1pub mod business_glossary_service {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::BusinessGlossaryService;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = BusinessGlossaryService;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
91 pub struct CreateGlossary(RequestBuilder<crate::model::CreateGlossaryRequest>);
92
93 impl CreateGlossary {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::CreateGlossaryRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
119 (*self.0.stub)
120 .create_glossary(self.0.request, self.0.options)
121 .await
122 .map(crate::Response::into_body)
123 }
124
125 pub fn poller(
127 self,
128 ) -> impl google_cloud_lro::Poller<crate::model::Glossary, crate::model::OperationMetadata>
129 {
130 type Operation = google_cloud_lro::internal::Operation<
131 crate::model::Glossary,
132 crate::model::OperationMetadata,
133 >;
134 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
135 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
136
137 let stub = self.0.stub.clone();
138 let mut options = self.0.options.clone();
139 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
140 let query = move |name| {
141 let stub = stub.clone();
142 let options = options.clone();
143 async {
144 let op = GetOperation::new(stub)
145 .set_name(name)
146 .with_options(options)
147 .send()
148 .await?;
149 Ok(Operation::new(op))
150 }
151 };
152
153 let start = move || async {
154 let op = self.send().await?;
155 Ok(Operation::new(op))
156 };
157
158 google_cloud_lro::internal::new_poller(
159 polling_error_policy,
160 polling_backoff_policy,
161 start,
162 query,
163 )
164 }
165
166 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.parent = v.into();
171 self
172 }
173
174 pub fn set_glossary_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
178 self.0.request.glossary_id = v.into();
179 self
180 }
181
182 pub fn set_glossary<T>(mut self, v: T) -> Self
186 where
187 T: std::convert::Into<crate::model::Glossary>,
188 {
189 self.0.request.glossary = std::option::Option::Some(v.into());
190 self
191 }
192
193 pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
197 where
198 T: std::convert::Into<crate::model::Glossary>,
199 {
200 self.0.request.glossary = v.map(|x| x.into());
201 self
202 }
203
204 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
206 self.0.request.validate_only = v.into();
207 self
208 }
209 }
210
211 #[doc(hidden)]
212 impl crate::RequestBuilder for CreateGlossary {
213 fn request_options(&mut self) -> &mut crate::RequestOptions {
214 &mut self.0.options
215 }
216 }
217
218 #[derive(Clone, Debug)]
236 pub struct UpdateGlossary(RequestBuilder<crate::model::UpdateGlossaryRequest>);
237
238 impl UpdateGlossary {
239 pub(crate) fn new(
240 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
241 ) -> Self {
242 Self(RequestBuilder::new(stub))
243 }
244
245 pub fn with_request<V: Into<crate::model::UpdateGlossaryRequest>>(mut self, v: V) -> Self {
247 self.0.request = v.into();
248 self
249 }
250
251 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
253 self.0.options = v.into();
254 self
255 }
256
257 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
264 (*self.0.stub)
265 .update_glossary(self.0.request, self.0.options)
266 .await
267 .map(crate::Response::into_body)
268 }
269
270 pub fn poller(
272 self,
273 ) -> impl google_cloud_lro::Poller<crate::model::Glossary, crate::model::OperationMetadata>
274 {
275 type Operation = google_cloud_lro::internal::Operation<
276 crate::model::Glossary,
277 crate::model::OperationMetadata,
278 >;
279 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
280 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
281
282 let stub = self.0.stub.clone();
283 let mut options = self.0.options.clone();
284 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
285 let query = move |name| {
286 let stub = stub.clone();
287 let options = options.clone();
288 async {
289 let op = GetOperation::new(stub)
290 .set_name(name)
291 .with_options(options)
292 .send()
293 .await?;
294 Ok(Operation::new(op))
295 }
296 };
297
298 let start = move || async {
299 let op = self.send().await?;
300 Ok(Operation::new(op))
301 };
302
303 google_cloud_lro::internal::new_poller(
304 polling_error_policy,
305 polling_backoff_policy,
306 start,
307 query,
308 )
309 }
310
311 pub fn set_glossary<T>(mut self, v: T) -> Self
315 where
316 T: std::convert::Into<crate::model::Glossary>,
317 {
318 self.0.request.glossary = std::option::Option::Some(v.into());
319 self
320 }
321
322 pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
326 where
327 T: std::convert::Into<crate::model::Glossary>,
328 {
329 self.0.request.glossary = v.map(|x| x.into());
330 self
331 }
332
333 pub fn set_update_mask<T>(mut self, v: T) -> Self
337 where
338 T: std::convert::Into<wkt::FieldMask>,
339 {
340 self.0.request.update_mask = std::option::Option::Some(v.into());
341 self
342 }
343
344 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
348 where
349 T: std::convert::Into<wkt::FieldMask>,
350 {
351 self.0.request.update_mask = v.map(|x| x.into());
352 self
353 }
354
355 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
357 self.0.request.validate_only = v.into();
358 self
359 }
360 }
361
362 #[doc(hidden)]
363 impl crate::RequestBuilder for UpdateGlossary {
364 fn request_options(&mut self) -> &mut crate::RequestOptions {
365 &mut self.0.options
366 }
367 }
368
369 #[derive(Clone, Debug)]
387 pub struct DeleteGlossary(RequestBuilder<crate::model::DeleteGlossaryRequest>);
388
389 impl DeleteGlossary {
390 pub(crate) fn new(
391 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
392 ) -> Self {
393 Self(RequestBuilder::new(stub))
394 }
395
396 pub fn with_request<V: Into<crate::model::DeleteGlossaryRequest>>(mut self, v: V) -> Self {
398 self.0.request = v.into();
399 self
400 }
401
402 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
404 self.0.options = v.into();
405 self
406 }
407
408 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
415 (*self.0.stub)
416 .delete_glossary(self.0.request, self.0.options)
417 .await
418 .map(crate::Response::into_body)
419 }
420
421 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
423 type Operation =
424 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
425 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
426 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
427
428 let stub = self.0.stub.clone();
429 let mut options = self.0.options.clone();
430 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
431 let query = move |name| {
432 let stub = stub.clone();
433 let options = options.clone();
434 async {
435 let op = GetOperation::new(stub)
436 .set_name(name)
437 .with_options(options)
438 .send()
439 .await?;
440 Ok(Operation::new(op))
441 }
442 };
443
444 let start = move || async {
445 let op = self.send().await?;
446 Ok(Operation::new(op))
447 };
448
449 google_cloud_lro::internal::new_unit_response_poller(
450 polling_error_policy,
451 polling_backoff_policy,
452 start,
453 query,
454 )
455 }
456
457 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
461 self.0.request.name = v.into();
462 self
463 }
464
465 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
467 self.0.request.etag = v.into();
468 self
469 }
470 }
471
472 #[doc(hidden)]
473 impl crate::RequestBuilder for DeleteGlossary {
474 fn request_options(&mut self) -> &mut crate::RequestOptions {
475 &mut self.0.options
476 }
477 }
478
479 #[derive(Clone, Debug)]
496 pub struct GetGlossary(RequestBuilder<crate::model::GetGlossaryRequest>);
497
498 impl GetGlossary {
499 pub(crate) fn new(
500 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
501 ) -> Self {
502 Self(RequestBuilder::new(stub))
503 }
504
505 pub fn with_request<V: Into<crate::model::GetGlossaryRequest>>(mut self, v: V) -> Self {
507 self.0.request = v.into();
508 self
509 }
510
511 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
513 self.0.options = v.into();
514 self
515 }
516
517 pub async fn send(self) -> Result<crate::model::Glossary> {
519 (*self.0.stub)
520 .get_glossary(self.0.request, self.0.options)
521 .await
522 .map(crate::Response::into_body)
523 }
524
525 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
529 self.0.request.name = v.into();
530 self
531 }
532 }
533
534 #[doc(hidden)]
535 impl crate::RequestBuilder for GetGlossary {
536 fn request_options(&mut self) -> &mut crate::RequestOptions {
537 &mut self.0.options
538 }
539 }
540
541 #[derive(Clone, Debug)]
562 pub struct ListGlossaries(RequestBuilder<crate::model::ListGlossariesRequest>);
563
564 impl ListGlossaries {
565 pub(crate) fn new(
566 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
567 ) -> Self {
568 Self(RequestBuilder::new(stub))
569 }
570
571 pub fn with_request<V: Into<crate::model::ListGlossariesRequest>>(mut self, v: V) -> Self {
573 self.0.request = v.into();
574 self
575 }
576
577 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
579 self.0.options = v.into();
580 self
581 }
582
583 pub async fn send(self) -> Result<crate::model::ListGlossariesResponse> {
585 (*self.0.stub)
586 .list_glossaries(self.0.request, self.0.options)
587 .await
588 .map(crate::Response::into_body)
589 }
590
591 pub fn by_page(
593 self,
594 ) -> impl google_cloud_gax::paginator::Paginator<
595 crate::model::ListGlossariesResponse,
596 crate::Error,
597 > {
598 use std::clone::Clone;
599 let token = self.0.request.page_token.clone();
600 let execute = move |token: String| {
601 let mut builder = self.clone();
602 builder.0.request = builder.0.request.set_page_token(token);
603 builder.send()
604 };
605 google_cloud_gax::paginator::internal::new_paginator(token, execute)
606 }
607
608 pub fn by_item(
610 self,
611 ) -> impl google_cloud_gax::paginator::ItemPaginator<
612 crate::model::ListGlossariesResponse,
613 crate::Error,
614 > {
615 use google_cloud_gax::paginator::Paginator;
616 self.by_page().items()
617 }
618
619 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
623 self.0.request.parent = v.into();
624 self
625 }
626
627 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
629 self.0.request.page_size = v.into();
630 self
631 }
632
633 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
635 self.0.request.page_token = v.into();
636 self
637 }
638
639 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
641 self.0.request.filter = v.into();
642 self
643 }
644
645 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
647 self.0.request.order_by = v.into();
648 self
649 }
650 }
651
652 #[doc(hidden)]
653 impl crate::RequestBuilder for ListGlossaries {
654 fn request_options(&mut self) -> &mut crate::RequestOptions {
655 &mut self.0.options
656 }
657 }
658
659 #[derive(Clone, Debug)]
676 pub struct CreateGlossaryCategory(RequestBuilder<crate::model::CreateGlossaryCategoryRequest>);
677
678 impl CreateGlossaryCategory {
679 pub(crate) fn new(
680 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
681 ) -> Self {
682 Self(RequestBuilder::new(stub))
683 }
684
685 pub fn with_request<V: Into<crate::model::CreateGlossaryCategoryRequest>>(
687 mut self,
688 v: V,
689 ) -> Self {
690 self.0.request = v.into();
691 self
692 }
693
694 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
696 self.0.options = v.into();
697 self
698 }
699
700 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
702 (*self.0.stub)
703 .create_glossary_category(self.0.request, self.0.options)
704 .await
705 .map(crate::Response::into_body)
706 }
707
708 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
712 self.0.request.parent = v.into();
713 self
714 }
715
716 pub fn set_category_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
720 self.0.request.category_id = v.into();
721 self
722 }
723
724 pub fn set_category<T>(mut self, v: T) -> Self
728 where
729 T: std::convert::Into<crate::model::GlossaryCategory>,
730 {
731 self.0.request.category = std::option::Option::Some(v.into());
732 self
733 }
734
735 pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
739 where
740 T: std::convert::Into<crate::model::GlossaryCategory>,
741 {
742 self.0.request.category = v.map(|x| x.into());
743 self
744 }
745 }
746
747 #[doc(hidden)]
748 impl crate::RequestBuilder for CreateGlossaryCategory {
749 fn request_options(&mut self) -> &mut crate::RequestOptions {
750 &mut self.0.options
751 }
752 }
753
754 #[derive(Clone, Debug)]
771 pub struct UpdateGlossaryCategory(RequestBuilder<crate::model::UpdateGlossaryCategoryRequest>);
772
773 impl UpdateGlossaryCategory {
774 pub(crate) fn new(
775 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
776 ) -> Self {
777 Self(RequestBuilder::new(stub))
778 }
779
780 pub fn with_request<V: Into<crate::model::UpdateGlossaryCategoryRequest>>(
782 mut self,
783 v: V,
784 ) -> Self {
785 self.0.request = v.into();
786 self
787 }
788
789 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
791 self.0.options = v.into();
792 self
793 }
794
795 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
797 (*self.0.stub)
798 .update_glossary_category(self.0.request, self.0.options)
799 .await
800 .map(crate::Response::into_body)
801 }
802
803 pub fn set_category<T>(mut self, v: T) -> Self
807 where
808 T: std::convert::Into<crate::model::GlossaryCategory>,
809 {
810 self.0.request.category = std::option::Option::Some(v.into());
811 self
812 }
813
814 pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
818 where
819 T: std::convert::Into<crate::model::GlossaryCategory>,
820 {
821 self.0.request.category = v.map(|x| x.into());
822 self
823 }
824
825 pub fn set_update_mask<T>(mut self, v: T) -> Self
829 where
830 T: std::convert::Into<wkt::FieldMask>,
831 {
832 self.0.request.update_mask = std::option::Option::Some(v.into());
833 self
834 }
835
836 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
840 where
841 T: std::convert::Into<wkt::FieldMask>,
842 {
843 self.0.request.update_mask = v.map(|x| x.into());
844 self
845 }
846 }
847
848 #[doc(hidden)]
849 impl crate::RequestBuilder for UpdateGlossaryCategory {
850 fn request_options(&mut self) -> &mut crate::RequestOptions {
851 &mut self.0.options
852 }
853 }
854
855 #[derive(Clone, Debug)]
872 pub struct DeleteGlossaryCategory(RequestBuilder<crate::model::DeleteGlossaryCategoryRequest>);
873
874 impl DeleteGlossaryCategory {
875 pub(crate) fn new(
876 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
877 ) -> Self {
878 Self(RequestBuilder::new(stub))
879 }
880
881 pub fn with_request<V: Into<crate::model::DeleteGlossaryCategoryRequest>>(
883 mut self,
884 v: V,
885 ) -> Self {
886 self.0.request = v.into();
887 self
888 }
889
890 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
892 self.0.options = v.into();
893 self
894 }
895
896 pub async fn send(self) -> Result<()> {
898 (*self.0.stub)
899 .delete_glossary_category(self.0.request, self.0.options)
900 .await
901 .map(crate::Response::into_body)
902 }
903
904 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
908 self.0.request.name = v.into();
909 self
910 }
911 }
912
913 #[doc(hidden)]
914 impl crate::RequestBuilder for DeleteGlossaryCategory {
915 fn request_options(&mut self) -> &mut crate::RequestOptions {
916 &mut self.0.options
917 }
918 }
919
920 #[derive(Clone, Debug)]
937 pub struct GetGlossaryCategory(RequestBuilder<crate::model::GetGlossaryCategoryRequest>);
938
939 impl GetGlossaryCategory {
940 pub(crate) fn new(
941 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
942 ) -> Self {
943 Self(RequestBuilder::new(stub))
944 }
945
946 pub fn with_request<V: Into<crate::model::GetGlossaryCategoryRequest>>(
948 mut self,
949 v: V,
950 ) -> Self {
951 self.0.request = v.into();
952 self
953 }
954
955 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
957 self.0.options = v.into();
958 self
959 }
960
961 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
963 (*self.0.stub)
964 .get_glossary_category(self.0.request, self.0.options)
965 .await
966 .map(crate::Response::into_body)
967 }
968
969 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
973 self.0.request.name = v.into();
974 self
975 }
976 }
977
978 #[doc(hidden)]
979 impl crate::RequestBuilder for GetGlossaryCategory {
980 fn request_options(&mut self) -> &mut crate::RequestOptions {
981 &mut self.0.options
982 }
983 }
984
985 #[derive(Clone, Debug)]
1006 pub struct ListGlossaryCategories(RequestBuilder<crate::model::ListGlossaryCategoriesRequest>);
1007
1008 impl ListGlossaryCategories {
1009 pub(crate) fn new(
1010 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1011 ) -> Self {
1012 Self(RequestBuilder::new(stub))
1013 }
1014
1015 pub fn with_request<V: Into<crate::model::ListGlossaryCategoriesRequest>>(
1017 mut self,
1018 v: V,
1019 ) -> Self {
1020 self.0.request = v.into();
1021 self
1022 }
1023
1024 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1026 self.0.options = v.into();
1027 self
1028 }
1029
1030 pub async fn send(self) -> Result<crate::model::ListGlossaryCategoriesResponse> {
1032 (*self.0.stub)
1033 .list_glossary_categories(self.0.request, self.0.options)
1034 .await
1035 .map(crate::Response::into_body)
1036 }
1037
1038 pub fn by_page(
1040 self,
1041 ) -> impl google_cloud_gax::paginator::Paginator<
1042 crate::model::ListGlossaryCategoriesResponse,
1043 crate::Error,
1044 > {
1045 use std::clone::Clone;
1046 let token = self.0.request.page_token.clone();
1047 let execute = move |token: String| {
1048 let mut builder = self.clone();
1049 builder.0.request = builder.0.request.set_page_token(token);
1050 builder.send()
1051 };
1052 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1053 }
1054
1055 pub fn by_item(
1057 self,
1058 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1059 crate::model::ListGlossaryCategoriesResponse,
1060 crate::Error,
1061 > {
1062 use google_cloud_gax::paginator::Paginator;
1063 self.by_page().items()
1064 }
1065
1066 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1070 self.0.request.parent = v.into();
1071 self
1072 }
1073
1074 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1076 self.0.request.page_size = v.into();
1077 self
1078 }
1079
1080 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1082 self.0.request.page_token = v.into();
1083 self
1084 }
1085
1086 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1088 self.0.request.filter = v.into();
1089 self
1090 }
1091
1092 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1094 self.0.request.order_by = v.into();
1095 self
1096 }
1097 }
1098
1099 #[doc(hidden)]
1100 impl crate::RequestBuilder for ListGlossaryCategories {
1101 fn request_options(&mut self) -> &mut crate::RequestOptions {
1102 &mut self.0.options
1103 }
1104 }
1105
1106 #[derive(Clone, Debug)]
1123 pub struct CreateGlossaryTerm(RequestBuilder<crate::model::CreateGlossaryTermRequest>);
1124
1125 impl CreateGlossaryTerm {
1126 pub(crate) fn new(
1127 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1128 ) -> Self {
1129 Self(RequestBuilder::new(stub))
1130 }
1131
1132 pub fn with_request<V: Into<crate::model::CreateGlossaryTermRequest>>(
1134 mut self,
1135 v: V,
1136 ) -> Self {
1137 self.0.request = v.into();
1138 self
1139 }
1140
1141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1143 self.0.options = v.into();
1144 self
1145 }
1146
1147 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1149 (*self.0.stub)
1150 .create_glossary_term(self.0.request, self.0.options)
1151 .await
1152 .map(crate::Response::into_body)
1153 }
1154
1155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1159 self.0.request.parent = v.into();
1160 self
1161 }
1162
1163 pub fn set_term_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1167 self.0.request.term_id = v.into();
1168 self
1169 }
1170
1171 pub fn set_term<T>(mut self, v: T) -> Self
1175 where
1176 T: std::convert::Into<crate::model::GlossaryTerm>,
1177 {
1178 self.0.request.term = std::option::Option::Some(v.into());
1179 self
1180 }
1181
1182 pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
1186 where
1187 T: std::convert::Into<crate::model::GlossaryTerm>,
1188 {
1189 self.0.request.term = v.map(|x| x.into());
1190 self
1191 }
1192 }
1193
1194 #[doc(hidden)]
1195 impl crate::RequestBuilder for CreateGlossaryTerm {
1196 fn request_options(&mut self) -> &mut crate::RequestOptions {
1197 &mut self.0.options
1198 }
1199 }
1200
1201 #[derive(Clone, Debug)]
1218 pub struct UpdateGlossaryTerm(RequestBuilder<crate::model::UpdateGlossaryTermRequest>);
1219
1220 impl UpdateGlossaryTerm {
1221 pub(crate) fn new(
1222 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1223 ) -> Self {
1224 Self(RequestBuilder::new(stub))
1225 }
1226
1227 pub fn with_request<V: Into<crate::model::UpdateGlossaryTermRequest>>(
1229 mut self,
1230 v: V,
1231 ) -> Self {
1232 self.0.request = v.into();
1233 self
1234 }
1235
1236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1238 self.0.options = v.into();
1239 self
1240 }
1241
1242 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1244 (*self.0.stub)
1245 .update_glossary_term(self.0.request, self.0.options)
1246 .await
1247 .map(crate::Response::into_body)
1248 }
1249
1250 pub fn set_term<T>(mut self, v: T) -> Self
1254 where
1255 T: std::convert::Into<crate::model::GlossaryTerm>,
1256 {
1257 self.0.request.term = std::option::Option::Some(v.into());
1258 self
1259 }
1260
1261 pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
1265 where
1266 T: std::convert::Into<crate::model::GlossaryTerm>,
1267 {
1268 self.0.request.term = v.map(|x| x.into());
1269 self
1270 }
1271
1272 pub fn set_update_mask<T>(mut self, v: T) -> Self
1276 where
1277 T: std::convert::Into<wkt::FieldMask>,
1278 {
1279 self.0.request.update_mask = std::option::Option::Some(v.into());
1280 self
1281 }
1282
1283 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1287 where
1288 T: std::convert::Into<wkt::FieldMask>,
1289 {
1290 self.0.request.update_mask = v.map(|x| x.into());
1291 self
1292 }
1293 }
1294
1295 #[doc(hidden)]
1296 impl crate::RequestBuilder for UpdateGlossaryTerm {
1297 fn request_options(&mut self) -> &mut crate::RequestOptions {
1298 &mut self.0.options
1299 }
1300 }
1301
1302 #[derive(Clone, Debug)]
1319 pub struct DeleteGlossaryTerm(RequestBuilder<crate::model::DeleteGlossaryTermRequest>);
1320
1321 impl DeleteGlossaryTerm {
1322 pub(crate) fn new(
1323 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1324 ) -> Self {
1325 Self(RequestBuilder::new(stub))
1326 }
1327
1328 pub fn with_request<V: Into<crate::model::DeleteGlossaryTermRequest>>(
1330 mut self,
1331 v: V,
1332 ) -> Self {
1333 self.0.request = v.into();
1334 self
1335 }
1336
1337 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1339 self.0.options = v.into();
1340 self
1341 }
1342
1343 pub async fn send(self) -> Result<()> {
1345 (*self.0.stub)
1346 .delete_glossary_term(self.0.request, self.0.options)
1347 .await
1348 .map(crate::Response::into_body)
1349 }
1350
1351 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1355 self.0.request.name = v.into();
1356 self
1357 }
1358 }
1359
1360 #[doc(hidden)]
1361 impl crate::RequestBuilder for DeleteGlossaryTerm {
1362 fn request_options(&mut self) -> &mut crate::RequestOptions {
1363 &mut self.0.options
1364 }
1365 }
1366
1367 #[derive(Clone, Debug)]
1384 pub struct GetGlossaryTerm(RequestBuilder<crate::model::GetGlossaryTermRequest>);
1385
1386 impl GetGlossaryTerm {
1387 pub(crate) fn new(
1388 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1389 ) -> Self {
1390 Self(RequestBuilder::new(stub))
1391 }
1392
1393 pub fn with_request<V: Into<crate::model::GetGlossaryTermRequest>>(mut self, v: V) -> Self {
1395 self.0.request = v.into();
1396 self
1397 }
1398
1399 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1401 self.0.options = v.into();
1402 self
1403 }
1404
1405 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1407 (*self.0.stub)
1408 .get_glossary_term(self.0.request, self.0.options)
1409 .await
1410 .map(crate::Response::into_body)
1411 }
1412
1413 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1417 self.0.request.name = v.into();
1418 self
1419 }
1420 }
1421
1422 #[doc(hidden)]
1423 impl crate::RequestBuilder for GetGlossaryTerm {
1424 fn request_options(&mut self) -> &mut crate::RequestOptions {
1425 &mut self.0.options
1426 }
1427 }
1428
1429 #[derive(Clone, Debug)]
1450 pub struct ListGlossaryTerms(RequestBuilder<crate::model::ListGlossaryTermsRequest>);
1451
1452 impl ListGlossaryTerms {
1453 pub(crate) fn new(
1454 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1455 ) -> Self {
1456 Self(RequestBuilder::new(stub))
1457 }
1458
1459 pub fn with_request<V: Into<crate::model::ListGlossaryTermsRequest>>(
1461 mut self,
1462 v: V,
1463 ) -> Self {
1464 self.0.request = v.into();
1465 self
1466 }
1467
1468 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1470 self.0.options = v.into();
1471 self
1472 }
1473
1474 pub async fn send(self) -> Result<crate::model::ListGlossaryTermsResponse> {
1476 (*self.0.stub)
1477 .list_glossary_terms(self.0.request, self.0.options)
1478 .await
1479 .map(crate::Response::into_body)
1480 }
1481
1482 pub fn by_page(
1484 self,
1485 ) -> impl google_cloud_gax::paginator::Paginator<
1486 crate::model::ListGlossaryTermsResponse,
1487 crate::Error,
1488 > {
1489 use std::clone::Clone;
1490 let token = self.0.request.page_token.clone();
1491 let execute = move |token: String| {
1492 let mut builder = self.clone();
1493 builder.0.request = builder.0.request.set_page_token(token);
1494 builder.send()
1495 };
1496 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1497 }
1498
1499 pub fn by_item(
1501 self,
1502 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1503 crate::model::ListGlossaryTermsResponse,
1504 crate::Error,
1505 > {
1506 use google_cloud_gax::paginator::Paginator;
1507 self.by_page().items()
1508 }
1509
1510 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1514 self.0.request.parent = v.into();
1515 self
1516 }
1517
1518 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1520 self.0.request.page_size = v.into();
1521 self
1522 }
1523
1524 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1526 self.0.request.page_token = v.into();
1527 self
1528 }
1529
1530 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1532 self.0.request.filter = v.into();
1533 self
1534 }
1535
1536 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1538 self.0.request.order_by = v.into();
1539 self
1540 }
1541 }
1542
1543 #[doc(hidden)]
1544 impl crate::RequestBuilder for ListGlossaryTerms {
1545 fn request_options(&mut self) -> &mut crate::RequestOptions {
1546 &mut self.0.options
1547 }
1548 }
1549
1550 #[derive(Clone, Debug)]
1571 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1572
1573 impl ListLocations {
1574 pub(crate) fn new(
1575 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1576 ) -> Self {
1577 Self(RequestBuilder::new(stub))
1578 }
1579
1580 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1582 mut self,
1583 v: V,
1584 ) -> Self {
1585 self.0.request = v.into();
1586 self
1587 }
1588
1589 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1591 self.0.options = v.into();
1592 self
1593 }
1594
1595 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1597 (*self.0.stub)
1598 .list_locations(self.0.request, self.0.options)
1599 .await
1600 .map(crate::Response::into_body)
1601 }
1602
1603 pub fn by_page(
1605 self,
1606 ) -> impl google_cloud_gax::paginator::Paginator<
1607 google_cloud_location::model::ListLocationsResponse,
1608 crate::Error,
1609 > {
1610 use std::clone::Clone;
1611 let token = self.0.request.page_token.clone();
1612 let execute = move |token: String| {
1613 let mut builder = self.clone();
1614 builder.0.request = builder.0.request.set_page_token(token);
1615 builder.send()
1616 };
1617 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1618 }
1619
1620 pub fn by_item(
1622 self,
1623 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1624 google_cloud_location::model::ListLocationsResponse,
1625 crate::Error,
1626 > {
1627 use google_cloud_gax::paginator::Paginator;
1628 self.by_page().items()
1629 }
1630
1631 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1633 self.0.request.name = v.into();
1634 self
1635 }
1636
1637 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1639 self.0.request.filter = v.into();
1640 self
1641 }
1642
1643 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1645 self.0.request.page_size = v.into();
1646 self
1647 }
1648
1649 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1651 self.0.request.page_token = v.into();
1652 self
1653 }
1654 }
1655
1656 #[doc(hidden)]
1657 impl crate::RequestBuilder for ListLocations {
1658 fn request_options(&mut self) -> &mut crate::RequestOptions {
1659 &mut self.0.options
1660 }
1661 }
1662
1663 #[derive(Clone, Debug)]
1680 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1681
1682 impl GetLocation {
1683 pub(crate) fn new(
1684 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1685 ) -> Self {
1686 Self(RequestBuilder::new(stub))
1687 }
1688
1689 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1691 mut self,
1692 v: V,
1693 ) -> Self {
1694 self.0.request = v.into();
1695 self
1696 }
1697
1698 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1700 self.0.options = v.into();
1701 self
1702 }
1703
1704 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1706 (*self.0.stub)
1707 .get_location(self.0.request, self.0.options)
1708 .await
1709 .map(crate::Response::into_body)
1710 }
1711
1712 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1714 self.0.request.name = v.into();
1715 self
1716 }
1717 }
1718
1719 #[doc(hidden)]
1720 impl crate::RequestBuilder for GetLocation {
1721 fn request_options(&mut self) -> &mut crate::RequestOptions {
1722 &mut self.0.options
1723 }
1724 }
1725
1726 #[derive(Clone, Debug)]
1743 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1744
1745 impl SetIamPolicy {
1746 pub(crate) fn new(
1747 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1748 ) -> Self {
1749 Self(RequestBuilder::new(stub))
1750 }
1751
1752 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1754 mut self,
1755 v: V,
1756 ) -> Self {
1757 self.0.request = v.into();
1758 self
1759 }
1760
1761 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1763 self.0.options = v.into();
1764 self
1765 }
1766
1767 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1769 (*self.0.stub)
1770 .set_iam_policy(self.0.request, self.0.options)
1771 .await
1772 .map(crate::Response::into_body)
1773 }
1774
1775 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1779 self.0.request.resource = v.into();
1780 self
1781 }
1782
1783 pub fn set_policy<T>(mut self, v: T) -> Self
1787 where
1788 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1789 {
1790 self.0.request.policy = std::option::Option::Some(v.into());
1791 self
1792 }
1793
1794 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1798 where
1799 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1800 {
1801 self.0.request.policy = v.map(|x| x.into());
1802 self
1803 }
1804
1805 pub fn set_update_mask<T>(mut self, v: T) -> Self
1807 where
1808 T: std::convert::Into<wkt::FieldMask>,
1809 {
1810 self.0.request.update_mask = std::option::Option::Some(v.into());
1811 self
1812 }
1813
1814 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1816 where
1817 T: std::convert::Into<wkt::FieldMask>,
1818 {
1819 self.0.request.update_mask = v.map(|x| x.into());
1820 self
1821 }
1822 }
1823
1824 #[doc(hidden)]
1825 impl crate::RequestBuilder for SetIamPolicy {
1826 fn request_options(&mut self) -> &mut crate::RequestOptions {
1827 &mut self.0.options
1828 }
1829 }
1830
1831 #[derive(Clone, Debug)]
1848 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1849
1850 impl GetIamPolicy {
1851 pub(crate) fn new(
1852 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1853 ) -> Self {
1854 Self(RequestBuilder::new(stub))
1855 }
1856
1857 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1859 mut self,
1860 v: V,
1861 ) -> Self {
1862 self.0.request = v.into();
1863 self
1864 }
1865
1866 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1868 self.0.options = v.into();
1869 self
1870 }
1871
1872 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1874 (*self.0.stub)
1875 .get_iam_policy(self.0.request, self.0.options)
1876 .await
1877 .map(crate::Response::into_body)
1878 }
1879
1880 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1884 self.0.request.resource = v.into();
1885 self
1886 }
1887
1888 pub fn set_options<T>(mut self, v: T) -> Self
1890 where
1891 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1892 {
1893 self.0.request.options = std::option::Option::Some(v.into());
1894 self
1895 }
1896
1897 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1899 where
1900 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1901 {
1902 self.0.request.options = v.map(|x| x.into());
1903 self
1904 }
1905 }
1906
1907 #[doc(hidden)]
1908 impl crate::RequestBuilder for GetIamPolicy {
1909 fn request_options(&mut self) -> &mut crate::RequestOptions {
1910 &mut self.0.options
1911 }
1912 }
1913
1914 #[derive(Clone, Debug)]
1931 pub struct TestIamPermissions(
1932 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1933 );
1934
1935 impl TestIamPermissions {
1936 pub(crate) fn new(
1937 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1938 ) -> Self {
1939 Self(RequestBuilder::new(stub))
1940 }
1941
1942 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1944 mut self,
1945 v: V,
1946 ) -> Self {
1947 self.0.request = v.into();
1948 self
1949 }
1950
1951 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1953 self.0.options = v.into();
1954 self
1955 }
1956
1957 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1959 (*self.0.stub)
1960 .test_iam_permissions(self.0.request, self.0.options)
1961 .await
1962 .map(crate::Response::into_body)
1963 }
1964
1965 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1969 self.0.request.resource = v.into();
1970 self
1971 }
1972
1973 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1977 where
1978 T: std::iter::IntoIterator<Item = V>,
1979 V: std::convert::Into<std::string::String>,
1980 {
1981 use std::iter::Iterator;
1982 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1983 self
1984 }
1985 }
1986
1987 #[doc(hidden)]
1988 impl crate::RequestBuilder for TestIamPermissions {
1989 fn request_options(&mut self) -> &mut crate::RequestOptions {
1990 &mut self.0.options
1991 }
1992 }
1993
1994 #[derive(Clone, Debug)]
2015 pub struct ListOperations(
2016 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2017 );
2018
2019 impl ListOperations {
2020 pub(crate) fn new(
2021 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2022 ) -> Self {
2023 Self(RequestBuilder::new(stub))
2024 }
2025
2026 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2028 mut self,
2029 v: V,
2030 ) -> Self {
2031 self.0.request = v.into();
2032 self
2033 }
2034
2035 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2037 self.0.options = v.into();
2038 self
2039 }
2040
2041 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2043 (*self.0.stub)
2044 .list_operations(self.0.request, self.0.options)
2045 .await
2046 .map(crate::Response::into_body)
2047 }
2048
2049 pub fn by_page(
2051 self,
2052 ) -> impl google_cloud_gax::paginator::Paginator<
2053 google_cloud_longrunning::model::ListOperationsResponse,
2054 crate::Error,
2055 > {
2056 use std::clone::Clone;
2057 let token = self.0.request.page_token.clone();
2058 let execute = move |token: String| {
2059 let mut builder = self.clone();
2060 builder.0.request = builder.0.request.set_page_token(token);
2061 builder.send()
2062 };
2063 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2064 }
2065
2066 pub fn by_item(
2068 self,
2069 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2070 google_cloud_longrunning::model::ListOperationsResponse,
2071 crate::Error,
2072 > {
2073 use google_cloud_gax::paginator::Paginator;
2074 self.by_page().items()
2075 }
2076
2077 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2079 self.0.request.name = v.into();
2080 self
2081 }
2082
2083 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2085 self.0.request.filter = v.into();
2086 self
2087 }
2088
2089 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2091 self.0.request.page_size = v.into();
2092 self
2093 }
2094
2095 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2097 self.0.request.page_token = v.into();
2098 self
2099 }
2100
2101 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2103 self.0.request.return_partial_success = v.into();
2104 self
2105 }
2106 }
2107
2108 #[doc(hidden)]
2109 impl crate::RequestBuilder for ListOperations {
2110 fn request_options(&mut self) -> &mut crate::RequestOptions {
2111 &mut self.0.options
2112 }
2113 }
2114
2115 #[derive(Clone, Debug)]
2132 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2133
2134 impl GetOperation {
2135 pub(crate) fn new(
2136 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2137 ) -> Self {
2138 Self(RequestBuilder::new(stub))
2139 }
2140
2141 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2143 mut self,
2144 v: V,
2145 ) -> Self {
2146 self.0.request = v.into();
2147 self
2148 }
2149
2150 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2152 self.0.options = v.into();
2153 self
2154 }
2155
2156 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2158 (*self.0.stub)
2159 .get_operation(self.0.request, self.0.options)
2160 .await
2161 .map(crate::Response::into_body)
2162 }
2163
2164 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2166 self.0.request.name = v.into();
2167 self
2168 }
2169 }
2170
2171 #[doc(hidden)]
2172 impl crate::RequestBuilder for GetOperation {
2173 fn request_options(&mut self) -> &mut crate::RequestOptions {
2174 &mut self.0.options
2175 }
2176 }
2177
2178 #[derive(Clone, Debug)]
2195 pub struct DeleteOperation(
2196 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2197 );
2198
2199 impl DeleteOperation {
2200 pub(crate) fn new(
2201 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2202 ) -> Self {
2203 Self(RequestBuilder::new(stub))
2204 }
2205
2206 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2208 mut self,
2209 v: V,
2210 ) -> Self {
2211 self.0.request = v.into();
2212 self
2213 }
2214
2215 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2217 self.0.options = v.into();
2218 self
2219 }
2220
2221 pub async fn send(self) -> Result<()> {
2223 (*self.0.stub)
2224 .delete_operation(self.0.request, self.0.options)
2225 .await
2226 .map(crate::Response::into_body)
2227 }
2228
2229 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2231 self.0.request.name = v.into();
2232 self
2233 }
2234 }
2235
2236 #[doc(hidden)]
2237 impl crate::RequestBuilder for DeleteOperation {
2238 fn request_options(&mut self) -> &mut crate::RequestOptions {
2239 &mut self.0.options
2240 }
2241 }
2242
2243 #[derive(Clone, Debug)]
2260 pub struct CancelOperation(
2261 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2262 );
2263
2264 impl CancelOperation {
2265 pub(crate) fn new(
2266 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2267 ) -> Self {
2268 Self(RequestBuilder::new(stub))
2269 }
2270
2271 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2273 mut self,
2274 v: V,
2275 ) -> Self {
2276 self.0.request = v.into();
2277 self
2278 }
2279
2280 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2282 self.0.options = v.into();
2283 self
2284 }
2285
2286 pub async fn send(self) -> Result<()> {
2288 (*self.0.stub)
2289 .cancel_operation(self.0.request, self.0.options)
2290 .await
2291 .map(crate::Response::into_body)
2292 }
2293
2294 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2296 self.0.request.name = v.into();
2297 self
2298 }
2299 }
2300
2301 #[doc(hidden)]
2302 impl crate::RequestBuilder for CancelOperation {
2303 fn request_options(&mut self) -> &mut crate::RequestOptions {
2304 &mut self.0.options
2305 }
2306 }
2307}
2308
2309pub mod catalog_service {
2310 use crate::Result;
2311
2312 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2326
2327 pub(crate) mod client {
2328 use super::super::super::client::CatalogService;
2329 pub struct Factory;
2330 impl crate::ClientFactory for Factory {
2331 type Client = CatalogService;
2332 type Credentials = gaxi::options::Credentials;
2333 async fn build(
2334 self,
2335 config: gaxi::options::ClientConfig,
2336 ) -> crate::ClientBuilderResult<Self::Client> {
2337 Self::Client::new(config).await
2338 }
2339 }
2340 }
2341
2342 #[derive(Clone, Debug)]
2344 pub(crate) struct RequestBuilder<R: std::default::Default> {
2345 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2346 request: R,
2347 options: crate::RequestOptions,
2348 }
2349
2350 impl<R> RequestBuilder<R>
2351 where
2352 R: std::default::Default,
2353 {
2354 pub(crate) fn new(
2355 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2356 ) -> Self {
2357 Self {
2358 stub,
2359 request: R::default(),
2360 options: crate::RequestOptions::default(),
2361 }
2362 }
2363 }
2364
2365 #[derive(Clone, Debug)]
2383 pub struct CreateEntryType(RequestBuilder<crate::model::CreateEntryTypeRequest>);
2384
2385 impl CreateEntryType {
2386 pub(crate) fn new(
2387 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2388 ) -> Self {
2389 Self(RequestBuilder::new(stub))
2390 }
2391
2392 pub fn with_request<V: Into<crate::model::CreateEntryTypeRequest>>(mut self, v: V) -> Self {
2394 self.0.request = v.into();
2395 self
2396 }
2397
2398 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2400 self.0.options = v.into();
2401 self
2402 }
2403
2404 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2411 (*self.0.stub)
2412 .create_entry_type(self.0.request, self.0.options)
2413 .await
2414 .map(crate::Response::into_body)
2415 }
2416
2417 pub fn poller(
2419 self,
2420 ) -> impl google_cloud_lro::Poller<crate::model::EntryType, crate::model::OperationMetadata>
2421 {
2422 type Operation = google_cloud_lro::internal::Operation<
2423 crate::model::EntryType,
2424 crate::model::OperationMetadata,
2425 >;
2426 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2427 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2428
2429 let stub = self.0.stub.clone();
2430 let mut options = self.0.options.clone();
2431 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2432 let query = move |name| {
2433 let stub = stub.clone();
2434 let options = options.clone();
2435 async {
2436 let op = GetOperation::new(stub)
2437 .set_name(name)
2438 .with_options(options)
2439 .send()
2440 .await?;
2441 Ok(Operation::new(op))
2442 }
2443 };
2444
2445 let start = move || async {
2446 let op = self.send().await?;
2447 Ok(Operation::new(op))
2448 };
2449
2450 google_cloud_lro::internal::new_poller(
2451 polling_error_policy,
2452 polling_backoff_policy,
2453 start,
2454 query,
2455 )
2456 }
2457
2458 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2462 self.0.request.parent = v.into();
2463 self
2464 }
2465
2466 pub fn set_entry_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2470 self.0.request.entry_type_id = v.into();
2471 self
2472 }
2473
2474 pub fn set_entry_type<T>(mut self, v: T) -> Self
2478 where
2479 T: std::convert::Into<crate::model::EntryType>,
2480 {
2481 self.0.request.entry_type = std::option::Option::Some(v.into());
2482 self
2483 }
2484
2485 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
2489 where
2490 T: std::convert::Into<crate::model::EntryType>,
2491 {
2492 self.0.request.entry_type = v.map(|x| x.into());
2493 self
2494 }
2495
2496 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2498 self.0.request.validate_only = v.into();
2499 self
2500 }
2501 }
2502
2503 #[doc(hidden)]
2504 impl crate::RequestBuilder for CreateEntryType {
2505 fn request_options(&mut self) -> &mut crate::RequestOptions {
2506 &mut self.0.options
2507 }
2508 }
2509
2510 #[derive(Clone, Debug)]
2528 pub struct UpdateEntryType(RequestBuilder<crate::model::UpdateEntryTypeRequest>);
2529
2530 impl UpdateEntryType {
2531 pub(crate) fn new(
2532 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2533 ) -> Self {
2534 Self(RequestBuilder::new(stub))
2535 }
2536
2537 pub fn with_request<V: Into<crate::model::UpdateEntryTypeRequest>>(mut self, v: V) -> Self {
2539 self.0.request = v.into();
2540 self
2541 }
2542
2543 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2545 self.0.options = v.into();
2546 self
2547 }
2548
2549 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2556 (*self.0.stub)
2557 .update_entry_type(self.0.request, self.0.options)
2558 .await
2559 .map(crate::Response::into_body)
2560 }
2561
2562 pub fn poller(
2564 self,
2565 ) -> impl google_cloud_lro::Poller<crate::model::EntryType, crate::model::OperationMetadata>
2566 {
2567 type Operation = google_cloud_lro::internal::Operation<
2568 crate::model::EntryType,
2569 crate::model::OperationMetadata,
2570 >;
2571 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2572 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2573
2574 let stub = self.0.stub.clone();
2575 let mut options = self.0.options.clone();
2576 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2577 let query = move |name| {
2578 let stub = stub.clone();
2579 let options = options.clone();
2580 async {
2581 let op = GetOperation::new(stub)
2582 .set_name(name)
2583 .with_options(options)
2584 .send()
2585 .await?;
2586 Ok(Operation::new(op))
2587 }
2588 };
2589
2590 let start = move || async {
2591 let op = self.send().await?;
2592 Ok(Operation::new(op))
2593 };
2594
2595 google_cloud_lro::internal::new_poller(
2596 polling_error_policy,
2597 polling_backoff_policy,
2598 start,
2599 query,
2600 )
2601 }
2602
2603 pub fn set_entry_type<T>(mut self, v: T) -> Self
2607 where
2608 T: std::convert::Into<crate::model::EntryType>,
2609 {
2610 self.0.request.entry_type = std::option::Option::Some(v.into());
2611 self
2612 }
2613
2614 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
2618 where
2619 T: std::convert::Into<crate::model::EntryType>,
2620 {
2621 self.0.request.entry_type = v.map(|x| x.into());
2622 self
2623 }
2624
2625 pub fn set_update_mask<T>(mut self, v: T) -> Self
2629 where
2630 T: std::convert::Into<wkt::FieldMask>,
2631 {
2632 self.0.request.update_mask = std::option::Option::Some(v.into());
2633 self
2634 }
2635
2636 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2640 where
2641 T: std::convert::Into<wkt::FieldMask>,
2642 {
2643 self.0.request.update_mask = v.map(|x| x.into());
2644 self
2645 }
2646
2647 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2649 self.0.request.validate_only = v.into();
2650 self
2651 }
2652 }
2653
2654 #[doc(hidden)]
2655 impl crate::RequestBuilder for UpdateEntryType {
2656 fn request_options(&mut self) -> &mut crate::RequestOptions {
2657 &mut self.0.options
2658 }
2659 }
2660
2661 #[derive(Clone, Debug)]
2679 pub struct DeleteEntryType(RequestBuilder<crate::model::DeleteEntryTypeRequest>);
2680
2681 impl DeleteEntryType {
2682 pub(crate) fn new(
2683 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2684 ) -> Self {
2685 Self(RequestBuilder::new(stub))
2686 }
2687
2688 pub fn with_request<V: Into<crate::model::DeleteEntryTypeRequest>>(mut self, v: V) -> Self {
2690 self.0.request = v.into();
2691 self
2692 }
2693
2694 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2696 self.0.options = v.into();
2697 self
2698 }
2699
2700 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2707 (*self.0.stub)
2708 .delete_entry_type(self.0.request, self.0.options)
2709 .await
2710 .map(crate::Response::into_body)
2711 }
2712
2713 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2715 type Operation =
2716 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2717 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2718 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2719
2720 let stub = self.0.stub.clone();
2721 let mut options = self.0.options.clone();
2722 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2723 let query = move |name| {
2724 let stub = stub.clone();
2725 let options = options.clone();
2726 async {
2727 let op = GetOperation::new(stub)
2728 .set_name(name)
2729 .with_options(options)
2730 .send()
2731 .await?;
2732 Ok(Operation::new(op))
2733 }
2734 };
2735
2736 let start = move || async {
2737 let op = self.send().await?;
2738 Ok(Operation::new(op))
2739 };
2740
2741 google_cloud_lro::internal::new_unit_response_poller(
2742 polling_error_policy,
2743 polling_backoff_policy,
2744 start,
2745 query,
2746 )
2747 }
2748
2749 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2753 self.0.request.name = v.into();
2754 self
2755 }
2756
2757 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2759 self.0.request.etag = v.into();
2760 self
2761 }
2762 }
2763
2764 #[doc(hidden)]
2765 impl crate::RequestBuilder for DeleteEntryType {
2766 fn request_options(&mut self) -> &mut crate::RequestOptions {
2767 &mut self.0.options
2768 }
2769 }
2770
2771 #[derive(Clone, Debug)]
2792 pub struct ListEntryTypes(RequestBuilder<crate::model::ListEntryTypesRequest>);
2793
2794 impl ListEntryTypes {
2795 pub(crate) fn new(
2796 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2797 ) -> Self {
2798 Self(RequestBuilder::new(stub))
2799 }
2800
2801 pub fn with_request<V: Into<crate::model::ListEntryTypesRequest>>(mut self, v: V) -> Self {
2803 self.0.request = v.into();
2804 self
2805 }
2806
2807 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2809 self.0.options = v.into();
2810 self
2811 }
2812
2813 pub async fn send(self) -> Result<crate::model::ListEntryTypesResponse> {
2815 (*self.0.stub)
2816 .list_entry_types(self.0.request, self.0.options)
2817 .await
2818 .map(crate::Response::into_body)
2819 }
2820
2821 pub fn by_page(
2823 self,
2824 ) -> impl google_cloud_gax::paginator::Paginator<
2825 crate::model::ListEntryTypesResponse,
2826 crate::Error,
2827 > {
2828 use std::clone::Clone;
2829 let token = self.0.request.page_token.clone();
2830 let execute = move |token: String| {
2831 let mut builder = self.clone();
2832 builder.0.request = builder.0.request.set_page_token(token);
2833 builder.send()
2834 };
2835 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2836 }
2837
2838 pub fn by_item(
2840 self,
2841 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2842 crate::model::ListEntryTypesResponse,
2843 crate::Error,
2844 > {
2845 use google_cloud_gax::paginator::Paginator;
2846 self.by_page().items()
2847 }
2848
2849 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2853 self.0.request.parent = v.into();
2854 self
2855 }
2856
2857 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2859 self.0.request.page_size = v.into();
2860 self
2861 }
2862
2863 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2865 self.0.request.page_token = v.into();
2866 self
2867 }
2868
2869 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2871 self.0.request.filter = v.into();
2872 self
2873 }
2874
2875 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2877 self.0.request.order_by = v.into();
2878 self
2879 }
2880 }
2881
2882 #[doc(hidden)]
2883 impl crate::RequestBuilder for ListEntryTypes {
2884 fn request_options(&mut self) -> &mut crate::RequestOptions {
2885 &mut self.0.options
2886 }
2887 }
2888
2889 #[derive(Clone, Debug)]
2906 pub struct GetEntryType(RequestBuilder<crate::model::GetEntryTypeRequest>);
2907
2908 impl GetEntryType {
2909 pub(crate) fn new(
2910 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2911 ) -> Self {
2912 Self(RequestBuilder::new(stub))
2913 }
2914
2915 pub fn with_request<V: Into<crate::model::GetEntryTypeRequest>>(mut self, v: V) -> Self {
2917 self.0.request = v.into();
2918 self
2919 }
2920
2921 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2923 self.0.options = v.into();
2924 self
2925 }
2926
2927 pub async fn send(self) -> Result<crate::model::EntryType> {
2929 (*self.0.stub)
2930 .get_entry_type(self.0.request, self.0.options)
2931 .await
2932 .map(crate::Response::into_body)
2933 }
2934
2935 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2939 self.0.request.name = v.into();
2940 self
2941 }
2942 }
2943
2944 #[doc(hidden)]
2945 impl crate::RequestBuilder for GetEntryType {
2946 fn request_options(&mut self) -> &mut crate::RequestOptions {
2947 &mut self.0.options
2948 }
2949 }
2950
2951 #[derive(Clone, Debug)]
2969 pub struct CreateAspectType(RequestBuilder<crate::model::CreateAspectTypeRequest>);
2970
2971 impl CreateAspectType {
2972 pub(crate) fn new(
2973 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2974 ) -> Self {
2975 Self(RequestBuilder::new(stub))
2976 }
2977
2978 pub fn with_request<V: Into<crate::model::CreateAspectTypeRequest>>(
2980 mut self,
2981 v: V,
2982 ) -> Self {
2983 self.0.request = v.into();
2984 self
2985 }
2986
2987 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2989 self.0.options = v.into();
2990 self
2991 }
2992
2993 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3000 (*self.0.stub)
3001 .create_aspect_type(self.0.request, self.0.options)
3002 .await
3003 .map(crate::Response::into_body)
3004 }
3005
3006 pub fn poller(
3008 self,
3009 ) -> impl google_cloud_lro::Poller<crate::model::AspectType, crate::model::OperationMetadata>
3010 {
3011 type Operation = google_cloud_lro::internal::Operation<
3012 crate::model::AspectType,
3013 crate::model::OperationMetadata,
3014 >;
3015 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3016 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3017
3018 let stub = self.0.stub.clone();
3019 let mut options = self.0.options.clone();
3020 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3021 let query = move |name| {
3022 let stub = stub.clone();
3023 let options = options.clone();
3024 async {
3025 let op = GetOperation::new(stub)
3026 .set_name(name)
3027 .with_options(options)
3028 .send()
3029 .await?;
3030 Ok(Operation::new(op))
3031 }
3032 };
3033
3034 let start = move || async {
3035 let op = self.send().await?;
3036 Ok(Operation::new(op))
3037 };
3038
3039 google_cloud_lro::internal::new_poller(
3040 polling_error_policy,
3041 polling_backoff_policy,
3042 start,
3043 query,
3044 )
3045 }
3046
3047 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3051 self.0.request.parent = v.into();
3052 self
3053 }
3054
3055 pub fn set_aspect_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3059 self.0.request.aspect_type_id = v.into();
3060 self
3061 }
3062
3063 pub fn set_aspect_type<T>(mut self, v: T) -> Self
3067 where
3068 T: std::convert::Into<crate::model::AspectType>,
3069 {
3070 self.0.request.aspect_type = std::option::Option::Some(v.into());
3071 self
3072 }
3073
3074 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
3078 where
3079 T: std::convert::Into<crate::model::AspectType>,
3080 {
3081 self.0.request.aspect_type = v.map(|x| x.into());
3082 self
3083 }
3084
3085 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3087 self.0.request.validate_only = v.into();
3088 self
3089 }
3090 }
3091
3092 #[doc(hidden)]
3093 impl crate::RequestBuilder for CreateAspectType {
3094 fn request_options(&mut self) -> &mut crate::RequestOptions {
3095 &mut self.0.options
3096 }
3097 }
3098
3099 #[derive(Clone, Debug)]
3117 pub struct UpdateAspectType(RequestBuilder<crate::model::UpdateAspectTypeRequest>);
3118
3119 impl UpdateAspectType {
3120 pub(crate) fn new(
3121 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3122 ) -> Self {
3123 Self(RequestBuilder::new(stub))
3124 }
3125
3126 pub fn with_request<V: Into<crate::model::UpdateAspectTypeRequest>>(
3128 mut self,
3129 v: V,
3130 ) -> Self {
3131 self.0.request = v.into();
3132 self
3133 }
3134
3135 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3137 self.0.options = v.into();
3138 self
3139 }
3140
3141 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3148 (*self.0.stub)
3149 .update_aspect_type(self.0.request, self.0.options)
3150 .await
3151 .map(crate::Response::into_body)
3152 }
3153
3154 pub fn poller(
3156 self,
3157 ) -> impl google_cloud_lro::Poller<crate::model::AspectType, crate::model::OperationMetadata>
3158 {
3159 type Operation = google_cloud_lro::internal::Operation<
3160 crate::model::AspectType,
3161 crate::model::OperationMetadata,
3162 >;
3163 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3164 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3165
3166 let stub = self.0.stub.clone();
3167 let mut options = self.0.options.clone();
3168 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3169 let query = move |name| {
3170 let stub = stub.clone();
3171 let options = options.clone();
3172 async {
3173 let op = GetOperation::new(stub)
3174 .set_name(name)
3175 .with_options(options)
3176 .send()
3177 .await?;
3178 Ok(Operation::new(op))
3179 }
3180 };
3181
3182 let start = move || async {
3183 let op = self.send().await?;
3184 Ok(Operation::new(op))
3185 };
3186
3187 google_cloud_lro::internal::new_poller(
3188 polling_error_policy,
3189 polling_backoff_policy,
3190 start,
3191 query,
3192 )
3193 }
3194
3195 pub fn set_aspect_type<T>(mut self, v: T) -> Self
3199 where
3200 T: std::convert::Into<crate::model::AspectType>,
3201 {
3202 self.0.request.aspect_type = std::option::Option::Some(v.into());
3203 self
3204 }
3205
3206 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
3210 where
3211 T: std::convert::Into<crate::model::AspectType>,
3212 {
3213 self.0.request.aspect_type = v.map(|x| x.into());
3214 self
3215 }
3216
3217 pub fn set_update_mask<T>(mut self, v: T) -> Self
3221 where
3222 T: std::convert::Into<wkt::FieldMask>,
3223 {
3224 self.0.request.update_mask = std::option::Option::Some(v.into());
3225 self
3226 }
3227
3228 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3232 where
3233 T: std::convert::Into<wkt::FieldMask>,
3234 {
3235 self.0.request.update_mask = v.map(|x| x.into());
3236 self
3237 }
3238
3239 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3241 self.0.request.validate_only = v.into();
3242 self
3243 }
3244 }
3245
3246 #[doc(hidden)]
3247 impl crate::RequestBuilder for UpdateAspectType {
3248 fn request_options(&mut self) -> &mut crate::RequestOptions {
3249 &mut self.0.options
3250 }
3251 }
3252
3253 #[derive(Clone, Debug)]
3271 pub struct DeleteAspectType(RequestBuilder<crate::model::DeleteAspectTypeRequest>);
3272
3273 impl DeleteAspectType {
3274 pub(crate) fn new(
3275 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3276 ) -> Self {
3277 Self(RequestBuilder::new(stub))
3278 }
3279
3280 pub fn with_request<V: Into<crate::model::DeleteAspectTypeRequest>>(
3282 mut self,
3283 v: V,
3284 ) -> Self {
3285 self.0.request = v.into();
3286 self
3287 }
3288
3289 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3291 self.0.options = v.into();
3292 self
3293 }
3294
3295 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3302 (*self.0.stub)
3303 .delete_aspect_type(self.0.request, self.0.options)
3304 .await
3305 .map(crate::Response::into_body)
3306 }
3307
3308 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3310 type Operation =
3311 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3312 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3313 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3314
3315 let stub = self.0.stub.clone();
3316 let mut options = self.0.options.clone();
3317 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3318 let query = move |name| {
3319 let stub = stub.clone();
3320 let options = options.clone();
3321 async {
3322 let op = GetOperation::new(stub)
3323 .set_name(name)
3324 .with_options(options)
3325 .send()
3326 .await?;
3327 Ok(Operation::new(op))
3328 }
3329 };
3330
3331 let start = move || async {
3332 let op = self.send().await?;
3333 Ok(Operation::new(op))
3334 };
3335
3336 google_cloud_lro::internal::new_unit_response_poller(
3337 polling_error_policy,
3338 polling_backoff_policy,
3339 start,
3340 query,
3341 )
3342 }
3343
3344 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3348 self.0.request.name = v.into();
3349 self
3350 }
3351
3352 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3354 self.0.request.etag = v.into();
3355 self
3356 }
3357 }
3358
3359 #[doc(hidden)]
3360 impl crate::RequestBuilder for DeleteAspectType {
3361 fn request_options(&mut self) -> &mut crate::RequestOptions {
3362 &mut self.0.options
3363 }
3364 }
3365
3366 #[derive(Clone, Debug)]
3387 pub struct ListAspectTypes(RequestBuilder<crate::model::ListAspectTypesRequest>);
3388
3389 impl ListAspectTypes {
3390 pub(crate) fn new(
3391 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3392 ) -> Self {
3393 Self(RequestBuilder::new(stub))
3394 }
3395
3396 pub fn with_request<V: Into<crate::model::ListAspectTypesRequest>>(mut self, v: V) -> Self {
3398 self.0.request = v.into();
3399 self
3400 }
3401
3402 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3404 self.0.options = v.into();
3405 self
3406 }
3407
3408 pub async fn send(self) -> Result<crate::model::ListAspectTypesResponse> {
3410 (*self.0.stub)
3411 .list_aspect_types(self.0.request, self.0.options)
3412 .await
3413 .map(crate::Response::into_body)
3414 }
3415
3416 pub fn by_page(
3418 self,
3419 ) -> impl google_cloud_gax::paginator::Paginator<
3420 crate::model::ListAspectTypesResponse,
3421 crate::Error,
3422 > {
3423 use std::clone::Clone;
3424 let token = self.0.request.page_token.clone();
3425 let execute = move |token: String| {
3426 let mut builder = self.clone();
3427 builder.0.request = builder.0.request.set_page_token(token);
3428 builder.send()
3429 };
3430 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3431 }
3432
3433 pub fn by_item(
3435 self,
3436 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3437 crate::model::ListAspectTypesResponse,
3438 crate::Error,
3439 > {
3440 use google_cloud_gax::paginator::Paginator;
3441 self.by_page().items()
3442 }
3443
3444 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3448 self.0.request.parent = v.into();
3449 self
3450 }
3451
3452 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3454 self.0.request.page_size = v.into();
3455 self
3456 }
3457
3458 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3460 self.0.request.page_token = v.into();
3461 self
3462 }
3463
3464 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3466 self.0.request.filter = v.into();
3467 self
3468 }
3469
3470 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3472 self.0.request.order_by = v.into();
3473 self
3474 }
3475 }
3476
3477 #[doc(hidden)]
3478 impl crate::RequestBuilder for ListAspectTypes {
3479 fn request_options(&mut self) -> &mut crate::RequestOptions {
3480 &mut self.0.options
3481 }
3482 }
3483
3484 #[derive(Clone, Debug)]
3501 pub struct GetAspectType(RequestBuilder<crate::model::GetAspectTypeRequest>);
3502
3503 impl GetAspectType {
3504 pub(crate) fn new(
3505 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3506 ) -> Self {
3507 Self(RequestBuilder::new(stub))
3508 }
3509
3510 pub fn with_request<V: Into<crate::model::GetAspectTypeRequest>>(mut self, v: V) -> Self {
3512 self.0.request = v.into();
3513 self
3514 }
3515
3516 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3518 self.0.options = v.into();
3519 self
3520 }
3521
3522 pub async fn send(self) -> Result<crate::model::AspectType> {
3524 (*self.0.stub)
3525 .get_aspect_type(self.0.request, self.0.options)
3526 .await
3527 .map(crate::Response::into_body)
3528 }
3529
3530 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3534 self.0.request.name = v.into();
3535 self
3536 }
3537 }
3538
3539 #[doc(hidden)]
3540 impl crate::RequestBuilder for GetAspectType {
3541 fn request_options(&mut self) -> &mut crate::RequestOptions {
3542 &mut self.0.options
3543 }
3544 }
3545
3546 #[derive(Clone, Debug)]
3564 pub struct CreateEntryGroup(RequestBuilder<crate::model::CreateEntryGroupRequest>);
3565
3566 impl CreateEntryGroup {
3567 pub(crate) fn new(
3568 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3569 ) -> Self {
3570 Self(RequestBuilder::new(stub))
3571 }
3572
3573 pub fn with_request<V: Into<crate::model::CreateEntryGroupRequest>>(
3575 mut self,
3576 v: V,
3577 ) -> Self {
3578 self.0.request = v.into();
3579 self
3580 }
3581
3582 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3584 self.0.options = v.into();
3585 self
3586 }
3587
3588 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3595 (*self.0.stub)
3596 .create_entry_group(self.0.request, self.0.options)
3597 .await
3598 .map(crate::Response::into_body)
3599 }
3600
3601 pub fn poller(
3603 self,
3604 ) -> impl google_cloud_lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata>
3605 {
3606 type Operation = google_cloud_lro::internal::Operation<
3607 crate::model::EntryGroup,
3608 crate::model::OperationMetadata,
3609 >;
3610 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3611 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3612
3613 let stub = self.0.stub.clone();
3614 let mut options = self.0.options.clone();
3615 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3616 let query = move |name| {
3617 let stub = stub.clone();
3618 let options = options.clone();
3619 async {
3620 let op = GetOperation::new(stub)
3621 .set_name(name)
3622 .with_options(options)
3623 .send()
3624 .await?;
3625 Ok(Operation::new(op))
3626 }
3627 };
3628
3629 let start = move || async {
3630 let op = self.send().await?;
3631 Ok(Operation::new(op))
3632 };
3633
3634 google_cloud_lro::internal::new_poller(
3635 polling_error_policy,
3636 polling_backoff_policy,
3637 start,
3638 query,
3639 )
3640 }
3641
3642 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3646 self.0.request.parent = v.into();
3647 self
3648 }
3649
3650 pub fn set_entry_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3654 self.0.request.entry_group_id = v.into();
3655 self
3656 }
3657
3658 pub fn set_entry_group<T>(mut self, v: T) -> Self
3662 where
3663 T: std::convert::Into<crate::model::EntryGroup>,
3664 {
3665 self.0.request.entry_group = std::option::Option::Some(v.into());
3666 self
3667 }
3668
3669 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
3673 where
3674 T: std::convert::Into<crate::model::EntryGroup>,
3675 {
3676 self.0.request.entry_group = v.map(|x| x.into());
3677 self
3678 }
3679
3680 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3682 self.0.request.validate_only = v.into();
3683 self
3684 }
3685 }
3686
3687 #[doc(hidden)]
3688 impl crate::RequestBuilder for CreateEntryGroup {
3689 fn request_options(&mut self) -> &mut crate::RequestOptions {
3690 &mut self.0.options
3691 }
3692 }
3693
3694 #[derive(Clone, Debug)]
3712 pub struct UpdateEntryGroup(RequestBuilder<crate::model::UpdateEntryGroupRequest>);
3713
3714 impl UpdateEntryGroup {
3715 pub(crate) fn new(
3716 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3717 ) -> Self {
3718 Self(RequestBuilder::new(stub))
3719 }
3720
3721 pub fn with_request<V: Into<crate::model::UpdateEntryGroupRequest>>(
3723 mut self,
3724 v: V,
3725 ) -> Self {
3726 self.0.request = v.into();
3727 self
3728 }
3729
3730 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3732 self.0.options = v.into();
3733 self
3734 }
3735
3736 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3743 (*self.0.stub)
3744 .update_entry_group(self.0.request, self.0.options)
3745 .await
3746 .map(crate::Response::into_body)
3747 }
3748
3749 pub fn poller(
3751 self,
3752 ) -> impl google_cloud_lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata>
3753 {
3754 type Operation = google_cloud_lro::internal::Operation<
3755 crate::model::EntryGroup,
3756 crate::model::OperationMetadata,
3757 >;
3758 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3759 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3760
3761 let stub = self.0.stub.clone();
3762 let mut options = self.0.options.clone();
3763 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3764 let query = move |name| {
3765 let stub = stub.clone();
3766 let options = options.clone();
3767 async {
3768 let op = GetOperation::new(stub)
3769 .set_name(name)
3770 .with_options(options)
3771 .send()
3772 .await?;
3773 Ok(Operation::new(op))
3774 }
3775 };
3776
3777 let start = move || async {
3778 let op = self.send().await?;
3779 Ok(Operation::new(op))
3780 };
3781
3782 google_cloud_lro::internal::new_poller(
3783 polling_error_policy,
3784 polling_backoff_policy,
3785 start,
3786 query,
3787 )
3788 }
3789
3790 pub fn set_entry_group<T>(mut self, v: T) -> Self
3794 where
3795 T: std::convert::Into<crate::model::EntryGroup>,
3796 {
3797 self.0.request.entry_group = std::option::Option::Some(v.into());
3798 self
3799 }
3800
3801 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
3805 where
3806 T: std::convert::Into<crate::model::EntryGroup>,
3807 {
3808 self.0.request.entry_group = v.map(|x| x.into());
3809 self
3810 }
3811
3812 pub fn set_update_mask<T>(mut self, v: T) -> Self
3816 where
3817 T: std::convert::Into<wkt::FieldMask>,
3818 {
3819 self.0.request.update_mask = std::option::Option::Some(v.into());
3820 self
3821 }
3822
3823 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3827 where
3828 T: std::convert::Into<wkt::FieldMask>,
3829 {
3830 self.0.request.update_mask = v.map(|x| x.into());
3831 self
3832 }
3833
3834 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3836 self.0.request.validate_only = v.into();
3837 self
3838 }
3839 }
3840
3841 #[doc(hidden)]
3842 impl crate::RequestBuilder for UpdateEntryGroup {
3843 fn request_options(&mut self) -> &mut crate::RequestOptions {
3844 &mut self.0.options
3845 }
3846 }
3847
3848 #[derive(Clone, Debug)]
3866 pub struct DeleteEntryGroup(RequestBuilder<crate::model::DeleteEntryGroupRequest>);
3867
3868 impl DeleteEntryGroup {
3869 pub(crate) fn new(
3870 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3871 ) -> Self {
3872 Self(RequestBuilder::new(stub))
3873 }
3874
3875 pub fn with_request<V: Into<crate::model::DeleteEntryGroupRequest>>(
3877 mut self,
3878 v: V,
3879 ) -> Self {
3880 self.0.request = v.into();
3881 self
3882 }
3883
3884 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3886 self.0.options = v.into();
3887 self
3888 }
3889
3890 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3897 (*self.0.stub)
3898 .delete_entry_group(self.0.request, self.0.options)
3899 .await
3900 .map(crate::Response::into_body)
3901 }
3902
3903 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3905 type Operation =
3906 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3907 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3908 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3909
3910 let stub = self.0.stub.clone();
3911 let mut options = self.0.options.clone();
3912 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3913 let query = move |name| {
3914 let stub = stub.clone();
3915 let options = options.clone();
3916 async {
3917 let op = GetOperation::new(stub)
3918 .set_name(name)
3919 .with_options(options)
3920 .send()
3921 .await?;
3922 Ok(Operation::new(op))
3923 }
3924 };
3925
3926 let start = move || async {
3927 let op = self.send().await?;
3928 Ok(Operation::new(op))
3929 };
3930
3931 google_cloud_lro::internal::new_unit_response_poller(
3932 polling_error_policy,
3933 polling_backoff_policy,
3934 start,
3935 query,
3936 )
3937 }
3938
3939 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3943 self.0.request.name = v.into();
3944 self
3945 }
3946
3947 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3949 self.0.request.etag = v.into();
3950 self
3951 }
3952 }
3953
3954 #[doc(hidden)]
3955 impl crate::RequestBuilder for DeleteEntryGroup {
3956 fn request_options(&mut self) -> &mut crate::RequestOptions {
3957 &mut self.0.options
3958 }
3959 }
3960
3961 #[derive(Clone, Debug)]
3982 pub struct ListEntryGroups(RequestBuilder<crate::model::ListEntryGroupsRequest>);
3983
3984 impl ListEntryGroups {
3985 pub(crate) fn new(
3986 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3987 ) -> Self {
3988 Self(RequestBuilder::new(stub))
3989 }
3990
3991 pub fn with_request<V: Into<crate::model::ListEntryGroupsRequest>>(mut self, v: V) -> Self {
3993 self.0.request = v.into();
3994 self
3995 }
3996
3997 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3999 self.0.options = v.into();
4000 self
4001 }
4002
4003 pub async fn send(self) -> Result<crate::model::ListEntryGroupsResponse> {
4005 (*self.0.stub)
4006 .list_entry_groups(self.0.request, self.0.options)
4007 .await
4008 .map(crate::Response::into_body)
4009 }
4010
4011 pub fn by_page(
4013 self,
4014 ) -> impl google_cloud_gax::paginator::Paginator<
4015 crate::model::ListEntryGroupsResponse,
4016 crate::Error,
4017 > {
4018 use std::clone::Clone;
4019 let token = self.0.request.page_token.clone();
4020 let execute = move |token: String| {
4021 let mut builder = self.clone();
4022 builder.0.request = builder.0.request.set_page_token(token);
4023 builder.send()
4024 };
4025 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4026 }
4027
4028 pub fn by_item(
4030 self,
4031 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4032 crate::model::ListEntryGroupsResponse,
4033 crate::Error,
4034 > {
4035 use google_cloud_gax::paginator::Paginator;
4036 self.by_page().items()
4037 }
4038
4039 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4043 self.0.request.parent = v.into();
4044 self
4045 }
4046
4047 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4049 self.0.request.page_size = v.into();
4050 self
4051 }
4052
4053 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4055 self.0.request.page_token = v.into();
4056 self
4057 }
4058
4059 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4061 self.0.request.filter = v.into();
4062 self
4063 }
4064
4065 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4067 self.0.request.order_by = v.into();
4068 self
4069 }
4070 }
4071
4072 #[doc(hidden)]
4073 impl crate::RequestBuilder for ListEntryGroups {
4074 fn request_options(&mut self) -> &mut crate::RequestOptions {
4075 &mut self.0.options
4076 }
4077 }
4078
4079 #[derive(Clone, Debug)]
4096 pub struct GetEntryGroup(RequestBuilder<crate::model::GetEntryGroupRequest>);
4097
4098 impl GetEntryGroup {
4099 pub(crate) fn new(
4100 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4101 ) -> Self {
4102 Self(RequestBuilder::new(stub))
4103 }
4104
4105 pub fn with_request<V: Into<crate::model::GetEntryGroupRequest>>(mut self, v: V) -> Self {
4107 self.0.request = v.into();
4108 self
4109 }
4110
4111 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4113 self.0.options = v.into();
4114 self
4115 }
4116
4117 pub async fn send(self) -> Result<crate::model::EntryGroup> {
4119 (*self.0.stub)
4120 .get_entry_group(self.0.request, self.0.options)
4121 .await
4122 .map(crate::Response::into_body)
4123 }
4124
4125 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4129 self.0.request.name = v.into();
4130 self
4131 }
4132 }
4133
4134 #[doc(hidden)]
4135 impl crate::RequestBuilder for GetEntryGroup {
4136 fn request_options(&mut self) -> &mut crate::RequestOptions {
4137 &mut self.0.options
4138 }
4139 }
4140
4141 #[derive(Clone, Debug)]
4158 pub struct CreateEntry(RequestBuilder<crate::model::CreateEntryRequest>);
4159
4160 impl CreateEntry {
4161 pub(crate) fn new(
4162 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4163 ) -> Self {
4164 Self(RequestBuilder::new(stub))
4165 }
4166
4167 pub fn with_request<V: Into<crate::model::CreateEntryRequest>>(mut self, v: V) -> Self {
4169 self.0.request = v.into();
4170 self
4171 }
4172
4173 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4175 self.0.options = v.into();
4176 self
4177 }
4178
4179 pub async fn send(self) -> Result<crate::model::Entry> {
4181 (*self.0.stub)
4182 .create_entry(self.0.request, self.0.options)
4183 .await
4184 .map(crate::Response::into_body)
4185 }
4186
4187 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4191 self.0.request.parent = v.into();
4192 self
4193 }
4194
4195 pub fn set_entry_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4199 self.0.request.entry_id = v.into();
4200 self
4201 }
4202
4203 pub fn set_entry<T>(mut self, v: T) -> Self
4207 where
4208 T: std::convert::Into<crate::model::Entry>,
4209 {
4210 self.0.request.entry = std::option::Option::Some(v.into());
4211 self
4212 }
4213
4214 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
4218 where
4219 T: std::convert::Into<crate::model::Entry>,
4220 {
4221 self.0.request.entry = v.map(|x| x.into());
4222 self
4223 }
4224 }
4225
4226 #[doc(hidden)]
4227 impl crate::RequestBuilder for CreateEntry {
4228 fn request_options(&mut self) -> &mut crate::RequestOptions {
4229 &mut self.0.options
4230 }
4231 }
4232
4233 #[derive(Clone, Debug)]
4250 pub struct UpdateEntry(RequestBuilder<crate::model::UpdateEntryRequest>);
4251
4252 impl UpdateEntry {
4253 pub(crate) fn new(
4254 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4255 ) -> Self {
4256 Self(RequestBuilder::new(stub))
4257 }
4258
4259 pub fn with_request<V: Into<crate::model::UpdateEntryRequest>>(mut self, v: V) -> Self {
4261 self.0.request = v.into();
4262 self
4263 }
4264
4265 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4267 self.0.options = v.into();
4268 self
4269 }
4270
4271 pub async fn send(self) -> Result<crate::model::Entry> {
4273 (*self.0.stub)
4274 .update_entry(self.0.request, self.0.options)
4275 .await
4276 .map(crate::Response::into_body)
4277 }
4278
4279 pub fn set_entry<T>(mut self, v: T) -> Self
4283 where
4284 T: std::convert::Into<crate::model::Entry>,
4285 {
4286 self.0.request.entry = std::option::Option::Some(v.into());
4287 self
4288 }
4289
4290 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
4294 where
4295 T: std::convert::Into<crate::model::Entry>,
4296 {
4297 self.0.request.entry = v.map(|x| x.into());
4298 self
4299 }
4300
4301 pub fn set_update_mask<T>(mut self, v: T) -> Self
4303 where
4304 T: std::convert::Into<wkt::FieldMask>,
4305 {
4306 self.0.request.update_mask = std::option::Option::Some(v.into());
4307 self
4308 }
4309
4310 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4312 where
4313 T: std::convert::Into<wkt::FieldMask>,
4314 {
4315 self.0.request.update_mask = v.map(|x| x.into());
4316 self
4317 }
4318
4319 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4321 self.0.request.allow_missing = v.into();
4322 self
4323 }
4324
4325 pub fn set_delete_missing_aspects<T: Into<bool>>(mut self, v: T) -> Self {
4327 self.0.request.delete_missing_aspects = v.into();
4328 self
4329 }
4330
4331 pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
4333 where
4334 T: std::iter::IntoIterator<Item = V>,
4335 V: std::convert::Into<std::string::String>,
4336 {
4337 use std::iter::Iterator;
4338 self.0.request.aspect_keys = v.into_iter().map(|i| i.into()).collect();
4339 self
4340 }
4341 }
4342
4343 #[doc(hidden)]
4344 impl crate::RequestBuilder for UpdateEntry {
4345 fn request_options(&mut self) -> &mut crate::RequestOptions {
4346 &mut self.0.options
4347 }
4348 }
4349
4350 #[derive(Clone, Debug)]
4367 pub struct DeleteEntry(RequestBuilder<crate::model::DeleteEntryRequest>);
4368
4369 impl DeleteEntry {
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::DeleteEntryRequest>>(mut self, v: V) -> Self {
4378 self.0.request = v.into();
4379 self
4380 }
4381
4382 pub fn with_options<V: Into<crate::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::Entry> {
4390 (*self.0.stub)
4391 .delete_entry(self.0.request, self.0.options)
4392 .await
4393 .map(crate::Response::into_body)
4394 }
4395
4396 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4400 self.0.request.name = v.into();
4401 self
4402 }
4403 }
4404
4405 #[doc(hidden)]
4406 impl crate::RequestBuilder for DeleteEntry {
4407 fn request_options(&mut self) -> &mut crate::RequestOptions {
4408 &mut self.0.options
4409 }
4410 }
4411
4412 #[derive(Clone, Debug)]
4433 pub struct ListEntries(RequestBuilder<crate::model::ListEntriesRequest>);
4434
4435 impl ListEntries {
4436 pub(crate) fn new(
4437 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4438 ) -> Self {
4439 Self(RequestBuilder::new(stub))
4440 }
4441
4442 pub fn with_request<V: Into<crate::model::ListEntriesRequest>>(mut self, v: V) -> Self {
4444 self.0.request = v.into();
4445 self
4446 }
4447
4448 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4450 self.0.options = v.into();
4451 self
4452 }
4453
4454 pub async fn send(self) -> Result<crate::model::ListEntriesResponse> {
4456 (*self.0.stub)
4457 .list_entries(self.0.request, self.0.options)
4458 .await
4459 .map(crate::Response::into_body)
4460 }
4461
4462 pub fn by_page(
4464 self,
4465 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListEntriesResponse, crate::Error>
4466 {
4467 use std::clone::Clone;
4468 let token = self.0.request.page_token.clone();
4469 let execute = move |token: String| {
4470 let mut builder = self.clone();
4471 builder.0.request = builder.0.request.set_page_token(token);
4472 builder.send()
4473 };
4474 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4475 }
4476
4477 pub fn by_item(
4479 self,
4480 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4481 crate::model::ListEntriesResponse,
4482 crate::Error,
4483 > {
4484 use google_cloud_gax::paginator::Paginator;
4485 self.by_page().items()
4486 }
4487
4488 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4492 self.0.request.parent = v.into();
4493 self
4494 }
4495
4496 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4498 self.0.request.page_size = v.into();
4499 self
4500 }
4501
4502 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4504 self.0.request.page_token = v.into();
4505 self
4506 }
4507
4508 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4510 self.0.request.filter = v.into();
4511 self
4512 }
4513 }
4514
4515 #[doc(hidden)]
4516 impl crate::RequestBuilder for ListEntries {
4517 fn request_options(&mut self) -> &mut crate::RequestOptions {
4518 &mut self.0.options
4519 }
4520 }
4521
4522 #[derive(Clone, Debug)]
4539 pub struct GetEntry(RequestBuilder<crate::model::GetEntryRequest>);
4540
4541 impl GetEntry {
4542 pub(crate) fn new(
4543 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4544 ) -> Self {
4545 Self(RequestBuilder::new(stub))
4546 }
4547
4548 pub fn with_request<V: Into<crate::model::GetEntryRequest>>(mut self, v: V) -> Self {
4550 self.0.request = v.into();
4551 self
4552 }
4553
4554 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4556 self.0.options = v.into();
4557 self
4558 }
4559
4560 pub async fn send(self) -> Result<crate::model::Entry> {
4562 (*self.0.stub)
4563 .get_entry(self.0.request, self.0.options)
4564 .await
4565 .map(crate::Response::into_body)
4566 }
4567
4568 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4572 self.0.request.name = v.into();
4573 self
4574 }
4575
4576 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
4578 self.0.request.view = v.into();
4579 self
4580 }
4581
4582 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
4584 where
4585 T: std::iter::IntoIterator<Item = V>,
4586 V: std::convert::Into<std::string::String>,
4587 {
4588 use std::iter::Iterator;
4589 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
4590 self
4591 }
4592
4593 pub fn set_paths<T, V>(mut self, v: T) -> Self
4595 where
4596 T: std::iter::IntoIterator<Item = V>,
4597 V: std::convert::Into<std::string::String>,
4598 {
4599 use std::iter::Iterator;
4600 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
4601 self
4602 }
4603 }
4604
4605 #[doc(hidden)]
4606 impl crate::RequestBuilder for GetEntry {
4607 fn request_options(&mut self) -> &mut crate::RequestOptions {
4608 &mut self.0.options
4609 }
4610 }
4611
4612 #[derive(Clone, Debug)]
4629 pub struct LookupEntry(RequestBuilder<crate::model::LookupEntryRequest>);
4630
4631 impl LookupEntry {
4632 pub(crate) fn new(
4633 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4634 ) -> Self {
4635 Self(RequestBuilder::new(stub))
4636 }
4637
4638 pub fn with_request<V: Into<crate::model::LookupEntryRequest>>(mut self, v: V) -> Self {
4640 self.0.request = v.into();
4641 self
4642 }
4643
4644 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4646 self.0.options = v.into();
4647 self
4648 }
4649
4650 pub async fn send(self) -> Result<crate::model::Entry> {
4652 (*self.0.stub)
4653 .lookup_entry(self.0.request, self.0.options)
4654 .await
4655 .map(crate::Response::into_body)
4656 }
4657
4658 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4662 self.0.request.name = v.into();
4663 self
4664 }
4665
4666 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
4668 self.0.request.view = v.into();
4669 self
4670 }
4671
4672 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
4674 where
4675 T: std::iter::IntoIterator<Item = V>,
4676 V: std::convert::Into<std::string::String>,
4677 {
4678 use std::iter::Iterator;
4679 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
4680 self
4681 }
4682
4683 pub fn set_paths<T, V>(mut self, v: T) -> Self
4685 where
4686 T: std::iter::IntoIterator<Item = V>,
4687 V: std::convert::Into<std::string::String>,
4688 {
4689 use std::iter::Iterator;
4690 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
4691 self
4692 }
4693
4694 pub fn set_entry<T: Into<std::string::String>>(mut self, v: T) -> Self {
4698 self.0.request.entry = v.into();
4699 self
4700 }
4701 }
4702
4703 #[doc(hidden)]
4704 impl crate::RequestBuilder for LookupEntry {
4705 fn request_options(&mut self) -> &mut crate::RequestOptions {
4706 &mut self.0.options
4707 }
4708 }
4709
4710 #[derive(Clone, Debug)]
4731 pub struct SearchEntries(RequestBuilder<crate::model::SearchEntriesRequest>);
4732
4733 impl SearchEntries {
4734 pub(crate) fn new(
4735 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4736 ) -> Self {
4737 Self(RequestBuilder::new(stub))
4738 }
4739
4740 pub fn with_request<V: Into<crate::model::SearchEntriesRequest>>(mut self, v: V) -> Self {
4742 self.0.request = v.into();
4743 self
4744 }
4745
4746 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4748 self.0.options = v.into();
4749 self
4750 }
4751
4752 pub async fn send(self) -> Result<crate::model::SearchEntriesResponse> {
4754 (*self.0.stub)
4755 .search_entries(self.0.request, self.0.options)
4756 .await
4757 .map(crate::Response::into_body)
4758 }
4759
4760 pub fn by_page(
4762 self,
4763 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchEntriesResponse, crate::Error>
4764 {
4765 use std::clone::Clone;
4766 let token = self.0.request.page_token.clone();
4767 let execute = move |token: String| {
4768 let mut builder = self.clone();
4769 builder.0.request = builder.0.request.set_page_token(token);
4770 builder.send()
4771 };
4772 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4773 }
4774
4775 pub fn by_item(
4777 self,
4778 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4779 crate::model::SearchEntriesResponse,
4780 crate::Error,
4781 > {
4782 use google_cloud_gax::paginator::Paginator;
4783 self.by_page().items()
4784 }
4785
4786 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4790 self.0.request.name = v.into();
4791 self
4792 }
4793
4794 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
4798 self.0.request.query = v.into();
4799 self
4800 }
4801
4802 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4804 self.0.request.page_size = v.into();
4805 self
4806 }
4807
4808 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4810 self.0.request.page_token = v.into();
4811 self
4812 }
4813
4814 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4816 self.0.request.order_by = v.into();
4817 self
4818 }
4819
4820 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
4822 self.0.request.scope = v.into();
4823 self
4824 }
4825
4826 pub fn set_semantic_search<T: Into<bool>>(mut self, v: T) -> Self {
4828 self.0.request.semantic_search = v.into();
4829 self
4830 }
4831 }
4832
4833 #[doc(hidden)]
4834 impl crate::RequestBuilder for SearchEntries {
4835 fn request_options(&mut self) -> &mut crate::RequestOptions {
4836 &mut self.0.options
4837 }
4838 }
4839
4840 #[derive(Clone, Debug)]
4858 pub struct CreateMetadataJob(RequestBuilder<crate::model::CreateMetadataJobRequest>);
4859
4860 impl CreateMetadataJob {
4861 pub(crate) fn new(
4862 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4863 ) -> Self {
4864 Self(RequestBuilder::new(stub))
4865 }
4866
4867 pub fn with_request<V: Into<crate::model::CreateMetadataJobRequest>>(
4869 mut self,
4870 v: V,
4871 ) -> Self {
4872 self.0.request = v.into();
4873 self
4874 }
4875
4876 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4878 self.0.options = v.into();
4879 self
4880 }
4881
4882 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4889 (*self.0.stub)
4890 .create_metadata_job(self.0.request, self.0.options)
4891 .await
4892 .map(crate::Response::into_body)
4893 }
4894
4895 pub fn poller(
4897 self,
4898 ) -> impl google_cloud_lro::Poller<crate::model::MetadataJob, crate::model::OperationMetadata>
4899 {
4900 type Operation = google_cloud_lro::internal::Operation<
4901 crate::model::MetadataJob,
4902 crate::model::OperationMetadata,
4903 >;
4904 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4905 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4906
4907 let stub = self.0.stub.clone();
4908 let mut options = self.0.options.clone();
4909 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4910 let query = move |name| {
4911 let stub = stub.clone();
4912 let options = options.clone();
4913 async {
4914 let op = GetOperation::new(stub)
4915 .set_name(name)
4916 .with_options(options)
4917 .send()
4918 .await?;
4919 Ok(Operation::new(op))
4920 }
4921 };
4922
4923 let start = move || async {
4924 let op = self.send().await?;
4925 Ok(Operation::new(op))
4926 };
4927
4928 google_cloud_lro::internal::new_poller(
4929 polling_error_policy,
4930 polling_backoff_policy,
4931 start,
4932 query,
4933 )
4934 }
4935
4936 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4940 self.0.request.parent = v.into();
4941 self
4942 }
4943
4944 pub fn set_metadata_job<T>(mut self, v: T) -> Self
4948 where
4949 T: std::convert::Into<crate::model::MetadataJob>,
4950 {
4951 self.0.request.metadata_job = std::option::Option::Some(v.into());
4952 self
4953 }
4954
4955 pub fn set_or_clear_metadata_job<T>(mut self, v: std::option::Option<T>) -> Self
4959 where
4960 T: std::convert::Into<crate::model::MetadataJob>,
4961 {
4962 self.0.request.metadata_job = v.map(|x| x.into());
4963 self
4964 }
4965
4966 pub fn set_metadata_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4968 self.0.request.metadata_job_id = v.into();
4969 self
4970 }
4971
4972 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4974 self.0.request.validate_only = v.into();
4975 self
4976 }
4977 }
4978
4979 #[doc(hidden)]
4980 impl crate::RequestBuilder for CreateMetadataJob {
4981 fn request_options(&mut self) -> &mut crate::RequestOptions {
4982 &mut self.0.options
4983 }
4984 }
4985
4986 #[derive(Clone, Debug)]
5003 pub struct GetMetadataJob(RequestBuilder<crate::model::GetMetadataJobRequest>);
5004
5005 impl GetMetadataJob {
5006 pub(crate) fn new(
5007 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5008 ) -> Self {
5009 Self(RequestBuilder::new(stub))
5010 }
5011
5012 pub fn with_request<V: Into<crate::model::GetMetadataJobRequest>>(mut self, v: V) -> Self {
5014 self.0.request = v.into();
5015 self
5016 }
5017
5018 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5020 self.0.options = v.into();
5021 self
5022 }
5023
5024 pub async fn send(self) -> Result<crate::model::MetadataJob> {
5026 (*self.0.stub)
5027 .get_metadata_job(self.0.request, self.0.options)
5028 .await
5029 .map(crate::Response::into_body)
5030 }
5031
5032 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5036 self.0.request.name = v.into();
5037 self
5038 }
5039 }
5040
5041 #[doc(hidden)]
5042 impl crate::RequestBuilder for GetMetadataJob {
5043 fn request_options(&mut self) -> &mut crate::RequestOptions {
5044 &mut self.0.options
5045 }
5046 }
5047
5048 #[derive(Clone, Debug)]
5069 pub struct ListMetadataJobs(RequestBuilder<crate::model::ListMetadataJobsRequest>);
5070
5071 impl ListMetadataJobs {
5072 pub(crate) fn new(
5073 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5074 ) -> Self {
5075 Self(RequestBuilder::new(stub))
5076 }
5077
5078 pub fn with_request<V: Into<crate::model::ListMetadataJobsRequest>>(
5080 mut self,
5081 v: V,
5082 ) -> Self {
5083 self.0.request = v.into();
5084 self
5085 }
5086
5087 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5089 self.0.options = v.into();
5090 self
5091 }
5092
5093 pub async fn send(self) -> Result<crate::model::ListMetadataJobsResponse> {
5095 (*self.0.stub)
5096 .list_metadata_jobs(self.0.request, self.0.options)
5097 .await
5098 .map(crate::Response::into_body)
5099 }
5100
5101 pub fn by_page(
5103 self,
5104 ) -> impl google_cloud_gax::paginator::Paginator<
5105 crate::model::ListMetadataJobsResponse,
5106 crate::Error,
5107 > {
5108 use std::clone::Clone;
5109 let token = self.0.request.page_token.clone();
5110 let execute = move |token: String| {
5111 let mut builder = self.clone();
5112 builder.0.request = builder.0.request.set_page_token(token);
5113 builder.send()
5114 };
5115 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5116 }
5117
5118 pub fn by_item(
5120 self,
5121 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5122 crate::model::ListMetadataJobsResponse,
5123 crate::Error,
5124 > {
5125 use google_cloud_gax::paginator::Paginator;
5126 self.by_page().items()
5127 }
5128
5129 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5133 self.0.request.parent = v.into();
5134 self
5135 }
5136
5137 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5139 self.0.request.page_size = v.into();
5140 self
5141 }
5142
5143 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5145 self.0.request.page_token = v.into();
5146 self
5147 }
5148
5149 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5151 self.0.request.filter = v.into();
5152 self
5153 }
5154
5155 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5157 self.0.request.order_by = v.into();
5158 self
5159 }
5160 }
5161
5162 #[doc(hidden)]
5163 impl crate::RequestBuilder for ListMetadataJobs {
5164 fn request_options(&mut self) -> &mut crate::RequestOptions {
5165 &mut self.0.options
5166 }
5167 }
5168
5169 #[derive(Clone, Debug)]
5186 pub struct CancelMetadataJob(RequestBuilder<crate::model::CancelMetadataJobRequest>);
5187
5188 impl CancelMetadataJob {
5189 pub(crate) fn new(
5190 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5191 ) -> Self {
5192 Self(RequestBuilder::new(stub))
5193 }
5194
5195 pub fn with_request<V: Into<crate::model::CancelMetadataJobRequest>>(
5197 mut self,
5198 v: V,
5199 ) -> Self {
5200 self.0.request = v.into();
5201 self
5202 }
5203
5204 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5206 self.0.options = v.into();
5207 self
5208 }
5209
5210 pub async fn send(self) -> Result<()> {
5212 (*self.0.stub)
5213 .cancel_metadata_job(self.0.request, self.0.options)
5214 .await
5215 .map(crate::Response::into_body)
5216 }
5217
5218 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5222 self.0.request.name = v.into();
5223 self
5224 }
5225 }
5226
5227 #[doc(hidden)]
5228 impl crate::RequestBuilder for CancelMetadataJob {
5229 fn request_options(&mut self) -> &mut crate::RequestOptions {
5230 &mut self.0.options
5231 }
5232 }
5233
5234 #[derive(Clone, Debug)]
5251 pub struct CreateEntryLink(RequestBuilder<crate::model::CreateEntryLinkRequest>);
5252
5253 impl CreateEntryLink {
5254 pub(crate) fn new(
5255 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5256 ) -> Self {
5257 Self(RequestBuilder::new(stub))
5258 }
5259
5260 pub fn with_request<V: Into<crate::model::CreateEntryLinkRequest>>(mut self, v: V) -> Self {
5262 self.0.request = v.into();
5263 self
5264 }
5265
5266 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5268 self.0.options = v.into();
5269 self
5270 }
5271
5272 pub async fn send(self) -> Result<crate::model::EntryLink> {
5274 (*self.0.stub)
5275 .create_entry_link(self.0.request, self.0.options)
5276 .await
5277 .map(crate::Response::into_body)
5278 }
5279
5280 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5284 self.0.request.parent = v.into();
5285 self
5286 }
5287
5288 pub fn set_entry_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5292 self.0.request.entry_link_id = v.into();
5293 self
5294 }
5295
5296 pub fn set_entry_link<T>(mut self, v: T) -> Self
5300 where
5301 T: std::convert::Into<crate::model::EntryLink>,
5302 {
5303 self.0.request.entry_link = std::option::Option::Some(v.into());
5304 self
5305 }
5306
5307 pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
5311 where
5312 T: std::convert::Into<crate::model::EntryLink>,
5313 {
5314 self.0.request.entry_link = v.map(|x| x.into());
5315 self
5316 }
5317 }
5318
5319 #[doc(hidden)]
5320 impl crate::RequestBuilder for CreateEntryLink {
5321 fn request_options(&mut self) -> &mut crate::RequestOptions {
5322 &mut self.0.options
5323 }
5324 }
5325
5326 #[derive(Clone, Debug)]
5343 pub struct UpdateEntryLink(RequestBuilder<crate::model::UpdateEntryLinkRequest>);
5344
5345 impl UpdateEntryLink {
5346 pub(crate) fn new(
5347 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5348 ) -> Self {
5349 Self(RequestBuilder::new(stub))
5350 }
5351
5352 pub fn with_request<V: Into<crate::model::UpdateEntryLinkRequest>>(mut self, v: V) -> Self {
5354 self.0.request = v.into();
5355 self
5356 }
5357
5358 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5360 self.0.options = v.into();
5361 self
5362 }
5363
5364 pub async fn send(self) -> Result<crate::model::EntryLink> {
5366 (*self.0.stub)
5367 .update_entry_link(self.0.request, self.0.options)
5368 .await
5369 .map(crate::Response::into_body)
5370 }
5371
5372 pub fn set_entry_link<T>(mut self, v: T) -> Self
5376 where
5377 T: std::convert::Into<crate::model::EntryLink>,
5378 {
5379 self.0.request.entry_link = std::option::Option::Some(v.into());
5380 self
5381 }
5382
5383 pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
5387 where
5388 T: std::convert::Into<crate::model::EntryLink>,
5389 {
5390 self.0.request.entry_link = v.map(|x| x.into());
5391 self
5392 }
5393
5394 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
5396 self.0.request.allow_missing = v.into();
5397 self
5398 }
5399
5400 pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
5402 where
5403 T: std::iter::IntoIterator<Item = V>,
5404 V: std::convert::Into<std::string::String>,
5405 {
5406 use std::iter::Iterator;
5407 self.0.request.aspect_keys = v.into_iter().map(|i| i.into()).collect();
5408 self
5409 }
5410 }
5411
5412 #[doc(hidden)]
5413 impl crate::RequestBuilder for UpdateEntryLink {
5414 fn request_options(&mut self) -> &mut crate::RequestOptions {
5415 &mut self.0.options
5416 }
5417 }
5418
5419 #[derive(Clone, Debug)]
5436 pub struct DeleteEntryLink(RequestBuilder<crate::model::DeleteEntryLinkRequest>);
5437
5438 impl DeleteEntryLink {
5439 pub(crate) fn new(
5440 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5441 ) -> Self {
5442 Self(RequestBuilder::new(stub))
5443 }
5444
5445 pub fn with_request<V: Into<crate::model::DeleteEntryLinkRequest>>(mut self, v: V) -> Self {
5447 self.0.request = v.into();
5448 self
5449 }
5450
5451 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5453 self.0.options = v.into();
5454 self
5455 }
5456
5457 pub async fn send(self) -> Result<crate::model::EntryLink> {
5459 (*self.0.stub)
5460 .delete_entry_link(self.0.request, self.0.options)
5461 .await
5462 .map(crate::Response::into_body)
5463 }
5464
5465 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5469 self.0.request.name = v.into();
5470 self
5471 }
5472 }
5473
5474 #[doc(hidden)]
5475 impl crate::RequestBuilder for DeleteEntryLink {
5476 fn request_options(&mut self) -> &mut crate::RequestOptions {
5477 &mut self.0.options
5478 }
5479 }
5480
5481 #[derive(Clone, Debug)]
5502 pub struct LookupEntryLinks(RequestBuilder<crate::model::LookupEntryLinksRequest>);
5503
5504 impl LookupEntryLinks {
5505 pub(crate) fn new(
5506 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5507 ) -> Self {
5508 Self(RequestBuilder::new(stub))
5509 }
5510
5511 pub fn with_request<V: Into<crate::model::LookupEntryLinksRequest>>(
5513 mut self,
5514 v: V,
5515 ) -> Self {
5516 self.0.request = v.into();
5517 self
5518 }
5519
5520 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5522 self.0.options = v.into();
5523 self
5524 }
5525
5526 pub async fn send(self) -> Result<crate::model::LookupEntryLinksResponse> {
5528 (*self.0.stub)
5529 .lookup_entry_links(self.0.request, self.0.options)
5530 .await
5531 .map(crate::Response::into_body)
5532 }
5533
5534 pub fn by_page(
5536 self,
5537 ) -> impl google_cloud_gax::paginator::Paginator<
5538 crate::model::LookupEntryLinksResponse,
5539 crate::Error,
5540 > {
5541 use std::clone::Clone;
5542 let token = self.0.request.page_token.clone();
5543 let execute = move |token: String| {
5544 let mut builder = self.clone();
5545 builder.0.request = builder.0.request.set_page_token(token);
5546 builder.send()
5547 };
5548 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5549 }
5550
5551 pub fn by_item(
5553 self,
5554 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5555 crate::model::LookupEntryLinksResponse,
5556 crate::Error,
5557 > {
5558 use google_cloud_gax::paginator::Paginator;
5559 self.by_page().items()
5560 }
5561
5562 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5566 self.0.request.name = v.into();
5567 self
5568 }
5569
5570 pub fn set_entry<T: Into<std::string::String>>(mut self, v: T) -> Self {
5574 self.0.request.entry = v.into();
5575 self
5576 }
5577
5578 pub fn set_entry_mode<T: Into<crate::model::lookup_entry_links_request::EntryMode>>(
5580 mut self,
5581 v: T,
5582 ) -> Self {
5583 self.0.request.entry_mode = v.into();
5584 self
5585 }
5586
5587 pub fn set_entry_link_types<T, V>(mut self, v: T) -> Self
5589 where
5590 T: std::iter::IntoIterator<Item = V>,
5591 V: std::convert::Into<std::string::String>,
5592 {
5593 use std::iter::Iterator;
5594 self.0.request.entry_link_types = v.into_iter().map(|i| i.into()).collect();
5595 self
5596 }
5597
5598 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5600 self.0.request.page_size = v.into();
5601 self
5602 }
5603
5604 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5606 self.0.request.page_token = v.into();
5607 self
5608 }
5609 }
5610
5611 #[doc(hidden)]
5612 impl crate::RequestBuilder for LookupEntryLinks {
5613 fn request_options(&mut self) -> &mut crate::RequestOptions {
5614 &mut self.0.options
5615 }
5616 }
5617
5618 #[derive(Clone, Debug)]
5635 pub struct LookupContext(RequestBuilder<crate::model::LookupContextRequest>);
5636
5637 impl LookupContext {
5638 pub(crate) fn new(
5639 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5640 ) -> Self {
5641 Self(RequestBuilder::new(stub))
5642 }
5643
5644 pub fn with_request<V: Into<crate::model::LookupContextRequest>>(mut self, v: V) -> Self {
5646 self.0.request = v.into();
5647 self
5648 }
5649
5650 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5652 self.0.options = v.into();
5653 self
5654 }
5655
5656 pub async fn send(self) -> Result<crate::model::LookupContextResponse> {
5658 (*self.0.stub)
5659 .lookup_context(self.0.request, self.0.options)
5660 .await
5661 .map(crate::Response::into_body)
5662 }
5663
5664 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5668 self.0.request.name = v.into();
5669 self
5670 }
5671
5672 pub fn set_resources<T, V>(mut self, v: T) -> Self
5676 where
5677 T: std::iter::IntoIterator<Item = V>,
5678 V: std::convert::Into<std::string::String>,
5679 {
5680 use std::iter::Iterator;
5681 self.0.request.resources = v.into_iter().map(|i| i.into()).collect();
5682 self
5683 }
5684
5685 pub fn set_options<T, K, V>(mut self, v: T) -> Self
5687 where
5688 T: std::iter::IntoIterator<Item = (K, V)>,
5689 K: std::convert::Into<std::string::String>,
5690 V: std::convert::Into<std::string::String>,
5691 {
5692 self.0.request.options = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5693 self
5694 }
5695 }
5696
5697 #[doc(hidden)]
5698 impl crate::RequestBuilder for LookupContext {
5699 fn request_options(&mut self) -> &mut crate::RequestOptions {
5700 &mut self.0.options
5701 }
5702 }
5703
5704 #[derive(Clone, Debug)]
5721 pub struct GetEntryLink(RequestBuilder<crate::model::GetEntryLinkRequest>);
5722
5723 impl GetEntryLink {
5724 pub(crate) fn new(
5725 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5726 ) -> Self {
5727 Self(RequestBuilder::new(stub))
5728 }
5729
5730 pub fn with_request<V: Into<crate::model::GetEntryLinkRequest>>(mut self, v: V) -> Self {
5732 self.0.request = v.into();
5733 self
5734 }
5735
5736 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5738 self.0.options = v.into();
5739 self
5740 }
5741
5742 pub async fn send(self) -> Result<crate::model::EntryLink> {
5744 (*self.0.stub)
5745 .get_entry_link(self.0.request, self.0.options)
5746 .await
5747 .map(crate::Response::into_body)
5748 }
5749
5750 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5754 self.0.request.name = v.into();
5755 self
5756 }
5757 }
5758
5759 #[doc(hidden)]
5760 impl crate::RequestBuilder for GetEntryLink {
5761 fn request_options(&mut self) -> &mut crate::RequestOptions {
5762 &mut self.0.options
5763 }
5764 }
5765
5766 #[derive(Clone, Debug)]
5784 pub struct CreateMetadataFeed(RequestBuilder<crate::model::CreateMetadataFeedRequest>);
5785
5786 impl CreateMetadataFeed {
5787 pub(crate) fn new(
5788 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5789 ) -> Self {
5790 Self(RequestBuilder::new(stub))
5791 }
5792
5793 pub fn with_request<V: Into<crate::model::CreateMetadataFeedRequest>>(
5795 mut self,
5796 v: V,
5797 ) -> Self {
5798 self.0.request = v.into();
5799 self
5800 }
5801
5802 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5804 self.0.options = v.into();
5805 self
5806 }
5807
5808 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5815 (*self.0.stub)
5816 .create_metadata_feed(self.0.request, self.0.options)
5817 .await
5818 .map(crate::Response::into_body)
5819 }
5820
5821 pub fn poller(
5823 self,
5824 ) -> impl google_cloud_lro::Poller<crate::model::MetadataFeed, crate::model::OperationMetadata>
5825 {
5826 type Operation = google_cloud_lro::internal::Operation<
5827 crate::model::MetadataFeed,
5828 crate::model::OperationMetadata,
5829 >;
5830 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5831 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5832
5833 let stub = self.0.stub.clone();
5834 let mut options = self.0.options.clone();
5835 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5836 let query = move |name| {
5837 let stub = stub.clone();
5838 let options = options.clone();
5839 async {
5840 let op = GetOperation::new(stub)
5841 .set_name(name)
5842 .with_options(options)
5843 .send()
5844 .await?;
5845 Ok(Operation::new(op))
5846 }
5847 };
5848
5849 let start = move || async {
5850 let op = self.send().await?;
5851 Ok(Operation::new(op))
5852 };
5853
5854 google_cloud_lro::internal::new_poller(
5855 polling_error_policy,
5856 polling_backoff_policy,
5857 start,
5858 query,
5859 )
5860 }
5861
5862 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5866 self.0.request.parent = v.into();
5867 self
5868 }
5869
5870 pub fn set_metadata_feed<T>(mut self, v: T) -> Self
5874 where
5875 T: std::convert::Into<crate::model::MetadataFeed>,
5876 {
5877 self.0.request.metadata_feed = std::option::Option::Some(v.into());
5878 self
5879 }
5880
5881 pub fn set_or_clear_metadata_feed<T>(mut self, v: std::option::Option<T>) -> Self
5885 where
5886 T: std::convert::Into<crate::model::MetadataFeed>,
5887 {
5888 self.0.request.metadata_feed = v.map(|x| x.into());
5889 self
5890 }
5891
5892 pub fn set_metadata_feed_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5894 self.0.request.metadata_feed_id = v.into();
5895 self
5896 }
5897
5898 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5900 self.0.request.validate_only = v.into();
5901 self
5902 }
5903 }
5904
5905 #[doc(hidden)]
5906 impl crate::RequestBuilder for CreateMetadataFeed {
5907 fn request_options(&mut self) -> &mut crate::RequestOptions {
5908 &mut self.0.options
5909 }
5910 }
5911
5912 #[derive(Clone, Debug)]
5929 pub struct GetMetadataFeed(RequestBuilder<crate::model::GetMetadataFeedRequest>);
5930
5931 impl GetMetadataFeed {
5932 pub(crate) fn new(
5933 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5934 ) -> Self {
5935 Self(RequestBuilder::new(stub))
5936 }
5937
5938 pub fn with_request<V: Into<crate::model::GetMetadataFeedRequest>>(mut self, v: V) -> Self {
5940 self.0.request = v.into();
5941 self
5942 }
5943
5944 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5946 self.0.options = v.into();
5947 self
5948 }
5949
5950 pub async fn send(self) -> Result<crate::model::MetadataFeed> {
5952 (*self.0.stub)
5953 .get_metadata_feed(self.0.request, self.0.options)
5954 .await
5955 .map(crate::Response::into_body)
5956 }
5957
5958 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5962 self.0.request.name = v.into();
5963 self
5964 }
5965 }
5966
5967 #[doc(hidden)]
5968 impl crate::RequestBuilder for GetMetadataFeed {
5969 fn request_options(&mut self) -> &mut crate::RequestOptions {
5970 &mut self.0.options
5971 }
5972 }
5973
5974 #[derive(Clone, Debug)]
5995 pub struct ListMetadataFeeds(RequestBuilder<crate::model::ListMetadataFeedsRequest>);
5996
5997 impl ListMetadataFeeds {
5998 pub(crate) fn new(
5999 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6000 ) -> Self {
6001 Self(RequestBuilder::new(stub))
6002 }
6003
6004 pub fn with_request<V: Into<crate::model::ListMetadataFeedsRequest>>(
6006 mut self,
6007 v: V,
6008 ) -> Self {
6009 self.0.request = v.into();
6010 self
6011 }
6012
6013 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6015 self.0.options = v.into();
6016 self
6017 }
6018
6019 pub async fn send(self) -> Result<crate::model::ListMetadataFeedsResponse> {
6021 (*self.0.stub)
6022 .list_metadata_feeds(self.0.request, self.0.options)
6023 .await
6024 .map(crate::Response::into_body)
6025 }
6026
6027 pub fn by_page(
6029 self,
6030 ) -> impl google_cloud_gax::paginator::Paginator<
6031 crate::model::ListMetadataFeedsResponse,
6032 crate::Error,
6033 > {
6034 use std::clone::Clone;
6035 let token = self.0.request.page_token.clone();
6036 let execute = move |token: String| {
6037 let mut builder = self.clone();
6038 builder.0.request = builder.0.request.set_page_token(token);
6039 builder.send()
6040 };
6041 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6042 }
6043
6044 pub fn by_item(
6046 self,
6047 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6048 crate::model::ListMetadataFeedsResponse,
6049 crate::Error,
6050 > {
6051 use google_cloud_gax::paginator::Paginator;
6052 self.by_page().items()
6053 }
6054
6055 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6059 self.0.request.parent = v.into();
6060 self
6061 }
6062
6063 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6065 self.0.request.page_size = v.into();
6066 self
6067 }
6068
6069 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6071 self.0.request.page_token = v.into();
6072 self
6073 }
6074
6075 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6077 self.0.request.filter = v.into();
6078 self
6079 }
6080
6081 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6083 self.0.request.order_by = v.into();
6084 self
6085 }
6086 }
6087
6088 #[doc(hidden)]
6089 impl crate::RequestBuilder for ListMetadataFeeds {
6090 fn request_options(&mut self) -> &mut crate::RequestOptions {
6091 &mut self.0.options
6092 }
6093 }
6094
6095 #[derive(Clone, Debug)]
6113 pub struct DeleteMetadataFeed(RequestBuilder<crate::model::DeleteMetadataFeedRequest>);
6114
6115 impl DeleteMetadataFeed {
6116 pub(crate) fn new(
6117 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6118 ) -> Self {
6119 Self(RequestBuilder::new(stub))
6120 }
6121
6122 pub fn with_request<V: Into<crate::model::DeleteMetadataFeedRequest>>(
6124 mut self,
6125 v: V,
6126 ) -> Self {
6127 self.0.request = v.into();
6128 self
6129 }
6130
6131 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6133 self.0.options = v.into();
6134 self
6135 }
6136
6137 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6144 (*self.0.stub)
6145 .delete_metadata_feed(self.0.request, self.0.options)
6146 .await
6147 .map(crate::Response::into_body)
6148 }
6149
6150 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6152 type Operation =
6153 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6154 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6155 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6156
6157 let stub = self.0.stub.clone();
6158 let mut options = self.0.options.clone();
6159 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6160 let query = move |name| {
6161 let stub = stub.clone();
6162 let options = options.clone();
6163 async {
6164 let op = GetOperation::new(stub)
6165 .set_name(name)
6166 .with_options(options)
6167 .send()
6168 .await?;
6169 Ok(Operation::new(op))
6170 }
6171 };
6172
6173 let start = move || async {
6174 let op = self.send().await?;
6175 Ok(Operation::new(op))
6176 };
6177
6178 google_cloud_lro::internal::new_unit_response_poller(
6179 polling_error_policy,
6180 polling_backoff_policy,
6181 start,
6182 query,
6183 )
6184 }
6185
6186 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6190 self.0.request.name = v.into();
6191 self
6192 }
6193 }
6194
6195 #[doc(hidden)]
6196 impl crate::RequestBuilder for DeleteMetadataFeed {
6197 fn request_options(&mut self) -> &mut crate::RequestOptions {
6198 &mut self.0.options
6199 }
6200 }
6201
6202 #[derive(Clone, Debug)]
6220 pub struct UpdateMetadataFeed(RequestBuilder<crate::model::UpdateMetadataFeedRequest>);
6221
6222 impl UpdateMetadataFeed {
6223 pub(crate) fn new(
6224 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6225 ) -> Self {
6226 Self(RequestBuilder::new(stub))
6227 }
6228
6229 pub fn with_request<V: Into<crate::model::UpdateMetadataFeedRequest>>(
6231 mut self,
6232 v: V,
6233 ) -> Self {
6234 self.0.request = v.into();
6235 self
6236 }
6237
6238 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6240 self.0.options = v.into();
6241 self
6242 }
6243
6244 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6251 (*self.0.stub)
6252 .update_metadata_feed(self.0.request, self.0.options)
6253 .await
6254 .map(crate::Response::into_body)
6255 }
6256
6257 pub fn poller(
6259 self,
6260 ) -> impl google_cloud_lro::Poller<crate::model::MetadataFeed, crate::model::OperationMetadata>
6261 {
6262 type Operation = google_cloud_lro::internal::Operation<
6263 crate::model::MetadataFeed,
6264 crate::model::OperationMetadata,
6265 >;
6266 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6267 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6268
6269 let stub = self.0.stub.clone();
6270 let mut options = self.0.options.clone();
6271 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6272 let query = move |name| {
6273 let stub = stub.clone();
6274 let options = options.clone();
6275 async {
6276 let op = GetOperation::new(stub)
6277 .set_name(name)
6278 .with_options(options)
6279 .send()
6280 .await?;
6281 Ok(Operation::new(op))
6282 }
6283 };
6284
6285 let start = move || async {
6286 let op = self.send().await?;
6287 Ok(Operation::new(op))
6288 };
6289
6290 google_cloud_lro::internal::new_poller(
6291 polling_error_policy,
6292 polling_backoff_policy,
6293 start,
6294 query,
6295 )
6296 }
6297
6298 pub fn set_metadata_feed<T>(mut self, v: T) -> Self
6302 where
6303 T: std::convert::Into<crate::model::MetadataFeed>,
6304 {
6305 self.0.request.metadata_feed = std::option::Option::Some(v.into());
6306 self
6307 }
6308
6309 pub fn set_or_clear_metadata_feed<T>(mut self, v: std::option::Option<T>) -> Self
6313 where
6314 T: std::convert::Into<crate::model::MetadataFeed>,
6315 {
6316 self.0.request.metadata_feed = v.map(|x| x.into());
6317 self
6318 }
6319
6320 pub fn set_update_mask<T>(mut self, v: T) -> Self
6322 where
6323 T: std::convert::Into<wkt::FieldMask>,
6324 {
6325 self.0.request.update_mask = std::option::Option::Some(v.into());
6326 self
6327 }
6328
6329 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6331 where
6332 T: std::convert::Into<wkt::FieldMask>,
6333 {
6334 self.0.request.update_mask = v.map(|x| x.into());
6335 self
6336 }
6337
6338 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
6340 self.0.request.validate_only = v.into();
6341 self
6342 }
6343 }
6344
6345 #[doc(hidden)]
6346 impl crate::RequestBuilder for UpdateMetadataFeed {
6347 fn request_options(&mut self) -> &mut crate::RequestOptions {
6348 &mut self.0.options
6349 }
6350 }
6351
6352 #[derive(Clone, Debug)]
6373 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6374
6375 impl ListLocations {
6376 pub(crate) fn new(
6377 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6378 ) -> Self {
6379 Self(RequestBuilder::new(stub))
6380 }
6381
6382 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6384 mut self,
6385 v: V,
6386 ) -> Self {
6387 self.0.request = v.into();
6388 self
6389 }
6390
6391 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6393 self.0.options = v.into();
6394 self
6395 }
6396
6397 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6399 (*self.0.stub)
6400 .list_locations(self.0.request, self.0.options)
6401 .await
6402 .map(crate::Response::into_body)
6403 }
6404
6405 pub fn by_page(
6407 self,
6408 ) -> impl google_cloud_gax::paginator::Paginator<
6409 google_cloud_location::model::ListLocationsResponse,
6410 crate::Error,
6411 > {
6412 use std::clone::Clone;
6413 let token = self.0.request.page_token.clone();
6414 let execute = move |token: String| {
6415 let mut builder = self.clone();
6416 builder.0.request = builder.0.request.set_page_token(token);
6417 builder.send()
6418 };
6419 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6420 }
6421
6422 pub fn by_item(
6424 self,
6425 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6426 google_cloud_location::model::ListLocationsResponse,
6427 crate::Error,
6428 > {
6429 use google_cloud_gax::paginator::Paginator;
6430 self.by_page().items()
6431 }
6432
6433 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6435 self.0.request.name = v.into();
6436 self
6437 }
6438
6439 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6441 self.0.request.filter = v.into();
6442 self
6443 }
6444
6445 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6447 self.0.request.page_size = v.into();
6448 self
6449 }
6450
6451 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6453 self.0.request.page_token = v.into();
6454 self
6455 }
6456 }
6457
6458 #[doc(hidden)]
6459 impl crate::RequestBuilder for ListLocations {
6460 fn request_options(&mut self) -> &mut crate::RequestOptions {
6461 &mut self.0.options
6462 }
6463 }
6464
6465 #[derive(Clone, Debug)]
6482 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6483
6484 impl GetLocation {
6485 pub(crate) fn new(
6486 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6487 ) -> Self {
6488 Self(RequestBuilder::new(stub))
6489 }
6490
6491 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6493 mut self,
6494 v: V,
6495 ) -> Self {
6496 self.0.request = v.into();
6497 self
6498 }
6499
6500 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6502 self.0.options = v.into();
6503 self
6504 }
6505
6506 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6508 (*self.0.stub)
6509 .get_location(self.0.request, self.0.options)
6510 .await
6511 .map(crate::Response::into_body)
6512 }
6513
6514 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6516 self.0.request.name = v.into();
6517 self
6518 }
6519 }
6520
6521 #[doc(hidden)]
6522 impl crate::RequestBuilder for GetLocation {
6523 fn request_options(&mut self) -> &mut crate::RequestOptions {
6524 &mut self.0.options
6525 }
6526 }
6527
6528 #[derive(Clone, Debug)]
6545 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6546
6547 impl SetIamPolicy {
6548 pub(crate) fn new(
6549 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6550 ) -> Self {
6551 Self(RequestBuilder::new(stub))
6552 }
6553
6554 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6556 mut self,
6557 v: V,
6558 ) -> Self {
6559 self.0.request = v.into();
6560 self
6561 }
6562
6563 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6565 self.0.options = v.into();
6566 self
6567 }
6568
6569 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6571 (*self.0.stub)
6572 .set_iam_policy(self.0.request, self.0.options)
6573 .await
6574 .map(crate::Response::into_body)
6575 }
6576
6577 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6581 self.0.request.resource = v.into();
6582 self
6583 }
6584
6585 pub fn set_policy<T>(mut self, v: T) -> Self
6589 where
6590 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6591 {
6592 self.0.request.policy = std::option::Option::Some(v.into());
6593 self
6594 }
6595
6596 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6600 where
6601 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6602 {
6603 self.0.request.policy = v.map(|x| x.into());
6604 self
6605 }
6606
6607 pub fn set_update_mask<T>(mut self, v: T) -> Self
6609 where
6610 T: std::convert::Into<wkt::FieldMask>,
6611 {
6612 self.0.request.update_mask = std::option::Option::Some(v.into());
6613 self
6614 }
6615
6616 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6618 where
6619 T: std::convert::Into<wkt::FieldMask>,
6620 {
6621 self.0.request.update_mask = v.map(|x| x.into());
6622 self
6623 }
6624 }
6625
6626 #[doc(hidden)]
6627 impl crate::RequestBuilder for SetIamPolicy {
6628 fn request_options(&mut self) -> &mut crate::RequestOptions {
6629 &mut self.0.options
6630 }
6631 }
6632
6633 #[derive(Clone, Debug)]
6650 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6651
6652 impl GetIamPolicy {
6653 pub(crate) fn new(
6654 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6655 ) -> Self {
6656 Self(RequestBuilder::new(stub))
6657 }
6658
6659 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6661 mut self,
6662 v: V,
6663 ) -> Self {
6664 self.0.request = v.into();
6665 self
6666 }
6667
6668 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6670 self.0.options = v.into();
6671 self
6672 }
6673
6674 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6676 (*self.0.stub)
6677 .get_iam_policy(self.0.request, self.0.options)
6678 .await
6679 .map(crate::Response::into_body)
6680 }
6681
6682 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6686 self.0.request.resource = v.into();
6687 self
6688 }
6689
6690 pub fn set_options<T>(mut self, v: T) -> Self
6692 where
6693 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6694 {
6695 self.0.request.options = std::option::Option::Some(v.into());
6696 self
6697 }
6698
6699 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6701 where
6702 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6703 {
6704 self.0.request.options = v.map(|x| x.into());
6705 self
6706 }
6707 }
6708
6709 #[doc(hidden)]
6710 impl crate::RequestBuilder for GetIamPolicy {
6711 fn request_options(&mut self) -> &mut crate::RequestOptions {
6712 &mut self.0.options
6713 }
6714 }
6715
6716 #[derive(Clone, Debug)]
6733 pub struct TestIamPermissions(
6734 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6735 );
6736
6737 impl TestIamPermissions {
6738 pub(crate) fn new(
6739 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6740 ) -> Self {
6741 Self(RequestBuilder::new(stub))
6742 }
6743
6744 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6746 mut self,
6747 v: V,
6748 ) -> Self {
6749 self.0.request = v.into();
6750 self
6751 }
6752
6753 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6755 self.0.options = v.into();
6756 self
6757 }
6758
6759 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6761 (*self.0.stub)
6762 .test_iam_permissions(self.0.request, self.0.options)
6763 .await
6764 .map(crate::Response::into_body)
6765 }
6766
6767 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6771 self.0.request.resource = v.into();
6772 self
6773 }
6774
6775 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6779 where
6780 T: std::iter::IntoIterator<Item = V>,
6781 V: std::convert::Into<std::string::String>,
6782 {
6783 use std::iter::Iterator;
6784 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6785 self
6786 }
6787 }
6788
6789 #[doc(hidden)]
6790 impl crate::RequestBuilder for TestIamPermissions {
6791 fn request_options(&mut self) -> &mut crate::RequestOptions {
6792 &mut self.0.options
6793 }
6794 }
6795
6796 #[derive(Clone, Debug)]
6817 pub struct ListOperations(
6818 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6819 );
6820
6821 impl ListOperations {
6822 pub(crate) fn new(
6823 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6824 ) -> Self {
6825 Self(RequestBuilder::new(stub))
6826 }
6827
6828 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6830 mut self,
6831 v: V,
6832 ) -> Self {
6833 self.0.request = v.into();
6834 self
6835 }
6836
6837 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6839 self.0.options = v.into();
6840 self
6841 }
6842
6843 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6845 (*self.0.stub)
6846 .list_operations(self.0.request, self.0.options)
6847 .await
6848 .map(crate::Response::into_body)
6849 }
6850
6851 pub fn by_page(
6853 self,
6854 ) -> impl google_cloud_gax::paginator::Paginator<
6855 google_cloud_longrunning::model::ListOperationsResponse,
6856 crate::Error,
6857 > {
6858 use std::clone::Clone;
6859 let token = self.0.request.page_token.clone();
6860 let execute = move |token: String| {
6861 let mut builder = self.clone();
6862 builder.0.request = builder.0.request.set_page_token(token);
6863 builder.send()
6864 };
6865 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6866 }
6867
6868 pub fn by_item(
6870 self,
6871 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6872 google_cloud_longrunning::model::ListOperationsResponse,
6873 crate::Error,
6874 > {
6875 use google_cloud_gax::paginator::Paginator;
6876 self.by_page().items()
6877 }
6878
6879 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6881 self.0.request.name = v.into();
6882 self
6883 }
6884
6885 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6887 self.0.request.filter = v.into();
6888 self
6889 }
6890
6891 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6893 self.0.request.page_size = v.into();
6894 self
6895 }
6896
6897 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6899 self.0.request.page_token = v.into();
6900 self
6901 }
6902
6903 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6905 self.0.request.return_partial_success = v.into();
6906 self
6907 }
6908 }
6909
6910 #[doc(hidden)]
6911 impl crate::RequestBuilder for ListOperations {
6912 fn request_options(&mut self) -> &mut crate::RequestOptions {
6913 &mut self.0.options
6914 }
6915 }
6916
6917 #[derive(Clone, Debug)]
6934 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6935
6936 impl GetOperation {
6937 pub(crate) fn new(
6938 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6939 ) -> Self {
6940 Self(RequestBuilder::new(stub))
6941 }
6942
6943 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6945 mut self,
6946 v: V,
6947 ) -> Self {
6948 self.0.request = v.into();
6949 self
6950 }
6951
6952 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6954 self.0.options = v.into();
6955 self
6956 }
6957
6958 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6960 (*self.0.stub)
6961 .get_operation(self.0.request, self.0.options)
6962 .await
6963 .map(crate::Response::into_body)
6964 }
6965
6966 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6968 self.0.request.name = v.into();
6969 self
6970 }
6971 }
6972
6973 #[doc(hidden)]
6974 impl crate::RequestBuilder for GetOperation {
6975 fn request_options(&mut self) -> &mut crate::RequestOptions {
6976 &mut self.0.options
6977 }
6978 }
6979
6980 #[derive(Clone, Debug)]
6997 pub struct DeleteOperation(
6998 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
6999 );
7000
7001 impl DeleteOperation {
7002 pub(crate) fn new(
7003 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
7004 ) -> Self {
7005 Self(RequestBuilder::new(stub))
7006 }
7007
7008 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7010 mut self,
7011 v: V,
7012 ) -> Self {
7013 self.0.request = v.into();
7014 self
7015 }
7016
7017 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7019 self.0.options = v.into();
7020 self
7021 }
7022
7023 pub async fn send(self) -> Result<()> {
7025 (*self.0.stub)
7026 .delete_operation(self.0.request, self.0.options)
7027 .await
7028 .map(crate::Response::into_body)
7029 }
7030
7031 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7033 self.0.request.name = v.into();
7034 self
7035 }
7036 }
7037
7038 #[doc(hidden)]
7039 impl crate::RequestBuilder for DeleteOperation {
7040 fn request_options(&mut self) -> &mut crate::RequestOptions {
7041 &mut self.0.options
7042 }
7043 }
7044
7045 #[derive(Clone, Debug)]
7062 pub struct CancelOperation(
7063 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7064 );
7065
7066 impl CancelOperation {
7067 pub(crate) fn new(
7068 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
7069 ) -> Self {
7070 Self(RequestBuilder::new(stub))
7071 }
7072
7073 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7075 mut self,
7076 v: V,
7077 ) -> Self {
7078 self.0.request = v.into();
7079 self
7080 }
7081
7082 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7084 self.0.options = v.into();
7085 self
7086 }
7087
7088 pub async fn send(self) -> Result<()> {
7090 (*self.0.stub)
7091 .cancel_operation(self.0.request, self.0.options)
7092 .await
7093 .map(crate::Response::into_body)
7094 }
7095
7096 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7098 self.0.request.name = v.into();
7099 self
7100 }
7101 }
7102
7103 #[doc(hidden)]
7104 impl crate::RequestBuilder for CancelOperation {
7105 fn request_options(&mut self) -> &mut crate::RequestOptions {
7106 &mut self.0.options
7107 }
7108 }
7109}
7110
7111pub mod cmek_service {
7112 use crate::Result;
7113
7114 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7128
7129 pub(crate) mod client {
7130 use super::super::super::client::CmekService;
7131 pub struct Factory;
7132 impl crate::ClientFactory for Factory {
7133 type Client = CmekService;
7134 type Credentials = gaxi::options::Credentials;
7135 async fn build(
7136 self,
7137 config: gaxi::options::ClientConfig,
7138 ) -> crate::ClientBuilderResult<Self::Client> {
7139 Self::Client::new(config).await
7140 }
7141 }
7142 }
7143
7144 #[derive(Clone, Debug)]
7146 pub(crate) struct RequestBuilder<R: std::default::Default> {
7147 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7148 request: R,
7149 options: crate::RequestOptions,
7150 }
7151
7152 impl<R> RequestBuilder<R>
7153 where
7154 R: std::default::Default,
7155 {
7156 pub(crate) fn new(
7157 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7158 ) -> Self {
7159 Self {
7160 stub,
7161 request: R::default(),
7162 options: crate::RequestOptions::default(),
7163 }
7164 }
7165 }
7166
7167 #[derive(Clone, Debug)]
7185 pub struct CreateEncryptionConfig(RequestBuilder<crate::model::CreateEncryptionConfigRequest>);
7186
7187 impl CreateEncryptionConfig {
7188 pub(crate) fn new(
7189 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7190 ) -> Self {
7191 Self(RequestBuilder::new(stub))
7192 }
7193
7194 pub fn with_request<V: Into<crate::model::CreateEncryptionConfigRequest>>(
7196 mut self,
7197 v: V,
7198 ) -> Self {
7199 self.0.request = v.into();
7200 self
7201 }
7202
7203 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7205 self.0.options = v.into();
7206 self
7207 }
7208
7209 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7216 (*self.0.stub)
7217 .create_encryption_config(self.0.request, self.0.options)
7218 .await
7219 .map(crate::Response::into_body)
7220 }
7221
7222 pub fn poller(
7224 self,
7225 ) -> impl google_cloud_lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
7226 {
7227 type Operation = google_cloud_lro::internal::Operation<
7228 crate::model::EncryptionConfig,
7229 crate::model::OperationMetadata,
7230 >;
7231 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7232 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7233
7234 let stub = self.0.stub.clone();
7235 let mut options = self.0.options.clone();
7236 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7237 let query = move |name| {
7238 let stub = stub.clone();
7239 let options = options.clone();
7240 async {
7241 let op = GetOperation::new(stub)
7242 .set_name(name)
7243 .with_options(options)
7244 .send()
7245 .await?;
7246 Ok(Operation::new(op))
7247 }
7248 };
7249
7250 let start = move || async {
7251 let op = self.send().await?;
7252 Ok(Operation::new(op))
7253 };
7254
7255 google_cloud_lro::internal::new_poller(
7256 polling_error_policy,
7257 polling_backoff_policy,
7258 start,
7259 query,
7260 )
7261 }
7262
7263 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7267 self.0.request.parent = v.into();
7268 self
7269 }
7270
7271 pub fn set_encryption_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7275 self.0.request.encryption_config_id = v.into();
7276 self
7277 }
7278
7279 pub fn set_encryption_config<T>(mut self, v: T) -> Self
7283 where
7284 T: std::convert::Into<crate::model::EncryptionConfig>,
7285 {
7286 self.0.request.encryption_config = std::option::Option::Some(v.into());
7287 self
7288 }
7289
7290 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
7294 where
7295 T: std::convert::Into<crate::model::EncryptionConfig>,
7296 {
7297 self.0.request.encryption_config = v.map(|x| x.into());
7298 self
7299 }
7300 }
7301
7302 #[doc(hidden)]
7303 impl crate::RequestBuilder for CreateEncryptionConfig {
7304 fn request_options(&mut self) -> &mut crate::RequestOptions {
7305 &mut self.0.options
7306 }
7307 }
7308
7309 #[derive(Clone, Debug)]
7327 pub struct UpdateEncryptionConfig(RequestBuilder<crate::model::UpdateEncryptionConfigRequest>);
7328
7329 impl UpdateEncryptionConfig {
7330 pub(crate) fn new(
7331 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7332 ) -> Self {
7333 Self(RequestBuilder::new(stub))
7334 }
7335
7336 pub fn with_request<V: Into<crate::model::UpdateEncryptionConfigRequest>>(
7338 mut self,
7339 v: V,
7340 ) -> Self {
7341 self.0.request = v.into();
7342 self
7343 }
7344
7345 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7347 self.0.options = v.into();
7348 self
7349 }
7350
7351 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7358 (*self.0.stub)
7359 .update_encryption_config(self.0.request, self.0.options)
7360 .await
7361 .map(crate::Response::into_body)
7362 }
7363
7364 pub fn poller(
7366 self,
7367 ) -> impl google_cloud_lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
7368 {
7369 type Operation = google_cloud_lro::internal::Operation<
7370 crate::model::EncryptionConfig,
7371 crate::model::OperationMetadata,
7372 >;
7373 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7374 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7375
7376 let stub = self.0.stub.clone();
7377 let mut options = self.0.options.clone();
7378 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7379 let query = move |name| {
7380 let stub = stub.clone();
7381 let options = options.clone();
7382 async {
7383 let op = GetOperation::new(stub)
7384 .set_name(name)
7385 .with_options(options)
7386 .send()
7387 .await?;
7388 Ok(Operation::new(op))
7389 }
7390 };
7391
7392 let start = move || async {
7393 let op = self.send().await?;
7394 Ok(Operation::new(op))
7395 };
7396
7397 google_cloud_lro::internal::new_poller(
7398 polling_error_policy,
7399 polling_backoff_policy,
7400 start,
7401 query,
7402 )
7403 }
7404
7405 pub fn set_encryption_config<T>(mut self, v: T) -> Self
7409 where
7410 T: std::convert::Into<crate::model::EncryptionConfig>,
7411 {
7412 self.0.request.encryption_config = std::option::Option::Some(v.into());
7413 self
7414 }
7415
7416 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
7420 where
7421 T: std::convert::Into<crate::model::EncryptionConfig>,
7422 {
7423 self.0.request.encryption_config = v.map(|x| x.into());
7424 self
7425 }
7426
7427 pub fn set_update_mask<T>(mut self, v: T) -> Self
7429 where
7430 T: std::convert::Into<wkt::FieldMask>,
7431 {
7432 self.0.request.update_mask = std::option::Option::Some(v.into());
7433 self
7434 }
7435
7436 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7438 where
7439 T: std::convert::Into<wkt::FieldMask>,
7440 {
7441 self.0.request.update_mask = v.map(|x| x.into());
7442 self
7443 }
7444 }
7445
7446 #[doc(hidden)]
7447 impl crate::RequestBuilder for UpdateEncryptionConfig {
7448 fn request_options(&mut self) -> &mut crate::RequestOptions {
7449 &mut self.0.options
7450 }
7451 }
7452
7453 #[derive(Clone, Debug)]
7471 pub struct DeleteEncryptionConfig(RequestBuilder<crate::model::DeleteEncryptionConfigRequest>);
7472
7473 impl DeleteEncryptionConfig {
7474 pub(crate) fn new(
7475 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7476 ) -> Self {
7477 Self(RequestBuilder::new(stub))
7478 }
7479
7480 pub fn with_request<V: Into<crate::model::DeleteEncryptionConfigRequest>>(
7482 mut self,
7483 v: V,
7484 ) -> Self {
7485 self.0.request = v.into();
7486 self
7487 }
7488
7489 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7491 self.0.options = v.into();
7492 self
7493 }
7494
7495 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7502 (*self.0.stub)
7503 .delete_encryption_config(self.0.request, self.0.options)
7504 .await
7505 .map(crate::Response::into_body)
7506 }
7507
7508 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7510 type Operation =
7511 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7512 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7513 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7514
7515 let stub = self.0.stub.clone();
7516 let mut options = self.0.options.clone();
7517 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7518 let query = move |name| {
7519 let stub = stub.clone();
7520 let options = options.clone();
7521 async {
7522 let op = GetOperation::new(stub)
7523 .set_name(name)
7524 .with_options(options)
7525 .send()
7526 .await?;
7527 Ok(Operation::new(op))
7528 }
7529 };
7530
7531 let start = move || async {
7532 let op = self.send().await?;
7533 Ok(Operation::new(op))
7534 };
7535
7536 google_cloud_lro::internal::new_unit_response_poller(
7537 polling_error_policy,
7538 polling_backoff_policy,
7539 start,
7540 query,
7541 )
7542 }
7543
7544 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7548 self.0.request.name = v.into();
7549 self
7550 }
7551
7552 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7554 self.0.request.etag = v.into();
7555 self
7556 }
7557 }
7558
7559 #[doc(hidden)]
7560 impl crate::RequestBuilder for DeleteEncryptionConfig {
7561 fn request_options(&mut self) -> &mut crate::RequestOptions {
7562 &mut self.0.options
7563 }
7564 }
7565
7566 #[derive(Clone, Debug)]
7587 pub struct ListEncryptionConfigs(RequestBuilder<crate::model::ListEncryptionConfigsRequest>);
7588
7589 impl ListEncryptionConfigs {
7590 pub(crate) fn new(
7591 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7592 ) -> Self {
7593 Self(RequestBuilder::new(stub))
7594 }
7595
7596 pub fn with_request<V: Into<crate::model::ListEncryptionConfigsRequest>>(
7598 mut self,
7599 v: V,
7600 ) -> Self {
7601 self.0.request = v.into();
7602 self
7603 }
7604
7605 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7607 self.0.options = v.into();
7608 self
7609 }
7610
7611 pub async fn send(self) -> Result<crate::model::ListEncryptionConfigsResponse> {
7613 (*self.0.stub)
7614 .list_encryption_configs(self.0.request, self.0.options)
7615 .await
7616 .map(crate::Response::into_body)
7617 }
7618
7619 pub fn by_page(
7621 self,
7622 ) -> impl google_cloud_gax::paginator::Paginator<
7623 crate::model::ListEncryptionConfigsResponse,
7624 crate::Error,
7625 > {
7626 use std::clone::Clone;
7627 let token = self.0.request.page_token.clone();
7628 let execute = move |token: String| {
7629 let mut builder = self.clone();
7630 builder.0.request = builder.0.request.set_page_token(token);
7631 builder.send()
7632 };
7633 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7634 }
7635
7636 pub fn by_item(
7638 self,
7639 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7640 crate::model::ListEncryptionConfigsResponse,
7641 crate::Error,
7642 > {
7643 use google_cloud_gax::paginator::Paginator;
7644 self.by_page().items()
7645 }
7646
7647 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7651 self.0.request.parent = v.into();
7652 self
7653 }
7654
7655 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7657 self.0.request.page_size = v.into();
7658 self
7659 }
7660
7661 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7663 self.0.request.page_token = v.into();
7664 self
7665 }
7666
7667 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7669 self.0.request.filter = v.into();
7670 self
7671 }
7672
7673 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7675 self.0.request.order_by = v.into();
7676 self
7677 }
7678 }
7679
7680 #[doc(hidden)]
7681 impl crate::RequestBuilder for ListEncryptionConfigs {
7682 fn request_options(&mut self) -> &mut crate::RequestOptions {
7683 &mut self.0.options
7684 }
7685 }
7686
7687 #[derive(Clone, Debug)]
7704 pub struct GetEncryptionConfig(RequestBuilder<crate::model::GetEncryptionConfigRequest>);
7705
7706 impl GetEncryptionConfig {
7707 pub(crate) fn new(
7708 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7709 ) -> Self {
7710 Self(RequestBuilder::new(stub))
7711 }
7712
7713 pub fn with_request<V: Into<crate::model::GetEncryptionConfigRequest>>(
7715 mut self,
7716 v: V,
7717 ) -> Self {
7718 self.0.request = v.into();
7719 self
7720 }
7721
7722 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7724 self.0.options = v.into();
7725 self
7726 }
7727
7728 pub async fn send(self) -> Result<crate::model::EncryptionConfig> {
7730 (*self.0.stub)
7731 .get_encryption_config(self.0.request, self.0.options)
7732 .await
7733 .map(crate::Response::into_body)
7734 }
7735
7736 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7740 self.0.request.name = v.into();
7741 self
7742 }
7743 }
7744
7745 #[doc(hidden)]
7746 impl crate::RequestBuilder for GetEncryptionConfig {
7747 fn request_options(&mut self) -> &mut crate::RequestOptions {
7748 &mut self.0.options
7749 }
7750 }
7751
7752 #[derive(Clone, Debug)]
7773 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7774
7775 impl ListLocations {
7776 pub(crate) fn new(
7777 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7778 ) -> Self {
7779 Self(RequestBuilder::new(stub))
7780 }
7781
7782 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7784 mut self,
7785 v: V,
7786 ) -> Self {
7787 self.0.request = v.into();
7788 self
7789 }
7790
7791 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7793 self.0.options = v.into();
7794 self
7795 }
7796
7797 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7799 (*self.0.stub)
7800 .list_locations(self.0.request, self.0.options)
7801 .await
7802 .map(crate::Response::into_body)
7803 }
7804
7805 pub fn by_page(
7807 self,
7808 ) -> impl google_cloud_gax::paginator::Paginator<
7809 google_cloud_location::model::ListLocationsResponse,
7810 crate::Error,
7811 > {
7812 use std::clone::Clone;
7813 let token = self.0.request.page_token.clone();
7814 let execute = move |token: String| {
7815 let mut builder = self.clone();
7816 builder.0.request = builder.0.request.set_page_token(token);
7817 builder.send()
7818 };
7819 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7820 }
7821
7822 pub fn by_item(
7824 self,
7825 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7826 google_cloud_location::model::ListLocationsResponse,
7827 crate::Error,
7828 > {
7829 use google_cloud_gax::paginator::Paginator;
7830 self.by_page().items()
7831 }
7832
7833 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7835 self.0.request.name = v.into();
7836 self
7837 }
7838
7839 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7841 self.0.request.filter = v.into();
7842 self
7843 }
7844
7845 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7847 self.0.request.page_size = v.into();
7848 self
7849 }
7850
7851 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7853 self.0.request.page_token = v.into();
7854 self
7855 }
7856 }
7857
7858 #[doc(hidden)]
7859 impl crate::RequestBuilder for ListLocations {
7860 fn request_options(&mut self) -> &mut crate::RequestOptions {
7861 &mut self.0.options
7862 }
7863 }
7864
7865 #[derive(Clone, Debug)]
7882 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
7883
7884 impl GetLocation {
7885 pub(crate) fn new(
7886 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7887 ) -> Self {
7888 Self(RequestBuilder::new(stub))
7889 }
7890
7891 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
7893 mut self,
7894 v: V,
7895 ) -> Self {
7896 self.0.request = v.into();
7897 self
7898 }
7899
7900 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7902 self.0.options = v.into();
7903 self
7904 }
7905
7906 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7908 (*self.0.stub)
7909 .get_location(self.0.request, self.0.options)
7910 .await
7911 .map(crate::Response::into_body)
7912 }
7913
7914 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7916 self.0.request.name = v.into();
7917 self
7918 }
7919 }
7920
7921 #[doc(hidden)]
7922 impl crate::RequestBuilder for GetLocation {
7923 fn request_options(&mut self) -> &mut crate::RequestOptions {
7924 &mut self.0.options
7925 }
7926 }
7927
7928 #[derive(Clone, Debug)]
7945 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
7946
7947 impl SetIamPolicy {
7948 pub(crate) fn new(
7949 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7950 ) -> Self {
7951 Self(RequestBuilder::new(stub))
7952 }
7953
7954 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
7956 mut self,
7957 v: V,
7958 ) -> Self {
7959 self.0.request = v.into();
7960 self
7961 }
7962
7963 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7965 self.0.options = v.into();
7966 self
7967 }
7968
7969 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7971 (*self.0.stub)
7972 .set_iam_policy(self.0.request, self.0.options)
7973 .await
7974 .map(crate::Response::into_body)
7975 }
7976
7977 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7981 self.0.request.resource = v.into();
7982 self
7983 }
7984
7985 pub fn set_policy<T>(mut self, v: T) -> Self
7989 where
7990 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7991 {
7992 self.0.request.policy = std::option::Option::Some(v.into());
7993 self
7994 }
7995
7996 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8000 where
8001 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8002 {
8003 self.0.request.policy = v.map(|x| x.into());
8004 self
8005 }
8006
8007 pub fn set_update_mask<T>(mut self, v: T) -> Self
8009 where
8010 T: std::convert::Into<wkt::FieldMask>,
8011 {
8012 self.0.request.update_mask = std::option::Option::Some(v.into());
8013 self
8014 }
8015
8016 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8018 where
8019 T: std::convert::Into<wkt::FieldMask>,
8020 {
8021 self.0.request.update_mask = v.map(|x| x.into());
8022 self
8023 }
8024 }
8025
8026 #[doc(hidden)]
8027 impl crate::RequestBuilder for SetIamPolicy {
8028 fn request_options(&mut self) -> &mut crate::RequestOptions {
8029 &mut self.0.options
8030 }
8031 }
8032
8033 #[derive(Clone, Debug)]
8050 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8051
8052 impl GetIamPolicy {
8053 pub(crate) fn new(
8054 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8055 ) -> Self {
8056 Self(RequestBuilder::new(stub))
8057 }
8058
8059 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8061 mut self,
8062 v: V,
8063 ) -> Self {
8064 self.0.request = v.into();
8065 self
8066 }
8067
8068 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8070 self.0.options = v.into();
8071 self
8072 }
8073
8074 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8076 (*self.0.stub)
8077 .get_iam_policy(self.0.request, self.0.options)
8078 .await
8079 .map(crate::Response::into_body)
8080 }
8081
8082 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8086 self.0.request.resource = v.into();
8087 self
8088 }
8089
8090 pub fn set_options<T>(mut self, v: T) -> Self
8092 where
8093 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8094 {
8095 self.0.request.options = std::option::Option::Some(v.into());
8096 self
8097 }
8098
8099 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8101 where
8102 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8103 {
8104 self.0.request.options = v.map(|x| x.into());
8105 self
8106 }
8107 }
8108
8109 #[doc(hidden)]
8110 impl crate::RequestBuilder for GetIamPolicy {
8111 fn request_options(&mut self) -> &mut crate::RequestOptions {
8112 &mut self.0.options
8113 }
8114 }
8115
8116 #[derive(Clone, Debug)]
8133 pub struct TestIamPermissions(
8134 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8135 );
8136
8137 impl TestIamPermissions {
8138 pub(crate) fn new(
8139 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8140 ) -> Self {
8141 Self(RequestBuilder::new(stub))
8142 }
8143
8144 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8146 mut self,
8147 v: V,
8148 ) -> Self {
8149 self.0.request = v.into();
8150 self
8151 }
8152
8153 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8155 self.0.options = v.into();
8156 self
8157 }
8158
8159 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8161 (*self.0.stub)
8162 .test_iam_permissions(self.0.request, self.0.options)
8163 .await
8164 .map(crate::Response::into_body)
8165 }
8166
8167 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8171 self.0.request.resource = v.into();
8172 self
8173 }
8174
8175 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8179 where
8180 T: std::iter::IntoIterator<Item = V>,
8181 V: std::convert::Into<std::string::String>,
8182 {
8183 use std::iter::Iterator;
8184 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8185 self
8186 }
8187 }
8188
8189 #[doc(hidden)]
8190 impl crate::RequestBuilder for TestIamPermissions {
8191 fn request_options(&mut self) -> &mut crate::RequestOptions {
8192 &mut self.0.options
8193 }
8194 }
8195
8196 #[derive(Clone, Debug)]
8217 pub struct ListOperations(
8218 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8219 );
8220
8221 impl ListOperations {
8222 pub(crate) fn new(
8223 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8224 ) -> Self {
8225 Self(RequestBuilder::new(stub))
8226 }
8227
8228 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8230 mut self,
8231 v: V,
8232 ) -> Self {
8233 self.0.request = v.into();
8234 self
8235 }
8236
8237 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8239 self.0.options = v.into();
8240 self
8241 }
8242
8243 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8245 (*self.0.stub)
8246 .list_operations(self.0.request, self.0.options)
8247 .await
8248 .map(crate::Response::into_body)
8249 }
8250
8251 pub fn by_page(
8253 self,
8254 ) -> impl google_cloud_gax::paginator::Paginator<
8255 google_cloud_longrunning::model::ListOperationsResponse,
8256 crate::Error,
8257 > {
8258 use std::clone::Clone;
8259 let token = self.0.request.page_token.clone();
8260 let execute = move |token: String| {
8261 let mut builder = self.clone();
8262 builder.0.request = builder.0.request.set_page_token(token);
8263 builder.send()
8264 };
8265 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8266 }
8267
8268 pub fn by_item(
8270 self,
8271 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8272 google_cloud_longrunning::model::ListOperationsResponse,
8273 crate::Error,
8274 > {
8275 use google_cloud_gax::paginator::Paginator;
8276 self.by_page().items()
8277 }
8278
8279 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8281 self.0.request.name = v.into();
8282 self
8283 }
8284
8285 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8287 self.0.request.filter = v.into();
8288 self
8289 }
8290
8291 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8293 self.0.request.page_size = v.into();
8294 self
8295 }
8296
8297 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8299 self.0.request.page_token = v.into();
8300 self
8301 }
8302
8303 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8305 self.0.request.return_partial_success = v.into();
8306 self
8307 }
8308 }
8309
8310 #[doc(hidden)]
8311 impl crate::RequestBuilder for ListOperations {
8312 fn request_options(&mut self) -> &mut crate::RequestOptions {
8313 &mut self.0.options
8314 }
8315 }
8316
8317 #[derive(Clone, Debug)]
8334 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8335
8336 impl GetOperation {
8337 pub(crate) fn new(
8338 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8339 ) -> Self {
8340 Self(RequestBuilder::new(stub))
8341 }
8342
8343 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8345 mut self,
8346 v: V,
8347 ) -> Self {
8348 self.0.request = v.into();
8349 self
8350 }
8351
8352 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8354 self.0.options = v.into();
8355 self
8356 }
8357
8358 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8360 (*self.0.stub)
8361 .get_operation(self.0.request, self.0.options)
8362 .await
8363 .map(crate::Response::into_body)
8364 }
8365
8366 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8368 self.0.request.name = v.into();
8369 self
8370 }
8371 }
8372
8373 #[doc(hidden)]
8374 impl crate::RequestBuilder for GetOperation {
8375 fn request_options(&mut self) -> &mut crate::RequestOptions {
8376 &mut self.0.options
8377 }
8378 }
8379
8380 #[derive(Clone, Debug)]
8397 pub struct DeleteOperation(
8398 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8399 );
8400
8401 impl DeleteOperation {
8402 pub(crate) fn new(
8403 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8404 ) -> Self {
8405 Self(RequestBuilder::new(stub))
8406 }
8407
8408 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8410 mut self,
8411 v: V,
8412 ) -> Self {
8413 self.0.request = v.into();
8414 self
8415 }
8416
8417 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8419 self.0.options = v.into();
8420 self
8421 }
8422
8423 pub async fn send(self) -> Result<()> {
8425 (*self.0.stub)
8426 .delete_operation(self.0.request, self.0.options)
8427 .await
8428 .map(crate::Response::into_body)
8429 }
8430
8431 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8433 self.0.request.name = v.into();
8434 self
8435 }
8436 }
8437
8438 #[doc(hidden)]
8439 impl crate::RequestBuilder for DeleteOperation {
8440 fn request_options(&mut self) -> &mut crate::RequestOptions {
8441 &mut self.0.options
8442 }
8443 }
8444
8445 #[derive(Clone, Debug)]
8462 pub struct CancelOperation(
8463 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8464 );
8465
8466 impl CancelOperation {
8467 pub(crate) fn new(
8468 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8469 ) -> Self {
8470 Self(RequestBuilder::new(stub))
8471 }
8472
8473 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8475 mut self,
8476 v: V,
8477 ) -> Self {
8478 self.0.request = v.into();
8479 self
8480 }
8481
8482 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8484 self.0.options = v.into();
8485 self
8486 }
8487
8488 pub async fn send(self) -> Result<()> {
8490 (*self.0.stub)
8491 .cancel_operation(self.0.request, self.0.options)
8492 .await
8493 .map(crate::Response::into_body)
8494 }
8495
8496 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8498 self.0.request.name = v.into();
8499 self
8500 }
8501 }
8502
8503 #[doc(hidden)]
8504 impl crate::RequestBuilder for CancelOperation {
8505 fn request_options(&mut self) -> &mut crate::RequestOptions {
8506 &mut self.0.options
8507 }
8508 }
8509}
8510
8511pub mod content_service {
8512 use crate::Result;
8513
8514 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8528
8529 pub(crate) mod client {
8530 use super::super::super::client::ContentService;
8531 pub struct Factory;
8532 impl crate::ClientFactory for Factory {
8533 type Client = ContentService;
8534 type Credentials = gaxi::options::Credentials;
8535 async fn build(
8536 self,
8537 config: gaxi::options::ClientConfig,
8538 ) -> crate::ClientBuilderResult<Self::Client> {
8539 Self::Client::new(config).await
8540 }
8541 }
8542 }
8543
8544 #[derive(Clone, Debug)]
8546 pub(crate) struct RequestBuilder<R: std::default::Default> {
8547 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8548 request: R,
8549 options: crate::RequestOptions,
8550 }
8551
8552 impl<R> RequestBuilder<R>
8553 where
8554 R: std::default::Default,
8555 {
8556 pub(crate) fn new(
8557 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8558 ) -> Self {
8559 Self {
8560 stub,
8561 request: R::default(),
8562 options: crate::RequestOptions::default(),
8563 }
8564 }
8565 }
8566
8567 #[derive(Clone, Debug)]
8588 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
8589
8590 impl ListLocations {
8591 pub(crate) fn new(
8592 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8593 ) -> Self {
8594 Self(RequestBuilder::new(stub))
8595 }
8596
8597 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
8599 mut self,
8600 v: V,
8601 ) -> Self {
8602 self.0.request = v.into();
8603 self
8604 }
8605
8606 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8608 self.0.options = v.into();
8609 self
8610 }
8611
8612 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8614 (*self.0.stub)
8615 .list_locations(self.0.request, self.0.options)
8616 .await
8617 .map(crate::Response::into_body)
8618 }
8619
8620 pub fn by_page(
8622 self,
8623 ) -> impl google_cloud_gax::paginator::Paginator<
8624 google_cloud_location::model::ListLocationsResponse,
8625 crate::Error,
8626 > {
8627 use std::clone::Clone;
8628 let token = self.0.request.page_token.clone();
8629 let execute = move |token: String| {
8630 let mut builder = self.clone();
8631 builder.0.request = builder.0.request.set_page_token(token);
8632 builder.send()
8633 };
8634 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8635 }
8636
8637 pub fn by_item(
8639 self,
8640 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8641 google_cloud_location::model::ListLocationsResponse,
8642 crate::Error,
8643 > {
8644 use google_cloud_gax::paginator::Paginator;
8645 self.by_page().items()
8646 }
8647
8648 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8650 self.0.request.name = v.into();
8651 self
8652 }
8653
8654 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8656 self.0.request.filter = v.into();
8657 self
8658 }
8659
8660 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8662 self.0.request.page_size = v.into();
8663 self
8664 }
8665
8666 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8668 self.0.request.page_token = v.into();
8669 self
8670 }
8671 }
8672
8673 #[doc(hidden)]
8674 impl crate::RequestBuilder for ListLocations {
8675 fn request_options(&mut self) -> &mut crate::RequestOptions {
8676 &mut self.0.options
8677 }
8678 }
8679
8680 #[derive(Clone, Debug)]
8697 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8698
8699 impl GetLocation {
8700 pub(crate) fn new(
8701 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8702 ) -> Self {
8703 Self(RequestBuilder::new(stub))
8704 }
8705
8706 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8708 mut self,
8709 v: V,
8710 ) -> Self {
8711 self.0.request = v.into();
8712 self
8713 }
8714
8715 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8717 self.0.options = v.into();
8718 self
8719 }
8720
8721 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8723 (*self.0.stub)
8724 .get_location(self.0.request, self.0.options)
8725 .await
8726 .map(crate::Response::into_body)
8727 }
8728
8729 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8731 self.0.request.name = v.into();
8732 self
8733 }
8734 }
8735
8736 #[doc(hidden)]
8737 impl crate::RequestBuilder for GetLocation {
8738 fn request_options(&mut self) -> &mut crate::RequestOptions {
8739 &mut self.0.options
8740 }
8741 }
8742
8743 #[derive(Clone, Debug)]
8760 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8761
8762 impl SetIamPolicy {
8763 pub(crate) fn new(
8764 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8765 ) -> Self {
8766 Self(RequestBuilder::new(stub))
8767 }
8768
8769 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8771 mut self,
8772 v: V,
8773 ) -> Self {
8774 self.0.request = v.into();
8775 self
8776 }
8777
8778 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8780 self.0.options = v.into();
8781 self
8782 }
8783
8784 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8786 (*self.0.stub)
8787 .set_iam_policy(self.0.request, self.0.options)
8788 .await
8789 .map(crate::Response::into_body)
8790 }
8791
8792 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8796 self.0.request.resource = v.into();
8797 self
8798 }
8799
8800 pub fn set_policy<T>(mut self, v: T) -> Self
8804 where
8805 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8806 {
8807 self.0.request.policy = std::option::Option::Some(v.into());
8808 self
8809 }
8810
8811 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8815 where
8816 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8817 {
8818 self.0.request.policy = v.map(|x| x.into());
8819 self
8820 }
8821
8822 pub fn set_update_mask<T>(mut self, v: T) -> Self
8824 where
8825 T: std::convert::Into<wkt::FieldMask>,
8826 {
8827 self.0.request.update_mask = std::option::Option::Some(v.into());
8828 self
8829 }
8830
8831 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8833 where
8834 T: std::convert::Into<wkt::FieldMask>,
8835 {
8836 self.0.request.update_mask = v.map(|x| x.into());
8837 self
8838 }
8839 }
8840
8841 #[doc(hidden)]
8842 impl crate::RequestBuilder for SetIamPolicy {
8843 fn request_options(&mut self) -> &mut crate::RequestOptions {
8844 &mut self.0.options
8845 }
8846 }
8847
8848 #[derive(Clone, Debug)]
8865 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8866
8867 impl GetIamPolicy {
8868 pub(crate) fn new(
8869 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8870 ) -> Self {
8871 Self(RequestBuilder::new(stub))
8872 }
8873
8874 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8876 mut self,
8877 v: V,
8878 ) -> Self {
8879 self.0.request = v.into();
8880 self
8881 }
8882
8883 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8885 self.0.options = v.into();
8886 self
8887 }
8888
8889 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8891 (*self.0.stub)
8892 .get_iam_policy(self.0.request, self.0.options)
8893 .await
8894 .map(crate::Response::into_body)
8895 }
8896
8897 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8901 self.0.request.resource = v.into();
8902 self
8903 }
8904
8905 pub fn set_options<T>(mut self, v: T) -> Self
8907 where
8908 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8909 {
8910 self.0.request.options = std::option::Option::Some(v.into());
8911 self
8912 }
8913
8914 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8916 where
8917 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8918 {
8919 self.0.request.options = v.map(|x| x.into());
8920 self
8921 }
8922 }
8923
8924 #[doc(hidden)]
8925 impl crate::RequestBuilder for GetIamPolicy {
8926 fn request_options(&mut self) -> &mut crate::RequestOptions {
8927 &mut self.0.options
8928 }
8929 }
8930
8931 #[derive(Clone, Debug)]
8948 pub struct TestIamPermissions(
8949 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8950 );
8951
8952 impl TestIamPermissions {
8953 pub(crate) fn new(
8954 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8955 ) -> Self {
8956 Self(RequestBuilder::new(stub))
8957 }
8958
8959 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8961 mut self,
8962 v: V,
8963 ) -> Self {
8964 self.0.request = v.into();
8965 self
8966 }
8967
8968 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8970 self.0.options = v.into();
8971 self
8972 }
8973
8974 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8976 (*self.0.stub)
8977 .test_iam_permissions(self.0.request, self.0.options)
8978 .await
8979 .map(crate::Response::into_body)
8980 }
8981
8982 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8986 self.0.request.resource = v.into();
8987 self
8988 }
8989
8990 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8994 where
8995 T: std::iter::IntoIterator<Item = V>,
8996 V: std::convert::Into<std::string::String>,
8997 {
8998 use std::iter::Iterator;
8999 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9000 self
9001 }
9002 }
9003
9004 #[doc(hidden)]
9005 impl crate::RequestBuilder for TestIamPermissions {
9006 fn request_options(&mut self) -> &mut crate::RequestOptions {
9007 &mut self.0.options
9008 }
9009 }
9010
9011 #[derive(Clone, Debug)]
9032 pub struct ListOperations(
9033 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9034 );
9035
9036 impl ListOperations {
9037 pub(crate) fn new(
9038 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9039 ) -> Self {
9040 Self(RequestBuilder::new(stub))
9041 }
9042
9043 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9045 mut self,
9046 v: V,
9047 ) -> Self {
9048 self.0.request = v.into();
9049 self
9050 }
9051
9052 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9054 self.0.options = v.into();
9055 self
9056 }
9057
9058 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9060 (*self.0.stub)
9061 .list_operations(self.0.request, self.0.options)
9062 .await
9063 .map(crate::Response::into_body)
9064 }
9065
9066 pub fn by_page(
9068 self,
9069 ) -> impl google_cloud_gax::paginator::Paginator<
9070 google_cloud_longrunning::model::ListOperationsResponse,
9071 crate::Error,
9072 > {
9073 use std::clone::Clone;
9074 let token = self.0.request.page_token.clone();
9075 let execute = move |token: String| {
9076 let mut builder = self.clone();
9077 builder.0.request = builder.0.request.set_page_token(token);
9078 builder.send()
9079 };
9080 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9081 }
9082
9083 pub fn by_item(
9085 self,
9086 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9087 google_cloud_longrunning::model::ListOperationsResponse,
9088 crate::Error,
9089 > {
9090 use google_cloud_gax::paginator::Paginator;
9091 self.by_page().items()
9092 }
9093
9094 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9096 self.0.request.name = v.into();
9097 self
9098 }
9099
9100 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9102 self.0.request.filter = v.into();
9103 self
9104 }
9105
9106 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9108 self.0.request.page_size = v.into();
9109 self
9110 }
9111
9112 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9114 self.0.request.page_token = v.into();
9115 self
9116 }
9117
9118 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9120 self.0.request.return_partial_success = v.into();
9121 self
9122 }
9123 }
9124
9125 #[doc(hidden)]
9126 impl crate::RequestBuilder for ListOperations {
9127 fn request_options(&mut self) -> &mut crate::RequestOptions {
9128 &mut self.0.options
9129 }
9130 }
9131
9132 #[derive(Clone, Debug)]
9149 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9150
9151 impl GetOperation {
9152 pub(crate) fn new(
9153 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9154 ) -> Self {
9155 Self(RequestBuilder::new(stub))
9156 }
9157
9158 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9160 mut self,
9161 v: V,
9162 ) -> Self {
9163 self.0.request = v.into();
9164 self
9165 }
9166
9167 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9169 self.0.options = v.into();
9170 self
9171 }
9172
9173 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9175 (*self.0.stub)
9176 .get_operation(self.0.request, self.0.options)
9177 .await
9178 .map(crate::Response::into_body)
9179 }
9180
9181 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9183 self.0.request.name = v.into();
9184 self
9185 }
9186 }
9187
9188 #[doc(hidden)]
9189 impl crate::RequestBuilder for GetOperation {
9190 fn request_options(&mut self) -> &mut crate::RequestOptions {
9191 &mut self.0.options
9192 }
9193 }
9194
9195 #[derive(Clone, Debug)]
9212 pub struct DeleteOperation(
9213 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
9214 );
9215
9216 impl DeleteOperation {
9217 pub(crate) fn new(
9218 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9219 ) -> Self {
9220 Self(RequestBuilder::new(stub))
9221 }
9222
9223 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
9225 mut self,
9226 v: V,
9227 ) -> Self {
9228 self.0.request = v.into();
9229 self
9230 }
9231
9232 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9234 self.0.options = v.into();
9235 self
9236 }
9237
9238 pub async fn send(self) -> Result<()> {
9240 (*self.0.stub)
9241 .delete_operation(self.0.request, self.0.options)
9242 .await
9243 .map(crate::Response::into_body)
9244 }
9245
9246 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9248 self.0.request.name = v.into();
9249 self
9250 }
9251 }
9252
9253 #[doc(hidden)]
9254 impl crate::RequestBuilder for DeleteOperation {
9255 fn request_options(&mut self) -> &mut crate::RequestOptions {
9256 &mut self.0.options
9257 }
9258 }
9259
9260 #[derive(Clone, Debug)]
9277 pub struct CancelOperation(
9278 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
9279 );
9280
9281 impl CancelOperation {
9282 pub(crate) fn new(
9283 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9284 ) -> Self {
9285 Self(RequestBuilder::new(stub))
9286 }
9287
9288 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
9290 mut self,
9291 v: V,
9292 ) -> Self {
9293 self.0.request = v.into();
9294 self
9295 }
9296
9297 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9299 self.0.options = v.into();
9300 self
9301 }
9302
9303 pub async fn send(self) -> Result<()> {
9305 (*self.0.stub)
9306 .cancel_operation(self.0.request, self.0.options)
9307 .await
9308 .map(crate::Response::into_body)
9309 }
9310
9311 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9313 self.0.request.name = v.into();
9314 self
9315 }
9316 }
9317
9318 #[doc(hidden)]
9319 impl crate::RequestBuilder for CancelOperation {
9320 fn request_options(&mut self) -> &mut crate::RequestOptions {
9321 &mut self.0.options
9322 }
9323 }
9324}
9325
9326pub mod data_product_service {
9327 use crate::Result;
9328
9329 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9343
9344 pub(crate) mod client {
9345 use super::super::super::client::DataProductService;
9346 pub struct Factory;
9347 impl crate::ClientFactory for Factory {
9348 type Client = DataProductService;
9349 type Credentials = gaxi::options::Credentials;
9350 async fn build(
9351 self,
9352 config: gaxi::options::ClientConfig,
9353 ) -> crate::ClientBuilderResult<Self::Client> {
9354 Self::Client::new(config).await
9355 }
9356 }
9357 }
9358
9359 #[derive(Clone, Debug)]
9361 pub(crate) struct RequestBuilder<R: std::default::Default> {
9362 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9363 request: R,
9364 options: crate::RequestOptions,
9365 }
9366
9367 impl<R> RequestBuilder<R>
9368 where
9369 R: std::default::Default,
9370 {
9371 pub(crate) fn new(
9372 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9373 ) -> Self {
9374 Self {
9375 stub,
9376 request: R::default(),
9377 options: crate::RequestOptions::default(),
9378 }
9379 }
9380 }
9381
9382 #[derive(Clone, Debug)]
9400 pub struct CreateDataProduct(RequestBuilder<crate::model::CreateDataProductRequest>);
9401
9402 impl CreateDataProduct {
9403 pub(crate) fn new(
9404 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9405 ) -> Self {
9406 Self(RequestBuilder::new(stub))
9407 }
9408
9409 pub fn with_request<V: Into<crate::model::CreateDataProductRequest>>(
9411 mut self,
9412 v: V,
9413 ) -> Self {
9414 self.0.request = v.into();
9415 self
9416 }
9417
9418 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9420 self.0.options = v.into();
9421 self
9422 }
9423
9424 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9431 (*self.0.stub)
9432 .create_data_product(self.0.request, self.0.options)
9433 .await
9434 .map(crate::Response::into_body)
9435 }
9436
9437 pub fn poller(
9439 self,
9440 ) -> impl google_cloud_lro::Poller<crate::model::DataProduct, crate::model::OperationMetadata>
9441 {
9442 type Operation = google_cloud_lro::internal::Operation<
9443 crate::model::DataProduct,
9444 crate::model::OperationMetadata,
9445 >;
9446 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9447 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9448
9449 let stub = self.0.stub.clone();
9450 let mut options = self.0.options.clone();
9451 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9452 let query = move |name| {
9453 let stub = stub.clone();
9454 let options = options.clone();
9455 async {
9456 let op = GetOperation::new(stub)
9457 .set_name(name)
9458 .with_options(options)
9459 .send()
9460 .await?;
9461 Ok(Operation::new(op))
9462 }
9463 };
9464
9465 let start = move || async {
9466 let op = self.send().await?;
9467 Ok(Operation::new(op))
9468 };
9469
9470 google_cloud_lro::internal::new_poller(
9471 polling_error_policy,
9472 polling_backoff_policy,
9473 start,
9474 query,
9475 )
9476 }
9477
9478 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9482 self.0.request.parent = v.into();
9483 self
9484 }
9485
9486 pub fn set_data_product_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9488 self.0.request.data_product_id = v.into();
9489 self
9490 }
9491
9492 pub fn set_data_product<T>(mut self, v: T) -> Self
9496 where
9497 T: std::convert::Into<crate::model::DataProduct>,
9498 {
9499 self.0.request.data_product = std::option::Option::Some(v.into());
9500 self
9501 }
9502
9503 pub fn set_or_clear_data_product<T>(mut self, v: std::option::Option<T>) -> Self
9507 where
9508 T: std::convert::Into<crate::model::DataProduct>,
9509 {
9510 self.0.request.data_product = v.map(|x| x.into());
9511 self
9512 }
9513
9514 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9516 self.0.request.validate_only = v.into();
9517 self
9518 }
9519 }
9520
9521 #[doc(hidden)]
9522 impl crate::RequestBuilder for CreateDataProduct {
9523 fn request_options(&mut self) -> &mut crate::RequestOptions {
9524 &mut self.0.options
9525 }
9526 }
9527
9528 #[derive(Clone, Debug)]
9546 pub struct DeleteDataProduct(RequestBuilder<crate::model::DeleteDataProductRequest>);
9547
9548 impl DeleteDataProduct {
9549 pub(crate) fn new(
9550 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9551 ) -> Self {
9552 Self(RequestBuilder::new(stub))
9553 }
9554
9555 pub fn with_request<V: Into<crate::model::DeleteDataProductRequest>>(
9557 mut self,
9558 v: V,
9559 ) -> Self {
9560 self.0.request = v.into();
9561 self
9562 }
9563
9564 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9566 self.0.options = v.into();
9567 self
9568 }
9569
9570 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9577 (*self.0.stub)
9578 .delete_data_product(self.0.request, self.0.options)
9579 .await
9580 .map(crate::Response::into_body)
9581 }
9582
9583 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9585 type Operation =
9586 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9587 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9588 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9589
9590 let stub = self.0.stub.clone();
9591 let mut options = self.0.options.clone();
9592 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9593 let query = move |name| {
9594 let stub = stub.clone();
9595 let options = options.clone();
9596 async {
9597 let op = GetOperation::new(stub)
9598 .set_name(name)
9599 .with_options(options)
9600 .send()
9601 .await?;
9602 Ok(Operation::new(op))
9603 }
9604 };
9605
9606 let start = move || async {
9607 let op = self.send().await?;
9608 Ok(Operation::new(op))
9609 };
9610
9611 google_cloud_lro::internal::new_unit_response_poller(
9612 polling_error_policy,
9613 polling_backoff_policy,
9614 start,
9615 query,
9616 )
9617 }
9618
9619 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9623 self.0.request.name = v.into();
9624 self
9625 }
9626
9627 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
9629 self.0.request.etag = v.into();
9630 self
9631 }
9632
9633 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9635 self.0.request.validate_only = v.into();
9636 self
9637 }
9638 }
9639
9640 #[doc(hidden)]
9641 impl crate::RequestBuilder for DeleteDataProduct {
9642 fn request_options(&mut self) -> &mut crate::RequestOptions {
9643 &mut self.0.options
9644 }
9645 }
9646
9647 #[derive(Clone, Debug)]
9664 pub struct GetDataProduct(RequestBuilder<crate::model::GetDataProductRequest>);
9665
9666 impl GetDataProduct {
9667 pub(crate) fn new(
9668 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9669 ) -> Self {
9670 Self(RequestBuilder::new(stub))
9671 }
9672
9673 pub fn with_request<V: Into<crate::model::GetDataProductRequest>>(mut self, v: V) -> Self {
9675 self.0.request = v.into();
9676 self
9677 }
9678
9679 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9681 self.0.options = v.into();
9682 self
9683 }
9684
9685 pub async fn send(self) -> Result<crate::model::DataProduct> {
9687 (*self.0.stub)
9688 .get_data_product(self.0.request, self.0.options)
9689 .await
9690 .map(crate::Response::into_body)
9691 }
9692
9693 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9697 self.0.request.name = v.into();
9698 self
9699 }
9700 }
9701
9702 #[doc(hidden)]
9703 impl crate::RequestBuilder for GetDataProduct {
9704 fn request_options(&mut self) -> &mut crate::RequestOptions {
9705 &mut self.0.options
9706 }
9707 }
9708
9709 #[derive(Clone, Debug)]
9730 pub struct ListDataProducts(RequestBuilder<crate::model::ListDataProductsRequest>);
9731
9732 impl ListDataProducts {
9733 pub(crate) fn new(
9734 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9735 ) -> Self {
9736 Self(RequestBuilder::new(stub))
9737 }
9738
9739 pub fn with_request<V: Into<crate::model::ListDataProductsRequest>>(
9741 mut self,
9742 v: V,
9743 ) -> Self {
9744 self.0.request = v.into();
9745 self
9746 }
9747
9748 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9750 self.0.options = v.into();
9751 self
9752 }
9753
9754 pub async fn send(self) -> Result<crate::model::ListDataProductsResponse> {
9756 (*self.0.stub)
9757 .list_data_products(self.0.request, self.0.options)
9758 .await
9759 .map(crate::Response::into_body)
9760 }
9761
9762 pub fn by_page(
9764 self,
9765 ) -> impl google_cloud_gax::paginator::Paginator<
9766 crate::model::ListDataProductsResponse,
9767 crate::Error,
9768 > {
9769 use std::clone::Clone;
9770 let token = self.0.request.page_token.clone();
9771 let execute = move |token: String| {
9772 let mut builder = self.clone();
9773 builder.0.request = builder.0.request.set_page_token(token);
9774 builder.send()
9775 };
9776 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9777 }
9778
9779 pub fn by_item(
9781 self,
9782 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9783 crate::model::ListDataProductsResponse,
9784 crate::Error,
9785 > {
9786 use google_cloud_gax::paginator::Paginator;
9787 self.by_page().items()
9788 }
9789
9790 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9794 self.0.request.parent = v.into();
9795 self
9796 }
9797
9798 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9800 self.0.request.filter = v.into();
9801 self
9802 }
9803
9804 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9806 self.0.request.page_size = v.into();
9807 self
9808 }
9809
9810 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9812 self.0.request.page_token = v.into();
9813 self
9814 }
9815
9816 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9818 self.0.request.order_by = v.into();
9819 self
9820 }
9821 }
9822
9823 #[doc(hidden)]
9824 impl crate::RequestBuilder for ListDataProducts {
9825 fn request_options(&mut self) -> &mut crate::RequestOptions {
9826 &mut self.0.options
9827 }
9828 }
9829
9830 #[derive(Clone, Debug)]
9848 pub struct UpdateDataProduct(RequestBuilder<crate::model::UpdateDataProductRequest>);
9849
9850 impl UpdateDataProduct {
9851 pub(crate) fn new(
9852 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9853 ) -> Self {
9854 Self(RequestBuilder::new(stub))
9855 }
9856
9857 pub fn with_request<V: Into<crate::model::UpdateDataProductRequest>>(
9859 mut self,
9860 v: V,
9861 ) -> Self {
9862 self.0.request = v.into();
9863 self
9864 }
9865
9866 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9868 self.0.options = v.into();
9869 self
9870 }
9871
9872 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9879 (*self.0.stub)
9880 .update_data_product(self.0.request, self.0.options)
9881 .await
9882 .map(crate::Response::into_body)
9883 }
9884
9885 pub fn poller(
9887 self,
9888 ) -> impl google_cloud_lro::Poller<crate::model::DataProduct, crate::model::OperationMetadata>
9889 {
9890 type Operation = google_cloud_lro::internal::Operation<
9891 crate::model::DataProduct,
9892 crate::model::OperationMetadata,
9893 >;
9894 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9895 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9896
9897 let stub = self.0.stub.clone();
9898 let mut options = self.0.options.clone();
9899 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9900 let query = move |name| {
9901 let stub = stub.clone();
9902 let options = options.clone();
9903 async {
9904 let op = GetOperation::new(stub)
9905 .set_name(name)
9906 .with_options(options)
9907 .send()
9908 .await?;
9909 Ok(Operation::new(op))
9910 }
9911 };
9912
9913 let start = move || async {
9914 let op = self.send().await?;
9915 Ok(Operation::new(op))
9916 };
9917
9918 google_cloud_lro::internal::new_poller(
9919 polling_error_policy,
9920 polling_backoff_policy,
9921 start,
9922 query,
9923 )
9924 }
9925
9926 pub fn set_data_product<T>(mut self, v: T) -> Self
9930 where
9931 T: std::convert::Into<crate::model::DataProduct>,
9932 {
9933 self.0.request.data_product = std::option::Option::Some(v.into());
9934 self
9935 }
9936
9937 pub fn set_or_clear_data_product<T>(mut self, v: std::option::Option<T>) -> Self
9941 where
9942 T: std::convert::Into<crate::model::DataProduct>,
9943 {
9944 self.0.request.data_product = v.map(|x| x.into());
9945 self
9946 }
9947
9948 pub fn set_update_mask<T>(mut self, v: T) -> Self
9950 where
9951 T: std::convert::Into<wkt::FieldMask>,
9952 {
9953 self.0.request.update_mask = std::option::Option::Some(v.into());
9954 self
9955 }
9956
9957 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9959 where
9960 T: std::convert::Into<wkt::FieldMask>,
9961 {
9962 self.0.request.update_mask = v.map(|x| x.into());
9963 self
9964 }
9965
9966 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9968 self.0.request.validate_only = v.into();
9969 self
9970 }
9971 }
9972
9973 #[doc(hidden)]
9974 impl crate::RequestBuilder for UpdateDataProduct {
9975 fn request_options(&mut self) -> &mut crate::RequestOptions {
9976 &mut self.0.options
9977 }
9978 }
9979
9980 #[derive(Clone, Debug)]
9998 pub struct CreateDataAsset(RequestBuilder<crate::model::CreateDataAssetRequest>);
9999
10000 impl CreateDataAsset {
10001 pub(crate) fn new(
10002 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10003 ) -> Self {
10004 Self(RequestBuilder::new(stub))
10005 }
10006
10007 pub fn with_request<V: Into<crate::model::CreateDataAssetRequest>>(mut self, v: V) -> Self {
10009 self.0.request = v.into();
10010 self
10011 }
10012
10013 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10015 self.0.options = v.into();
10016 self
10017 }
10018
10019 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10026 (*self.0.stub)
10027 .create_data_asset(self.0.request, self.0.options)
10028 .await
10029 .map(crate::Response::into_body)
10030 }
10031
10032 pub fn poller(
10034 self,
10035 ) -> impl google_cloud_lro::Poller<crate::model::DataAsset, crate::model::OperationMetadata>
10036 {
10037 type Operation = google_cloud_lro::internal::Operation<
10038 crate::model::DataAsset,
10039 crate::model::OperationMetadata,
10040 >;
10041 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10042 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10043
10044 let stub = self.0.stub.clone();
10045 let mut options = self.0.options.clone();
10046 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10047 let query = move |name| {
10048 let stub = stub.clone();
10049 let options = options.clone();
10050 async {
10051 let op = GetOperation::new(stub)
10052 .set_name(name)
10053 .with_options(options)
10054 .send()
10055 .await?;
10056 Ok(Operation::new(op))
10057 }
10058 };
10059
10060 let start = move || async {
10061 let op = self.send().await?;
10062 Ok(Operation::new(op))
10063 };
10064
10065 google_cloud_lro::internal::new_poller(
10066 polling_error_policy,
10067 polling_backoff_policy,
10068 start,
10069 query,
10070 )
10071 }
10072
10073 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10077 self.0.request.parent = v.into();
10078 self
10079 }
10080
10081 pub fn set_data_asset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10083 self.0.request.data_asset_id = v.into();
10084 self
10085 }
10086
10087 pub fn set_data_asset<T>(mut self, v: T) -> Self
10091 where
10092 T: std::convert::Into<crate::model::DataAsset>,
10093 {
10094 self.0.request.data_asset = std::option::Option::Some(v.into());
10095 self
10096 }
10097
10098 pub fn set_or_clear_data_asset<T>(mut self, v: std::option::Option<T>) -> Self
10102 where
10103 T: std::convert::Into<crate::model::DataAsset>,
10104 {
10105 self.0.request.data_asset = v.map(|x| x.into());
10106 self
10107 }
10108
10109 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10111 self.0.request.validate_only = v.into();
10112 self
10113 }
10114 }
10115
10116 #[doc(hidden)]
10117 impl crate::RequestBuilder for CreateDataAsset {
10118 fn request_options(&mut self) -> &mut crate::RequestOptions {
10119 &mut self.0.options
10120 }
10121 }
10122
10123 #[derive(Clone, Debug)]
10141 pub struct UpdateDataAsset(RequestBuilder<crate::model::UpdateDataAssetRequest>);
10142
10143 impl UpdateDataAsset {
10144 pub(crate) fn new(
10145 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10146 ) -> Self {
10147 Self(RequestBuilder::new(stub))
10148 }
10149
10150 pub fn with_request<V: Into<crate::model::UpdateDataAssetRequest>>(mut self, v: V) -> Self {
10152 self.0.request = v.into();
10153 self
10154 }
10155
10156 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10158 self.0.options = v.into();
10159 self
10160 }
10161
10162 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10169 (*self.0.stub)
10170 .update_data_asset(self.0.request, self.0.options)
10171 .await
10172 .map(crate::Response::into_body)
10173 }
10174
10175 pub fn poller(
10177 self,
10178 ) -> impl google_cloud_lro::Poller<crate::model::DataAsset, crate::model::OperationMetadata>
10179 {
10180 type Operation = google_cloud_lro::internal::Operation<
10181 crate::model::DataAsset,
10182 crate::model::OperationMetadata,
10183 >;
10184 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10185 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10186
10187 let stub = self.0.stub.clone();
10188 let mut options = self.0.options.clone();
10189 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10190 let query = move |name| {
10191 let stub = stub.clone();
10192 let options = options.clone();
10193 async {
10194 let op = GetOperation::new(stub)
10195 .set_name(name)
10196 .with_options(options)
10197 .send()
10198 .await?;
10199 Ok(Operation::new(op))
10200 }
10201 };
10202
10203 let start = move || async {
10204 let op = self.send().await?;
10205 Ok(Operation::new(op))
10206 };
10207
10208 google_cloud_lro::internal::new_poller(
10209 polling_error_policy,
10210 polling_backoff_policy,
10211 start,
10212 query,
10213 )
10214 }
10215
10216 pub fn set_data_asset<T>(mut self, v: T) -> Self
10220 where
10221 T: std::convert::Into<crate::model::DataAsset>,
10222 {
10223 self.0.request.data_asset = std::option::Option::Some(v.into());
10224 self
10225 }
10226
10227 pub fn set_or_clear_data_asset<T>(mut self, v: std::option::Option<T>) -> Self
10231 where
10232 T: std::convert::Into<crate::model::DataAsset>,
10233 {
10234 self.0.request.data_asset = v.map(|x| x.into());
10235 self
10236 }
10237
10238 pub fn set_update_mask<T>(mut self, v: T) -> Self
10240 where
10241 T: std::convert::Into<wkt::FieldMask>,
10242 {
10243 self.0.request.update_mask = std::option::Option::Some(v.into());
10244 self
10245 }
10246
10247 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_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10258 self.0.request.validate_only = v.into();
10259 self
10260 }
10261 }
10262
10263 #[doc(hidden)]
10264 impl crate::RequestBuilder for UpdateDataAsset {
10265 fn request_options(&mut self) -> &mut crate::RequestOptions {
10266 &mut self.0.options
10267 }
10268 }
10269
10270 #[derive(Clone, Debug)]
10288 pub struct DeleteDataAsset(RequestBuilder<crate::model::DeleteDataAssetRequest>);
10289
10290 impl DeleteDataAsset {
10291 pub(crate) fn new(
10292 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10293 ) -> Self {
10294 Self(RequestBuilder::new(stub))
10295 }
10296
10297 pub fn with_request<V: Into<crate::model::DeleteDataAssetRequest>>(mut self, v: V) -> Self {
10299 self.0.request = v.into();
10300 self
10301 }
10302
10303 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10305 self.0.options = v.into();
10306 self
10307 }
10308
10309 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10316 (*self.0.stub)
10317 .delete_data_asset(self.0.request, self.0.options)
10318 .await
10319 .map(crate::Response::into_body)
10320 }
10321
10322 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10324 type Operation =
10325 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10326 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10327 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10328
10329 let stub = self.0.stub.clone();
10330 let mut options = self.0.options.clone();
10331 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10332 let query = move |name| {
10333 let stub = stub.clone();
10334 let options = options.clone();
10335 async {
10336 let op = GetOperation::new(stub)
10337 .set_name(name)
10338 .with_options(options)
10339 .send()
10340 .await?;
10341 Ok(Operation::new(op))
10342 }
10343 };
10344
10345 let start = move || async {
10346 let op = self.send().await?;
10347 Ok(Operation::new(op))
10348 };
10349
10350 google_cloud_lro::internal::new_unit_response_poller(
10351 polling_error_policy,
10352 polling_backoff_policy,
10353 start,
10354 query,
10355 )
10356 }
10357
10358 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10362 self.0.request.name = v.into();
10363 self
10364 }
10365
10366 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
10368 self.0.request.etag = v.into();
10369 self
10370 }
10371
10372 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10374 self.0.request.validate_only = v.into();
10375 self
10376 }
10377 }
10378
10379 #[doc(hidden)]
10380 impl crate::RequestBuilder for DeleteDataAsset {
10381 fn request_options(&mut self) -> &mut crate::RequestOptions {
10382 &mut self.0.options
10383 }
10384 }
10385
10386 #[derive(Clone, Debug)]
10403 pub struct GetDataAsset(RequestBuilder<crate::model::GetDataAssetRequest>);
10404
10405 impl GetDataAsset {
10406 pub(crate) fn new(
10407 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10408 ) -> Self {
10409 Self(RequestBuilder::new(stub))
10410 }
10411
10412 pub fn with_request<V: Into<crate::model::GetDataAssetRequest>>(mut self, v: V) -> Self {
10414 self.0.request = v.into();
10415 self
10416 }
10417
10418 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10420 self.0.options = v.into();
10421 self
10422 }
10423
10424 pub async fn send(self) -> Result<crate::model::DataAsset> {
10426 (*self.0.stub)
10427 .get_data_asset(self.0.request, self.0.options)
10428 .await
10429 .map(crate::Response::into_body)
10430 }
10431
10432 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10436 self.0.request.name = v.into();
10437 self
10438 }
10439 }
10440
10441 #[doc(hidden)]
10442 impl crate::RequestBuilder for GetDataAsset {
10443 fn request_options(&mut self) -> &mut crate::RequestOptions {
10444 &mut self.0.options
10445 }
10446 }
10447
10448 #[derive(Clone, Debug)]
10469 pub struct ListDataAssets(RequestBuilder<crate::model::ListDataAssetsRequest>);
10470
10471 impl ListDataAssets {
10472 pub(crate) fn new(
10473 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10474 ) -> Self {
10475 Self(RequestBuilder::new(stub))
10476 }
10477
10478 pub fn with_request<V: Into<crate::model::ListDataAssetsRequest>>(mut self, v: V) -> Self {
10480 self.0.request = v.into();
10481 self
10482 }
10483
10484 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10486 self.0.options = v.into();
10487 self
10488 }
10489
10490 pub async fn send(self) -> Result<crate::model::ListDataAssetsResponse> {
10492 (*self.0.stub)
10493 .list_data_assets(self.0.request, self.0.options)
10494 .await
10495 .map(crate::Response::into_body)
10496 }
10497
10498 pub fn by_page(
10500 self,
10501 ) -> impl google_cloud_gax::paginator::Paginator<
10502 crate::model::ListDataAssetsResponse,
10503 crate::Error,
10504 > {
10505 use std::clone::Clone;
10506 let token = self.0.request.page_token.clone();
10507 let execute = move |token: String| {
10508 let mut builder = self.clone();
10509 builder.0.request = builder.0.request.set_page_token(token);
10510 builder.send()
10511 };
10512 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10513 }
10514
10515 pub fn by_item(
10517 self,
10518 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10519 crate::model::ListDataAssetsResponse,
10520 crate::Error,
10521 > {
10522 use google_cloud_gax::paginator::Paginator;
10523 self.by_page().items()
10524 }
10525
10526 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10530 self.0.request.parent = v.into();
10531 self
10532 }
10533
10534 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10536 self.0.request.filter = v.into();
10537 self
10538 }
10539
10540 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10542 self.0.request.order_by = v.into();
10543 self
10544 }
10545
10546 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10548 self.0.request.page_size = v.into();
10549 self
10550 }
10551
10552 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10554 self.0.request.page_token = v.into();
10555 self
10556 }
10557 }
10558
10559 #[doc(hidden)]
10560 impl crate::RequestBuilder for ListDataAssets {
10561 fn request_options(&mut self) -> &mut crate::RequestOptions {
10562 &mut self.0.options
10563 }
10564 }
10565
10566 #[derive(Clone, Debug)]
10587 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10588
10589 impl ListLocations {
10590 pub(crate) fn new(
10591 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10592 ) -> Self {
10593 Self(RequestBuilder::new(stub))
10594 }
10595
10596 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10598 mut self,
10599 v: V,
10600 ) -> Self {
10601 self.0.request = v.into();
10602 self
10603 }
10604
10605 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10607 self.0.options = v.into();
10608 self
10609 }
10610
10611 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10613 (*self.0.stub)
10614 .list_locations(self.0.request, self.0.options)
10615 .await
10616 .map(crate::Response::into_body)
10617 }
10618
10619 pub fn by_page(
10621 self,
10622 ) -> impl google_cloud_gax::paginator::Paginator<
10623 google_cloud_location::model::ListLocationsResponse,
10624 crate::Error,
10625 > {
10626 use std::clone::Clone;
10627 let token = self.0.request.page_token.clone();
10628 let execute = move |token: String| {
10629 let mut builder = self.clone();
10630 builder.0.request = builder.0.request.set_page_token(token);
10631 builder.send()
10632 };
10633 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10634 }
10635
10636 pub fn by_item(
10638 self,
10639 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10640 google_cloud_location::model::ListLocationsResponse,
10641 crate::Error,
10642 > {
10643 use google_cloud_gax::paginator::Paginator;
10644 self.by_page().items()
10645 }
10646
10647 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10649 self.0.request.name = v.into();
10650 self
10651 }
10652
10653 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10655 self.0.request.filter = v.into();
10656 self
10657 }
10658
10659 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10661 self.0.request.page_size = v.into();
10662 self
10663 }
10664
10665 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10667 self.0.request.page_token = v.into();
10668 self
10669 }
10670 }
10671
10672 #[doc(hidden)]
10673 impl crate::RequestBuilder for ListLocations {
10674 fn request_options(&mut self) -> &mut crate::RequestOptions {
10675 &mut self.0.options
10676 }
10677 }
10678
10679 #[derive(Clone, Debug)]
10696 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10697
10698 impl GetLocation {
10699 pub(crate) fn new(
10700 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10701 ) -> Self {
10702 Self(RequestBuilder::new(stub))
10703 }
10704
10705 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10707 mut self,
10708 v: V,
10709 ) -> Self {
10710 self.0.request = v.into();
10711 self
10712 }
10713
10714 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10716 self.0.options = v.into();
10717 self
10718 }
10719
10720 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10722 (*self.0.stub)
10723 .get_location(self.0.request, self.0.options)
10724 .await
10725 .map(crate::Response::into_body)
10726 }
10727
10728 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10730 self.0.request.name = v.into();
10731 self
10732 }
10733 }
10734
10735 #[doc(hidden)]
10736 impl crate::RequestBuilder for GetLocation {
10737 fn request_options(&mut self) -> &mut crate::RequestOptions {
10738 &mut self.0.options
10739 }
10740 }
10741
10742 #[derive(Clone, Debug)]
10759 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10760
10761 impl SetIamPolicy {
10762 pub(crate) fn new(
10763 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10764 ) -> Self {
10765 Self(RequestBuilder::new(stub))
10766 }
10767
10768 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10770 mut self,
10771 v: V,
10772 ) -> Self {
10773 self.0.request = v.into();
10774 self
10775 }
10776
10777 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10779 self.0.options = v.into();
10780 self
10781 }
10782
10783 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10785 (*self.0.stub)
10786 .set_iam_policy(self.0.request, self.0.options)
10787 .await
10788 .map(crate::Response::into_body)
10789 }
10790
10791 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10795 self.0.request.resource = v.into();
10796 self
10797 }
10798
10799 pub fn set_policy<T>(mut self, v: T) -> Self
10803 where
10804 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10805 {
10806 self.0.request.policy = std::option::Option::Some(v.into());
10807 self
10808 }
10809
10810 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10814 where
10815 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10816 {
10817 self.0.request.policy = v.map(|x| x.into());
10818 self
10819 }
10820
10821 pub fn set_update_mask<T>(mut self, v: T) -> Self
10823 where
10824 T: std::convert::Into<wkt::FieldMask>,
10825 {
10826 self.0.request.update_mask = std::option::Option::Some(v.into());
10827 self
10828 }
10829
10830 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10832 where
10833 T: std::convert::Into<wkt::FieldMask>,
10834 {
10835 self.0.request.update_mask = v.map(|x| x.into());
10836 self
10837 }
10838 }
10839
10840 #[doc(hidden)]
10841 impl crate::RequestBuilder for SetIamPolicy {
10842 fn request_options(&mut self) -> &mut crate::RequestOptions {
10843 &mut self.0.options
10844 }
10845 }
10846
10847 #[derive(Clone, Debug)]
10864 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
10865
10866 impl GetIamPolicy {
10867 pub(crate) fn new(
10868 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10869 ) -> Self {
10870 Self(RequestBuilder::new(stub))
10871 }
10872
10873 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
10875 mut self,
10876 v: V,
10877 ) -> Self {
10878 self.0.request = v.into();
10879 self
10880 }
10881
10882 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10884 self.0.options = v.into();
10885 self
10886 }
10887
10888 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10890 (*self.0.stub)
10891 .get_iam_policy(self.0.request, self.0.options)
10892 .await
10893 .map(crate::Response::into_body)
10894 }
10895
10896 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10900 self.0.request.resource = v.into();
10901 self
10902 }
10903
10904 pub fn set_options<T>(mut self, v: T) -> Self
10906 where
10907 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10908 {
10909 self.0.request.options = std::option::Option::Some(v.into());
10910 self
10911 }
10912
10913 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10915 where
10916 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10917 {
10918 self.0.request.options = v.map(|x| x.into());
10919 self
10920 }
10921 }
10922
10923 #[doc(hidden)]
10924 impl crate::RequestBuilder for GetIamPolicy {
10925 fn request_options(&mut self) -> &mut crate::RequestOptions {
10926 &mut self.0.options
10927 }
10928 }
10929
10930 #[derive(Clone, Debug)]
10947 pub struct TestIamPermissions(
10948 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10949 );
10950
10951 impl TestIamPermissions {
10952 pub(crate) fn new(
10953 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10954 ) -> Self {
10955 Self(RequestBuilder::new(stub))
10956 }
10957
10958 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10960 mut self,
10961 v: V,
10962 ) -> Self {
10963 self.0.request = v.into();
10964 self
10965 }
10966
10967 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10969 self.0.options = v.into();
10970 self
10971 }
10972
10973 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10975 (*self.0.stub)
10976 .test_iam_permissions(self.0.request, self.0.options)
10977 .await
10978 .map(crate::Response::into_body)
10979 }
10980
10981 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10985 self.0.request.resource = v.into();
10986 self
10987 }
10988
10989 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10993 where
10994 T: std::iter::IntoIterator<Item = V>,
10995 V: std::convert::Into<std::string::String>,
10996 {
10997 use std::iter::Iterator;
10998 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10999 self
11000 }
11001 }
11002
11003 #[doc(hidden)]
11004 impl crate::RequestBuilder for TestIamPermissions {
11005 fn request_options(&mut self) -> &mut crate::RequestOptions {
11006 &mut self.0.options
11007 }
11008 }
11009
11010 #[derive(Clone, Debug)]
11031 pub struct ListOperations(
11032 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11033 );
11034
11035 impl ListOperations {
11036 pub(crate) fn new(
11037 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11038 ) -> Self {
11039 Self(RequestBuilder::new(stub))
11040 }
11041
11042 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11044 mut self,
11045 v: V,
11046 ) -> Self {
11047 self.0.request = v.into();
11048 self
11049 }
11050
11051 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11053 self.0.options = v.into();
11054 self
11055 }
11056
11057 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11059 (*self.0.stub)
11060 .list_operations(self.0.request, self.0.options)
11061 .await
11062 .map(crate::Response::into_body)
11063 }
11064
11065 pub fn by_page(
11067 self,
11068 ) -> impl google_cloud_gax::paginator::Paginator<
11069 google_cloud_longrunning::model::ListOperationsResponse,
11070 crate::Error,
11071 > {
11072 use std::clone::Clone;
11073 let token = self.0.request.page_token.clone();
11074 let execute = move |token: String| {
11075 let mut builder = self.clone();
11076 builder.0.request = builder.0.request.set_page_token(token);
11077 builder.send()
11078 };
11079 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11080 }
11081
11082 pub fn by_item(
11084 self,
11085 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11086 google_cloud_longrunning::model::ListOperationsResponse,
11087 crate::Error,
11088 > {
11089 use google_cloud_gax::paginator::Paginator;
11090 self.by_page().items()
11091 }
11092
11093 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11095 self.0.request.name = v.into();
11096 self
11097 }
11098
11099 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11101 self.0.request.filter = v.into();
11102 self
11103 }
11104
11105 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11107 self.0.request.page_size = v.into();
11108 self
11109 }
11110
11111 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11113 self.0.request.page_token = v.into();
11114 self
11115 }
11116
11117 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11119 self.0.request.return_partial_success = v.into();
11120 self
11121 }
11122 }
11123
11124 #[doc(hidden)]
11125 impl crate::RequestBuilder for ListOperations {
11126 fn request_options(&mut self) -> &mut crate::RequestOptions {
11127 &mut self.0.options
11128 }
11129 }
11130
11131 #[derive(Clone, Debug)]
11148 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11149
11150 impl GetOperation {
11151 pub(crate) fn new(
11152 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11153 ) -> Self {
11154 Self(RequestBuilder::new(stub))
11155 }
11156
11157 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11159 mut self,
11160 v: V,
11161 ) -> Self {
11162 self.0.request = v.into();
11163 self
11164 }
11165
11166 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11168 self.0.options = v.into();
11169 self
11170 }
11171
11172 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11174 (*self.0.stub)
11175 .get_operation(self.0.request, self.0.options)
11176 .await
11177 .map(crate::Response::into_body)
11178 }
11179
11180 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11182 self.0.request.name = v.into();
11183 self
11184 }
11185 }
11186
11187 #[doc(hidden)]
11188 impl crate::RequestBuilder for GetOperation {
11189 fn request_options(&mut self) -> &mut crate::RequestOptions {
11190 &mut self.0.options
11191 }
11192 }
11193
11194 #[derive(Clone, Debug)]
11211 pub struct DeleteOperation(
11212 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11213 );
11214
11215 impl DeleteOperation {
11216 pub(crate) fn new(
11217 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11218 ) -> Self {
11219 Self(RequestBuilder::new(stub))
11220 }
11221
11222 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11224 mut self,
11225 v: V,
11226 ) -> Self {
11227 self.0.request = v.into();
11228 self
11229 }
11230
11231 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11233 self.0.options = v.into();
11234 self
11235 }
11236
11237 pub async fn send(self) -> Result<()> {
11239 (*self.0.stub)
11240 .delete_operation(self.0.request, self.0.options)
11241 .await
11242 .map(crate::Response::into_body)
11243 }
11244
11245 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11247 self.0.request.name = v.into();
11248 self
11249 }
11250 }
11251
11252 #[doc(hidden)]
11253 impl crate::RequestBuilder for DeleteOperation {
11254 fn request_options(&mut self) -> &mut crate::RequestOptions {
11255 &mut self.0.options
11256 }
11257 }
11258
11259 #[derive(Clone, Debug)]
11276 pub struct CancelOperation(
11277 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11278 );
11279
11280 impl CancelOperation {
11281 pub(crate) fn new(
11282 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11283 ) -> Self {
11284 Self(RequestBuilder::new(stub))
11285 }
11286
11287 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11289 mut self,
11290 v: V,
11291 ) -> Self {
11292 self.0.request = v.into();
11293 self
11294 }
11295
11296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11298 self.0.options = v.into();
11299 self
11300 }
11301
11302 pub async fn send(self) -> Result<()> {
11304 (*self.0.stub)
11305 .cancel_operation(self.0.request, self.0.options)
11306 .await
11307 .map(crate::Response::into_body)
11308 }
11309
11310 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11312 self.0.request.name = v.into();
11313 self
11314 }
11315 }
11316
11317 #[doc(hidden)]
11318 impl crate::RequestBuilder for CancelOperation {
11319 fn request_options(&mut self) -> &mut crate::RequestOptions {
11320 &mut self.0.options
11321 }
11322 }
11323}
11324
11325pub mod data_taxonomy_service {
11326 use crate::Result;
11327
11328 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11342
11343 pub(crate) mod client {
11344 use super::super::super::client::DataTaxonomyService;
11345 pub struct Factory;
11346 impl crate::ClientFactory for Factory {
11347 type Client = DataTaxonomyService;
11348 type Credentials = gaxi::options::Credentials;
11349 async fn build(
11350 self,
11351 config: gaxi::options::ClientConfig,
11352 ) -> crate::ClientBuilderResult<Self::Client> {
11353 Self::Client::new(config).await
11354 }
11355 }
11356 }
11357
11358 #[derive(Clone, Debug)]
11360 pub(crate) struct RequestBuilder<R: std::default::Default> {
11361 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11362 request: R,
11363 options: crate::RequestOptions,
11364 }
11365
11366 impl<R> RequestBuilder<R>
11367 where
11368 R: std::default::Default,
11369 {
11370 pub(crate) fn new(
11371 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11372 ) -> Self {
11373 Self {
11374 stub,
11375 request: R::default(),
11376 options: crate::RequestOptions::default(),
11377 }
11378 }
11379 }
11380
11381 #[derive(Clone, Debug)]
11399 pub struct CreateDataTaxonomy(RequestBuilder<crate::model::CreateDataTaxonomyRequest>);
11400
11401 impl CreateDataTaxonomy {
11402 pub(crate) fn new(
11403 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11404 ) -> Self {
11405 Self(RequestBuilder::new(stub))
11406 }
11407
11408 pub fn with_request<V: Into<crate::model::CreateDataTaxonomyRequest>>(
11410 mut self,
11411 v: V,
11412 ) -> Self {
11413 self.0.request = v.into();
11414 self
11415 }
11416
11417 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11419 self.0.options = v.into();
11420 self
11421 }
11422
11423 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11430 (*self.0.stub)
11431 .create_data_taxonomy(self.0.request, self.0.options)
11432 .await
11433 .map(crate::Response::into_body)
11434 }
11435
11436 pub fn poller(
11438 self,
11439 ) -> impl google_cloud_lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata>
11440 {
11441 type Operation = google_cloud_lro::internal::Operation<
11442 crate::model::DataTaxonomy,
11443 crate::model::OperationMetadata,
11444 >;
11445 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11446 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11447
11448 let stub = self.0.stub.clone();
11449 let mut options = self.0.options.clone();
11450 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11451 let query = move |name| {
11452 let stub = stub.clone();
11453 let options = options.clone();
11454 async {
11455 let op = GetOperation::new(stub)
11456 .set_name(name)
11457 .with_options(options)
11458 .send()
11459 .await?;
11460 Ok(Operation::new(op))
11461 }
11462 };
11463
11464 let start = move || async {
11465 let op = self.send().await?;
11466 Ok(Operation::new(op))
11467 };
11468
11469 google_cloud_lro::internal::new_poller(
11470 polling_error_policy,
11471 polling_backoff_policy,
11472 start,
11473 query,
11474 )
11475 }
11476
11477 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11481 self.0.request.parent = v.into();
11482 self
11483 }
11484
11485 pub fn set_data_taxonomy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11489 self.0.request.data_taxonomy_id = v.into();
11490 self
11491 }
11492
11493 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
11497 where
11498 T: std::convert::Into<crate::model::DataTaxonomy>,
11499 {
11500 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
11501 self
11502 }
11503
11504 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
11508 where
11509 T: std::convert::Into<crate::model::DataTaxonomy>,
11510 {
11511 self.0.request.data_taxonomy = v.map(|x| x.into());
11512 self
11513 }
11514
11515 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11517 self.0.request.validate_only = v.into();
11518 self
11519 }
11520 }
11521
11522 #[doc(hidden)]
11523 impl crate::RequestBuilder for CreateDataTaxonomy {
11524 fn request_options(&mut self) -> &mut crate::RequestOptions {
11525 &mut self.0.options
11526 }
11527 }
11528
11529 #[derive(Clone, Debug)]
11547 pub struct UpdateDataTaxonomy(RequestBuilder<crate::model::UpdateDataTaxonomyRequest>);
11548
11549 impl UpdateDataTaxonomy {
11550 pub(crate) fn new(
11551 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11552 ) -> Self {
11553 Self(RequestBuilder::new(stub))
11554 }
11555
11556 pub fn with_request<V: Into<crate::model::UpdateDataTaxonomyRequest>>(
11558 mut self,
11559 v: V,
11560 ) -> Self {
11561 self.0.request = v.into();
11562 self
11563 }
11564
11565 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11567 self.0.options = v.into();
11568 self
11569 }
11570
11571 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11578 (*self.0.stub)
11579 .update_data_taxonomy(self.0.request, self.0.options)
11580 .await
11581 .map(crate::Response::into_body)
11582 }
11583
11584 pub fn poller(
11586 self,
11587 ) -> impl google_cloud_lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata>
11588 {
11589 type Operation = google_cloud_lro::internal::Operation<
11590 crate::model::DataTaxonomy,
11591 crate::model::OperationMetadata,
11592 >;
11593 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11594 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11595
11596 let stub = self.0.stub.clone();
11597 let mut options = self.0.options.clone();
11598 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11599 let query = move |name| {
11600 let stub = stub.clone();
11601 let options = options.clone();
11602 async {
11603 let op = GetOperation::new(stub)
11604 .set_name(name)
11605 .with_options(options)
11606 .send()
11607 .await?;
11608 Ok(Operation::new(op))
11609 }
11610 };
11611
11612 let start = move || async {
11613 let op = self.send().await?;
11614 Ok(Operation::new(op))
11615 };
11616
11617 google_cloud_lro::internal::new_poller(
11618 polling_error_policy,
11619 polling_backoff_policy,
11620 start,
11621 query,
11622 )
11623 }
11624
11625 pub fn set_update_mask<T>(mut self, v: T) -> Self
11629 where
11630 T: std::convert::Into<wkt::FieldMask>,
11631 {
11632 self.0.request.update_mask = std::option::Option::Some(v.into());
11633 self
11634 }
11635
11636 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11640 where
11641 T: std::convert::Into<wkt::FieldMask>,
11642 {
11643 self.0.request.update_mask = v.map(|x| x.into());
11644 self
11645 }
11646
11647 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
11651 where
11652 T: std::convert::Into<crate::model::DataTaxonomy>,
11653 {
11654 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
11655 self
11656 }
11657
11658 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
11662 where
11663 T: std::convert::Into<crate::model::DataTaxonomy>,
11664 {
11665 self.0.request.data_taxonomy = v.map(|x| x.into());
11666 self
11667 }
11668
11669 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11671 self.0.request.validate_only = v.into();
11672 self
11673 }
11674 }
11675
11676 #[doc(hidden)]
11677 impl crate::RequestBuilder for UpdateDataTaxonomy {
11678 fn request_options(&mut self) -> &mut crate::RequestOptions {
11679 &mut self.0.options
11680 }
11681 }
11682
11683 #[derive(Clone, Debug)]
11701 pub struct DeleteDataTaxonomy(RequestBuilder<crate::model::DeleteDataTaxonomyRequest>);
11702
11703 impl DeleteDataTaxonomy {
11704 pub(crate) fn new(
11705 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11706 ) -> Self {
11707 Self(RequestBuilder::new(stub))
11708 }
11709
11710 pub fn with_request<V: Into<crate::model::DeleteDataTaxonomyRequest>>(
11712 mut self,
11713 v: V,
11714 ) -> Self {
11715 self.0.request = v.into();
11716 self
11717 }
11718
11719 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11721 self.0.options = v.into();
11722 self
11723 }
11724
11725 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11732 (*self.0.stub)
11733 .delete_data_taxonomy(self.0.request, self.0.options)
11734 .await
11735 .map(crate::Response::into_body)
11736 }
11737
11738 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11740 type Operation =
11741 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11742 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11743 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11744
11745 let stub = self.0.stub.clone();
11746 let mut options = self.0.options.clone();
11747 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11748 let query = move |name| {
11749 let stub = stub.clone();
11750 let options = options.clone();
11751 async {
11752 let op = GetOperation::new(stub)
11753 .set_name(name)
11754 .with_options(options)
11755 .send()
11756 .await?;
11757 Ok(Operation::new(op))
11758 }
11759 };
11760
11761 let start = move || async {
11762 let op = self.send().await?;
11763 Ok(Operation::new(op))
11764 };
11765
11766 google_cloud_lro::internal::new_unit_response_poller(
11767 polling_error_policy,
11768 polling_backoff_policy,
11769 start,
11770 query,
11771 )
11772 }
11773
11774 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11778 self.0.request.name = v.into();
11779 self
11780 }
11781
11782 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
11784 self.0.request.etag = v.into();
11785 self
11786 }
11787 }
11788
11789 #[doc(hidden)]
11790 impl crate::RequestBuilder for DeleteDataTaxonomy {
11791 fn request_options(&mut self) -> &mut crate::RequestOptions {
11792 &mut self.0.options
11793 }
11794 }
11795
11796 #[derive(Clone, Debug)]
11817 pub struct ListDataTaxonomies(RequestBuilder<crate::model::ListDataTaxonomiesRequest>);
11818
11819 impl ListDataTaxonomies {
11820 pub(crate) fn new(
11821 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11822 ) -> Self {
11823 Self(RequestBuilder::new(stub))
11824 }
11825
11826 pub fn with_request<V: Into<crate::model::ListDataTaxonomiesRequest>>(
11828 mut self,
11829 v: V,
11830 ) -> Self {
11831 self.0.request = v.into();
11832 self
11833 }
11834
11835 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11837 self.0.options = v.into();
11838 self
11839 }
11840
11841 pub async fn send(self) -> Result<crate::model::ListDataTaxonomiesResponse> {
11843 (*self.0.stub)
11844 .list_data_taxonomies(self.0.request, self.0.options)
11845 .await
11846 .map(crate::Response::into_body)
11847 }
11848
11849 pub fn by_page(
11851 self,
11852 ) -> impl google_cloud_gax::paginator::Paginator<
11853 crate::model::ListDataTaxonomiesResponse,
11854 crate::Error,
11855 > {
11856 use std::clone::Clone;
11857 let token = self.0.request.page_token.clone();
11858 let execute = move |token: String| {
11859 let mut builder = self.clone();
11860 builder.0.request = builder.0.request.set_page_token(token);
11861 builder.send()
11862 };
11863 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11864 }
11865
11866 pub fn by_item(
11868 self,
11869 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11870 crate::model::ListDataTaxonomiesResponse,
11871 crate::Error,
11872 > {
11873 use google_cloud_gax::paginator::Paginator;
11874 self.by_page().items()
11875 }
11876
11877 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11881 self.0.request.parent = v.into();
11882 self
11883 }
11884
11885 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11887 self.0.request.page_size = v.into();
11888 self
11889 }
11890
11891 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11893 self.0.request.page_token = v.into();
11894 self
11895 }
11896
11897 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11899 self.0.request.filter = v.into();
11900 self
11901 }
11902
11903 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11905 self.0.request.order_by = v.into();
11906 self
11907 }
11908 }
11909
11910 #[doc(hidden)]
11911 impl crate::RequestBuilder for ListDataTaxonomies {
11912 fn request_options(&mut self) -> &mut crate::RequestOptions {
11913 &mut self.0.options
11914 }
11915 }
11916
11917 #[derive(Clone, Debug)]
11934 pub struct GetDataTaxonomy(RequestBuilder<crate::model::GetDataTaxonomyRequest>);
11935
11936 impl GetDataTaxonomy {
11937 pub(crate) fn new(
11938 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11939 ) -> Self {
11940 Self(RequestBuilder::new(stub))
11941 }
11942
11943 pub fn with_request<V: Into<crate::model::GetDataTaxonomyRequest>>(mut self, v: V) -> Self {
11945 self.0.request = v.into();
11946 self
11947 }
11948
11949 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11951 self.0.options = v.into();
11952 self
11953 }
11954
11955 pub async fn send(self) -> Result<crate::model::DataTaxonomy> {
11957 (*self.0.stub)
11958 .get_data_taxonomy(self.0.request, self.0.options)
11959 .await
11960 .map(crate::Response::into_body)
11961 }
11962
11963 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11967 self.0.request.name = v.into();
11968 self
11969 }
11970 }
11971
11972 #[doc(hidden)]
11973 impl crate::RequestBuilder for GetDataTaxonomy {
11974 fn request_options(&mut self) -> &mut crate::RequestOptions {
11975 &mut self.0.options
11976 }
11977 }
11978
11979 #[derive(Clone, Debug)]
11997 pub struct CreateDataAttributeBinding(
11998 RequestBuilder<crate::model::CreateDataAttributeBindingRequest>,
11999 );
12000
12001 impl CreateDataAttributeBinding {
12002 pub(crate) fn new(
12003 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12004 ) -> Self {
12005 Self(RequestBuilder::new(stub))
12006 }
12007
12008 pub fn with_request<V: Into<crate::model::CreateDataAttributeBindingRequest>>(
12010 mut self,
12011 v: V,
12012 ) -> Self {
12013 self.0.request = v.into();
12014 self
12015 }
12016
12017 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12019 self.0.options = v.into();
12020 self
12021 }
12022
12023 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12030 (*self.0.stub)
12031 .create_data_attribute_binding(self.0.request, self.0.options)
12032 .await
12033 .map(crate::Response::into_body)
12034 }
12035
12036 pub fn poller(
12038 self,
12039 ) -> impl google_cloud_lro::Poller<
12040 crate::model::DataAttributeBinding,
12041 crate::model::OperationMetadata,
12042 > {
12043 type Operation = google_cloud_lro::internal::Operation<
12044 crate::model::DataAttributeBinding,
12045 crate::model::OperationMetadata,
12046 >;
12047 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12048 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12049
12050 let stub = self.0.stub.clone();
12051 let mut options = self.0.options.clone();
12052 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12053 let query = move |name| {
12054 let stub = stub.clone();
12055 let options = options.clone();
12056 async {
12057 let op = GetOperation::new(stub)
12058 .set_name(name)
12059 .with_options(options)
12060 .send()
12061 .await?;
12062 Ok(Operation::new(op))
12063 }
12064 };
12065
12066 let start = move || async {
12067 let op = self.send().await?;
12068 Ok(Operation::new(op))
12069 };
12070
12071 google_cloud_lro::internal::new_poller(
12072 polling_error_policy,
12073 polling_backoff_policy,
12074 start,
12075 query,
12076 )
12077 }
12078
12079 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12083 self.0.request.parent = v.into();
12084 self
12085 }
12086
12087 pub fn set_data_attribute_binding_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12091 self.0.request.data_attribute_binding_id = v.into();
12092 self
12093 }
12094
12095 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
12099 where
12100 T: std::convert::Into<crate::model::DataAttributeBinding>,
12101 {
12102 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
12103 self
12104 }
12105
12106 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
12110 where
12111 T: std::convert::Into<crate::model::DataAttributeBinding>,
12112 {
12113 self.0.request.data_attribute_binding = v.map(|x| x.into());
12114 self
12115 }
12116
12117 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12119 self.0.request.validate_only = v.into();
12120 self
12121 }
12122 }
12123
12124 #[doc(hidden)]
12125 impl crate::RequestBuilder for CreateDataAttributeBinding {
12126 fn request_options(&mut self) -> &mut crate::RequestOptions {
12127 &mut self.0.options
12128 }
12129 }
12130
12131 #[derive(Clone, Debug)]
12149 pub struct UpdateDataAttributeBinding(
12150 RequestBuilder<crate::model::UpdateDataAttributeBindingRequest>,
12151 );
12152
12153 impl UpdateDataAttributeBinding {
12154 pub(crate) fn new(
12155 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12156 ) -> Self {
12157 Self(RequestBuilder::new(stub))
12158 }
12159
12160 pub fn with_request<V: Into<crate::model::UpdateDataAttributeBindingRequest>>(
12162 mut self,
12163 v: V,
12164 ) -> Self {
12165 self.0.request = v.into();
12166 self
12167 }
12168
12169 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12171 self.0.options = v.into();
12172 self
12173 }
12174
12175 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12182 (*self.0.stub)
12183 .update_data_attribute_binding(self.0.request, self.0.options)
12184 .await
12185 .map(crate::Response::into_body)
12186 }
12187
12188 pub fn poller(
12190 self,
12191 ) -> impl google_cloud_lro::Poller<
12192 crate::model::DataAttributeBinding,
12193 crate::model::OperationMetadata,
12194 > {
12195 type Operation = google_cloud_lro::internal::Operation<
12196 crate::model::DataAttributeBinding,
12197 crate::model::OperationMetadata,
12198 >;
12199 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12200 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12201
12202 let stub = self.0.stub.clone();
12203 let mut options = self.0.options.clone();
12204 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12205 let query = move |name| {
12206 let stub = stub.clone();
12207 let options = options.clone();
12208 async {
12209 let op = GetOperation::new(stub)
12210 .set_name(name)
12211 .with_options(options)
12212 .send()
12213 .await?;
12214 Ok(Operation::new(op))
12215 }
12216 };
12217
12218 let start = move || async {
12219 let op = self.send().await?;
12220 Ok(Operation::new(op))
12221 };
12222
12223 google_cloud_lro::internal::new_poller(
12224 polling_error_policy,
12225 polling_backoff_policy,
12226 start,
12227 query,
12228 )
12229 }
12230
12231 pub fn set_update_mask<T>(mut self, v: T) -> Self
12235 where
12236 T: std::convert::Into<wkt::FieldMask>,
12237 {
12238 self.0.request.update_mask = std::option::Option::Some(v.into());
12239 self
12240 }
12241
12242 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12246 where
12247 T: std::convert::Into<wkt::FieldMask>,
12248 {
12249 self.0.request.update_mask = v.map(|x| x.into());
12250 self
12251 }
12252
12253 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
12257 where
12258 T: std::convert::Into<crate::model::DataAttributeBinding>,
12259 {
12260 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
12261 self
12262 }
12263
12264 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
12268 where
12269 T: std::convert::Into<crate::model::DataAttributeBinding>,
12270 {
12271 self.0.request.data_attribute_binding = v.map(|x| x.into());
12272 self
12273 }
12274
12275 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12277 self.0.request.validate_only = v.into();
12278 self
12279 }
12280 }
12281
12282 #[doc(hidden)]
12283 impl crate::RequestBuilder for UpdateDataAttributeBinding {
12284 fn request_options(&mut self) -> &mut crate::RequestOptions {
12285 &mut self.0.options
12286 }
12287 }
12288
12289 #[derive(Clone, Debug)]
12307 pub struct DeleteDataAttributeBinding(
12308 RequestBuilder<crate::model::DeleteDataAttributeBindingRequest>,
12309 );
12310
12311 impl DeleteDataAttributeBinding {
12312 pub(crate) fn new(
12313 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12314 ) -> Self {
12315 Self(RequestBuilder::new(stub))
12316 }
12317
12318 pub fn with_request<V: Into<crate::model::DeleteDataAttributeBindingRequest>>(
12320 mut self,
12321 v: V,
12322 ) -> Self {
12323 self.0.request = v.into();
12324 self
12325 }
12326
12327 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12329 self.0.options = v.into();
12330 self
12331 }
12332
12333 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12340 (*self.0.stub)
12341 .delete_data_attribute_binding(self.0.request, self.0.options)
12342 .await
12343 .map(crate::Response::into_body)
12344 }
12345
12346 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12348 type Operation =
12349 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12350 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12351 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12352
12353 let stub = self.0.stub.clone();
12354 let mut options = self.0.options.clone();
12355 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12356 let query = move |name| {
12357 let stub = stub.clone();
12358 let options = options.clone();
12359 async {
12360 let op = GetOperation::new(stub)
12361 .set_name(name)
12362 .with_options(options)
12363 .send()
12364 .await?;
12365 Ok(Operation::new(op))
12366 }
12367 };
12368
12369 let start = move || async {
12370 let op = self.send().await?;
12371 Ok(Operation::new(op))
12372 };
12373
12374 google_cloud_lro::internal::new_unit_response_poller(
12375 polling_error_policy,
12376 polling_backoff_policy,
12377 start,
12378 query,
12379 )
12380 }
12381
12382 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12386 self.0.request.name = v.into();
12387 self
12388 }
12389
12390 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
12394 self.0.request.etag = v.into();
12395 self
12396 }
12397 }
12398
12399 #[doc(hidden)]
12400 impl crate::RequestBuilder for DeleteDataAttributeBinding {
12401 fn request_options(&mut self) -> &mut crate::RequestOptions {
12402 &mut self.0.options
12403 }
12404 }
12405
12406 #[derive(Clone, Debug)]
12427 pub struct ListDataAttributeBindings(
12428 RequestBuilder<crate::model::ListDataAttributeBindingsRequest>,
12429 );
12430
12431 impl ListDataAttributeBindings {
12432 pub(crate) fn new(
12433 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12434 ) -> Self {
12435 Self(RequestBuilder::new(stub))
12436 }
12437
12438 pub fn with_request<V: Into<crate::model::ListDataAttributeBindingsRequest>>(
12440 mut self,
12441 v: V,
12442 ) -> Self {
12443 self.0.request = v.into();
12444 self
12445 }
12446
12447 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12449 self.0.options = v.into();
12450 self
12451 }
12452
12453 pub async fn send(self) -> Result<crate::model::ListDataAttributeBindingsResponse> {
12455 (*self.0.stub)
12456 .list_data_attribute_bindings(self.0.request, self.0.options)
12457 .await
12458 .map(crate::Response::into_body)
12459 }
12460
12461 pub fn by_page(
12463 self,
12464 ) -> impl google_cloud_gax::paginator::Paginator<
12465 crate::model::ListDataAttributeBindingsResponse,
12466 crate::Error,
12467 > {
12468 use std::clone::Clone;
12469 let token = self.0.request.page_token.clone();
12470 let execute = move |token: String| {
12471 let mut builder = self.clone();
12472 builder.0.request = builder.0.request.set_page_token(token);
12473 builder.send()
12474 };
12475 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12476 }
12477
12478 pub fn by_item(
12480 self,
12481 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12482 crate::model::ListDataAttributeBindingsResponse,
12483 crate::Error,
12484 > {
12485 use google_cloud_gax::paginator::Paginator;
12486 self.by_page().items()
12487 }
12488
12489 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12493 self.0.request.parent = v.into();
12494 self
12495 }
12496
12497 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12499 self.0.request.page_size = v.into();
12500 self
12501 }
12502
12503 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12505 self.0.request.page_token = v.into();
12506 self
12507 }
12508
12509 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12511 self.0.request.filter = v.into();
12512 self
12513 }
12514
12515 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12517 self.0.request.order_by = v.into();
12518 self
12519 }
12520 }
12521
12522 #[doc(hidden)]
12523 impl crate::RequestBuilder for ListDataAttributeBindings {
12524 fn request_options(&mut self) -> &mut crate::RequestOptions {
12525 &mut self.0.options
12526 }
12527 }
12528
12529 #[derive(Clone, Debug)]
12546 pub struct GetDataAttributeBinding(
12547 RequestBuilder<crate::model::GetDataAttributeBindingRequest>,
12548 );
12549
12550 impl GetDataAttributeBinding {
12551 pub(crate) fn new(
12552 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12553 ) -> Self {
12554 Self(RequestBuilder::new(stub))
12555 }
12556
12557 pub fn with_request<V: Into<crate::model::GetDataAttributeBindingRequest>>(
12559 mut self,
12560 v: V,
12561 ) -> Self {
12562 self.0.request = v.into();
12563 self
12564 }
12565
12566 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12568 self.0.options = v.into();
12569 self
12570 }
12571
12572 pub async fn send(self) -> Result<crate::model::DataAttributeBinding> {
12574 (*self.0.stub)
12575 .get_data_attribute_binding(self.0.request, self.0.options)
12576 .await
12577 .map(crate::Response::into_body)
12578 }
12579
12580 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12584 self.0.request.name = v.into();
12585 self
12586 }
12587 }
12588
12589 #[doc(hidden)]
12590 impl crate::RequestBuilder for GetDataAttributeBinding {
12591 fn request_options(&mut self) -> &mut crate::RequestOptions {
12592 &mut self.0.options
12593 }
12594 }
12595
12596 #[derive(Clone, Debug)]
12614 pub struct CreateDataAttribute(RequestBuilder<crate::model::CreateDataAttributeRequest>);
12615
12616 impl CreateDataAttribute {
12617 pub(crate) fn new(
12618 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12619 ) -> Self {
12620 Self(RequestBuilder::new(stub))
12621 }
12622
12623 pub fn with_request<V: Into<crate::model::CreateDataAttributeRequest>>(
12625 mut self,
12626 v: V,
12627 ) -> Self {
12628 self.0.request = v.into();
12629 self
12630 }
12631
12632 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12634 self.0.options = v.into();
12635 self
12636 }
12637
12638 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12645 (*self.0.stub)
12646 .create_data_attribute(self.0.request, self.0.options)
12647 .await
12648 .map(crate::Response::into_body)
12649 }
12650
12651 pub fn poller(
12653 self,
12654 ) -> impl google_cloud_lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
12655 {
12656 type Operation = google_cloud_lro::internal::Operation<
12657 crate::model::DataAttribute,
12658 crate::model::OperationMetadata,
12659 >;
12660 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12661 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12662
12663 let stub = self.0.stub.clone();
12664 let mut options = self.0.options.clone();
12665 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12666 let query = move |name| {
12667 let stub = stub.clone();
12668 let options = options.clone();
12669 async {
12670 let op = GetOperation::new(stub)
12671 .set_name(name)
12672 .with_options(options)
12673 .send()
12674 .await?;
12675 Ok(Operation::new(op))
12676 }
12677 };
12678
12679 let start = move || async {
12680 let op = self.send().await?;
12681 Ok(Operation::new(op))
12682 };
12683
12684 google_cloud_lro::internal::new_poller(
12685 polling_error_policy,
12686 polling_backoff_policy,
12687 start,
12688 query,
12689 )
12690 }
12691
12692 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12696 self.0.request.parent = v.into();
12697 self
12698 }
12699
12700 pub fn set_data_attribute_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12704 self.0.request.data_attribute_id = v.into();
12705 self
12706 }
12707
12708 pub fn set_data_attribute<T>(mut self, v: T) -> Self
12712 where
12713 T: std::convert::Into<crate::model::DataAttribute>,
12714 {
12715 self.0.request.data_attribute = std::option::Option::Some(v.into());
12716 self
12717 }
12718
12719 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
12723 where
12724 T: std::convert::Into<crate::model::DataAttribute>,
12725 {
12726 self.0.request.data_attribute = v.map(|x| x.into());
12727 self
12728 }
12729
12730 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12732 self.0.request.validate_only = v.into();
12733 self
12734 }
12735 }
12736
12737 #[doc(hidden)]
12738 impl crate::RequestBuilder for CreateDataAttribute {
12739 fn request_options(&mut self) -> &mut crate::RequestOptions {
12740 &mut self.0.options
12741 }
12742 }
12743
12744 #[derive(Clone, Debug)]
12762 pub struct UpdateDataAttribute(RequestBuilder<crate::model::UpdateDataAttributeRequest>);
12763
12764 impl UpdateDataAttribute {
12765 pub(crate) fn new(
12766 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12767 ) -> Self {
12768 Self(RequestBuilder::new(stub))
12769 }
12770
12771 pub fn with_request<V: Into<crate::model::UpdateDataAttributeRequest>>(
12773 mut self,
12774 v: V,
12775 ) -> Self {
12776 self.0.request = v.into();
12777 self
12778 }
12779
12780 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12782 self.0.options = v.into();
12783 self
12784 }
12785
12786 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12793 (*self.0.stub)
12794 .update_data_attribute(self.0.request, self.0.options)
12795 .await
12796 .map(crate::Response::into_body)
12797 }
12798
12799 pub fn poller(
12801 self,
12802 ) -> impl google_cloud_lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
12803 {
12804 type Operation = google_cloud_lro::internal::Operation<
12805 crate::model::DataAttribute,
12806 crate::model::OperationMetadata,
12807 >;
12808 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12809 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12810
12811 let stub = self.0.stub.clone();
12812 let mut options = self.0.options.clone();
12813 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12814 let query = move |name| {
12815 let stub = stub.clone();
12816 let options = options.clone();
12817 async {
12818 let op = GetOperation::new(stub)
12819 .set_name(name)
12820 .with_options(options)
12821 .send()
12822 .await?;
12823 Ok(Operation::new(op))
12824 }
12825 };
12826
12827 let start = move || async {
12828 let op = self.send().await?;
12829 Ok(Operation::new(op))
12830 };
12831
12832 google_cloud_lro::internal::new_poller(
12833 polling_error_policy,
12834 polling_backoff_policy,
12835 start,
12836 query,
12837 )
12838 }
12839
12840 pub fn set_update_mask<T>(mut self, v: T) -> Self
12844 where
12845 T: std::convert::Into<wkt::FieldMask>,
12846 {
12847 self.0.request.update_mask = std::option::Option::Some(v.into());
12848 self
12849 }
12850
12851 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12855 where
12856 T: std::convert::Into<wkt::FieldMask>,
12857 {
12858 self.0.request.update_mask = v.map(|x| x.into());
12859 self
12860 }
12861
12862 pub fn set_data_attribute<T>(mut self, v: T) -> Self
12866 where
12867 T: std::convert::Into<crate::model::DataAttribute>,
12868 {
12869 self.0.request.data_attribute = std::option::Option::Some(v.into());
12870 self
12871 }
12872
12873 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
12877 where
12878 T: std::convert::Into<crate::model::DataAttribute>,
12879 {
12880 self.0.request.data_attribute = v.map(|x| x.into());
12881 self
12882 }
12883
12884 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12886 self.0.request.validate_only = v.into();
12887 self
12888 }
12889 }
12890
12891 #[doc(hidden)]
12892 impl crate::RequestBuilder for UpdateDataAttribute {
12893 fn request_options(&mut self) -> &mut crate::RequestOptions {
12894 &mut self.0.options
12895 }
12896 }
12897
12898 #[derive(Clone, Debug)]
12916 pub struct DeleteDataAttribute(RequestBuilder<crate::model::DeleteDataAttributeRequest>);
12917
12918 impl DeleteDataAttribute {
12919 pub(crate) fn new(
12920 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12921 ) -> Self {
12922 Self(RequestBuilder::new(stub))
12923 }
12924
12925 pub fn with_request<V: Into<crate::model::DeleteDataAttributeRequest>>(
12927 mut self,
12928 v: V,
12929 ) -> Self {
12930 self.0.request = v.into();
12931 self
12932 }
12933
12934 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12936 self.0.options = v.into();
12937 self
12938 }
12939
12940 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12947 (*self.0.stub)
12948 .delete_data_attribute(self.0.request, self.0.options)
12949 .await
12950 .map(crate::Response::into_body)
12951 }
12952
12953 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12955 type Operation =
12956 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12957 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12958 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12959
12960 let stub = self.0.stub.clone();
12961 let mut options = self.0.options.clone();
12962 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12963 let query = move |name| {
12964 let stub = stub.clone();
12965 let options = options.clone();
12966 async {
12967 let op = GetOperation::new(stub)
12968 .set_name(name)
12969 .with_options(options)
12970 .send()
12971 .await?;
12972 Ok(Operation::new(op))
12973 }
12974 };
12975
12976 let start = move || async {
12977 let op = self.send().await?;
12978 Ok(Operation::new(op))
12979 };
12980
12981 google_cloud_lro::internal::new_unit_response_poller(
12982 polling_error_policy,
12983 polling_backoff_policy,
12984 start,
12985 query,
12986 )
12987 }
12988
12989 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12993 self.0.request.name = v.into();
12994 self
12995 }
12996
12997 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
12999 self.0.request.etag = v.into();
13000 self
13001 }
13002 }
13003
13004 #[doc(hidden)]
13005 impl crate::RequestBuilder for DeleteDataAttribute {
13006 fn request_options(&mut self) -> &mut crate::RequestOptions {
13007 &mut self.0.options
13008 }
13009 }
13010
13011 #[derive(Clone, Debug)]
13032 pub struct ListDataAttributes(RequestBuilder<crate::model::ListDataAttributesRequest>);
13033
13034 impl ListDataAttributes {
13035 pub(crate) fn new(
13036 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13037 ) -> Self {
13038 Self(RequestBuilder::new(stub))
13039 }
13040
13041 pub fn with_request<V: Into<crate::model::ListDataAttributesRequest>>(
13043 mut self,
13044 v: V,
13045 ) -> Self {
13046 self.0.request = v.into();
13047 self
13048 }
13049
13050 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13052 self.0.options = v.into();
13053 self
13054 }
13055
13056 pub async fn send(self) -> Result<crate::model::ListDataAttributesResponse> {
13058 (*self.0.stub)
13059 .list_data_attributes(self.0.request, self.0.options)
13060 .await
13061 .map(crate::Response::into_body)
13062 }
13063
13064 pub fn by_page(
13066 self,
13067 ) -> impl google_cloud_gax::paginator::Paginator<
13068 crate::model::ListDataAttributesResponse,
13069 crate::Error,
13070 > {
13071 use std::clone::Clone;
13072 let token = self.0.request.page_token.clone();
13073 let execute = move |token: String| {
13074 let mut builder = self.clone();
13075 builder.0.request = builder.0.request.set_page_token(token);
13076 builder.send()
13077 };
13078 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13079 }
13080
13081 pub fn by_item(
13083 self,
13084 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13085 crate::model::ListDataAttributesResponse,
13086 crate::Error,
13087 > {
13088 use google_cloud_gax::paginator::Paginator;
13089 self.by_page().items()
13090 }
13091
13092 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13096 self.0.request.parent = v.into();
13097 self
13098 }
13099
13100 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13102 self.0.request.page_size = v.into();
13103 self
13104 }
13105
13106 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13108 self.0.request.page_token = v.into();
13109 self
13110 }
13111
13112 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13114 self.0.request.filter = v.into();
13115 self
13116 }
13117
13118 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
13120 self.0.request.order_by = v.into();
13121 self
13122 }
13123 }
13124
13125 #[doc(hidden)]
13126 impl crate::RequestBuilder for ListDataAttributes {
13127 fn request_options(&mut self) -> &mut crate::RequestOptions {
13128 &mut self.0.options
13129 }
13130 }
13131
13132 #[derive(Clone, Debug)]
13149 pub struct GetDataAttribute(RequestBuilder<crate::model::GetDataAttributeRequest>);
13150
13151 impl GetDataAttribute {
13152 pub(crate) fn new(
13153 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13154 ) -> Self {
13155 Self(RequestBuilder::new(stub))
13156 }
13157
13158 pub fn with_request<V: Into<crate::model::GetDataAttributeRequest>>(
13160 mut self,
13161 v: V,
13162 ) -> Self {
13163 self.0.request = v.into();
13164 self
13165 }
13166
13167 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13169 self.0.options = v.into();
13170 self
13171 }
13172
13173 pub async fn send(self) -> Result<crate::model::DataAttribute> {
13175 (*self.0.stub)
13176 .get_data_attribute(self.0.request, self.0.options)
13177 .await
13178 .map(crate::Response::into_body)
13179 }
13180
13181 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13185 self.0.request.name = v.into();
13186 self
13187 }
13188 }
13189
13190 #[doc(hidden)]
13191 impl crate::RequestBuilder for GetDataAttribute {
13192 fn request_options(&mut self) -> &mut crate::RequestOptions {
13193 &mut self.0.options
13194 }
13195 }
13196
13197 #[derive(Clone, Debug)]
13218 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13219
13220 impl ListLocations {
13221 pub(crate) fn new(
13222 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13223 ) -> Self {
13224 Self(RequestBuilder::new(stub))
13225 }
13226
13227 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13229 mut self,
13230 v: V,
13231 ) -> Self {
13232 self.0.request = v.into();
13233 self
13234 }
13235
13236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13238 self.0.options = v.into();
13239 self
13240 }
13241
13242 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13244 (*self.0.stub)
13245 .list_locations(self.0.request, self.0.options)
13246 .await
13247 .map(crate::Response::into_body)
13248 }
13249
13250 pub fn by_page(
13252 self,
13253 ) -> impl google_cloud_gax::paginator::Paginator<
13254 google_cloud_location::model::ListLocationsResponse,
13255 crate::Error,
13256 > {
13257 use std::clone::Clone;
13258 let token = self.0.request.page_token.clone();
13259 let execute = move |token: String| {
13260 let mut builder = self.clone();
13261 builder.0.request = builder.0.request.set_page_token(token);
13262 builder.send()
13263 };
13264 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13265 }
13266
13267 pub fn by_item(
13269 self,
13270 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13271 google_cloud_location::model::ListLocationsResponse,
13272 crate::Error,
13273 > {
13274 use google_cloud_gax::paginator::Paginator;
13275 self.by_page().items()
13276 }
13277
13278 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13280 self.0.request.name = v.into();
13281 self
13282 }
13283
13284 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13286 self.0.request.filter = v.into();
13287 self
13288 }
13289
13290 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13292 self.0.request.page_size = v.into();
13293 self
13294 }
13295
13296 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13298 self.0.request.page_token = v.into();
13299 self
13300 }
13301 }
13302
13303 #[doc(hidden)]
13304 impl crate::RequestBuilder for ListLocations {
13305 fn request_options(&mut self) -> &mut crate::RequestOptions {
13306 &mut self.0.options
13307 }
13308 }
13309
13310 #[derive(Clone, Debug)]
13327 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13328
13329 impl GetLocation {
13330 pub(crate) fn new(
13331 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13332 ) -> Self {
13333 Self(RequestBuilder::new(stub))
13334 }
13335
13336 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13338 mut self,
13339 v: V,
13340 ) -> Self {
13341 self.0.request = v.into();
13342 self
13343 }
13344
13345 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13347 self.0.options = v.into();
13348 self
13349 }
13350
13351 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13353 (*self.0.stub)
13354 .get_location(self.0.request, self.0.options)
13355 .await
13356 .map(crate::Response::into_body)
13357 }
13358
13359 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13361 self.0.request.name = v.into();
13362 self
13363 }
13364 }
13365
13366 #[doc(hidden)]
13367 impl crate::RequestBuilder for GetLocation {
13368 fn request_options(&mut self) -> &mut crate::RequestOptions {
13369 &mut self.0.options
13370 }
13371 }
13372
13373 #[derive(Clone, Debug)]
13390 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
13391
13392 impl SetIamPolicy {
13393 pub(crate) fn new(
13394 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13395 ) -> Self {
13396 Self(RequestBuilder::new(stub))
13397 }
13398
13399 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
13401 mut self,
13402 v: V,
13403 ) -> Self {
13404 self.0.request = v.into();
13405 self
13406 }
13407
13408 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13410 self.0.options = v.into();
13411 self
13412 }
13413
13414 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13416 (*self.0.stub)
13417 .set_iam_policy(self.0.request, self.0.options)
13418 .await
13419 .map(crate::Response::into_body)
13420 }
13421
13422 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13426 self.0.request.resource = v.into();
13427 self
13428 }
13429
13430 pub fn set_policy<T>(mut self, v: T) -> Self
13434 where
13435 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13436 {
13437 self.0.request.policy = std::option::Option::Some(v.into());
13438 self
13439 }
13440
13441 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
13445 where
13446 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13447 {
13448 self.0.request.policy = v.map(|x| x.into());
13449 self
13450 }
13451
13452 pub fn set_update_mask<T>(mut self, v: T) -> Self
13454 where
13455 T: std::convert::Into<wkt::FieldMask>,
13456 {
13457 self.0.request.update_mask = std::option::Option::Some(v.into());
13458 self
13459 }
13460
13461 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13463 where
13464 T: std::convert::Into<wkt::FieldMask>,
13465 {
13466 self.0.request.update_mask = v.map(|x| x.into());
13467 self
13468 }
13469 }
13470
13471 #[doc(hidden)]
13472 impl crate::RequestBuilder for SetIamPolicy {
13473 fn request_options(&mut self) -> &mut crate::RequestOptions {
13474 &mut self.0.options
13475 }
13476 }
13477
13478 #[derive(Clone, Debug)]
13495 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
13496
13497 impl GetIamPolicy {
13498 pub(crate) fn new(
13499 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13500 ) -> Self {
13501 Self(RequestBuilder::new(stub))
13502 }
13503
13504 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
13506 mut self,
13507 v: V,
13508 ) -> Self {
13509 self.0.request = v.into();
13510 self
13511 }
13512
13513 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13515 self.0.options = v.into();
13516 self
13517 }
13518
13519 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13521 (*self.0.stub)
13522 .get_iam_policy(self.0.request, self.0.options)
13523 .await
13524 .map(crate::Response::into_body)
13525 }
13526
13527 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13531 self.0.request.resource = v.into();
13532 self
13533 }
13534
13535 pub fn set_options<T>(mut self, v: T) -> Self
13537 where
13538 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13539 {
13540 self.0.request.options = std::option::Option::Some(v.into());
13541 self
13542 }
13543
13544 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
13546 where
13547 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13548 {
13549 self.0.request.options = v.map(|x| x.into());
13550 self
13551 }
13552 }
13553
13554 #[doc(hidden)]
13555 impl crate::RequestBuilder for GetIamPolicy {
13556 fn request_options(&mut self) -> &mut crate::RequestOptions {
13557 &mut self.0.options
13558 }
13559 }
13560
13561 #[derive(Clone, Debug)]
13578 pub struct TestIamPermissions(
13579 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
13580 );
13581
13582 impl TestIamPermissions {
13583 pub(crate) fn new(
13584 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13585 ) -> Self {
13586 Self(RequestBuilder::new(stub))
13587 }
13588
13589 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
13591 mut self,
13592 v: V,
13593 ) -> Self {
13594 self.0.request = v.into();
13595 self
13596 }
13597
13598 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13600 self.0.options = v.into();
13601 self
13602 }
13603
13604 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
13606 (*self.0.stub)
13607 .test_iam_permissions(self.0.request, self.0.options)
13608 .await
13609 .map(crate::Response::into_body)
13610 }
13611
13612 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13616 self.0.request.resource = v.into();
13617 self
13618 }
13619
13620 pub fn set_permissions<T, V>(mut self, v: T) -> Self
13624 where
13625 T: std::iter::IntoIterator<Item = V>,
13626 V: std::convert::Into<std::string::String>,
13627 {
13628 use std::iter::Iterator;
13629 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
13630 self
13631 }
13632 }
13633
13634 #[doc(hidden)]
13635 impl crate::RequestBuilder for TestIamPermissions {
13636 fn request_options(&mut self) -> &mut crate::RequestOptions {
13637 &mut self.0.options
13638 }
13639 }
13640
13641 #[derive(Clone, Debug)]
13662 pub struct ListOperations(
13663 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13664 );
13665
13666 impl ListOperations {
13667 pub(crate) fn new(
13668 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13669 ) -> Self {
13670 Self(RequestBuilder::new(stub))
13671 }
13672
13673 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13675 mut self,
13676 v: V,
13677 ) -> Self {
13678 self.0.request = v.into();
13679 self
13680 }
13681
13682 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13684 self.0.options = v.into();
13685 self
13686 }
13687
13688 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13690 (*self.0.stub)
13691 .list_operations(self.0.request, self.0.options)
13692 .await
13693 .map(crate::Response::into_body)
13694 }
13695
13696 pub fn by_page(
13698 self,
13699 ) -> impl google_cloud_gax::paginator::Paginator<
13700 google_cloud_longrunning::model::ListOperationsResponse,
13701 crate::Error,
13702 > {
13703 use std::clone::Clone;
13704 let token = self.0.request.page_token.clone();
13705 let execute = move |token: String| {
13706 let mut builder = self.clone();
13707 builder.0.request = builder.0.request.set_page_token(token);
13708 builder.send()
13709 };
13710 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13711 }
13712
13713 pub fn by_item(
13715 self,
13716 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13717 google_cloud_longrunning::model::ListOperationsResponse,
13718 crate::Error,
13719 > {
13720 use google_cloud_gax::paginator::Paginator;
13721 self.by_page().items()
13722 }
13723
13724 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13726 self.0.request.name = v.into();
13727 self
13728 }
13729
13730 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13732 self.0.request.filter = v.into();
13733 self
13734 }
13735
13736 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13738 self.0.request.page_size = v.into();
13739 self
13740 }
13741
13742 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13744 self.0.request.page_token = v.into();
13745 self
13746 }
13747
13748 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13750 self.0.request.return_partial_success = v.into();
13751 self
13752 }
13753 }
13754
13755 #[doc(hidden)]
13756 impl crate::RequestBuilder for ListOperations {
13757 fn request_options(&mut self) -> &mut crate::RequestOptions {
13758 &mut self.0.options
13759 }
13760 }
13761
13762 #[derive(Clone, Debug)]
13779 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13780
13781 impl GetOperation {
13782 pub(crate) fn new(
13783 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13784 ) -> Self {
13785 Self(RequestBuilder::new(stub))
13786 }
13787
13788 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13790 mut self,
13791 v: V,
13792 ) -> Self {
13793 self.0.request = v.into();
13794 self
13795 }
13796
13797 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13799 self.0.options = v.into();
13800 self
13801 }
13802
13803 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13805 (*self.0.stub)
13806 .get_operation(self.0.request, self.0.options)
13807 .await
13808 .map(crate::Response::into_body)
13809 }
13810
13811 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13813 self.0.request.name = v.into();
13814 self
13815 }
13816 }
13817
13818 #[doc(hidden)]
13819 impl crate::RequestBuilder for GetOperation {
13820 fn request_options(&mut self) -> &mut crate::RequestOptions {
13821 &mut self.0.options
13822 }
13823 }
13824
13825 #[derive(Clone, Debug)]
13842 pub struct DeleteOperation(
13843 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
13844 );
13845
13846 impl DeleteOperation {
13847 pub(crate) fn new(
13848 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13849 ) -> Self {
13850 Self(RequestBuilder::new(stub))
13851 }
13852
13853 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
13855 mut self,
13856 v: V,
13857 ) -> Self {
13858 self.0.request = v.into();
13859 self
13860 }
13861
13862 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13864 self.0.options = v.into();
13865 self
13866 }
13867
13868 pub async fn send(self) -> Result<()> {
13870 (*self.0.stub)
13871 .delete_operation(self.0.request, self.0.options)
13872 .await
13873 .map(crate::Response::into_body)
13874 }
13875
13876 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13878 self.0.request.name = v.into();
13879 self
13880 }
13881 }
13882
13883 #[doc(hidden)]
13884 impl crate::RequestBuilder for DeleteOperation {
13885 fn request_options(&mut self) -> &mut crate::RequestOptions {
13886 &mut self.0.options
13887 }
13888 }
13889
13890 #[derive(Clone, Debug)]
13907 pub struct CancelOperation(
13908 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13909 );
13910
13911 impl CancelOperation {
13912 pub(crate) fn new(
13913 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13914 ) -> Self {
13915 Self(RequestBuilder::new(stub))
13916 }
13917
13918 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13920 mut self,
13921 v: V,
13922 ) -> Self {
13923 self.0.request = v.into();
13924 self
13925 }
13926
13927 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13929 self.0.options = v.into();
13930 self
13931 }
13932
13933 pub async fn send(self) -> Result<()> {
13935 (*self.0.stub)
13936 .cancel_operation(self.0.request, self.0.options)
13937 .await
13938 .map(crate::Response::into_body)
13939 }
13940
13941 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13943 self.0.request.name = v.into();
13944 self
13945 }
13946 }
13947
13948 #[doc(hidden)]
13949 impl crate::RequestBuilder for CancelOperation {
13950 fn request_options(&mut self) -> &mut crate::RequestOptions {
13951 &mut self.0.options
13952 }
13953 }
13954}
13955
13956pub mod data_scan_service {
13957 use crate::Result;
13958
13959 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13973
13974 pub(crate) mod client {
13975 use super::super::super::client::DataScanService;
13976 pub struct Factory;
13977 impl crate::ClientFactory for Factory {
13978 type Client = DataScanService;
13979 type Credentials = gaxi::options::Credentials;
13980 async fn build(
13981 self,
13982 config: gaxi::options::ClientConfig,
13983 ) -> crate::ClientBuilderResult<Self::Client> {
13984 Self::Client::new(config).await
13985 }
13986 }
13987 }
13988
13989 #[derive(Clone, Debug)]
13991 pub(crate) struct RequestBuilder<R: std::default::Default> {
13992 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
13993 request: R,
13994 options: crate::RequestOptions,
13995 }
13996
13997 impl<R> RequestBuilder<R>
13998 where
13999 R: std::default::Default,
14000 {
14001 pub(crate) fn new(
14002 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14003 ) -> Self {
14004 Self {
14005 stub,
14006 request: R::default(),
14007 options: crate::RequestOptions::default(),
14008 }
14009 }
14010 }
14011
14012 #[derive(Clone, Debug)]
14030 pub struct CreateDataScan(RequestBuilder<crate::model::CreateDataScanRequest>);
14031
14032 impl CreateDataScan {
14033 pub(crate) fn new(
14034 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14035 ) -> Self {
14036 Self(RequestBuilder::new(stub))
14037 }
14038
14039 pub fn with_request<V: Into<crate::model::CreateDataScanRequest>>(mut self, v: V) -> Self {
14041 self.0.request = v.into();
14042 self
14043 }
14044
14045 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14047 self.0.options = v.into();
14048 self
14049 }
14050
14051 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14058 (*self.0.stub)
14059 .create_data_scan(self.0.request, self.0.options)
14060 .await
14061 .map(crate::Response::into_body)
14062 }
14063
14064 pub fn poller(
14066 self,
14067 ) -> impl google_cloud_lro::Poller<crate::model::DataScan, crate::model::OperationMetadata>
14068 {
14069 type Operation = google_cloud_lro::internal::Operation<
14070 crate::model::DataScan,
14071 crate::model::OperationMetadata,
14072 >;
14073 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14074 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14075
14076 let stub = self.0.stub.clone();
14077 let mut options = self.0.options.clone();
14078 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14079 let query = move |name| {
14080 let stub = stub.clone();
14081 let options = options.clone();
14082 async {
14083 let op = GetOperation::new(stub)
14084 .set_name(name)
14085 .with_options(options)
14086 .send()
14087 .await?;
14088 Ok(Operation::new(op))
14089 }
14090 };
14091
14092 let start = move || async {
14093 let op = self.send().await?;
14094 Ok(Operation::new(op))
14095 };
14096
14097 google_cloud_lro::internal::new_poller(
14098 polling_error_policy,
14099 polling_backoff_policy,
14100 start,
14101 query,
14102 )
14103 }
14104
14105 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14109 self.0.request.parent = v.into();
14110 self
14111 }
14112
14113 pub fn set_data_scan<T>(mut self, v: T) -> Self
14117 where
14118 T: std::convert::Into<crate::model::DataScan>,
14119 {
14120 self.0.request.data_scan = std::option::Option::Some(v.into());
14121 self
14122 }
14123
14124 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
14128 where
14129 T: std::convert::Into<crate::model::DataScan>,
14130 {
14131 self.0.request.data_scan = v.map(|x| x.into());
14132 self
14133 }
14134
14135 pub fn set_data_scan_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14139 self.0.request.data_scan_id = v.into();
14140 self
14141 }
14142
14143 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14145 self.0.request.validate_only = v.into();
14146 self
14147 }
14148 }
14149
14150 #[doc(hidden)]
14151 impl crate::RequestBuilder for CreateDataScan {
14152 fn request_options(&mut self) -> &mut crate::RequestOptions {
14153 &mut self.0.options
14154 }
14155 }
14156
14157 #[derive(Clone, Debug)]
14175 pub struct UpdateDataScan(RequestBuilder<crate::model::UpdateDataScanRequest>);
14176
14177 impl UpdateDataScan {
14178 pub(crate) fn new(
14179 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14180 ) -> Self {
14181 Self(RequestBuilder::new(stub))
14182 }
14183
14184 pub fn with_request<V: Into<crate::model::UpdateDataScanRequest>>(mut self, v: V) -> Self {
14186 self.0.request = v.into();
14187 self
14188 }
14189
14190 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14192 self.0.options = v.into();
14193 self
14194 }
14195
14196 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14203 (*self.0.stub)
14204 .update_data_scan(self.0.request, self.0.options)
14205 .await
14206 .map(crate::Response::into_body)
14207 }
14208
14209 pub fn poller(
14211 self,
14212 ) -> impl google_cloud_lro::Poller<crate::model::DataScan, crate::model::OperationMetadata>
14213 {
14214 type Operation = google_cloud_lro::internal::Operation<
14215 crate::model::DataScan,
14216 crate::model::OperationMetadata,
14217 >;
14218 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14219 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14220
14221 let stub = self.0.stub.clone();
14222 let mut options = self.0.options.clone();
14223 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14224 let query = move |name| {
14225 let stub = stub.clone();
14226 let options = options.clone();
14227 async {
14228 let op = GetOperation::new(stub)
14229 .set_name(name)
14230 .with_options(options)
14231 .send()
14232 .await?;
14233 Ok(Operation::new(op))
14234 }
14235 };
14236
14237 let start = move || async {
14238 let op = self.send().await?;
14239 Ok(Operation::new(op))
14240 };
14241
14242 google_cloud_lro::internal::new_poller(
14243 polling_error_policy,
14244 polling_backoff_policy,
14245 start,
14246 query,
14247 )
14248 }
14249
14250 pub fn set_data_scan<T>(mut self, v: T) -> Self
14254 where
14255 T: std::convert::Into<crate::model::DataScan>,
14256 {
14257 self.0.request.data_scan = std::option::Option::Some(v.into());
14258 self
14259 }
14260
14261 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
14265 where
14266 T: std::convert::Into<crate::model::DataScan>,
14267 {
14268 self.0.request.data_scan = v.map(|x| x.into());
14269 self
14270 }
14271
14272 pub fn set_update_mask<T>(mut self, v: T) -> Self
14274 where
14275 T: std::convert::Into<wkt::FieldMask>,
14276 {
14277 self.0.request.update_mask = std::option::Option::Some(v.into());
14278 self
14279 }
14280
14281 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14283 where
14284 T: std::convert::Into<wkt::FieldMask>,
14285 {
14286 self.0.request.update_mask = v.map(|x| x.into());
14287 self
14288 }
14289
14290 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14292 self.0.request.validate_only = v.into();
14293 self
14294 }
14295 }
14296
14297 #[doc(hidden)]
14298 impl crate::RequestBuilder for UpdateDataScan {
14299 fn request_options(&mut self) -> &mut crate::RequestOptions {
14300 &mut self.0.options
14301 }
14302 }
14303
14304 #[derive(Clone, Debug)]
14322 pub struct DeleteDataScan(RequestBuilder<crate::model::DeleteDataScanRequest>);
14323
14324 impl DeleteDataScan {
14325 pub(crate) fn new(
14326 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14327 ) -> Self {
14328 Self(RequestBuilder::new(stub))
14329 }
14330
14331 pub fn with_request<V: Into<crate::model::DeleteDataScanRequest>>(mut self, v: V) -> Self {
14333 self.0.request = v.into();
14334 self
14335 }
14336
14337 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14339 self.0.options = v.into();
14340 self
14341 }
14342
14343 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14350 (*self.0.stub)
14351 .delete_data_scan(self.0.request, self.0.options)
14352 .await
14353 .map(crate::Response::into_body)
14354 }
14355
14356 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14358 type Operation =
14359 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14360 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14361 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14362
14363 let stub = self.0.stub.clone();
14364 let mut options = self.0.options.clone();
14365 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14366 let query = move |name| {
14367 let stub = stub.clone();
14368 let options = options.clone();
14369 async {
14370 let op = GetOperation::new(stub)
14371 .set_name(name)
14372 .with_options(options)
14373 .send()
14374 .await?;
14375 Ok(Operation::new(op))
14376 }
14377 };
14378
14379 let start = move || async {
14380 let op = self.send().await?;
14381 Ok(Operation::new(op))
14382 };
14383
14384 google_cloud_lro::internal::new_unit_response_poller(
14385 polling_error_policy,
14386 polling_backoff_policy,
14387 start,
14388 query,
14389 )
14390 }
14391
14392 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14396 self.0.request.name = v.into();
14397 self
14398 }
14399
14400 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
14402 self.0.request.force = v.into();
14403 self
14404 }
14405 }
14406
14407 #[doc(hidden)]
14408 impl crate::RequestBuilder for DeleteDataScan {
14409 fn request_options(&mut self) -> &mut crate::RequestOptions {
14410 &mut self.0.options
14411 }
14412 }
14413
14414 #[derive(Clone, Debug)]
14431 pub struct GetDataScan(RequestBuilder<crate::model::GetDataScanRequest>);
14432
14433 impl GetDataScan {
14434 pub(crate) fn new(
14435 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14436 ) -> Self {
14437 Self(RequestBuilder::new(stub))
14438 }
14439
14440 pub fn with_request<V: Into<crate::model::GetDataScanRequest>>(mut self, v: V) -> Self {
14442 self.0.request = v.into();
14443 self
14444 }
14445
14446 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14448 self.0.options = v.into();
14449 self
14450 }
14451
14452 pub async fn send(self) -> Result<crate::model::DataScan> {
14454 (*self.0.stub)
14455 .get_data_scan(self.0.request, self.0.options)
14456 .await
14457 .map(crate::Response::into_body)
14458 }
14459
14460 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14464 self.0.request.name = v.into();
14465 self
14466 }
14467
14468 pub fn set_view<T: Into<crate::model::get_data_scan_request::DataScanView>>(
14470 mut self,
14471 v: T,
14472 ) -> Self {
14473 self.0.request.view = v.into();
14474 self
14475 }
14476 }
14477
14478 #[doc(hidden)]
14479 impl crate::RequestBuilder for GetDataScan {
14480 fn request_options(&mut self) -> &mut crate::RequestOptions {
14481 &mut self.0.options
14482 }
14483 }
14484
14485 #[derive(Clone, Debug)]
14506 pub struct ListDataScans(RequestBuilder<crate::model::ListDataScansRequest>);
14507
14508 impl ListDataScans {
14509 pub(crate) fn new(
14510 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14511 ) -> Self {
14512 Self(RequestBuilder::new(stub))
14513 }
14514
14515 pub fn with_request<V: Into<crate::model::ListDataScansRequest>>(mut self, v: V) -> Self {
14517 self.0.request = v.into();
14518 self
14519 }
14520
14521 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14523 self.0.options = v.into();
14524 self
14525 }
14526
14527 pub async fn send(self) -> Result<crate::model::ListDataScansResponse> {
14529 (*self.0.stub)
14530 .list_data_scans(self.0.request, self.0.options)
14531 .await
14532 .map(crate::Response::into_body)
14533 }
14534
14535 pub fn by_page(
14537 self,
14538 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListDataScansResponse, crate::Error>
14539 {
14540 use std::clone::Clone;
14541 let token = self.0.request.page_token.clone();
14542 let execute = move |token: String| {
14543 let mut builder = self.clone();
14544 builder.0.request = builder.0.request.set_page_token(token);
14545 builder.send()
14546 };
14547 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14548 }
14549
14550 pub fn by_item(
14552 self,
14553 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14554 crate::model::ListDataScansResponse,
14555 crate::Error,
14556 > {
14557 use google_cloud_gax::paginator::Paginator;
14558 self.by_page().items()
14559 }
14560
14561 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14565 self.0.request.parent = v.into();
14566 self
14567 }
14568
14569 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14571 self.0.request.page_size = v.into();
14572 self
14573 }
14574
14575 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14577 self.0.request.page_token = v.into();
14578 self
14579 }
14580
14581 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14583 self.0.request.filter = v.into();
14584 self
14585 }
14586
14587 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
14589 self.0.request.order_by = v.into();
14590 self
14591 }
14592 }
14593
14594 #[doc(hidden)]
14595 impl crate::RequestBuilder for ListDataScans {
14596 fn request_options(&mut self) -> &mut crate::RequestOptions {
14597 &mut self.0.options
14598 }
14599 }
14600
14601 #[derive(Clone, Debug)]
14618 pub struct RunDataScan(RequestBuilder<crate::model::RunDataScanRequest>);
14619
14620 impl RunDataScan {
14621 pub(crate) fn new(
14622 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14623 ) -> Self {
14624 Self(RequestBuilder::new(stub))
14625 }
14626
14627 pub fn with_request<V: Into<crate::model::RunDataScanRequest>>(mut self, v: V) -> Self {
14629 self.0.request = v.into();
14630 self
14631 }
14632
14633 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14635 self.0.options = v.into();
14636 self
14637 }
14638
14639 pub async fn send(self) -> Result<crate::model::RunDataScanResponse> {
14641 (*self.0.stub)
14642 .run_data_scan(self.0.request, self.0.options)
14643 .await
14644 .map(crate::Response::into_body)
14645 }
14646
14647 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14651 self.0.request.name = v.into();
14652 self
14653 }
14654 }
14655
14656 #[doc(hidden)]
14657 impl crate::RequestBuilder for RunDataScan {
14658 fn request_options(&mut self) -> &mut crate::RequestOptions {
14659 &mut self.0.options
14660 }
14661 }
14662
14663 #[derive(Clone, Debug)]
14680 pub struct GetDataScanJob(RequestBuilder<crate::model::GetDataScanJobRequest>);
14681
14682 impl GetDataScanJob {
14683 pub(crate) fn new(
14684 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14685 ) -> Self {
14686 Self(RequestBuilder::new(stub))
14687 }
14688
14689 pub fn with_request<V: Into<crate::model::GetDataScanJobRequest>>(mut self, v: V) -> Self {
14691 self.0.request = v.into();
14692 self
14693 }
14694
14695 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14697 self.0.options = v.into();
14698 self
14699 }
14700
14701 pub async fn send(self) -> Result<crate::model::DataScanJob> {
14703 (*self.0.stub)
14704 .get_data_scan_job(self.0.request, self.0.options)
14705 .await
14706 .map(crate::Response::into_body)
14707 }
14708
14709 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14713 self.0.request.name = v.into();
14714 self
14715 }
14716
14717 pub fn set_view<T: Into<crate::model::get_data_scan_job_request::DataScanJobView>>(
14719 mut self,
14720 v: T,
14721 ) -> Self {
14722 self.0.request.view = v.into();
14723 self
14724 }
14725 }
14726
14727 #[doc(hidden)]
14728 impl crate::RequestBuilder for GetDataScanJob {
14729 fn request_options(&mut self) -> &mut crate::RequestOptions {
14730 &mut self.0.options
14731 }
14732 }
14733
14734 #[derive(Clone, Debug)]
14755 pub struct ListDataScanJobs(RequestBuilder<crate::model::ListDataScanJobsRequest>);
14756
14757 impl ListDataScanJobs {
14758 pub(crate) fn new(
14759 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14760 ) -> Self {
14761 Self(RequestBuilder::new(stub))
14762 }
14763
14764 pub fn with_request<V: Into<crate::model::ListDataScanJobsRequest>>(
14766 mut self,
14767 v: V,
14768 ) -> Self {
14769 self.0.request = v.into();
14770 self
14771 }
14772
14773 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14775 self.0.options = v.into();
14776 self
14777 }
14778
14779 pub async fn send(self) -> Result<crate::model::ListDataScanJobsResponse> {
14781 (*self.0.stub)
14782 .list_data_scan_jobs(self.0.request, self.0.options)
14783 .await
14784 .map(crate::Response::into_body)
14785 }
14786
14787 pub fn by_page(
14789 self,
14790 ) -> impl google_cloud_gax::paginator::Paginator<
14791 crate::model::ListDataScanJobsResponse,
14792 crate::Error,
14793 > {
14794 use std::clone::Clone;
14795 let token = self.0.request.page_token.clone();
14796 let execute = move |token: String| {
14797 let mut builder = self.clone();
14798 builder.0.request = builder.0.request.set_page_token(token);
14799 builder.send()
14800 };
14801 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14802 }
14803
14804 pub fn by_item(
14806 self,
14807 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14808 crate::model::ListDataScanJobsResponse,
14809 crate::Error,
14810 > {
14811 use google_cloud_gax::paginator::Paginator;
14812 self.by_page().items()
14813 }
14814
14815 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14819 self.0.request.parent = v.into();
14820 self
14821 }
14822
14823 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14825 self.0.request.page_size = v.into();
14826 self
14827 }
14828
14829 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14831 self.0.request.page_token = v.into();
14832 self
14833 }
14834
14835 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14837 self.0.request.filter = v.into();
14838 self
14839 }
14840 }
14841
14842 #[doc(hidden)]
14843 impl crate::RequestBuilder for ListDataScanJobs {
14844 fn request_options(&mut self) -> &mut crate::RequestOptions {
14845 &mut self.0.options
14846 }
14847 }
14848
14849 #[derive(Clone, Debug)]
14866 pub struct GenerateDataQualityRules(
14867 RequestBuilder<crate::model::GenerateDataQualityRulesRequest>,
14868 );
14869
14870 impl GenerateDataQualityRules {
14871 pub(crate) fn new(
14872 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14873 ) -> Self {
14874 Self(RequestBuilder::new(stub))
14875 }
14876
14877 pub fn with_request<V: Into<crate::model::GenerateDataQualityRulesRequest>>(
14879 mut self,
14880 v: V,
14881 ) -> Self {
14882 self.0.request = v.into();
14883 self
14884 }
14885
14886 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14888 self.0.options = v.into();
14889 self
14890 }
14891
14892 pub async fn send(self) -> Result<crate::model::GenerateDataQualityRulesResponse> {
14894 (*self.0.stub)
14895 .generate_data_quality_rules(self.0.request, self.0.options)
14896 .await
14897 .map(crate::Response::into_body)
14898 }
14899
14900 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14904 self.0.request.name = v.into();
14905 self
14906 }
14907 }
14908
14909 #[doc(hidden)]
14910 impl crate::RequestBuilder for GenerateDataQualityRules {
14911 fn request_options(&mut self) -> &mut crate::RequestOptions {
14912 &mut self.0.options
14913 }
14914 }
14915
14916 #[derive(Clone, Debug)]
14937 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
14938
14939 impl ListLocations {
14940 pub(crate) fn new(
14941 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14942 ) -> Self {
14943 Self(RequestBuilder::new(stub))
14944 }
14945
14946 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
14948 mut self,
14949 v: V,
14950 ) -> Self {
14951 self.0.request = v.into();
14952 self
14953 }
14954
14955 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14957 self.0.options = v.into();
14958 self
14959 }
14960
14961 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
14963 (*self.0.stub)
14964 .list_locations(self.0.request, self.0.options)
14965 .await
14966 .map(crate::Response::into_body)
14967 }
14968
14969 pub fn by_page(
14971 self,
14972 ) -> impl google_cloud_gax::paginator::Paginator<
14973 google_cloud_location::model::ListLocationsResponse,
14974 crate::Error,
14975 > {
14976 use std::clone::Clone;
14977 let token = self.0.request.page_token.clone();
14978 let execute = move |token: String| {
14979 let mut builder = self.clone();
14980 builder.0.request = builder.0.request.set_page_token(token);
14981 builder.send()
14982 };
14983 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14984 }
14985
14986 pub fn by_item(
14988 self,
14989 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14990 google_cloud_location::model::ListLocationsResponse,
14991 crate::Error,
14992 > {
14993 use google_cloud_gax::paginator::Paginator;
14994 self.by_page().items()
14995 }
14996
14997 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14999 self.0.request.name = v.into();
15000 self
15001 }
15002
15003 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15005 self.0.request.filter = v.into();
15006 self
15007 }
15008
15009 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15011 self.0.request.page_size = v.into();
15012 self
15013 }
15014
15015 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15017 self.0.request.page_token = v.into();
15018 self
15019 }
15020 }
15021
15022 #[doc(hidden)]
15023 impl crate::RequestBuilder for ListLocations {
15024 fn request_options(&mut self) -> &mut crate::RequestOptions {
15025 &mut self.0.options
15026 }
15027 }
15028
15029 #[derive(Clone, Debug)]
15046 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
15047
15048 impl GetLocation {
15049 pub(crate) fn new(
15050 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15051 ) -> Self {
15052 Self(RequestBuilder::new(stub))
15053 }
15054
15055 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
15057 mut self,
15058 v: V,
15059 ) -> Self {
15060 self.0.request = v.into();
15061 self
15062 }
15063
15064 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15066 self.0.options = v.into();
15067 self
15068 }
15069
15070 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
15072 (*self.0.stub)
15073 .get_location(self.0.request, self.0.options)
15074 .await
15075 .map(crate::Response::into_body)
15076 }
15077
15078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15080 self.0.request.name = v.into();
15081 self
15082 }
15083 }
15084
15085 #[doc(hidden)]
15086 impl crate::RequestBuilder for GetLocation {
15087 fn request_options(&mut self) -> &mut crate::RequestOptions {
15088 &mut self.0.options
15089 }
15090 }
15091
15092 #[derive(Clone, Debug)]
15109 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
15110
15111 impl SetIamPolicy {
15112 pub(crate) fn new(
15113 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15114 ) -> Self {
15115 Self(RequestBuilder::new(stub))
15116 }
15117
15118 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
15120 mut self,
15121 v: V,
15122 ) -> Self {
15123 self.0.request = v.into();
15124 self
15125 }
15126
15127 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15129 self.0.options = v.into();
15130 self
15131 }
15132
15133 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
15135 (*self.0.stub)
15136 .set_iam_policy(self.0.request, self.0.options)
15137 .await
15138 .map(crate::Response::into_body)
15139 }
15140
15141 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
15145 self.0.request.resource = v.into();
15146 self
15147 }
15148
15149 pub fn set_policy<T>(mut self, v: T) -> Self
15153 where
15154 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
15155 {
15156 self.0.request.policy = std::option::Option::Some(v.into());
15157 self
15158 }
15159
15160 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
15164 where
15165 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
15166 {
15167 self.0.request.policy = v.map(|x| x.into());
15168 self
15169 }
15170
15171 pub fn set_update_mask<T>(mut self, v: T) -> Self
15173 where
15174 T: std::convert::Into<wkt::FieldMask>,
15175 {
15176 self.0.request.update_mask = std::option::Option::Some(v.into());
15177 self
15178 }
15179
15180 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15182 where
15183 T: std::convert::Into<wkt::FieldMask>,
15184 {
15185 self.0.request.update_mask = v.map(|x| x.into());
15186 self
15187 }
15188 }
15189
15190 #[doc(hidden)]
15191 impl crate::RequestBuilder for SetIamPolicy {
15192 fn request_options(&mut self) -> &mut crate::RequestOptions {
15193 &mut self.0.options
15194 }
15195 }
15196
15197 #[derive(Clone, Debug)]
15214 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
15215
15216 impl GetIamPolicy {
15217 pub(crate) fn new(
15218 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15219 ) -> Self {
15220 Self(RequestBuilder::new(stub))
15221 }
15222
15223 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
15225 mut self,
15226 v: V,
15227 ) -> Self {
15228 self.0.request = v.into();
15229 self
15230 }
15231
15232 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15234 self.0.options = v.into();
15235 self
15236 }
15237
15238 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
15240 (*self.0.stub)
15241 .get_iam_policy(self.0.request, self.0.options)
15242 .await
15243 .map(crate::Response::into_body)
15244 }
15245
15246 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
15250 self.0.request.resource = v.into();
15251 self
15252 }
15253
15254 pub fn set_options<T>(mut self, v: T) -> Self
15256 where
15257 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
15258 {
15259 self.0.request.options = std::option::Option::Some(v.into());
15260 self
15261 }
15262
15263 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
15265 where
15266 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
15267 {
15268 self.0.request.options = v.map(|x| x.into());
15269 self
15270 }
15271 }
15272
15273 #[doc(hidden)]
15274 impl crate::RequestBuilder for GetIamPolicy {
15275 fn request_options(&mut self) -> &mut crate::RequestOptions {
15276 &mut self.0.options
15277 }
15278 }
15279
15280 #[derive(Clone, Debug)]
15297 pub struct TestIamPermissions(
15298 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
15299 );
15300
15301 impl TestIamPermissions {
15302 pub(crate) fn new(
15303 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15304 ) -> Self {
15305 Self(RequestBuilder::new(stub))
15306 }
15307
15308 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
15310 mut self,
15311 v: V,
15312 ) -> Self {
15313 self.0.request = v.into();
15314 self
15315 }
15316
15317 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15319 self.0.options = v.into();
15320 self
15321 }
15322
15323 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
15325 (*self.0.stub)
15326 .test_iam_permissions(self.0.request, self.0.options)
15327 .await
15328 .map(crate::Response::into_body)
15329 }
15330
15331 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
15335 self.0.request.resource = v.into();
15336 self
15337 }
15338
15339 pub fn set_permissions<T, V>(mut self, v: T) -> Self
15343 where
15344 T: std::iter::IntoIterator<Item = V>,
15345 V: std::convert::Into<std::string::String>,
15346 {
15347 use std::iter::Iterator;
15348 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
15349 self
15350 }
15351 }
15352
15353 #[doc(hidden)]
15354 impl crate::RequestBuilder for TestIamPermissions {
15355 fn request_options(&mut self) -> &mut crate::RequestOptions {
15356 &mut self.0.options
15357 }
15358 }
15359
15360 #[derive(Clone, Debug)]
15381 pub struct ListOperations(
15382 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
15383 );
15384
15385 impl ListOperations {
15386 pub(crate) fn new(
15387 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15388 ) -> Self {
15389 Self(RequestBuilder::new(stub))
15390 }
15391
15392 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
15394 mut self,
15395 v: V,
15396 ) -> Self {
15397 self.0.request = v.into();
15398 self
15399 }
15400
15401 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15403 self.0.options = v.into();
15404 self
15405 }
15406
15407 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
15409 (*self.0.stub)
15410 .list_operations(self.0.request, self.0.options)
15411 .await
15412 .map(crate::Response::into_body)
15413 }
15414
15415 pub fn by_page(
15417 self,
15418 ) -> impl google_cloud_gax::paginator::Paginator<
15419 google_cloud_longrunning::model::ListOperationsResponse,
15420 crate::Error,
15421 > {
15422 use std::clone::Clone;
15423 let token = self.0.request.page_token.clone();
15424 let execute = move |token: String| {
15425 let mut builder = self.clone();
15426 builder.0.request = builder.0.request.set_page_token(token);
15427 builder.send()
15428 };
15429 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15430 }
15431
15432 pub fn by_item(
15434 self,
15435 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15436 google_cloud_longrunning::model::ListOperationsResponse,
15437 crate::Error,
15438 > {
15439 use google_cloud_gax::paginator::Paginator;
15440 self.by_page().items()
15441 }
15442
15443 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15445 self.0.request.name = v.into();
15446 self
15447 }
15448
15449 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15451 self.0.request.filter = v.into();
15452 self
15453 }
15454
15455 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15457 self.0.request.page_size = v.into();
15458 self
15459 }
15460
15461 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15463 self.0.request.page_token = v.into();
15464 self
15465 }
15466
15467 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15469 self.0.request.return_partial_success = v.into();
15470 self
15471 }
15472 }
15473
15474 #[doc(hidden)]
15475 impl crate::RequestBuilder for ListOperations {
15476 fn request_options(&mut self) -> &mut crate::RequestOptions {
15477 &mut self.0.options
15478 }
15479 }
15480
15481 #[derive(Clone, Debug)]
15498 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
15499
15500 impl GetOperation {
15501 pub(crate) fn new(
15502 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15503 ) -> Self {
15504 Self(RequestBuilder::new(stub))
15505 }
15506
15507 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
15509 mut self,
15510 v: V,
15511 ) -> Self {
15512 self.0.request = v.into();
15513 self
15514 }
15515
15516 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15518 self.0.options = v.into();
15519 self
15520 }
15521
15522 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15524 (*self.0.stub)
15525 .get_operation(self.0.request, self.0.options)
15526 .await
15527 .map(crate::Response::into_body)
15528 }
15529
15530 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15532 self.0.request.name = v.into();
15533 self
15534 }
15535 }
15536
15537 #[doc(hidden)]
15538 impl crate::RequestBuilder for GetOperation {
15539 fn request_options(&mut self) -> &mut crate::RequestOptions {
15540 &mut self.0.options
15541 }
15542 }
15543
15544 #[derive(Clone, Debug)]
15561 pub struct DeleteOperation(
15562 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
15563 );
15564
15565 impl DeleteOperation {
15566 pub(crate) fn new(
15567 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15568 ) -> Self {
15569 Self(RequestBuilder::new(stub))
15570 }
15571
15572 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
15574 mut self,
15575 v: V,
15576 ) -> Self {
15577 self.0.request = v.into();
15578 self
15579 }
15580
15581 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15583 self.0.options = v.into();
15584 self
15585 }
15586
15587 pub async fn send(self) -> Result<()> {
15589 (*self.0.stub)
15590 .delete_operation(self.0.request, self.0.options)
15591 .await
15592 .map(crate::Response::into_body)
15593 }
15594
15595 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15597 self.0.request.name = v.into();
15598 self
15599 }
15600 }
15601
15602 #[doc(hidden)]
15603 impl crate::RequestBuilder for DeleteOperation {
15604 fn request_options(&mut self) -> &mut crate::RequestOptions {
15605 &mut self.0.options
15606 }
15607 }
15608
15609 #[derive(Clone, Debug)]
15626 pub struct CancelOperation(
15627 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
15628 );
15629
15630 impl CancelOperation {
15631 pub(crate) fn new(
15632 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15633 ) -> Self {
15634 Self(RequestBuilder::new(stub))
15635 }
15636
15637 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
15639 mut self,
15640 v: V,
15641 ) -> Self {
15642 self.0.request = v.into();
15643 self
15644 }
15645
15646 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15648 self.0.options = v.into();
15649 self
15650 }
15651
15652 pub async fn send(self) -> Result<()> {
15654 (*self.0.stub)
15655 .cancel_operation(self.0.request, self.0.options)
15656 .await
15657 .map(crate::Response::into_body)
15658 }
15659
15660 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15662 self.0.request.name = v.into();
15663 self
15664 }
15665 }
15666
15667 #[doc(hidden)]
15668 impl crate::RequestBuilder for CancelOperation {
15669 fn request_options(&mut self) -> &mut crate::RequestOptions {
15670 &mut self.0.options
15671 }
15672 }
15673}
15674
15675pub mod metadata_service {
15676 use crate::Result;
15677
15678 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15692
15693 pub(crate) mod client {
15694 use super::super::super::client::MetadataService;
15695 pub struct Factory;
15696 impl crate::ClientFactory for Factory {
15697 type Client = MetadataService;
15698 type Credentials = gaxi::options::Credentials;
15699 async fn build(
15700 self,
15701 config: gaxi::options::ClientConfig,
15702 ) -> crate::ClientBuilderResult<Self::Client> {
15703 Self::Client::new(config).await
15704 }
15705 }
15706 }
15707
15708 #[derive(Clone, Debug)]
15710 pub(crate) struct RequestBuilder<R: std::default::Default> {
15711 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
15712 request: R,
15713 options: crate::RequestOptions,
15714 }
15715
15716 impl<R> RequestBuilder<R>
15717 where
15718 R: std::default::Default,
15719 {
15720 pub(crate) fn new(
15721 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
15722 ) -> Self {
15723 Self {
15724 stub,
15725 request: R::default(),
15726 options: crate::RequestOptions::default(),
15727 }
15728 }
15729 }
15730
15731 #[derive(Clone, Debug)]
15748 pub struct CreateEntity(RequestBuilder<crate::model::CreateEntityRequest>);
15749
15750 impl CreateEntity {
15751 pub(crate) fn new(
15752 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
15753 ) -> Self {
15754 Self(RequestBuilder::new(stub))
15755 }
15756
15757 pub fn with_request<V: Into<crate::model::CreateEntityRequest>>(mut self, v: V) -> Self {
15759 self.0.request = v.into();
15760 self
15761 }
15762
15763 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15765 self.0.options = v.into();
15766 self
15767 }
15768
15769 pub async fn send(self) -> Result<crate::model::Entity> {
15771 (*self.0.stub)
15772 .create_entity(self.0.request, self.0.options)
15773 .await
15774 .map(crate::Response::into_body)
15775 }
15776
15777 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15781 self.0.request.parent = v.into();
15782 self
15783 }
15784
15785 pub fn set_entity<T>(mut self, v: T) -> Self
15789 where
15790 T: std::convert::Into<crate::model::Entity>,
15791 {
15792 self.0.request.entity = std::option::Option::Some(v.into());
15793 self
15794 }
15795
15796 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
15800 where
15801 T: std::convert::Into<crate::model::Entity>,
15802 {
15803 self.0.request.entity = v.map(|x| x.into());
15804 self
15805 }
15806
15807 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15809 self.0.request.validate_only = v.into();
15810 self
15811 }
15812 }
15813
15814 #[doc(hidden)]
15815 impl crate::RequestBuilder for CreateEntity {
15816 fn request_options(&mut self) -> &mut crate::RequestOptions {
15817 &mut self.0.options
15818 }
15819 }
15820
15821 #[derive(Clone, Debug)]
15838 pub struct UpdateEntity(RequestBuilder<crate::model::UpdateEntityRequest>);
15839
15840 impl UpdateEntity {
15841 pub(crate) fn new(
15842 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
15843 ) -> Self {
15844 Self(RequestBuilder::new(stub))
15845 }
15846
15847 pub fn with_request<V: Into<crate::model::UpdateEntityRequest>>(mut self, v: V) -> Self {
15849 self.0.request = v.into();
15850 self
15851 }
15852
15853 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15855 self.0.options = v.into();
15856 self
15857 }
15858
15859 pub async fn send(self) -> Result<crate::model::Entity> {
15861 (*self.0.stub)
15862 .update_entity(self.0.request, self.0.options)
15863 .await
15864 .map(crate::Response::into_body)
15865 }
15866
15867 pub fn set_entity<T>(mut self, v: T) -> Self
15871 where
15872 T: std::convert::Into<crate::model::Entity>,
15873 {
15874 self.0.request.entity = std::option::Option::Some(v.into());
15875 self
15876 }
15877
15878 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
15882 where
15883 T: std::convert::Into<crate::model::Entity>,
15884 {
15885 self.0.request.entity = v.map(|x| x.into());
15886 self
15887 }
15888
15889 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15891 self.0.request.validate_only = v.into();
15892 self
15893 }
15894 }
15895
15896 #[doc(hidden)]
15897 impl crate::RequestBuilder for UpdateEntity {
15898 fn request_options(&mut self) -> &mut crate::RequestOptions {
15899 &mut self.0.options
15900 }
15901 }
15902
15903 #[derive(Clone, Debug)]
15920 pub struct DeleteEntity(RequestBuilder<crate::model::DeleteEntityRequest>);
15921
15922 impl DeleteEntity {
15923 pub(crate) fn new(
15924 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
15925 ) -> Self {
15926 Self(RequestBuilder::new(stub))
15927 }
15928
15929 pub fn with_request<V: Into<crate::model::DeleteEntityRequest>>(mut self, v: V) -> Self {
15931 self.0.request = v.into();
15932 self
15933 }
15934
15935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15937 self.0.options = v.into();
15938 self
15939 }
15940
15941 pub async fn send(self) -> Result<()> {
15943 (*self.0.stub)
15944 .delete_entity(self.0.request, self.0.options)
15945 .await
15946 .map(crate::Response::into_body)
15947 }
15948
15949 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15953 self.0.request.name = v.into();
15954 self
15955 }
15956
15957 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
15961 self.0.request.etag = v.into();
15962 self
15963 }
15964 }
15965
15966 #[doc(hidden)]
15967 impl crate::RequestBuilder for DeleteEntity {
15968 fn request_options(&mut self) -> &mut crate::RequestOptions {
15969 &mut self.0.options
15970 }
15971 }
15972
15973 #[derive(Clone, Debug)]
15990 pub struct GetEntity(RequestBuilder<crate::model::GetEntityRequest>);
15991
15992 impl GetEntity {
15993 pub(crate) fn new(
15994 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
15995 ) -> Self {
15996 Self(RequestBuilder::new(stub))
15997 }
15998
15999 pub fn with_request<V: Into<crate::model::GetEntityRequest>>(mut self, v: V) -> Self {
16001 self.0.request = v.into();
16002 self
16003 }
16004
16005 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16007 self.0.options = v.into();
16008 self
16009 }
16010
16011 pub async fn send(self) -> Result<crate::model::Entity> {
16013 (*self.0.stub)
16014 .get_entity(self.0.request, self.0.options)
16015 .await
16016 .map(crate::Response::into_body)
16017 }
16018
16019 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16023 self.0.request.name = v.into();
16024 self
16025 }
16026
16027 pub fn set_view<T: Into<crate::model::get_entity_request::EntityView>>(
16029 mut self,
16030 v: T,
16031 ) -> Self {
16032 self.0.request.view = v.into();
16033 self
16034 }
16035 }
16036
16037 #[doc(hidden)]
16038 impl crate::RequestBuilder for GetEntity {
16039 fn request_options(&mut self) -> &mut crate::RequestOptions {
16040 &mut self.0.options
16041 }
16042 }
16043
16044 #[derive(Clone, Debug)]
16065 pub struct ListEntities(RequestBuilder<crate::model::ListEntitiesRequest>);
16066
16067 impl ListEntities {
16068 pub(crate) fn new(
16069 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16070 ) -> Self {
16071 Self(RequestBuilder::new(stub))
16072 }
16073
16074 pub fn with_request<V: Into<crate::model::ListEntitiesRequest>>(mut self, v: V) -> Self {
16076 self.0.request = v.into();
16077 self
16078 }
16079
16080 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16082 self.0.options = v.into();
16083 self
16084 }
16085
16086 pub async fn send(self) -> Result<crate::model::ListEntitiesResponse> {
16088 (*self.0.stub)
16089 .list_entities(self.0.request, self.0.options)
16090 .await
16091 .map(crate::Response::into_body)
16092 }
16093
16094 pub fn by_page(
16096 self,
16097 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListEntitiesResponse, crate::Error>
16098 {
16099 use std::clone::Clone;
16100 let token = self.0.request.page_token.clone();
16101 let execute = move |token: String| {
16102 let mut builder = self.clone();
16103 builder.0.request = builder.0.request.set_page_token(token);
16104 builder.send()
16105 };
16106 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16107 }
16108
16109 pub fn by_item(
16111 self,
16112 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16113 crate::model::ListEntitiesResponse,
16114 crate::Error,
16115 > {
16116 use google_cloud_gax::paginator::Paginator;
16117 self.by_page().items()
16118 }
16119
16120 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16124 self.0.request.parent = v.into();
16125 self
16126 }
16127
16128 pub fn set_view<T: Into<crate::model::list_entities_request::EntityView>>(
16132 mut self,
16133 v: T,
16134 ) -> Self {
16135 self.0.request.view = v.into();
16136 self
16137 }
16138
16139 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16141 self.0.request.page_size = v.into();
16142 self
16143 }
16144
16145 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16147 self.0.request.page_token = v.into();
16148 self
16149 }
16150
16151 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16153 self.0.request.filter = v.into();
16154 self
16155 }
16156 }
16157
16158 #[doc(hidden)]
16159 impl crate::RequestBuilder for ListEntities {
16160 fn request_options(&mut self) -> &mut crate::RequestOptions {
16161 &mut self.0.options
16162 }
16163 }
16164
16165 #[derive(Clone, Debug)]
16182 pub struct CreatePartition(RequestBuilder<crate::model::CreatePartitionRequest>);
16183
16184 impl CreatePartition {
16185 pub(crate) fn new(
16186 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16187 ) -> Self {
16188 Self(RequestBuilder::new(stub))
16189 }
16190
16191 pub fn with_request<V: Into<crate::model::CreatePartitionRequest>>(mut self, v: V) -> Self {
16193 self.0.request = v.into();
16194 self
16195 }
16196
16197 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16199 self.0.options = v.into();
16200 self
16201 }
16202
16203 pub async fn send(self) -> Result<crate::model::Partition> {
16205 (*self.0.stub)
16206 .create_partition(self.0.request, self.0.options)
16207 .await
16208 .map(crate::Response::into_body)
16209 }
16210
16211 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16215 self.0.request.parent = v.into();
16216 self
16217 }
16218
16219 pub fn set_partition<T>(mut self, v: T) -> Self
16223 where
16224 T: std::convert::Into<crate::model::Partition>,
16225 {
16226 self.0.request.partition = std::option::Option::Some(v.into());
16227 self
16228 }
16229
16230 pub fn set_or_clear_partition<T>(mut self, v: std::option::Option<T>) -> Self
16234 where
16235 T: std::convert::Into<crate::model::Partition>,
16236 {
16237 self.0.request.partition = v.map(|x| x.into());
16238 self
16239 }
16240
16241 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16243 self.0.request.validate_only = v.into();
16244 self
16245 }
16246 }
16247
16248 #[doc(hidden)]
16249 impl crate::RequestBuilder for CreatePartition {
16250 fn request_options(&mut self) -> &mut crate::RequestOptions {
16251 &mut self.0.options
16252 }
16253 }
16254
16255 #[derive(Clone, Debug)]
16272 pub struct DeletePartition(RequestBuilder<crate::model::DeletePartitionRequest>);
16273
16274 impl DeletePartition {
16275 pub(crate) fn new(
16276 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16277 ) -> Self {
16278 Self(RequestBuilder::new(stub))
16279 }
16280
16281 pub fn with_request<V: Into<crate::model::DeletePartitionRequest>>(mut self, v: V) -> Self {
16283 self.0.request = v.into();
16284 self
16285 }
16286
16287 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16289 self.0.options = v.into();
16290 self
16291 }
16292
16293 pub async fn send(self) -> Result<()> {
16295 (*self.0.stub)
16296 .delete_partition(self.0.request, self.0.options)
16297 .await
16298 .map(crate::Response::into_body)
16299 }
16300
16301 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16305 self.0.request.name = v.into();
16306 self
16307 }
16308
16309 #[deprecated]
16311 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
16312 self.0.request.etag = v.into();
16313 self
16314 }
16315 }
16316
16317 #[doc(hidden)]
16318 impl crate::RequestBuilder for DeletePartition {
16319 fn request_options(&mut self) -> &mut crate::RequestOptions {
16320 &mut self.0.options
16321 }
16322 }
16323
16324 #[derive(Clone, Debug)]
16341 pub struct GetPartition(RequestBuilder<crate::model::GetPartitionRequest>);
16342
16343 impl GetPartition {
16344 pub(crate) fn new(
16345 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16346 ) -> Self {
16347 Self(RequestBuilder::new(stub))
16348 }
16349
16350 pub fn with_request<V: Into<crate::model::GetPartitionRequest>>(mut self, v: V) -> Self {
16352 self.0.request = v.into();
16353 self
16354 }
16355
16356 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16358 self.0.options = v.into();
16359 self
16360 }
16361
16362 pub async fn send(self) -> Result<crate::model::Partition> {
16364 (*self.0.stub)
16365 .get_partition(self.0.request, self.0.options)
16366 .await
16367 .map(crate::Response::into_body)
16368 }
16369
16370 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16374 self.0.request.name = v.into();
16375 self
16376 }
16377 }
16378
16379 #[doc(hidden)]
16380 impl crate::RequestBuilder for GetPartition {
16381 fn request_options(&mut self) -> &mut crate::RequestOptions {
16382 &mut self.0.options
16383 }
16384 }
16385
16386 #[derive(Clone, Debug)]
16407 pub struct ListPartitions(RequestBuilder<crate::model::ListPartitionsRequest>);
16408
16409 impl ListPartitions {
16410 pub(crate) fn new(
16411 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16412 ) -> Self {
16413 Self(RequestBuilder::new(stub))
16414 }
16415
16416 pub fn with_request<V: Into<crate::model::ListPartitionsRequest>>(mut self, v: V) -> Self {
16418 self.0.request = v.into();
16419 self
16420 }
16421
16422 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16424 self.0.options = v.into();
16425 self
16426 }
16427
16428 pub async fn send(self) -> Result<crate::model::ListPartitionsResponse> {
16430 (*self.0.stub)
16431 .list_partitions(self.0.request, self.0.options)
16432 .await
16433 .map(crate::Response::into_body)
16434 }
16435
16436 pub fn by_page(
16438 self,
16439 ) -> impl google_cloud_gax::paginator::Paginator<
16440 crate::model::ListPartitionsResponse,
16441 crate::Error,
16442 > {
16443 use std::clone::Clone;
16444 let token = self.0.request.page_token.clone();
16445 let execute = move |token: String| {
16446 let mut builder = self.clone();
16447 builder.0.request = builder.0.request.set_page_token(token);
16448 builder.send()
16449 };
16450 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16451 }
16452
16453 pub fn by_item(
16455 self,
16456 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16457 crate::model::ListPartitionsResponse,
16458 crate::Error,
16459 > {
16460 use google_cloud_gax::paginator::Paginator;
16461 self.by_page().items()
16462 }
16463
16464 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16468 self.0.request.parent = v.into();
16469 self
16470 }
16471
16472 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16474 self.0.request.page_size = v.into();
16475 self
16476 }
16477
16478 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16480 self.0.request.page_token = v.into();
16481 self
16482 }
16483
16484 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16486 self.0.request.filter = v.into();
16487 self
16488 }
16489 }
16490
16491 #[doc(hidden)]
16492 impl crate::RequestBuilder for ListPartitions {
16493 fn request_options(&mut self) -> &mut crate::RequestOptions {
16494 &mut self.0.options
16495 }
16496 }
16497
16498 #[derive(Clone, Debug)]
16519 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
16520
16521 impl ListLocations {
16522 pub(crate) fn new(
16523 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16524 ) -> Self {
16525 Self(RequestBuilder::new(stub))
16526 }
16527
16528 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
16530 mut self,
16531 v: V,
16532 ) -> Self {
16533 self.0.request = v.into();
16534 self
16535 }
16536
16537 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16539 self.0.options = v.into();
16540 self
16541 }
16542
16543 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
16545 (*self.0.stub)
16546 .list_locations(self.0.request, self.0.options)
16547 .await
16548 .map(crate::Response::into_body)
16549 }
16550
16551 pub fn by_page(
16553 self,
16554 ) -> impl google_cloud_gax::paginator::Paginator<
16555 google_cloud_location::model::ListLocationsResponse,
16556 crate::Error,
16557 > {
16558 use std::clone::Clone;
16559 let token = self.0.request.page_token.clone();
16560 let execute = move |token: String| {
16561 let mut builder = self.clone();
16562 builder.0.request = builder.0.request.set_page_token(token);
16563 builder.send()
16564 };
16565 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16566 }
16567
16568 pub fn by_item(
16570 self,
16571 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16572 google_cloud_location::model::ListLocationsResponse,
16573 crate::Error,
16574 > {
16575 use google_cloud_gax::paginator::Paginator;
16576 self.by_page().items()
16577 }
16578
16579 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16581 self.0.request.name = v.into();
16582 self
16583 }
16584
16585 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16587 self.0.request.filter = v.into();
16588 self
16589 }
16590
16591 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16593 self.0.request.page_size = v.into();
16594 self
16595 }
16596
16597 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16599 self.0.request.page_token = v.into();
16600 self
16601 }
16602 }
16603
16604 #[doc(hidden)]
16605 impl crate::RequestBuilder for ListLocations {
16606 fn request_options(&mut self) -> &mut crate::RequestOptions {
16607 &mut self.0.options
16608 }
16609 }
16610
16611 #[derive(Clone, Debug)]
16628 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
16629
16630 impl GetLocation {
16631 pub(crate) fn new(
16632 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16633 ) -> Self {
16634 Self(RequestBuilder::new(stub))
16635 }
16636
16637 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
16639 mut self,
16640 v: V,
16641 ) -> Self {
16642 self.0.request = v.into();
16643 self
16644 }
16645
16646 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16648 self.0.options = v.into();
16649 self
16650 }
16651
16652 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
16654 (*self.0.stub)
16655 .get_location(self.0.request, self.0.options)
16656 .await
16657 .map(crate::Response::into_body)
16658 }
16659
16660 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16662 self.0.request.name = v.into();
16663 self
16664 }
16665 }
16666
16667 #[doc(hidden)]
16668 impl crate::RequestBuilder for GetLocation {
16669 fn request_options(&mut self) -> &mut crate::RequestOptions {
16670 &mut self.0.options
16671 }
16672 }
16673
16674 #[derive(Clone, Debug)]
16691 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
16692
16693 impl SetIamPolicy {
16694 pub(crate) fn new(
16695 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16696 ) -> Self {
16697 Self(RequestBuilder::new(stub))
16698 }
16699
16700 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
16702 mut self,
16703 v: V,
16704 ) -> Self {
16705 self.0.request = v.into();
16706 self
16707 }
16708
16709 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16711 self.0.options = v.into();
16712 self
16713 }
16714
16715 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
16717 (*self.0.stub)
16718 .set_iam_policy(self.0.request, self.0.options)
16719 .await
16720 .map(crate::Response::into_body)
16721 }
16722
16723 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
16727 self.0.request.resource = v.into();
16728 self
16729 }
16730
16731 pub fn set_policy<T>(mut self, v: T) -> Self
16735 where
16736 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
16737 {
16738 self.0.request.policy = std::option::Option::Some(v.into());
16739 self
16740 }
16741
16742 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
16746 where
16747 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
16748 {
16749 self.0.request.policy = v.map(|x| x.into());
16750 self
16751 }
16752
16753 pub fn set_update_mask<T>(mut self, v: T) -> Self
16755 where
16756 T: std::convert::Into<wkt::FieldMask>,
16757 {
16758 self.0.request.update_mask = std::option::Option::Some(v.into());
16759 self
16760 }
16761
16762 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16764 where
16765 T: std::convert::Into<wkt::FieldMask>,
16766 {
16767 self.0.request.update_mask = v.map(|x| x.into());
16768 self
16769 }
16770 }
16771
16772 #[doc(hidden)]
16773 impl crate::RequestBuilder for SetIamPolicy {
16774 fn request_options(&mut self) -> &mut crate::RequestOptions {
16775 &mut self.0.options
16776 }
16777 }
16778
16779 #[derive(Clone, Debug)]
16796 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
16797
16798 impl GetIamPolicy {
16799 pub(crate) fn new(
16800 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16801 ) -> Self {
16802 Self(RequestBuilder::new(stub))
16803 }
16804
16805 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
16807 mut self,
16808 v: V,
16809 ) -> Self {
16810 self.0.request = v.into();
16811 self
16812 }
16813
16814 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16816 self.0.options = v.into();
16817 self
16818 }
16819
16820 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
16822 (*self.0.stub)
16823 .get_iam_policy(self.0.request, self.0.options)
16824 .await
16825 .map(crate::Response::into_body)
16826 }
16827
16828 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
16832 self.0.request.resource = v.into();
16833 self
16834 }
16835
16836 pub fn set_options<T>(mut self, v: T) -> Self
16838 where
16839 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
16840 {
16841 self.0.request.options = std::option::Option::Some(v.into());
16842 self
16843 }
16844
16845 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
16847 where
16848 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
16849 {
16850 self.0.request.options = v.map(|x| x.into());
16851 self
16852 }
16853 }
16854
16855 #[doc(hidden)]
16856 impl crate::RequestBuilder for GetIamPolicy {
16857 fn request_options(&mut self) -> &mut crate::RequestOptions {
16858 &mut self.0.options
16859 }
16860 }
16861
16862 #[derive(Clone, Debug)]
16879 pub struct TestIamPermissions(
16880 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
16881 );
16882
16883 impl TestIamPermissions {
16884 pub(crate) fn new(
16885 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16886 ) -> Self {
16887 Self(RequestBuilder::new(stub))
16888 }
16889
16890 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
16892 mut self,
16893 v: V,
16894 ) -> Self {
16895 self.0.request = v.into();
16896 self
16897 }
16898
16899 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16901 self.0.options = v.into();
16902 self
16903 }
16904
16905 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
16907 (*self.0.stub)
16908 .test_iam_permissions(self.0.request, self.0.options)
16909 .await
16910 .map(crate::Response::into_body)
16911 }
16912
16913 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
16917 self.0.request.resource = v.into();
16918 self
16919 }
16920
16921 pub fn set_permissions<T, V>(mut self, v: T) -> Self
16925 where
16926 T: std::iter::IntoIterator<Item = V>,
16927 V: std::convert::Into<std::string::String>,
16928 {
16929 use std::iter::Iterator;
16930 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
16931 self
16932 }
16933 }
16934
16935 #[doc(hidden)]
16936 impl crate::RequestBuilder for TestIamPermissions {
16937 fn request_options(&mut self) -> &mut crate::RequestOptions {
16938 &mut self.0.options
16939 }
16940 }
16941
16942 #[derive(Clone, Debug)]
16963 pub struct ListOperations(
16964 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
16965 );
16966
16967 impl ListOperations {
16968 pub(crate) fn new(
16969 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16970 ) -> Self {
16971 Self(RequestBuilder::new(stub))
16972 }
16973
16974 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
16976 mut self,
16977 v: V,
16978 ) -> Self {
16979 self.0.request = v.into();
16980 self
16981 }
16982
16983 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16985 self.0.options = v.into();
16986 self
16987 }
16988
16989 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
16991 (*self.0.stub)
16992 .list_operations(self.0.request, self.0.options)
16993 .await
16994 .map(crate::Response::into_body)
16995 }
16996
16997 pub fn by_page(
16999 self,
17000 ) -> impl google_cloud_gax::paginator::Paginator<
17001 google_cloud_longrunning::model::ListOperationsResponse,
17002 crate::Error,
17003 > {
17004 use std::clone::Clone;
17005 let token = self.0.request.page_token.clone();
17006 let execute = move |token: String| {
17007 let mut builder = self.clone();
17008 builder.0.request = builder.0.request.set_page_token(token);
17009 builder.send()
17010 };
17011 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17012 }
17013
17014 pub fn by_item(
17016 self,
17017 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17018 google_cloud_longrunning::model::ListOperationsResponse,
17019 crate::Error,
17020 > {
17021 use google_cloud_gax::paginator::Paginator;
17022 self.by_page().items()
17023 }
17024
17025 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17027 self.0.request.name = v.into();
17028 self
17029 }
17030
17031 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17033 self.0.request.filter = v.into();
17034 self
17035 }
17036
17037 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17039 self.0.request.page_size = v.into();
17040 self
17041 }
17042
17043 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17045 self.0.request.page_token = v.into();
17046 self
17047 }
17048
17049 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
17051 self.0.request.return_partial_success = v.into();
17052 self
17053 }
17054 }
17055
17056 #[doc(hidden)]
17057 impl crate::RequestBuilder for ListOperations {
17058 fn request_options(&mut self) -> &mut crate::RequestOptions {
17059 &mut self.0.options
17060 }
17061 }
17062
17063 #[derive(Clone, Debug)]
17080 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
17081
17082 impl GetOperation {
17083 pub(crate) fn new(
17084 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17085 ) -> Self {
17086 Self(RequestBuilder::new(stub))
17087 }
17088
17089 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
17091 mut self,
17092 v: V,
17093 ) -> Self {
17094 self.0.request = v.into();
17095 self
17096 }
17097
17098 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17100 self.0.options = v.into();
17101 self
17102 }
17103
17104 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17106 (*self.0.stub)
17107 .get_operation(self.0.request, self.0.options)
17108 .await
17109 .map(crate::Response::into_body)
17110 }
17111
17112 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17114 self.0.request.name = v.into();
17115 self
17116 }
17117 }
17118
17119 #[doc(hidden)]
17120 impl crate::RequestBuilder for GetOperation {
17121 fn request_options(&mut self) -> &mut crate::RequestOptions {
17122 &mut self.0.options
17123 }
17124 }
17125
17126 #[derive(Clone, Debug)]
17143 pub struct DeleteOperation(
17144 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
17145 );
17146
17147 impl DeleteOperation {
17148 pub(crate) fn new(
17149 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17150 ) -> Self {
17151 Self(RequestBuilder::new(stub))
17152 }
17153
17154 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
17156 mut self,
17157 v: V,
17158 ) -> Self {
17159 self.0.request = v.into();
17160 self
17161 }
17162
17163 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17165 self.0.options = v.into();
17166 self
17167 }
17168
17169 pub async fn send(self) -> Result<()> {
17171 (*self.0.stub)
17172 .delete_operation(self.0.request, self.0.options)
17173 .await
17174 .map(crate::Response::into_body)
17175 }
17176
17177 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17179 self.0.request.name = v.into();
17180 self
17181 }
17182 }
17183
17184 #[doc(hidden)]
17185 impl crate::RequestBuilder for DeleteOperation {
17186 fn request_options(&mut self) -> &mut crate::RequestOptions {
17187 &mut self.0.options
17188 }
17189 }
17190
17191 #[derive(Clone, Debug)]
17208 pub struct CancelOperation(
17209 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
17210 );
17211
17212 impl CancelOperation {
17213 pub(crate) fn new(
17214 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17215 ) -> Self {
17216 Self(RequestBuilder::new(stub))
17217 }
17218
17219 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
17221 mut self,
17222 v: V,
17223 ) -> Self {
17224 self.0.request = v.into();
17225 self
17226 }
17227
17228 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17230 self.0.options = v.into();
17231 self
17232 }
17233
17234 pub async fn send(self) -> Result<()> {
17236 (*self.0.stub)
17237 .cancel_operation(self.0.request, self.0.options)
17238 .await
17239 .map(crate::Response::into_body)
17240 }
17241
17242 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17244 self.0.request.name = v.into();
17245 self
17246 }
17247 }
17248
17249 #[doc(hidden)]
17250 impl crate::RequestBuilder for CancelOperation {
17251 fn request_options(&mut self) -> &mut crate::RequestOptions {
17252 &mut self.0.options
17253 }
17254 }
17255}
17256
17257pub mod dataplex_service {
17258 use crate::Result;
17259
17260 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17274
17275 pub(crate) mod client {
17276 use super::super::super::client::DataplexService;
17277 pub struct Factory;
17278 impl crate::ClientFactory for Factory {
17279 type Client = DataplexService;
17280 type Credentials = gaxi::options::Credentials;
17281 async fn build(
17282 self,
17283 config: gaxi::options::ClientConfig,
17284 ) -> crate::ClientBuilderResult<Self::Client> {
17285 Self::Client::new(config).await
17286 }
17287 }
17288 }
17289
17290 #[derive(Clone, Debug)]
17292 pub(crate) struct RequestBuilder<R: std::default::Default> {
17293 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17294 request: R,
17295 options: crate::RequestOptions,
17296 }
17297
17298 impl<R> RequestBuilder<R>
17299 where
17300 R: std::default::Default,
17301 {
17302 pub(crate) fn new(
17303 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17304 ) -> Self {
17305 Self {
17306 stub,
17307 request: R::default(),
17308 options: crate::RequestOptions::default(),
17309 }
17310 }
17311 }
17312
17313 #[derive(Clone, Debug)]
17331 pub struct CreateLake(RequestBuilder<crate::model::CreateLakeRequest>);
17332
17333 impl CreateLake {
17334 pub(crate) fn new(
17335 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17336 ) -> Self {
17337 Self(RequestBuilder::new(stub))
17338 }
17339
17340 pub fn with_request<V: Into<crate::model::CreateLakeRequest>>(mut self, v: V) -> Self {
17342 self.0.request = v.into();
17343 self
17344 }
17345
17346 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17348 self.0.options = v.into();
17349 self
17350 }
17351
17352 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17359 (*self.0.stub)
17360 .create_lake(self.0.request, self.0.options)
17361 .await
17362 .map(crate::Response::into_body)
17363 }
17364
17365 pub fn poller(
17367 self,
17368 ) -> impl google_cloud_lro::Poller<crate::model::Lake, crate::model::OperationMetadata>
17369 {
17370 type Operation = google_cloud_lro::internal::Operation<
17371 crate::model::Lake,
17372 crate::model::OperationMetadata,
17373 >;
17374 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17375 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17376
17377 let stub = self.0.stub.clone();
17378 let mut options = self.0.options.clone();
17379 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17380 let query = move |name| {
17381 let stub = stub.clone();
17382 let options = options.clone();
17383 async {
17384 let op = GetOperation::new(stub)
17385 .set_name(name)
17386 .with_options(options)
17387 .send()
17388 .await?;
17389 Ok(Operation::new(op))
17390 }
17391 };
17392
17393 let start = move || async {
17394 let op = self.send().await?;
17395 Ok(Operation::new(op))
17396 };
17397
17398 google_cloud_lro::internal::new_poller(
17399 polling_error_policy,
17400 polling_backoff_policy,
17401 start,
17402 query,
17403 )
17404 }
17405
17406 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17410 self.0.request.parent = v.into();
17411 self
17412 }
17413
17414 pub fn set_lake_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17418 self.0.request.lake_id = v.into();
17419 self
17420 }
17421
17422 pub fn set_lake<T>(mut self, v: T) -> Self
17426 where
17427 T: std::convert::Into<crate::model::Lake>,
17428 {
17429 self.0.request.lake = std::option::Option::Some(v.into());
17430 self
17431 }
17432
17433 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
17437 where
17438 T: std::convert::Into<crate::model::Lake>,
17439 {
17440 self.0.request.lake = v.map(|x| x.into());
17441 self
17442 }
17443
17444 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17446 self.0.request.validate_only = v.into();
17447 self
17448 }
17449 }
17450
17451 #[doc(hidden)]
17452 impl crate::RequestBuilder for CreateLake {
17453 fn request_options(&mut self) -> &mut crate::RequestOptions {
17454 &mut self.0.options
17455 }
17456 }
17457
17458 #[derive(Clone, Debug)]
17476 pub struct UpdateLake(RequestBuilder<crate::model::UpdateLakeRequest>);
17477
17478 impl UpdateLake {
17479 pub(crate) fn new(
17480 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17481 ) -> Self {
17482 Self(RequestBuilder::new(stub))
17483 }
17484
17485 pub fn with_request<V: Into<crate::model::UpdateLakeRequest>>(mut self, v: V) -> Self {
17487 self.0.request = v.into();
17488 self
17489 }
17490
17491 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17493 self.0.options = v.into();
17494 self
17495 }
17496
17497 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17504 (*self.0.stub)
17505 .update_lake(self.0.request, self.0.options)
17506 .await
17507 .map(crate::Response::into_body)
17508 }
17509
17510 pub fn poller(
17512 self,
17513 ) -> impl google_cloud_lro::Poller<crate::model::Lake, crate::model::OperationMetadata>
17514 {
17515 type Operation = google_cloud_lro::internal::Operation<
17516 crate::model::Lake,
17517 crate::model::OperationMetadata,
17518 >;
17519 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17520 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17521
17522 let stub = self.0.stub.clone();
17523 let mut options = self.0.options.clone();
17524 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17525 let query = move |name| {
17526 let stub = stub.clone();
17527 let options = options.clone();
17528 async {
17529 let op = GetOperation::new(stub)
17530 .set_name(name)
17531 .with_options(options)
17532 .send()
17533 .await?;
17534 Ok(Operation::new(op))
17535 }
17536 };
17537
17538 let start = move || async {
17539 let op = self.send().await?;
17540 Ok(Operation::new(op))
17541 };
17542
17543 google_cloud_lro::internal::new_poller(
17544 polling_error_policy,
17545 polling_backoff_policy,
17546 start,
17547 query,
17548 )
17549 }
17550
17551 pub fn set_update_mask<T>(mut self, v: T) -> Self
17555 where
17556 T: std::convert::Into<wkt::FieldMask>,
17557 {
17558 self.0.request.update_mask = std::option::Option::Some(v.into());
17559 self
17560 }
17561
17562 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17566 where
17567 T: std::convert::Into<wkt::FieldMask>,
17568 {
17569 self.0.request.update_mask = v.map(|x| x.into());
17570 self
17571 }
17572
17573 pub fn set_lake<T>(mut self, v: T) -> Self
17577 where
17578 T: std::convert::Into<crate::model::Lake>,
17579 {
17580 self.0.request.lake = std::option::Option::Some(v.into());
17581 self
17582 }
17583
17584 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
17588 where
17589 T: std::convert::Into<crate::model::Lake>,
17590 {
17591 self.0.request.lake = v.map(|x| x.into());
17592 self
17593 }
17594
17595 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17597 self.0.request.validate_only = v.into();
17598 self
17599 }
17600 }
17601
17602 #[doc(hidden)]
17603 impl crate::RequestBuilder for UpdateLake {
17604 fn request_options(&mut self) -> &mut crate::RequestOptions {
17605 &mut self.0.options
17606 }
17607 }
17608
17609 #[derive(Clone, Debug)]
17627 pub struct DeleteLake(RequestBuilder<crate::model::DeleteLakeRequest>);
17628
17629 impl DeleteLake {
17630 pub(crate) fn new(
17631 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17632 ) -> Self {
17633 Self(RequestBuilder::new(stub))
17634 }
17635
17636 pub fn with_request<V: Into<crate::model::DeleteLakeRequest>>(mut self, v: V) -> Self {
17638 self.0.request = v.into();
17639 self
17640 }
17641
17642 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17644 self.0.options = v.into();
17645 self
17646 }
17647
17648 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17655 (*self.0.stub)
17656 .delete_lake(self.0.request, self.0.options)
17657 .await
17658 .map(crate::Response::into_body)
17659 }
17660
17661 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17663 type Operation =
17664 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17665 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17666 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17667
17668 let stub = self.0.stub.clone();
17669 let mut options = self.0.options.clone();
17670 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17671 let query = move |name| {
17672 let stub = stub.clone();
17673 let options = options.clone();
17674 async {
17675 let op = GetOperation::new(stub)
17676 .set_name(name)
17677 .with_options(options)
17678 .send()
17679 .await?;
17680 Ok(Operation::new(op))
17681 }
17682 };
17683
17684 let start = move || async {
17685 let op = self.send().await?;
17686 Ok(Operation::new(op))
17687 };
17688
17689 google_cloud_lro::internal::new_unit_response_poller(
17690 polling_error_policy,
17691 polling_backoff_policy,
17692 start,
17693 query,
17694 )
17695 }
17696
17697 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17701 self.0.request.name = v.into();
17702 self
17703 }
17704 }
17705
17706 #[doc(hidden)]
17707 impl crate::RequestBuilder for DeleteLake {
17708 fn request_options(&mut self) -> &mut crate::RequestOptions {
17709 &mut self.0.options
17710 }
17711 }
17712
17713 #[derive(Clone, Debug)]
17734 pub struct ListLakes(RequestBuilder<crate::model::ListLakesRequest>);
17735
17736 impl ListLakes {
17737 pub(crate) fn new(
17738 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17739 ) -> Self {
17740 Self(RequestBuilder::new(stub))
17741 }
17742
17743 pub fn with_request<V: Into<crate::model::ListLakesRequest>>(mut self, v: V) -> Self {
17745 self.0.request = v.into();
17746 self
17747 }
17748
17749 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17751 self.0.options = v.into();
17752 self
17753 }
17754
17755 pub async fn send(self) -> Result<crate::model::ListLakesResponse> {
17757 (*self.0.stub)
17758 .list_lakes(self.0.request, self.0.options)
17759 .await
17760 .map(crate::Response::into_body)
17761 }
17762
17763 pub fn by_page(
17765 self,
17766 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListLakesResponse, crate::Error>
17767 {
17768 use std::clone::Clone;
17769 let token = self.0.request.page_token.clone();
17770 let execute = move |token: String| {
17771 let mut builder = self.clone();
17772 builder.0.request = builder.0.request.set_page_token(token);
17773 builder.send()
17774 };
17775 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17776 }
17777
17778 pub fn by_item(
17780 self,
17781 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListLakesResponse, crate::Error>
17782 {
17783 use google_cloud_gax::paginator::Paginator;
17784 self.by_page().items()
17785 }
17786
17787 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17791 self.0.request.parent = v.into();
17792 self
17793 }
17794
17795 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17797 self.0.request.page_size = v.into();
17798 self
17799 }
17800
17801 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17803 self.0.request.page_token = v.into();
17804 self
17805 }
17806
17807 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17809 self.0.request.filter = v.into();
17810 self
17811 }
17812
17813 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
17815 self.0.request.order_by = v.into();
17816 self
17817 }
17818 }
17819
17820 #[doc(hidden)]
17821 impl crate::RequestBuilder for ListLakes {
17822 fn request_options(&mut self) -> &mut crate::RequestOptions {
17823 &mut self.0.options
17824 }
17825 }
17826
17827 #[derive(Clone, Debug)]
17844 pub struct GetLake(RequestBuilder<crate::model::GetLakeRequest>);
17845
17846 impl GetLake {
17847 pub(crate) fn new(
17848 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17849 ) -> Self {
17850 Self(RequestBuilder::new(stub))
17851 }
17852
17853 pub fn with_request<V: Into<crate::model::GetLakeRequest>>(mut self, v: V) -> Self {
17855 self.0.request = v.into();
17856 self
17857 }
17858
17859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17861 self.0.options = v.into();
17862 self
17863 }
17864
17865 pub async fn send(self) -> Result<crate::model::Lake> {
17867 (*self.0.stub)
17868 .get_lake(self.0.request, self.0.options)
17869 .await
17870 .map(crate::Response::into_body)
17871 }
17872
17873 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17877 self.0.request.name = v.into();
17878 self
17879 }
17880 }
17881
17882 #[doc(hidden)]
17883 impl crate::RequestBuilder for GetLake {
17884 fn request_options(&mut self) -> &mut crate::RequestOptions {
17885 &mut self.0.options
17886 }
17887 }
17888
17889 #[derive(Clone, Debug)]
17910 pub struct ListLakeActions(RequestBuilder<crate::model::ListLakeActionsRequest>);
17911
17912 impl ListLakeActions {
17913 pub(crate) fn new(
17914 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17915 ) -> Self {
17916 Self(RequestBuilder::new(stub))
17917 }
17918
17919 pub fn with_request<V: Into<crate::model::ListLakeActionsRequest>>(mut self, v: V) -> Self {
17921 self.0.request = v.into();
17922 self
17923 }
17924
17925 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17927 self.0.options = v.into();
17928 self
17929 }
17930
17931 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
17933 (*self.0.stub)
17934 .list_lake_actions(self.0.request, self.0.options)
17935 .await
17936 .map(crate::Response::into_body)
17937 }
17938
17939 pub fn by_page(
17941 self,
17942 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
17943 {
17944 use std::clone::Clone;
17945 let token = self.0.request.page_token.clone();
17946 let execute = move |token: String| {
17947 let mut builder = self.clone();
17948 builder.0.request = builder.0.request.set_page_token(token);
17949 builder.send()
17950 };
17951 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17952 }
17953
17954 pub fn by_item(
17956 self,
17957 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17958 crate::model::ListActionsResponse,
17959 crate::Error,
17960 > {
17961 use google_cloud_gax::paginator::Paginator;
17962 self.by_page().items()
17963 }
17964
17965 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17969 self.0.request.parent = v.into();
17970 self
17971 }
17972
17973 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17975 self.0.request.page_size = v.into();
17976 self
17977 }
17978
17979 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17981 self.0.request.page_token = v.into();
17982 self
17983 }
17984 }
17985
17986 #[doc(hidden)]
17987 impl crate::RequestBuilder for ListLakeActions {
17988 fn request_options(&mut self) -> &mut crate::RequestOptions {
17989 &mut self.0.options
17990 }
17991 }
17992
17993 #[derive(Clone, Debug)]
18011 pub struct CreateZone(RequestBuilder<crate::model::CreateZoneRequest>);
18012
18013 impl CreateZone {
18014 pub(crate) fn new(
18015 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18016 ) -> Self {
18017 Self(RequestBuilder::new(stub))
18018 }
18019
18020 pub fn with_request<V: Into<crate::model::CreateZoneRequest>>(mut self, v: V) -> Self {
18022 self.0.request = v.into();
18023 self
18024 }
18025
18026 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18028 self.0.options = v.into();
18029 self
18030 }
18031
18032 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18039 (*self.0.stub)
18040 .create_zone(self.0.request, self.0.options)
18041 .await
18042 .map(crate::Response::into_body)
18043 }
18044
18045 pub fn poller(
18047 self,
18048 ) -> impl google_cloud_lro::Poller<crate::model::Zone, crate::model::OperationMetadata>
18049 {
18050 type Operation = google_cloud_lro::internal::Operation<
18051 crate::model::Zone,
18052 crate::model::OperationMetadata,
18053 >;
18054 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18055 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18056
18057 let stub = self.0.stub.clone();
18058 let mut options = self.0.options.clone();
18059 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18060 let query = move |name| {
18061 let stub = stub.clone();
18062 let options = options.clone();
18063 async {
18064 let op = GetOperation::new(stub)
18065 .set_name(name)
18066 .with_options(options)
18067 .send()
18068 .await?;
18069 Ok(Operation::new(op))
18070 }
18071 };
18072
18073 let start = move || async {
18074 let op = self.send().await?;
18075 Ok(Operation::new(op))
18076 };
18077
18078 google_cloud_lro::internal::new_poller(
18079 polling_error_policy,
18080 polling_backoff_policy,
18081 start,
18082 query,
18083 )
18084 }
18085
18086 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18090 self.0.request.parent = v.into();
18091 self
18092 }
18093
18094 pub fn set_zone_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18098 self.0.request.zone_id = v.into();
18099 self
18100 }
18101
18102 pub fn set_zone<T>(mut self, v: T) -> Self
18106 where
18107 T: std::convert::Into<crate::model::Zone>,
18108 {
18109 self.0.request.zone = std::option::Option::Some(v.into());
18110 self
18111 }
18112
18113 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
18117 where
18118 T: std::convert::Into<crate::model::Zone>,
18119 {
18120 self.0.request.zone = v.map(|x| x.into());
18121 self
18122 }
18123
18124 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
18126 self.0.request.validate_only = v.into();
18127 self
18128 }
18129 }
18130
18131 #[doc(hidden)]
18132 impl crate::RequestBuilder for CreateZone {
18133 fn request_options(&mut self) -> &mut crate::RequestOptions {
18134 &mut self.0.options
18135 }
18136 }
18137
18138 #[derive(Clone, Debug)]
18156 pub struct UpdateZone(RequestBuilder<crate::model::UpdateZoneRequest>);
18157
18158 impl UpdateZone {
18159 pub(crate) fn new(
18160 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18161 ) -> Self {
18162 Self(RequestBuilder::new(stub))
18163 }
18164
18165 pub fn with_request<V: Into<crate::model::UpdateZoneRequest>>(mut self, v: V) -> Self {
18167 self.0.request = v.into();
18168 self
18169 }
18170
18171 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18173 self.0.options = v.into();
18174 self
18175 }
18176
18177 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18184 (*self.0.stub)
18185 .update_zone(self.0.request, self.0.options)
18186 .await
18187 .map(crate::Response::into_body)
18188 }
18189
18190 pub fn poller(
18192 self,
18193 ) -> impl google_cloud_lro::Poller<crate::model::Zone, crate::model::OperationMetadata>
18194 {
18195 type Operation = google_cloud_lro::internal::Operation<
18196 crate::model::Zone,
18197 crate::model::OperationMetadata,
18198 >;
18199 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18200 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18201
18202 let stub = self.0.stub.clone();
18203 let mut options = self.0.options.clone();
18204 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18205 let query = move |name| {
18206 let stub = stub.clone();
18207 let options = options.clone();
18208 async {
18209 let op = GetOperation::new(stub)
18210 .set_name(name)
18211 .with_options(options)
18212 .send()
18213 .await?;
18214 Ok(Operation::new(op))
18215 }
18216 };
18217
18218 let start = move || async {
18219 let op = self.send().await?;
18220 Ok(Operation::new(op))
18221 };
18222
18223 google_cloud_lro::internal::new_poller(
18224 polling_error_policy,
18225 polling_backoff_policy,
18226 start,
18227 query,
18228 )
18229 }
18230
18231 pub fn set_update_mask<T>(mut self, v: T) -> Self
18235 where
18236 T: std::convert::Into<wkt::FieldMask>,
18237 {
18238 self.0.request.update_mask = std::option::Option::Some(v.into());
18239 self
18240 }
18241
18242 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18246 where
18247 T: std::convert::Into<wkt::FieldMask>,
18248 {
18249 self.0.request.update_mask = v.map(|x| x.into());
18250 self
18251 }
18252
18253 pub fn set_zone<T>(mut self, v: T) -> Self
18257 where
18258 T: std::convert::Into<crate::model::Zone>,
18259 {
18260 self.0.request.zone = std::option::Option::Some(v.into());
18261 self
18262 }
18263
18264 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
18268 where
18269 T: std::convert::Into<crate::model::Zone>,
18270 {
18271 self.0.request.zone = v.map(|x| x.into());
18272 self
18273 }
18274
18275 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
18277 self.0.request.validate_only = v.into();
18278 self
18279 }
18280 }
18281
18282 #[doc(hidden)]
18283 impl crate::RequestBuilder for UpdateZone {
18284 fn request_options(&mut self) -> &mut crate::RequestOptions {
18285 &mut self.0.options
18286 }
18287 }
18288
18289 #[derive(Clone, Debug)]
18307 pub struct DeleteZone(RequestBuilder<crate::model::DeleteZoneRequest>);
18308
18309 impl DeleteZone {
18310 pub(crate) fn new(
18311 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18312 ) -> Self {
18313 Self(RequestBuilder::new(stub))
18314 }
18315
18316 pub fn with_request<V: Into<crate::model::DeleteZoneRequest>>(mut self, v: V) -> Self {
18318 self.0.request = v.into();
18319 self
18320 }
18321
18322 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18324 self.0.options = v.into();
18325 self
18326 }
18327
18328 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18335 (*self.0.stub)
18336 .delete_zone(self.0.request, self.0.options)
18337 .await
18338 .map(crate::Response::into_body)
18339 }
18340
18341 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18343 type Operation =
18344 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18345 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18346 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18347
18348 let stub = self.0.stub.clone();
18349 let mut options = self.0.options.clone();
18350 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18351 let query = move |name| {
18352 let stub = stub.clone();
18353 let options = options.clone();
18354 async {
18355 let op = GetOperation::new(stub)
18356 .set_name(name)
18357 .with_options(options)
18358 .send()
18359 .await?;
18360 Ok(Operation::new(op))
18361 }
18362 };
18363
18364 let start = move || async {
18365 let op = self.send().await?;
18366 Ok(Operation::new(op))
18367 };
18368
18369 google_cloud_lro::internal::new_unit_response_poller(
18370 polling_error_policy,
18371 polling_backoff_policy,
18372 start,
18373 query,
18374 )
18375 }
18376
18377 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18381 self.0.request.name = v.into();
18382 self
18383 }
18384 }
18385
18386 #[doc(hidden)]
18387 impl crate::RequestBuilder for DeleteZone {
18388 fn request_options(&mut self) -> &mut crate::RequestOptions {
18389 &mut self.0.options
18390 }
18391 }
18392
18393 #[derive(Clone, Debug)]
18414 pub struct ListZones(RequestBuilder<crate::model::ListZonesRequest>);
18415
18416 impl ListZones {
18417 pub(crate) fn new(
18418 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18419 ) -> Self {
18420 Self(RequestBuilder::new(stub))
18421 }
18422
18423 pub fn with_request<V: Into<crate::model::ListZonesRequest>>(mut self, v: V) -> Self {
18425 self.0.request = v.into();
18426 self
18427 }
18428
18429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18431 self.0.options = v.into();
18432 self
18433 }
18434
18435 pub async fn send(self) -> Result<crate::model::ListZonesResponse> {
18437 (*self.0.stub)
18438 .list_zones(self.0.request, self.0.options)
18439 .await
18440 .map(crate::Response::into_body)
18441 }
18442
18443 pub fn by_page(
18445 self,
18446 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListZonesResponse, crate::Error>
18447 {
18448 use std::clone::Clone;
18449 let token = self.0.request.page_token.clone();
18450 let execute = move |token: String| {
18451 let mut builder = self.clone();
18452 builder.0.request = builder.0.request.set_page_token(token);
18453 builder.send()
18454 };
18455 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18456 }
18457
18458 pub fn by_item(
18460 self,
18461 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListZonesResponse, crate::Error>
18462 {
18463 use google_cloud_gax::paginator::Paginator;
18464 self.by_page().items()
18465 }
18466
18467 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18471 self.0.request.parent = v.into();
18472 self
18473 }
18474
18475 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18477 self.0.request.page_size = v.into();
18478 self
18479 }
18480
18481 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18483 self.0.request.page_token = v.into();
18484 self
18485 }
18486
18487 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18489 self.0.request.filter = v.into();
18490 self
18491 }
18492
18493 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
18495 self.0.request.order_by = v.into();
18496 self
18497 }
18498 }
18499
18500 #[doc(hidden)]
18501 impl crate::RequestBuilder for ListZones {
18502 fn request_options(&mut self) -> &mut crate::RequestOptions {
18503 &mut self.0.options
18504 }
18505 }
18506
18507 #[derive(Clone, Debug)]
18524 pub struct GetZone(RequestBuilder<crate::model::GetZoneRequest>);
18525
18526 impl GetZone {
18527 pub(crate) fn new(
18528 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18529 ) -> Self {
18530 Self(RequestBuilder::new(stub))
18531 }
18532
18533 pub fn with_request<V: Into<crate::model::GetZoneRequest>>(mut self, v: V) -> Self {
18535 self.0.request = v.into();
18536 self
18537 }
18538
18539 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18541 self.0.options = v.into();
18542 self
18543 }
18544
18545 pub async fn send(self) -> Result<crate::model::Zone> {
18547 (*self.0.stub)
18548 .get_zone(self.0.request, self.0.options)
18549 .await
18550 .map(crate::Response::into_body)
18551 }
18552
18553 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18557 self.0.request.name = v.into();
18558 self
18559 }
18560 }
18561
18562 #[doc(hidden)]
18563 impl crate::RequestBuilder for GetZone {
18564 fn request_options(&mut self) -> &mut crate::RequestOptions {
18565 &mut self.0.options
18566 }
18567 }
18568
18569 #[derive(Clone, Debug)]
18590 pub struct ListZoneActions(RequestBuilder<crate::model::ListZoneActionsRequest>);
18591
18592 impl ListZoneActions {
18593 pub(crate) fn new(
18594 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18595 ) -> Self {
18596 Self(RequestBuilder::new(stub))
18597 }
18598
18599 pub fn with_request<V: Into<crate::model::ListZoneActionsRequest>>(mut self, v: V) -> Self {
18601 self.0.request = v.into();
18602 self
18603 }
18604
18605 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18607 self.0.options = v.into();
18608 self
18609 }
18610
18611 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
18613 (*self.0.stub)
18614 .list_zone_actions(self.0.request, self.0.options)
18615 .await
18616 .map(crate::Response::into_body)
18617 }
18618
18619 pub fn by_page(
18621 self,
18622 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
18623 {
18624 use std::clone::Clone;
18625 let token = self.0.request.page_token.clone();
18626 let execute = move |token: String| {
18627 let mut builder = self.clone();
18628 builder.0.request = builder.0.request.set_page_token(token);
18629 builder.send()
18630 };
18631 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18632 }
18633
18634 pub fn by_item(
18636 self,
18637 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18638 crate::model::ListActionsResponse,
18639 crate::Error,
18640 > {
18641 use google_cloud_gax::paginator::Paginator;
18642 self.by_page().items()
18643 }
18644
18645 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18649 self.0.request.parent = v.into();
18650 self
18651 }
18652
18653 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18655 self.0.request.page_size = v.into();
18656 self
18657 }
18658
18659 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18661 self.0.request.page_token = v.into();
18662 self
18663 }
18664 }
18665
18666 #[doc(hidden)]
18667 impl crate::RequestBuilder for ListZoneActions {
18668 fn request_options(&mut self) -> &mut crate::RequestOptions {
18669 &mut self.0.options
18670 }
18671 }
18672
18673 #[derive(Clone, Debug)]
18691 pub struct CreateAsset(RequestBuilder<crate::model::CreateAssetRequest>);
18692
18693 impl CreateAsset {
18694 pub(crate) fn new(
18695 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18696 ) -> Self {
18697 Self(RequestBuilder::new(stub))
18698 }
18699
18700 pub fn with_request<V: Into<crate::model::CreateAssetRequest>>(mut self, v: V) -> Self {
18702 self.0.request = v.into();
18703 self
18704 }
18705
18706 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18708 self.0.options = v.into();
18709 self
18710 }
18711
18712 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18719 (*self.0.stub)
18720 .create_asset(self.0.request, self.0.options)
18721 .await
18722 .map(crate::Response::into_body)
18723 }
18724
18725 pub fn poller(
18727 self,
18728 ) -> impl google_cloud_lro::Poller<crate::model::Asset, crate::model::OperationMetadata>
18729 {
18730 type Operation = google_cloud_lro::internal::Operation<
18731 crate::model::Asset,
18732 crate::model::OperationMetadata,
18733 >;
18734 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18735 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18736
18737 let stub = self.0.stub.clone();
18738 let mut options = self.0.options.clone();
18739 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18740 let query = move |name| {
18741 let stub = stub.clone();
18742 let options = options.clone();
18743 async {
18744 let op = GetOperation::new(stub)
18745 .set_name(name)
18746 .with_options(options)
18747 .send()
18748 .await?;
18749 Ok(Operation::new(op))
18750 }
18751 };
18752
18753 let start = move || async {
18754 let op = self.send().await?;
18755 Ok(Operation::new(op))
18756 };
18757
18758 google_cloud_lro::internal::new_poller(
18759 polling_error_policy,
18760 polling_backoff_policy,
18761 start,
18762 query,
18763 )
18764 }
18765
18766 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18770 self.0.request.parent = v.into();
18771 self
18772 }
18773
18774 pub fn set_asset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18778 self.0.request.asset_id = v.into();
18779 self
18780 }
18781
18782 pub fn set_asset<T>(mut self, v: T) -> Self
18786 where
18787 T: std::convert::Into<crate::model::Asset>,
18788 {
18789 self.0.request.asset = std::option::Option::Some(v.into());
18790 self
18791 }
18792
18793 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
18797 where
18798 T: std::convert::Into<crate::model::Asset>,
18799 {
18800 self.0.request.asset = v.map(|x| x.into());
18801 self
18802 }
18803
18804 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
18806 self.0.request.validate_only = v.into();
18807 self
18808 }
18809 }
18810
18811 #[doc(hidden)]
18812 impl crate::RequestBuilder for CreateAsset {
18813 fn request_options(&mut self) -> &mut crate::RequestOptions {
18814 &mut self.0.options
18815 }
18816 }
18817
18818 #[derive(Clone, Debug)]
18836 pub struct UpdateAsset(RequestBuilder<crate::model::UpdateAssetRequest>);
18837
18838 impl UpdateAsset {
18839 pub(crate) fn new(
18840 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18841 ) -> Self {
18842 Self(RequestBuilder::new(stub))
18843 }
18844
18845 pub fn with_request<V: Into<crate::model::UpdateAssetRequest>>(mut self, v: V) -> Self {
18847 self.0.request = v.into();
18848 self
18849 }
18850
18851 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18853 self.0.options = v.into();
18854 self
18855 }
18856
18857 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18864 (*self.0.stub)
18865 .update_asset(self.0.request, self.0.options)
18866 .await
18867 .map(crate::Response::into_body)
18868 }
18869
18870 pub fn poller(
18872 self,
18873 ) -> impl google_cloud_lro::Poller<crate::model::Asset, crate::model::OperationMetadata>
18874 {
18875 type Operation = google_cloud_lro::internal::Operation<
18876 crate::model::Asset,
18877 crate::model::OperationMetadata,
18878 >;
18879 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18880 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18881
18882 let stub = self.0.stub.clone();
18883 let mut options = self.0.options.clone();
18884 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18885 let query = move |name| {
18886 let stub = stub.clone();
18887 let options = options.clone();
18888 async {
18889 let op = GetOperation::new(stub)
18890 .set_name(name)
18891 .with_options(options)
18892 .send()
18893 .await?;
18894 Ok(Operation::new(op))
18895 }
18896 };
18897
18898 let start = move || async {
18899 let op = self.send().await?;
18900 Ok(Operation::new(op))
18901 };
18902
18903 google_cloud_lro::internal::new_poller(
18904 polling_error_policy,
18905 polling_backoff_policy,
18906 start,
18907 query,
18908 )
18909 }
18910
18911 pub fn set_update_mask<T>(mut self, v: T) -> Self
18915 where
18916 T: std::convert::Into<wkt::FieldMask>,
18917 {
18918 self.0.request.update_mask = std::option::Option::Some(v.into());
18919 self
18920 }
18921
18922 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18926 where
18927 T: std::convert::Into<wkt::FieldMask>,
18928 {
18929 self.0.request.update_mask = v.map(|x| x.into());
18930 self
18931 }
18932
18933 pub fn set_asset<T>(mut self, v: T) -> Self
18937 where
18938 T: std::convert::Into<crate::model::Asset>,
18939 {
18940 self.0.request.asset = std::option::Option::Some(v.into());
18941 self
18942 }
18943
18944 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
18948 where
18949 T: std::convert::Into<crate::model::Asset>,
18950 {
18951 self.0.request.asset = v.map(|x| x.into());
18952 self
18953 }
18954
18955 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
18957 self.0.request.validate_only = v.into();
18958 self
18959 }
18960 }
18961
18962 #[doc(hidden)]
18963 impl crate::RequestBuilder for UpdateAsset {
18964 fn request_options(&mut self) -> &mut crate::RequestOptions {
18965 &mut self.0.options
18966 }
18967 }
18968
18969 #[derive(Clone, Debug)]
18987 pub struct DeleteAsset(RequestBuilder<crate::model::DeleteAssetRequest>);
18988
18989 impl DeleteAsset {
18990 pub(crate) fn new(
18991 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18992 ) -> Self {
18993 Self(RequestBuilder::new(stub))
18994 }
18995
18996 pub fn with_request<V: Into<crate::model::DeleteAssetRequest>>(mut self, v: V) -> Self {
18998 self.0.request = v.into();
18999 self
19000 }
19001
19002 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19004 self.0.options = v.into();
19005 self
19006 }
19007
19008 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19015 (*self.0.stub)
19016 .delete_asset(self.0.request, self.0.options)
19017 .await
19018 .map(crate::Response::into_body)
19019 }
19020
19021 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
19023 type Operation =
19024 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
19025 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19026 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19027
19028 let stub = self.0.stub.clone();
19029 let mut options = self.0.options.clone();
19030 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19031 let query = move |name| {
19032 let stub = stub.clone();
19033 let options = options.clone();
19034 async {
19035 let op = GetOperation::new(stub)
19036 .set_name(name)
19037 .with_options(options)
19038 .send()
19039 .await?;
19040 Ok(Operation::new(op))
19041 }
19042 };
19043
19044 let start = move || async {
19045 let op = self.send().await?;
19046 Ok(Operation::new(op))
19047 };
19048
19049 google_cloud_lro::internal::new_unit_response_poller(
19050 polling_error_policy,
19051 polling_backoff_policy,
19052 start,
19053 query,
19054 )
19055 }
19056
19057 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19061 self.0.request.name = v.into();
19062 self
19063 }
19064 }
19065
19066 #[doc(hidden)]
19067 impl crate::RequestBuilder for DeleteAsset {
19068 fn request_options(&mut self) -> &mut crate::RequestOptions {
19069 &mut self.0.options
19070 }
19071 }
19072
19073 #[derive(Clone, Debug)]
19094 pub struct ListAssets(RequestBuilder<crate::model::ListAssetsRequest>);
19095
19096 impl ListAssets {
19097 pub(crate) fn new(
19098 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19099 ) -> Self {
19100 Self(RequestBuilder::new(stub))
19101 }
19102
19103 pub fn with_request<V: Into<crate::model::ListAssetsRequest>>(mut self, v: V) -> Self {
19105 self.0.request = v.into();
19106 self
19107 }
19108
19109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19111 self.0.options = v.into();
19112 self
19113 }
19114
19115 pub async fn send(self) -> Result<crate::model::ListAssetsResponse> {
19117 (*self.0.stub)
19118 .list_assets(self.0.request, self.0.options)
19119 .await
19120 .map(crate::Response::into_body)
19121 }
19122
19123 pub fn by_page(
19125 self,
19126 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListAssetsResponse, crate::Error>
19127 {
19128 use std::clone::Clone;
19129 let token = self.0.request.page_token.clone();
19130 let execute = move |token: String| {
19131 let mut builder = self.clone();
19132 builder.0.request = builder.0.request.set_page_token(token);
19133 builder.send()
19134 };
19135 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19136 }
19137
19138 pub fn by_item(
19140 self,
19141 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19142 crate::model::ListAssetsResponse,
19143 crate::Error,
19144 > {
19145 use google_cloud_gax::paginator::Paginator;
19146 self.by_page().items()
19147 }
19148
19149 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19153 self.0.request.parent = v.into();
19154 self
19155 }
19156
19157 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19159 self.0.request.page_size = v.into();
19160 self
19161 }
19162
19163 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19165 self.0.request.page_token = v.into();
19166 self
19167 }
19168
19169 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19171 self.0.request.filter = v.into();
19172 self
19173 }
19174
19175 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
19177 self.0.request.order_by = v.into();
19178 self
19179 }
19180 }
19181
19182 #[doc(hidden)]
19183 impl crate::RequestBuilder for ListAssets {
19184 fn request_options(&mut self) -> &mut crate::RequestOptions {
19185 &mut self.0.options
19186 }
19187 }
19188
19189 #[derive(Clone, Debug)]
19206 pub struct GetAsset(RequestBuilder<crate::model::GetAssetRequest>);
19207
19208 impl GetAsset {
19209 pub(crate) fn new(
19210 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19211 ) -> Self {
19212 Self(RequestBuilder::new(stub))
19213 }
19214
19215 pub fn with_request<V: Into<crate::model::GetAssetRequest>>(mut self, v: V) -> Self {
19217 self.0.request = v.into();
19218 self
19219 }
19220
19221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19223 self.0.options = v.into();
19224 self
19225 }
19226
19227 pub async fn send(self) -> Result<crate::model::Asset> {
19229 (*self.0.stub)
19230 .get_asset(self.0.request, self.0.options)
19231 .await
19232 .map(crate::Response::into_body)
19233 }
19234
19235 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19239 self.0.request.name = v.into();
19240 self
19241 }
19242 }
19243
19244 #[doc(hidden)]
19245 impl crate::RequestBuilder for GetAsset {
19246 fn request_options(&mut self) -> &mut crate::RequestOptions {
19247 &mut self.0.options
19248 }
19249 }
19250
19251 #[derive(Clone, Debug)]
19272 pub struct ListAssetActions(RequestBuilder<crate::model::ListAssetActionsRequest>);
19273
19274 impl ListAssetActions {
19275 pub(crate) fn new(
19276 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19277 ) -> Self {
19278 Self(RequestBuilder::new(stub))
19279 }
19280
19281 pub fn with_request<V: Into<crate::model::ListAssetActionsRequest>>(
19283 mut self,
19284 v: V,
19285 ) -> Self {
19286 self.0.request = v.into();
19287 self
19288 }
19289
19290 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19292 self.0.options = v.into();
19293 self
19294 }
19295
19296 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
19298 (*self.0.stub)
19299 .list_asset_actions(self.0.request, self.0.options)
19300 .await
19301 .map(crate::Response::into_body)
19302 }
19303
19304 pub fn by_page(
19306 self,
19307 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
19308 {
19309 use std::clone::Clone;
19310 let token = self.0.request.page_token.clone();
19311 let execute = move |token: String| {
19312 let mut builder = self.clone();
19313 builder.0.request = builder.0.request.set_page_token(token);
19314 builder.send()
19315 };
19316 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19317 }
19318
19319 pub fn by_item(
19321 self,
19322 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19323 crate::model::ListActionsResponse,
19324 crate::Error,
19325 > {
19326 use google_cloud_gax::paginator::Paginator;
19327 self.by_page().items()
19328 }
19329
19330 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19334 self.0.request.parent = v.into();
19335 self
19336 }
19337
19338 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19340 self.0.request.page_size = v.into();
19341 self
19342 }
19343
19344 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19346 self.0.request.page_token = v.into();
19347 self
19348 }
19349 }
19350
19351 #[doc(hidden)]
19352 impl crate::RequestBuilder for ListAssetActions {
19353 fn request_options(&mut self) -> &mut crate::RequestOptions {
19354 &mut self.0.options
19355 }
19356 }
19357
19358 #[derive(Clone, Debug)]
19376 pub struct CreateTask(RequestBuilder<crate::model::CreateTaskRequest>);
19377
19378 impl CreateTask {
19379 pub(crate) fn new(
19380 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19381 ) -> Self {
19382 Self(RequestBuilder::new(stub))
19383 }
19384
19385 pub fn with_request<V: Into<crate::model::CreateTaskRequest>>(mut self, v: V) -> Self {
19387 self.0.request = v.into();
19388 self
19389 }
19390
19391 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19393 self.0.options = v.into();
19394 self
19395 }
19396
19397 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19404 (*self.0.stub)
19405 .create_task(self.0.request, self.0.options)
19406 .await
19407 .map(crate::Response::into_body)
19408 }
19409
19410 pub fn poller(
19412 self,
19413 ) -> impl google_cloud_lro::Poller<crate::model::Task, crate::model::OperationMetadata>
19414 {
19415 type Operation = google_cloud_lro::internal::Operation<
19416 crate::model::Task,
19417 crate::model::OperationMetadata,
19418 >;
19419 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19420 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19421
19422 let stub = self.0.stub.clone();
19423 let mut options = self.0.options.clone();
19424 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19425 let query = move |name| {
19426 let stub = stub.clone();
19427 let options = options.clone();
19428 async {
19429 let op = GetOperation::new(stub)
19430 .set_name(name)
19431 .with_options(options)
19432 .send()
19433 .await?;
19434 Ok(Operation::new(op))
19435 }
19436 };
19437
19438 let start = move || async {
19439 let op = self.send().await?;
19440 Ok(Operation::new(op))
19441 };
19442
19443 google_cloud_lro::internal::new_poller(
19444 polling_error_policy,
19445 polling_backoff_policy,
19446 start,
19447 query,
19448 )
19449 }
19450
19451 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19455 self.0.request.parent = v.into();
19456 self
19457 }
19458
19459 pub fn set_task_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19463 self.0.request.task_id = v.into();
19464 self
19465 }
19466
19467 pub fn set_task<T>(mut self, v: T) -> Self
19471 where
19472 T: std::convert::Into<crate::model::Task>,
19473 {
19474 self.0.request.task = std::option::Option::Some(v.into());
19475 self
19476 }
19477
19478 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
19482 where
19483 T: std::convert::Into<crate::model::Task>,
19484 {
19485 self.0.request.task = v.map(|x| x.into());
19486 self
19487 }
19488
19489 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
19491 self.0.request.validate_only = v.into();
19492 self
19493 }
19494 }
19495
19496 #[doc(hidden)]
19497 impl crate::RequestBuilder for CreateTask {
19498 fn request_options(&mut self) -> &mut crate::RequestOptions {
19499 &mut self.0.options
19500 }
19501 }
19502
19503 #[derive(Clone, Debug)]
19521 pub struct UpdateTask(RequestBuilder<crate::model::UpdateTaskRequest>);
19522
19523 impl UpdateTask {
19524 pub(crate) fn new(
19525 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19526 ) -> Self {
19527 Self(RequestBuilder::new(stub))
19528 }
19529
19530 pub fn with_request<V: Into<crate::model::UpdateTaskRequest>>(mut self, v: V) -> Self {
19532 self.0.request = v.into();
19533 self
19534 }
19535
19536 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19538 self.0.options = v.into();
19539 self
19540 }
19541
19542 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19549 (*self.0.stub)
19550 .update_task(self.0.request, self.0.options)
19551 .await
19552 .map(crate::Response::into_body)
19553 }
19554
19555 pub fn poller(
19557 self,
19558 ) -> impl google_cloud_lro::Poller<crate::model::Task, crate::model::OperationMetadata>
19559 {
19560 type Operation = google_cloud_lro::internal::Operation<
19561 crate::model::Task,
19562 crate::model::OperationMetadata,
19563 >;
19564 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19565 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19566
19567 let stub = self.0.stub.clone();
19568 let mut options = self.0.options.clone();
19569 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19570 let query = move |name| {
19571 let stub = stub.clone();
19572 let options = options.clone();
19573 async {
19574 let op = GetOperation::new(stub)
19575 .set_name(name)
19576 .with_options(options)
19577 .send()
19578 .await?;
19579 Ok(Operation::new(op))
19580 }
19581 };
19582
19583 let start = move || async {
19584 let op = self.send().await?;
19585 Ok(Operation::new(op))
19586 };
19587
19588 google_cloud_lro::internal::new_poller(
19589 polling_error_policy,
19590 polling_backoff_policy,
19591 start,
19592 query,
19593 )
19594 }
19595
19596 pub fn set_update_mask<T>(mut self, v: T) -> Self
19600 where
19601 T: std::convert::Into<wkt::FieldMask>,
19602 {
19603 self.0.request.update_mask = std::option::Option::Some(v.into());
19604 self
19605 }
19606
19607 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19611 where
19612 T: std::convert::Into<wkt::FieldMask>,
19613 {
19614 self.0.request.update_mask = v.map(|x| x.into());
19615 self
19616 }
19617
19618 pub fn set_task<T>(mut self, v: T) -> Self
19622 where
19623 T: std::convert::Into<crate::model::Task>,
19624 {
19625 self.0.request.task = std::option::Option::Some(v.into());
19626 self
19627 }
19628
19629 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
19633 where
19634 T: std::convert::Into<crate::model::Task>,
19635 {
19636 self.0.request.task = v.map(|x| x.into());
19637 self
19638 }
19639
19640 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
19642 self.0.request.validate_only = v.into();
19643 self
19644 }
19645 }
19646
19647 #[doc(hidden)]
19648 impl crate::RequestBuilder for UpdateTask {
19649 fn request_options(&mut self) -> &mut crate::RequestOptions {
19650 &mut self.0.options
19651 }
19652 }
19653
19654 #[derive(Clone, Debug)]
19672 pub struct DeleteTask(RequestBuilder<crate::model::DeleteTaskRequest>);
19673
19674 impl DeleteTask {
19675 pub(crate) fn new(
19676 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19677 ) -> Self {
19678 Self(RequestBuilder::new(stub))
19679 }
19680
19681 pub fn with_request<V: Into<crate::model::DeleteTaskRequest>>(mut self, v: V) -> Self {
19683 self.0.request = v.into();
19684 self
19685 }
19686
19687 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19689 self.0.options = v.into();
19690 self
19691 }
19692
19693 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19700 (*self.0.stub)
19701 .delete_task(self.0.request, self.0.options)
19702 .await
19703 .map(crate::Response::into_body)
19704 }
19705
19706 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
19708 type Operation =
19709 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
19710 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19711 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19712
19713 let stub = self.0.stub.clone();
19714 let mut options = self.0.options.clone();
19715 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19716 let query = move |name| {
19717 let stub = stub.clone();
19718 let options = options.clone();
19719 async {
19720 let op = GetOperation::new(stub)
19721 .set_name(name)
19722 .with_options(options)
19723 .send()
19724 .await?;
19725 Ok(Operation::new(op))
19726 }
19727 };
19728
19729 let start = move || async {
19730 let op = self.send().await?;
19731 Ok(Operation::new(op))
19732 };
19733
19734 google_cloud_lro::internal::new_unit_response_poller(
19735 polling_error_policy,
19736 polling_backoff_policy,
19737 start,
19738 query,
19739 )
19740 }
19741
19742 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19746 self.0.request.name = v.into();
19747 self
19748 }
19749 }
19750
19751 #[doc(hidden)]
19752 impl crate::RequestBuilder for DeleteTask {
19753 fn request_options(&mut self) -> &mut crate::RequestOptions {
19754 &mut self.0.options
19755 }
19756 }
19757
19758 #[derive(Clone, Debug)]
19779 pub struct ListTasks(RequestBuilder<crate::model::ListTasksRequest>);
19780
19781 impl ListTasks {
19782 pub(crate) fn new(
19783 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19784 ) -> Self {
19785 Self(RequestBuilder::new(stub))
19786 }
19787
19788 pub fn with_request<V: Into<crate::model::ListTasksRequest>>(mut self, v: V) -> Self {
19790 self.0.request = v.into();
19791 self
19792 }
19793
19794 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19796 self.0.options = v.into();
19797 self
19798 }
19799
19800 pub async fn send(self) -> Result<crate::model::ListTasksResponse> {
19802 (*self.0.stub)
19803 .list_tasks(self.0.request, self.0.options)
19804 .await
19805 .map(crate::Response::into_body)
19806 }
19807
19808 pub fn by_page(
19810 self,
19811 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTasksResponse, crate::Error>
19812 {
19813 use std::clone::Clone;
19814 let token = self.0.request.page_token.clone();
19815 let execute = move |token: String| {
19816 let mut builder = self.clone();
19817 builder.0.request = builder.0.request.set_page_token(token);
19818 builder.send()
19819 };
19820 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19821 }
19822
19823 pub fn by_item(
19825 self,
19826 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListTasksResponse, crate::Error>
19827 {
19828 use google_cloud_gax::paginator::Paginator;
19829 self.by_page().items()
19830 }
19831
19832 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19836 self.0.request.parent = v.into();
19837 self
19838 }
19839
19840 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19842 self.0.request.page_size = v.into();
19843 self
19844 }
19845
19846 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19848 self.0.request.page_token = v.into();
19849 self
19850 }
19851
19852 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19854 self.0.request.filter = v.into();
19855 self
19856 }
19857
19858 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
19860 self.0.request.order_by = v.into();
19861 self
19862 }
19863 }
19864
19865 #[doc(hidden)]
19866 impl crate::RequestBuilder for ListTasks {
19867 fn request_options(&mut self) -> &mut crate::RequestOptions {
19868 &mut self.0.options
19869 }
19870 }
19871
19872 #[derive(Clone, Debug)]
19889 pub struct GetTask(RequestBuilder<crate::model::GetTaskRequest>);
19890
19891 impl GetTask {
19892 pub(crate) fn new(
19893 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19894 ) -> Self {
19895 Self(RequestBuilder::new(stub))
19896 }
19897
19898 pub fn with_request<V: Into<crate::model::GetTaskRequest>>(mut self, v: V) -> Self {
19900 self.0.request = v.into();
19901 self
19902 }
19903
19904 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19906 self.0.options = v.into();
19907 self
19908 }
19909
19910 pub async fn send(self) -> Result<crate::model::Task> {
19912 (*self.0.stub)
19913 .get_task(self.0.request, self.0.options)
19914 .await
19915 .map(crate::Response::into_body)
19916 }
19917
19918 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19922 self.0.request.name = v.into();
19923 self
19924 }
19925 }
19926
19927 #[doc(hidden)]
19928 impl crate::RequestBuilder for GetTask {
19929 fn request_options(&mut self) -> &mut crate::RequestOptions {
19930 &mut self.0.options
19931 }
19932 }
19933
19934 #[derive(Clone, Debug)]
19955 pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
19956
19957 impl ListJobs {
19958 pub(crate) fn new(
19959 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19960 ) -> Self {
19961 Self(RequestBuilder::new(stub))
19962 }
19963
19964 pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
19966 self.0.request = v.into();
19967 self
19968 }
19969
19970 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19972 self.0.options = v.into();
19973 self
19974 }
19975
19976 pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
19978 (*self.0.stub)
19979 .list_jobs(self.0.request, self.0.options)
19980 .await
19981 .map(crate::Response::into_body)
19982 }
19983
19984 pub fn by_page(
19986 self,
19987 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListJobsResponse, crate::Error>
19988 {
19989 use std::clone::Clone;
19990 let token = self.0.request.page_token.clone();
19991 let execute = move |token: String| {
19992 let mut builder = self.clone();
19993 builder.0.request = builder.0.request.set_page_token(token);
19994 builder.send()
19995 };
19996 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19997 }
19998
19999 pub fn by_item(
20001 self,
20002 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListJobsResponse, crate::Error>
20003 {
20004 use google_cloud_gax::paginator::Paginator;
20005 self.by_page().items()
20006 }
20007
20008 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20012 self.0.request.parent = v.into();
20013 self
20014 }
20015
20016 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20018 self.0.request.page_size = v.into();
20019 self
20020 }
20021
20022 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20024 self.0.request.page_token = v.into();
20025 self
20026 }
20027 }
20028
20029 #[doc(hidden)]
20030 impl crate::RequestBuilder for ListJobs {
20031 fn request_options(&mut self) -> &mut crate::RequestOptions {
20032 &mut self.0.options
20033 }
20034 }
20035
20036 #[derive(Clone, Debug)]
20053 pub struct RunTask(RequestBuilder<crate::model::RunTaskRequest>);
20054
20055 impl RunTask {
20056 pub(crate) fn new(
20057 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20058 ) -> Self {
20059 Self(RequestBuilder::new(stub))
20060 }
20061
20062 pub fn with_request<V: Into<crate::model::RunTaskRequest>>(mut self, v: V) -> Self {
20064 self.0.request = v.into();
20065 self
20066 }
20067
20068 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20070 self.0.options = v.into();
20071 self
20072 }
20073
20074 pub async fn send(self) -> Result<crate::model::RunTaskResponse> {
20076 (*self.0.stub)
20077 .run_task(self.0.request, self.0.options)
20078 .await
20079 .map(crate::Response::into_body)
20080 }
20081
20082 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20086 self.0.request.name = v.into();
20087 self
20088 }
20089
20090 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
20092 where
20093 T: std::iter::IntoIterator<Item = (K, V)>,
20094 K: std::convert::Into<std::string::String>,
20095 V: std::convert::Into<std::string::String>,
20096 {
20097 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20098 self
20099 }
20100
20101 pub fn set_args<T, K, V>(mut self, v: T) -> Self
20103 where
20104 T: std::iter::IntoIterator<Item = (K, V)>,
20105 K: std::convert::Into<std::string::String>,
20106 V: std::convert::Into<std::string::String>,
20107 {
20108 self.0.request.args = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20109 self
20110 }
20111 }
20112
20113 #[doc(hidden)]
20114 impl crate::RequestBuilder for RunTask {
20115 fn request_options(&mut self) -> &mut crate::RequestOptions {
20116 &mut self.0.options
20117 }
20118 }
20119
20120 #[derive(Clone, Debug)]
20137 pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
20138
20139 impl GetJob {
20140 pub(crate) fn new(
20141 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20142 ) -> Self {
20143 Self(RequestBuilder::new(stub))
20144 }
20145
20146 pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
20148 self.0.request = v.into();
20149 self
20150 }
20151
20152 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20154 self.0.options = v.into();
20155 self
20156 }
20157
20158 pub async fn send(self) -> Result<crate::model::Job> {
20160 (*self.0.stub)
20161 .get_job(self.0.request, self.0.options)
20162 .await
20163 .map(crate::Response::into_body)
20164 }
20165
20166 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20170 self.0.request.name = v.into();
20171 self
20172 }
20173 }
20174
20175 #[doc(hidden)]
20176 impl crate::RequestBuilder for GetJob {
20177 fn request_options(&mut self) -> &mut crate::RequestOptions {
20178 &mut self.0.options
20179 }
20180 }
20181
20182 #[derive(Clone, Debug)]
20199 pub struct CancelJob(RequestBuilder<crate::model::CancelJobRequest>);
20200
20201 impl CancelJob {
20202 pub(crate) fn new(
20203 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20204 ) -> Self {
20205 Self(RequestBuilder::new(stub))
20206 }
20207
20208 pub fn with_request<V: Into<crate::model::CancelJobRequest>>(mut self, v: V) -> Self {
20210 self.0.request = v.into();
20211 self
20212 }
20213
20214 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20216 self.0.options = v.into();
20217 self
20218 }
20219
20220 pub async fn send(self) -> Result<()> {
20222 (*self.0.stub)
20223 .cancel_job(self.0.request, self.0.options)
20224 .await
20225 .map(crate::Response::into_body)
20226 }
20227
20228 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20232 self.0.request.name = v.into();
20233 self
20234 }
20235 }
20236
20237 #[doc(hidden)]
20238 impl crate::RequestBuilder for CancelJob {
20239 fn request_options(&mut self) -> &mut crate::RequestOptions {
20240 &mut self.0.options
20241 }
20242 }
20243
20244 #[derive(Clone, Debug)]
20265 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20266
20267 impl ListLocations {
20268 pub(crate) fn new(
20269 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20270 ) -> Self {
20271 Self(RequestBuilder::new(stub))
20272 }
20273
20274 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
20276 mut self,
20277 v: V,
20278 ) -> Self {
20279 self.0.request = v.into();
20280 self
20281 }
20282
20283 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20285 self.0.options = v.into();
20286 self
20287 }
20288
20289 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
20291 (*self.0.stub)
20292 .list_locations(self.0.request, self.0.options)
20293 .await
20294 .map(crate::Response::into_body)
20295 }
20296
20297 pub fn by_page(
20299 self,
20300 ) -> impl google_cloud_gax::paginator::Paginator<
20301 google_cloud_location::model::ListLocationsResponse,
20302 crate::Error,
20303 > {
20304 use std::clone::Clone;
20305 let token = self.0.request.page_token.clone();
20306 let execute = move |token: String| {
20307 let mut builder = self.clone();
20308 builder.0.request = builder.0.request.set_page_token(token);
20309 builder.send()
20310 };
20311 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20312 }
20313
20314 pub fn by_item(
20316 self,
20317 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20318 google_cloud_location::model::ListLocationsResponse,
20319 crate::Error,
20320 > {
20321 use google_cloud_gax::paginator::Paginator;
20322 self.by_page().items()
20323 }
20324
20325 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20327 self.0.request.name = v.into();
20328 self
20329 }
20330
20331 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20333 self.0.request.filter = v.into();
20334 self
20335 }
20336
20337 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20339 self.0.request.page_size = v.into();
20340 self
20341 }
20342
20343 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20345 self.0.request.page_token = v.into();
20346 self
20347 }
20348 }
20349
20350 #[doc(hidden)]
20351 impl crate::RequestBuilder for ListLocations {
20352 fn request_options(&mut self) -> &mut crate::RequestOptions {
20353 &mut self.0.options
20354 }
20355 }
20356
20357 #[derive(Clone, Debug)]
20374 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
20375
20376 impl GetLocation {
20377 pub(crate) fn new(
20378 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20379 ) -> Self {
20380 Self(RequestBuilder::new(stub))
20381 }
20382
20383 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
20385 mut self,
20386 v: V,
20387 ) -> Self {
20388 self.0.request = v.into();
20389 self
20390 }
20391
20392 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20394 self.0.options = v.into();
20395 self
20396 }
20397
20398 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
20400 (*self.0.stub)
20401 .get_location(self.0.request, self.0.options)
20402 .await
20403 .map(crate::Response::into_body)
20404 }
20405
20406 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20408 self.0.request.name = v.into();
20409 self
20410 }
20411 }
20412
20413 #[doc(hidden)]
20414 impl crate::RequestBuilder for GetLocation {
20415 fn request_options(&mut self) -> &mut crate::RequestOptions {
20416 &mut self.0.options
20417 }
20418 }
20419
20420 #[derive(Clone, Debug)]
20437 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
20438
20439 impl SetIamPolicy {
20440 pub(crate) fn new(
20441 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20442 ) -> Self {
20443 Self(RequestBuilder::new(stub))
20444 }
20445
20446 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
20448 mut self,
20449 v: V,
20450 ) -> Self {
20451 self.0.request = v.into();
20452 self
20453 }
20454
20455 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20457 self.0.options = v.into();
20458 self
20459 }
20460
20461 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
20463 (*self.0.stub)
20464 .set_iam_policy(self.0.request, self.0.options)
20465 .await
20466 .map(crate::Response::into_body)
20467 }
20468
20469 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20473 self.0.request.resource = v.into();
20474 self
20475 }
20476
20477 pub fn set_policy<T>(mut self, v: T) -> Self
20481 where
20482 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
20483 {
20484 self.0.request.policy = std::option::Option::Some(v.into());
20485 self
20486 }
20487
20488 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
20492 where
20493 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
20494 {
20495 self.0.request.policy = v.map(|x| x.into());
20496 self
20497 }
20498
20499 pub fn set_update_mask<T>(mut self, v: T) -> Self
20501 where
20502 T: std::convert::Into<wkt::FieldMask>,
20503 {
20504 self.0.request.update_mask = std::option::Option::Some(v.into());
20505 self
20506 }
20507
20508 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20510 where
20511 T: std::convert::Into<wkt::FieldMask>,
20512 {
20513 self.0.request.update_mask = v.map(|x| x.into());
20514 self
20515 }
20516 }
20517
20518 #[doc(hidden)]
20519 impl crate::RequestBuilder for SetIamPolicy {
20520 fn request_options(&mut self) -> &mut crate::RequestOptions {
20521 &mut self.0.options
20522 }
20523 }
20524
20525 #[derive(Clone, Debug)]
20542 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
20543
20544 impl GetIamPolicy {
20545 pub(crate) fn new(
20546 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20547 ) -> Self {
20548 Self(RequestBuilder::new(stub))
20549 }
20550
20551 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
20553 mut self,
20554 v: V,
20555 ) -> Self {
20556 self.0.request = v.into();
20557 self
20558 }
20559
20560 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20562 self.0.options = v.into();
20563 self
20564 }
20565
20566 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
20568 (*self.0.stub)
20569 .get_iam_policy(self.0.request, self.0.options)
20570 .await
20571 .map(crate::Response::into_body)
20572 }
20573
20574 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20578 self.0.request.resource = v.into();
20579 self
20580 }
20581
20582 pub fn set_options<T>(mut self, v: T) -> Self
20584 where
20585 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
20586 {
20587 self.0.request.options = std::option::Option::Some(v.into());
20588 self
20589 }
20590
20591 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
20593 where
20594 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
20595 {
20596 self.0.request.options = v.map(|x| x.into());
20597 self
20598 }
20599 }
20600
20601 #[doc(hidden)]
20602 impl crate::RequestBuilder for GetIamPolicy {
20603 fn request_options(&mut self) -> &mut crate::RequestOptions {
20604 &mut self.0.options
20605 }
20606 }
20607
20608 #[derive(Clone, Debug)]
20625 pub struct TestIamPermissions(
20626 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
20627 );
20628
20629 impl TestIamPermissions {
20630 pub(crate) fn new(
20631 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20632 ) -> Self {
20633 Self(RequestBuilder::new(stub))
20634 }
20635
20636 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
20638 mut self,
20639 v: V,
20640 ) -> Self {
20641 self.0.request = v.into();
20642 self
20643 }
20644
20645 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20647 self.0.options = v.into();
20648 self
20649 }
20650
20651 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
20653 (*self.0.stub)
20654 .test_iam_permissions(self.0.request, self.0.options)
20655 .await
20656 .map(crate::Response::into_body)
20657 }
20658
20659 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20663 self.0.request.resource = v.into();
20664 self
20665 }
20666
20667 pub fn set_permissions<T, V>(mut self, v: T) -> Self
20671 where
20672 T: std::iter::IntoIterator<Item = V>,
20673 V: std::convert::Into<std::string::String>,
20674 {
20675 use std::iter::Iterator;
20676 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
20677 self
20678 }
20679 }
20680
20681 #[doc(hidden)]
20682 impl crate::RequestBuilder for TestIamPermissions {
20683 fn request_options(&mut self) -> &mut crate::RequestOptions {
20684 &mut self.0.options
20685 }
20686 }
20687
20688 #[derive(Clone, Debug)]
20709 pub struct ListOperations(
20710 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
20711 );
20712
20713 impl ListOperations {
20714 pub(crate) fn new(
20715 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20716 ) -> Self {
20717 Self(RequestBuilder::new(stub))
20718 }
20719
20720 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
20722 mut self,
20723 v: V,
20724 ) -> Self {
20725 self.0.request = v.into();
20726 self
20727 }
20728
20729 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20731 self.0.options = v.into();
20732 self
20733 }
20734
20735 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
20737 (*self.0.stub)
20738 .list_operations(self.0.request, self.0.options)
20739 .await
20740 .map(crate::Response::into_body)
20741 }
20742
20743 pub fn by_page(
20745 self,
20746 ) -> impl google_cloud_gax::paginator::Paginator<
20747 google_cloud_longrunning::model::ListOperationsResponse,
20748 crate::Error,
20749 > {
20750 use std::clone::Clone;
20751 let token = self.0.request.page_token.clone();
20752 let execute = move |token: String| {
20753 let mut builder = self.clone();
20754 builder.0.request = builder.0.request.set_page_token(token);
20755 builder.send()
20756 };
20757 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20758 }
20759
20760 pub fn by_item(
20762 self,
20763 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20764 google_cloud_longrunning::model::ListOperationsResponse,
20765 crate::Error,
20766 > {
20767 use google_cloud_gax::paginator::Paginator;
20768 self.by_page().items()
20769 }
20770
20771 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20773 self.0.request.name = v.into();
20774 self
20775 }
20776
20777 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20779 self.0.request.filter = v.into();
20780 self
20781 }
20782
20783 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20785 self.0.request.page_size = v.into();
20786 self
20787 }
20788
20789 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20791 self.0.request.page_token = v.into();
20792 self
20793 }
20794
20795 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20797 self.0.request.return_partial_success = v.into();
20798 self
20799 }
20800 }
20801
20802 #[doc(hidden)]
20803 impl crate::RequestBuilder for ListOperations {
20804 fn request_options(&mut self) -> &mut crate::RequestOptions {
20805 &mut self.0.options
20806 }
20807 }
20808
20809 #[derive(Clone, Debug)]
20826 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20827
20828 impl GetOperation {
20829 pub(crate) fn new(
20830 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20831 ) -> Self {
20832 Self(RequestBuilder::new(stub))
20833 }
20834
20835 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20837 mut self,
20838 v: V,
20839 ) -> Self {
20840 self.0.request = v.into();
20841 self
20842 }
20843
20844 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20846 self.0.options = v.into();
20847 self
20848 }
20849
20850 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20852 (*self.0.stub)
20853 .get_operation(self.0.request, self.0.options)
20854 .await
20855 .map(crate::Response::into_body)
20856 }
20857
20858 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20860 self.0.request.name = v.into();
20861 self
20862 }
20863 }
20864
20865 #[doc(hidden)]
20866 impl crate::RequestBuilder for GetOperation {
20867 fn request_options(&mut self) -> &mut crate::RequestOptions {
20868 &mut self.0.options
20869 }
20870 }
20871
20872 #[derive(Clone, Debug)]
20889 pub struct DeleteOperation(
20890 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
20891 );
20892
20893 impl DeleteOperation {
20894 pub(crate) fn new(
20895 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20896 ) -> Self {
20897 Self(RequestBuilder::new(stub))
20898 }
20899
20900 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
20902 mut self,
20903 v: V,
20904 ) -> Self {
20905 self.0.request = v.into();
20906 self
20907 }
20908
20909 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20911 self.0.options = v.into();
20912 self
20913 }
20914
20915 pub async fn send(self) -> Result<()> {
20917 (*self.0.stub)
20918 .delete_operation(self.0.request, self.0.options)
20919 .await
20920 .map(crate::Response::into_body)
20921 }
20922
20923 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20925 self.0.request.name = v.into();
20926 self
20927 }
20928 }
20929
20930 #[doc(hidden)]
20931 impl crate::RequestBuilder for DeleteOperation {
20932 fn request_options(&mut self) -> &mut crate::RequestOptions {
20933 &mut self.0.options
20934 }
20935 }
20936
20937 #[derive(Clone, Debug)]
20954 pub struct CancelOperation(
20955 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20956 );
20957
20958 impl CancelOperation {
20959 pub(crate) fn new(
20960 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20961 ) -> Self {
20962 Self(RequestBuilder::new(stub))
20963 }
20964
20965 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20967 mut self,
20968 v: V,
20969 ) -> Self {
20970 self.0.request = v.into();
20971 self
20972 }
20973
20974 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20976 self.0.options = v.into();
20977 self
20978 }
20979
20980 pub async fn send(self) -> Result<()> {
20982 (*self.0.stub)
20983 .cancel_operation(self.0.request, self.0.options)
20984 .await
20985 .map(crate::Response::into_body)
20986 }
20987
20988 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20990 self.0.request.name = v.into();
20991 self
20992 }
20993 }
20994
20995 #[doc(hidden)]
20996 impl crate::RequestBuilder for CancelOperation {
20997 fn request_options(&mut self) -> &mut crate::RequestOptions {
20998 &mut self.0.options
20999 }
21000 }
21001}