1pub mod business_glossary_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::BusinessGlossaryService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = BusinessGlossaryService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
92 pub struct CreateGlossary(RequestBuilder<crate::model::CreateGlossaryRequest>);
93
94 impl CreateGlossary {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::CreateGlossaryRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
120 (*self.0.stub)
121 .create_glossary(self.0.request, self.0.options)
122 .await
123 .map(crate::Response::into_body)
124 }
125
126 pub fn poller(
128 self,
129 ) -> impl google_cloud_lro::Poller<crate::model::Glossary, crate::model::OperationMetadata>
130 {
131 type Operation = google_cloud_lro::internal::Operation<
132 crate::model::Glossary,
133 crate::model::OperationMetadata,
134 >;
135 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
136 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
137
138 let stub = self.0.stub.clone();
139 let mut options = self.0.options.clone();
140 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
141 let query = move |name| {
142 let stub = stub.clone();
143 let options = options.clone();
144 async {
145 let op = GetOperation::new(stub)
146 .set_name(name)
147 .with_options(options)
148 .send()
149 .await?;
150 Ok(Operation::new(op))
151 }
152 };
153
154 let start = move || async {
155 let op = self.send().await?;
156 Ok(Operation::new(op))
157 };
158
159 google_cloud_lro::internal::new_poller(
160 polling_error_policy,
161 polling_backoff_policy,
162 start,
163 query,
164 )
165 }
166
167 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.parent = v.into();
172 self
173 }
174
175 pub fn set_glossary_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
179 self.0.request.glossary_id = v.into();
180 self
181 }
182
183 pub fn set_glossary<T>(mut self, v: T) -> Self
187 where
188 T: std::convert::Into<crate::model::Glossary>,
189 {
190 self.0.request.glossary = std::option::Option::Some(v.into());
191 self
192 }
193
194 pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
198 where
199 T: std::convert::Into<crate::model::Glossary>,
200 {
201 self.0.request.glossary = v.map(|x| x.into());
202 self
203 }
204
205 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
207 self.0.request.validate_only = v.into();
208 self
209 }
210 }
211
212 #[doc(hidden)]
213 impl crate::RequestBuilder for CreateGlossary {
214 fn request_options(&mut self) -> &mut crate::RequestOptions {
215 &mut self.0.options
216 }
217 }
218
219 #[derive(Clone, Debug)]
237 pub struct UpdateGlossary(RequestBuilder<crate::model::UpdateGlossaryRequest>);
238
239 impl UpdateGlossary {
240 pub(crate) fn new(
241 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
242 ) -> Self {
243 Self(RequestBuilder::new(stub))
244 }
245
246 pub fn with_request<V: Into<crate::model::UpdateGlossaryRequest>>(mut self, v: V) -> Self {
248 self.0.request = v.into();
249 self
250 }
251
252 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
254 self.0.options = v.into();
255 self
256 }
257
258 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
265 (*self.0.stub)
266 .update_glossary(self.0.request, self.0.options)
267 .await
268 .map(crate::Response::into_body)
269 }
270
271 pub fn poller(
273 self,
274 ) -> impl google_cloud_lro::Poller<crate::model::Glossary, crate::model::OperationMetadata>
275 {
276 type Operation = google_cloud_lro::internal::Operation<
277 crate::model::Glossary,
278 crate::model::OperationMetadata,
279 >;
280 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
281 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
282
283 let stub = self.0.stub.clone();
284 let mut options = self.0.options.clone();
285 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
286 let query = move |name| {
287 let stub = stub.clone();
288 let options = options.clone();
289 async {
290 let op = GetOperation::new(stub)
291 .set_name(name)
292 .with_options(options)
293 .send()
294 .await?;
295 Ok(Operation::new(op))
296 }
297 };
298
299 let start = move || async {
300 let op = self.send().await?;
301 Ok(Operation::new(op))
302 };
303
304 google_cloud_lro::internal::new_poller(
305 polling_error_policy,
306 polling_backoff_policy,
307 start,
308 query,
309 )
310 }
311
312 pub fn set_glossary<T>(mut self, v: T) -> Self
316 where
317 T: std::convert::Into<crate::model::Glossary>,
318 {
319 self.0.request.glossary = std::option::Option::Some(v.into());
320 self
321 }
322
323 pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
327 where
328 T: std::convert::Into<crate::model::Glossary>,
329 {
330 self.0.request.glossary = v.map(|x| x.into());
331 self
332 }
333
334 pub fn set_update_mask<T>(mut self, v: T) -> Self
338 where
339 T: std::convert::Into<wkt::FieldMask>,
340 {
341 self.0.request.update_mask = std::option::Option::Some(v.into());
342 self
343 }
344
345 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
349 where
350 T: std::convert::Into<wkt::FieldMask>,
351 {
352 self.0.request.update_mask = v.map(|x| x.into());
353 self
354 }
355
356 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
358 self.0.request.validate_only = v.into();
359 self
360 }
361 }
362
363 #[doc(hidden)]
364 impl crate::RequestBuilder for UpdateGlossary {
365 fn request_options(&mut self) -> &mut crate::RequestOptions {
366 &mut self.0.options
367 }
368 }
369
370 #[derive(Clone, Debug)]
388 pub struct DeleteGlossary(RequestBuilder<crate::model::DeleteGlossaryRequest>);
389
390 impl DeleteGlossary {
391 pub(crate) fn new(
392 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
393 ) -> Self {
394 Self(RequestBuilder::new(stub))
395 }
396
397 pub fn with_request<V: Into<crate::model::DeleteGlossaryRequest>>(mut self, v: V) -> Self {
399 self.0.request = v.into();
400 self
401 }
402
403 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
405 self.0.options = v.into();
406 self
407 }
408
409 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
416 (*self.0.stub)
417 .delete_glossary(self.0.request, self.0.options)
418 .await
419 .map(crate::Response::into_body)
420 }
421
422 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
424 type Operation =
425 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
426 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
427 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
428
429 let stub = self.0.stub.clone();
430 let mut options = self.0.options.clone();
431 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
432 let query = move |name| {
433 let stub = stub.clone();
434 let options = options.clone();
435 async {
436 let op = GetOperation::new(stub)
437 .set_name(name)
438 .with_options(options)
439 .send()
440 .await?;
441 Ok(Operation::new(op))
442 }
443 };
444
445 let start = move || async {
446 let op = self.send().await?;
447 Ok(Operation::new(op))
448 };
449
450 google_cloud_lro::internal::new_unit_response_poller(
451 polling_error_policy,
452 polling_backoff_policy,
453 start,
454 query,
455 )
456 }
457
458 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
462 self.0.request.name = v.into();
463 self
464 }
465
466 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
468 self.0.request.etag = v.into();
469 self
470 }
471 }
472
473 #[doc(hidden)]
474 impl crate::RequestBuilder for DeleteGlossary {
475 fn request_options(&mut self) -> &mut crate::RequestOptions {
476 &mut self.0.options
477 }
478 }
479
480 #[derive(Clone, Debug)]
497 pub struct GetGlossary(RequestBuilder<crate::model::GetGlossaryRequest>);
498
499 impl GetGlossary {
500 pub(crate) fn new(
501 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
502 ) -> Self {
503 Self(RequestBuilder::new(stub))
504 }
505
506 pub fn with_request<V: Into<crate::model::GetGlossaryRequest>>(mut self, v: V) -> Self {
508 self.0.request = v.into();
509 self
510 }
511
512 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
514 self.0.options = v.into();
515 self
516 }
517
518 pub async fn send(self) -> Result<crate::model::Glossary> {
520 (*self.0.stub)
521 .get_glossary(self.0.request, self.0.options)
522 .await
523 .map(crate::Response::into_body)
524 }
525
526 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
530 self.0.request.name = v.into();
531 self
532 }
533 }
534
535 #[doc(hidden)]
536 impl crate::RequestBuilder for GetGlossary {
537 fn request_options(&mut self) -> &mut crate::RequestOptions {
538 &mut self.0.options
539 }
540 }
541
542 #[derive(Clone, Debug)]
563 pub struct ListGlossaries(RequestBuilder<crate::model::ListGlossariesRequest>);
564
565 impl ListGlossaries {
566 pub(crate) fn new(
567 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
568 ) -> Self {
569 Self(RequestBuilder::new(stub))
570 }
571
572 pub fn with_request<V: Into<crate::model::ListGlossariesRequest>>(mut self, v: V) -> Self {
574 self.0.request = v.into();
575 self
576 }
577
578 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
580 self.0.options = v.into();
581 self
582 }
583
584 pub async fn send(self) -> Result<crate::model::ListGlossariesResponse> {
586 (*self.0.stub)
587 .list_glossaries(self.0.request, self.0.options)
588 .await
589 .map(crate::Response::into_body)
590 }
591
592 pub fn by_page(
594 self,
595 ) -> impl google_cloud_gax::paginator::Paginator<
596 crate::model::ListGlossariesResponse,
597 crate::Error,
598 > {
599 use std::clone::Clone;
600 let token = self.0.request.page_token.clone();
601 let execute = move |token: String| {
602 let mut builder = self.clone();
603 builder.0.request = builder.0.request.set_page_token(token);
604 builder.send()
605 };
606 google_cloud_gax::paginator::internal::new_paginator(token, execute)
607 }
608
609 pub fn by_item(
611 self,
612 ) -> impl google_cloud_gax::paginator::ItemPaginator<
613 crate::model::ListGlossariesResponse,
614 crate::Error,
615 > {
616 use google_cloud_gax::paginator::Paginator;
617 self.by_page().items()
618 }
619
620 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
624 self.0.request.parent = v.into();
625 self
626 }
627
628 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
630 self.0.request.page_size = v.into();
631 self
632 }
633
634 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
636 self.0.request.page_token = v.into();
637 self
638 }
639
640 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
642 self.0.request.filter = v.into();
643 self
644 }
645
646 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
648 self.0.request.order_by = v.into();
649 self
650 }
651 }
652
653 #[doc(hidden)]
654 impl crate::RequestBuilder for ListGlossaries {
655 fn request_options(&mut self) -> &mut crate::RequestOptions {
656 &mut self.0.options
657 }
658 }
659
660 #[derive(Clone, Debug)]
677 pub struct CreateGlossaryCategory(RequestBuilder<crate::model::CreateGlossaryCategoryRequest>);
678
679 impl CreateGlossaryCategory {
680 pub(crate) fn new(
681 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
682 ) -> Self {
683 Self(RequestBuilder::new(stub))
684 }
685
686 pub fn with_request<V: Into<crate::model::CreateGlossaryCategoryRequest>>(
688 mut self,
689 v: V,
690 ) -> Self {
691 self.0.request = v.into();
692 self
693 }
694
695 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
697 self.0.options = v.into();
698 self
699 }
700
701 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
703 (*self.0.stub)
704 .create_glossary_category(self.0.request, self.0.options)
705 .await
706 .map(crate::Response::into_body)
707 }
708
709 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
713 self.0.request.parent = v.into();
714 self
715 }
716
717 pub fn set_category_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
721 self.0.request.category_id = v.into();
722 self
723 }
724
725 pub fn set_category<T>(mut self, v: T) -> Self
729 where
730 T: std::convert::Into<crate::model::GlossaryCategory>,
731 {
732 self.0.request.category = std::option::Option::Some(v.into());
733 self
734 }
735
736 pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
740 where
741 T: std::convert::Into<crate::model::GlossaryCategory>,
742 {
743 self.0.request.category = v.map(|x| x.into());
744 self
745 }
746 }
747
748 #[doc(hidden)]
749 impl crate::RequestBuilder for CreateGlossaryCategory {
750 fn request_options(&mut self) -> &mut crate::RequestOptions {
751 &mut self.0.options
752 }
753 }
754
755 #[derive(Clone, Debug)]
772 pub struct UpdateGlossaryCategory(RequestBuilder<crate::model::UpdateGlossaryCategoryRequest>);
773
774 impl UpdateGlossaryCategory {
775 pub(crate) fn new(
776 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
777 ) -> Self {
778 Self(RequestBuilder::new(stub))
779 }
780
781 pub fn with_request<V: Into<crate::model::UpdateGlossaryCategoryRequest>>(
783 mut self,
784 v: V,
785 ) -> Self {
786 self.0.request = v.into();
787 self
788 }
789
790 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
792 self.0.options = v.into();
793 self
794 }
795
796 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
798 (*self.0.stub)
799 .update_glossary_category(self.0.request, self.0.options)
800 .await
801 .map(crate::Response::into_body)
802 }
803
804 pub fn set_category<T>(mut self, v: T) -> Self
808 where
809 T: std::convert::Into<crate::model::GlossaryCategory>,
810 {
811 self.0.request.category = std::option::Option::Some(v.into());
812 self
813 }
814
815 pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
819 where
820 T: std::convert::Into<crate::model::GlossaryCategory>,
821 {
822 self.0.request.category = v.map(|x| x.into());
823 self
824 }
825
826 pub fn set_update_mask<T>(mut self, v: T) -> Self
830 where
831 T: std::convert::Into<wkt::FieldMask>,
832 {
833 self.0.request.update_mask = std::option::Option::Some(v.into());
834 self
835 }
836
837 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
841 where
842 T: std::convert::Into<wkt::FieldMask>,
843 {
844 self.0.request.update_mask = v.map(|x| x.into());
845 self
846 }
847 }
848
849 #[doc(hidden)]
850 impl crate::RequestBuilder for UpdateGlossaryCategory {
851 fn request_options(&mut self) -> &mut crate::RequestOptions {
852 &mut self.0.options
853 }
854 }
855
856 #[derive(Clone, Debug)]
873 pub struct DeleteGlossaryCategory(RequestBuilder<crate::model::DeleteGlossaryCategoryRequest>);
874
875 impl DeleteGlossaryCategory {
876 pub(crate) fn new(
877 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
878 ) -> Self {
879 Self(RequestBuilder::new(stub))
880 }
881
882 pub fn with_request<V: Into<crate::model::DeleteGlossaryCategoryRequest>>(
884 mut self,
885 v: V,
886 ) -> Self {
887 self.0.request = v.into();
888 self
889 }
890
891 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
893 self.0.options = v.into();
894 self
895 }
896
897 pub async fn send(self) -> Result<()> {
899 (*self.0.stub)
900 .delete_glossary_category(self.0.request, self.0.options)
901 .await
902 .map(crate::Response::into_body)
903 }
904
905 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
909 self.0.request.name = v.into();
910 self
911 }
912 }
913
914 #[doc(hidden)]
915 impl crate::RequestBuilder for DeleteGlossaryCategory {
916 fn request_options(&mut self) -> &mut crate::RequestOptions {
917 &mut self.0.options
918 }
919 }
920
921 #[derive(Clone, Debug)]
938 pub struct GetGlossaryCategory(RequestBuilder<crate::model::GetGlossaryCategoryRequest>);
939
940 impl GetGlossaryCategory {
941 pub(crate) fn new(
942 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
943 ) -> Self {
944 Self(RequestBuilder::new(stub))
945 }
946
947 pub fn with_request<V: Into<crate::model::GetGlossaryCategoryRequest>>(
949 mut self,
950 v: V,
951 ) -> Self {
952 self.0.request = v.into();
953 self
954 }
955
956 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
958 self.0.options = v.into();
959 self
960 }
961
962 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
964 (*self.0.stub)
965 .get_glossary_category(self.0.request, self.0.options)
966 .await
967 .map(crate::Response::into_body)
968 }
969
970 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
974 self.0.request.name = v.into();
975 self
976 }
977 }
978
979 #[doc(hidden)]
980 impl crate::RequestBuilder for GetGlossaryCategory {
981 fn request_options(&mut self) -> &mut crate::RequestOptions {
982 &mut self.0.options
983 }
984 }
985
986 #[derive(Clone, Debug)]
1007 pub struct ListGlossaryCategories(RequestBuilder<crate::model::ListGlossaryCategoriesRequest>);
1008
1009 impl ListGlossaryCategories {
1010 pub(crate) fn new(
1011 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1012 ) -> Self {
1013 Self(RequestBuilder::new(stub))
1014 }
1015
1016 pub fn with_request<V: Into<crate::model::ListGlossaryCategoriesRequest>>(
1018 mut self,
1019 v: V,
1020 ) -> Self {
1021 self.0.request = v.into();
1022 self
1023 }
1024
1025 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1027 self.0.options = v.into();
1028 self
1029 }
1030
1031 pub async fn send(self) -> Result<crate::model::ListGlossaryCategoriesResponse> {
1033 (*self.0.stub)
1034 .list_glossary_categories(self.0.request, self.0.options)
1035 .await
1036 .map(crate::Response::into_body)
1037 }
1038
1039 pub fn by_page(
1041 self,
1042 ) -> impl google_cloud_gax::paginator::Paginator<
1043 crate::model::ListGlossaryCategoriesResponse,
1044 crate::Error,
1045 > {
1046 use std::clone::Clone;
1047 let token = self.0.request.page_token.clone();
1048 let execute = move |token: String| {
1049 let mut builder = self.clone();
1050 builder.0.request = builder.0.request.set_page_token(token);
1051 builder.send()
1052 };
1053 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1054 }
1055
1056 pub fn by_item(
1058 self,
1059 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1060 crate::model::ListGlossaryCategoriesResponse,
1061 crate::Error,
1062 > {
1063 use google_cloud_gax::paginator::Paginator;
1064 self.by_page().items()
1065 }
1066
1067 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1071 self.0.request.parent = v.into();
1072 self
1073 }
1074
1075 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1077 self.0.request.page_size = v.into();
1078 self
1079 }
1080
1081 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1083 self.0.request.page_token = v.into();
1084 self
1085 }
1086
1087 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1089 self.0.request.filter = v.into();
1090 self
1091 }
1092
1093 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1095 self.0.request.order_by = v.into();
1096 self
1097 }
1098 }
1099
1100 #[doc(hidden)]
1101 impl crate::RequestBuilder for ListGlossaryCategories {
1102 fn request_options(&mut self) -> &mut crate::RequestOptions {
1103 &mut self.0.options
1104 }
1105 }
1106
1107 #[derive(Clone, Debug)]
1124 pub struct CreateGlossaryTerm(RequestBuilder<crate::model::CreateGlossaryTermRequest>);
1125
1126 impl CreateGlossaryTerm {
1127 pub(crate) fn new(
1128 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1129 ) -> Self {
1130 Self(RequestBuilder::new(stub))
1131 }
1132
1133 pub fn with_request<V: Into<crate::model::CreateGlossaryTermRequest>>(
1135 mut self,
1136 v: V,
1137 ) -> Self {
1138 self.0.request = v.into();
1139 self
1140 }
1141
1142 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1144 self.0.options = v.into();
1145 self
1146 }
1147
1148 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1150 (*self.0.stub)
1151 .create_glossary_term(self.0.request, self.0.options)
1152 .await
1153 .map(crate::Response::into_body)
1154 }
1155
1156 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1160 self.0.request.parent = v.into();
1161 self
1162 }
1163
1164 pub fn set_term_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1168 self.0.request.term_id = v.into();
1169 self
1170 }
1171
1172 pub fn set_term<T>(mut self, v: T) -> Self
1176 where
1177 T: std::convert::Into<crate::model::GlossaryTerm>,
1178 {
1179 self.0.request.term = std::option::Option::Some(v.into());
1180 self
1181 }
1182
1183 pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
1187 where
1188 T: std::convert::Into<crate::model::GlossaryTerm>,
1189 {
1190 self.0.request.term = v.map(|x| x.into());
1191 self
1192 }
1193 }
1194
1195 #[doc(hidden)]
1196 impl crate::RequestBuilder for CreateGlossaryTerm {
1197 fn request_options(&mut self) -> &mut crate::RequestOptions {
1198 &mut self.0.options
1199 }
1200 }
1201
1202 #[derive(Clone, Debug)]
1219 pub struct UpdateGlossaryTerm(RequestBuilder<crate::model::UpdateGlossaryTermRequest>);
1220
1221 impl UpdateGlossaryTerm {
1222 pub(crate) fn new(
1223 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1224 ) -> Self {
1225 Self(RequestBuilder::new(stub))
1226 }
1227
1228 pub fn with_request<V: Into<crate::model::UpdateGlossaryTermRequest>>(
1230 mut self,
1231 v: V,
1232 ) -> Self {
1233 self.0.request = v.into();
1234 self
1235 }
1236
1237 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1239 self.0.options = v.into();
1240 self
1241 }
1242
1243 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1245 (*self.0.stub)
1246 .update_glossary_term(self.0.request, self.0.options)
1247 .await
1248 .map(crate::Response::into_body)
1249 }
1250
1251 pub fn set_term<T>(mut self, v: T) -> Self
1255 where
1256 T: std::convert::Into<crate::model::GlossaryTerm>,
1257 {
1258 self.0.request.term = std::option::Option::Some(v.into());
1259 self
1260 }
1261
1262 pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
1266 where
1267 T: std::convert::Into<crate::model::GlossaryTerm>,
1268 {
1269 self.0.request.term = v.map(|x| x.into());
1270 self
1271 }
1272
1273 pub fn set_update_mask<T>(mut self, v: T) -> Self
1277 where
1278 T: std::convert::Into<wkt::FieldMask>,
1279 {
1280 self.0.request.update_mask = std::option::Option::Some(v.into());
1281 self
1282 }
1283
1284 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1288 where
1289 T: std::convert::Into<wkt::FieldMask>,
1290 {
1291 self.0.request.update_mask = v.map(|x| x.into());
1292 self
1293 }
1294 }
1295
1296 #[doc(hidden)]
1297 impl crate::RequestBuilder for UpdateGlossaryTerm {
1298 fn request_options(&mut self) -> &mut crate::RequestOptions {
1299 &mut self.0.options
1300 }
1301 }
1302
1303 #[derive(Clone, Debug)]
1320 pub struct DeleteGlossaryTerm(RequestBuilder<crate::model::DeleteGlossaryTermRequest>);
1321
1322 impl DeleteGlossaryTerm {
1323 pub(crate) fn new(
1324 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1325 ) -> Self {
1326 Self(RequestBuilder::new(stub))
1327 }
1328
1329 pub fn with_request<V: Into<crate::model::DeleteGlossaryTermRequest>>(
1331 mut self,
1332 v: V,
1333 ) -> Self {
1334 self.0.request = v.into();
1335 self
1336 }
1337
1338 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1340 self.0.options = v.into();
1341 self
1342 }
1343
1344 pub async fn send(self) -> Result<()> {
1346 (*self.0.stub)
1347 .delete_glossary_term(self.0.request, self.0.options)
1348 .await
1349 .map(crate::Response::into_body)
1350 }
1351
1352 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1356 self.0.request.name = v.into();
1357 self
1358 }
1359 }
1360
1361 #[doc(hidden)]
1362 impl crate::RequestBuilder for DeleteGlossaryTerm {
1363 fn request_options(&mut self) -> &mut crate::RequestOptions {
1364 &mut self.0.options
1365 }
1366 }
1367
1368 #[derive(Clone, Debug)]
1385 pub struct GetGlossaryTerm(RequestBuilder<crate::model::GetGlossaryTermRequest>);
1386
1387 impl GetGlossaryTerm {
1388 pub(crate) fn new(
1389 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1390 ) -> Self {
1391 Self(RequestBuilder::new(stub))
1392 }
1393
1394 pub fn with_request<V: Into<crate::model::GetGlossaryTermRequest>>(mut self, v: V) -> Self {
1396 self.0.request = v.into();
1397 self
1398 }
1399
1400 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1402 self.0.options = v.into();
1403 self
1404 }
1405
1406 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1408 (*self.0.stub)
1409 .get_glossary_term(self.0.request, self.0.options)
1410 .await
1411 .map(crate::Response::into_body)
1412 }
1413
1414 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1418 self.0.request.name = v.into();
1419 self
1420 }
1421 }
1422
1423 #[doc(hidden)]
1424 impl crate::RequestBuilder for GetGlossaryTerm {
1425 fn request_options(&mut self) -> &mut crate::RequestOptions {
1426 &mut self.0.options
1427 }
1428 }
1429
1430 #[derive(Clone, Debug)]
1451 pub struct ListGlossaryTerms(RequestBuilder<crate::model::ListGlossaryTermsRequest>);
1452
1453 impl ListGlossaryTerms {
1454 pub(crate) fn new(
1455 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1456 ) -> Self {
1457 Self(RequestBuilder::new(stub))
1458 }
1459
1460 pub fn with_request<V: Into<crate::model::ListGlossaryTermsRequest>>(
1462 mut self,
1463 v: V,
1464 ) -> Self {
1465 self.0.request = v.into();
1466 self
1467 }
1468
1469 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1471 self.0.options = v.into();
1472 self
1473 }
1474
1475 pub async fn send(self) -> Result<crate::model::ListGlossaryTermsResponse> {
1477 (*self.0.stub)
1478 .list_glossary_terms(self.0.request, self.0.options)
1479 .await
1480 .map(crate::Response::into_body)
1481 }
1482
1483 pub fn by_page(
1485 self,
1486 ) -> impl google_cloud_gax::paginator::Paginator<
1487 crate::model::ListGlossaryTermsResponse,
1488 crate::Error,
1489 > {
1490 use std::clone::Clone;
1491 let token = self.0.request.page_token.clone();
1492 let execute = move |token: String| {
1493 let mut builder = self.clone();
1494 builder.0.request = builder.0.request.set_page_token(token);
1495 builder.send()
1496 };
1497 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1498 }
1499
1500 pub fn by_item(
1502 self,
1503 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1504 crate::model::ListGlossaryTermsResponse,
1505 crate::Error,
1506 > {
1507 use google_cloud_gax::paginator::Paginator;
1508 self.by_page().items()
1509 }
1510
1511 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1515 self.0.request.parent = v.into();
1516 self
1517 }
1518
1519 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1521 self.0.request.page_size = v.into();
1522 self
1523 }
1524
1525 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1527 self.0.request.page_token = v.into();
1528 self
1529 }
1530
1531 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1533 self.0.request.filter = v.into();
1534 self
1535 }
1536
1537 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1539 self.0.request.order_by = v.into();
1540 self
1541 }
1542 }
1543
1544 #[doc(hidden)]
1545 impl crate::RequestBuilder for ListGlossaryTerms {
1546 fn request_options(&mut self) -> &mut crate::RequestOptions {
1547 &mut self.0.options
1548 }
1549 }
1550
1551 #[derive(Clone, Debug)]
1572 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1573
1574 impl ListLocations {
1575 pub(crate) fn new(
1576 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1577 ) -> Self {
1578 Self(RequestBuilder::new(stub))
1579 }
1580
1581 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1583 mut self,
1584 v: V,
1585 ) -> Self {
1586 self.0.request = v.into();
1587 self
1588 }
1589
1590 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1592 self.0.options = v.into();
1593 self
1594 }
1595
1596 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1598 (*self.0.stub)
1599 .list_locations(self.0.request, self.0.options)
1600 .await
1601 .map(crate::Response::into_body)
1602 }
1603
1604 pub fn by_page(
1606 self,
1607 ) -> impl google_cloud_gax::paginator::Paginator<
1608 google_cloud_location::model::ListLocationsResponse,
1609 crate::Error,
1610 > {
1611 use std::clone::Clone;
1612 let token = self.0.request.page_token.clone();
1613 let execute = move |token: String| {
1614 let mut builder = self.clone();
1615 builder.0.request = builder.0.request.set_page_token(token);
1616 builder.send()
1617 };
1618 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1619 }
1620
1621 pub fn by_item(
1623 self,
1624 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1625 google_cloud_location::model::ListLocationsResponse,
1626 crate::Error,
1627 > {
1628 use google_cloud_gax::paginator::Paginator;
1629 self.by_page().items()
1630 }
1631
1632 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1634 self.0.request.name = v.into();
1635 self
1636 }
1637
1638 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1640 self.0.request.filter = v.into();
1641 self
1642 }
1643
1644 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1646 self.0.request.page_size = v.into();
1647 self
1648 }
1649
1650 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1652 self.0.request.page_token = v.into();
1653 self
1654 }
1655 }
1656
1657 #[doc(hidden)]
1658 impl crate::RequestBuilder for ListLocations {
1659 fn request_options(&mut self) -> &mut crate::RequestOptions {
1660 &mut self.0.options
1661 }
1662 }
1663
1664 #[derive(Clone, Debug)]
1681 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1682
1683 impl GetLocation {
1684 pub(crate) fn new(
1685 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1686 ) -> Self {
1687 Self(RequestBuilder::new(stub))
1688 }
1689
1690 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1692 mut self,
1693 v: V,
1694 ) -> Self {
1695 self.0.request = v.into();
1696 self
1697 }
1698
1699 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1701 self.0.options = v.into();
1702 self
1703 }
1704
1705 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1707 (*self.0.stub)
1708 .get_location(self.0.request, self.0.options)
1709 .await
1710 .map(crate::Response::into_body)
1711 }
1712
1713 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1715 self.0.request.name = v.into();
1716 self
1717 }
1718 }
1719
1720 #[doc(hidden)]
1721 impl crate::RequestBuilder for GetLocation {
1722 fn request_options(&mut self) -> &mut crate::RequestOptions {
1723 &mut self.0.options
1724 }
1725 }
1726
1727 #[derive(Clone, Debug)]
1744 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1745
1746 impl SetIamPolicy {
1747 pub(crate) fn new(
1748 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1749 ) -> Self {
1750 Self(RequestBuilder::new(stub))
1751 }
1752
1753 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1755 mut self,
1756 v: V,
1757 ) -> Self {
1758 self.0.request = v.into();
1759 self
1760 }
1761
1762 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1764 self.0.options = v.into();
1765 self
1766 }
1767
1768 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1770 (*self.0.stub)
1771 .set_iam_policy(self.0.request, self.0.options)
1772 .await
1773 .map(crate::Response::into_body)
1774 }
1775
1776 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1780 self.0.request.resource = v.into();
1781 self
1782 }
1783
1784 pub fn set_policy<T>(mut self, v: T) -> Self
1788 where
1789 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1790 {
1791 self.0.request.policy = std::option::Option::Some(v.into());
1792 self
1793 }
1794
1795 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1799 where
1800 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1801 {
1802 self.0.request.policy = v.map(|x| x.into());
1803 self
1804 }
1805
1806 pub fn set_update_mask<T>(mut self, v: T) -> Self
1808 where
1809 T: std::convert::Into<wkt::FieldMask>,
1810 {
1811 self.0.request.update_mask = std::option::Option::Some(v.into());
1812 self
1813 }
1814
1815 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1817 where
1818 T: std::convert::Into<wkt::FieldMask>,
1819 {
1820 self.0.request.update_mask = v.map(|x| x.into());
1821 self
1822 }
1823 }
1824
1825 #[doc(hidden)]
1826 impl crate::RequestBuilder for SetIamPolicy {
1827 fn request_options(&mut self) -> &mut crate::RequestOptions {
1828 &mut self.0.options
1829 }
1830 }
1831
1832 #[derive(Clone, Debug)]
1849 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1850
1851 impl GetIamPolicy {
1852 pub(crate) fn new(
1853 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1854 ) -> Self {
1855 Self(RequestBuilder::new(stub))
1856 }
1857
1858 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1860 mut self,
1861 v: V,
1862 ) -> Self {
1863 self.0.request = v.into();
1864 self
1865 }
1866
1867 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1869 self.0.options = v.into();
1870 self
1871 }
1872
1873 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1875 (*self.0.stub)
1876 .get_iam_policy(self.0.request, self.0.options)
1877 .await
1878 .map(crate::Response::into_body)
1879 }
1880
1881 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1885 self.0.request.resource = v.into();
1886 self
1887 }
1888
1889 pub fn set_options<T>(mut self, v: T) -> Self
1891 where
1892 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1893 {
1894 self.0.request.options = std::option::Option::Some(v.into());
1895 self
1896 }
1897
1898 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1900 where
1901 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1902 {
1903 self.0.request.options = v.map(|x| x.into());
1904 self
1905 }
1906 }
1907
1908 #[doc(hidden)]
1909 impl crate::RequestBuilder for GetIamPolicy {
1910 fn request_options(&mut self) -> &mut crate::RequestOptions {
1911 &mut self.0.options
1912 }
1913 }
1914
1915 #[derive(Clone, Debug)]
1932 pub struct TestIamPermissions(
1933 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1934 );
1935
1936 impl TestIamPermissions {
1937 pub(crate) fn new(
1938 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1939 ) -> Self {
1940 Self(RequestBuilder::new(stub))
1941 }
1942
1943 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1945 mut self,
1946 v: V,
1947 ) -> Self {
1948 self.0.request = v.into();
1949 self
1950 }
1951
1952 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1954 self.0.options = v.into();
1955 self
1956 }
1957
1958 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1960 (*self.0.stub)
1961 .test_iam_permissions(self.0.request, self.0.options)
1962 .await
1963 .map(crate::Response::into_body)
1964 }
1965
1966 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1970 self.0.request.resource = v.into();
1971 self
1972 }
1973
1974 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1978 where
1979 T: std::iter::IntoIterator<Item = V>,
1980 V: std::convert::Into<std::string::String>,
1981 {
1982 use std::iter::Iterator;
1983 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1984 self
1985 }
1986 }
1987
1988 #[doc(hidden)]
1989 impl crate::RequestBuilder for TestIamPermissions {
1990 fn request_options(&mut self) -> &mut crate::RequestOptions {
1991 &mut self.0.options
1992 }
1993 }
1994
1995 #[derive(Clone, Debug)]
2016 pub struct ListOperations(
2017 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2018 );
2019
2020 impl ListOperations {
2021 pub(crate) fn new(
2022 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2023 ) -> Self {
2024 Self(RequestBuilder::new(stub))
2025 }
2026
2027 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2029 mut self,
2030 v: V,
2031 ) -> Self {
2032 self.0.request = v.into();
2033 self
2034 }
2035
2036 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2038 self.0.options = v.into();
2039 self
2040 }
2041
2042 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2044 (*self.0.stub)
2045 .list_operations(self.0.request, self.0.options)
2046 .await
2047 .map(crate::Response::into_body)
2048 }
2049
2050 pub fn by_page(
2052 self,
2053 ) -> impl google_cloud_gax::paginator::Paginator<
2054 google_cloud_longrunning::model::ListOperationsResponse,
2055 crate::Error,
2056 > {
2057 use std::clone::Clone;
2058 let token = self.0.request.page_token.clone();
2059 let execute = move |token: String| {
2060 let mut builder = self.clone();
2061 builder.0.request = builder.0.request.set_page_token(token);
2062 builder.send()
2063 };
2064 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2065 }
2066
2067 pub fn by_item(
2069 self,
2070 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2071 google_cloud_longrunning::model::ListOperationsResponse,
2072 crate::Error,
2073 > {
2074 use google_cloud_gax::paginator::Paginator;
2075 self.by_page().items()
2076 }
2077
2078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2080 self.0.request.name = v.into();
2081 self
2082 }
2083
2084 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2086 self.0.request.filter = v.into();
2087 self
2088 }
2089
2090 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2092 self.0.request.page_size = v.into();
2093 self
2094 }
2095
2096 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2098 self.0.request.page_token = v.into();
2099 self
2100 }
2101
2102 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2104 self.0.request.return_partial_success = v.into();
2105 self
2106 }
2107 }
2108
2109 #[doc(hidden)]
2110 impl crate::RequestBuilder for ListOperations {
2111 fn request_options(&mut self) -> &mut crate::RequestOptions {
2112 &mut self.0.options
2113 }
2114 }
2115
2116 #[derive(Clone, Debug)]
2133 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2134
2135 impl GetOperation {
2136 pub(crate) fn new(
2137 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2138 ) -> Self {
2139 Self(RequestBuilder::new(stub))
2140 }
2141
2142 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2144 mut self,
2145 v: V,
2146 ) -> Self {
2147 self.0.request = v.into();
2148 self
2149 }
2150
2151 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2153 self.0.options = v.into();
2154 self
2155 }
2156
2157 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2159 (*self.0.stub)
2160 .get_operation(self.0.request, self.0.options)
2161 .await
2162 .map(crate::Response::into_body)
2163 }
2164
2165 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2167 self.0.request.name = v.into();
2168 self
2169 }
2170 }
2171
2172 #[doc(hidden)]
2173 impl crate::RequestBuilder for GetOperation {
2174 fn request_options(&mut self) -> &mut crate::RequestOptions {
2175 &mut self.0.options
2176 }
2177 }
2178
2179 #[derive(Clone, Debug)]
2196 pub struct DeleteOperation(
2197 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2198 );
2199
2200 impl DeleteOperation {
2201 pub(crate) fn new(
2202 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2203 ) -> Self {
2204 Self(RequestBuilder::new(stub))
2205 }
2206
2207 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2209 mut self,
2210 v: V,
2211 ) -> Self {
2212 self.0.request = v.into();
2213 self
2214 }
2215
2216 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2218 self.0.options = v.into();
2219 self
2220 }
2221
2222 pub async fn send(self) -> Result<()> {
2224 (*self.0.stub)
2225 .delete_operation(self.0.request, self.0.options)
2226 .await
2227 .map(crate::Response::into_body)
2228 }
2229
2230 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2232 self.0.request.name = v.into();
2233 self
2234 }
2235 }
2236
2237 #[doc(hidden)]
2238 impl crate::RequestBuilder for DeleteOperation {
2239 fn request_options(&mut self) -> &mut crate::RequestOptions {
2240 &mut self.0.options
2241 }
2242 }
2243
2244 #[derive(Clone, Debug)]
2261 pub struct CancelOperation(
2262 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2263 );
2264
2265 impl CancelOperation {
2266 pub(crate) fn new(
2267 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2268 ) -> Self {
2269 Self(RequestBuilder::new(stub))
2270 }
2271
2272 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2274 mut self,
2275 v: V,
2276 ) -> Self {
2277 self.0.request = v.into();
2278 self
2279 }
2280
2281 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2283 self.0.options = v.into();
2284 self
2285 }
2286
2287 pub async fn send(self) -> Result<()> {
2289 (*self.0.stub)
2290 .cancel_operation(self.0.request, self.0.options)
2291 .await
2292 .map(crate::Response::into_body)
2293 }
2294
2295 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2297 self.0.request.name = v.into();
2298 self
2299 }
2300 }
2301
2302 #[doc(hidden)]
2303 impl crate::RequestBuilder for CancelOperation {
2304 fn request_options(&mut self) -> &mut crate::RequestOptions {
2305 &mut self.0.options
2306 }
2307 }
2308}
2309
2310pub mod catalog_service {
2312 use crate::Result;
2313
2314 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2328
2329 pub(crate) mod client {
2330 use super::super::super::client::CatalogService;
2331 pub struct Factory;
2332 impl crate::ClientFactory for Factory {
2333 type Client = CatalogService;
2334 type Credentials = gaxi::options::Credentials;
2335 async fn build(
2336 self,
2337 config: gaxi::options::ClientConfig,
2338 ) -> crate::ClientBuilderResult<Self::Client> {
2339 Self::Client::new(config).await
2340 }
2341 }
2342 }
2343
2344 #[derive(Clone, Debug)]
2346 pub(crate) struct RequestBuilder<R: std::default::Default> {
2347 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2348 request: R,
2349 options: crate::RequestOptions,
2350 }
2351
2352 impl<R> RequestBuilder<R>
2353 where
2354 R: std::default::Default,
2355 {
2356 pub(crate) fn new(
2357 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2358 ) -> Self {
2359 Self {
2360 stub,
2361 request: R::default(),
2362 options: crate::RequestOptions::default(),
2363 }
2364 }
2365 }
2366
2367 #[derive(Clone, Debug)]
2385 pub struct CreateEntryType(RequestBuilder<crate::model::CreateEntryTypeRequest>);
2386
2387 impl CreateEntryType {
2388 pub(crate) fn new(
2389 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2390 ) -> Self {
2391 Self(RequestBuilder::new(stub))
2392 }
2393
2394 pub fn with_request<V: Into<crate::model::CreateEntryTypeRequest>>(mut self, v: V) -> Self {
2396 self.0.request = v.into();
2397 self
2398 }
2399
2400 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2402 self.0.options = v.into();
2403 self
2404 }
2405
2406 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2413 (*self.0.stub)
2414 .create_entry_type(self.0.request, self.0.options)
2415 .await
2416 .map(crate::Response::into_body)
2417 }
2418
2419 pub fn poller(
2421 self,
2422 ) -> impl google_cloud_lro::Poller<crate::model::EntryType, crate::model::OperationMetadata>
2423 {
2424 type Operation = google_cloud_lro::internal::Operation<
2425 crate::model::EntryType,
2426 crate::model::OperationMetadata,
2427 >;
2428 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2429 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2430
2431 let stub = self.0.stub.clone();
2432 let mut options = self.0.options.clone();
2433 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2434 let query = move |name| {
2435 let stub = stub.clone();
2436 let options = options.clone();
2437 async {
2438 let op = GetOperation::new(stub)
2439 .set_name(name)
2440 .with_options(options)
2441 .send()
2442 .await?;
2443 Ok(Operation::new(op))
2444 }
2445 };
2446
2447 let start = move || async {
2448 let op = self.send().await?;
2449 Ok(Operation::new(op))
2450 };
2451
2452 google_cloud_lro::internal::new_poller(
2453 polling_error_policy,
2454 polling_backoff_policy,
2455 start,
2456 query,
2457 )
2458 }
2459
2460 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2464 self.0.request.parent = v.into();
2465 self
2466 }
2467
2468 pub fn set_entry_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2472 self.0.request.entry_type_id = v.into();
2473 self
2474 }
2475
2476 pub fn set_entry_type<T>(mut self, v: T) -> Self
2480 where
2481 T: std::convert::Into<crate::model::EntryType>,
2482 {
2483 self.0.request.entry_type = std::option::Option::Some(v.into());
2484 self
2485 }
2486
2487 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
2491 where
2492 T: std::convert::Into<crate::model::EntryType>,
2493 {
2494 self.0.request.entry_type = v.map(|x| x.into());
2495 self
2496 }
2497
2498 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2500 self.0.request.validate_only = v.into();
2501 self
2502 }
2503 }
2504
2505 #[doc(hidden)]
2506 impl crate::RequestBuilder for CreateEntryType {
2507 fn request_options(&mut self) -> &mut crate::RequestOptions {
2508 &mut self.0.options
2509 }
2510 }
2511
2512 #[derive(Clone, Debug)]
2530 pub struct UpdateEntryType(RequestBuilder<crate::model::UpdateEntryTypeRequest>);
2531
2532 impl UpdateEntryType {
2533 pub(crate) fn new(
2534 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2535 ) -> Self {
2536 Self(RequestBuilder::new(stub))
2537 }
2538
2539 pub fn with_request<V: Into<crate::model::UpdateEntryTypeRequest>>(mut self, v: V) -> Self {
2541 self.0.request = v.into();
2542 self
2543 }
2544
2545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2547 self.0.options = v.into();
2548 self
2549 }
2550
2551 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2558 (*self.0.stub)
2559 .update_entry_type(self.0.request, self.0.options)
2560 .await
2561 .map(crate::Response::into_body)
2562 }
2563
2564 pub fn poller(
2566 self,
2567 ) -> impl google_cloud_lro::Poller<crate::model::EntryType, crate::model::OperationMetadata>
2568 {
2569 type Operation = google_cloud_lro::internal::Operation<
2570 crate::model::EntryType,
2571 crate::model::OperationMetadata,
2572 >;
2573 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2574 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2575
2576 let stub = self.0.stub.clone();
2577 let mut options = self.0.options.clone();
2578 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2579 let query = move |name| {
2580 let stub = stub.clone();
2581 let options = options.clone();
2582 async {
2583 let op = GetOperation::new(stub)
2584 .set_name(name)
2585 .with_options(options)
2586 .send()
2587 .await?;
2588 Ok(Operation::new(op))
2589 }
2590 };
2591
2592 let start = move || async {
2593 let op = self.send().await?;
2594 Ok(Operation::new(op))
2595 };
2596
2597 google_cloud_lro::internal::new_poller(
2598 polling_error_policy,
2599 polling_backoff_policy,
2600 start,
2601 query,
2602 )
2603 }
2604
2605 pub fn set_entry_type<T>(mut self, v: T) -> Self
2609 where
2610 T: std::convert::Into<crate::model::EntryType>,
2611 {
2612 self.0.request.entry_type = std::option::Option::Some(v.into());
2613 self
2614 }
2615
2616 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
2620 where
2621 T: std::convert::Into<crate::model::EntryType>,
2622 {
2623 self.0.request.entry_type = v.map(|x| x.into());
2624 self
2625 }
2626
2627 pub fn set_update_mask<T>(mut self, v: T) -> Self
2631 where
2632 T: std::convert::Into<wkt::FieldMask>,
2633 {
2634 self.0.request.update_mask = std::option::Option::Some(v.into());
2635 self
2636 }
2637
2638 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2642 where
2643 T: std::convert::Into<wkt::FieldMask>,
2644 {
2645 self.0.request.update_mask = v.map(|x| x.into());
2646 self
2647 }
2648
2649 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2651 self.0.request.validate_only = v.into();
2652 self
2653 }
2654 }
2655
2656 #[doc(hidden)]
2657 impl crate::RequestBuilder for UpdateEntryType {
2658 fn request_options(&mut self) -> &mut crate::RequestOptions {
2659 &mut self.0.options
2660 }
2661 }
2662
2663 #[derive(Clone, Debug)]
2681 pub struct DeleteEntryType(RequestBuilder<crate::model::DeleteEntryTypeRequest>);
2682
2683 impl DeleteEntryType {
2684 pub(crate) fn new(
2685 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2686 ) -> Self {
2687 Self(RequestBuilder::new(stub))
2688 }
2689
2690 pub fn with_request<V: Into<crate::model::DeleteEntryTypeRequest>>(mut self, v: V) -> Self {
2692 self.0.request = v.into();
2693 self
2694 }
2695
2696 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2698 self.0.options = v.into();
2699 self
2700 }
2701
2702 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2709 (*self.0.stub)
2710 .delete_entry_type(self.0.request, self.0.options)
2711 .await
2712 .map(crate::Response::into_body)
2713 }
2714
2715 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2717 type Operation =
2718 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2719 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2720 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2721
2722 let stub = self.0.stub.clone();
2723 let mut options = self.0.options.clone();
2724 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2725 let query = move |name| {
2726 let stub = stub.clone();
2727 let options = options.clone();
2728 async {
2729 let op = GetOperation::new(stub)
2730 .set_name(name)
2731 .with_options(options)
2732 .send()
2733 .await?;
2734 Ok(Operation::new(op))
2735 }
2736 };
2737
2738 let start = move || async {
2739 let op = self.send().await?;
2740 Ok(Operation::new(op))
2741 };
2742
2743 google_cloud_lro::internal::new_unit_response_poller(
2744 polling_error_policy,
2745 polling_backoff_policy,
2746 start,
2747 query,
2748 )
2749 }
2750
2751 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2755 self.0.request.name = v.into();
2756 self
2757 }
2758
2759 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2761 self.0.request.etag = v.into();
2762 self
2763 }
2764 }
2765
2766 #[doc(hidden)]
2767 impl crate::RequestBuilder for DeleteEntryType {
2768 fn request_options(&mut self) -> &mut crate::RequestOptions {
2769 &mut self.0.options
2770 }
2771 }
2772
2773 #[derive(Clone, Debug)]
2794 pub struct ListEntryTypes(RequestBuilder<crate::model::ListEntryTypesRequest>);
2795
2796 impl ListEntryTypes {
2797 pub(crate) fn new(
2798 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2799 ) -> Self {
2800 Self(RequestBuilder::new(stub))
2801 }
2802
2803 pub fn with_request<V: Into<crate::model::ListEntryTypesRequest>>(mut self, v: V) -> Self {
2805 self.0.request = v.into();
2806 self
2807 }
2808
2809 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2811 self.0.options = v.into();
2812 self
2813 }
2814
2815 pub async fn send(self) -> Result<crate::model::ListEntryTypesResponse> {
2817 (*self.0.stub)
2818 .list_entry_types(self.0.request, self.0.options)
2819 .await
2820 .map(crate::Response::into_body)
2821 }
2822
2823 pub fn by_page(
2825 self,
2826 ) -> impl google_cloud_gax::paginator::Paginator<
2827 crate::model::ListEntryTypesResponse,
2828 crate::Error,
2829 > {
2830 use std::clone::Clone;
2831 let token = self.0.request.page_token.clone();
2832 let execute = move |token: String| {
2833 let mut builder = self.clone();
2834 builder.0.request = builder.0.request.set_page_token(token);
2835 builder.send()
2836 };
2837 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2838 }
2839
2840 pub fn by_item(
2842 self,
2843 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2844 crate::model::ListEntryTypesResponse,
2845 crate::Error,
2846 > {
2847 use google_cloud_gax::paginator::Paginator;
2848 self.by_page().items()
2849 }
2850
2851 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2855 self.0.request.parent = v.into();
2856 self
2857 }
2858
2859 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2861 self.0.request.page_size = v.into();
2862 self
2863 }
2864
2865 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2867 self.0.request.page_token = v.into();
2868 self
2869 }
2870
2871 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2873 self.0.request.filter = v.into();
2874 self
2875 }
2876
2877 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2879 self.0.request.order_by = v.into();
2880 self
2881 }
2882 }
2883
2884 #[doc(hidden)]
2885 impl crate::RequestBuilder for ListEntryTypes {
2886 fn request_options(&mut self) -> &mut crate::RequestOptions {
2887 &mut self.0.options
2888 }
2889 }
2890
2891 #[derive(Clone, Debug)]
2908 pub struct GetEntryType(RequestBuilder<crate::model::GetEntryTypeRequest>);
2909
2910 impl GetEntryType {
2911 pub(crate) fn new(
2912 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2913 ) -> Self {
2914 Self(RequestBuilder::new(stub))
2915 }
2916
2917 pub fn with_request<V: Into<crate::model::GetEntryTypeRequest>>(mut self, v: V) -> Self {
2919 self.0.request = v.into();
2920 self
2921 }
2922
2923 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2925 self.0.options = v.into();
2926 self
2927 }
2928
2929 pub async fn send(self) -> Result<crate::model::EntryType> {
2931 (*self.0.stub)
2932 .get_entry_type(self.0.request, self.0.options)
2933 .await
2934 .map(crate::Response::into_body)
2935 }
2936
2937 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2941 self.0.request.name = v.into();
2942 self
2943 }
2944 }
2945
2946 #[doc(hidden)]
2947 impl crate::RequestBuilder for GetEntryType {
2948 fn request_options(&mut self) -> &mut crate::RequestOptions {
2949 &mut self.0.options
2950 }
2951 }
2952
2953 #[derive(Clone, Debug)]
2971 pub struct CreateAspectType(RequestBuilder<crate::model::CreateAspectTypeRequest>);
2972
2973 impl CreateAspectType {
2974 pub(crate) fn new(
2975 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2976 ) -> Self {
2977 Self(RequestBuilder::new(stub))
2978 }
2979
2980 pub fn with_request<V: Into<crate::model::CreateAspectTypeRequest>>(
2982 mut self,
2983 v: V,
2984 ) -> Self {
2985 self.0.request = v.into();
2986 self
2987 }
2988
2989 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2991 self.0.options = v.into();
2992 self
2993 }
2994
2995 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3002 (*self.0.stub)
3003 .create_aspect_type(self.0.request, self.0.options)
3004 .await
3005 .map(crate::Response::into_body)
3006 }
3007
3008 pub fn poller(
3010 self,
3011 ) -> impl google_cloud_lro::Poller<crate::model::AspectType, crate::model::OperationMetadata>
3012 {
3013 type Operation = google_cloud_lro::internal::Operation<
3014 crate::model::AspectType,
3015 crate::model::OperationMetadata,
3016 >;
3017 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3018 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3019
3020 let stub = self.0.stub.clone();
3021 let mut options = self.0.options.clone();
3022 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3023 let query = move |name| {
3024 let stub = stub.clone();
3025 let options = options.clone();
3026 async {
3027 let op = GetOperation::new(stub)
3028 .set_name(name)
3029 .with_options(options)
3030 .send()
3031 .await?;
3032 Ok(Operation::new(op))
3033 }
3034 };
3035
3036 let start = move || async {
3037 let op = self.send().await?;
3038 Ok(Operation::new(op))
3039 };
3040
3041 google_cloud_lro::internal::new_poller(
3042 polling_error_policy,
3043 polling_backoff_policy,
3044 start,
3045 query,
3046 )
3047 }
3048
3049 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3053 self.0.request.parent = v.into();
3054 self
3055 }
3056
3057 pub fn set_aspect_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3061 self.0.request.aspect_type_id = v.into();
3062 self
3063 }
3064
3065 pub fn set_aspect_type<T>(mut self, v: T) -> Self
3069 where
3070 T: std::convert::Into<crate::model::AspectType>,
3071 {
3072 self.0.request.aspect_type = std::option::Option::Some(v.into());
3073 self
3074 }
3075
3076 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
3080 where
3081 T: std::convert::Into<crate::model::AspectType>,
3082 {
3083 self.0.request.aspect_type = v.map(|x| x.into());
3084 self
3085 }
3086
3087 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3089 self.0.request.validate_only = v.into();
3090 self
3091 }
3092 }
3093
3094 #[doc(hidden)]
3095 impl crate::RequestBuilder for CreateAspectType {
3096 fn request_options(&mut self) -> &mut crate::RequestOptions {
3097 &mut self.0.options
3098 }
3099 }
3100
3101 #[derive(Clone, Debug)]
3119 pub struct UpdateAspectType(RequestBuilder<crate::model::UpdateAspectTypeRequest>);
3120
3121 impl UpdateAspectType {
3122 pub(crate) fn new(
3123 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3124 ) -> Self {
3125 Self(RequestBuilder::new(stub))
3126 }
3127
3128 pub fn with_request<V: Into<crate::model::UpdateAspectTypeRequest>>(
3130 mut self,
3131 v: V,
3132 ) -> Self {
3133 self.0.request = v.into();
3134 self
3135 }
3136
3137 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3139 self.0.options = v.into();
3140 self
3141 }
3142
3143 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3150 (*self.0.stub)
3151 .update_aspect_type(self.0.request, self.0.options)
3152 .await
3153 .map(crate::Response::into_body)
3154 }
3155
3156 pub fn poller(
3158 self,
3159 ) -> impl google_cloud_lro::Poller<crate::model::AspectType, crate::model::OperationMetadata>
3160 {
3161 type Operation = google_cloud_lro::internal::Operation<
3162 crate::model::AspectType,
3163 crate::model::OperationMetadata,
3164 >;
3165 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3166 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3167
3168 let stub = self.0.stub.clone();
3169 let mut options = self.0.options.clone();
3170 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3171 let query = move |name| {
3172 let stub = stub.clone();
3173 let options = options.clone();
3174 async {
3175 let op = GetOperation::new(stub)
3176 .set_name(name)
3177 .with_options(options)
3178 .send()
3179 .await?;
3180 Ok(Operation::new(op))
3181 }
3182 };
3183
3184 let start = move || async {
3185 let op = self.send().await?;
3186 Ok(Operation::new(op))
3187 };
3188
3189 google_cloud_lro::internal::new_poller(
3190 polling_error_policy,
3191 polling_backoff_policy,
3192 start,
3193 query,
3194 )
3195 }
3196
3197 pub fn set_aspect_type<T>(mut self, v: T) -> Self
3201 where
3202 T: std::convert::Into<crate::model::AspectType>,
3203 {
3204 self.0.request.aspect_type = std::option::Option::Some(v.into());
3205 self
3206 }
3207
3208 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
3212 where
3213 T: std::convert::Into<crate::model::AspectType>,
3214 {
3215 self.0.request.aspect_type = v.map(|x| x.into());
3216 self
3217 }
3218
3219 pub fn set_update_mask<T>(mut self, v: T) -> Self
3223 where
3224 T: std::convert::Into<wkt::FieldMask>,
3225 {
3226 self.0.request.update_mask = std::option::Option::Some(v.into());
3227 self
3228 }
3229
3230 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3234 where
3235 T: std::convert::Into<wkt::FieldMask>,
3236 {
3237 self.0.request.update_mask = v.map(|x| x.into());
3238 self
3239 }
3240
3241 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3243 self.0.request.validate_only = v.into();
3244 self
3245 }
3246 }
3247
3248 #[doc(hidden)]
3249 impl crate::RequestBuilder for UpdateAspectType {
3250 fn request_options(&mut self) -> &mut crate::RequestOptions {
3251 &mut self.0.options
3252 }
3253 }
3254
3255 #[derive(Clone, Debug)]
3273 pub struct DeleteAspectType(RequestBuilder<crate::model::DeleteAspectTypeRequest>);
3274
3275 impl DeleteAspectType {
3276 pub(crate) fn new(
3277 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3278 ) -> Self {
3279 Self(RequestBuilder::new(stub))
3280 }
3281
3282 pub fn with_request<V: Into<crate::model::DeleteAspectTypeRequest>>(
3284 mut self,
3285 v: V,
3286 ) -> Self {
3287 self.0.request = v.into();
3288 self
3289 }
3290
3291 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3293 self.0.options = v.into();
3294 self
3295 }
3296
3297 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3304 (*self.0.stub)
3305 .delete_aspect_type(self.0.request, self.0.options)
3306 .await
3307 .map(crate::Response::into_body)
3308 }
3309
3310 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3312 type Operation =
3313 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3314 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3315 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3316
3317 let stub = self.0.stub.clone();
3318 let mut options = self.0.options.clone();
3319 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3320 let query = move |name| {
3321 let stub = stub.clone();
3322 let options = options.clone();
3323 async {
3324 let op = GetOperation::new(stub)
3325 .set_name(name)
3326 .with_options(options)
3327 .send()
3328 .await?;
3329 Ok(Operation::new(op))
3330 }
3331 };
3332
3333 let start = move || async {
3334 let op = self.send().await?;
3335 Ok(Operation::new(op))
3336 };
3337
3338 google_cloud_lro::internal::new_unit_response_poller(
3339 polling_error_policy,
3340 polling_backoff_policy,
3341 start,
3342 query,
3343 )
3344 }
3345
3346 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3350 self.0.request.name = v.into();
3351 self
3352 }
3353
3354 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3356 self.0.request.etag = v.into();
3357 self
3358 }
3359 }
3360
3361 #[doc(hidden)]
3362 impl crate::RequestBuilder for DeleteAspectType {
3363 fn request_options(&mut self) -> &mut crate::RequestOptions {
3364 &mut self.0.options
3365 }
3366 }
3367
3368 #[derive(Clone, Debug)]
3389 pub struct ListAspectTypes(RequestBuilder<crate::model::ListAspectTypesRequest>);
3390
3391 impl ListAspectTypes {
3392 pub(crate) fn new(
3393 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3394 ) -> Self {
3395 Self(RequestBuilder::new(stub))
3396 }
3397
3398 pub fn with_request<V: Into<crate::model::ListAspectTypesRequest>>(mut self, v: V) -> Self {
3400 self.0.request = v.into();
3401 self
3402 }
3403
3404 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3406 self.0.options = v.into();
3407 self
3408 }
3409
3410 pub async fn send(self) -> Result<crate::model::ListAspectTypesResponse> {
3412 (*self.0.stub)
3413 .list_aspect_types(self.0.request, self.0.options)
3414 .await
3415 .map(crate::Response::into_body)
3416 }
3417
3418 pub fn by_page(
3420 self,
3421 ) -> impl google_cloud_gax::paginator::Paginator<
3422 crate::model::ListAspectTypesResponse,
3423 crate::Error,
3424 > {
3425 use std::clone::Clone;
3426 let token = self.0.request.page_token.clone();
3427 let execute = move |token: String| {
3428 let mut builder = self.clone();
3429 builder.0.request = builder.0.request.set_page_token(token);
3430 builder.send()
3431 };
3432 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3433 }
3434
3435 pub fn by_item(
3437 self,
3438 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3439 crate::model::ListAspectTypesResponse,
3440 crate::Error,
3441 > {
3442 use google_cloud_gax::paginator::Paginator;
3443 self.by_page().items()
3444 }
3445
3446 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3450 self.0.request.parent = v.into();
3451 self
3452 }
3453
3454 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3456 self.0.request.page_size = v.into();
3457 self
3458 }
3459
3460 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3462 self.0.request.page_token = v.into();
3463 self
3464 }
3465
3466 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3468 self.0.request.filter = v.into();
3469 self
3470 }
3471
3472 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3474 self.0.request.order_by = v.into();
3475 self
3476 }
3477 }
3478
3479 #[doc(hidden)]
3480 impl crate::RequestBuilder for ListAspectTypes {
3481 fn request_options(&mut self) -> &mut crate::RequestOptions {
3482 &mut self.0.options
3483 }
3484 }
3485
3486 #[derive(Clone, Debug)]
3503 pub struct GetAspectType(RequestBuilder<crate::model::GetAspectTypeRequest>);
3504
3505 impl GetAspectType {
3506 pub(crate) fn new(
3507 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3508 ) -> Self {
3509 Self(RequestBuilder::new(stub))
3510 }
3511
3512 pub fn with_request<V: Into<crate::model::GetAspectTypeRequest>>(mut self, v: V) -> Self {
3514 self.0.request = v.into();
3515 self
3516 }
3517
3518 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3520 self.0.options = v.into();
3521 self
3522 }
3523
3524 pub async fn send(self) -> Result<crate::model::AspectType> {
3526 (*self.0.stub)
3527 .get_aspect_type(self.0.request, self.0.options)
3528 .await
3529 .map(crate::Response::into_body)
3530 }
3531
3532 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3536 self.0.request.name = v.into();
3537 self
3538 }
3539 }
3540
3541 #[doc(hidden)]
3542 impl crate::RequestBuilder for GetAspectType {
3543 fn request_options(&mut self) -> &mut crate::RequestOptions {
3544 &mut self.0.options
3545 }
3546 }
3547
3548 #[derive(Clone, Debug)]
3566 pub struct CreateEntryGroup(RequestBuilder<crate::model::CreateEntryGroupRequest>);
3567
3568 impl CreateEntryGroup {
3569 pub(crate) fn new(
3570 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3571 ) -> Self {
3572 Self(RequestBuilder::new(stub))
3573 }
3574
3575 pub fn with_request<V: Into<crate::model::CreateEntryGroupRequest>>(
3577 mut self,
3578 v: V,
3579 ) -> Self {
3580 self.0.request = v.into();
3581 self
3582 }
3583
3584 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3586 self.0.options = v.into();
3587 self
3588 }
3589
3590 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3597 (*self.0.stub)
3598 .create_entry_group(self.0.request, self.0.options)
3599 .await
3600 .map(crate::Response::into_body)
3601 }
3602
3603 pub fn poller(
3605 self,
3606 ) -> impl google_cloud_lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata>
3607 {
3608 type Operation = google_cloud_lro::internal::Operation<
3609 crate::model::EntryGroup,
3610 crate::model::OperationMetadata,
3611 >;
3612 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3613 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3614
3615 let stub = self.0.stub.clone();
3616 let mut options = self.0.options.clone();
3617 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3618 let query = move |name| {
3619 let stub = stub.clone();
3620 let options = options.clone();
3621 async {
3622 let op = GetOperation::new(stub)
3623 .set_name(name)
3624 .with_options(options)
3625 .send()
3626 .await?;
3627 Ok(Operation::new(op))
3628 }
3629 };
3630
3631 let start = move || async {
3632 let op = self.send().await?;
3633 Ok(Operation::new(op))
3634 };
3635
3636 google_cloud_lro::internal::new_poller(
3637 polling_error_policy,
3638 polling_backoff_policy,
3639 start,
3640 query,
3641 )
3642 }
3643
3644 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3648 self.0.request.parent = v.into();
3649 self
3650 }
3651
3652 pub fn set_entry_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3656 self.0.request.entry_group_id = v.into();
3657 self
3658 }
3659
3660 pub fn set_entry_group<T>(mut self, v: T) -> Self
3664 where
3665 T: std::convert::Into<crate::model::EntryGroup>,
3666 {
3667 self.0.request.entry_group = std::option::Option::Some(v.into());
3668 self
3669 }
3670
3671 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
3675 where
3676 T: std::convert::Into<crate::model::EntryGroup>,
3677 {
3678 self.0.request.entry_group = v.map(|x| x.into());
3679 self
3680 }
3681
3682 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3684 self.0.request.validate_only = v.into();
3685 self
3686 }
3687 }
3688
3689 #[doc(hidden)]
3690 impl crate::RequestBuilder for CreateEntryGroup {
3691 fn request_options(&mut self) -> &mut crate::RequestOptions {
3692 &mut self.0.options
3693 }
3694 }
3695
3696 #[derive(Clone, Debug)]
3714 pub struct UpdateEntryGroup(RequestBuilder<crate::model::UpdateEntryGroupRequest>);
3715
3716 impl UpdateEntryGroup {
3717 pub(crate) fn new(
3718 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3719 ) -> Self {
3720 Self(RequestBuilder::new(stub))
3721 }
3722
3723 pub fn with_request<V: Into<crate::model::UpdateEntryGroupRequest>>(
3725 mut self,
3726 v: V,
3727 ) -> Self {
3728 self.0.request = v.into();
3729 self
3730 }
3731
3732 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3734 self.0.options = v.into();
3735 self
3736 }
3737
3738 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3745 (*self.0.stub)
3746 .update_entry_group(self.0.request, self.0.options)
3747 .await
3748 .map(crate::Response::into_body)
3749 }
3750
3751 pub fn poller(
3753 self,
3754 ) -> impl google_cloud_lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata>
3755 {
3756 type Operation = google_cloud_lro::internal::Operation<
3757 crate::model::EntryGroup,
3758 crate::model::OperationMetadata,
3759 >;
3760 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3761 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3762
3763 let stub = self.0.stub.clone();
3764 let mut options = self.0.options.clone();
3765 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3766 let query = move |name| {
3767 let stub = stub.clone();
3768 let options = options.clone();
3769 async {
3770 let op = GetOperation::new(stub)
3771 .set_name(name)
3772 .with_options(options)
3773 .send()
3774 .await?;
3775 Ok(Operation::new(op))
3776 }
3777 };
3778
3779 let start = move || async {
3780 let op = self.send().await?;
3781 Ok(Operation::new(op))
3782 };
3783
3784 google_cloud_lro::internal::new_poller(
3785 polling_error_policy,
3786 polling_backoff_policy,
3787 start,
3788 query,
3789 )
3790 }
3791
3792 pub fn set_entry_group<T>(mut self, v: T) -> Self
3796 where
3797 T: std::convert::Into<crate::model::EntryGroup>,
3798 {
3799 self.0.request.entry_group = std::option::Option::Some(v.into());
3800 self
3801 }
3802
3803 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
3807 where
3808 T: std::convert::Into<crate::model::EntryGroup>,
3809 {
3810 self.0.request.entry_group = v.map(|x| x.into());
3811 self
3812 }
3813
3814 pub fn set_update_mask<T>(mut self, v: T) -> Self
3818 where
3819 T: std::convert::Into<wkt::FieldMask>,
3820 {
3821 self.0.request.update_mask = std::option::Option::Some(v.into());
3822 self
3823 }
3824
3825 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3829 where
3830 T: std::convert::Into<wkt::FieldMask>,
3831 {
3832 self.0.request.update_mask = v.map(|x| x.into());
3833 self
3834 }
3835
3836 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3838 self.0.request.validate_only = v.into();
3839 self
3840 }
3841 }
3842
3843 #[doc(hidden)]
3844 impl crate::RequestBuilder for UpdateEntryGroup {
3845 fn request_options(&mut self) -> &mut crate::RequestOptions {
3846 &mut self.0.options
3847 }
3848 }
3849
3850 #[derive(Clone, Debug)]
3868 pub struct DeleteEntryGroup(RequestBuilder<crate::model::DeleteEntryGroupRequest>);
3869
3870 impl DeleteEntryGroup {
3871 pub(crate) fn new(
3872 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3873 ) -> Self {
3874 Self(RequestBuilder::new(stub))
3875 }
3876
3877 pub fn with_request<V: Into<crate::model::DeleteEntryGroupRequest>>(
3879 mut self,
3880 v: V,
3881 ) -> Self {
3882 self.0.request = v.into();
3883 self
3884 }
3885
3886 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3888 self.0.options = v.into();
3889 self
3890 }
3891
3892 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3899 (*self.0.stub)
3900 .delete_entry_group(self.0.request, self.0.options)
3901 .await
3902 .map(crate::Response::into_body)
3903 }
3904
3905 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3907 type Operation =
3908 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3909 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3910 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3911
3912 let stub = self.0.stub.clone();
3913 let mut options = self.0.options.clone();
3914 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3915 let query = move |name| {
3916 let stub = stub.clone();
3917 let options = options.clone();
3918 async {
3919 let op = GetOperation::new(stub)
3920 .set_name(name)
3921 .with_options(options)
3922 .send()
3923 .await?;
3924 Ok(Operation::new(op))
3925 }
3926 };
3927
3928 let start = move || async {
3929 let op = self.send().await?;
3930 Ok(Operation::new(op))
3931 };
3932
3933 google_cloud_lro::internal::new_unit_response_poller(
3934 polling_error_policy,
3935 polling_backoff_policy,
3936 start,
3937 query,
3938 )
3939 }
3940
3941 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3945 self.0.request.name = v.into();
3946 self
3947 }
3948
3949 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3951 self.0.request.etag = v.into();
3952 self
3953 }
3954 }
3955
3956 #[doc(hidden)]
3957 impl crate::RequestBuilder for DeleteEntryGroup {
3958 fn request_options(&mut self) -> &mut crate::RequestOptions {
3959 &mut self.0.options
3960 }
3961 }
3962
3963 #[derive(Clone, Debug)]
3984 pub struct ListEntryGroups(RequestBuilder<crate::model::ListEntryGroupsRequest>);
3985
3986 impl ListEntryGroups {
3987 pub(crate) fn new(
3988 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3989 ) -> Self {
3990 Self(RequestBuilder::new(stub))
3991 }
3992
3993 pub fn with_request<V: Into<crate::model::ListEntryGroupsRequest>>(mut self, v: V) -> Self {
3995 self.0.request = v.into();
3996 self
3997 }
3998
3999 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4001 self.0.options = v.into();
4002 self
4003 }
4004
4005 pub async fn send(self) -> Result<crate::model::ListEntryGroupsResponse> {
4007 (*self.0.stub)
4008 .list_entry_groups(self.0.request, self.0.options)
4009 .await
4010 .map(crate::Response::into_body)
4011 }
4012
4013 pub fn by_page(
4015 self,
4016 ) -> impl google_cloud_gax::paginator::Paginator<
4017 crate::model::ListEntryGroupsResponse,
4018 crate::Error,
4019 > {
4020 use std::clone::Clone;
4021 let token = self.0.request.page_token.clone();
4022 let execute = move |token: String| {
4023 let mut builder = self.clone();
4024 builder.0.request = builder.0.request.set_page_token(token);
4025 builder.send()
4026 };
4027 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4028 }
4029
4030 pub fn by_item(
4032 self,
4033 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4034 crate::model::ListEntryGroupsResponse,
4035 crate::Error,
4036 > {
4037 use google_cloud_gax::paginator::Paginator;
4038 self.by_page().items()
4039 }
4040
4041 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4045 self.0.request.parent = v.into();
4046 self
4047 }
4048
4049 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4051 self.0.request.page_size = v.into();
4052 self
4053 }
4054
4055 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4057 self.0.request.page_token = v.into();
4058 self
4059 }
4060
4061 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4063 self.0.request.filter = v.into();
4064 self
4065 }
4066
4067 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4069 self.0.request.order_by = v.into();
4070 self
4071 }
4072 }
4073
4074 #[doc(hidden)]
4075 impl crate::RequestBuilder for ListEntryGroups {
4076 fn request_options(&mut self) -> &mut crate::RequestOptions {
4077 &mut self.0.options
4078 }
4079 }
4080
4081 #[derive(Clone, Debug)]
4098 pub struct GetEntryGroup(RequestBuilder<crate::model::GetEntryGroupRequest>);
4099
4100 impl GetEntryGroup {
4101 pub(crate) fn new(
4102 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4103 ) -> Self {
4104 Self(RequestBuilder::new(stub))
4105 }
4106
4107 pub fn with_request<V: Into<crate::model::GetEntryGroupRequest>>(mut self, v: V) -> Self {
4109 self.0.request = v.into();
4110 self
4111 }
4112
4113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4115 self.0.options = v.into();
4116 self
4117 }
4118
4119 pub async fn send(self) -> Result<crate::model::EntryGroup> {
4121 (*self.0.stub)
4122 .get_entry_group(self.0.request, self.0.options)
4123 .await
4124 .map(crate::Response::into_body)
4125 }
4126
4127 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4131 self.0.request.name = v.into();
4132 self
4133 }
4134 }
4135
4136 #[doc(hidden)]
4137 impl crate::RequestBuilder for GetEntryGroup {
4138 fn request_options(&mut self) -> &mut crate::RequestOptions {
4139 &mut self.0.options
4140 }
4141 }
4142
4143 #[derive(Clone, Debug)]
4160 pub struct CreateEntry(RequestBuilder<crate::model::CreateEntryRequest>);
4161
4162 impl CreateEntry {
4163 pub(crate) fn new(
4164 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4165 ) -> Self {
4166 Self(RequestBuilder::new(stub))
4167 }
4168
4169 pub fn with_request<V: Into<crate::model::CreateEntryRequest>>(mut self, v: V) -> Self {
4171 self.0.request = v.into();
4172 self
4173 }
4174
4175 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4177 self.0.options = v.into();
4178 self
4179 }
4180
4181 pub async fn send(self) -> Result<crate::model::Entry> {
4183 (*self.0.stub)
4184 .create_entry(self.0.request, self.0.options)
4185 .await
4186 .map(crate::Response::into_body)
4187 }
4188
4189 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4193 self.0.request.parent = v.into();
4194 self
4195 }
4196
4197 pub fn set_entry_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4201 self.0.request.entry_id = v.into();
4202 self
4203 }
4204
4205 pub fn set_entry<T>(mut self, v: T) -> Self
4209 where
4210 T: std::convert::Into<crate::model::Entry>,
4211 {
4212 self.0.request.entry = std::option::Option::Some(v.into());
4213 self
4214 }
4215
4216 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
4220 where
4221 T: std::convert::Into<crate::model::Entry>,
4222 {
4223 self.0.request.entry = v.map(|x| x.into());
4224 self
4225 }
4226 }
4227
4228 #[doc(hidden)]
4229 impl crate::RequestBuilder for CreateEntry {
4230 fn request_options(&mut self) -> &mut crate::RequestOptions {
4231 &mut self.0.options
4232 }
4233 }
4234
4235 #[derive(Clone, Debug)]
4252 pub struct UpdateEntry(RequestBuilder<crate::model::UpdateEntryRequest>);
4253
4254 impl UpdateEntry {
4255 pub(crate) fn new(
4256 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4257 ) -> Self {
4258 Self(RequestBuilder::new(stub))
4259 }
4260
4261 pub fn with_request<V: Into<crate::model::UpdateEntryRequest>>(mut self, v: V) -> Self {
4263 self.0.request = v.into();
4264 self
4265 }
4266
4267 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4269 self.0.options = v.into();
4270 self
4271 }
4272
4273 pub async fn send(self) -> Result<crate::model::Entry> {
4275 (*self.0.stub)
4276 .update_entry(self.0.request, self.0.options)
4277 .await
4278 .map(crate::Response::into_body)
4279 }
4280
4281 pub fn set_entry<T>(mut self, v: T) -> Self
4285 where
4286 T: std::convert::Into<crate::model::Entry>,
4287 {
4288 self.0.request.entry = std::option::Option::Some(v.into());
4289 self
4290 }
4291
4292 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
4296 where
4297 T: std::convert::Into<crate::model::Entry>,
4298 {
4299 self.0.request.entry = v.map(|x| x.into());
4300 self
4301 }
4302
4303 pub fn set_update_mask<T>(mut self, v: T) -> Self
4305 where
4306 T: std::convert::Into<wkt::FieldMask>,
4307 {
4308 self.0.request.update_mask = std::option::Option::Some(v.into());
4309 self
4310 }
4311
4312 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4314 where
4315 T: std::convert::Into<wkt::FieldMask>,
4316 {
4317 self.0.request.update_mask = v.map(|x| x.into());
4318 self
4319 }
4320
4321 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4323 self.0.request.allow_missing = v.into();
4324 self
4325 }
4326
4327 pub fn set_delete_missing_aspects<T: Into<bool>>(mut self, v: T) -> Self {
4329 self.0.request.delete_missing_aspects = v.into();
4330 self
4331 }
4332
4333 pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
4335 where
4336 T: std::iter::IntoIterator<Item = V>,
4337 V: std::convert::Into<std::string::String>,
4338 {
4339 use std::iter::Iterator;
4340 self.0.request.aspect_keys = v.into_iter().map(|i| i.into()).collect();
4341 self
4342 }
4343 }
4344
4345 #[doc(hidden)]
4346 impl crate::RequestBuilder for UpdateEntry {
4347 fn request_options(&mut self) -> &mut crate::RequestOptions {
4348 &mut self.0.options
4349 }
4350 }
4351
4352 #[derive(Clone, Debug)]
4369 pub struct DeleteEntry(RequestBuilder<crate::model::DeleteEntryRequest>);
4370
4371 impl DeleteEntry {
4372 pub(crate) fn new(
4373 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4374 ) -> Self {
4375 Self(RequestBuilder::new(stub))
4376 }
4377
4378 pub fn with_request<V: Into<crate::model::DeleteEntryRequest>>(mut self, v: V) -> Self {
4380 self.0.request = v.into();
4381 self
4382 }
4383
4384 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4386 self.0.options = v.into();
4387 self
4388 }
4389
4390 pub async fn send(self) -> Result<crate::model::Entry> {
4392 (*self.0.stub)
4393 .delete_entry(self.0.request, self.0.options)
4394 .await
4395 .map(crate::Response::into_body)
4396 }
4397
4398 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4402 self.0.request.name = v.into();
4403 self
4404 }
4405 }
4406
4407 #[doc(hidden)]
4408 impl crate::RequestBuilder for DeleteEntry {
4409 fn request_options(&mut self) -> &mut crate::RequestOptions {
4410 &mut self.0.options
4411 }
4412 }
4413
4414 #[derive(Clone, Debug)]
4435 pub struct ListEntries(RequestBuilder<crate::model::ListEntriesRequest>);
4436
4437 impl ListEntries {
4438 pub(crate) fn new(
4439 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4440 ) -> Self {
4441 Self(RequestBuilder::new(stub))
4442 }
4443
4444 pub fn with_request<V: Into<crate::model::ListEntriesRequest>>(mut self, v: V) -> Self {
4446 self.0.request = v.into();
4447 self
4448 }
4449
4450 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4452 self.0.options = v.into();
4453 self
4454 }
4455
4456 pub async fn send(self) -> Result<crate::model::ListEntriesResponse> {
4458 (*self.0.stub)
4459 .list_entries(self.0.request, self.0.options)
4460 .await
4461 .map(crate::Response::into_body)
4462 }
4463
4464 pub fn by_page(
4466 self,
4467 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListEntriesResponse, crate::Error>
4468 {
4469 use std::clone::Clone;
4470 let token = self.0.request.page_token.clone();
4471 let execute = move |token: String| {
4472 let mut builder = self.clone();
4473 builder.0.request = builder.0.request.set_page_token(token);
4474 builder.send()
4475 };
4476 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4477 }
4478
4479 pub fn by_item(
4481 self,
4482 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4483 crate::model::ListEntriesResponse,
4484 crate::Error,
4485 > {
4486 use google_cloud_gax::paginator::Paginator;
4487 self.by_page().items()
4488 }
4489
4490 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4494 self.0.request.parent = v.into();
4495 self
4496 }
4497
4498 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4500 self.0.request.page_size = v.into();
4501 self
4502 }
4503
4504 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4506 self.0.request.page_token = v.into();
4507 self
4508 }
4509
4510 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4512 self.0.request.filter = v.into();
4513 self
4514 }
4515 }
4516
4517 #[doc(hidden)]
4518 impl crate::RequestBuilder for ListEntries {
4519 fn request_options(&mut self) -> &mut crate::RequestOptions {
4520 &mut self.0.options
4521 }
4522 }
4523
4524 #[derive(Clone, Debug)]
4541 pub struct GetEntry(RequestBuilder<crate::model::GetEntryRequest>);
4542
4543 impl GetEntry {
4544 pub(crate) fn new(
4545 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4546 ) -> Self {
4547 Self(RequestBuilder::new(stub))
4548 }
4549
4550 pub fn with_request<V: Into<crate::model::GetEntryRequest>>(mut self, v: V) -> Self {
4552 self.0.request = v.into();
4553 self
4554 }
4555
4556 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4558 self.0.options = v.into();
4559 self
4560 }
4561
4562 pub async fn send(self) -> Result<crate::model::Entry> {
4564 (*self.0.stub)
4565 .get_entry(self.0.request, self.0.options)
4566 .await
4567 .map(crate::Response::into_body)
4568 }
4569
4570 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4574 self.0.request.name = v.into();
4575 self
4576 }
4577
4578 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
4580 self.0.request.view = v.into();
4581 self
4582 }
4583
4584 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
4586 where
4587 T: std::iter::IntoIterator<Item = V>,
4588 V: std::convert::Into<std::string::String>,
4589 {
4590 use std::iter::Iterator;
4591 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
4592 self
4593 }
4594
4595 pub fn set_paths<T, V>(mut self, v: T) -> Self
4597 where
4598 T: std::iter::IntoIterator<Item = V>,
4599 V: std::convert::Into<std::string::String>,
4600 {
4601 use std::iter::Iterator;
4602 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
4603 self
4604 }
4605 }
4606
4607 #[doc(hidden)]
4608 impl crate::RequestBuilder for GetEntry {
4609 fn request_options(&mut self) -> &mut crate::RequestOptions {
4610 &mut self.0.options
4611 }
4612 }
4613
4614 #[derive(Clone, Debug)]
4631 pub struct LookupEntry(RequestBuilder<crate::model::LookupEntryRequest>);
4632
4633 impl LookupEntry {
4634 pub(crate) fn new(
4635 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4636 ) -> Self {
4637 Self(RequestBuilder::new(stub))
4638 }
4639
4640 pub fn with_request<V: Into<crate::model::LookupEntryRequest>>(mut self, v: V) -> Self {
4642 self.0.request = v.into();
4643 self
4644 }
4645
4646 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4648 self.0.options = v.into();
4649 self
4650 }
4651
4652 pub async fn send(self) -> Result<crate::model::Entry> {
4654 (*self.0.stub)
4655 .lookup_entry(self.0.request, self.0.options)
4656 .await
4657 .map(crate::Response::into_body)
4658 }
4659
4660 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4664 self.0.request.name = v.into();
4665 self
4666 }
4667
4668 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
4670 self.0.request.view = v.into();
4671 self
4672 }
4673
4674 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
4676 where
4677 T: std::iter::IntoIterator<Item = V>,
4678 V: std::convert::Into<std::string::String>,
4679 {
4680 use std::iter::Iterator;
4681 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
4682 self
4683 }
4684
4685 pub fn set_paths<T, V>(mut self, v: T) -> Self
4687 where
4688 T: std::iter::IntoIterator<Item = V>,
4689 V: std::convert::Into<std::string::String>,
4690 {
4691 use std::iter::Iterator;
4692 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
4693 self
4694 }
4695
4696 pub fn set_entry<T: Into<std::string::String>>(mut self, v: T) -> Self {
4700 self.0.request.entry = v.into();
4701 self
4702 }
4703 }
4704
4705 #[doc(hidden)]
4706 impl crate::RequestBuilder for LookupEntry {
4707 fn request_options(&mut self) -> &mut crate::RequestOptions {
4708 &mut self.0.options
4709 }
4710 }
4711
4712 #[derive(Clone, Debug)]
4733 pub struct SearchEntries(RequestBuilder<crate::model::SearchEntriesRequest>);
4734
4735 impl SearchEntries {
4736 pub(crate) fn new(
4737 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4738 ) -> Self {
4739 Self(RequestBuilder::new(stub))
4740 }
4741
4742 pub fn with_request<V: Into<crate::model::SearchEntriesRequest>>(mut self, v: V) -> Self {
4744 self.0.request = v.into();
4745 self
4746 }
4747
4748 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4750 self.0.options = v.into();
4751 self
4752 }
4753
4754 pub async fn send(self) -> Result<crate::model::SearchEntriesResponse> {
4756 (*self.0.stub)
4757 .search_entries(self.0.request, self.0.options)
4758 .await
4759 .map(crate::Response::into_body)
4760 }
4761
4762 pub fn by_page(
4764 self,
4765 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchEntriesResponse, crate::Error>
4766 {
4767 use std::clone::Clone;
4768 let token = self.0.request.page_token.clone();
4769 let execute = move |token: String| {
4770 let mut builder = self.clone();
4771 builder.0.request = builder.0.request.set_page_token(token);
4772 builder.send()
4773 };
4774 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4775 }
4776
4777 pub fn by_item(
4779 self,
4780 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4781 crate::model::SearchEntriesResponse,
4782 crate::Error,
4783 > {
4784 use google_cloud_gax::paginator::Paginator;
4785 self.by_page().items()
4786 }
4787
4788 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4792 self.0.request.name = v.into();
4793 self
4794 }
4795
4796 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
4800 self.0.request.query = v.into();
4801 self
4802 }
4803
4804 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4806 self.0.request.page_size = v.into();
4807 self
4808 }
4809
4810 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4812 self.0.request.page_token = v.into();
4813 self
4814 }
4815
4816 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4818 self.0.request.order_by = v.into();
4819 self
4820 }
4821
4822 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
4824 self.0.request.scope = v.into();
4825 self
4826 }
4827
4828 pub fn set_semantic_search<T: Into<bool>>(mut self, v: T) -> Self {
4830 self.0.request.semantic_search = v.into();
4831 self
4832 }
4833 }
4834
4835 #[doc(hidden)]
4836 impl crate::RequestBuilder for SearchEntries {
4837 fn request_options(&mut self) -> &mut crate::RequestOptions {
4838 &mut self.0.options
4839 }
4840 }
4841
4842 #[derive(Clone, Debug)]
4860 pub struct CreateMetadataJob(RequestBuilder<crate::model::CreateMetadataJobRequest>);
4861
4862 impl CreateMetadataJob {
4863 pub(crate) fn new(
4864 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4865 ) -> Self {
4866 Self(RequestBuilder::new(stub))
4867 }
4868
4869 pub fn with_request<V: Into<crate::model::CreateMetadataJobRequest>>(
4871 mut self,
4872 v: V,
4873 ) -> Self {
4874 self.0.request = v.into();
4875 self
4876 }
4877
4878 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4880 self.0.options = v.into();
4881 self
4882 }
4883
4884 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4891 (*self.0.stub)
4892 .create_metadata_job(self.0.request, self.0.options)
4893 .await
4894 .map(crate::Response::into_body)
4895 }
4896
4897 pub fn poller(
4899 self,
4900 ) -> impl google_cloud_lro::Poller<crate::model::MetadataJob, crate::model::OperationMetadata>
4901 {
4902 type Operation = google_cloud_lro::internal::Operation<
4903 crate::model::MetadataJob,
4904 crate::model::OperationMetadata,
4905 >;
4906 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4907 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4908
4909 let stub = self.0.stub.clone();
4910 let mut options = self.0.options.clone();
4911 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4912 let query = move |name| {
4913 let stub = stub.clone();
4914 let options = options.clone();
4915 async {
4916 let op = GetOperation::new(stub)
4917 .set_name(name)
4918 .with_options(options)
4919 .send()
4920 .await?;
4921 Ok(Operation::new(op))
4922 }
4923 };
4924
4925 let start = move || async {
4926 let op = self.send().await?;
4927 Ok(Operation::new(op))
4928 };
4929
4930 google_cloud_lro::internal::new_poller(
4931 polling_error_policy,
4932 polling_backoff_policy,
4933 start,
4934 query,
4935 )
4936 }
4937
4938 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4942 self.0.request.parent = v.into();
4943 self
4944 }
4945
4946 pub fn set_metadata_job<T>(mut self, v: T) -> Self
4950 where
4951 T: std::convert::Into<crate::model::MetadataJob>,
4952 {
4953 self.0.request.metadata_job = std::option::Option::Some(v.into());
4954 self
4955 }
4956
4957 pub fn set_or_clear_metadata_job<T>(mut self, v: std::option::Option<T>) -> Self
4961 where
4962 T: std::convert::Into<crate::model::MetadataJob>,
4963 {
4964 self.0.request.metadata_job = v.map(|x| x.into());
4965 self
4966 }
4967
4968 pub fn set_metadata_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4970 self.0.request.metadata_job_id = v.into();
4971 self
4972 }
4973
4974 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4976 self.0.request.validate_only = v.into();
4977 self
4978 }
4979 }
4980
4981 #[doc(hidden)]
4982 impl crate::RequestBuilder for CreateMetadataJob {
4983 fn request_options(&mut self) -> &mut crate::RequestOptions {
4984 &mut self.0.options
4985 }
4986 }
4987
4988 #[derive(Clone, Debug)]
5005 pub struct GetMetadataJob(RequestBuilder<crate::model::GetMetadataJobRequest>);
5006
5007 impl GetMetadataJob {
5008 pub(crate) fn new(
5009 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5010 ) -> Self {
5011 Self(RequestBuilder::new(stub))
5012 }
5013
5014 pub fn with_request<V: Into<crate::model::GetMetadataJobRequest>>(mut self, v: V) -> Self {
5016 self.0.request = v.into();
5017 self
5018 }
5019
5020 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5022 self.0.options = v.into();
5023 self
5024 }
5025
5026 pub async fn send(self) -> Result<crate::model::MetadataJob> {
5028 (*self.0.stub)
5029 .get_metadata_job(self.0.request, self.0.options)
5030 .await
5031 .map(crate::Response::into_body)
5032 }
5033
5034 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5038 self.0.request.name = v.into();
5039 self
5040 }
5041 }
5042
5043 #[doc(hidden)]
5044 impl crate::RequestBuilder for GetMetadataJob {
5045 fn request_options(&mut self) -> &mut crate::RequestOptions {
5046 &mut self.0.options
5047 }
5048 }
5049
5050 #[derive(Clone, Debug)]
5071 pub struct ListMetadataJobs(RequestBuilder<crate::model::ListMetadataJobsRequest>);
5072
5073 impl ListMetadataJobs {
5074 pub(crate) fn new(
5075 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5076 ) -> Self {
5077 Self(RequestBuilder::new(stub))
5078 }
5079
5080 pub fn with_request<V: Into<crate::model::ListMetadataJobsRequest>>(
5082 mut self,
5083 v: V,
5084 ) -> Self {
5085 self.0.request = v.into();
5086 self
5087 }
5088
5089 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5091 self.0.options = v.into();
5092 self
5093 }
5094
5095 pub async fn send(self) -> Result<crate::model::ListMetadataJobsResponse> {
5097 (*self.0.stub)
5098 .list_metadata_jobs(self.0.request, self.0.options)
5099 .await
5100 .map(crate::Response::into_body)
5101 }
5102
5103 pub fn by_page(
5105 self,
5106 ) -> impl google_cloud_gax::paginator::Paginator<
5107 crate::model::ListMetadataJobsResponse,
5108 crate::Error,
5109 > {
5110 use std::clone::Clone;
5111 let token = self.0.request.page_token.clone();
5112 let execute = move |token: String| {
5113 let mut builder = self.clone();
5114 builder.0.request = builder.0.request.set_page_token(token);
5115 builder.send()
5116 };
5117 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5118 }
5119
5120 pub fn by_item(
5122 self,
5123 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5124 crate::model::ListMetadataJobsResponse,
5125 crate::Error,
5126 > {
5127 use google_cloud_gax::paginator::Paginator;
5128 self.by_page().items()
5129 }
5130
5131 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5135 self.0.request.parent = v.into();
5136 self
5137 }
5138
5139 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5141 self.0.request.page_size = v.into();
5142 self
5143 }
5144
5145 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5147 self.0.request.page_token = v.into();
5148 self
5149 }
5150
5151 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5153 self.0.request.filter = v.into();
5154 self
5155 }
5156
5157 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5159 self.0.request.order_by = v.into();
5160 self
5161 }
5162 }
5163
5164 #[doc(hidden)]
5165 impl crate::RequestBuilder for ListMetadataJobs {
5166 fn request_options(&mut self) -> &mut crate::RequestOptions {
5167 &mut self.0.options
5168 }
5169 }
5170
5171 #[derive(Clone, Debug)]
5188 pub struct CancelMetadataJob(RequestBuilder<crate::model::CancelMetadataJobRequest>);
5189
5190 impl CancelMetadataJob {
5191 pub(crate) fn new(
5192 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5193 ) -> Self {
5194 Self(RequestBuilder::new(stub))
5195 }
5196
5197 pub fn with_request<V: Into<crate::model::CancelMetadataJobRequest>>(
5199 mut self,
5200 v: V,
5201 ) -> Self {
5202 self.0.request = v.into();
5203 self
5204 }
5205
5206 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5208 self.0.options = v.into();
5209 self
5210 }
5211
5212 pub async fn send(self) -> Result<()> {
5214 (*self.0.stub)
5215 .cancel_metadata_job(self.0.request, self.0.options)
5216 .await
5217 .map(crate::Response::into_body)
5218 }
5219
5220 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5224 self.0.request.name = v.into();
5225 self
5226 }
5227 }
5228
5229 #[doc(hidden)]
5230 impl crate::RequestBuilder for CancelMetadataJob {
5231 fn request_options(&mut self) -> &mut crate::RequestOptions {
5232 &mut self.0.options
5233 }
5234 }
5235
5236 #[derive(Clone, Debug)]
5253 pub struct CreateEntryLink(RequestBuilder<crate::model::CreateEntryLinkRequest>);
5254
5255 impl CreateEntryLink {
5256 pub(crate) fn new(
5257 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5258 ) -> Self {
5259 Self(RequestBuilder::new(stub))
5260 }
5261
5262 pub fn with_request<V: Into<crate::model::CreateEntryLinkRequest>>(mut self, v: V) -> Self {
5264 self.0.request = v.into();
5265 self
5266 }
5267
5268 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5270 self.0.options = v.into();
5271 self
5272 }
5273
5274 pub async fn send(self) -> Result<crate::model::EntryLink> {
5276 (*self.0.stub)
5277 .create_entry_link(self.0.request, self.0.options)
5278 .await
5279 .map(crate::Response::into_body)
5280 }
5281
5282 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5286 self.0.request.parent = v.into();
5287 self
5288 }
5289
5290 pub fn set_entry_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5294 self.0.request.entry_link_id = v.into();
5295 self
5296 }
5297
5298 pub fn set_entry_link<T>(mut self, v: T) -> Self
5302 where
5303 T: std::convert::Into<crate::model::EntryLink>,
5304 {
5305 self.0.request.entry_link = std::option::Option::Some(v.into());
5306 self
5307 }
5308
5309 pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
5313 where
5314 T: std::convert::Into<crate::model::EntryLink>,
5315 {
5316 self.0.request.entry_link = v.map(|x| x.into());
5317 self
5318 }
5319 }
5320
5321 #[doc(hidden)]
5322 impl crate::RequestBuilder for CreateEntryLink {
5323 fn request_options(&mut self) -> &mut crate::RequestOptions {
5324 &mut self.0.options
5325 }
5326 }
5327
5328 #[derive(Clone, Debug)]
5345 pub struct UpdateEntryLink(RequestBuilder<crate::model::UpdateEntryLinkRequest>);
5346
5347 impl UpdateEntryLink {
5348 pub(crate) fn new(
5349 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5350 ) -> Self {
5351 Self(RequestBuilder::new(stub))
5352 }
5353
5354 pub fn with_request<V: Into<crate::model::UpdateEntryLinkRequest>>(mut self, v: V) -> Self {
5356 self.0.request = v.into();
5357 self
5358 }
5359
5360 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5362 self.0.options = v.into();
5363 self
5364 }
5365
5366 pub async fn send(self) -> Result<crate::model::EntryLink> {
5368 (*self.0.stub)
5369 .update_entry_link(self.0.request, self.0.options)
5370 .await
5371 .map(crate::Response::into_body)
5372 }
5373
5374 pub fn set_entry_link<T>(mut self, v: T) -> Self
5378 where
5379 T: std::convert::Into<crate::model::EntryLink>,
5380 {
5381 self.0.request.entry_link = std::option::Option::Some(v.into());
5382 self
5383 }
5384
5385 pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
5389 where
5390 T: std::convert::Into<crate::model::EntryLink>,
5391 {
5392 self.0.request.entry_link = v.map(|x| x.into());
5393 self
5394 }
5395
5396 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
5398 self.0.request.allow_missing = v.into();
5399 self
5400 }
5401
5402 pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
5404 where
5405 T: std::iter::IntoIterator<Item = V>,
5406 V: std::convert::Into<std::string::String>,
5407 {
5408 use std::iter::Iterator;
5409 self.0.request.aspect_keys = v.into_iter().map(|i| i.into()).collect();
5410 self
5411 }
5412 }
5413
5414 #[doc(hidden)]
5415 impl crate::RequestBuilder for UpdateEntryLink {
5416 fn request_options(&mut self) -> &mut crate::RequestOptions {
5417 &mut self.0.options
5418 }
5419 }
5420
5421 #[derive(Clone, Debug)]
5438 pub struct DeleteEntryLink(RequestBuilder<crate::model::DeleteEntryLinkRequest>);
5439
5440 impl DeleteEntryLink {
5441 pub(crate) fn new(
5442 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5443 ) -> Self {
5444 Self(RequestBuilder::new(stub))
5445 }
5446
5447 pub fn with_request<V: Into<crate::model::DeleteEntryLinkRequest>>(mut self, v: V) -> Self {
5449 self.0.request = v.into();
5450 self
5451 }
5452
5453 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5455 self.0.options = v.into();
5456 self
5457 }
5458
5459 pub async fn send(self) -> Result<crate::model::EntryLink> {
5461 (*self.0.stub)
5462 .delete_entry_link(self.0.request, self.0.options)
5463 .await
5464 .map(crate::Response::into_body)
5465 }
5466
5467 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5471 self.0.request.name = v.into();
5472 self
5473 }
5474 }
5475
5476 #[doc(hidden)]
5477 impl crate::RequestBuilder for DeleteEntryLink {
5478 fn request_options(&mut self) -> &mut crate::RequestOptions {
5479 &mut self.0.options
5480 }
5481 }
5482
5483 #[derive(Clone, Debug)]
5504 pub struct LookupEntryLinks(RequestBuilder<crate::model::LookupEntryLinksRequest>);
5505
5506 impl LookupEntryLinks {
5507 pub(crate) fn new(
5508 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5509 ) -> Self {
5510 Self(RequestBuilder::new(stub))
5511 }
5512
5513 pub fn with_request<V: Into<crate::model::LookupEntryLinksRequest>>(
5515 mut self,
5516 v: V,
5517 ) -> Self {
5518 self.0.request = v.into();
5519 self
5520 }
5521
5522 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5524 self.0.options = v.into();
5525 self
5526 }
5527
5528 pub async fn send(self) -> Result<crate::model::LookupEntryLinksResponse> {
5530 (*self.0.stub)
5531 .lookup_entry_links(self.0.request, self.0.options)
5532 .await
5533 .map(crate::Response::into_body)
5534 }
5535
5536 pub fn by_page(
5538 self,
5539 ) -> impl google_cloud_gax::paginator::Paginator<
5540 crate::model::LookupEntryLinksResponse,
5541 crate::Error,
5542 > {
5543 use std::clone::Clone;
5544 let token = self.0.request.page_token.clone();
5545 let execute = move |token: String| {
5546 let mut builder = self.clone();
5547 builder.0.request = builder.0.request.set_page_token(token);
5548 builder.send()
5549 };
5550 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5551 }
5552
5553 pub fn by_item(
5555 self,
5556 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5557 crate::model::LookupEntryLinksResponse,
5558 crate::Error,
5559 > {
5560 use google_cloud_gax::paginator::Paginator;
5561 self.by_page().items()
5562 }
5563
5564 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5568 self.0.request.name = v.into();
5569 self
5570 }
5571
5572 pub fn set_entry<T: Into<std::string::String>>(mut self, v: T) -> Self {
5576 self.0.request.entry = v.into();
5577 self
5578 }
5579
5580 pub fn set_entry_mode<T: Into<crate::model::lookup_entry_links_request::EntryMode>>(
5582 mut self,
5583 v: T,
5584 ) -> Self {
5585 self.0.request.entry_mode = v.into();
5586 self
5587 }
5588
5589 pub fn set_entry_link_types<T, V>(mut self, v: T) -> Self
5591 where
5592 T: std::iter::IntoIterator<Item = V>,
5593 V: std::convert::Into<std::string::String>,
5594 {
5595 use std::iter::Iterator;
5596 self.0.request.entry_link_types = v.into_iter().map(|i| i.into()).collect();
5597 self
5598 }
5599
5600 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5602 self.0.request.page_size = v.into();
5603 self
5604 }
5605
5606 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5608 self.0.request.page_token = v.into();
5609 self
5610 }
5611 }
5612
5613 #[doc(hidden)]
5614 impl crate::RequestBuilder for LookupEntryLinks {
5615 fn request_options(&mut self) -> &mut crate::RequestOptions {
5616 &mut self.0.options
5617 }
5618 }
5619
5620 #[derive(Clone, Debug)]
5637 pub struct LookupContext(RequestBuilder<crate::model::LookupContextRequest>);
5638
5639 impl LookupContext {
5640 pub(crate) fn new(
5641 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5642 ) -> Self {
5643 Self(RequestBuilder::new(stub))
5644 }
5645
5646 pub fn with_request<V: Into<crate::model::LookupContextRequest>>(mut self, v: V) -> Self {
5648 self.0.request = v.into();
5649 self
5650 }
5651
5652 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5654 self.0.options = v.into();
5655 self
5656 }
5657
5658 pub async fn send(self) -> Result<crate::model::LookupContextResponse> {
5660 (*self.0.stub)
5661 .lookup_context(self.0.request, self.0.options)
5662 .await
5663 .map(crate::Response::into_body)
5664 }
5665
5666 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5670 self.0.request.name = v.into();
5671 self
5672 }
5673
5674 pub fn set_resources<T, V>(mut self, v: T) -> Self
5678 where
5679 T: std::iter::IntoIterator<Item = V>,
5680 V: std::convert::Into<std::string::String>,
5681 {
5682 use std::iter::Iterator;
5683 self.0.request.resources = v.into_iter().map(|i| i.into()).collect();
5684 self
5685 }
5686
5687 pub fn set_options<T, K, V>(mut self, v: T) -> Self
5689 where
5690 T: std::iter::IntoIterator<Item = (K, V)>,
5691 K: std::convert::Into<std::string::String>,
5692 V: std::convert::Into<std::string::String>,
5693 {
5694 self.0.request.options = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5695 self
5696 }
5697 }
5698
5699 #[doc(hidden)]
5700 impl crate::RequestBuilder for LookupContext {
5701 fn request_options(&mut self) -> &mut crate::RequestOptions {
5702 &mut self.0.options
5703 }
5704 }
5705
5706 #[derive(Clone, Debug)]
5723 pub struct GetEntryLink(RequestBuilder<crate::model::GetEntryLinkRequest>);
5724
5725 impl GetEntryLink {
5726 pub(crate) fn new(
5727 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5728 ) -> Self {
5729 Self(RequestBuilder::new(stub))
5730 }
5731
5732 pub fn with_request<V: Into<crate::model::GetEntryLinkRequest>>(mut self, v: V) -> Self {
5734 self.0.request = v.into();
5735 self
5736 }
5737
5738 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5740 self.0.options = v.into();
5741 self
5742 }
5743
5744 pub async fn send(self) -> Result<crate::model::EntryLink> {
5746 (*self.0.stub)
5747 .get_entry_link(self.0.request, self.0.options)
5748 .await
5749 .map(crate::Response::into_body)
5750 }
5751
5752 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5756 self.0.request.name = v.into();
5757 self
5758 }
5759 }
5760
5761 #[doc(hidden)]
5762 impl crate::RequestBuilder for GetEntryLink {
5763 fn request_options(&mut self) -> &mut crate::RequestOptions {
5764 &mut self.0.options
5765 }
5766 }
5767
5768 #[derive(Clone, Debug)]
5786 pub struct CreateMetadataFeed(RequestBuilder<crate::model::CreateMetadataFeedRequest>);
5787
5788 impl CreateMetadataFeed {
5789 pub(crate) fn new(
5790 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5791 ) -> Self {
5792 Self(RequestBuilder::new(stub))
5793 }
5794
5795 pub fn with_request<V: Into<crate::model::CreateMetadataFeedRequest>>(
5797 mut self,
5798 v: V,
5799 ) -> Self {
5800 self.0.request = v.into();
5801 self
5802 }
5803
5804 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5806 self.0.options = v.into();
5807 self
5808 }
5809
5810 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5817 (*self.0.stub)
5818 .create_metadata_feed(self.0.request, self.0.options)
5819 .await
5820 .map(crate::Response::into_body)
5821 }
5822
5823 pub fn poller(
5825 self,
5826 ) -> impl google_cloud_lro::Poller<crate::model::MetadataFeed, crate::model::OperationMetadata>
5827 {
5828 type Operation = google_cloud_lro::internal::Operation<
5829 crate::model::MetadataFeed,
5830 crate::model::OperationMetadata,
5831 >;
5832 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5833 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5834
5835 let stub = self.0.stub.clone();
5836 let mut options = self.0.options.clone();
5837 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5838 let query = move |name| {
5839 let stub = stub.clone();
5840 let options = options.clone();
5841 async {
5842 let op = GetOperation::new(stub)
5843 .set_name(name)
5844 .with_options(options)
5845 .send()
5846 .await?;
5847 Ok(Operation::new(op))
5848 }
5849 };
5850
5851 let start = move || async {
5852 let op = self.send().await?;
5853 Ok(Operation::new(op))
5854 };
5855
5856 google_cloud_lro::internal::new_poller(
5857 polling_error_policy,
5858 polling_backoff_policy,
5859 start,
5860 query,
5861 )
5862 }
5863
5864 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5868 self.0.request.parent = v.into();
5869 self
5870 }
5871
5872 pub fn set_metadata_feed<T>(mut self, v: T) -> Self
5876 where
5877 T: std::convert::Into<crate::model::MetadataFeed>,
5878 {
5879 self.0.request.metadata_feed = std::option::Option::Some(v.into());
5880 self
5881 }
5882
5883 pub fn set_or_clear_metadata_feed<T>(mut self, v: std::option::Option<T>) -> Self
5887 where
5888 T: std::convert::Into<crate::model::MetadataFeed>,
5889 {
5890 self.0.request.metadata_feed = v.map(|x| x.into());
5891 self
5892 }
5893
5894 pub fn set_metadata_feed_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5896 self.0.request.metadata_feed_id = v.into();
5897 self
5898 }
5899
5900 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5902 self.0.request.validate_only = v.into();
5903 self
5904 }
5905 }
5906
5907 #[doc(hidden)]
5908 impl crate::RequestBuilder for CreateMetadataFeed {
5909 fn request_options(&mut self) -> &mut crate::RequestOptions {
5910 &mut self.0.options
5911 }
5912 }
5913
5914 #[derive(Clone, Debug)]
5931 pub struct GetMetadataFeed(RequestBuilder<crate::model::GetMetadataFeedRequest>);
5932
5933 impl GetMetadataFeed {
5934 pub(crate) fn new(
5935 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5936 ) -> Self {
5937 Self(RequestBuilder::new(stub))
5938 }
5939
5940 pub fn with_request<V: Into<crate::model::GetMetadataFeedRequest>>(mut self, v: V) -> Self {
5942 self.0.request = v.into();
5943 self
5944 }
5945
5946 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5948 self.0.options = v.into();
5949 self
5950 }
5951
5952 pub async fn send(self) -> Result<crate::model::MetadataFeed> {
5954 (*self.0.stub)
5955 .get_metadata_feed(self.0.request, self.0.options)
5956 .await
5957 .map(crate::Response::into_body)
5958 }
5959
5960 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5964 self.0.request.name = v.into();
5965 self
5966 }
5967 }
5968
5969 #[doc(hidden)]
5970 impl crate::RequestBuilder for GetMetadataFeed {
5971 fn request_options(&mut self) -> &mut crate::RequestOptions {
5972 &mut self.0.options
5973 }
5974 }
5975
5976 #[derive(Clone, Debug)]
5997 pub struct ListMetadataFeeds(RequestBuilder<crate::model::ListMetadataFeedsRequest>);
5998
5999 impl ListMetadataFeeds {
6000 pub(crate) fn new(
6001 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6002 ) -> Self {
6003 Self(RequestBuilder::new(stub))
6004 }
6005
6006 pub fn with_request<V: Into<crate::model::ListMetadataFeedsRequest>>(
6008 mut self,
6009 v: V,
6010 ) -> Self {
6011 self.0.request = v.into();
6012 self
6013 }
6014
6015 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6017 self.0.options = v.into();
6018 self
6019 }
6020
6021 pub async fn send(self) -> Result<crate::model::ListMetadataFeedsResponse> {
6023 (*self.0.stub)
6024 .list_metadata_feeds(self.0.request, self.0.options)
6025 .await
6026 .map(crate::Response::into_body)
6027 }
6028
6029 pub fn by_page(
6031 self,
6032 ) -> impl google_cloud_gax::paginator::Paginator<
6033 crate::model::ListMetadataFeedsResponse,
6034 crate::Error,
6035 > {
6036 use std::clone::Clone;
6037 let token = self.0.request.page_token.clone();
6038 let execute = move |token: String| {
6039 let mut builder = self.clone();
6040 builder.0.request = builder.0.request.set_page_token(token);
6041 builder.send()
6042 };
6043 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6044 }
6045
6046 pub fn by_item(
6048 self,
6049 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6050 crate::model::ListMetadataFeedsResponse,
6051 crate::Error,
6052 > {
6053 use google_cloud_gax::paginator::Paginator;
6054 self.by_page().items()
6055 }
6056
6057 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6061 self.0.request.parent = v.into();
6062 self
6063 }
6064
6065 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6067 self.0.request.page_size = v.into();
6068 self
6069 }
6070
6071 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6073 self.0.request.page_token = v.into();
6074 self
6075 }
6076
6077 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6079 self.0.request.filter = v.into();
6080 self
6081 }
6082
6083 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6085 self.0.request.order_by = v.into();
6086 self
6087 }
6088 }
6089
6090 #[doc(hidden)]
6091 impl crate::RequestBuilder for ListMetadataFeeds {
6092 fn request_options(&mut self) -> &mut crate::RequestOptions {
6093 &mut self.0.options
6094 }
6095 }
6096
6097 #[derive(Clone, Debug)]
6115 pub struct DeleteMetadataFeed(RequestBuilder<crate::model::DeleteMetadataFeedRequest>);
6116
6117 impl DeleteMetadataFeed {
6118 pub(crate) fn new(
6119 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6120 ) -> Self {
6121 Self(RequestBuilder::new(stub))
6122 }
6123
6124 pub fn with_request<V: Into<crate::model::DeleteMetadataFeedRequest>>(
6126 mut self,
6127 v: V,
6128 ) -> Self {
6129 self.0.request = v.into();
6130 self
6131 }
6132
6133 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6135 self.0.options = v.into();
6136 self
6137 }
6138
6139 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6146 (*self.0.stub)
6147 .delete_metadata_feed(self.0.request, self.0.options)
6148 .await
6149 .map(crate::Response::into_body)
6150 }
6151
6152 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6154 type Operation =
6155 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6156 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6157 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6158
6159 let stub = self.0.stub.clone();
6160 let mut options = self.0.options.clone();
6161 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6162 let query = move |name| {
6163 let stub = stub.clone();
6164 let options = options.clone();
6165 async {
6166 let op = GetOperation::new(stub)
6167 .set_name(name)
6168 .with_options(options)
6169 .send()
6170 .await?;
6171 Ok(Operation::new(op))
6172 }
6173 };
6174
6175 let start = move || async {
6176 let op = self.send().await?;
6177 Ok(Operation::new(op))
6178 };
6179
6180 google_cloud_lro::internal::new_unit_response_poller(
6181 polling_error_policy,
6182 polling_backoff_policy,
6183 start,
6184 query,
6185 )
6186 }
6187
6188 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6192 self.0.request.name = v.into();
6193 self
6194 }
6195 }
6196
6197 #[doc(hidden)]
6198 impl crate::RequestBuilder for DeleteMetadataFeed {
6199 fn request_options(&mut self) -> &mut crate::RequestOptions {
6200 &mut self.0.options
6201 }
6202 }
6203
6204 #[derive(Clone, Debug)]
6222 pub struct UpdateMetadataFeed(RequestBuilder<crate::model::UpdateMetadataFeedRequest>);
6223
6224 impl UpdateMetadataFeed {
6225 pub(crate) fn new(
6226 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6227 ) -> Self {
6228 Self(RequestBuilder::new(stub))
6229 }
6230
6231 pub fn with_request<V: Into<crate::model::UpdateMetadataFeedRequest>>(
6233 mut self,
6234 v: V,
6235 ) -> Self {
6236 self.0.request = v.into();
6237 self
6238 }
6239
6240 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6242 self.0.options = v.into();
6243 self
6244 }
6245
6246 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6253 (*self.0.stub)
6254 .update_metadata_feed(self.0.request, self.0.options)
6255 .await
6256 .map(crate::Response::into_body)
6257 }
6258
6259 pub fn poller(
6261 self,
6262 ) -> impl google_cloud_lro::Poller<crate::model::MetadataFeed, crate::model::OperationMetadata>
6263 {
6264 type Operation = google_cloud_lro::internal::Operation<
6265 crate::model::MetadataFeed,
6266 crate::model::OperationMetadata,
6267 >;
6268 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6269 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6270
6271 let stub = self.0.stub.clone();
6272 let mut options = self.0.options.clone();
6273 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6274 let query = move |name| {
6275 let stub = stub.clone();
6276 let options = options.clone();
6277 async {
6278 let op = GetOperation::new(stub)
6279 .set_name(name)
6280 .with_options(options)
6281 .send()
6282 .await?;
6283 Ok(Operation::new(op))
6284 }
6285 };
6286
6287 let start = move || async {
6288 let op = self.send().await?;
6289 Ok(Operation::new(op))
6290 };
6291
6292 google_cloud_lro::internal::new_poller(
6293 polling_error_policy,
6294 polling_backoff_policy,
6295 start,
6296 query,
6297 )
6298 }
6299
6300 pub fn set_metadata_feed<T>(mut self, v: T) -> Self
6304 where
6305 T: std::convert::Into<crate::model::MetadataFeed>,
6306 {
6307 self.0.request.metadata_feed = std::option::Option::Some(v.into());
6308 self
6309 }
6310
6311 pub fn set_or_clear_metadata_feed<T>(mut self, v: std::option::Option<T>) -> Self
6315 where
6316 T: std::convert::Into<crate::model::MetadataFeed>,
6317 {
6318 self.0.request.metadata_feed = v.map(|x| x.into());
6319 self
6320 }
6321
6322 pub fn set_update_mask<T>(mut self, v: T) -> Self
6324 where
6325 T: std::convert::Into<wkt::FieldMask>,
6326 {
6327 self.0.request.update_mask = std::option::Option::Some(v.into());
6328 self
6329 }
6330
6331 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6333 where
6334 T: std::convert::Into<wkt::FieldMask>,
6335 {
6336 self.0.request.update_mask = v.map(|x| x.into());
6337 self
6338 }
6339
6340 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
6342 self.0.request.validate_only = v.into();
6343 self
6344 }
6345 }
6346
6347 #[doc(hidden)]
6348 impl crate::RequestBuilder for UpdateMetadataFeed {
6349 fn request_options(&mut self) -> &mut crate::RequestOptions {
6350 &mut self.0.options
6351 }
6352 }
6353
6354 #[derive(Clone, Debug)]
6375 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6376
6377 impl ListLocations {
6378 pub(crate) fn new(
6379 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6380 ) -> Self {
6381 Self(RequestBuilder::new(stub))
6382 }
6383
6384 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6386 mut self,
6387 v: V,
6388 ) -> Self {
6389 self.0.request = v.into();
6390 self
6391 }
6392
6393 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6395 self.0.options = v.into();
6396 self
6397 }
6398
6399 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6401 (*self.0.stub)
6402 .list_locations(self.0.request, self.0.options)
6403 .await
6404 .map(crate::Response::into_body)
6405 }
6406
6407 pub fn by_page(
6409 self,
6410 ) -> impl google_cloud_gax::paginator::Paginator<
6411 google_cloud_location::model::ListLocationsResponse,
6412 crate::Error,
6413 > {
6414 use std::clone::Clone;
6415 let token = self.0.request.page_token.clone();
6416 let execute = move |token: String| {
6417 let mut builder = self.clone();
6418 builder.0.request = builder.0.request.set_page_token(token);
6419 builder.send()
6420 };
6421 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6422 }
6423
6424 pub fn by_item(
6426 self,
6427 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6428 google_cloud_location::model::ListLocationsResponse,
6429 crate::Error,
6430 > {
6431 use google_cloud_gax::paginator::Paginator;
6432 self.by_page().items()
6433 }
6434
6435 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6437 self.0.request.name = v.into();
6438 self
6439 }
6440
6441 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6443 self.0.request.filter = v.into();
6444 self
6445 }
6446
6447 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6449 self.0.request.page_size = v.into();
6450 self
6451 }
6452
6453 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6455 self.0.request.page_token = v.into();
6456 self
6457 }
6458 }
6459
6460 #[doc(hidden)]
6461 impl crate::RequestBuilder for ListLocations {
6462 fn request_options(&mut self) -> &mut crate::RequestOptions {
6463 &mut self.0.options
6464 }
6465 }
6466
6467 #[derive(Clone, Debug)]
6484 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6485
6486 impl GetLocation {
6487 pub(crate) fn new(
6488 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6489 ) -> Self {
6490 Self(RequestBuilder::new(stub))
6491 }
6492
6493 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6495 mut self,
6496 v: V,
6497 ) -> Self {
6498 self.0.request = v.into();
6499 self
6500 }
6501
6502 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6504 self.0.options = v.into();
6505 self
6506 }
6507
6508 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6510 (*self.0.stub)
6511 .get_location(self.0.request, self.0.options)
6512 .await
6513 .map(crate::Response::into_body)
6514 }
6515
6516 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6518 self.0.request.name = v.into();
6519 self
6520 }
6521 }
6522
6523 #[doc(hidden)]
6524 impl crate::RequestBuilder for GetLocation {
6525 fn request_options(&mut self) -> &mut crate::RequestOptions {
6526 &mut self.0.options
6527 }
6528 }
6529
6530 #[derive(Clone, Debug)]
6547 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6548
6549 impl SetIamPolicy {
6550 pub(crate) fn new(
6551 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6552 ) -> Self {
6553 Self(RequestBuilder::new(stub))
6554 }
6555
6556 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6558 mut self,
6559 v: V,
6560 ) -> Self {
6561 self.0.request = v.into();
6562 self
6563 }
6564
6565 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6567 self.0.options = v.into();
6568 self
6569 }
6570
6571 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6573 (*self.0.stub)
6574 .set_iam_policy(self.0.request, self.0.options)
6575 .await
6576 .map(crate::Response::into_body)
6577 }
6578
6579 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6583 self.0.request.resource = v.into();
6584 self
6585 }
6586
6587 pub fn set_policy<T>(mut self, v: T) -> Self
6591 where
6592 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6593 {
6594 self.0.request.policy = std::option::Option::Some(v.into());
6595 self
6596 }
6597
6598 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6602 where
6603 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6604 {
6605 self.0.request.policy = v.map(|x| x.into());
6606 self
6607 }
6608
6609 pub fn set_update_mask<T>(mut self, v: T) -> Self
6611 where
6612 T: std::convert::Into<wkt::FieldMask>,
6613 {
6614 self.0.request.update_mask = std::option::Option::Some(v.into());
6615 self
6616 }
6617
6618 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6620 where
6621 T: std::convert::Into<wkt::FieldMask>,
6622 {
6623 self.0.request.update_mask = v.map(|x| x.into());
6624 self
6625 }
6626 }
6627
6628 #[doc(hidden)]
6629 impl crate::RequestBuilder for SetIamPolicy {
6630 fn request_options(&mut self) -> &mut crate::RequestOptions {
6631 &mut self.0.options
6632 }
6633 }
6634
6635 #[derive(Clone, Debug)]
6652 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6653
6654 impl GetIamPolicy {
6655 pub(crate) fn new(
6656 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6657 ) -> Self {
6658 Self(RequestBuilder::new(stub))
6659 }
6660
6661 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6663 mut self,
6664 v: V,
6665 ) -> Self {
6666 self.0.request = v.into();
6667 self
6668 }
6669
6670 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6672 self.0.options = v.into();
6673 self
6674 }
6675
6676 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6678 (*self.0.stub)
6679 .get_iam_policy(self.0.request, self.0.options)
6680 .await
6681 .map(crate::Response::into_body)
6682 }
6683
6684 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6688 self.0.request.resource = v.into();
6689 self
6690 }
6691
6692 pub fn set_options<T>(mut self, v: T) -> Self
6694 where
6695 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6696 {
6697 self.0.request.options = std::option::Option::Some(v.into());
6698 self
6699 }
6700
6701 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6703 where
6704 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6705 {
6706 self.0.request.options = v.map(|x| x.into());
6707 self
6708 }
6709 }
6710
6711 #[doc(hidden)]
6712 impl crate::RequestBuilder for GetIamPolicy {
6713 fn request_options(&mut self) -> &mut crate::RequestOptions {
6714 &mut self.0.options
6715 }
6716 }
6717
6718 #[derive(Clone, Debug)]
6735 pub struct TestIamPermissions(
6736 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6737 );
6738
6739 impl TestIamPermissions {
6740 pub(crate) fn new(
6741 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6742 ) -> Self {
6743 Self(RequestBuilder::new(stub))
6744 }
6745
6746 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6748 mut self,
6749 v: V,
6750 ) -> Self {
6751 self.0.request = v.into();
6752 self
6753 }
6754
6755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6757 self.0.options = v.into();
6758 self
6759 }
6760
6761 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6763 (*self.0.stub)
6764 .test_iam_permissions(self.0.request, self.0.options)
6765 .await
6766 .map(crate::Response::into_body)
6767 }
6768
6769 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6773 self.0.request.resource = v.into();
6774 self
6775 }
6776
6777 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6781 where
6782 T: std::iter::IntoIterator<Item = V>,
6783 V: std::convert::Into<std::string::String>,
6784 {
6785 use std::iter::Iterator;
6786 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6787 self
6788 }
6789 }
6790
6791 #[doc(hidden)]
6792 impl crate::RequestBuilder for TestIamPermissions {
6793 fn request_options(&mut self) -> &mut crate::RequestOptions {
6794 &mut self.0.options
6795 }
6796 }
6797
6798 #[derive(Clone, Debug)]
6819 pub struct ListOperations(
6820 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6821 );
6822
6823 impl ListOperations {
6824 pub(crate) fn new(
6825 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6826 ) -> Self {
6827 Self(RequestBuilder::new(stub))
6828 }
6829
6830 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6832 mut self,
6833 v: V,
6834 ) -> Self {
6835 self.0.request = v.into();
6836 self
6837 }
6838
6839 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6841 self.0.options = v.into();
6842 self
6843 }
6844
6845 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6847 (*self.0.stub)
6848 .list_operations(self.0.request, self.0.options)
6849 .await
6850 .map(crate::Response::into_body)
6851 }
6852
6853 pub fn by_page(
6855 self,
6856 ) -> impl google_cloud_gax::paginator::Paginator<
6857 google_cloud_longrunning::model::ListOperationsResponse,
6858 crate::Error,
6859 > {
6860 use std::clone::Clone;
6861 let token = self.0.request.page_token.clone();
6862 let execute = move |token: String| {
6863 let mut builder = self.clone();
6864 builder.0.request = builder.0.request.set_page_token(token);
6865 builder.send()
6866 };
6867 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6868 }
6869
6870 pub fn by_item(
6872 self,
6873 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6874 google_cloud_longrunning::model::ListOperationsResponse,
6875 crate::Error,
6876 > {
6877 use google_cloud_gax::paginator::Paginator;
6878 self.by_page().items()
6879 }
6880
6881 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6883 self.0.request.name = v.into();
6884 self
6885 }
6886
6887 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6889 self.0.request.filter = v.into();
6890 self
6891 }
6892
6893 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6895 self.0.request.page_size = v.into();
6896 self
6897 }
6898
6899 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6901 self.0.request.page_token = v.into();
6902 self
6903 }
6904
6905 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6907 self.0.request.return_partial_success = v.into();
6908 self
6909 }
6910 }
6911
6912 #[doc(hidden)]
6913 impl crate::RequestBuilder for ListOperations {
6914 fn request_options(&mut self) -> &mut crate::RequestOptions {
6915 &mut self.0.options
6916 }
6917 }
6918
6919 #[derive(Clone, Debug)]
6936 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6937
6938 impl GetOperation {
6939 pub(crate) fn new(
6940 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6941 ) -> Self {
6942 Self(RequestBuilder::new(stub))
6943 }
6944
6945 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6947 mut self,
6948 v: V,
6949 ) -> Self {
6950 self.0.request = v.into();
6951 self
6952 }
6953
6954 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6956 self.0.options = v.into();
6957 self
6958 }
6959
6960 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6962 (*self.0.stub)
6963 .get_operation(self.0.request, self.0.options)
6964 .await
6965 .map(crate::Response::into_body)
6966 }
6967
6968 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6970 self.0.request.name = v.into();
6971 self
6972 }
6973 }
6974
6975 #[doc(hidden)]
6976 impl crate::RequestBuilder for GetOperation {
6977 fn request_options(&mut self) -> &mut crate::RequestOptions {
6978 &mut self.0.options
6979 }
6980 }
6981
6982 #[derive(Clone, Debug)]
6999 pub struct DeleteOperation(
7000 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7001 );
7002
7003 impl DeleteOperation {
7004 pub(crate) fn new(
7005 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
7006 ) -> Self {
7007 Self(RequestBuilder::new(stub))
7008 }
7009
7010 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7012 mut self,
7013 v: V,
7014 ) -> Self {
7015 self.0.request = v.into();
7016 self
7017 }
7018
7019 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7021 self.0.options = v.into();
7022 self
7023 }
7024
7025 pub async fn send(self) -> Result<()> {
7027 (*self.0.stub)
7028 .delete_operation(self.0.request, self.0.options)
7029 .await
7030 .map(crate::Response::into_body)
7031 }
7032
7033 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7035 self.0.request.name = v.into();
7036 self
7037 }
7038 }
7039
7040 #[doc(hidden)]
7041 impl crate::RequestBuilder for DeleteOperation {
7042 fn request_options(&mut self) -> &mut crate::RequestOptions {
7043 &mut self.0.options
7044 }
7045 }
7046
7047 #[derive(Clone, Debug)]
7064 pub struct CancelOperation(
7065 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7066 );
7067
7068 impl CancelOperation {
7069 pub(crate) fn new(
7070 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
7071 ) -> Self {
7072 Self(RequestBuilder::new(stub))
7073 }
7074
7075 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7077 mut self,
7078 v: V,
7079 ) -> Self {
7080 self.0.request = v.into();
7081 self
7082 }
7083
7084 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7086 self.0.options = v.into();
7087 self
7088 }
7089
7090 pub async fn send(self) -> Result<()> {
7092 (*self.0.stub)
7093 .cancel_operation(self.0.request, self.0.options)
7094 .await
7095 .map(crate::Response::into_body)
7096 }
7097
7098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7100 self.0.request.name = v.into();
7101 self
7102 }
7103 }
7104
7105 #[doc(hidden)]
7106 impl crate::RequestBuilder for CancelOperation {
7107 fn request_options(&mut self) -> &mut crate::RequestOptions {
7108 &mut self.0.options
7109 }
7110 }
7111}
7112
7113pub mod cmek_service {
7115 use crate::Result;
7116
7117 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7131
7132 pub(crate) mod client {
7133 use super::super::super::client::CmekService;
7134 pub struct Factory;
7135 impl crate::ClientFactory for Factory {
7136 type Client = CmekService;
7137 type Credentials = gaxi::options::Credentials;
7138 async fn build(
7139 self,
7140 config: gaxi::options::ClientConfig,
7141 ) -> crate::ClientBuilderResult<Self::Client> {
7142 Self::Client::new(config).await
7143 }
7144 }
7145 }
7146
7147 #[derive(Clone, Debug)]
7149 pub(crate) struct RequestBuilder<R: std::default::Default> {
7150 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7151 request: R,
7152 options: crate::RequestOptions,
7153 }
7154
7155 impl<R> RequestBuilder<R>
7156 where
7157 R: std::default::Default,
7158 {
7159 pub(crate) fn new(
7160 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7161 ) -> Self {
7162 Self {
7163 stub,
7164 request: R::default(),
7165 options: crate::RequestOptions::default(),
7166 }
7167 }
7168 }
7169
7170 #[derive(Clone, Debug)]
7188 pub struct CreateEncryptionConfig(RequestBuilder<crate::model::CreateEncryptionConfigRequest>);
7189
7190 impl CreateEncryptionConfig {
7191 pub(crate) fn new(
7192 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7193 ) -> Self {
7194 Self(RequestBuilder::new(stub))
7195 }
7196
7197 pub fn with_request<V: Into<crate::model::CreateEncryptionConfigRequest>>(
7199 mut self,
7200 v: V,
7201 ) -> Self {
7202 self.0.request = v.into();
7203 self
7204 }
7205
7206 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7208 self.0.options = v.into();
7209 self
7210 }
7211
7212 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7219 (*self.0.stub)
7220 .create_encryption_config(self.0.request, self.0.options)
7221 .await
7222 .map(crate::Response::into_body)
7223 }
7224
7225 pub fn poller(
7227 self,
7228 ) -> impl google_cloud_lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
7229 {
7230 type Operation = google_cloud_lro::internal::Operation<
7231 crate::model::EncryptionConfig,
7232 crate::model::OperationMetadata,
7233 >;
7234 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7235 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7236
7237 let stub = self.0.stub.clone();
7238 let mut options = self.0.options.clone();
7239 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7240 let query = move |name| {
7241 let stub = stub.clone();
7242 let options = options.clone();
7243 async {
7244 let op = GetOperation::new(stub)
7245 .set_name(name)
7246 .with_options(options)
7247 .send()
7248 .await?;
7249 Ok(Operation::new(op))
7250 }
7251 };
7252
7253 let start = move || async {
7254 let op = self.send().await?;
7255 Ok(Operation::new(op))
7256 };
7257
7258 google_cloud_lro::internal::new_poller(
7259 polling_error_policy,
7260 polling_backoff_policy,
7261 start,
7262 query,
7263 )
7264 }
7265
7266 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7270 self.0.request.parent = v.into();
7271 self
7272 }
7273
7274 pub fn set_encryption_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7278 self.0.request.encryption_config_id = v.into();
7279 self
7280 }
7281
7282 pub fn set_encryption_config<T>(mut self, v: T) -> Self
7286 where
7287 T: std::convert::Into<crate::model::EncryptionConfig>,
7288 {
7289 self.0.request.encryption_config = std::option::Option::Some(v.into());
7290 self
7291 }
7292
7293 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
7297 where
7298 T: std::convert::Into<crate::model::EncryptionConfig>,
7299 {
7300 self.0.request.encryption_config = v.map(|x| x.into());
7301 self
7302 }
7303 }
7304
7305 #[doc(hidden)]
7306 impl crate::RequestBuilder for CreateEncryptionConfig {
7307 fn request_options(&mut self) -> &mut crate::RequestOptions {
7308 &mut self.0.options
7309 }
7310 }
7311
7312 #[derive(Clone, Debug)]
7330 pub struct UpdateEncryptionConfig(RequestBuilder<crate::model::UpdateEncryptionConfigRequest>);
7331
7332 impl UpdateEncryptionConfig {
7333 pub(crate) fn new(
7334 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7335 ) -> Self {
7336 Self(RequestBuilder::new(stub))
7337 }
7338
7339 pub fn with_request<V: Into<crate::model::UpdateEncryptionConfigRequest>>(
7341 mut self,
7342 v: V,
7343 ) -> Self {
7344 self.0.request = v.into();
7345 self
7346 }
7347
7348 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7350 self.0.options = v.into();
7351 self
7352 }
7353
7354 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7361 (*self.0.stub)
7362 .update_encryption_config(self.0.request, self.0.options)
7363 .await
7364 .map(crate::Response::into_body)
7365 }
7366
7367 pub fn poller(
7369 self,
7370 ) -> impl google_cloud_lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
7371 {
7372 type Operation = google_cloud_lro::internal::Operation<
7373 crate::model::EncryptionConfig,
7374 crate::model::OperationMetadata,
7375 >;
7376 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7377 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7378
7379 let stub = self.0.stub.clone();
7380 let mut options = self.0.options.clone();
7381 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7382 let query = move |name| {
7383 let stub = stub.clone();
7384 let options = options.clone();
7385 async {
7386 let op = GetOperation::new(stub)
7387 .set_name(name)
7388 .with_options(options)
7389 .send()
7390 .await?;
7391 Ok(Operation::new(op))
7392 }
7393 };
7394
7395 let start = move || async {
7396 let op = self.send().await?;
7397 Ok(Operation::new(op))
7398 };
7399
7400 google_cloud_lro::internal::new_poller(
7401 polling_error_policy,
7402 polling_backoff_policy,
7403 start,
7404 query,
7405 )
7406 }
7407
7408 pub fn set_encryption_config<T>(mut self, v: T) -> Self
7412 where
7413 T: std::convert::Into<crate::model::EncryptionConfig>,
7414 {
7415 self.0.request.encryption_config = std::option::Option::Some(v.into());
7416 self
7417 }
7418
7419 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
7423 where
7424 T: std::convert::Into<crate::model::EncryptionConfig>,
7425 {
7426 self.0.request.encryption_config = v.map(|x| x.into());
7427 self
7428 }
7429
7430 pub fn set_update_mask<T>(mut self, v: T) -> Self
7432 where
7433 T: std::convert::Into<wkt::FieldMask>,
7434 {
7435 self.0.request.update_mask = std::option::Option::Some(v.into());
7436 self
7437 }
7438
7439 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7441 where
7442 T: std::convert::Into<wkt::FieldMask>,
7443 {
7444 self.0.request.update_mask = v.map(|x| x.into());
7445 self
7446 }
7447 }
7448
7449 #[doc(hidden)]
7450 impl crate::RequestBuilder for UpdateEncryptionConfig {
7451 fn request_options(&mut self) -> &mut crate::RequestOptions {
7452 &mut self.0.options
7453 }
7454 }
7455
7456 #[derive(Clone, Debug)]
7474 pub struct DeleteEncryptionConfig(RequestBuilder<crate::model::DeleteEncryptionConfigRequest>);
7475
7476 impl DeleteEncryptionConfig {
7477 pub(crate) fn new(
7478 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7479 ) -> Self {
7480 Self(RequestBuilder::new(stub))
7481 }
7482
7483 pub fn with_request<V: Into<crate::model::DeleteEncryptionConfigRequest>>(
7485 mut self,
7486 v: V,
7487 ) -> Self {
7488 self.0.request = v.into();
7489 self
7490 }
7491
7492 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7494 self.0.options = v.into();
7495 self
7496 }
7497
7498 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7505 (*self.0.stub)
7506 .delete_encryption_config(self.0.request, self.0.options)
7507 .await
7508 .map(crate::Response::into_body)
7509 }
7510
7511 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7513 type Operation =
7514 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7515 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7516 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7517
7518 let stub = self.0.stub.clone();
7519 let mut options = self.0.options.clone();
7520 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7521 let query = move |name| {
7522 let stub = stub.clone();
7523 let options = options.clone();
7524 async {
7525 let op = GetOperation::new(stub)
7526 .set_name(name)
7527 .with_options(options)
7528 .send()
7529 .await?;
7530 Ok(Operation::new(op))
7531 }
7532 };
7533
7534 let start = move || async {
7535 let op = self.send().await?;
7536 Ok(Operation::new(op))
7537 };
7538
7539 google_cloud_lro::internal::new_unit_response_poller(
7540 polling_error_policy,
7541 polling_backoff_policy,
7542 start,
7543 query,
7544 )
7545 }
7546
7547 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7551 self.0.request.name = v.into();
7552 self
7553 }
7554
7555 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7557 self.0.request.etag = v.into();
7558 self
7559 }
7560 }
7561
7562 #[doc(hidden)]
7563 impl crate::RequestBuilder for DeleteEncryptionConfig {
7564 fn request_options(&mut self) -> &mut crate::RequestOptions {
7565 &mut self.0.options
7566 }
7567 }
7568
7569 #[derive(Clone, Debug)]
7590 pub struct ListEncryptionConfigs(RequestBuilder<crate::model::ListEncryptionConfigsRequest>);
7591
7592 impl ListEncryptionConfigs {
7593 pub(crate) fn new(
7594 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7595 ) -> Self {
7596 Self(RequestBuilder::new(stub))
7597 }
7598
7599 pub fn with_request<V: Into<crate::model::ListEncryptionConfigsRequest>>(
7601 mut self,
7602 v: V,
7603 ) -> Self {
7604 self.0.request = v.into();
7605 self
7606 }
7607
7608 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7610 self.0.options = v.into();
7611 self
7612 }
7613
7614 pub async fn send(self) -> Result<crate::model::ListEncryptionConfigsResponse> {
7616 (*self.0.stub)
7617 .list_encryption_configs(self.0.request, self.0.options)
7618 .await
7619 .map(crate::Response::into_body)
7620 }
7621
7622 pub fn by_page(
7624 self,
7625 ) -> impl google_cloud_gax::paginator::Paginator<
7626 crate::model::ListEncryptionConfigsResponse,
7627 crate::Error,
7628 > {
7629 use std::clone::Clone;
7630 let token = self.0.request.page_token.clone();
7631 let execute = move |token: String| {
7632 let mut builder = self.clone();
7633 builder.0.request = builder.0.request.set_page_token(token);
7634 builder.send()
7635 };
7636 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7637 }
7638
7639 pub fn by_item(
7641 self,
7642 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7643 crate::model::ListEncryptionConfigsResponse,
7644 crate::Error,
7645 > {
7646 use google_cloud_gax::paginator::Paginator;
7647 self.by_page().items()
7648 }
7649
7650 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7654 self.0.request.parent = v.into();
7655 self
7656 }
7657
7658 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7660 self.0.request.page_size = v.into();
7661 self
7662 }
7663
7664 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7666 self.0.request.page_token = v.into();
7667 self
7668 }
7669
7670 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7672 self.0.request.filter = v.into();
7673 self
7674 }
7675
7676 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7678 self.0.request.order_by = v.into();
7679 self
7680 }
7681 }
7682
7683 #[doc(hidden)]
7684 impl crate::RequestBuilder for ListEncryptionConfigs {
7685 fn request_options(&mut self) -> &mut crate::RequestOptions {
7686 &mut self.0.options
7687 }
7688 }
7689
7690 #[derive(Clone, Debug)]
7707 pub struct GetEncryptionConfig(RequestBuilder<crate::model::GetEncryptionConfigRequest>);
7708
7709 impl GetEncryptionConfig {
7710 pub(crate) fn new(
7711 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7712 ) -> Self {
7713 Self(RequestBuilder::new(stub))
7714 }
7715
7716 pub fn with_request<V: Into<crate::model::GetEncryptionConfigRequest>>(
7718 mut self,
7719 v: V,
7720 ) -> Self {
7721 self.0.request = v.into();
7722 self
7723 }
7724
7725 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7727 self.0.options = v.into();
7728 self
7729 }
7730
7731 pub async fn send(self) -> Result<crate::model::EncryptionConfig> {
7733 (*self.0.stub)
7734 .get_encryption_config(self.0.request, self.0.options)
7735 .await
7736 .map(crate::Response::into_body)
7737 }
7738
7739 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7743 self.0.request.name = v.into();
7744 self
7745 }
7746 }
7747
7748 #[doc(hidden)]
7749 impl crate::RequestBuilder for GetEncryptionConfig {
7750 fn request_options(&mut self) -> &mut crate::RequestOptions {
7751 &mut self.0.options
7752 }
7753 }
7754
7755 #[derive(Clone, Debug)]
7776 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7777
7778 impl ListLocations {
7779 pub(crate) fn new(
7780 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7781 ) -> Self {
7782 Self(RequestBuilder::new(stub))
7783 }
7784
7785 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7787 mut self,
7788 v: V,
7789 ) -> Self {
7790 self.0.request = v.into();
7791 self
7792 }
7793
7794 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7796 self.0.options = v.into();
7797 self
7798 }
7799
7800 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7802 (*self.0.stub)
7803 .list_locations(self.0.request, self.0.options)
7804 .await
7805 .map(crate::Response::into_body)
7806 }
7807
7808 pub fn by_page(
7810 self,
7811 ) -> impl google_cloud_gax::paginator::Paginator<
7812 google_cloud_location::model::ListLocationsResponse,
7813 crate::Error,
7814 > {
7815 use std::clone::Clone;
7816 let token = self.0.request.page_token.clone();
7817 let execute = move |token: String| {
7818 let mut builder = self.clone();
7819 builder.0.request = builder.0.request.set_page_token(token);
7820 builder.send()
7821 };
7822 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7823 }
7824
7825 pub fn by_item(
7827 self,
7828 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7829 google_cloud_location::model::ListLocationsResponse,
7830 crate::Error,
7831 > {
7832 use google_cloud_gax::paginator::Paginator;
7833 self.by_page().items()
7834 }
7835
7836 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7838 self.0.request.name = v.into();
7839 self
7840 }
7841
7842 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7844 self.0.request.filter = v.into();
7845 self
7846 }
7847
7848 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7850 self.0.request.page_size = v.into();
7851 self
7852 }
7853
7854 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7856 self.0.request.page_token = v.into();
7857 self
7858 }
7859 }
7860
7861 #[doc(hidden)]
7862 impl crate::RequestBuilder for ListLocations {
7863 fn request_options(&mut self) -> &mut crate::RequestOptions {
7864 &mut self.0.options
7865 }
7866 }
7867
7868 #[derive(Clone, Debug)]
7885 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
7886
7887 impl GetLocation {
7888 pub(crate) fn new(
7889 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7890 ) -> Self {
7891 Self(RequestBuilder::new(stub))
7892 }
7893
7894 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
7896 mut self,
7897 v: V,
7898 ) -> Self {
7899 self.0.request = v.into();
7900 self
7901 }
7902
7903 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7905 self.0.options = v.into();
7906 self
7907 }
7908
7909 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7911 (*self.0.stub)
7912 .get_location(self.0.request, self.0.options)
7913 .await
7914 .map(crate::Response::into_body)
7915 }
7916
7917 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7919 self.0.request.name = v.into();
7920 self
7921 }
7922 }
7923
7924 #[doc(hidden)]
7925 impl crate::RequestBuilder for GetLocation {
7926 fn request_options(&mut self) -> &mut crate::RequestOptions {
7927 &mut self.0.options
7928 }
7929 }
7930
7931 #[derive(Clone, Debug)]
7948 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
7949
7950 impl SetIamPolicy {
7951 pub(crate) fn new(
7952 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7953 ) -> Self {
7954 Self(RequestBuilder::new(stub))
7955 }
7956
7957 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
7959 mut self,
7960 v: V,
7961 ) -> Self {
7962 self.0.request = v.into();
7963 self
7964 }
7965
7966 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7968 self.0.options = v.into();
7969 self
7970 }
7971
7972 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7974 (*self.0.stub)
7975 .set_iam_policy(self.0.request, self.0.options)
7976 .await
7977 .map(crate::Response::into_body)
7978 }
7979
7980 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7984 self.0.request.resource = v.into();
7985 self
7986 }
7987
7988 pub fn set_policy<T>(mut self, v: T) -> Self
7992 where
7993 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7994 {
7995 self.0.request.policy = std::option::Option::Some(v.into());
7996 self
7997 }
7998
7999 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8003 where
8004 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8005 {
8006 self.0.request.policy = v.map(|x| x.into());
8007 self
8008 }
8009
8010 pub fn set_update_mask<T>(mut self, v: T) -> Self
8012 where
8013 T: std::convert::Into<wkt::FieldMask>,
8014 {
8015 self.0.request.update_mask = std::option::Option::Some(v.into());
8016 self
8017 }
8018
8019 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8021 where
8022 T: std::convert::Into<wkt::FieldMask>,
8023 {
8024 self.0.request.update_mask = v.map(|x| x.into());
8025 self
8026 }
8027 }
8028
8029 #[doc(hidden)]
8030 impl crate::RequestBuilder for SetIamPolicy {
8031 fn request_options(&mut self) -> &mut crate::RequestOptions {
8032 &mut self.0.options
8033 }
8034 }
8035
8036 #[derive(Clone, Debug)]
8053 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8054
8055 impl GetIamPolicy {
8056 pub(crate) fn new(
8057 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8058 ) -> Self {
8059 Self(RequestBuilder::new(stub))
8060 }
8061
8062 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8064 mut self,
8065 v: V,
8066 ) -> Self {
8067 self.0.request = v.into();
8068 self
8069 }
8070
8071 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8073 self.0.options = v.into();
8074 self
8075 }
8076
8077 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8079 (*self.0.stub)
8080 .get_iam_policy(self.0.request, self.0.options)
8081 .await
8082 .map(crate::Response::into_body)
8083 }
8084
8085 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8089 self.0.request.resource = v.into();
8090 self
8091 }
8092
8093 pub fn set_options<T>(mut self, v: T) -> Self
8095 where
8096 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8097 {
8098 self.0.request.options = std::option::Option::Some(v.into());
8099 self
8100 }
8101
8102 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8104 where
8105 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8106 {
8107 self.0.request.options = v.map(|x| x.into());
8108 self
8109 }
8110 }
8111
8112 #[doc(hidden)]
8113 impl crate::RequestBuilder for GetIamPolicy {
8114 fn request_options(&mut self) -> &mut crate::RequestOptions {
8115 &mut self.0.options
8116 }
8117 }
8118
8119 #[derive(Clone, Debug)]
8136 pub struct TestIamPermissions(
8137 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8138 );
8139
8140 impl TestIamPermissions {
8141 pub(crate) fn new(
8142 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8143 ) -> Self {
8144 Self(RequestBuilder::new(stub))
8145 }
8146
8147 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8149 mut self,
8150 v: V,
8151 ) -> Self {
8152 self.0.request = v.into();
8153 self
8154 }
8155
8156 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8158 self.0.options = v.into();
8159 self
8160 }
8161
8162 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8164 (*self.0.stub)
8165 .test_iam_permissions(self.0.request, self.0.options)
8166 .await
8167 .map(crate::Response::into_body)
8168 }
8169
8170 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8174 self.0.request.resource = v.into();
8175 self
8176 }
8177
8178 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8182 where
8183 T: std::iter::IntoIterator<Item = V>,
8184 V: std::convert::Into<std::string::String>,
8185 {
8186 use std::iter::Iterator;
8187 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8188 self
8189 }
8190 }
8191
8192 #[doc(hidden)]
8193 impl crate::RequestBuilder for TestIamPermissions {
8194 fn request_options(&mut self) -> &mut crate::RequestOptions {
8195 &mut self.0.options
8196 }
8197 }
8198
8199 #[derive(Clone, Debug)]
8220 pub struct ListOperations(
8221 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8222 );
8223
8224 impl ListOperations {
8225 pub(crate) fn new(
8226 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8227 ) -> Self {
8228 Self(RequestBuilder::new(stub))
8229 }
8230
8231 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8233 mut self,
8234 v: V,
8235 ) -> Self {
8236 self.0.request = v.into();
8237 self
8238 }
8239
8240 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8242 self.0.options = v.into();
8243 self
8244 }
8245
8246 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8248 (*self.0.stub)
8249 .list_operations(self.0.request, self.0.options)
8250 .await
8251 .map(crate::Response::into_body)
8252 }
8253
8254 pub fn by_page(
8256 self,
8257 ) -> impl google_cloud_gax::paginator::Paginator<
8258 google_cloud_longrunning::model::ListOperationsResponse,
8259 crate::Error,
8260 > {
8261 use std::clone::Clone;
8262 let token = self.0.request.page_token.clone();
8263 let execute = move |token: String| {
8264 let mut builder = self.clone();
8265 builder.0.request = builder.0.request.set_page_token(token);
8266 builder.send()
8267 };
8268 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8269 }
8270
8271 pub fn by_item(
8273 self,
8274 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8275 google_cloud_longrunning::model::ListOperationsResponse,
8276 crate::Error,
8277 > {
8278 use google_cloud_gax::paginator::Paginator;
8279 self.by_page().items()
8280 }
8281
8282 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8284 self.0.request.name = v.into();
8285 self
8286 }
8287
8288 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8290 self.0.request.filter = v.into();
8291 self
8292 }
8293
8294 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8296 self.0.request.page_size = v.into();
8297 self
8298 }
8299
8300 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8302 self.0.request.page_token = v.into();
8303 self
8304 }
8305
8306 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8308 self.0.request.return_partial_success = v.into();
8309 self
8310 }
8311 }
8312
8313 #[doc(hidden)]
8314 impl crate::RequestBuilder for ListOperations {
8315 fn request_options(&mut self) -> &mut crate::RequestOptions {
8316 &mut self.0.options
8317 }
8318 }
8319
8320 #[derive(Clone, Debug)]
8337 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8338
8339 impl GetOperation {
8340 pub(crate) fn new(
8341 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8342 ) -> Self {
8343 Self(RequestBuilder::new(stub))
8344 }
8345
8346 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8348 mut self,
8349 v: V,
8350 ) -> Self {
8351 self.0.request = v.into();
8352 self
8353 }
8354
8355 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8357 self.0.options = v.into();
8358 self
8359 }
8360
8361 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8363 (*self.0.stub)
8364 .get_operation(self.0.request, self.0.options)
8365 .await
8366 .map(crate::Response::into_body)
8367 }
8368
8369 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8371 self.0.request.name = v.into();
8372 self
8373 }
8374 }
8375
8376 #[doc(hidden)]
8377 impl crate::RequestBuilder for GetOperation {
8378 fn request_options(&mut self) -> &mut crate::RequestOptions {
8379 &mut self.0.options
8380 }
8381 }
8382
8383 #[derive(Clone, Debug)]
8400 pub struct DeleteOperation(
8401 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8402 );
8403
8404 impl DeleteOperation {
8405 pub(crate) fn new(
8406 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8407 ) -> Self {
8408 Self(RequestBuilder::new(stub))
8409 }
8410
8411 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8413 mut self,
8414 v: V,
8415 ) -> Self {
8416 self.0.request = v.into();
8417 self
8418 }
8419
8420 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8422 self.0.options = v.into();
8423 self
8424 }
8425
8426 pub async fn send(self) -> Result<()> {
8428 (*self.0.stub)
8429 .delete_operation(self.0.request, self.0.options)
8430 .await
8431 .map(crate::Response::into_body)
8432 }
8433
8434 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8436 self.0.request.name = v.into();
8437 self
8438 }
8439 }
8440
8441 #[doc(hidden)]
8442 impl crate::RequestBuilder for DeleteOperation {
8443 fn request_options(&mut self) -> &mut crate::RequestOptions {
8444 &mut self.0.options
8445 }
8446 }
8447
8448 #[derive(Clone, Debug)]
8465 pub struct CancelOperation(
8466 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8467 );
8468
8469 impl CancelOperation {
8470 pub(crate) fn new(
8471 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8472 ) -> Self {
8473 Self(RequestBuilder::new(stub))
8474 }
8475
8476 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8478 mut self,
8479 v: V,
8480 ) -> Self {
8481 self.0.request = v.into();
8482 self
8483 }
8484
8485 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8487 self.0.options = v.into();
8488 self
8489 }
8490
8491 pub async fn send(self) -> Result<()> {
8493 (*self.0.stub)
8494 .cancel_operation(self.0.request, self.0.options)
8495 .await
8496 .map(crate::Response::into_body)
8497 }
8498
8499 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8501 self.0.request.name = v.into();
8502 self
8503 }
8504 }
8505
8506 #[doc(hidden)]
8507 impl crate::RequestBuilder for CancelOperation {
8508 fn request_options(&mut self) -> &mut crate::RequestOptions {
8509 &mut self.0.options
8510 }
8511 }
8512}
8513
8514pub mod content_service {
8516 use crate::Result;
8517
8518 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8532
8533 pub(crate) mod client {
8534 use super::super::super::client::ContentService;
8535 pub struct Factory;
8536 impl crate::ClientFactory for Factory {
8537 type Client = ContentService;
8538 type Credentials = gaxi::options::Credentials;
8539 async fn build(
8540 self,
8541 config: gaxi::options::ClientConfig,
8542 ) -> crate::ClientBuilderResult<Self::Client> {
8543 Self::Client::new(config).await
8544 }
8545 }
8546 }
8547
8548 #[derive(Clone, Debug)]
8550 pub(crate) struct RequestBuilder<R: std::default::Default> {
8551 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8552 request: R,
8553 options: crate::RequestOptions,
8554 }
8555
8556 impl<R> RequestBuilder<R>
8557 where
8558 R: std::default::Default,
8559 {
8560 pub(crate) fn new(
8561 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8562 ) -> Self {
8563 Self {
8564 stub,
8565 request: R::default(),
8566 options: crate::RequestOptions::default(),
8567 }
8568 }
8569 }
8570
8571 #[derive(Clone, Debug)]
8592 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
8593
8594 impl ListLocations {
8595 pub(crate) fn new(
8596 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8597 ) -> Self {
8598 Self(RequestBuilder::new(stub))
8599 }
8600
8601 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
8603 mut self,
8604 v: V,
8605 ) -> Self {
8606 self.0.request = v.into();
8607 self
8608 }
8609
8610 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8612 self.0.options = v.into();
8613 self
8614 }
8615
8616 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8618 (*self.0.stub)
8619 .list_locations(self.0.request, self.0.options)
8620 .await
8621 .map(crate::Response::into_body)
8622 }
8623
8624 pub fn by_page(
8626 self,
8627 ) -> impl google_cloud_gax::paginator::Paginator<
8628 google_cloud_location::model::ListLocationsResponse,
8629 crate::Error,
8630 > {
8631 use std::clone::Clone;
8632 let token = self.0.request.page_token.clone();
8633 let execute = move |token: String| {
8634 let mut builder = self.clone();
8635 builder.0.request = builder.0.request.set_page_token(token);
8636 builder.send()
8637 };
8638 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8639 }
8640
8641 pub fn by_item(
8643 self,
8644 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8645 google_cloud_location::model::ListLocationsResponse,
8646 crate::Error,
8647 > {
8648 use google_cloud_gax::paginator::Paginator;
8649 self.by_page().items()
8650 }
8651
8652 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8654 self.0.request.name = v.into();
8655 self
8656 }
8657
8658 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8660 self.0.request.filter = v.into();
8661 self
8662 }
8663
8664 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8666 self.0.request.page_size = v.into();
8667 self
8668 }
8669
8670 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8672 self.0.request.page_token = v.into();
8673 self
8674 }
8675 }
8676
8677 #[doc(hidden)]
8678 impl crate::RequestBuilder for ListLocations {
8679 fn request_options(&mut self) -> &mut crate::RequestOptions {
8680 &mut self.0.options
8681 }
8682 }
8683
8684 #[derive(Clone, Debug)]
8701 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8702
8703 impl GetLocation {
8704 pub(crate) fn new(
8705 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8706 ) -> Self {
8707 Self(RequestBuilder::new(stub))
8708 }
8709
8710 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8712 mut self,
8713 v: V,
8714 ) -> Self {
8715 self.0.request = v.into();
8716 self
8717 }
8718
8719 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8721 self.0.options = v.into();
8722 self
8723 }
8724
8725 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8727 (*self.0.stub)
8728 .get_location(self.0.request, self.0.options)
8729 .await
8730 .map(crate::Response::into_body)
8731 }
8732
8733 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8735 self.0.request.name = v.into();
8736 self
8737 }
8738 }
8739
8740 #[doc(hidden)]
8741 impl crate::RequestBuilder for GetLocation {
8742 fn request_options(&mut self) -> &mut crate::RequestOptions {
8743 &mut self.0.options
8744 }
8745 }
8746
8747 #[derive(Clone, Debug)]
8764 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8765
8766 impl SetIamPolicy {
8767 pub(crate) fn new(
8768 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8769 ) -> Self {
8770 Self(RequestBuilder::new(stub))
8771 }
8772
8773 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8775 mut self,
8776 v: V,
8777 ) -> Self {
8778 self.0.request = v.into();
8779 self
8780 }
8781
8782 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8784 self.0.options = v.into();
8785 self
8786 }
8787
8788 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8790 (*self.0.stub)
8791 .set_iam_policy(self.0.request, self.0.options)
8792 .await
8793 .map(crate::Response::into_body)
8794 }
8795
8796 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8800 self.0.request.resource = v.into();
8801 self
8802 }
8803
8804 pub fn set_policy<T>(mut self, v: T) -> Self
8808 where
8809 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8810 {
8811 self.0.request.policy = std::option::Option::Some(v.into());
8812 self
8813 }
8814
8815 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8819 where
8820 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8821 {
8822 self.0.request.policy = v.map(|x| x.into());
8823 self
8824 }
8825
8826 pub fn set_update_mask<T>(mut self, v: T) -> Self
8828 where
8829 T: std::convert::Into<wkt::FieldMask>,
8830 {
8831 self.0.request.update_mask = std::option::Option::Some(v.into());
8832 self
8833 }
8834
8835 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8837 where
8838 T: std::convert::Into<wkt::FieldMask>,
8839 {
8840 self.0.request.update_mask = v.map(|x| x.into());
8841 self
8842 }
8843 }
8844
8845 #[doc(hidden)]
8846 impl crate::RequestBuilder for SetIamPolicy {
8847 fn request_options(&mut self) -> &mut crate::RequestOptions {
8848 &mut self.0.options
8849 }
8850 }
8851
8852 #[derive(Clone, Debug)]
8869 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8870
8871 impl GetIamPolicy {
8872 pub(crate) fn new(
8873 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8874 ) -> Self {
8875 Self(RequestBuilder::new(stub))
8876 }
8877
8878 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8880 mut self,
8881 v: V,
8882 ) -> Self {
8883 self.0.request = v.into();
8884 self
8885 }
8886
8887 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8889 self.0.options = v.into();
8890 self
8891 }
8892
8893 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8895 (*self.0.stub)
8896 .get_iam_policy(self.0.request, self.0.options)
8897 .await
8898 .map(crate::Response::into_body)
8899 }
8900
8901 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8905 self.0.request.resource = v.into();
8906 self
8907 }
8908
8909 pub fn set_options<T>(mut self, v: T) -> Self
8911 where
8912 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8913 {
8914 self.0.request.options = std::option::Option::Some(v.into());
8915 self
8916 }
8917
8918 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8920 where
8921 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8922 {
8923 self.0.request.options = v.map(|x| x.into());
8924 self
8925 }
8926 }
8927
8928 #[doc(hidden)]
8929 impl crate::RequestBuilder for GetIamPolicy {
8930 fn request_options(&mut self) -> &mut crate::RequestOptions {
8931 &mut self.0.options
8932 }
8933 }
8934
8935 #[derive(Clone, Debug)]
8952 pub struct TestIamPermissions(
8953 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8954 );
8955
8956 impl TestIamPermissions {
8957 pub(crate) fn new(
8958 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8959 ) -> Self {
8960 Self(RequestBuilder::new(stub))
8961 }
8962
8963 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8965 mut self,
8966 v: V,
8967 ) -> Self {
8968 self.0.request = v.into();
8969 self
8970 }
8971
8972 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8974 self.0.options = v.into();
8975 self
8976 }
8977
8978 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8980 (*self.0.stub)
8981 .test_iam_permissions(self.0.request, self.0.options)
8982 .await
8983 .map(crate::Response::into_body)
8984 }
8985
8986 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8990 self.0.request.resource = v.into();
8991 self
8992 }
8993
8994 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8998 where
8999 T: std::iter::IntoIterator<Item = V>,
9000 V: std::convert::Into<std::string::String>,
9001 {
9002 use std::iter::Iterator;
9003 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9004 self
9005 }
9006 }
9007
9008 #[doc(hidden)]
9009 impl crate::RequestBuilder for TestIamPermissions {
9010 fn request_options(&mut self) -> &mut crate::RequestOptions {
9011 &mut self.0.options
9012 }
9013 }
9014
9015 #[derive(Clone, Debug)]
9036 pub struct ListOperations(
9037 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9038 );
9039
9040 impl ListOperations {
9041 pub(crate) fn new(
9042 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9043 ) -> Self {
9044 Self(RequestBuilder::new(stub))
9045 }
9046
9047 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9049 mut self,
9050 v: V,
9051 ) -> Self {
9052 self.0.request = v.into();
9053 self
9054 }
9055
9056 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9058 self.0.options = v.into();
9059 self
9060 }
9061
9062 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9064 (*self.0.stub)
9065 .list_operations(self.0.request, self.0.options)
9066 .await
9067 .map(crate::Response::into_body)
9068 }
9069
9070 pub fn by_page(
9072 self,
9073 ) -> impl google_cloud_gax::paginator::Paginator<
9074 google_cloud_longrunning::model::ListOperationsResponse,
9075 crate::Error,
9076 > {
9077 use std::clone::Clone;
9078 let token = self.0.request.page_token.clone();
9079 let execute = move |token: String| {
9080 let mut builder = self.clone();
9081 builder.0.request = builder.0.request.set_page_token(token);
9082 builder.send()
9083 };
9084 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9085 }
9086
9087 pub fn by_item(
9089 self,
9090 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9091 google_cloud_longrunning::model::ListOperationsResponse,
9092 crate::Error,
9093 > {
9094 use google_cloud_gax::paginator::Paginator;
9095 self.by_page().items()
9096 }
9097
9098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9100 self.0.request.name = v.into();
9101 self
9102 }
9103
9104 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9106 self.0.request.filter = v.into();
9107 self
9108 }
9109
9110 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9112 self.0.request.page_size = v.into();
9113 self
9114 }
9115
9116 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9118 self.0.request.page_token = v.into();
9119 self
9120 }
9121
9122 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9124 self.0.request.return_partial_success = v.into();
9125 self
9126 }
9127 }
9128
9129 #[doc(hidden)]
9130 impl crate::RequestBuilder for ListOperations {
9131 fn request_options(&mut self) -> &mut crate::RequestOptions {
9132 &mut self.0.options
9133 }
9134 }
9135
9136 #[derive(Clone, Debug)]
9153 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9154
9155 impl GetOperation {
9156 pub(crate) fn new(
9157 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9158 ) -> Self {
9159 Self(RequestBuilder::new(stub))
9160 }
9161
9162 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9164 mut self,
9165 v: V,
9166 ) -> Self {
9167 self.0.request = v.into();
9168 self
9169 }
9170
9171 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9173 self.0.options = v.into();
9174 self
9175 }
9176
9177 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9179 (*self.0.stub)
9180 .get_operation(self.0.request, self.0.options)
9181 .await
9182 .map(crate::Response::into_body)
9183 }
9184
9185 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9187 self.0.request.name = v.into();
9188 self
9189 }
9190 }
9191
9192 #[doc(hidden)]
9193 impl crate::RequestBuilder for GetOperation {
9194 fn request_options(&mut self) -> &mut crate::RequestOptions {
9195 &mut self.0.options
9196 }
9197 }
9198
9199 #[derive(Clone, Debug)]
9216 pub struct DeleteOperation(
9217 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
9218 );
9219
9220 impl DeleteOperation {
9221 pub(crate) fn new(
9222 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9223 ) -> Self {
9224 Self(RequestBuilder::new(stub))
9225 }
9226
9227 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
9229 mut self,
9230 v: V,
9231 ) -> Self {
9232 self.0.request = v.into();
9233 self
9234 }
9235
9236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9238 self.0.options = v.into();
9239 self
9240 }
9241
9242 pub async fn send(self) -> Result<()> {
9244 (*self.0.stub)
9245 .delete_operation(self.0.request, self.0.options)
9246 .await
9247 .map(crate::Response::into_body)
9248 }
9249
9250 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9252 self.0.request.name = v.into();
9253 self
9254 }
9255 }
9256
9257 #[doc(hidden)]
9258 impl crate::RequestBuilder for DeleteOperation {
9259 fn request_options(&mut self) -> &mut crate::RequestOptions {
9260 &mut self.0.options
9261 }
9262 }
9263
9264 #[derive(Clone, Debug)]
9281 pub struct CancelOperation(
9282 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
9283 );
9284
9285 impl CancelOperation {
9286 pub(crate) fn new(
9287 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9288 ) -> Self {
9289 Self(RequestBuilder::new(stub))
9290 }
9291
9292 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
9294 mut self,
9295 v: V,
9296 ) -> Self {
9297 self.0.request = v.into();
9298 self
9299 }
9300
9301 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9303 self.0.options = v.into();
9304 self
9305 }
9306
9307 pub async fn send(self) -> Result<()> {
9309 (*self.0.stub)
9310 .cancel_operation(self.0.request, self.0.options)
9311 .await
9312 .map(crate::Response::into_body)
9313 }
9314
9315 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9317 self.0.request.name = v.into();
9318 self
9319 }
9320 }
9321
9322 #[doc(hidden)]
9323 impl crate::RequestBuilder for CancelOperation {
9324 fn request_options(&mut self) -> &mut crate::RequestOptions {
9325 &mut self.0.options
9326 }
9327 }
9328}
9329
9330pub mod data_product_service {
9332 use crate::Result;
9333
9334 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9348
9349 pub(crate) mod client {
9350 use super::super::super::client::DataProductService;
9351 pub struct Factory;
9352 impl crate::ClientFactory for Factory {
9353 type Client = DataProductService;
9354 type Credentials = gaxi::options::Credentials;
9355 async fn build(
9356 self,
9357 config: gaxi::options::ClientConfig,
9358 ) -> crate::ClientBuilderResult<Self::Client> {
9359 Self::Client::new(config).await
9360 }
9361 }
9362 }
9363
9364 #[derive(Clone, Debug)]
9366 pub(crate) struct RequestBuilder<R: std::default::Default> {
9367 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9368 request: R,
9369 options: crate::RequestOptions,
9370 }
9371
9372 impl<R> RequestBuilder<R>
9373 where
9374 R: std::default::Default,
9375 {
9376 pub(crate) fn new(
9377 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9378 ) -> Self {
9379 Self {
9380 stub,
9381 request: R::default(),
9382 options: crate::RequestOptions::default(),
9383 }
9384 }
9385 }
9386
9387 #[derive(Clone, Debug)]
9405 pub struct CreateDataProduct(RequestBuilder<crate::model::CreateDataProductRequest>);
9406
9407 impl CreateDataProduct {
9408 pub(crate) fn new(
9409 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9410 ) -> Self {
9411 Self(RequestBuilder::new(stub))
9412 }
9413
9414 pub fn with_request<V: Into<crate::model::CreateDataProductRequest>>(
9416 mut self,
9417 v: V,
9418 ) -> Self {
9419 self.0.request = v.into();
9420 self
9421 }
9422
9423 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9425 self.0.options = v.into();
9426 self
9427 }
9428
9429 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9436 (*self.0.stub)
9437 .create_data_product(self.0.request, self.0.options)
9438 .await
9439 .map(crate::Response::into_body)
9440 }
9441
9442 pub fn poller(
9444 self,
9445 ) -> impl google_cloud_lro::Poller<crate::model::DataProduct, crate::model::OperationMetadata>
9446 {
9447 type Operation = google_cloud_lro::internal::Operation<
9448 crate::model::DataProduct,
9449 crate::model::OperationMetadata,
9450 >;
9451 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9452 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9453
9454 let stub = self.0.stub.clone();
9455 let mut options = self.0.options.clone();
9456 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9457 let query = move |name| {
9458 let stub = stub.clone();
9459 let options = options.clone();
9460 async {
9461 let op = GetOperation::new(stub)
9462 .set_name(name)
9463 .with_options(options)
9464 .send()
9465 .await?;
9466 Ok(Operation::new(op))
9467 }
9468 };
9469
9470 let start = move || async {
9471 let op = self.send().await?;
9472 Ok(Operation::new(op))
9473 };
9474
9475 google_cloud_lro::internal::new_poller(
9476 polling_error_policy,
9477 polling_backoff_policy,
9478 start,
9479 query,
9480 )
9481 }
9482
9483 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9487 self.0.request.parent = v.into();
9488 self
9489 }
9490
9491 pub fn set_data_product_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9493 self.0.request.data_product_id = v.into();
9494 self
9495 }
9496
9497 pub fn set_data_product<T>(mut self, v: T) -> Self
9501 where
9502 T: std::convert::Into<crate::model::DataProduct>,
9503 {
9504 self.0.request.data_product = std::option::Option::Some(v.into());
9505 self
9506 }
9507
9508 pub fn set_or_clear_data_product<T>(mut self, v: std::option::Option<T>) -> Self
9512 where
9513 T: std::convert::Into<crate::model::DataProduct>,
9514 {
9515 self.0.request.data_product = v.map(|x| x.into());
9516 self
9517 }
9518
9519 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9521 self.0.request.validate_only = v.into();
9522 self
9523 }
9524 }
9525
9526 #[doc(hidden)]
9527 impl crate::RequestBuilder for CreateDataProduct {
9528 fn request_options(&mut self) -> &mut crate::RequestOptions {
9529 &mut self.0.options
9530 }
9531 }
9532
9533 #[derive(Clone, Debug)]
9551 pub struct DeleteDataProduct(RequestBuilder<crate::model::DeleteDataProductRequest>);
9552
9553 impl DeleteDataProduct {
9554 pub(crate) fn new(
9555 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9556 ) -> Self {
9557 Self(RequestBuilder::new(stub))
9558 }
9559
9560 pub fn with_request<V: Into<crate::model::DeleteDataProductRequest>>(
9562 mut self,
9563 v: V,
9564 ) -> Self {
9565 self.0.request = v.into();
9566 self
9567 }
9568
9569 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9571 self.0.options = v.into();
9572 self
9573 }
9574
9575 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9582 (*self.0.stub)
9583 .delete_data_product(self.0.request, self.0.options)
9584 .await
9585 .map(crate::Response::into_body)
9586 }
9587
9588 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9590 type Operation =
9591 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9592 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9593 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9594
9595 let stub = self.0.stub.clone();
9596 let mut options = self.0.options.clone();
9597 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9598 let query = move |name| {
9599 let stub = stub.clone();
9600 let options = options.clone();
9601 async {
9602 let op = GetOperation::new(stub)
9603 .set_name(name)
9604 .with_options(options)
9605 .send()
9606 .await?;
9607 Ok(Operation::new(op))
9608 }
9609 };
9610
9611 let start = move || async {
9612 let op = self.send().await?;
9613 Ok(Operation::new(op))
9614 };
9615
9616 google_cloud_lro::internal::new_unit_response_poller(
9617 polling_error_policy,
9618 polling_backoff_policy,
9619 start,
9620 query,
9621 )
9622 }
9623
9624 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9628 self.0.request.name = v.into();
9629 self
9630 }
9631
9632 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
9634 self.0.request.etag = v.into();
9635 self
9636 }
9637
9638 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9640 self.0.request.validate_only = v.into();
9641 self
9642 }
9643 }
9644
9645 #[doc(hidden)]
9646 impl crate::RequestBuilder for DeleteDataProduct {
9647 fn request_options(&mut self) -> &mut crate::RequestOptions {
9648 &mut self.0.options
9649 }
9650 }
9651
9652 #[derive(Clone, Debug)]
9669 pub struct GetDataProduct(RequestBuilder<crate::model::GetDataProductRequest>);
9670
9671 impl GetDataProduct {
9672 pub(crate) fn new(
9673 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9674 ) -> Self {
9675 Self(RequestBuilder::new(stub))
9676 }
9677
9678 pub fn with_request<V: Into<crate::model::GetDataProductRequest>>(mut self, v: V) -> Self {
9680 self.0.request = v.into();
9681 self
9682 }
9683
9684 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9686 self.0.options = v.into();
9687 self
9688 }
9689
9690 pub async fn send(self) -> Result<crate::model::DataProduct> {
9692 (*self.0.stub)
9693 .get_data_product(self.0.request, self.0.options)
9694 .await
9695 .map(crate::Response::into_body)
9696 }
9697
9698 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9702 self.0.request.name = v.into();
9703 self
9704 }
9705 }
9706
9707 #[doc(hidden)]
9708 impl crate::RequestBuilder for GetDataProduct {
9709 fn request_options(&mut self) -> &mut crate::RequestOptions {
9710 &mut self.0.options
9711 }
9712 }
9713
9714 #[derive(Clone, Debug)]
9735 pub struct ListDataProducts(RequestBuilder<crate::model::ListDataProductsRequest>);
9736
9737 impl ListDataProducts {
9738 pub(crate) fn new(
9739 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9740 ) -> Self {
9741 Self(RequestBuilder::new(stub))
9742 }
9743
9744 pub fn with_request<V: Into<crate::model::ListDataProductsRequest>>(
9746 mut self,
9747 v: V,
9748 ) -> Self {
9749 self.0.request = v.into();
9750 self
9751 }
9752
9753 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9755 self.0.options = v.into();
9756 self
9757 }
9758
9759 pub async fn send(self) -> Result<crate::model::ListDataProductsResponse> {
9761 (*self.0.stub)
9762 .list_data_products(self.0.request, self.0.options)
9763 .await
9764 .map(crate::Response::into_body)
9765 }
9766
9767 pub fn by_page(
9769 self,
9770 ) -> impl google_cloud_gax::paginator::Paginator<
9771 crate::model::ListDataProductsResponse,
9772 crate::Error,
9773 > {
9774 use std::clone::Clone;
9775 let token = self.0.request.page_token.clone();
9776 let execute = move |token: String| {
9777 let mut builder = self.clone();
9778 builder.0.request = builder.0.request.set_page_token(token);
9779 builder.send()
9780 };
9781 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9782 }
9783
9784 pub fn by_item(
9786 self,
9787 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9788 crate::model::ListDataProductsResponse,
9789 crate::Error,
9790 > {
9791 use google_cloud_gax::paginator::Paginator;
9792 self.by_page().items()
9793 }
9794
9795 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9799 self.0.request.parent = v.into();
9800 self
9801 }
9802
9803 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9805 self.0.request.filter = v.into();
9806 self
9807 }
9808
9809 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9811 self.0.request.page_size = v.into();
9812 self
9813 }
9814
9815 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9817 self.0.request.page_token = v.into();
9818 self
9819 }
9820
9821 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9823 self.0.request.order_by = v.into();
9824 self
9825 }
9826 }
9827
9828 #[doc(hidden)]
9829 impl crate::RequestBuilder for ListDataProducts {
9830 fn request_options(&mut self) -> &mut crate::RequestOptions {
9831 &mut self.0.options
9832 }
9833 }
9834
9835 #[derive(Clone, Debug)]
9853 pub struct UpdateDataProduct(RequestBuilder<crate::model::UpdateDataProductRequest>);
9854
9855 impl UpdateDataProduct {
9856 pub(crate) fn new(
9857 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9858 ) -> Self {
9859 Self(RequestBuilder::new(stub))
9860 }
9861
9862 pub fn with_request<V: Into<crate::model::UpdateDataProductRequest>>(
9864 mut self,
9865 v: V,
9866 ) -> Self {
9867 self.0.request = v.into();
9868 self
9869 }
9870
9871 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9873 self.0.options = v.into();
9874 self
9875 }
9876
9877 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9884 (*self.0.stub)
9885 .update_data_product(self.0.request, self.0.options)
9886 .await
9887 .map(crate::Response::into_body)
9888 }
9889
9890 pub fn poller(
9892 self,
9893 ) -> impl google_cloud_lro::Poller<crate::model::DataProduct, crate::model::OperationMetadata>
9894 {
9895 type Operation = google_cloud_lro::internal::Operation<
9896 crate::model::DataProduct,
9897 crate::model::OperationMetadata,
9898 >;
9899 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9900 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9901
9902 let stub = self.0.stub.clone();
9903 let mut options = self.0.options.clone();
9904 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9905 let query = move |name| {
9906 let stub = stub.clone();
9907 let options = options.clone();
9908 async {
9909 let op = GetOperation::new(stub)
9910 .set_name(name)
9911 .with_options(options)
9912 .send()
9913 .await?;
9914 Ok(Operation::new(op))
9915 }
9916 };
9917
9918 let start = move || async {
9919 let op = self.send().await?;
9920 Ok(Operation::new(op))
9921 };
9922
9923 google_cloud_lro::internal::new_poller(
9924 polling_error_policy,
9925 polling_backoff_policy,
9926 start,
9927 query,
9928 )
9929 }
9930
9931 pub fn set_data_product<T>(mut self, v: T) -> Self
9935 where
9936 T: std::convert::Into<crate::model::DataProduct>,
9937 {
9938 self.0.request.data_product = std::option::Option::Some(v.into());
9939 self
9940 }
9941
9942 pub fn set_or_clear_data_product<T>(mut self, v: std::option::Option<T>) -> Self
9946 where
9947 T: std::convert::Into<crate::model::DataProduct>,
9948 {
9949 self.0.request.data_product = v.map(|x| x.into());
9950 self
9951 }
9952
9953 pub fn set_update_mask<T>(mut self, v: T) -> Self
9955 where
9956 T: std::convert::Into<wkt::FieldMask>,
9957 {
9958 self.0.request.update_mask = std::option::Option::Some(v.into());
9959 self
9960 }
9961
9962 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9964 where
9965 T: std::convert::Into<wkt::FieldMask>,
9966 {
9967 self.0.request.update_mask = v.map(|x| x.into());
9968 self
9969 }
9970
9971 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9973 self.0.request.validate_only = v.into();
9974 self
9975 }
9976 }
9977
9978 #[doc(hidden)]
9979 impl crate::RequestBuilder for UpdateDataProduct {
9980 fn request_options(&mut self) -> &mut crate::RequestOptions {
9981 &mut self.0.options
9982 }
9983 }
9984
9985 #[derive(Clone, Debug)]
10003 pub struct CreateDataAsset(RequestBuilder<crate::model::CreateDataAssetRequest>);
10004
10005 impl CreateDataAsset {
10006 pub(crate) fn new(
10007 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10008 ) -> Self {
10009 Self(RequestBuilder::new(stub))
10010 }
10011
10012 pub fn with_request<V: Into<crate::model::CreateDataAssetRequest>>(mut self, v: V) -> Self {
10014 self.0.request = v.into();
10015 self
10016 }
10017
10018 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10020 self.0.options = v.into();
10021 self
10022 }
10023
10024 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10031 (*self.0.stub)
10032 .create_data_asset(self.0.request, self.0.options)
10033 .await
10034 .map(crate::Response::into_body)
10035 }
10036
10037 pub fn poller(
10039 self,
10040 ) -> impl google_cloud_lro::Poller<crate::model::DataAsset, crate::model::OperationMetadata>
10041 {
10042 type Operation = google_cloud_lro::internal::Operation<
10043 crate::model::DataAsset,
10044 crate::model::OperationMetadata,
10045 >;
10046 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10047 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10048
10049 let stub = self.0.stub.clone();
10050 let mut options = self.0.options.clone();
10051 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10052 let query = move |name| {
10053 let stub = stub.clone();
10054 let options = options.clone();
10055 async {
10056 let op = GetOperation::new(stub)
10057 .set_name(name)
10058 .with_options(options)
10059 .send()
10060 .await?;
10061 Ok(Operation::new(op))
10062 }
10063 };
10064
10065 let start = move || async {
10066 let op = self.send().await?;
10067 Ok(Operation::new(op))
10068 };
10069
10070 google_cloud_lro::internal::new_poller(
10071 polling_error_policy,
10072 polling_backoff_policy,
10073 start,
10074 query,
10075 )
10076 }
10077
10078 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10082 self.0.request.parent = v.into();
10083 self
10084 }
10085
10086 pub fn set_data_asset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10088 self.0.request.data_asset_id = v.into();
10089 self
10090 }
10091
10092 pub fn set_data_asset<T>(mut self, v: T) -> Self
10096 where
10097 T: std::convert::Into<crate::model::DataAsset>,
10098 {
10099 self.0.request.data_asset = std::option::Option::Some(v.into());
10100 self
10101 }
10102
10103 pub fn set_or_clear_data_asset<T>(mut self, v: std::option::Option<T>) -> Self
10107 where
10108 T: std::convert::Into<crate::model::DataAsset>,
10109 {
10110 self.0.request.data_asset = v.map(|x| x.into());
10111 self
10112 }
10113
10114 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10116 self.0.request.validate_only = v.into();
10117 self
10118 }
10119 }
10120
10121 #[doc(hidden)]
10122 impl crate::RequestBuilder for CreateDataAsset {
10123 fn request_options(&mut self) -> &mut crate::RequestOptions {
10124 &mut self.0.options
10125 }
10126 }
10127
10128 #[derive(Clone, Debug)]
10146 pub struct UpdateDataAsset(RequestBuilder<crate::model::UpdateDataAssetRequest>);
10147
10148 impl UpdateDataAsset {
10149 pub(crate) fn new(
10150 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10151 ) -> Self {
10152 Self(RequestBuilder::new(stub))
10153 }
10154
10155 pub fn with_request<V: Into<crate::model::UpdateDataAssetRequest>>(mut self, v: V) -> Self {
10157 self.0.request = v.into();
10158 self
10159 }
10160
10161 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10163 self.0.options = v.into();
10164 self
10165 }
10166
10167 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10174 (*self.0.stub)
10175 .update_data_asset(self.0.request, self.0.options)
10176 .await
10177 .map(crate::Response::into_body)
10178 }
10179
10180 pub fn poller(
10182 self,
10183 ) -> impl google_cloud_lro::Poller<crate::model::DataAsset, crate::model::OperationMetadata>
10184 {
10185 type Operation = google_cloud_lro::internal::Operation<
10186 crate::model::DataAsset,
10187 crate::model::OperationMetadata,
10188 >;
10189 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10190 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10191
10192 let stub = self.0.stub.clone();
10193 let mut options = self.0.options.clone();
10194 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10195 let query = move |name| {
10196 let stub = stub.clone();
10197 let options = options.clone();
10198 async {
10199 let op = GetOperation::new(stub)
10200 .set_name(name)
10201 .with_options(options)
10202 .send()
10203 .await?;
10204 Ok(Operation::new(op))
10205 }
10206 };
10207
10208 let start = move || async {
10209 let op = self.send().await?;
10210 Ok(Operation::new(op))
10211 };
10212
10213 google_cloud_lro::internal::new_poller(
10214 polling_error_policy,
10215 polling_backoff_policy,
10216 start,
10217 query,
10218 )
10219 }
10220
10221 pub fn set_data_asset<T>(mut self, v: T) -> Self
10225 where
10226 T: std::convert::Into<crate::model::DataAsset>,
10227 {
10228 self.0.request.data_asset = std::option::Option::Some(v.into());
10229 self
10230 }
10231
10232 pub fn set_or_clear_data_asset<T>(mut self, v: std::option::Option<T>) -> Self
10236 where
10237 T: std::convert::Into<crate::model::DataAsset>,
10238 {
10239 self.0.request.data_asset = v.map(|x| x.into());
10240 self
10241 }
10242
10243 pub fn set_update_mask<T>(mut self, v: T) -> Self
10245 where
10246 T: std::convert::Into<wkt::FieldMask>,
10247 {
10248 self.0.request.update_mask = std::option::Option::Some(v.into());
10249 self
10250 }
10251
10252 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10254 where
10255 T: std::convert::Into<wkt::FieldMask>,
10256 {
10257 self.0.request.update_mask = v.map(|x| x.into());
10258 self
10259 }
10260
10261 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10263 self.0.request.validate_only = v.into();
10264 self
10265 }
10266 }
10267
10268 #[doc(hidden)]
10269 impl crate::RequestBuilder for UpdateDataAsset {
10270 fn request_options(&mut self) -> &mut crate::RequestOptions {
10271 &mut self.0.options
10272 }
10273 }
10274
10275 #[derive(Clone, Debug)]
10293 pub struct DeleteDataAsset(RequestBuilder<crate::model::DeleteDataAssetRequest>);
10294
10295 impl DeleteDataAsset {
10296 pub(crate) fn new(
10297 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10298 ) -> Self {
10299 Self(RequestBuilder::new(stub))
10300 }
10301
10302 pub fn with_request<V: Into<crate::model::DeleteDataAssetRequest>>(mut self, v: V) -> Self {
10304 self.0.request = v.into();
10305 self
10306 }
10307
10308 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10310 self.0.options = v.into();
10311 self
10312 }
10313
10314 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10321 (*self.0.stub)
10322 .delete_data_asset(self.0.request, self.0.options)
10323 .await
10324 .map(crate::Response::into_body)
10325 }
10326
10327 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10329 type Operation =
10330 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10331 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10332 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10333
10334 let stub = self.0.stub.clone();
10335 let mut options = self.0.options.clone();
10336 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10337 let query = move |name| {
10338 let stub = stub.clone();
10339 let options = options.clone();
10340 async {
10341 let op = GetOperation::new(stub)
10342 .set_name(name)
10343 .with_options(options)
10344 .send()
10345 .await?;
10346 Ok(Operation::new(op))
10347 }
10348 };
10349
10350 let start = move || async {
10351 let op = self.send().await?;
10352 Ok(Operation::new(op))
10353 };
10354
10355 google_cloud_lro::internal::new_unit_response_poller(
10356 polling_error_policy,
10357 polling_backoff_policy,
10358 start,
10359 query,
10360 )
10361 }
10362
10363 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10367 self.0.request.name = v.into();
10368 self
10369 }
10370
10371 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
10373 self.0.request.etag = v.into();
10374 self
10375 }
10376
10377 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10379 self.0.request.validate_only = v.into();
10380 self
10381 }
10382 }
10383
10384 #[doc(hidden)]
10385 impl crate::RequestBuilder for DeleteDataAsset {
10386 fn request_options(&mut self) -> &mut crate::RequestOptions {
10387 &mut self.0.options
10388 }
10389 }
10390
10391 #[derive(Clone, Debug)]
10408 pub struct GetDataAsset(RequestBuilder<crate::model::GetDataAssetRequest>);
10409
10410 impl GetDataAsset {
10411 pub(crate) fn new(
10412 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10413 ) -> Self {
10414 Self(RequestBuilder::new(stub))
10415 }
10416
10417 pub fn with_request<V: Into<crate::model::GetDataAssetRequest>>(mut self, v: V) -> Self {
10419 self.0.request = v.into();
10420 self
10421 }
10422
10423 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10425 self.0.options = v.into();
10426 self
10427 }
10428
10429 pub async fn send(self) -> Result<crate::model::DataAsset> {
10431 (*self.0.stub)
10432 .get_data_asset(self.0.request, self.0.options)
10433 .await
10434 .map(crate::Response::into_body)
10435 }
10436
10437 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10441 self.0.request.name = v.into();
10442 self
10443 }
10444 }
10445
10446 #[doc(hidden)]
10447 impl crate::RequestBuilder for GetDataAsset {
10448 fn request_options(&mut self) -> &mut crate::RequestOptions {
10449 &mut self.0.options
10450 }
10451 }
10452
10453 #[derive(Clone, Debug)]
10474 pub struct ListDataAssets(RequestBuilder<crate::model::ListDataAssetsRequest>);
10475
10476 impl ListDataAssets {
10477 pub(crate) fn new(
10478 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10479 ) -> Self {
10480 Self(RequestBuilder::new(stub))
10481 }
10482
10483 pub fn with_request<V: Into<crate::model::ListDataAssetsRequest>>(mut self, v: V) -> Self {
10485 self.0.request = v.into();
10486 self
10487 }
10488
10489 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10491 self.0.options = v.into();
10492 self
10493 }
10494
10495 pub async fn send(self) -> Result<crate::model::ListDataAssetsResponse> {
10497 (*self.0.stub)
10498 .list_data_assets(self.0.request, self.0.options)
10499 .await
10500 .map(crate::Response::into_body)
10501 }
10502
10503 pub fn by_page(
10505 self,
10506 ) -> impl google_cloud_gax::paginator::Paginator<
10507 crate::model::ListDataAssetsResponse,
10508 crate::Error,
10509 > {
10510 use std::clone::Clone;
10511 let token = self.0.request.page_token.clone();
10512 let execute = move |token: String| {
10513 let mut builder = self.clone();
10514 builder.0.request = builder.0.request.set_page_token(token);
10515 builder.send()
10516 };
10517 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10518 }
10519
10520 pub fn by_item(
10522 self,
10523 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10524 crate::model::ListDataAssetsResponse,
10525 crate::Error,
10526 > {
10527 use google_cloud_gax::paginator::Paginator;
10528 self.by_page().items()
10529 }
10530
10531 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10535 self.0.request.parent = v.into();
10536 self
10537 }
10538
10539 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10541 self.0.request.filter = v.into();
10542 self
10543 }
10544
10545 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10547 self.0.request.order_by = v.into();
10548 self
10549 }
10550
10551 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10553 self.0.request.page_size = v.into();
10554 self
10555 }
10556
10557 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10559 self.0.request.page_token = v.into();
10560 self
10561 }
10562 }
10563
10564 #[doc(hidden)]
10565 impl crate::RequestBuilder for ListDataAssets {
10566 fn request_options(&mut self) -> &mut crate::RequestOptions {
10567 &mut self.0.options
10568 }
10569 }
10570
10571 #[derive(Clone, Debug)]
10592 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10593
10594 impl ListLocations {
10595 pub(crate) fn new(
10596 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10597 ) -> Self {
10598 Self(RequestBuilder::new(stub))
10599 }
10600
10601 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10603 mut self,
10604 v: V,
10605 ) -> Self {
10606 self.0.request = v.into();
10607 self
10608 }
10609
10610 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10612 self.0.options = v.into();
10613 self
10614 }
10615
10616 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10618 (*self.0.stub)
10619 .list_locations(self.0.request, self.0.options)
10620 .await
10621 .map(crate::Response::into_body)
10622 }
10623
10624 pub fn by_page(
10626 self,
10627 ) -> impl google_cloud_gax::paginator::Paginator<
10628 google_cloud_location::model::ListLocationsResponse,
10629 crate::Error,
10630 > {
10631 use std::clone::Clone;
10632 let token = self.0.request.page_token.clone();
10633 let execute = move |token: String| {
10634 let mut builder = self.clone();
10635 builder.0.request = builder.0.request.set_page_token(token);
10636 builder.send()
10637 };
10638 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10639 }
10640
10641 pub fn by_item(
10643 self,
10644 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10645 google_cloud_location::model::ListLocationsResponse,
10646 crate::Error,
10647 > {
10648 use google_cloud_gax::paginator::Paginator;
10649 self.by_page().items()
10650 }
10651
10652 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10654 self.0.request.name = v.into();
10655 self
10656 }
10657
10658 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10660 self.0.request.filter = v.into();
10661 self
10662 }
10663
10664 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10666 self.0.request.page_size = v.into();
10667 self
10668 }
10669
10670 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10672 self.0.request.page_token = v.into();
10673 self
10674 }
10675 }
10676
10677 #[doc(hidden)]
10678 impl crate::RequestBuilder for ListLocations {
10679 fn request_options(&mut self) -> &mut crate::RequestOptions {
10680 &mut self.0.options
10681 }
10682 }
10683
10684 #[derive(Clone, Debug)]
10701 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10702
10703 impl GetLocation {
10704 pub(crate) fn new(
10705 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10706 ) -> Self {
10707 Self(RequestBuilder::new(stub))
10708 }
10709
10710 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10712 mut self,
10713 v: V,
10714 ) -> Self {
10715 self.0.request = v.into();
10716 self
10717 }
10718
10719 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10721 self.0.options = v.into();
10722 self
10723 }
10724
10725 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10727 (*self.0.stub)
10728 .get_location(self.0.request, self.0.options)
10729 .await
10730 .map(crate::Response::into_body)
10731 }
10732
10733 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10735 self.0.request.name = v.into();
10736 self
10737 }
10738 }
10739
10740 #[doc(hidden)]
10741 impl crate::RequestBuilder for GetLocation {
10742 fn request_options(&mut self) -> &mut crate::RequestOptions {
10743 &mut self.0.options
10744 }
10745 }
10746
10747 #[derive(Clone, Debug)]
10764 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10765
10766 impl SetIamPolicy {
10767 pub(crate) fn new(
10768 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10769 ) -> Self {
10770 Self(RequestBuilder::new(stub))
10771 }
10772
10773 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10775 mut self,
10776 v: V,
10777 ) -> Self {
10778 self.0.request = v.into();
10779 self
10780 }
10781
10782 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10784 self.0.options = v.into();
10785 self
10786 }
10787
10788 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10790 (*self.0.stub)
10791 .set_iam_policy(self.0.request, self.0.options)
10792 .await
10793 .map(crate::Response::into_body)
10794 }
10795
10796 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10800 self.0.request.resource = v.into();
10801 self
10802 }
10803
10804 pub fn set_policy<T>(mut self, v: T) -> Self
10808 where
10809 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10810 {
10811 self.0.request.policy = std::option::Option::Some(v.into());
10812 self
10813 }
10814
10815 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10819 where
10820 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10821 {
10822 self.0.request.policy = v.map(|x| x.into());
10823 self
10824 }
10825
10826 pub fn set_update_mask<T>(mut self, v: T) -> Self
10828 where
10829 T: std::convert::Into<wkt::FieldMask>,
10830 {
10831 self.0.request.update_mask = std::option::Option::Some(v.into());
10832 self
10833 }
10834
10835 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10837 where
10838 T: std::convert::Into<wkt::FieldMask>,
10839 {
10840 self.0.request.update_mask = v.map(|x| x.into());
10841 self
10842 }
10843 }
10844
10845 #[doc(hidden)]
10846 impl crate::RequestBuilder for SetIamPolicy {
10847 fn request_options(&mut self) -> &mut crate::RequestOptions {
10848 &mut self.0.options
10849 }
10850 }
10851
10852 #[derive(Clone, Debug)]
10869 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
10870
10871 impl GetIamPolicy {
10872 pub(crate) fn new(
10873 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10874 ) -> Self {
10875 Self(RequestBuilder::new(stub))
10876 }
10877
10878 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
10880 mut self,
10881 v: V,
10882 ) -> Self {
10883 self.0.request = v.into();
10884 self
10885 }
10886
10887 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10889 self.0.options = v.into();
10890 self
10891 }
10892
10893 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10895 (*self.0.stub)
10896 .get_iam_policy(self.0.request, self.0.options)
10897 .await
10898 .map(crate::Response::into_body)
10899 }
10900
10901 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10905 self.0.request.resource = v.into();
10906 self
10907 }
10908
10909 pub fn set_options<T>(mut self, v: T) -> Self
10911 where
10912 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10913 {
10914 self.0.request.options = std::option::Option::Some(v.into());
10915 self
10916 }
10917
10918 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10920 where
10921 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10922 {
10923 self.0.request.options = v.map(|x| x.into());
10924 self
10925 }
10926 }
10927
10928 #[doc(hidden)]
10929 impl crate::RequestBuilder for GetIamPolicy {
10930 fn request_options(&mut self) -> &mut crate::RequestOptions {
10931 &mut self.0.options
10932 }
10933 }
10934
10935 #[derive(Clone, Debug)]
10952 pub struct TestIamPermissions(
10953 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10954 );
10955
10956 impl TestIamPermissions {
10957 pub(crate) fn new(
10958 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10959 ) -> Self {
10960 Self(RequestBuilder::new(stub))
10961 }
10962
10963 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10965 mut self,
10966 v: V,
10967 ) -> Self {
10968 self.0.request = v.into();
10969 self
10970 }
10971
10972 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10974 self.0.options = v.into();
10975 self
10976 }
10977
10978 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10980 (*self.0.stub)
10981 .test_iam_permissions(self.0.request, self.0.options)
10982 .await
10983 .map(crate::Response::into_body)
10984 }
10985
10986 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10990 self.0.request.resource = v.into();
10991 self
10992 }
10993
10994 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10998 where
10999 T: std::iter::IntoIterator<Item = V>,
11000 V: std::convert::Into<std::string::String>,
11001 {
11002 use std::iter::Iterator;
11003 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
11004 self
11005 }
11006 }
11007
11008 #[doc(hidden)]
11009 impl crate::RequestBuilder for TestIamPermissions {
11010 fn request_options(&mut self) -> &mut crate::RequestOptions {
11011 &mut self.0.options
11012 }
11013 }
11014
11015 #[derive(Clone, Debug)]
11036 pub struct ListOperations(
11037 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11038 );
11039
11040 impl ListOperations {
11041 pub(crate) fn new(
11042 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11043 ) -> Self {
11044 Self(RequestBuilder::new(stub))
11045 }
11046
11047 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11049 mut self,
11050 v: V,
11051 ) -> Self {
11052 self.0.request = v.into();
11053 self
11054 }
11055
11056 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11058 self.0.options = v.into();
11059 self
11060 }
11061
11062 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11064 (*self.0.stub)
11065 .list_operations(self.0.request, self.0.options)
11066 .await
11067 .map(crate::Response::into_body)
11068 }
11069
11070 pub fn by_page(
11072 self,
11073 ) -> impl google_cloud_gax::paginator::Paginator<
11074 google_cloud_longrunning::model::ListOperationsResponse,
11075 crate::Error,
11076 > {
11077 use std::clone::Clone;
11078 let token = self.0.request.page_token.clone();
11079 let execute = move |token: String| {
11080 let mut builder = self.clone();
11081 builder.0.request = builder.0.request.set_page_token(token);
11082 builder.send()
11083 };
11084 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11085 }
11086
11087 pub fn by_item(
11089 self,
11090 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11091 google_cloud_longrunning::model::ListOperationsResponse,
11092 crate::Error,
11093 > {
11094 use google_cloud_gax::paginator::Paginator;
11095 self.by_page().items()
11096 }
11097
11098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11100 self.0.request.name = v.into();
11101 self
11102 }
11103
11104 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11106 self.0.request.filter = v.into();
11107 self
11108 }
11109
11110 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11112 self.0.request.page_size = v.into();
11113 self
11114 }
11115
11116 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11118 self.0.request.page_token = v.into();
11119 self
11120 }
11121
11122 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11124 self.0.request.return_partial_success = v.into();
11125 self
11126 }
11127 }
11128
11129 #[doc(hidden)]
11130 impl crate::RequestBuilder for ListOperations {
11131 fn request_options(&mut self) -> &mut crate::RequestOptions {
11132 &mut self.0.options
11133 }
11134 }
11135
11136 #[derive(Clone, Debug)]
11153 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11154
11155 impl GetOperation {
11156 pub(crate) fn new(
11157 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11158 ) -> Self {
11159 Self(RequestBuilder::new(stub))
11160 }
11161
11162 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11164 mut self,
11165 v: V,
11166 ) -> Self {
11167 self.0.request = v.into();
11168 self
11169 }
11170
11171 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11173 self.0.options = v.into();
11174 self
11175 }
11176
11177 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11179 (*self.0.stub)
11180 .get_operation(self.0.request, self.0.options)
11181 .await
11182 .map(crate::Response::into_body)
11183 }
11184
11185 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11187 self.0.request.name = v.into();
11188 self
11189 }
11190 }
11191
11192 #[doc(hidden)]
11193 impl crate::RequestBuilder for GetOperation {
11194 fn request_options(&mut self) -> &mut crate::RequestOptions {
11195 &mut self.0.options
11196 }
11197 }
11198
11199 #[derive(Clone, Debug)]
11216 pub struct DeleteOperation(
11217 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11218 );
11219
11220 impl DeleteOperation {
11221 pub(crate) fn new(
11222 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11223 ) -> Self {
11224 Self(RequestBuilder::new(stub))
11225 }
11226
11227 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11229 mut self,
11230 v: V,
11231 ) -> Self {
11232 self.0.request = v.into();
11233 self
11234 }
11235
11236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11238 self.0.options = v.into();
11239 self
11240 }
11241
11242 pub async fn send(self) -> Result<()> {
11244 (*self.0.stub)
11245 .delete_operation(self.0.request, self.0.options)
11246 .await
11247 .map(crate::Response::into_body)
11248 }
11249
11250 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11252 self.0.request.name = v.into();
11253 self
11254 }
11255 }
11256
11257 #[doc(hidden)]
11258 impl crate::RequestBuilder for DeleteOperation {
11259 fn request_options(&mut self) -> &mut crate::RequestOptions {
11260 &mut self.0.options
11261 }
11262 }
11263
11264 #[derive(Clone, Debug)]
11281 pub struct CancelOperation(
11282 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11283 );
11284
11285 impl CancelOperation {
11286 pub(crate) fn new(
11287 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11288 ) -> Self {
11289 Self(RequestBuilder::new(stub))
11290 }
11291
11292 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11294 mut self,
11295 v: V,
11296 ) -> Self {
11297 self.0.request = v.into();
11298 self
11299 }
11300
11301 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11303 self.0.options = v.into();
11304 self
11305 }
11306
11307 pub async fn send(self) -> Result<()> {
11309 (*self.0.stub)
11310 .cancel_operation(self.0.request, self.0.options)
11311 .await
11312 .map(crate::Response::into_body)
11313 }
11314
11315 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11317 self.0.request.name = v.into();
11318 self
11319 }
11320 }
11321
11322 #[doc(hidden)]
11323 impl crate::RequestBuilder for CancelOperation {
11324 fn request_options(&mut self) -> &mut crate::RequestOptions {
11325 &mut self.0.options
11326 }
11327 }
11328}
11329
11330pub mod data_taxonomy_service {
11332 use crate::Result;
11333
11334 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11348
11349 pub(crate) mod client {
11350 use super::super::super::client::DataTaxonomyService;
11351 pub struct Factory;
11352 impl crate::ClientFactory for Factory {
11353 type Client = DataTaxonomyService;
11354 type Credentials = gaxi::options::Credentials;
11355 async fn build(
11356 self,
11357 config: gaxi::options::ClientConfig,
11358 ) -> crate::ClientBuilderResult<Self::Client> {
11359 Self::Client::new(config).await
11360 }
11361 }
11362 }
11363
11364 #[derive(Clone, Debug)]
11366 pub(crate) struct RequestBuilder<R: std::default::Default> {
11367 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11368 request: R,
11369 options: crate::RequestOptions,
11370 }
11371
11372 impl<R> RequestBuilder<R>
11373 where
11374 R: std::default::Default,
11375 {
11376 pub(crate) fn new(
11377 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11378 ) -> Self {
11379 Self {
11380 stub,
11381 request: R::default(),
11382 options: crate::RequestOptions::default(),
11383 }
11384 }
11385 }
11386
11387 #[derive(Clone, Debug)]
11405 pub struct CreateDataTaxonomy(RequestBuilder<crate::model::CreateDataTaxonomyRequest>);
11406
11407 impl CreateDataTaxonomy {
11408 pub(crate) fn new(
11409 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11410 ) -> Self {
11411 Self(RequestBuilder::new(stub))
11412 }
11413
11414 pub fn with_request<V: Into<crate::model::CreateDataTaxonomyRequest>>(
11416 mut self,
11417 v: V,
11418 ) -> Self {
11419 self.0.request = v.into();
11420 self
11421 }
11422
11423 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11425 self.0.options = v.into();
11426 self
11427 }
11428
11429 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11436 (*self.0.stub)
11437 .create_data_taxonomy(self.0.request, self.0.options)
11438 .await
11439 .map(crate::Response::into_body)
11440 }
11441
11442 pub fn poller(
11444 self,
11445 ) -> impl google_cloud_lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata>
11446 {
11447 type Operation = google_cloud_lro::internal::Operation<
11448 crate::model::DataTaxonomy,
11449 crate::model::OperationMetadata,
11450 >;
11451 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11452 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11453
11454 let stub = self.0.stub.clone();
11455 let mut options = self.0.options.clone();
11456 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11457 let query = move |name| {
11458 let stub = stub.clone();
11459 let options = options.clone();
11460 async {
11461 let op = GetOperation::new(stub)
11462 .set_name(name)
11463 .with_options(options)
11464 .send()
11465 .await?;
11466 Ok(Operation::new(op))
11467 }
11468 };
11469
11470 let start = move || async {
11471 let op = self.send().await?;
11472 Ok(Operation::new(op))
11473 };
11474
11475 google_cloud_lro::internal::new_poller(
11476 polling_error_policy,
11477 polling_backoff_policy,
11478 start,
11479 query,
11480 )
11481 }
11482
11483 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11487 self.0.request.parent = v.into();
11488 self
11489 }
11490
11491 pub fn set_data_taxonomy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11495 self.0.request.data_taxonomy_id = v.into();
11496 self
11497 }
11498
11499 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
11503 where
11504 T: std::convert::Into<crate::model::DataTaxonomy>,
11505 {
11506 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
11507 self
11508 }
11509
11510 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
11514 where
11515 T: std::convert::Into<crate::model::DataTaxonomy>,
11516 {
11517 self.0.request.data_taxonomy = v.map(|x| x.into());
11518 self
11519 }
11520
11521 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11523 self.0.request.validate_only = v.into();
11524 self
11525 }
11526 }
11527
11528 #[doc(hidden)]
11529 impl crate::RequestBuilder for CreateDataTaxonomy {
11530 fn request_options(&mut self) -> &mut crate::RequestOptions {
11531 &mut self.0.options
11532 }
11533 }
11534
11535 #[derive(Clone, Debug)]
11553 pub struct UpdateDataTaxonomy(RequestBuilder<crate::model::UpdateDataTaxonomyRequest>);
11554
11555 impl UpdateDataTaxonomy {
11556 pub(crate) fn new(
11557 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11558 ) -> Self {
11559 Self(RequestBuilder::new(stub))
11560 }
11561
11562 pub fn with_request<V: Into<crate::model::UpdateDataTaxonomyRequest>>(
11564 mut self,
11565 v: V,
11566 ) -> Self {
11567 self.0.request = v.into();
11568 self
11569 }
11570
11571 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11573 self.0.options = v.into();
11574 self
11575 }
11576
11577 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11584 (*self.0.stub)
11585 .update_data_taxonomy(self.0.request, self.0.options)
11586 .await
11587 .map(crate::Response::into_body)
11588 }
11589
11590 pub fn poller(
11592 self,
11593 ) -> impl google_cloud_lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata>
11594 {
11595 type Operation = google_cloud_lro::internal::Operation<
11596 crate::model::DataTaxonomy,
11597 crate::model::OperationMetadata,
11598 >;
11599 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11600 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11601
11602 let stub = self.0.stub.clone();
11603 let mut options = self.0.options.clone();
11604 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11605 let query = move |name| {
11606 let stub = stub.clone();
11607 let options = options.clone();
11608 async {
11609 let op = GetOperation::new(stub)
11610 .set_name(name)
11611 .with_options(options)
11612 .send()
11613 .await?;
11614 Ok(Operation::new(op))
11615 }
11616 };
11617
11618 let start = move || async {
11619 let op = self.send().await?;
11620 Ok(Operation::new(op))
11621 };
11622
11623 google_cloud_lro::internal::new_poller(
11624 polling_error_policy,
11625 polling_backoff_policy,
11626 start,
11627 query,
11628 )
11629 }
11630
11631 pub fn set_update_mask<T>(mut self, v: T) -> Self
11635 where
11636 T: std::convert::Into<wkt::FieldMask>,
11637 {
11638 self.0.request.update_mask = std::option::Option::Some(v.into());
11639 self
11640 }
11641
11642 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11646 where
11647 T: std::convert::Into<wkt::FieldMask>,
11648 {
11649 self.0.request.update_mask = v.map(|x| x.into());
11650 self
11651 }
11652
11653 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
11657 where
11658 T: std::convert::Into<crate::model::DataTaxonomy>,
11659 {
11660 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
11661 self
11662 }
11663
11664 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
11668 where
11669 T: std::convert::Into<crate::model::DataTaxonomy>,
11670 {
11671 self.0.request.data_taxonomy = v.map(|x| x.into());
11672 self
11673 }
11674
11675 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11677 self.0.request.validate_only = v.into();
11678 self
11679 }
11680 }
11681
11682 #[doc(hidden)]
11683 impl crate::RequestBuilder for UpdateDataTaxonomy {
11684 fn request_options(&mut self) -> &mut crate::RequestOptions {
11685 &mut self.0.options
11686 }
11687 }
11688
11689 #[derive(Clone, Debug)]
11707 pub struct DeleteDataTaxonomy(RequestBuilder<crate::model::DeleteDataTaxonomyRequest>);
11708
11709 impl DeleteDataTaxonomy {
11710 pub(crate) fn new(
11711 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11712 ) -> Self {
11713 Self(RequestBuilder::new(stub))
11714 }
11715
11716 pub fn with_request<V: Into<crate::model::DeleteDataTaxonomyRequest>>(
11718 mut self,
11719 v: V,
11720 ) -> Self {
11721 self.0.request = v.into();
11722 self
11723 }
11724
11725 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11727 self.0.options = v.into();
11728 self
11729 }
11730
11731 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11738 (*self.0.stub)
11739 .delete_data_taxonomy(self.0.request, self.0.options)
11740 .await
11741 .map(crate::Response::into_body)
11742 }
11743
11744 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11746 type Operation =
11747 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11748 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11749 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11750
11751 let stub = self.0.stub.clone();
11752 let mut options = self.0.options.clone();
11753 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11754 let query = move |name| {
11755 let stub = stub.clone();
11756 let options = options.clone();
11757 async {
11758 let op = GetOperation::new(stub)
11759 .set_name(name)
11760 .with_options(options)
11761 .send()
11762 .await?;
11763 Ok(Operation::new(op))
11764 }
11765 };
11766
11767 let start = move || async {
11768 let op = self.send().await?;
11769 Ok(Operation::new(op))
11770 };
11771
11772 google_cloud_lro::internal::new_unit_response_poller(
11773 polling_error_policy,
11774 polling_backoff_policy,
11775 start,
11776 query,
11777 )
11778 }
11779
11780 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11784 self.0.request.name = v.into();
11785 self
11786 }
11787
11788 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
11790 self.0.request.etag = v.into();
11791 self
11792 }
11793 }
11794
11795 #[doc(hidden)]
11796 impl crate::RequestBuilder for DeleteDataTaxonomy {
11797 fn request_options(&mut self) -> &mut crate::RequestOptions {
11798 &mut self.0.options
11799 }
11800 }
11801
11802 #[derive(Clone, Debug)]
11823 pub struct ListDataTaxonomies(RequestBuilder<crate::model::ListDataTaxonomiesRequest>);
11824
11825 impl ListDataTaxonomies {
11826 pub(crate) fn new(
11827 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11828 ) -> Self {
11829 Self(RequestBuilder::new(stub))
11830 }
11831
11832 pub fn with_request<V: Into<crate::model::ListDataTaxonomiesRequest>>(
11834 mut self,
11835 v: V,
11836 ) -> Self {
11837 self.0.request = v.into();
11838 self
11839 }
11840
11841 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11843 self.0.options = v.into();
11844 self
11845 }
11846
11847 pub async fn send(self) -> Result<crate::model::ListDataTaxonomiesResponse> {
11849 (*self.0.stub)
11850 .list_data_taxonomies(self.0.request, self.0.options)
11851 .await
11852 .map(crate::Response::into_body)
11853 }
11854
11855 pub fn by_page(
11857 self,
11858 ) -> impl google_cloud_gax::paginator::Paginator<
11859 crate::model::ListDataTaxonomiesResponse,
11860 crate::Error,
11861 > {
11862 use std::clone::Clone;
11863 let token = self.0.request.page_token.clone();
11864 let execute = move |token: String| {
11865 let mut builder = self.clone();
11866 builder.0.request = builder.0.request.set_page_token(token);
11867 builder.send()
11868 };
11869 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11870 }
11871
11872 pub fn by_item(
11874 self,
11875 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11876 crate::model::ListDataTaxonomiesResponse,
11877 crate::Error,
11878 > {
11879 use google_cloud_gax::paginator::Paginator;
11880 self.by_page().items()
11881 }
11882
11883 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11887 self.0.request.parent = v.into();
11888 self
11889 }
11890
11891 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11893 self.0.request.page_size = v.into();
11894 self
11895 }
11896
11897 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11899 self.0.request.page_token = v.into();
11900 self
11901 }
11902
11903 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11905 self.0.request.filter = v.into();
11906 self
11907 }
11908
11909 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11911 self.0.request.order_by = v.into();
11912 self
11913 }
11914 }
11915
11916 #[doc(hidden)]
11917 impl crate::RequestBuilder for ListDataTaxonomies {
11918 fn request_options(&mut self) -> &mut crate::RequestOptions {
11919 &mut self.0.options
11920 }
11921 }
11922
11923 #[derive(Clone, Debug)]
11940 pub struct GetDataTaxonomy(RequestBuilder<crate::model::GetDataTaxonomyRequest>);
11941
11942 impl GetDataTaxonomy {
11943 pub(crate) fn new(
11944 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11945 ) -> Self {
11946 Self(RequestBuilder::new(stub))
11947 }
11948
11949 pub fn with_request<V: Into<crate::model::GetDataTaxonomyRequest>>(mut self, v: V) -> Self {
11951 self.0.request = v.into();
11952 self
11953 }
11954
11955 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11957 self.0.options = v.into();
11958 self
11959 }
11960
11961 pub async fn send(self) -> Result<crate::model::DataTaxonomy> {
11963 (*self.0.stub)
11964 .get_data_taxonomy(self.0.request, self.0.options)
11965 .await
11966 .map(crate::Response::into_body)
11967 }
11968
11969 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11973 self.0.request.name = v.into();
11974 self
11975 }
11976 }
11977
11978 #[doc(hidden)]
11979 impl crate::RequestBuilder for GetDataTaxonomy {
11980 fn request_options(&mut self) -> &mut crate::RequestOptions {
11981 &mut self.0.options
11982 }
11983 }
11984
11985 #[derive(Clone, Debug)]
12003 pub struct CreateDataAttributeBinding(
12004 RequestBuilder<crate::model::CreateDataAttributeBindingRequest>,
12005 );
12006
12007 impl CreateDataAttributeBinding {
12008 pub(crate) fn new(
12009 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12010 ) -> Self {
12011 Self(RequestBuilder::new(stub))
12012 }
12013
12014 pub fn with_request<V: Into<crate::model::CreateDataAttributeBindingRequest>>(
12016 mut self,
12017 v: V,
12018 ) -> Self {
12019 self.0.request = v.into();
12020 self
12021 }
12022
12023 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12025 self.0.options = v.into();
12026 self
12027 }
12028
12029 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12036 (*self.0.stub)
12037 .create_data_attribute_binding(self.0.request, self.0.options)
12038 .await
12039 .map(crate::Response::into_body)
12040 }
12041
12042 pub fn poller(
12044 self,
12045 ) -> impl google_cloud_lro::Poller<
12046 crate::model::DataAttributeBinding,
12047 crate::model::OperationMetadata,
12048 > {
12049 type Operation = google_cloud_lro::internal::Operation<
12050 crate::model::DataAttributeBinding,
12051 crate::model::OperationMetadata,
12052 >;
12053 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12054 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12055
12056 let stub = self.0.stub.clone();
12057 let mut options = self.0.options.clone();
12058 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12059 let query = move |name| {
12060 let stub = stub.clone();
12061 let options = options.clone();
12062 async {
12063 let op = GetOperation::new(stub)
12064 .set_name(name)
12065 .with_options(options)
12066 .send()
12067 .await?;
12068 Ok(Operation::new(op))
12069 }
12070 };
12071
12072 let start = move || async {
12073 let op = self.send().await?;
12074 Ok(Operation::new(op))
12075 };
12076
12077 google_cloud_lro::internal::new_poller(
12078 polling_error_policy,
12079 polling_backoff_policy,
12080 start,
12081 query,
12082 )
12083 }
12084
12085 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12089 self.0.request.parent = v.into();
12090 self
12091 }
12092
12093 pub fn set_data_attribute_binding_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12097 self.0.request.data_attribute_binding_id = v.into();
12098 self
12099 }
12100
12101 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
12105 where
12106 T: std::convert::Into<crate::model::DataAttributeBinding>,
12107 {
12108 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
12109 self
12110 }
12111
12112 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
12116 where
12117 T: std::convert::Into<crate::model::DataAttributeBinding>,
12118 {
12119 self.0.request.data_attribute_binding = v.map(|x| x.into());
12120 self
12121 }
12122
12123 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12125 self.0.request.validate_only = v.into();
12126 self
12127 }
12128 }
12129
12130 #[doc(hidden)]
12131 impl crate::RequestBuilder for CreateDataAttributeBinding {
12132 fn request_options(&mut self) -> &mut crate::RequestOptions {
12133 &mut self.0.options
12134 }
12135 }
12136
12137 #[derive(Clone, Debug)]
12155 pub struct UpdateDataAttributeBinding(
12156 RequestBuilder<crate::model::UpdateDataAttributeBindingRequest>,
12157 );
12158
12159 impl UpdateDataAttributeBinding {
12160 pub(crate) fn new(
12161 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12162 ) -> Self {
12163 Self(RequestBuilder::new(stub))
12164 }
12165
12166 pub fn with_request<V: Into<crate::model::UpdateDataAttributeBindingRequest>>(
12168 mut self,
12169 v: V,
12170 ) -> Self {
12171 self.0.request = v.into();
12172 self
12173 }
12174
12175 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12177 self.0.options = v.into();
12178 self
12179 }
12180
12181 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12188 (*self.0.stub)
12189 .update_data_attribute_binding(self.0.request, self.0.options)
12190 .await
12191 .map(crate::Response::into_body)
12192 }
12193
12194 pub fn poller(
12196 self,
12197 ) -> impl google_cloud_lro::Poller<
12198 crate::model::DataAttributeBinding,
12199 crate::model::OperationMetadata,
12200 > {
12201 type Operation = google_cloud_lro::internal::Operation<
12202 crate::model::DataAttributeBinding,
12203 crate::model::OperationMetadata,
12204 >;
12205 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12206 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12207
12208 let stub = self.0.stub.clone();
12209 let mut options = self.0.options.clone();
12210 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12211 let query = move |name| {
12212 let stub = stub.clone();
12213 let options = options.clone();
12214 async {
12215 let op = GetOperation::new(stub)
12216 .set_name(name)
12217 .with_options(options)
12218 .send()
12219 .await?;
12220 Ok(Operation::new(op))
12221 }
12222 };
12223
12224 let start = move || async {
12225 let op = self.send().await?;
12226 Ok(Operation::new(op))
12227 };
12228
12229 google_cloud_lro::internal::new_poller(
12230 polling_error_policy,
12231 polling_backoff_policy,
12232 start,
12233 query,
12234 )
12235 }
12236
12237 pub fn set_update_mask<T>(mut self, v: T) -> Self
12241 where
12242 T: std::convert::Into<wkt::FieldMask>,
12243 {
12244 self.0.request.update_mask = std::option::Option::Some(v.into());
12245 self
12246 }
12247
12248 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12252 where
12253 T: std::convert::Into<wkt::FieldMask>,
12254 {
12255 self.0.request.update_mask = v.map(|x| x.into());
12256 self
12257 }
12258
12259 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
12263 where
12264 T: std::convert::Into<crate::model::DataAttributeBinding>,
12265 {
12266 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
12267 self
12268 }
12269
12270 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
12274 where
12275 T: std::convert::Into<crate::model::DataAttributeBinding>,
12276 {
12277 self.0.request.data_attribute_binding = v.map(|x| x.into());
12278 self
12279 }
12280
12281 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12283 self.0.request.validate_only = v.into();
12284 self
12285 }
12286 }
12287
12288 #[doc(hidden)]
12289 impl crate::RequestBuilder for UpdateDataAttributeBinding {
12290 fn request_options(&mut self) -> &mut crate::RequestOptions {
12291 &mut self.0.options
12292 }
12293 }
12294
12295 #[derive(Clone, Debug)]
12313 pub struct DeleteDataAttributeBinding(
12314 RequestBuilder<crate::model::DeleteDataAttributeBindingRequest>,
12315 );
12316
12317 impl DeleteDataAttributeBinding {
12318 pub(crate) fn new(
12319 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12320 ) -> Self {
12321 Self(RequestBuilder::new(stub))
12322 }
12323
12324 pub fn with_request<V: Into<crate::model::DeleteDataAttributeBindingRequest>>(
12326 mut self,
12327 v: V,
12328 ) -> Self {
12329 self.0.request = v.into();
12330 self
12331 }
12332
12333 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12335 self.0.options = v.into();
12336 self
12337 }
12338
12339 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12346 (*self.0.stub)
12347 .delete_data_attribute_binding(self.0.request, self.0.options)
12348 .await
12349 .map(crate::Response::into_body)
12350 }
12351
12352 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12354 type Operation =
12355 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12356 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12357 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12358
12359 let stub = self.0.stub.clone();
12360 let mut options = self.0.options.clone();
12361 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12362 let query = move |name| {
12363 let stub = stub.clone();
12364 let options = options.clone();
12365 async {
12366 let op = GetOperation::new(stub)
12367 .set_name(name)
12368 .with_options(options)
12369 .send()
12370 .await?;
12371 Ok(Operation::new(op))
12372 }
12373 };
12374
12375 let start = move || async {
12376 let op = self.send().await?;
12377 Ok(Operation::new(op))
12378 };
12379
12380 google_cloud_lro::internal::new_unit_response_poller(
12381 polling_error_policy,
12382 polling_backoff_policy,
12383 start,
12384 query,
12385 )
12386 }
12387
12388 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12392 self.0.request.name = v.into();
12393 self
12394 }
12395
12396 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
12400 self.0.request.etag = v.into();
12401 self
12402 }
12403 }
12404
12405 #[doc(hidden)]
12406 impl crate::RequestBuilder for DeleteDataAttributeBinding {
12407 fn request_options(&mut self) -> &mut crate::RequestOptions {
12408 &mut self.0.options
12409 }
12410 }
12411
12412 #[derive(Clone, Debug)]
12433 pub struct ListDataAttributeBindings(
12434 RequestBuilder<crate::model::ListDataAttributeBindingsRequest>,
12435 );
12436
12437 impl ListDataAttributeBindings {
12438 pub(crate) fn new(
12439 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12440 ) -> Self {
12441 Self(RequestBuilder::new(stub))
12442 }
12443
12444 pub fn with_request<V: Into<crate::model::ListDataAttributeBindingsRequest>>(
12446 mut self,
12447 v: V,
12448 ) -> Self {
12449 self.0.request = v.into();
12450 self
12451 }
12452
12453 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12455 self.0.options = v.into();
12456 self
12457 }
12458
12459 pub async fn send(self) -> Result<crate::model::ListDataAttributeBindingsResponse> {
12461 (*self.0.stub)
12462 .list_data_attribute_bindings(self.0.request, self.0.options)
12463 .await
12464 .map(crate::Response::into_body)
12465 }
12466
12467 pub fn by_page(
12469 self,
12470 ) -> impl google_cloud_gax::paginator::Paginator<
12471 crate::model::ListDataAttributeBindingsResponse,
12472 crate::Error,
12473 > {
12474 use std::clone::Clone;
12475 let token = self.0.request.page_token.clone();
12476 let execute = move |token: String| {
12477 let mut builder = self.clone();
12478 builder.0.request = builder.0.request.set_page_token(token);
12479 builder.send()
12480 };
12481 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12482 }
12483
12484 pub fn by_item(
12486 self,
12487 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12488 crate::model::ListDataAttributeBindingsResponse,
12489 crate::Error,
12490 > {
12491 use google_cloud_gax::paginator::Paginator;
12492 self.by_page().items()
12493 }
12494
12495 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12499 self.0.request.parent = v.into();
12500 self
12501 }
12502
12503 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12505 self.0.request.page_size = v.into();
12506 self
12507 }
12508
12509 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12511 self.0.request.page_token = v.into();
12512 self
12513 }
12514
12515 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12517 self.0.request.filter = v.into();
12518 self
12519 }
12520
12521 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12523 self.0.request.order_by = v.into();
12524 self
12525 }
12526 }
12527
12528 #[doc(hidden)]
12529 impl crate::RequestBuilder for ListDataAttributeBindings {
12530 fn request_options(&mut self) -> &mut crate::RequestOptions {
12531 &mut self.0.options
12532 }
12533 }
12534
12535 #[derive(Clone, Debug)]
12552 pub struct GetDataAttributeBinding(
12553 RequestBuilder<crate::model::GetDataAttributeBindingRequest>,
12554 );
12555
12556 impl GetDataAttributeBinding {
12557 pub(crate) fn new(
12558 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12559 ) -> Self {
12560 Self(RequestBuilder::new(stub))
12561 }
12562
12563 pub fn with_request<V: Into<crate::model::GetDataAttributeBindingRequest>>(
12565 mut self,
12566 v: V,
12567 ) -> Self {
12568 self.0.request = v.into();
12569 self
12570 }
12571
12572 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12574 self.0.options = v.into();
12575 self
12576 }
12577
12578 pub async fn send(self) -> Result<crate::model::DataAttributeBinding> {
12580 (*self.0.stub)
12581 .get_data_attribute_binding(self.0.request, self.0.options)
12582 .await
12583 .map(crate::Response::into_body)
12584 }
12585
12586 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12590 self.0.request.name = v.into();
12591 self
12592 }
12593 }
12594
12595 #[doc(hidden)]
12596 impl crate::RequestBuilder for GetDataAttributeBinding {
12597 fn request_options(&mut self) -> &mut crate::RequestOptions {
12598 &mut self.0.options
12599 }
12600 }
12601
12602 #[derive(Clone, Debug)]
12620 pub struct CreateDataAttribute(RequestBuilder<crate::model::CreateDataAttributeRequest>);
12621
12622 impl CreateDataAttribute {
12623 pub(crate) fn new(
12624 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12625 ) -> Self {
12626 Self(RequestBuilder::new(stub))
12627 }
12628
12629 pub fn with_request<V: Into<crate::model::CreateDataAttributeRequest>>(
12631 mut self,
12632 v: V,
12633 ) -> Self {
12634 self.0.request = v.into();
12635 self
12636 }
12637
12638 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12640 self.0.options = v.into();
12641 self
12642 }
12643
12644 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12651 (*self.0.stub)
12652 .create_data_attribute(self.0.request, self.0.options)
12653 .await
12654 .map(crate::Response::into_body)
12655 }
12656
12657 pub fn poller(
12659 self,
12660 ) -> impl google_cloud_lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
12661 {
12662 type Operation = google_cloud_lro::internal::Operation<
12663 crate::model::DataAttribute,
12664 crate::model::OperationMetadata,
12665 >;
12666 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12667 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12668
12669 let stub = self.0.stub.clone();
12670 let mut options = self.0.options.clone();
12671 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12672 let query = move |name| {
12673 let stub = stub.clone();
12674 let options = options.clone();
12675 async {
12676 let op = GetOperation::new(stub)
12677 .set_name(name)
12678 .with_options(options)
12679 .send()
12680 .await?;
12681 Ok(Operation::new(op))
12682 }
12683 };
12684
12685 let start = move || async {
12686 let op = self.send().await?;
12687 Ok(Operation::new(op))
12688 };
12689
12690 google_cloud_lro::internal::new_poller(
12691 polling_error_policy,
12692 polling_backoff_policy,
12693 start,
12694 query,
12695 )
12696 }
12697
12698 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12702 self.0.request.parent = v.into();
12703 self
12704 }
12705
12706 pub fn set_data_attribute_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12710 self.0.request.data_attribute_id = v.into();
12711 self
12712 }
12713
12714 pub fn set_data_attribute<T>(mut self, v: T) -> Self
12718 where
12719 T: std::convert::Into<crate::model::DataAttribute>,
12720 {
12721 self.0.request.data_attribute = std::option::Option::Some(v.into());
12722 self
12723 }
12724
12725 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
12729 where
12730 T: std::convert::Into<crate::model::DataAttribute>,
12731 {
12732 self.0.request.data_attribute = v.map(|x| x.into());
12733 self
12734 }
12735
12736 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12738 self.0.request.validate_only = v.into();
12739 self
12740 }
12741 }
12742
12743 #[doc(hidden)]
12744 impl crate::RequestBuilder for CreateDataAttribute {
12745 fn request_options(&mut self) -> &mut crate::RequestOptions {
12746 &mut self.0.options
12747 }
12748 }
12749
12750 #[derive(Clone, Debug)]
12768 pub struct UpdateDataAttribute(RequestBuilder<crate::model::UpdateDataAttributeRequest>);
12769
12770 impl UpdateDataAttribute {
12771 pub(crate) fn new(
12772 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12773 ) -> Self {
12774 Self(RequestBuilder::new(stub))
12775 }
12776
12777 pub fn with_request<V: Into<crate::model::UpdateDataAttributeRequest>>(
12779 mut self,
12780 v: V,
12781 ) -> Self {
12782 self.0.request = v.into();
12783 self
12784 }
12785
12786 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12788 self.0.options = v.into();
12789 self
12790 }
12791
12792 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12799 (*self.0.stub)
12800 .update_data_attribute(self.0.request, self.0.options)
12801 .await
12802 .map(crate::Response::into_body)
12803 }
12804
12805 pub fn poller(
12807 self,
12808 ) -> impl google_cloud_lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
12809 {
12810 type Operation = google_cloud_lro::internal::Operation<
12811 crate::model::DataAttribute,
12812 crate::model::OperationMetadata,
12813 >;
12814 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12815 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12816
12817 let stub = self.0.stub.clone();
12818 let mut options = self.0.options.clone();
12819 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12820 let query = move |name| {
12821 let stub = stub.clone();
12822 let options = options.clone();
12823 async {
12824 let op = GetOperation::new(stub)
12825 .set_name(name)
12826 .with_options(options)
12827 .send()
12828 .await?;
12829 Ok(Operation::new(op))
12830 }
12831 };
12832
12833 let start = move || async {
12834 let op = self.send().await?;
12835 Ok(Operation::new(op))
12836 };
12837
12838 google_cloud_lro::internal::new_poller(
12839 polling_error_policy,
12840 polling_backoff_policy,
12841 start,
12842 query,
12843 )
12844 }
12845
12846 pub fn set_update_mask<T>(mut self, v: T) -> Self
12850 where
12851 T: std::convert::Into<wkt::FieldMask>,
12852 {
12853 self.0.request.update_mask = std::option::Option::Some(v.into());
12854 self
12855 }
12856
12857 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12861 where
12862 T: std::convert::Into<wkt::FieldMask>,
12863 {
12864 self.0.request.update_mask = v.map(|x| x.into());
12865 self
12866 }
12867
12868 pub fn set_data_attribute<T>(mut self, v: T) -> Self
12872 where
12873 T: std::convert::Into<crate::model::DataAttribute>,
12874 {
12875 self.0.request.data_attribute = std::option::Option::Some(v.into());
12876 self
12877 }
12878
12879 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
12883 where
12884 T: std::convert::Into<crate::model::DataAttribute>,
12885 {
12886 self.0.request.data_attribute = v.map(|x| x.into());
12887 self
12888 }
12889
12890 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12892 self.0.request.validate_only = v.into();
12893 self
12894 }
12895 }
12896
12897 #[doc(hidden)]
12898 impl crate::RequestBuilder for UpdateDataAttribute {
12899 fn request_options(&mut self) -> &mut crate::RequestOptions {
12900 &mut self.0.options
12901 }
12902 }
12903
12904 #[derive(Clone, Debug)]
12922 pub struct DeleteDataAttribute(RequestBuilder<crate::model::DeleteDataAttributeRequest>);
12923
12924 impl DeleteDataAttribute {
12925 pub(crate) fn new(
12926 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12927 ) -> Self {
12928 Self(RequestBuilder::new(stub))
12929 }
12930
12931 pub fn with_request<V: Into<crate::model::DeleteDataAttributeRequest>>(
12933 mut self,
12934 v: V,
12935 ) -> Self {
12936 self.0.request = v.into();
12937 self
12938 }
12939
12940 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12942 self.0.options = v.into();
12943 self
12944 }
12945
12946 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12953 (*self.0.stub)
12954 .delete_data_attribute(self.0.request, self.0.options)
12955 .await
12956 .map(crate::Response::into_body)
12957 }
12958
12959 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12961 type Operation =
12962 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12963 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12964 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12965
12966 let stub = self.0.stub.clone();
12967 let mut options = self.0.options.clone();
12968 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12969 let query = move |name| {
12970 let stub = stub.clone();
12971 let options = options.clone();
12972 async {
12973 let op = GetOperation::new(stub)
12974 .set_name(name)
12975 .with_options(options)
12976 .send()
12977 .await?;
12978 Ok(Operation::new(op))
12979 }
12980 };
12981
12982 let start = move || async {
12983 let op = self.send().await?;
12984 Ok(Operation::new(op))
12985 };
12986
12987 google_cloud_lro::internal::new_unit_response_poller(
12988 polling_error_policy,
12989 polling_backoff_policy,
12990 start,
12991 query,
12992 )
12993 }
12994
12995 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12999 self.0.request.name = v.into();
13000 self
13001 }
13002
13003 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
13005 self.0.request.etag = v.into();
13006 self
13007 }
13008 }
13009
13010 #[doc(hidden)]
13011 impl crate::RequestBuilder for DeleteDataAttribute {
13012 fn request_options(&mut self) -> &mut crate::RequestOptions {
13013 &mut self.0.options
13014 }
13015 }
13016
13017 #[derive(Clone, Debug)]
13038 pub struct ListDataAttributes(RequestBuilder<crate::model::ListDataAttributesRequest>);
13039
13040 impl ListDataAttributes {
13041 pub(crate) fn new(
13042 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13043 ) -> Self {
13044 Self(RequestBuilder::new(stub))
13045 }
13046
13047 pub fn with_request<V: Into<crate::model::ListDataAttributesRequest>>(
13049 mut self,
13050 v: V,
13051 ) -> Self {
13052 self.0.request = v.into();
13053 self
13054 }
13055
13056 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13058 self.0.options = v.into();
13059 self
13060 }
13061
13062 pub async fn send(self) -> Result<crate::model::ListDataAttributesResponse> {
13064 (*self.0.stub)
13065 .list_data_attributes(self.0.request, self.0.options)
13066 .await
13067 .map(crate::Response::into_body)
13068 }
13069
13070 pub fn by_page(
13072 self,
13073 ) -> impl google_cloud_gax::paginator::Paginator<
13074 crate::model::ListDataAttributesResponse,
13075 crate::Error,
13076 > {
13077 use std::clone::Clone;
13078 let token = self.0.request.page_token.clone();
13079 let execute = move |token: String| {
13080 let mut builder = self.clone();
13081 builder.0.request = builder.0.request.set_page_token(token);
13082 builder.send()
13083 };
13084 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13085 }
13086
13087 pub fn by_item(
13089 self,
13090 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13091 crate::model::ListDataAttributesResponse,
13092 crate::Error,
13093 > {
13094 use google_cloud_gax::paginator::Paginator;
13095 self.by_page().items()
13096 }
13097
13098 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13102 self.0.request.parent = v.into();
13103 self
13104 }
13105
13106 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13108 self.0.request.page_size = v.into();
13109 self
13110 }
13111
13112 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13114 self.0.request.page_token = v.into();
13115 self
13116 }
13117
13118 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13120 self.0.request.filter = v.into();
13121 self
13122 }
13123
13124 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
13126 self.0.request.order_by = v.into();
13127 self
13128 }
13129 }
13130
13131 #[doc(hidden)]
13132 impl crate::RequestBuilder for ListDataAttributes {
13133 fn request_options(&mut self) -> &mut crate::RequestOptions {
13134 &mut self.0.options
13135 }
13136 }
13137
13138 #[derive(Clone, Debug)]
13155 pub struct GetDataAttribute(RequestBuilder<crate::model::GetDataAttributeRequest>);
13156
13157 impl GetDataAttribute {
13158 pub(crate) fn new(
13159 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13160 ) -> Self {
13161 Self(RequestBuilder::new(stub))
13162 }
13163
13164 pub fn with_request<V: Into<crate::model::GetDataAttributeRequest>>(
13166 mut self,
13167 v: V,
13168 ) -> Self {
13169 self.0.request = v.into();
13170 self
13171 }
13172
13173 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13175 self.0.options = v.into();
13176 self
13177 }
13178
13179 pub async fn send(self) -> Result<crate::model::DataAttribute> {
13181 (*self.0.stub)
13182 .get_data_attribute(self.0.request, self.0.options)
13183 .await
13184 .map(crate::Response::into_body)
13185 }
13186
13187 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13191 self.0.request.name = v.into();
13192 self
13193 }
13194 }
13195
13196 #[doc(hidden)]
13197 impl crate::RequestBuilder for GetDataAttribute {
13198 fn request_options(&mut self) -> &mut crate::RequestOptions {
13199 &mut self.0.options
13200 }
13201 }
13202
13203 #[derive(Clone, Debug)]
13224 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13225
13226 impl ListLocations {
13227 pub(crate) fn new(
13228 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13229 ) -> Self {
13230 Self(RequestBuilder::new(stub))
13231 }
13232
13233 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13235 mut self,
13236 v: V,
13237 ) -> Self {
13238 self.0.request = v.into();
13239 self
13240 }
13241
13242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13244 self.0.options = v.into();
13245 self
13246 }
13247
13248 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13250 (*self.0.stub)
13251 .list_locations(self.0.request, self.0.options)
13252 .await
13253 .map(crate::Response::into_body)
13254 }
13255
13256 pub fn by_page(
13258 self,
13259 ) -> impl google_cloud_gax::paginator::Paginator<
13260 google_cloud_location::model::ListLocationsResponse,
13261 crate::Error,
13262 > {
13263 use std::clone::Clone;
13264 let token = self.0.request.page_token.clone();
13265 let execute = move |token: String| {
13266 let mut builder = self.clone();
13267 builder.0.request = builder.0.request.set_page_token(token);
13268 builder.send()
13269 };
13270 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13271 }
13272
13273 pub fn by_item(
13275 self,
13276 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13277 google_cloud_location::model::ListLocationsResponse,
13278 crate::Error,
13279 > {
13280 use google_cloud_gax::paginator::Paginator;
13281 self.by_page().items()
13282 }
13283
13284 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13286 self.0.request.name = v.into();
13287 self
13288 }
13289
13290 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13292 self.0.request.filter = v.into();
13293 self
13294 }
13295
13296 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13298 self.0.request.page_size = v.into();
13299 self
13300 }
13301
13302 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13304 self.0.request.page_token = v.into();
13305 self
13306 }
13307 }
13308
13309 #[doc(hidden)]
13310 impl crate::RequestBuilder for ListLocations {
13311 fn request_options(&mut self) -> &mut crate::RequestOptions {
13312 &mut self.0.options
13313 }
13314 }
13315
13316 #[derive(Clone, Debug)]
13333 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13334
13335 impl GetLocation {
13336 pub(crate) fn new(
13337 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13338 ) -> Self {
13339 Self(RequestBuilder::new(stub))
13340 }
13341
13342 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13344 mut self,
13345 v: V,
13346 ) -> Self {
13347 self.0.request = v.into();
13348 self
13349 }
13350
13351 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13353 self.0.options = v.into();
13354 self
13355 }
13356
13357 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13359 (*self.0.stub)
13360 .get_location(self.0.request, self.0.options)
13361 .await
13362 .map(crate::Response::into_body)
13363 }
13364
13365 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13367 self.0.request.name = v.into();
13368 self
13369 }
13370 }
13371
13372 #[doc(hidden)]
13373 impl crate::RequestBuilder for GetLocation {
13374 fn request_options(&mut self) -> &mut crate::RequestOptions {
13375 &mut self.0.options
13376 }
13377 }
13378
13379 #[derive(Clone, Debug)]
13396 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
13397
13398 impl SetIamPolicy {
13399 pub(crate) fn new(
13400 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13401 ) -> Self {
13402 Self(RequestBuilder::new(stub))
13403 }
13404
13405 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
13407 mut self,
13408 v: V,
13409 ) -> Self {
13410 self.0.request = v.into();
13411 self
13412 }
13413
13414 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13416 self.0.options = v.into();
13417 self
13418 }
13419
13420 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13422 (*self.0.stub)
13423 .set_iam_policy(self.0.request, self.0.options)
13424 .await
13425 .map(crate::Response::into_body)
13426 }
13427
13428 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13432 self.0.request.resource = v.into();
13433 self
13434 }
13435
13436 pub fn set_policy<T>(mut self, v: T) -> Self
13440 where
13441 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13442 {
13443 self.0.request.policy = std::option::Option::Some(v.into());
13444 self
13445 }
13446
13447 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
13451 where
13452 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13453 {
13454 self.0.request.policy = v.map(|x| x.into());
13455 self
13456 }
13457
13458 pub fn set_update_mask<T>(mut self, v: T) -> Self
13460 where
13461 T: std::convert::Into<wkt::FieldMask>,
13462 {
13463 self.0.request.update_mask = std::option::Option::Some(v.into());
13464 self
13465 }
13466
13467 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13469 where
13470 T: std::convert::Into<wkt::FieldMask>,
13471 {
13472 self.0.request.update_mask = v.map(|x| x.into());
13473 self
13474 }
13475 }
13476
13477 #[doc(hidden)]
13478 impl crate::RequestBuilder for SetIamPolicy {
13479 fn request_options(&mut self) -> &mut crate::RequestOptions {
13480 &mut self.0.options
13481 }
13482 }
13483
13484 #[derive(Clone, Debug)]
13501 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
13502
13503 impl GetIamPolicy {
13504 pub(crate) fn new(
13505 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13506 ) -> Self {
13507 Self(RequestBuilder::new(stub))
13508 }
13509
13510 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
13512 mut self,
13513 v: V,
13514 ) -> Self {
13515 self.0.request = v.into();
13516 self
13517 }
13518
13519 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13521 self.0.options = v.into();
13522 self
13523 }
13524
13525 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13527 (*self.0.stub)
13528 .get_iam_policy(self.0.request, self.0.options)
13529 .await
13530 .map(crate::Response::into_body)
13531 }
13532
13533 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13537 self.0.request.resource = v.into();
13538 self
13539 }
13540
13541 pub fn set_options<T>(mut self, v: T) -> Self
13543 where
13544 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13545 {
13546 self.0.request.options = std::option::Option::Some(v.into());
13547 self
13548 }
13549
13550 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
13552 where
13553 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13554 {
13555 self.0.request.options = v.map(|x| x.into());
13556 self
13557 }
13558 }
13559
13560 #[doc(hidden)]
13561 impl crate::RequestBuilder for GetIamPolicy {
13562 fn request_options(&mut self) -> &mut crate::RequestOptions {
13563 &mut self.0.options
13564 }
13565 }
13566
13567 #[derive(Clone, Debug)]
13584 pub struct TestIamPermissions(
13585 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
13586 );
13587
13588 impl TestIamPermissions {
13589 pub(crate) fn new(
13590 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13591 ) -> Self {
13592 Self(RequestBuilder::new(stub))
13593 }
13594
13595 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
13597 mut self,
13598 v: V,
13599 ) -> Self {
13600 self.0.request = v.into();
13601 self
13602 }
13603
13604 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13606 self.0.options = v.into();
13607 self
13608 }
13609
13610 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
13612 (*self.0.stub)
13613 .test_iam_permissions(self.0.request, self.0.options)
13614 .await
13615 .map(crate::Response::into_body)
13616 }
13617
13618 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13622 self.0.request.resource = v.into();
13623 self
13624 }
13625
13626 pub fn set_permissions<T, V>(mut self, v: T) -> Self
13630 where
13631 T: std::iter::IntoIterator<Item = V>,
13632 V: std::convert::Into<std::string::String>,
13633 {
13634 use std::iter::Iterator;
13635 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
13636 self
13637 }
13638 }
13639
13640 #[doc(hidden)]
13641 impl crate::RequestBuilder for TestIamPermissions {
13642 fn request_options(&mut self) -> &mut crate::RequestOptions {
13643 &mut self.0.options
13644 }
13645 }
13646
13647 #[derive(Clone, Debug)]
13668 pub struct ListOperations(
13669 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13670 );
13671
13672 impl ListOperations {
13673 pub(crate) fn new(
13674 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13675 ) -> Self {
13676 Self(RequestBuilder::new(stub))
13677 }
13678
13679 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13681 mut self,
13682 v: V,
13683 ) -> Self {
13684 self.0.request = v.into();
13685 self
13686 }
13687
13688 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13690 self.0.options = v.into();
13691 self
13692 }
13693
13694 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13696 (*self.0.stub)
13697 .list_operations(self.0.request, self.0.options)
13698 .await
13699 .map(crate::Response::into_body)
13700 }
13701
13702 pub fn by_page(
13704 self,
13705 ) -> impl google_cloud_gax::paginator::Paginator<
13706 google_cloud_longrunning::model::ListOperationsResponse,
13707 crate::Error,
13708 > {
13709 use std::clone::Clone;
13710 let token = self.0.request.page_token.clone();
13711 let execute = move |token: String| {
13712 let mut builder = self.clone();
13713 builder.0.request = builder.0.request.set_page_token(token);
13714 builder.send()
13715 };
13716 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13717 }
13718
13719 pub fn by_item(
13721 self,
13722 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13723 google_cloud_longrunning::model::ListOperationsResponse,
13724 crate::Error,
13725 > {
13726 use google_cloud_gax::paginator::Paginator;
13727 self.by_page().items()
13728 }
13729
13730 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13732 self.0.request.name = v.into();
13733 self
13734 }
13735
13736 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13738 self.0.request.filter = v.into();
13739 self
13740 }
13741
13742 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13744 self.0.request.page_size = v.into();
13745 self
13746 }
13747
13748 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13750 self.0.request.page_token = v.into();
13751 self
13752 }
13753
13754 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13756 self.0.request.return_partial_success = v.into();
13757 self
13758 }
13759 }
13760
13761 #[doc(hidden)]
13762 impl crate::RequestBuilder for ListOperations {
13763 fn request_options(&mut self) -> &mut crate::RequestOptions {
13764 &mut self.0.options
13765 }
13766 }
13767
13768 #[derive(Clone, Debug)]
13785 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13786
13787 impl GetOperation {
13788 pub(crate) fn new(
13789 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13790 ) -> Self {
13791 Self(RequestBuilder::new(stub))
13792 }
13793
13794 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13796 mut self,
13797 v: V,
13798 ) -> Self {
13799 self.0.request = v.into();
13800 self
13801 }
13802
13803 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13805 self.0.options = v.into();
13806 self
13807 }
13808
13809 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13811 (*self.0.stub)
13812 .get_operation(self.0.request, self.0.options)
13813 .await
13814 .map(crate::Response::into_body)
13815 }
13816
13817 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13819 self.0.request.name = v.into();
13820 self
13821 }
13822 }
13823
13824 #[doc(hidden)]
13825 impl crate::RequestBuilder for GetOperation {
13826 fn request_options(&mut self) -> &mut crate::RequestOptions {
13827 &mut self.0.options
13828 }
13829 }
13830
13831 #[derive(Clone, Debug)]
13848 pub struct DeleteOperation(
13849 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
13850 );
13851
13852 impl DeleteOperation {
13853 pub(crate) fn new(
13854 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13855 ) -> Self {
13856 Self(RequestBuilder::new(stub))
13857 }
13858
13859 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
13861 mut self,
13862 v: V,
13863 ) -> Self {
13864 self.0.request = v.into();
13865 self
13866 }
13867
13868 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13870 self.0.options = v.into();
13871 self
13872 }
13873
13874 pub async fn send(self) -> Result<()> {
13876 (*self.0.stub)
13877 .delete_operation(self.0.request, self.0.options)
13878 .await
13879 .map(crate::Response::into_body)
13880 }
13881
13882 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13884 self.0.request.name = v.into();
13885 self
13886 }
13887 }
13888
13889 #[doc(hidden)]
13890 impl crate::RequestBuilder for DeleteOperation {
13891 fn request_options(&mut self) -> &mut crate::RequestOptions {
13892 &mut self.0.options
13893 }
13894 }
13895
13896 #[derive(Clone, Debug)]
13913 pub struct CancelOperation(
13914 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13915 );
13916
13917 impl CancelOperation {
13918 pub(crate) fn new(
13919 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13920 ) -> Self {
13921 Self(RequestBuilder::new(stub))
13922 }
13923
13924 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13926 mut self,
13927 v: V,
13928 ) -> Self {
13929 self.0.request = v.into();
13930 self
13931 }
13932
13933 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13935 self.0.options = v.into();
13936 self
13937 }
13938
13939 pub async fn send(self) -> Result<()> {
13941 (*self.0.stub)
13942 .cancel_operation(self.0.request, self.0.options)
13943 .await
13944 .map(crate::Response::into_body)
13945 }
13946
13947 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13949 self.0.request.name = v.into();
13950 self
13951 }
13952 }
13953
13954 #[doc(hidden)]
13955 impl crate::RequestBuilder for CancelOperation {
13956 fn request_options(&mut self) -> &mut crate::RequestOptions {
13957 &mut self.0.options
13958 }
13959 }
13960}
13961
13962pub mod data_scan_service {
13964 use crate::Result;
13965
13966 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13980
13981 pub(crate) mod client {
13982 use super::super::super::client::DataScanService;
13983 pub struct Factory;
13984 impl crate::ClientFactory for Factory {
13985 type Client = DataScanService;
13986 type Credentials = gaxi::options::Credentials;
13987 async fn build(
13988 self,
13989 config: gaxi::options::ClientConfig,
13990 ) -> crate::ClientBuilderResult<Self::Client> {
13991 Self::Client::new(config).await
13992 }
13993 }
13994 }
13995
13996 #[derive(Clone, Debug)]
13998 pub(crate) struct RequestBuilder<R: std::default::Default> {
13999 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14000 request: R,
14001 options: crate::RequestOptions,
14002 }
14003
14004 impl<R> RequestBuilder<R>
14005 where
14006 R: std::default::Default,
14007 {
14008 pub(crate) fn new(
14009 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14010 ) -> Self {
14011 Self {
14012 stub,
14013 request: R::default(),
14014 options: crate::RequestOptions::default(),
14015 }
14016 }
14017 }
14018
14019 #[derive(Clone, Debug)]
14037 pub struct CreateDataScan(RequestBuilder<crate::model::CreateDataScanRequest>);
14038
14039 impl CreateDataScan {
14040 pub(crate) fn new(
14041 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14042 ) -> Self {
14043 Self(RequestBuilder::new(stub))
14044 }
14045
14046 pub fn with_request<V: Into<crate::model::CreateDataScanRequest>>(mut self, v: V) -> Self {
14048 self.0.request = v.into();
14049 self
14050 }
14051
14052 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14054 self.0.options = v.into();
14055 self
14056 }
14057
14058 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14065 (*self.0.stub)
14066 .create_data_scan(self.0.request, self.0.options)
14067 .await
14068 .map(crate::Response::into_body)
14069 }
14070
14071 pub fn poller(
14073 self,
14074 ) -> impl google_cloud_lro::Poller<crate::model::DataScan, crate::model::OperationMetadata>
14075 {
14076 type Operation = google_cloud_lro::internal::Operation<
14077 crate::model::DataScan,
14078 crate::model::OperationMetadata,
14079 >;
14080 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14081 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14082
14083 let stub = self.0.stub.clone();
14084 let mut options = self.0.options.clone();
14085 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14086 let query = move |name| {
14087 let stub = stub.clone();
14088 let options = options.clone();
14089 async {
14090 let op = GetOperation::new(stub)
14091 .set_name(name)
14092 .with_options(options)
14093 .send()
14094 .await?;
14095 Ok(Operation::new(op))
14096 }
14097 };
14098
14099 let start = move || async {
14100 let op = self.send().await?;
14101 Ok(Operation::new(op))
14102 };
14103
14104 google_cloud_lro::internal::new_poller(
14105 polling_error_policy,
14106 polling_backoff_policy,
14107 start,
14108 query,
14109 )
14110 }
14111
14112 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14116 self.0.request.parent = v.into();
14117 self
14118 }
14119
14120 pub fn set_data_scan<T>(mut self, v: T) -> Self
14124 where
14125 T: std::convert::Into<crate::model::DataScan>,
14126 {
14127 self.0.request.data_scan = std::option::Option::Some(v.into());
14128 self
14129 }
14130
14131 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
14135 where
14136 T: std::convert::Into<crate::model::DataScan>,
14137 {
14138 self.0.request.data_scan = v.map(|x| x.into());
14139 self
14140 }
14141
14142 pub fn set_data_scan_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14146 self.0.request.data_scan_id = v.into();
14147 self
14148 }
14149
14150 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14152 self.0.request.validate_only = v.into();
14153 self
14154 }
14155 }
14156
14157 #[doc(hidden)]
14158 impl crate::RequestBuilder for CreateDataScan {
14159 fn request_options(&mut self) -> &mut crate::RequestOptions {
14160 &mut self.0.options
14161 }
14162 }
14163
14164 #[derive(Clone, Debug)]
14182 pub struct UpdateDataScan(RequestBuilder<crate::model::UpdateDataScanRequest>);
14183
14184 impl UpdateDataScan {
14185 pub(crate) fn new(
14186 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14187 ) -> Self {
14188 Self(RequestBuilder::new(stub))
14189 }
14190
14191 pub fn with_request<V: Into<crate::model::UpdateDataScanRequest>>(mut self, v: V) -> Self {
14193 self.0.request = v.into();
14194 self
14195 }
14196
14197 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14199 self.0.options = v.into();
14200 self
14201 }
14202
14203 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14210 (*self.0.stub)
14211 .update_data_scan(self.0.request, self.0.options)
14212 .await
14213 .map(crate::Response::into_body)
14214 }
14215
14216 pub fn poller(
14218 self,
14219 ) -> impl google_cloud_lro::Poller<crate::model::DataScan, crate::model::OperationMetadata>
14220 {
14221 type Operation = google_cloud_lro::internal::Operation<
14222 crate::model::DataScan,
14223 crate::model::OperationMetadata,
14224 >;
14225 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14226 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14227
14228 let stub = self.0.stub.clone();
14229 let mut options = self.0.options.clone();
14230 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14231 let query = move |name| {
14232 let stub = stub.clone();
14233 let options = options.clone();
14234 async {
14235 let op = GetOperation::new(stub)
14236 .set_name(name)
14237 .with_options(options)
14238 .send()
14239 .await?;
14240 Ok(Operation::new(op))
14241 }
14242 };
14243
14244 let start = move || async {
14245 let op = self.send().await?;
14246 Ok(Operation::new(op))
14247 };
14248
14249 google_cloud_lro::internal::new_poller(
14250 polling_error_policy,
14251 polling_backoff_policy,
14252 start,
14253 query,
14254 )
14255 }
14256
14257 pub fn set_data_scan<T>(mut self, v: T) -> Self
14261 where
14262 T: std::convert::Into<crate::model::DataScan>,
14263 {
14264 self.0.request.data_scan = std::option::Option::Some(v.into());
14265 self
14266 }
14267
14268 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
14272 where
14273 T: std::convert::Into<crate::model::DataScan>,
14274 {
14275 self.0.request.data_scan = v.map(|x| x.into());
14276 self
14277 }
14278
14279 pub fn set_update_mask<T>(mut self, v: T) -> Self
14281 where
14282 T: std::convert::Into<wkt::FieldMask>,
14283 {
14284 self.0.request.update_mask = std::option::Option::Some(v.into());
14285 self
14286 }
14287
14288 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14290 where
14291 T: std::convert::Into<wkt::FieldMask>,
14292 {
14293 self.0.request.update_mask = v.map(|x| x.into());
14294 self
14295 }
14296
14297 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14299 self.0.request.validate_only = v.into();
14300 self
14301 }
14302 }
14303
14304 #[doc(hidden)]
14305 impl crate::RequestBuilder for UpdateDataScan {
14306 fn request_options(&mut self) -> &mut crate::RequestOptions {
14307 &mut self.0.options
14308 }
14309 }
14310
14311 #[derive(Clone, Debug)]
14329 pub struct DeleteDataScan(RequestBuilder<crate::model::DeleteDataScanRequest>);
14330
14331 impl DeleteDataScan {
14332 pub(crate) fn new(
14333 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14334 ) -> Self {
14335 Self(RequestBuilder::new(stub))
14336 }
14337
14338 pub fn with_request<V: Into<crate::model::DeleteDataScanRequest>>(mut self, v: V) -> Self {
14340 self.0.request = v.into();
14341 self
14342 }
14343
14344 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14346 self.0.options = v.into();
14347 self
14348 }
14349
14350 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14357 (*self.0.stub)
14358 .delete_data_scan(self.0.request, self.0.options)
14359 .await
14360 .map(crate::Response::into_body)
14361 }
14362
14363 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14365 type Operation =
14366 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14367 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14368 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14369
14370 let stub = self.0.stub.clone();
14371 let mut options = self.0.options.clone();
14372 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14373 let query = move |name| {
14374 let stub = stub.clone();
14375 let options = options.clone();
14376 async {
14377 let op = GetOperation::new(stub)
14378 .set_name(name)
14379 .with_options(options)
14380 .send()
14381 .await?;
14382 Ok(Operation::new(op))
14383 }
14384 };
14385
14386 let start = move || async {
14387 let op = self.send().await?;
14388 Ok(Operation::new(op))
14389 };
14390
14391 google_cloud_lro::internal::new_unit_response_poller(
14392 polling_error_policy,
14393 polling_backoff_policy,
14394 start,
14395 query,
14396 )
14397 }
14398
14399 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14403 self.0.request.name = v.into();
14404 self
14405 }
14406
14407 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
14409 self.0.request.force = v.into();
14410 self
14411 }
14412 }
14413
14414 #[doc(hidden)]
14415 impl crate::RequestBuilder for DeleteDataScan {
14416 fn request_options(&mut self) -> &mut crate::RequestOptions {
14417 &mut self.0.options
14418 }
14419 }
14420
14421 #[derive(Clone, Debug)]
14438 pub struct GetDataScan(RequestBuilder<crate::model::GetDataScanRequest>);
14439
14440 impl GetDataScan {
14441 pub(crate) fn new(
14442 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14443 ) -> Self {
14444 Self(RequestBuilder::new(stub))
14445 }
14446
14447 pub fn with_request<V: Into<crate::model::GetDataScanRequest>>(mut self, v: V) -> Self {
14449 self.0.request = v.into();
14450 self
14451 }
14452
14453 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14455 self.0.options = v.into();
14456 self
14457 }
14458
14459 pub async fn send(self) -> Result<crate::model::DataScan> {
14461 (*self.0.stub)
14462 .get_data_scan(self.0.request, self.0.options)
14463 .await
14464 .map(crate::Response::into_body)
14465 }
14466
14467 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14471 self.0.request.name = v.into();
14472 self
14473 }
14474
14475 pub fn set_view<T: Into<crate::model::get_data_scan_request::DataScanView>>(
14477 mut self,
14478 v: T,
14479 ) -> Self {
14480 self.0.request.view = v.into();
14481 self
14482 }
14483 }
14484
14485 #[doc(hidden)]
14486 impl crate::RequestBuilder for GetDataScan {
14487 fn request_options(&mut self) -> &mut crate::RequestOptions {
14488 &mut self.0.options
14489 }
14490 }
14491
14492 #[derive(Clone, Debug)]
14513 pub struct ListDataScans(RequestBuilder<crate::model::ListDataScansRequest>);
14514
14515 impl ListDataScans {
14516 pub(crate) fn new(
14517 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14518 ) -> Self {
14519 Self(RequestBuilder::new(stub))
14520 }
14521
14522 pub fn with_request<V: Into<crate::model::ListDataScansRequest>>(mut self, v: V) -> Self {
14524 self.0.request = v.into();
14525 self
14526 }
14527
14528 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14530 self.0.options = v.into();
14531 self
14532 }
14533
14534 pub async fn send(self) -> Result<crate::model::ListDataScansResponse> {
14536 (*self.0.stub)
14537 .list_data_scans(self.0.request, self.0.options)
14538 .await
14539 .map(crate::Response::into_body)
14540 }
14541
14542 pub fn by_page(
14544 self,
14545 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListDataScansResponse, crate::Error>
14546 {
14547 use std::clone::Clone;
14548 let token = self.0.request.page_token.clone();
14549 let execute = move |token: String| {
14550 let mut builder = self.clone();
14551 builder.0.request = builder.0.request.set_page_token(token);
14552 builder.send()
14553 };
14554 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14555 }
14556
14557 pub fn by_item(
14559 self,
14560 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14561 crate::model::ListDataScansResponse,
14562 crate::Error,
14563 > {
14564 use google_cloud_gax::paginator::Paginator;
14565 self.by_page().items()
14566 }
14567
14568 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14572 self.0.request.parent = v.into();
14573 self
14574 }
14575
14576 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14578 self.0.request.page_size = v.into();
14579 self
14580 }
14581
14582 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14584 self.0.request.page_token = v.into();
14585 self
14586 }
14587
14588 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14590 self.0.request.filter = v.into();
14591 self
14592 }
14593
14594 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
14596 self.0.request.order_by = v.into();
14597 self
14598 }
14599 }
14600
14601 #[doc(hidden)]
14602 impl crate::RequestBuilder for ListDataScans {
14603 fn request_options(&mut self) -> &mut crate::RequestOptions {
14604 &mut self.0.options
14605 }
14606 }
14607
14608 #[derive(Clone, Debug)]
14625 pub struct RunDataScan(RequestBuilder<crate::model::RunDataScanRequest>);
14626
14627 impl RunDataScan {
14628 pub(crate) fn new(
14629 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14630 ) -> Self {
14631 Self(RequestBuilder::new(stub))
14632 }
14633
14634 pub fn with_request<V: Into<crate::model::RunDataScanRequest>>(mut self, v: V) -> Self {
14636 self.0.request = v.into();
14637 self
14638 }
14639
14640 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14642 self.0.options = v.into();
14643 self
14644 }
14645
14646 pub async fn send(self) -> Result<crate::model::RunDataScanResponse> {
14648 (*self.0.stub)
14649 .run_data_scan(self.0.request, self.0.options)
14650 .await
14651 .map(crate::Response::into_body)
14652 }
14653
14654 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14658 self.0.request.name = v.into();
14659 self
14660 }
14661 }
14662
14663 #[doc(hidden)]
14664 impl crate::RequestBuilder for RunDataScan {
14665 fn request_options(&mut self) -> &mut crate::RequestOptions {
14666 &mut self.0.options
14667 }
14668 }
14669
14670 #[derive(Clone, Debug)]
14687 pub struct GetDataScanJob(RequestBuilder<crate::model::GetDataScanJobRequest>);
14688
14689 impl GetDataScanJob {
14690 pub(crate) fn new(
14691 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14692 ) -> Self {
14693 Self(RequestBuilder::new(stub))
14694 }
14695
14696 pub fn with_request<V: Into<crate::model::GetDataScanJobRequest>>(mut self, v: V) -> Self {
14698 self.0.request = v.into();
14699 self
14700 }
14701
14702 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14704 self.0.options = v.into();
14705 self
14706 }
14707
14708 pub async fn send(self) -> Result<crate::model::DataScanJob> {
14710 (*self.0.stub)
14711 .get_data_scan_job(self.0.request, self.0.options)
14712 .await
14713 .map(crate::Response::into_body)
14714 }
14715
14716 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14720 self.0.request.name = v.into();
14721 self
14722 }
14723
14724 pub fn set_view<T: Into<crate::model::get_data_scan_job_request::DataScanJobView>>(
14726 mut self,
14727 v: T,
14728 ) -> Self {
14729 self.0.request.view = v.into();
14730 self
14731 }
14732 }
14733
14734 #[doc(hidden)]
14735 impl crate::RequestBuilder for GetDataScanJob {
14736 fn request_options(&mut self) -> &mut crate::RequestOptions {
14737 &mut self.0.options
14738 }
14739 }
14740
14741 #[derive(Clone, Debug)]
14762 pub struct ListDataScanJobs(RequestBuilder<crate::model::ListDataScanJobsRequest>);
14763
14764 impl ListDataScanJobs {
14765 pub(crate) fn new(
14766 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14767 ) -> Self {
14768 Self(RequestBuilder::new(stub))
14769 }
14770
14771 pub fn with_request<V: Into<crate::model::ListDataScanJobsRequest>>(
14773 mut self,
14774 v: V,
14775 ) -> Self {
14776 self.0.request = v.into();
14777 self
14778 }
14779
14780 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14782 self.0.options = v.into();
14783 self
14784 }
14785
14786 pub async fn send(self) -> Result<crate::model::ListDataScanJobsResponse> {
14788 (*self.0.stub)
14789 .list_data_scan_jobs(self.0.request, self.0.options)
14790 .await
14791 .map(crate::Response::into_body)
14792 }
14793
14794 pub fn by_page(
14796 self,
14797 ) -> impl google_cloud_gax::paginator::Paginator<
14798 crate::model::ListDataScanJobsResponse,
14799 crate::Error,
14800 > {
14801 use std::clone::Clone;
14802 let token = self.0.request.page_token.clone();
14803 let execute = move |token: String| {
14804 let mut builder = self.clone();
14805 builder.0.request = builder.0.request.set_page_token(token);
14806 builder.send()
14807 };
14808 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14809 }
14810
14811 pub fn by_item(
14813 self,
14814 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14815 crate::model::ListDataScanJobsResponse,
14816 crate::Error,
14817 > {
14818 use google_cloud_gax::paginator::Paginator;
14819 self.by_page().items()
14820 }
14821
14822 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14826 self.0.request.parent = v.into();
14827 self
14828 }
14829
14830 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14832 self.0.request.page_size = v.into();
14833 self
14834 }
14835
14836 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14838 self.0.request.page_token = v.into();
14839 self
14840 }
14841
14842 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14844 self.0.request.filter = v.into();
14845 self
14846 }
14847 }
14848
14849 #[doc(hidden)]
14850 impl crate::RequestBuilder for ListDataScanJobs {
14851 fn request_options(&mut self) -> &mut crate::RequestOptions {
14852 &mut self.0.options
14853 }
14854 }
14855
14856 #[derive(Clone, Debug)]
14873 pub struct GenerateDataQualityRules(
14874 RequestBuilder<crate::model::GenerateDataQualityRulesRequest>,
14875 );
14876
14877 impl GenerateDataQualityRules {
14878 pub(crate) fn new(
14879 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14880 ) -> Self {
14881 Self(RequestBuilder::new(stub))
14882 }
14883
14884 pub fn with_request<V: Into<crate::model::GenerateDataQualityRulesRequest>>(
14886 mut self,
14887 v: V,
14888 ) -> Self {
14889 self.0.request = v.into();
14890 self
14891 }
14892
14893 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14895 self.0.options = v.into();
14896 self
14897 }
14898
14899 pub async fn send(self) -> Result<crate::model::GenerateDataQualityRulesResponse> {
14901 (*self.0.stub)
14902 .generate_data_quality_rules(self.0.request, self.0.options)
14903 .await
14904 .map(crate::Response::into_body)
14905 }
14906
14907 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14911 self.0.request.name = v.into();
14912 self
14913 }
14914 }
14915
14916 #[doc(hidden)]
14917 impl crate::RequestBuilder for GenerateDataQualityRules {
14918 fn request_options(&mut self) -> &mut crate::RequestOptions {
14919 &mut self.0.options
14920 }
14921 }
14922
14923 #[derive(Clone, Debug)]
14944 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
14945
14946 impl ListLocations {
14947 pub(crate) fn new(
14948 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14949 ) -> Self {
14950 Self(RequestBuilder::new(stub))
14951 }
14952
14953 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
14955 mut self,
14956 v: V,
14957 ) -> Self {
14958 self.0.request = v.into();
14959 self
14960 }
14961
14962 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14964 self.0.options = v.into();
14965 self
14966 }
14967
14968 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
14970 (*self.0.stub)
14971 .list_locations(self.0.request, self.0.options)
14972 .await
14973 .map(crate::Response::into_body)
14974 }
14975
14976 pub fn by_page(
14978 self,
14979 ) -> impl google_cloud_gax::paginator::Paginator<
14980 google_cloud_location::model::ListLocationsResponse,
14981 crate::Error,
14982 > {
14983 use std::clone::Clone;
14984 let token = self.0.request.page_token.clone();
14985 let execute = move |token: String| {
14986 let mut builder = self.clone();
14987 builder.0.request = builder.0.request.set_page_token(token);
14988 builder.send()
14989 };
14990 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14991 }
14992
14993 pub fn by_item(
14995 self,
14996 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14997 google_cloud_location::model::ListLocationsResponse,
14998 crate::Error,
14999 > {
15000 use google_cloud_gax::paginator::Paginator;
15001 self.by_page().items()
15002 }
15003
15004 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15006 self.0.request.name = v.into();
15007 self
15008 }
15009
15010 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15012 self.0.request.filter = v.into();
15013 self
15014 }
15015
15016 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15018 self.0.request.page_size = v.into();
15019 self
15020 }
15021
15022 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15024 self.0.request.page_token = v.into();
15025 self
15026 }
15027 }
15028
15029 #[doc(hidden)]
15030 impl crate::RequestBuilder for ListLocations {
15031 fn request_options(&mut self) -> &mut crate::RequestOptions {
15032 &mut self.0.options
15033 }
15034 }
15035
15036 #[derive(Clone, Debug)]
15053 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
15054
15055 impl GetLocation {
15056 pub(crate) fn new(
15057 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15058 ) -> Self {
15059 Self(RequestBuilder::new(stub))
15060 }
15061
15062 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
15064 mut self,
15065 v: V,
15066 ) -> Self {
15067 self.0.request = v.into();
15068 self
15069 }
15070
15071 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15073 self.0.options = v.into();
15074 self
15075 }
15076
15077 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
15079 (*self.0.stub)
15080 .get_location(self.0.request, self.0.options)
15081 .await
15082 .map(crate::Response::into_body)
15083 }
15084
15085 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15087 self.0.request.name = v.into();
15088 self
15089 }
15090 }
15091
15092 #[doc(hidden)]
15093 impl crate::RequestBuilder for GetLocation {
15094 fn request_options(&mut self) -> &mut crate::RequestOptions {
15095 &mut self.0.options
15096 }
15097 }
15098
15099 #[derive(Clone, Debug)]
15116 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
15117
15118 impl SetIamPolicy {
15119 pub(crate) fn new(
15120 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15121 ) -> Self {
15122 Self(RequestBuilder::new(stub))
15123 }
15124
15125 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
15127 mut self,
15128 v: V,
15129 ) -> Self {
15130 self.0.request = v.into();
15131 self
15132 }
15133
15134 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15136 self.0.options = v.into();
15137 self
15138 }
15139
15140 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
15142 (*self.0.stub)
15143 .set_iam_policy(self.0.request, self.0.options)
15144 .await
15145 .map(crate::Response::into_body)
15146 }
15147
15148 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
15152 self.0.request.resource = v.into();
15153 self
15154 }
15155
15156 pub fn set_policy<T>(mut self, v: T) -> Self
15160 where
15161 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
15162 {
15163 self.0.request.policy = std::option::Option::Some(v.into());
15164 self
15165 }
15166
15167 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
15171 where
15172 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
15173 {
15174 self.0.request.policy = v.map(|x| x.into());
15175 self
15176 }
15177
15178 pub fn set_update_mask<T>(mut self, v: T) -> Self
15180 where
15181 T: std::convert::Into<wkt::FieldMask>,
15182 {
15183 self.0.request.update_mask = std::option::Option::Some(v.into());
15184 self
15185 }
15186
15187 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15189 where
15190 T: std::convert::Into<wkt::FieldMask>,
15191 {
15192 self.0.request.update_mask = v.map(|x| x.into());
15193 self
15194 }
15195 }
15196
15197 #[doc(hidden)]
15198 impl crate::RequestBuilder for SetIamPolicy {
15199 fn request_options(&mut self) -> &mut crate::RequestOptions {
15200 &mut self.0.options
15201 }
15202 }
15203
15204 #[derive(Clone, Debug)]
15221 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
15222
15223 impl GetIamPolicy {
15224 pub(crate) fn new(
15225 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15226 ) -> Self {
15227 Self(RequestBuilder::new(stub))
15228 }
15229
15230 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
15232 mut self,
15233 v: V,
15234 ) -> Self {
15235 self.0.request = v.into();
15236 self
15237 }
15238
15239 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15241 self.0.options = v.into();
15242 self
15243 }
15244
15245 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
15247 (*self.0.stub)
15248 .get_iam_policy(self.0.request, self.0.options)
15249 .await
15250 .map(crate::Response::into_body)
15251 }
15252
15253 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
15257 self.0.request.resource = v.into();
15258 self
15259 }
15260
15261 pub fn set_options<T>(mut self, v: T) -> Self
15263 where
15264 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
15265 {
15266 self.0.request.options = std::option::Option::Some(v.into());
15267 self
15268 }
15269
15270 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
15272 where
15273 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
15274 {
15275 self.0.request.options = v.map(|x| x.into());
15276 self
15277 }
15278 }
15279
15280 #[doc(hidden)]
15281 impl crate::RequestBuilder for GetIamPolicy {
15282 fn request_options(&mut self) -> &mut crate::RequestOptions {
15283 &mut self.0.options
15284 }
15285 }
15286
15287 #[derive(Clone, Debug)]
15304 pub struct TestIamPermissions(
15305 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
15306 );
15307
15308 impl TestIamPermissions {
15309 pub(crate) fn new(
15310 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15311 ) -> Self {
15312 Self(RequestBuilder::new(stub))
15313 }
15314
15315 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
15317 mut self,
15318 v: V,
15319 ) -> Self {
15320 self.0.request = v.into();
15321 self
15322 }
15323
15324 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15326 self.0.options = v.into();
15327 self
15328 }
15329
15330 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
15332 (*self.0.stub)
15333 .test_iam_permissions(self.0.request, self.0.options)
15334 .await
15335 .map(crate::Response::into_body)
15336 }
15337
15338 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
15342 self.0.request.resource = v.into();
15343 self
15344 }
15345
15346 pub fn set_permissions<T, V>(mut self, v: T) -> Self
15350 where
15351 T: std::iter::IntoIterator<Item = V>,
15352 V: std::convert::Into<std::string::String>,
15353 {
15354 use std::iter::Iterator;
15355 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
15356 self
15357 }
15358 }
15359
15360 #[doc(hidden)]
15361 impl crate::RequestBuilder for TestIamPermissions {
15362 fn request_options(&mut self) -> &mut crate::RequestOptions {
15363 &mut self.0.options
15364 }
15365 }
15366
15367 #[derive(Clone, Debug)]
15388 pub struct ListOperations(
15389 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
15390 );
15391
15392 impl ListOperations {
15393 pub(crate) fn new(
15394 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15395 ) -> Self {
15396 Self(RequestBuilder::new(stub))
15397 }
15398
15399 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
15401 mut self,
15402 v: V,
15403 ) -> Self {
15404 self.0.request = v.into();
15405 self
15406 }
15407
15408 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15410 self.0.options = v.into();
15411 self
15412 }
15413
15414 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
15416 (*self.0.stub)
15417 .list_operations(self.0.request, self.0.options)
15418 .await
15419 .map(crate::Response::into_body)
15420 }
15421
15422 pub fn by_page(
15424 self,
15425 ) -> impl google_cloud_gax::paginator::Paginator<
15426 google_cloud_longrunning::model::ListOperationsResponse,
15427 crate::Error,
15428 > {
15429 use std::clone::Clone;
15430 let token = self.0.request.page_token.clone();
15431 let execute = move |token: String| {
15432 let mut builder = self.clone();
15433 builder.0.request = builder.0.request.set_page_token(token);
15434 builder.send()
15435 };
15436 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15437 }
15438
15439 pub fn by_item(
15441 self,
15442 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15443 google_cloud_longrunning::model::ListOperationsResponse,
15444 crate::Error,
15445 > {
15446 use google_cloud_gax::paginator::Paginator;
15447 self.by_page().items()
15448 }
15449
15450 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15452 self.0.request.name = v.into();
15453 self
15454 }
15455
15456 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15458 self.0.request.filter = v.into();
15459 self
15460 }
15461
15462 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15464 self.0.request.page_size = v.into();
15465 self
15466 }
15467
15468 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15470 self.0.request.page_token = v.into();
15471 self
15472 }
15473
15474 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15476 self.0.request.return_partial_success = v.into();
15477 self
15478 }
15479 }
15480
15481 #[doc(hidden)]
15482 impl crate::RequestBuilder for ListOperations {
15483 fn request_options(&mut self) -> &mut crate::RequestOptions {
15484 &mut self.0.options
15485 }
15486 }
15487
15488 #[derive(Clone, Debug)]
15505 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
15506
15507 impl GetOperation {
15508 pub(crate) fn new(
15509 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15510 ) -> Self {
15511 Self(RequestBuilder::new(stub))
15512 }
15513
15514 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
15516 mut self,
15517 v: V,
15518 ) -> Self {
15519 self.0.request = v.into();
15520 self
15521 }
15522
15523 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15525 self.0.options = v.into();
15526 self
15527 }
15528
15529 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15531 (*self.0.stub)
15532 .get_operation(self.0.request, self.0.options)
15533 .await
15534 .map(crate::Response::into_body)
15535 }
15536
15537 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15539 self.0.request.name = v.into();
15540 self
15541 }
15542 }
15543
15544 #[doc(hidden)]
15545 impl crate::RequestBuilder for GetOperation {
15546 fn request_options(&mut self) -> &mut crate::RequestOptions {
15547 &mut self.0.options
15548 }
15549 }
15550
15551 #[derive(Clone, Debug)]
15568 pub struct DeleteOperation(
15569 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
15570 );
15571
15572 impl DeleteOperation {
15573 pub(crate) fn new(
15574 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15575 ) -> Self {
15576 Self(RequestBuilder::new(stub))
15577 }
15578
15579 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
15581 mut self,
15582 v: V,
15583 ) -> Self {
15584 self.0.request = v.into();
15585 self
15586 }
15587
15588 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15590 self.0.options = v.into();
15591 self
15592 }
15593
15594 pub async fn send(self) -> Result<()> {
15596 (*self.0.stub)
15597 .delete_operation(self.0.request, self.0.options)
15598 .await
15599 .map(crate::Response::into_body)
15600 }
15601
15602 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15604 self.0.request.name = v.into();
15605 self
15606 }
15607 }
15608
15609 #[doc(hidden)]
15610 impl crate::RequestBuilder for DeleteOperation {
15611 fn request_options(&mut self) -> &mut crate::RequestOptions {
15612 &mut self.0.options
15613 }
15614 }
15615
15616 #[derive(Clone, Debug)]
15633 pub struct CancelOperation(
15634 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
15635 );
15636
15637 impl CancelOperation {
15638 pub(crate) fn new(
15639 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15640 ) -> Self {
15641 Self(RequestBuilder::new(stub))
15642 }
15643
15644 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
15646 mut self,
15647 v: V,
15648 ) -> Self {
15649 self.0.request = v.into();
15650 self
15651 }
15652
15653 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15655 self.0.options = v.into();
15656 self
15657 }
15658
15659 pub async fn send(self) -> Result<()> {
15661 (*self.0.stub)
15662 .cancel_operation(self.0.request, self.0.options)
15663 .await
15664 .map(crate::Response::into_body)
15665 }
15666
15667 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15669 self.0.request.name = v.into();
15670 self
15671 }
15672 }
15673
15674 #[doc(hidden)]
15675 impl crate::RequestBuilder for CancelOperation {
15676 fn request_options(&mut self) -> &mut crate::RequestOptions {
15677 &mut self.0.options
15678 }
15679 }
15680}
15681
15682pub mod metadata_service {
15684 use crate::Result;
15685
15686 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15700
15701 pub(crate) mod client {
15702 use super::super::super::client::MetadataService;
15703 pub struct Factory;
15704 impl crate::ClientFactory for Factory {
15705 type Client = MetadataService;
15706 type Credentials = gaxi::options::Credentials;
15707 async fn build(
15708 self,
15709 config: gaxi::options::ClientConfig,
15710 ) -> crate::ClientBuilderResult<Self::Client> {
15711 Self::Client::new(config).await
15712 }
15713 }
15714 }
15715
15716 #[derive(Clone, Debug)]
15718 pub(crate) struct RequestBuilder<R: std::default::Default> {
15719 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
15720 request: R,
15721 options: crate::RequestOptions,
15722 }
15723
15724 impl<R> RequestBuilder<R>
15725 where
15726 R: std::default::Default,
15727 {
15728 pub(crate) fn new(
15729 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
15730 ) -> Self {
15731 Self {
15732 stub,
15733 request: R::default(),
15734 options: crate::RequestOptions::default(),
15735 }
15736 }
15737 }
15738
15739 #[derive(Clone, Debug)]
15756 pub struct CreateEntity(RequestBuilder<crate::model::CreateEntityRequest>);
15757
15758 impl CreateEntity {
15759 pub(crate) fn new(
15760 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
15761 ) -> Self {
15762 Self(RequestBuilder::new(stub))
15763 }
15764
15765 pub fn with_request<V: Into<crate::model::CreateEntityRequest>>(mut self, v: V) -> Self {
15767 self.0.request = v.into();
15768 self
15769 }
15770
15771 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15773 self.0.options = v.into();
15774 self
15775 }
15776
15777 pub async fn send(self) -> Result<crate::model::Entity> {
15779 (*self.0.stub)
15780 .create_entity(self.0.request, self.0.options)
15781 .await
15782 .map(crate::Response::into_body)
15783 }
15784
15785 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15789 self.0.request.parent = v.into();
15790 self
15791 }
15792
15793 pub fn set_entity<T>(mut self, v: T) -> Self
15797 where
15798 T: std::convert::Into<crate::model::Entity>,
15799 {
15800 self.0.request.entity = std::option::Option::Some(v.into());
15801 self
15802 }
15803
15804 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
15808 where
15809 T: std::convert::Into<crate::model::Entity>,
15810 {
15811 self.0.request.entity = v.map(|x| x.into());
15812 self
15813 }
15814
15815 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15817 self.0.request.validate_only = v.into();
15818 self
15819 }
15820 }
15821
15822 #[doc(hidden)]
15823 impl crate::RequestBuilder for CreateEntity {
15824 fn request_options(&mut self) -> &mut crate::RequestOptions {
15825 &mut self.0.options
15826 }
15827 }
15828
15829 #[derive(Clone, Debug)]
15846 pub struct UpdateEntity(RequestBuilder<crate::model::UpdateEntityRequest>);
15847
15848 impl UpdateEntity {
15849 pub(crate) fn new(
15850 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
15851 ) -> Self {
15852 Self(RequestBuilder::new(stub))
15853 }
15854
15855 pub fn with_request<V: Into<crate::model::UpdateEntityRequest>>(mut self, v: V) -> Self {
15857 self.0.request = v.into();
15858 self
15859 }
15860
15861 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15863 self.0.options = v.into();
15864 self
15865 }
15866
15867 pub async fn send(self) -> Result<crate::model::Entity> {
15869 (*self.0.stub)
15870 .update_entity(self.0.request, self.0.options)
15871 .await
15872 .map(crate::Response::into_body)
15873 }
15874
15875 pub fn set_entity<T>(mut self, v: T) -> Self
15879 where
15880 T: std::convert::Into<crate::model::Entity>,
15881 {
15882 self.0.request.entity = std::option::Option::Some(v.into());
15883 self
15884 }
15885
15886 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
15890 where
15891 T: std::convert::Into<crate::model::Entity>,
15892 {
15893 self.0.request.entity = v.map(|x| x.into());
15894 self
15895 }
15896
15897 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15899 self.0.request.validate_only = v.into();
15900 self
15901 }
15902 }
15903
15904 #[doc(hidden)]
15905 impl crate::RequestBuilder for UpdateEntity {
15906 fn request_options(&mut self) -> &mut crate::RequestOptions {
15907 &mut self.0.options
15908 }
15909 }
15910
15911 #[derive(Clone, Debug)]
15928 pub struct DeleteEntity(RequestBuilder<crate::model::DeleteEntityRequest>);
15929
15930 impl DeleteEntity {
15931 pub(crate) fn new(
15932 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
15933 ) -> Self {
15934 Self(RequestBuilder::new(stub))
15935 }
15936
15937 pub fn with_request<V: Into<crate::model::DeleteEntityRequest>>(mut self, v: V) -> Self {
15939 self.0.request = v.into();
15940 self
15941 }
15942
15943 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15945 self.0.options = v.into();
15946 self
15947 }
15948
15949 pub async fn send(self) -> Result<()> {
15951 (*self.0.stub)
15952 .delete_entity(self.0.request, self.0.options)
15953 .await
15954 .map(crate::Response::into_body)
15955 }
15956
15957 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15961 self.0.request.name = v.into();
15962 self
15963 }
15964
15965 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
15969 self.0.request.etag = v.into();
15970 self
15971 }
15972 }
15973
15974 #[doc(hidden)]
15975 impl crate::RequestBuilder for DeleteEntity {
15976 fn request_options(&mut self) -> &mut crate::RequestOptions {
15977 &mut self.0.options
15978 }
15979 }
15980
15981 #[derive(Clone, Debug)]
15998 pub struct GetEntity(RequestBuilder<crate::model::GetEntityRequest>);
15999
16000 impl GetEntity {
16001 pub(crate) fn new(
16002 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16003 ) -> Self {
16004 Self(RequestBuilder::new(stub))
16005 }
16006
16007 pub fn with_request<V: Into<crate::model::GetEntityRequest>>(mut self, v: V) -> Self {
16009 self.0.request = v.into();
16010 self
16011 }
16012
16013 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16015 self.0.options = v.into();
16016 self
16017 }
16018
16019 pub async fn send(self) -> Result<crate::model::Entity> {
16021 (*self.0.stub)
16022 .get_entity(self.0.request, self.0.options)
16023 .await
16024 .map(crate::Response::into_body)
16025 }
16026
16027 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16031 self.0.request.name = v.into();
16032 self
16033 }
16034
16035 pub fn set_view<T: Into<crate::model::get_entity_request::EntityView>>(
16037 mut self,
16038 v: T,
16039 ) -> Self {
16040 self.0.request.view = v.into();
16041 self
16042 }
16043 }
16044
16045 #[doc(hidden)]
16046 impl crate::RequestBuilder for GetEntity {
16047 fn request_options(&mut self) -> &mut crate::RequestOptions {
16048 &mut self.0.options
16049 }
16050 }
16051
16052 #[derive(Clone, Debug)]
16073 pub struct ListEntities(RequestBuilder<crate::model::ListEntitiesRequest>);
16074
16075 impl ListEntities {
16076 pub(crate) fn new(
16077 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16078 ) -> Self {
16079 Self(RequestBuilder::new(stub))
16080 }
16081
16082 pub fn with_request<V: Into<crate::model::ListEntitiesRequest>>(mut self, v: V) -> Self {
16084 self.0.request = v.into();
16085 self
16086 }
16087
16088 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16090 self.0.options = v.into();
16091 self
16092 }
16093
16094 pub async fn send(self) -> Result<crate::model::ListEntitiesResponse> {
16096 (*self.0.stub)
16097 .list_entities(self.0.request, self.0.options)
16098 .await
16099 .map(crate::Response::into_body)
16100 }
16101
16102 pub fn by_page(
16104 self,
16105 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListEntitiesResponse, crate::Error>
16106 {
16107 use std::clone::Clone;
16108 let token = self.0.request.page_token.clone();
16109 let execute = move |token: String| {
16110 let mut builder = self.clone();
16111 builder.0.request = builder.0.request.set_page_token(token);
16112 builder.send()
16113 };
16114 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16115 }
16116
16117 pub fn by_item(
16119 self,
16120 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16121 crate::model::ListEntitiesResponse,
16122 crate::Error,
16123 > {
16124 use google_cloud_gax::paginator::Paginator;
16125 self.by_page().items()
16126 }
16127
16128 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16132 self.0.request.parent = v.into();
16133 self
16134 }
16135
16136 pub fn set_view<T: Into<crate::model::list_entities_request::EntityView>>(
16140 mut self,
16141 v: T,
16142 ) -> Self {
16143 self.0.request.view = v.into();
16144 self
16145 }
16146
16147 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16149 self.0.request.page_size = v.into();
16150 self
16151 }
16152
16153 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16155 self.0.request.page_token = v.into();
16156 self
16157 }
16158
16159 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16161 self.0.request.filter = v.into();
16162 self
16163 }
16164 }
16165
16166 #[doc(hidden)]
16167 impl crate::RequestBuilder for ListEntities {
16168 fn request_options(&mut self) -> &mut crate::RequestOptions {
16169 &mut self.0.options
16170 }
16171 }
16172
16173 #[derive(Clone, Debug)]
16190 pub struct CreatePartition(RequestBuilder<crate::model::CreatePartitionRequest>);
16191
16192 impl CreatePartition {
16193 pub(crate) fn new(
16194 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16195 ) -> Self {
16196 Self(RequestBuilder::new(stub))
16197 }
16198
16199 pub fn with_request<V: Into<crate::model::CreatePartitionRequest>>(mut self, v: V) -> Self {
16201 self.0.request = v.into();
16202 self
16203 }
16204
16205 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16207 self.0.options = v.into();
16208 self
16209 }
16210
16211 pub async fn send(self) -> Result<crate::model::Partition> {
16213 (*self.0.stub)
16214 .create_partition(self.0.request, self.0.options)
16215 .await
16216 .map(crate::Response::into_body)
16217 }
16218
16219 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16223 self.0.request.parent = v.into();
16224 self
16225 }
16226
16227 pub fn set_partition<T>(mut self, v: T) -> Self
16231 where
16232 T: std::convert::Into<crate::model::Partition>,
16233 {
16234 self.0.request.partition = std::option::Option::Some(v.into());
16235 self
16236 }
16237
16238 pub fn set_or_clear_partition<T>(mut self, v: std::option::Option<T>) -> Self
16242 where
16243 T: std::convert::Into<crate::model::Partition>,
16244 {
16245 self.0.request.partition = v.map(|x| x.into());
16246 self
16247 }
16248
16249 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16251 self.0.request.validate_only = v.into();
16252 self
16253 }
16254 }
16255
16256 #[doc(hidden)]
16257 impl crate::RequestBuilder for CreatePartition {
16258 fn request_options(&mut self) -> &mut crate::RequestOptions {
16259 &mut self.0.options
16260 }
16261 }
16262
16263 #[derive(Clone, Debug)]
16280 pub struct DeletePartition(RequestBuilder<crate::model::DeletePartitionRequest>);
16281
16282 impl DeletePartition {
16283 pub(crate) fn new(
16284 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16285 ) -> Self {
16286 Self(RequestBuilder::new(stub))
16287 }
16288
16289 pub fn with_request<V: Into<crate::model::DeletePartitionRequest>>(mut self, v: V) -> Self {
16291 self.0.request = v.into();
16292 self
16293 }
16294
16295 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16297 self.0.options = v.into();
16298 self
16299 }
16300
16301 pub async fn send(self) -> Result<()> {
16303 (*self.0.stub)
16304 .delete_partition(self.0.request, self.0.options)
16305 .await
16306 .map(crate::Response::into_body)
16307 }
16308
16309 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16313 self.0.request.name = v.into();
16314 self
16315 }
16316
16317 #[deprecated]
16319 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
16320 self.0.request.etag = v.into();
16321 self
16322 }
16323 }
16324
16325 #[doc(hidden)]
16326 impl crate::RequestBuilder for DeletePartition {
16327 fn request_options(&mut self) -> &mut crate::RequestOptions {
16328 &mut self.0.options
16329 }
16330 }
16331
16332 #[derive(Clone, Debug)]
16349 pub struct GetPartition(RequestBuilder<crate::model::GetPartitionRequest>);
16350
16351 impl GetPartition {
16352 pub(crate) fn new(
16353 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16354 ) -> Self {
16355 Self(RequestBuilder::new(stub))
16356 }
16357
16358 pub fn with_request<V: Into<crate::model::GetPartitionRequest>>(mut self, v: V) -> Self {
16360 self.0.request = v.into();
16361 self
16362 }
16363
16364 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16366 self.0.options = v.into();
16367 self
16368 }
16369
16370 pub async fn send(self) -> Result<crate::model::Partition> {
16372 (*self.0.stub)
16373 .get_partition(self.0.request, self.0.options)
16374 .await
16375 .map(crate::Response::into_body)
16376 }
16377
16378 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16382 self.0.request.name = v.into();
16383 self
16384 }
16385 }
16386
16387 #[doc(hidden)]
16388 impl crate::RequestBuilder for GetPartition {
16389 fn request_options(&mut self) -> &mut crate::RequestOptions {
16390 &mut self.0.options
16391 }
16392 }
16393
16394 #[derive(Clone, Debug)]
16415 pub struct ListPartitions(RequestBuilder<crate::model::ListPartitionsRequest>);
16416
16417 impl ListPartitions {
16418 pub(crate) fn new(
16419 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16420 ) -> Self {
16421 Self(RequestBuilder::new(stub))
16422 }
16423
16424 pub fn with_request<V: Into<crate::model::ListPartitionsRequest>>(mut self, v: V) -> Self {
16426 self.0.request = v.into();
16427 self
16428 }
16429
16430 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16432 self.0.options = v.into();
16433 self
16434 }
16435
16436 pub async fn send(self) -> Result<crate::model::ListPartitionsResponse> {
16438 (*self.0.stub)
16439 .list_partitions(self.0.request, self.0.options)
16440 .await
16441 .map(crate::Response::into_body)
16442 }
16443
16444 pub fn by_page(
16446 self,
16447 ) -> impl google_cloud_gax::paginator::Paginator<
16448 crate::model::ListPartitionsResponse,
16449 crate::Error,
16450 > {
16451 use std::clone::Clone;
16452 let token = self.0.request.page_token.clone();
16453 let execute = move |token: String| {
16454 let mut builder = self.clone();
16455 builder.0.request = builder.0.request.set_page_token(token);
16456 builder.send()
16457 };
16458 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16459 }
16460
16461 pub fn by_item(
16463 self,
16464 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16465 crate::model::ListPartitionsResponse,
16466 crate::Error,
16467 > {
16468 use google_cloud_gax::paginator::Paginator;
16469 self.by_page().items()
16470 }
16471
16472 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16476 self.0.request.parent = v.into();
16477 self
16478 }
16479
16480 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16482 self.0.request.page_size = v.into();
16483 self
16484 }
16485
16486 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16488 self.0.request.page_token = v.into();
16489 self
16490 }
16491
16492 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16494 self.0.request.filter = v.into();
16495 self
16496 }
16497 }
16498
16499 #[doc(hidden)]
16500 impl crate::RequestBuilder for ListPartitions {
16501 fn request_options(&mut self) -> &mut crate::RequestOptions {
16502 &mut self.0.options
16503 }
16504 }
16505
16506 #[derive(Clone, Debug)]
16527 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
16528
16529 impl ListLocations {
16530 pub(crate) fn new(
16531 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16532 ) -> Self {
16533 Self(RequestBuilder::new(stub))
16534 }
16535
16536 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
16538 mut self,
16539 v: V,
16540 ) -> Self {
16541 self.0.request = v.into();
16542 self
16543 }
16544
16545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16547 self.0.options = v.into();
16548 self
16549 }
16550
16551 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
16553 (*self.0.stub)
16554 .list_locations(self.0.request, self.0.options)
16555 .await
16556 .map(crate::Response::into_body)
16557 }
16558
16559 pub fn by_page(
16561 self,
16562 ) -> impl google_cloud_gax::paginator::Paginator<
16563 google_cloud_location::model::ListLocationsResponse,
16564 crate::Error,
16565 > {
16566 use std::clone::Clone;
16567 let token = self.0.request.page_token.clone();
16568 let execute = move |token: String| {
16569 let mut builder = self.clone();
16570 builder.0.request = builder.0.request.set_page_token(token);
16571 builder.send()
16572 };
16573 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16574 }
16575
16576 pub fn by_item(
16578 self,
16579 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16580 google_cloud_location::model::ListLocationsResponse,
16581 crate::Error,
16582 > {
16583 use google_cloud_gax::paginator::Paginator;
16584 self.by_page().items()
16585 }
16586
16587 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16589 self.0.request.name = v.into();
16590 self
16591 }
16592
16593 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16595 self.0.request.filter = v.into();
16596 self
16597 }
16598
16599 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16601 self.0.request.page_size = v.into();
16602 self
16603 }
16604
16605 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16607 self.0.request.page_token = v.into();
16608 self
16609 }
16610 }
16611
16612 #[doc(hidden)]
16613 impl crate::RequestBuilder for ListLocations {
16614 fn request_options(&mut self) -> &mut crate::RequestOptions {
16615 &mut self.0.options
16616 }
16617 }
16618
16619 #[derive(Clone, Debug)]
16636 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
16637
16638 impl GetLocation {
16639 pub(crate) fn new(
16640 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16641 ) -> Self {
16642 Self(RequestBuilder::new(stub))
16643 }
16644
16645 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
16647 mut self,
16648 v: V,
16649 ) -> Self {
16650 self.0.request = v.into();
16651 self
16652 }
16653
16654 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16656 self.0.options = v.into();
16657 self
16658 }
16659
16660 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
16662 (*self.0.stub)
16663 .get_location(self.0.request, self.0.options)
16664 .await
16665 .map(crate::Response::into_body)
16666 }
16667
16668 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16670 self.0.request.name = v.into();
16671 self
16672 }
16673 }
16674
16675 #[doc(hidden)]
16676 impl crate::RequestBuilder for GetLocation {
16677 fn request_options(&mut self) -> &mut crate::RequestOptions {
16678 &mut self.0.options
16679 }
16680 }
16681
16682 #[derive(Clone, Debug)]
16699 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
16700
16701 impl SetIamPolicy {
16702 pub(crate) fn new(
16703 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16704 ) -> Self {
16705 Self(RequestBuilder::new(stub))
16706 }
16707
16708 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
16710 mut self,
16711 v: V,
16712 ) -> Self {
16713 self.0.request = v.into();
16714 self
16715 }
16716
16717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16719 self.0.options = v.into();
16720 self
16721 }
16722
16723 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
16725 (*self.0.stub)
16726 .set_iam_policy(self.0.request, self.0.options)
16727 .await
16728 .map(crate::Response::into_body)
16729 }
16730
16731 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
16735 self.0.request.resource = v.into();
16736 self
16737 }
16738
16739 pub fn set_policy<T>(mut self, v: T) -> Self
16743 where
16744 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
16745 {
16746 self.0.request.policy = std::option::Option::Some(v.into());
16747 self
16748 }
16749
16750 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
16754 where
16755 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
16756 {
16757 self.0.request.policy = v.map(|x| x.into());
16758 self
16759 }
16760
16761 pub fn set_update_mask<T>(mut self, v: T) -> Self
16763 where
16764 T: std::convert::Into<wkt::FieldMask>,
16765 {
16766 self.0.request.update_mask = std::option::Option::Some(v.into());
16767 self
16768 }
16769
16770 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16772 where
16773 T: std::convert::Into<wkt::FieldMask>,
16774 {
16775 self.0.request.update_mask = v.map(|x| x.into());
16776 self
16777 }
16778 }
16779
16780 #[doc(hidden)]
16781 impl crate::RequestBuilder for SetIamPolicy {
16782 fn request_options(&mut self) -> &mut crate::RequestOptions {
16783 &mut self.0.options
16784 }
16785 }
16786
16787 #[derive(Clone, Debug)]
16804 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
16805
16806 impl GetIamPolicy {
16807 pub(crate) fn new(
16808 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16809 ) -> Self {
16810 Self(RequestBuilder::new(stub))
16811 }
16812
16813 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
16815 mut self,
16816 v: V,
16817 ) -> Self {
16818 self.0.request = v.into();
16819 self
16820 }
16821
16822 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16824 self.0.options = v.into();
16825 self
16826 }
16827
16828 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
16830 (*self.0.stub)
16831 .get_iam_policy(self.0.request, self.0.options)
16832 .await
16833 .map(crate::Response::into_body)
16834 }
16835
16836 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
16840 self.0.request.resource = v.into();
16841 self
16842 }
16843
16844 pub fn set_options<T>(mut self, v: T) -> Self
16846 where
16847 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
16848 {
16849 self.0.request.options = std::option::Option::Some(v.into());
16850 self
16851 }
16852
16853 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
16855 where
16856 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
16857 {
16858 self.0.request.options = v.map(|x| x.into());
16859 self
16860 }
16861 }
16862
16863 #[doc(hidden)]
16864 impl crate::RequestBuilder for GetIamPolicy {
16865 fn request_options(&mut self) -> &mut crate::RequestOptions {
16866 &mut self.0.options
16867 }
16868 }
16869
16870 #[derive(Clone, Debug)]
16887 pub struct TestIamPermissions(
16888 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
16889 );
16890
16891 impl TestIamPermissions {
16892 pub(crate) fn new(
16893 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16894 ) -> Self {
16895 Self(RequestBuilder::new(stub))
16896 }
16897
16898 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
16900 mut self,
16901 v: V,
16902 ) -> Self {
16903 self.0.request = v.into();
16904 self
16905 }
16906
16907 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16909 self.0.options = v.into();
16910 self
16911 }
16912
16913 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
16915 (*self.0.stub)
16916 .test_iam_permissions(self.0.request, self.0.options)
16917 .await
16918 .map(crate::Response::into_body)
16919 }
16920
16921 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
16925 self.0.request.resource = v.into();
16926 self
16927 }
16928
16929 pub fn set_permissions<T, V>(mut self, v: T) -> Self
16933 where
16934 T: std::iter::IntoIterator<Item = V>,
16935 V: std::convert::Into<std::string::String>,
16936 {
16937 use std::iter::Iterator;
16938 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
16939 self
16940 }
16941 }
16942
16943 #[doc(hidden)]
16944 impl crate::RequestBuilder for TestIamPermissions {
16945 fn request_options(&mut self) -> &mut crate::RequestOptions {
16946 &mut self.0.options
16947 }
16948 }
16949
16950 #[derive(Clone, Debug)]
16971 pub struct ListOperations(
16972 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
16973 );
16974
16975 impl ListOperations {
16976 pub(crate) fn new(
16977 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16978 ) -> Self {
16979 Self(RequestBuilder::new(stub))
16980 }
16981
16982 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
16984 mut self,
16985 v: V,
16986 ) -> Self {
16987 self.0.request = v.into();
16988 self
16989 }
16990
16991 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16993 self.0.options = v.into();
16994 self
16995 }
16996
16997 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
16999 (*self.0.stub)
17000 .list_operations(self.0.request, self.0.options)
17001 .await
17002 .map(crate::Response::into_body)
17003 }
17004
17005 pub fn by_page(
17007 self,
17008 ) -> impl google_cloud_gax::paginator::Paginator<
17009 google_cloud_longrunning::model::ListOperationsResponse,
17010 crate::Error,
17011 > {
17012 use std::clone::Clone;
17013 let token = self.0.request.page_token.clone();
17014 let execute = move |token: String| {
17015 let mut builder = self.clone();
17016 builder.0.request = builder.0.request.set_page_token(token);
17017 builder.send()
17018 };
17019 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17020 }
17021
17022 pub fn by_item(
17024 self,
17025 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17026 google_cloud_longrunning::model::ListOperationsResponse,
17027 crate::Error,
17028 > {
17029 use google_cloud_gax::paginator::Paginator;
17030 self.by_page().items()
17031 }
17032
17033 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17035 self.0.request.name = v.into();
17036 self
17037 }
17038
17039 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17041 self.0.request.filter = v.into();
17042 self
17043 }
17044
17045 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17047 self.0.request.page_size = v.into();
17048 self
17049 }
17050
17051 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17053 self.0.request.page_token = v.into();
17054 self
17055 }
17056
17057 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
17059 self.0.request.return_partial_success = v.into();
17060 self
17061 }
17062 }
17063
17064 #[doc(hidden)]
17065 impl crate::RequestBuilder for ListOperations {
17066 fn request_options(&mut self) -> &mut crate::RequestOptions {
17067 &mut self.0.options
17068 }
17069 }
17070
17071 #[derive(Clone, Debug)]
17088 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
17089
17090 impl GetOperation {
17091 pub(crate) fn new(
17092 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17093 ) -> Self {
17094 Self(RequestBuilder::new(stub))
17095 }
17096
17097 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
17099 mut self,
17100 v: V,
17101 ) -> Self {
17102 self.0.request = v.into();
17103 self
17104 }
17105
17106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17108 self.0.options = v.into();
17109 self
17110 }
17111
17112 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17114 (*self.0.stub)
17115 .get_operation(self.0.request, self.0.options)
17116 .await
17117 .map(crate::Response::into_body)
17118 }
17119
17120 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17122 self.0.request.name = v.into();
17123 self
17124 }
17125 }
17126
17127 #[doc(hidden)]
17128 impl crate::RequestBuilder for GetOperation {
17129 fn request_options(&mut self) -> &mut crate::RequestOptions {
17130 &mut self.0.options
17131 }
17132 }
17133
17134 #[derive(Clone, Debug)]
17151 pub struct DeleteOperation(
17152 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
17153 );
17154
17155 impl DeleteOperation {
17156 pub(crate) fn new(
17157 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17158 ) -> Self {
17159 Self(RequestBuilder::new(stub))
17160 }
17161
17162 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
17164 mut self,
17165 v: V,
17166 ) -> Self {
17167 self.0.request = v.into();
17168 self
17169 }
17170
17171 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17173 self.0.options = v.into();
17174 self
17175 }
17176
17177 pub async fn send(self) -> Result<()> {
17179 (*self.0.stub)
17180 .delete_operation(self.0.request, self.0.options)
17181 .await
17182 .map(crate::Response::into_body)
17183 }
17184
17185 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17187 self.0.request.name = v.into();
17188 self
17189 }
17190 }
17191
17192 #[doc(hidden)]
17193 impl crate::RequestBuilder for DeleteOperation {
17194 fn request_options(&mut self) -> &mut crate::RequestOptions {
17195 &mut self.0.options
17196 }
17197 }
17198
17199 #[derive(Clone, Debug)]
17216 pub struct CancelOperation(
17217 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
17218 );
17219
17220 impl CancelOperation {
17221 pub(crate) fn new(
17222 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17223 ) -> Self {
17224 Self(RequestBuilder::new(stub))
17225 }
17226
17227 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
17229 mut self,
17230 v: V,
17231 ) -> Self {
17232 self.0.request = v.into();
17233 self
17234 }
17235
17236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17238 self.0.options = v.into();
17239 self
17240 }
17241
17242 pub async fn send(self) -> Result<()> {
17244 (*self.0.stub)
17245 .cancel_operation(self.0.request, self.0.options)
17246 .await
17247 .map(crate::Response::into_body)
17248 }
17249
17250 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17252 self.0.request.name = v.into();
17253 self
17254 }
17255 }
17256
17257 #[doc(hidden)]
17258 impl crate::RequestBuilder for CancelOperation {
17259 fn request_options(&mut self) -> &mut crate::RequestOptions {
17260 &mut self.0.options
17261 }
17262 }
17263}
17264
17265pub mod dataplex_service {
17267 use crate::Result;
17268
17269 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17283
17284 pub(crate) mod client {
17285 use super::super::super::client::DataplexService;
17286 pub struct Factory;
17287 impl crate::ClientFactory for Factory {
17288 type Client = DataplexService;
17289 type Credentials = gaxi::options::Credentials;
17290 async fn build(
17291 self,
17292 config: gaxi::options::ClientConfig,
17293 ) -> crate::ClientBuilderResult<Self::Client> {
17294 Self::Client::new(config).await
17295 }
17296 }
17297 }
17298
17299 #[derive(Clone, Debug)]
17301 pub(crate) struct RequestBuilder<R: std::default::Default> {
17302 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17303 request: R,
17304 options: crate::RequestOptions,
17305 }
17306
17307 impl<R> RequestBuilder<R>
17308 where
17309 R: std::default::Default,
17310 {
17311 pub(crate) fn new(
17312 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17313 ) -> Self {
17314 Self {
17315 stub,
17316 request: R::default(),
17317 options: crate::RequestOptions::default(),
17318 }
17319 }
17320 }
17321
17322 #[derive(Clone, Debug)]
17340 pub struct CreateLake(RequestBuilder<crate::model::CreateLakeRequest>);
17341
17342 impl CreateLake {
17343 pub(crate) fn new(
17344 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17345 ) -> Self {
17346 Self(RequestBuilder::new(stub))
17347 }
17348
17349 pub fn with_request<V: Into<crate::model::CreateLakeRequest>>(mut self, v: V) -> Self {
17351 self.0.request = v.into();
17352 self
17353 }
17354
17355 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17357 self.0.options = v.into();
17358 self
17359 }
17360
17361 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17368 (*self.0.stub)
17369 .create_lake(self.0.request, self.0.options)
17370 .await
17371 .map(crate::Response::into_body)
17372 }
17373
17374 pub fn poller(
17376 self,
17377 ) -> impl google_cloud_lro::Poller<crate::model::Lake, crate::model::OperationMetadata>
17378 {
17379 type Operation = google_cloud_lro::internal::Operation<
17380 crate::model::Lake,
17381 crate::model::OperationMetadata,
17382 >;
17383 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17384 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17385
17386 let stub = self.0.stub.clone();
17387 let mut options = self.0.options.clone();
17388 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17389 let query = move |name| {
17390 let stub = stub.clone();
17391 let options = options.clone();
17392 async {
17393 let op = GetOperation::new(stub)
17394 .set_name(name)
17395 .with_options(options)
17396 .send()
17397 .await?;
17398 Ok(Operation::new(op))
17399 }
17400 };
17401
17402 let start = move || async {
17403 let op = self.send().await?;
17404 Ok(Operation::new(op))
17405 };
17406
17407 google_cloud_lro::internal::new_poller(
17408 polling_error_policy,
17409 polling_backoff_policy,
17410 start,
17411 query,
17412 )
17413 }
17414
17415 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17419 self.0.request.parent = v.into();
17420 self
17421 }
17422
17423 pub fn set_lake_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17427 self.0.request.lake_id = v.into();
17428 self
17429 }
17430
17431 pub fn set_lake<T>(mut self, v: T) -> Self
17435 where
17436 T: std::convert::Into<crate::model::Lake>,
17437 {
17438 self.0.request.lake = std::option::Option::Some(v.into());
17439 self
17440 }
17441
17442 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
17446 where
17447 T: std::convert::Into<crate::model::Lake>,
17448 {
17449 self.0.request.lake = v.map(|x| x.into());
17450 self
17451 }
17452
17453 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17455 self.0.request.validate_only = v.into();
17456 self
17457 }
17458 }
17459
17460 #[doc(hidden)]
17461 impl crate::RequestBuilder for CreateLake {
17462 fn request_options(&mut self) -> &mut crate::RequestOptions {
17463 &mut self.0.options
17464 }
17465 }
17466
17467 #[derive(Clone, Debug)]
17485 pub struct UpdateLake(RequestBuilder<crate::model::UpdateLakeRequest>);
17486
17487 impl UpdateLake {
17488 pub(crate) fn new(
17489 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17490 ) -> Self {
17491 Self(RequestBuilder::new(stub))
17492 }
17493
17494 pub fn with_request<V: Into<crate::model::UpdateLakeRequest>>(mut self, v: V) -> Self {
17496 self.0.request = v.into();
17497 self
17498 }
17499
17500 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17502 self.0.options = v.into();
17503 self
17504 }
17505
17506 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17513 (*self.0.stub)
17514 .update_lake(self.0.request, self.0.options)
17515 .await
17516 .map(crate::Response::into_body)
17517 }
17518
17519 pub fn poller(
17521 self,
17522 ) -> impl google_cloud_lro::Poller<crate::model::Lake, crate::model::OperationMetadata>
17523 {
17524 type Operation = google_cloud_lro::internal::Operation<
17525 crate::model::Lake,
17526 crate::model::OperationMetadata,
17527 >;
17528 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17529 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17530
17531 let stub = self.0.stub.clone();
17532 let mut options = self.0.options.clone();
17533 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17534 let query = move |name| {
17535 let stub = stub.clone();
17536 let options = options.clone();
17537 async {
17538 let op = GetOperation::new(stub)
17539 .set_name(name)
17540 .with_options(options)
17541 .send()
17542 .await?;
17543 Ok(Operation::new(op))
17544 }
17545 };
17546
17547 let start = move || async {
17548 let op = self.send().await?;
17549 Ok(Operation::new(op))
17550 };
17551
17552 google_cloud_lro::internal::new_poller(
17553 polling_error_policy,
17554 polling_backoff_policy,
17555 start,
17556 query,
17557 )
17558 }
17559
17560 pub fn set_update_mask<T>(mut self, v: T) -> Self
17564 where
17565 T: std::convert::Into<wkt::FieldMask>,
17566 {
17567 self.0.request.update_mask = std::option::Option::Some(v.into());
17568 self
17569 }
17570
17571 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17575 where
17576 T: std::convert::Into<wkt::FieldMask>,
17577 {
17578 self.0.request.update_mask = v.map(|x| x.into());
17579 self
17580 }
17581
17582 pub fn set_lake<T>(mut self, v: T) -> Self
17586 where
17587 T: std::convert::Into<crate::model::Lake>,
17588 {
17589 self.0.request.lake = std::option::Option::Some(v.into());
17590 self
17591 }
17592
17593 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
17597 where
17598 T: std::convert::Into<crate::model::Lake>,
17599 {
17600 self.0.request.lake = v.map(|x| x.into());
17601 self
17602 }
17603
17604 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17606 self.0.request.validate_only = v.into();
17607 self
17608 }
17609 }
17610
17611 #[doc(hidden)]
17612 impl crate::RequestBuilder for UpdateLake {
17613 fn request_options(&mut self) -> &mut crate::RequestOptions {
17614 &mut self.0.options
17615 }
17616 }
17617
17618 #[derive(Clone, Debug)]
17636 pub struct DeleteLake(RequestBuilder<crate::model::DeleteLakeRequest>);
17637
17638 impl DeleteLake {
17639 pub(crate) fn new(
17640 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17641 ) -> Self {
17642 Self(RequestBuilder::new(stub))
17643 }
17644
17645 pub fn with_request<V: Into<crate::model::DeleteLakeRequest>>(mut self, v: V) -> Self {
17647 self.0.request = v.into();
17648 self
17649 }
17650
17651 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17653 self.0.options = v.into();
17654 self
17655 }
17656
17657 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17664 (*self.0.stub)
17665 .delete_lake(self.0.request, self.0.options)
17666 .await
17667 .map(crate::Response::into_body)
17668 }
17669
17670 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17672 type Operation =
17673 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17674 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17675 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17676
17677 let stub = self.0.stub.clone();
17678 let mut options = self.0.options.clone();
17679 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17680 let query = move |name| {
17681 let stub = stub.clone();
17682 let options = options.clone();
17683 async {
17684 let op = GetOperation::new(stub)
17685 .set_name(name)
17686 .with_options(options)
17687 .send()
17688 .await?;
17689 Ok(Operation::new(op))
17690 }
17691 };
17692
17693 let start = move || async {
17694 let op = self.send().await?;
17695 Ok(Operation::new(op))
17696 };
17697
17698 google_cloud_lro::internal::new_unit_response_poller(
17699 polling_error_policy,
17700 polling_backoff_policy,
17701 start,
17702 query,
17703 )
17704 }
17705
17706 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17710 self.0.request.name = v.into();
17711 self
17712 }
17713 }
17714
17715 #[doc(hidden)]
17716 impl crate::RequestBuilder for DeleteLake {
17717 fn request_options(&mut self) -> &mut crate::RequestOptions {
17718 &mut self.0.options
17719 }
17720 }
17721
17722 #[derive(Clone, Debug)]
17743 pub struct ListLakes(RequestBuilder<crate::model::ListLakesRequest>);
17744
17745 impl ListLakes {
17746 pub(crate) fn new(
17747 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17748 ) -> Self {
17749 Self(RequestBuilder::new(stub))
17750 }
17751
17752 pub fn with_request<V: Into<crate::model::ListLakesRequest>>(mut self, v: V) -> Self {
17754 self.0.request = v.into();
17755 self
17756 }
17757
17758 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17760 self.0.options = v.into();
17761 self
17762 }
17763
17764 pub async fn send(self) -> Result<crate::model::ListLakesResponse> {
17766 (*self.0.stub)
17767 .list_lakes(self.0.request, self.0.options)
17768 .await
17769 .map(crate::Response::into_body)
17770 }
17771
17772 pub fn by_page(
17774 self,
17775 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListLakesResponse, crate::Error>
17776 {
17777 use std::clone::Clone;
17778 let token = self.0.request.page_token.clone();
17779 let execute = move |token: String| {
17780 let mut builder = self.clone();
17781 builder.0.request = builder.0.request.set_page_token(token);
17782 builder.send()
17783 };
17784 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17785 }
17786
17787 pub fn by_item(
17789 self,
17790 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListLakesResponse, crate::Error>
17791 {
17792 use google_cloud_gax::paginator::Paginator;
17793 self.by_page().items()
17794 }
17795
17796 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17800 self.0.request.parent = v.into();
17801 self
17802 }
17803
17804 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17806 self.0.request.page_size = v.into();
17807 self
17808 }
17809
17810 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17812 self.0.request.page_token = v.into();
17813 self
17814 }
17815
17816 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17818 self.0.request.filter = v.into();
17819 self
17820 }
17821
17822 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
17824 self.0.request.order_by = v.into();
17825 self
17826 }
17827 }
17828
17829 #[doc(hidden)]
17830 impl crate::RequestBuilder for ListLakes {
17831 fn request_options(&mut self) -> &mut crate::RequestOptions {
17832 &mut self.0.options
17833 }
17834 }
17835
17836 #[derive(Clone, Debug)]
17853 pub struct GetLake(RequestBuilder<crate::model::GetLakeRequest>);
17854
17855 impl GetLake {
17856 pub(crate) fn new(
17857 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17858 ) -> Self {
17859 Self(RequestBuilder::new(stub))
17860 }
17861
17862 pub fn with_request<V: Into<crate::model::GetLakeRequest>>(mut self, v: V) -> Self {
17864 self.0.request = v.into();
17865 self
17866 }
17867
17868 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17870 self.0.options = v.into();
17871 self
17872 }
17873
17874 pub async fn send(self) -> Result<crate::model::Lake> {
17876 (*self.0.stub)
17877 .get_lake(self.0.request, self.0.options)
17878 .await
17879 .map(crate::Response::into_body)
17880 }
17881
17882 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17886 self.0.request.name = v.into();
17887 self
17888 }
17889 }
17890
17891 #[doc(hidden)]
17892 impl crate::RequestBuilder for GetLake {
17893 fn request_options(&mut self) -> &mut crate::RequestOptions {
17894 &mut self.0.options
17895 }
17896 }
17897
17898 #[derive(Clone, Debug)]
17919 pub struct ListLakeActions(RequestBuilder<crate::model::ListLakeActionsRequest>);
17920
17921 impl ListLakeActions {
17922 pub(crate) fn new(
17923 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17924 ) -> Self {
17925 Self(RequestBuilder::new(stub))
17926 }
17927
17928 pub fn with_request<V: Into<crate::model::ListLakeActionsRequest>>(mut self, v: V) -> Self {
17930 self.0.request = v.into();
17931 self
17932 }
17933
17934 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17936 self.0.options = v.into();
17937 self
17938 }
17939
17940 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
17942 (*self.0.stub)
17943 .list_lake_actions(self.0.request, self.0.options)
17944 .await
17945 .map(crate::Response::into_body)
17946 }
17947
17948 pub fn by_page(
17950 self,
17951 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
17952 {
17953 use std::clone::Clone;
17954 let token = self.0.request.page_token.clone();
17955 let execute = move |token: String| {
17956 let mut builder = self.clone();
17957 builder.0.request = builder.0.request.set_page_token(token);
17958 builder.send()
17959 };
17960 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17961 }
17962
17963 pub fn by_item(
17965 self,
17966 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17967 crate::model::ListActionsResponse,
17968 crate::Error,
17969 > {
17970 use google_cloud_gax::paginator::Paginator;
17971 self.by_page().items()
17972 }
17973
17974 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17978 self.0.request.parent = v.into();
17979 self
17980 }
17981
17982 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17984 self.0.request.page_size = v.into();
17985 self
17986 }
17987
17988 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17990 self.0.request.page_token = v.into();
17991 self
17992 }
17993 }
17994
17995 #[doc(hidden)]
17996 impl crate::RequestBuilder for ListLakeActions {
17997 fn request_options(&mut self) -> &mut crate::RequestOptions {
17998 &mut self.0.options
17999 }
18000 }
18001
18002 #[derive(Clone, Debug)]
18020 pub struct CreateZone(RequestBuilder<crate::model::CreateZoneRequest>);
18021
18022 impl CreateZone {
18023 pub(crate) fn new(
18024 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18025 ) -> Self {
18026 Self(RequestBuilder::new(stub))
18027 }
18028
18029 pub fn with_request<V: Into<crate::model::CreateZoneRequest>>(mut self, v: V) -> Self {
18031 self.0.request = v.into();
18032 self
18033 }
18034
18035 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18037 self.0.options = v.into();
18038 self
18039 }
18040
18041 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18048 (*self.0.stub)
18049 .create_zone(self.0.request, self.0.options)
18050 .await
18051 .map(crate::Response::into_body)
18052 }
18053
18054 pub fn poller(
18056 self,
18057 ) -> impl google_cloud_lro::Poller<crate::model::Zone, crate::model::OperationMetadata>
18058 {
18059 type Operation = google_cloud_lro::internal::Operation<
18060 crate::model::Zone,
18061 crate::model::OperationMetadata,
18062 >;
18063 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18064 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18065
18066 let stub = self.0.stub.clone();
18067 let mut options = self.0.options.clone();
18068 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18069 let query = move |name| {
18070 let stub = stub.clone();
18071 let options = options.clone();
18072 async {
18073 let op = GetOperation::new(stub)
18074 .set_name(name)
18075 .with_options(options)
18076 .send()
18077 .await?;
18078 Ok(Operation::new(op))
18079 }
18080 };
18081
18082 let start = move || async {
18083 let op = self.send().await?;
18084 Ok(Operation::new(op))
18085 };
18086
18087 google_cloud_lro::internal::new_poller(
18088 polling_error_policy,
18089 polling_backoff_policy,
18090 start,
18091 query,
18092 )
18093 }
18094
18095 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18099 self.0.request.parent = v.into();
18100 self
18101 }
18102
18103 pub fn set_zone_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18107 self.0.request.zone_id = v.into();
18108 self
18109 }
18110
18111 pub fn set_zone<T>(mut self, v: T) -> Self
18115 where
18116 T: std::convert::Into<crate::model::Zone>,
18117 {
18118 self.0.request.zone = std::option::Option::Some(v.into());
18119 self
18120 }
18121
18122 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
18126 where
18127 T: std::convert::Into<crate::model::Zone>,
18128 {
18129 self.0.request.zone = v.map(|x| x.into());
18130 self
18131 }
18132
18133 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
18135 self.0.request.validate_only = v.into();
18136 self
18137 }
18138 }
18139
18140 #[doc(hidden)]
18141 impl crate::RequestBuilder for CreateZone {
18142 fn request_options(&mut self) -> &mut crate::RequestOptions {
18143 &mut self.0.options
18144 }
18145 }
18146
18147 #[derive(Clone, Debug)]
18165 pub struct UpdateZone(RequestBuilder<crate::model::UpdateZoneRequest>);
18166
18167 impl UpdateZone {
18168 pub(crate) fn new(
18169 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18170 ) -> Self {
18171 Self(RequestBuilder::new(stub))
18172 }
18173
18174 pub fn with_request<V: Into<crate::model::UpdateZoneRequest>>(mut self, v: V) -> Self {
18176 self.0.request = v.into();
18177 self
18178 }
18179
18180 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18182 self.0.options = v.into();
18183 self
18184 }
18185
18186 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18193 (*self.0.stub)
18194 .update_zone(self.0.request, self.0.options)
18195 .await
18196 .map(crate::Response::into_body)
18197 }
18198
18199 pub fn poller(
18201 self,
18202 ) -> impl google_cloud_lro::Poller<crate::model::Zone, crate::model::OperationMetadata>
18203 {
18204 type Operation = google_cloud_lro::internal::Operation<
18205 crate::model::Zone,
18206 crate::model::OperationMetadata,
18207 >;
18208 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18209 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18210
18211 let stub = self.0.stub.clone();
18212 let mut options = self.0.options.clone();
18213 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18214 let query = move |name| {
18215 let stub = stub.clone();
18216 let options = options.clone();
18217 async {
18218 let op = GetOperation::new(stub)
18219 .set_name(name)
18220 .with_options(options)
18221 .send()
18222 .await?;
18223 Ok(Operation::new(op))
18224 }
18225 };
18226
18227 let start = move || async {
18228 let op = self.send().await?;
18229 Ok(Operation::new(op))
18230 };
18231
18232 google_cloud_lro::internal::new_poller(
18233 polling_error_policy,
18234 polling_backoff_policy,
18235 start,
18236 query,
18237 )
18238 }
18239
18240 pub fn set_update_mask<T>(mut self, v: T) -> Self
18244 where
18245 T: std::convert::Into<wkt::FieldMask>,
18246 {
18247 self.0.request.update_mask = std::option::Option::Some(v.into());
18248 self
18249 }
18250
18251 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18255 where
18256 T: std::convert::Into<wkt::FieldMask>,
18257 {
18258 self.0.request.update_mask = v.map(|x| x.into());
18259 self
18260 }
18261
18262 pub fn set_zone<T>(mut self, v: T) -> Self
18266 where
18267 T: std::convert::Into<crate::model::Zone>,
18268 {
18269 self.0.request.zone = std::option::Option::Some(v.into());
18270 self
18271 }
18272
18273 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
18277 where
18278 T: std::convert::Into<crate::model::Zone>,
18279 {
18280 self.0.request.zone = v.map(|x| x.into());
18281 self
18282 }
18283
18284 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
18286 self.0.request.validate_only = v.into();
18287 self
18288 }
18289 }
18290
18291 #[doc(hidden)]
18292 impl crate::RequestBuilder for UpdateZone {
18293 fn request_options(&mut self) -> &mut crate::RequestOptions {
18294 &mut self.0.options
18295 }
18296 }
18297
18298 #[derive(Clone, Debug)]
18316 pub struct DeleteZone(RequestBuilder<crate::model::DeleteZoneRequest>);
18317
18318 impl DeleteZone {
18319 pub(crate) fn new(
18320 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18321 ) -> Self {
18322 Self(RequestBuilder::new(stub))
18323 }
18324
18325 pub fn with_request<V: Into<crate::model::DeleteZoneRequest>>(mut self, v: V) -> Self {
18327 self.0.request = v.into();
18328 self
18329 }
18330
18331 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18333 self.0.options = v.into();
18334 self
18335 }
18336
18337 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18344 (*self.0.stub)
18345 .delete_zone(self.0.request, self.0.options)
18346 .await
18347 .map(crate::Response::into_body)
18348 }
18349
18350 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18352 type Operation =
18353 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18354 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18355 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18356
18357 let stub = self.0.stub.clone();
18358 let mut options = self.0.options.clone();
18359 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18360 let query = move |name| {
18361 let stub = stub.clone();
18362 let options = options.clone();
18363 async {
18364 let op = GetOperation::new(stub)
18365 .set_name(name)
18366 .with_options(options)
18367 .send()
18368 .await?;
18369 Ok(Operation::new(op))
18370 }
18371 };
18372
18373 let start = move || async {
18374 let op = self.send().await?;
18375 Ok(Operation::new(op))
18376 };
18377
18378 google_cloud_lro::internal::new_unit_response_poller(
18379 polling_error_policy,
18380 polling_backoff_policy,
18381 start,
18382 query,
18383 )
18384 }
18385
18386 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18390 self.0.request.name = v.into();
18391 self
18392 }
18393 }
18394
18395 #[doc(hidden)]
18396 impl crate::RequestBuilder for DeleteZone {
18397 fn request_options(&mut self) -> &mut crate::RequestOptions {
18398 &mut self.0.options
18399 }
18400 }
18401
18402 #[derive(Clone, Debug)]
18423 pub struct ListZones(RequestBuilder<crate::model::ListZonesRequest>);
18424
18425 impl ListZones {
18426 pub(crate) fn new(
18427 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18428 ) -> Self {
18429 Self(RequestBuilder::new(stub))
18430 }
18431
18432 pub fn with_request<V: Into<crate::model::ListZonesRequest>>(mut self, v: V) -> Self {
18434 self.0.request = v.into();
18435 self
18436 }
18437
18438 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18440 self.0.options = v.into();
18441 self
18442 }
18443
18444 pub async fn send(self) -> Result<crate::model::ListZonesResponse> {
18446 (*self.0.stub)
18447 .list_zones(self.0.request, self.0.options)
18448 .await
18449 .map(crate::Response::into_body)
18450 }
18451
18452 pub fn by_page(
18454 self,
18455 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListZonesResponse, crate::Error>
18456 {
18457 use std::clone::Clone;
18458 let token = self.0.request.page_token.clone();
18459 let execute = move |token: String| {
18460 let mut builder = self.clone();
18461 builder.0.request = builder.0.request.set_page_token(token);
18462 builder.send()
18463 };
18464 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18465 }
18466
18467 pub fn by_item(
18469 self,
18470 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListZonesResponse, crate::Error>
18471 {
18472 use google_cloud_gax::paginator::Paginator;
18473 self.by_page().items()
18474 }
18475
18476 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18480 self.0.request.parent = v.into();
18481 self
18482 }
18483
18484 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18486 self.0.request.page_size = v.into();
18487 self
18488 }
18489
18490 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18492 self.0.request.page_token = v.into();
18493 self
18494 }
18495
18496 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18498 self.0.request.filter = v.into();
18499 self
18500 }
18501
18502 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
18504 self.0.request.order_by = v.into();
18505 self
18506 }
18507 }
18508
18509 #[doc(hidden)]
18510 impl crate::RequestBuilder for ListZones {
18511 fn request_options(&mut self) -> &mut crate::RequestOptions {
18512 &mut self.0.options
18513 }
18514 }
18515
18516 #[derive(Clone, Debug)]
18533 pub struct GetZone(RequestBuilder<crate::model::GetZoneRequest>);
18534
18535 impl GetZone {
18536 pub(crate) fn new(
18537 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18538 ) -> Self {
18539 Self(RequestBuilder::new(stub))
18540 }
18541
18542 pub fn with_request<V: Into<crate::model::GetZoneRequest>>(mut self, v: V) -> Self {
18544 self.0.request = v.into();
18545 self
18546 }
18547
18548 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18550 self.0.options = v.into();
18551 self
18552 }
18553
18554 pub async fn send(self) -> Result<crate::model::Zone> {
18556 (*self.0.stub)
18557 .get_zone(self.0.request, self.0.options)
18558 .await
18559 .map(crate::Response::into_body)
18560 }
18561
18562 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18566 self.0.request.name = v.into();
18567 self
18568 }
18569 }
18570
18571 #[doc(hidden)]
18572 impl crate::RequestBuilder for GetZone {
18573 fn request_options(&mut self) -> &mut crate::RequestOptions {
18574 &mut self.0.options
18575 }
18576 }
18577
18578 #[derive(Clone, Debug)]
18599 pub struct ListZoneActions(RequestBuilder<crate::model::ListZoneActionsRequest>);
18600
18601 impl ListZoneActions {
18602 pub(crate) fn new(
18603 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18604 ) -> Self {
18605 Self(RequestBuilder::new(stub))
18606 }
18607
18608 pub fn with_request<V: Into<crate::model::ListZoneActionsRequest>>(mut self, v: V) -> Self {
18610 self.0.request = v.into();
18611 self
18612 }
18613
18614 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18616 self.0.options = v.into();
18617 self
18618 }
18619
18620 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
18622 (*self.0.stub)
18623 .list_zone_actions(self.0.request, self.0.options)
18624 .await
18625 .map(crate::Response::into_body)
18626 }
18627
18628 pub fn by_page(
18630 self,
18631 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
18632 {
18633 use std::clone::Clone;
18634 let token = self.0.request.page_token.clone();
18635 let execute = move |token: String| {
18636 let mut builder = self.clone();
18637 builder.0.request = builder.0.request.set_page_token(token);
18638 builder.send()
18639 };
18640 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18641 }
18642
18643 pub fn by_item(
18645 self,
18646 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18647 crate::model::ListActionsResponse,
18648 crate::Error,
18649 > {
18650 use google_cloud_gax::paginator::Paginator;
18651 self.by_page().items()
18652 }
18653
18654 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18658 self.0.request.parent = v.into();
18659 self
18660 }
18661
18662 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18664 self.0.request.page_size = v.into();
18665 self
18666 }
18667
18668 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18670 self.0.request.page_token = v.into();
18671 self
18672 }
18673 }
18674
18675 #[doc(hidden)]
18676 impl crate::RequestBuilder for ListZoneActions {
18677 fn request_options(&mut self) -> &mut crate::RequestOptions {
18678 &mut self.0.options
18679 }
18680 }
18681
18682 #[derive(Clone, Debug)]
18700 pub struct CreateAsset(RequestBuilder<crate::model::CreateAssetRequest>);
18701
18702 impl CreateAsset {
18703 pub(crate) fn new(
18704 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18705 ) -> Self {
18706 Self(RequestBuilder::new(stub))
18707 }
18708
18709 pub fn with_request<V: Into<crate::model::CreateAssetRequest>>(mut self, v: V) -> Self {
18711 self.0.request = v.into();
18712 self
18713 }
18714
18715 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18717 self.0.options = v.into();
18718 self
18719 }
18720
18721 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18728 (*self.0.stub)
18729 .create_asset(self.0.request, self.0.options)
18730 .await
18731 .map(crate::Response::into_body)
18732 }
18733
18734 pub fn poller(
18736 self,
18737 ) -> impl google_cloud_lro::Poller<crate::model::Asset, crate::model::OperationMetadata>
18738 {
18739 type Operation = google_cloud_lro::internal::Operation<
18740 crate::model::Asset,
18741 crate::model::OperationMetadata,
18742 >;
18743 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18744 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18745
18746 let stub = self.0.stub.clone();
18747 let mut options = self.0.options.clone();
18748 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18749 let query = move |name| {
18750 let stub = stub.clone();
18751 let options = options.clone();
18752 async {
18753 let op = GetOperation::new(stub)
18754 .set_name(name)
18755 .with_options(options)
18756 .send()
18757 .await?;
18758 Ok(Operation::new(op))
18759 }
18760 };
18761
18762 let start = move || async {
18763 let op = self.send().await?;
18764 Ok(Operation::new(op))
18765 };
18766
18767 google_cloud_lro::internal::new_poller(
18768 polling_error_policy,
18769 polling_backoff_policy,
18770 start,
18771 query,
18772 )
18773 }
18774
18775 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18779 self.0.request.parent = v.into();
18780 self
18781 }
18782
18783 pub fn set_asset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18787 self.0.request.asset_id = v.into();
18788 self
18789 }
18790
18791 pub fn set_asset<T>(mut self, v: T) -> Self
18795 where
18796 T: std::convert::Into<crate::model::Asset>,
18797 {
18798 self.0.request.asset = std::option::Option::Some(v.into());
18799 self
18800 }
18801
18802 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
18806 where
18807 T: std::convert::Into<crate::model::Asset>,
18808 {
18809 self.0.request.asset = v.map(|x| x.into());
18810 self
18811 }
18812
18813 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
18815 self.0.request.validate_only = v.into();
18816 self
18817 }
18818 }
18819
18820 #[doc(hidden)]
18821 impl crate::RequestBuilder for CreateAsset {
18822 fn request_options(&mut self) -> &mut crate::RequestOptions {
18823 &mut self.0.options
18824 }
18825 }
18826
18827 #[derive(Clone, Debug)]
18845 pub struct UpdateAsset(RequestBuilder<crate::model::UpdateAssetRequest>);
18846
18847 impl UpdateAsset {
18848 pub(crate) fn new(
18849 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18850 ) -> Self {
18851 Self(RequestBuilder::new(stub))
18852 }
18853
18854 pub fn with_request<V: Into<crate::model::UpdateAssetRequest>>(mut self, v: V) -> Self {
18856 self.0.request = v.into();
18857 self
18858 }
18859
18860 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18862 self.0.options = v.into();
18863 self
18864 }
18865
18866 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18873 (*self.0.stub)
18874 .update_asset(self.0.request, self.0.options)
18875 .await
18876 .map(crate::Response::into_body)
18877 }
18878
18879 pub fn poller(
18881 self,
18882 ) -> impl google_cloud_lro::Poller<crate::model::Asset, crate::model::OperationMetadata>
18883 {
18884 type Operation = google_cloud_lro::internal::Operation<
18885 crate::model::Asset,
18886 crate::model::OperationMetadata,
18887 >;
18888 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18889 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18890
18891 let stub = self.0.stub.clone();
18892 let mut options = self.0.options.clone();
18893 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18894 let query = move |name| {
18895 let stub = stub.clone();
18896 let options = options.clone();
18897 async {
18898 let op = GetOperation::new(stub)
18899 .set_name(name)
18900 .with_options(options)
18901 .send()
18902 .await?;
18903 Ok(Operation::new(op))
18904 }
18905 };
18906
18907 let start = move || async {
18908 let op = self.send().await?;
18909 Ok(Operation::new(op))
18910 };
18911
18912 google_cloud_lro::internal::new_poller(
18913 polling_error_policy,
18914 polling_backoff_policy,
18915 start,
18916 query,
18917 )
18918 }
18919
18920 pub fn set_update_mask<T>(mut self, v: T) -> Self
18924 where
18925 T: std::convert::Into<wkt::FieldMask>,
18926 {
18927 self.0.request.update_mask = std::option::Option::Some(v.into());
18928 self
18929 }
18930
18931 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18935 where
18936 T: std::convert::Into<wkt::FieldMask>,
18937 {
18938 self.0.request.update_mask = v.map(|x| x.into());
18939 self
18940 }
18941
18942 pub fn set_asset<T>(mut self, v: T) -> Self
18946 where
18947 T: std::convert::Into<crate::model::Asset>,
18948 {
18949 self.0.request.asset = std::option::Option::Some(v.into());
18950 self
18951 }
18952
18953 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
18957 where
18958 T: std::convert::Into<crate::model::Asset>,
18959 {
18960 self.0.request.asset = v.map(|x| x.into());
18961 self
18962 }
18963
18964 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
18966 self.0.request.validate_only = v.into();
18967 self
18968 }
18969 }
18970
18971 #[doc(hidden)]
18972 impl crate::RequestBuilder for UpdateAsset {
18973 fn request_options(&mut self) -> &mut crate::RequestOptions {
18974 &mut self.0.options
18975 }
18976 }
18977
18978 #[derive(Clone, Debug)]
18996 pub struct DeleteAsset(RequestBuilder<crate::model::DeleteAssetRequest>);
18997
18998 impl DeleteAsset {
18999 pub(crate) fn new(
19000 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19001 ) -> Self {
19002 Self(RequestBuilder::new(stub))
19003 }
19004
19005 pub fn with_request<V: Into<crate::model::DeleteAssetRequest>>(mut self, v: V) -> Self {
19007 self.0.request = v.into();
19008 self
19009 }
19010
19011 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19013 self.0.options = v.into();
19014 self
19015 }
19016
19017 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19024 (*self.0.stub)
19025 .delete_asset(self.0.request, self.0.options)
19026 .await
19027 .map(crate::Response::into_body)
19028 }
19029
19030 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
19032 type Operation =
19033 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
19034 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19035 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19036
19037 let stub = self.0.stub.clone();
19038 let mut options = self.0.options.clone();
19039 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19040 let query = move |name| {
19041 let stub = stub.clone();
19042 let options = options.clone();
19043 async {
19044 let op = GetOperation::new(stub)
19045 .set_name(name)
19046 .with_options(options)
19047 .send()
19048 .await?;
19049 Ok(Operation::new(op))
19050 }
19051 };
19052
19053 let start = move || async {
19054 let op = self.send().await?;
19055 Ok(Operation::new(op))
19056 };
19057
19058 google_cloud_lro::internal::new_unit_response_poller(
19059 polling_error_policy,
19060 polling_backoff_policy,
19061 start,
19062 query,
19063 )
19064 }
19065
19066 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19070 self.0.request.name = v.into();
19071 self
19072 }
19073 }
19074
19075 #[doc(hidden)]
19076 impl crate::RequestBuilder for DeleteAsset {
19077 fn request_options(&mut self) -> &mut crate::RequestOptions {
19078 &mut self.0.options
19079 }
19080 }
19081
19082 #[derive(Clone, Debug)]
19103 pub struct ListAssets(RequestBuilder<crate::model::ListAssetsRequest>);
19104
19105 impl ListAssets {
19106 pub(crate) fn new(
19107 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19108 ) -> Self {
19109 Self(RequestBuilder::new(stub))
19110 }
19111
19112 pub fn with_request<V: Into<crate::model::ListAssetsRequest>>(mut self, v: V) -> Self {
19114 self.0.request = v.into();
19115 self
19116 }
19117
19118 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19120 self.0.options = v.into();
19121 self
19122 }
19123
19124 pub async fn send(self) -> Result<crate::model::ListAssetsResponse> {
19126 (*self.0.stub)
19127 .list_assets(self.0.request, self.0.options)
19128 .await
19129 .map(crate::Response::into_body)
19130 }
19131
19132 pub fn by_page(
19134 self,
19135 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListAssetsResponse, crate::Error>
19136 {
19137 use std::clone::Clone;
19138 let token = self.0.request.page_token.clone();
19139 let execute = move |token: String| {
19140 let mut builder = self.clone();
19141 builder.0.request = builder.0.request.set_page_token(token);
19142 builder.send()
19143 };
19144 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19145 }
19146
19147 pub fn by_item(
19149 self,
19150 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19151 crate::model::ListAssetsResponse,
19152 crate::Error,
19153 > {
19154 use google_cloud_gax::paginator::Paginator;
19155 self.by_page().items()
19156 }
19157
19158 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19162 self.0.request.parent = v.into();
19163 self
19164 }
19165
19166 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19168 self.0.request.page_size = v.into();
19169 self
19170 }
19171
19172 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19174 self.0.request.page_token = v.into();
19175 self
19176 }
19177
19178 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19180 self.0.request.filter = v.into();
19181 self
19182 }
19183
19184 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
19186 self.0.request.order_by = v.into();
19187 self
19188 }
19189 }
19190
19191 #[doc(hidden)]
19192 impl crate::RequestBuilder for ListAssets {
19193 fn request_options(&mut self) -> &mut crate::RequestOptions {
19194 &mut self.0.options
19195 }
19196 }
19197
19198 #[derive(Clone, Debug)]
19215 pub struct GetAsset(RequestBuilder<crate::model::GetAssetRequest>);
19216
19217 impl GetAsset {
19218 pub(crate) fn new(
19219 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19220 ) -> Self {
19221 Self(RequestBuilder::new(stub))
19222 }
19223
19224 pub fn with_request<V: Into<crate::model::GetAssetRequest>>(mut self, v: V) -> Self {
19226 self.0.request = v.into();
19227 self
19228 }
19229
19230 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19232 self.0.options = v.into();
19233 self
19234 }
19235
19236 pub async fn send(self) -> Result<crate::model::Asset> {
19238 (*self.0.stub)
19239 .get_asset(self.0.request, self.0.options)
19240 .await
19241 .map(crate::Response::into_body)
19242 }
19243
19244 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19248 self.0.request.name = v.into();
19249 self
19250 }
19251 }
19252
19253 #[doc(hidden)]
19254 impl crate::RequestBuilder for GetAsset {
19255 fn request_options(&mut self) -> &mut crate::RequestOptions {
19256 &mut self.0.options
19257 }
19258 }
19259
19260 #[derive(Clone, Debug)]
19281 pub struct ListAssetActions(RequestBuilder<crate::model::ListAssetActionsRequest>);
19282
19283 impl ListAssetActions {
19284 pub(crate) fn new(
19285 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19286 ) -> Self {
19287 Self(RequestBuilder::new(stub))
19288 }
19289
19290 pub fn with_request<V: Into<crate::model::ListAssetActionsRequest>>(
19292 mut self,
19293 v: V,
19294 ) -> Self {
19295 self.0.request = v.into();
19296 self
19297 }
19298
19299 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19301 self.0.options = v.into();
19302 self
19303 }
19304
19305 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
19307 (*self.0.stub)
19308 .list_asset_actions(self.0.request, self.0.options)
19309 .await
19310 .map(crate::Response::into_body)
19311 }
19312
19313 pub fn by_page(
19315 self,
19316 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
19317 {
19318 use std::clone::Clone;
19319 let token = self.0.request.page_token.clone();
19320 let execute = move |token: String| {
19321 let mut builder = self.clone();
19322 builder.0.request = builder.0.request.set_page_token(token);
19323 builder.send()
19324 };
19325 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19326 }
19327
19328 pub fn by_item(
19330 self,
19331 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19332 crate::model::ListActionsResponse,
19333 crate::Error,
19334 > {
19335 use google_cloud_gax::paginator::Paginator;
19336 self.by_page().items()
19337 }
19338
19339 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19343 self.0.request.parent = v.into();
19344 self
19345 }
19346
19347 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19349 self.0.request.page_size = v.into();
19350 self
19351 }
19352
19353 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19355 self.0.request.page_token = v.into();
19356 self
19357 }
19358 }
19359
19360 #[doc(hidden)]
19361 impl crate::RequestBuilder for ListAssetActions {
19362 fn request_options(&mut self) -> &mut crate::RequestOptions {
19363 &mut self.0.options
19364 }
19365 }
19366
19367 #[derive(Clone, Debug)]
19385 pub struct CreateTask(RequestBuilder<crate::model::CreateTaskRequest>);
19386
19387 impl CreateTask {
19388 pub(crate) fn new(
19389 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19390 ) -> Self {
19391 Self(RequestBuilder::new(stub))
19392 }
19393
19394 pub fn with_request<V: Into<crate::model::CreateTaskRequest>>(mut self, v: V) -> Self {
19396 self.0.request = v.into();
19397 self
19398 }
19399
19400 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19402 self.0.options = v.into();
19403 self
19404 }
19405
19406 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19413 (*self.0.stub)
19414 .create_task(self.0.request, self.0.options)
19415 .await
19416 .map(crate::Response::into_body)
19417 }
19418
19419 pub fn poller(
19421 self,
19422 ) -> impl google_cloud_lro::Poller<crate::model::Task, crate::model::OperationMetadata>
19423 {
19424 type Operation = google_cloud_lro::internal::Operation<
19425 crate::model::Task,
19426 crate::model::OperationMetadata,
19427 >;
19428 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19429 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19430
19431 let stub = self.0.stub.clone();
19432 let mut options = self.0.options.clone();
19433 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19434 let query = move |name| {
19435 let stub = stub.clone();
19436 let options = options.clone();
19437 async {
19438 let op = GetOperation::new(stub)
19439 .set_name(name)
19440 .with_options(options)
19441 .send()
19442 .await?;
19443 Ok(Operation::new(op))
19444 }
19445 };
19446
19447 let start = move || async {
19448 let op = self.send().await?;
19449 Ok(Operation::new(op))
19450 };
19451
19452 google_cloud_lro::internal::new_poller(
19453 polling_error_policy,
19454 polling_backoff_policy,
19455 start,
19456 query,
19457 )
19458 }
19459
19460 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19464 self.0.request.parent = v.into();
19465 self
19466 }
19467
19468 pub fn set_task_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19472 self.0.request.task_id = v.into();
19473 self
19474 }
19475
19476 pub fn set_task<T>(mut self, v: T) -> Self
19480 where
19481 T: std::convert::Into<crate::model::Task>,
19482 {
19483 self.0.request.task = std::option::Option::Some(v.into());
19484 self
19485 }
19486
19487 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
19491 where
19492 T: std::convert::Into<crate::model::Task>,
19493 {
19494 self.0.request.task = v.map(|x| x.into());
19495 self
19496 }
19497
19498 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
19500 self.0.request.validate_only = v.into();
19501 self
19502 }
19503 }
19504
19505 #[doc(hidden)]
19506 impl crate::RequestBuilder for CreateTask {
19507 fn request_options(&mut self) -> &mut crate::RequestOptions {
19508 &mut self.0.options
19509 }
19510 }
19511
19512 #[derive(Clone, Debug)]
19530 pub struct UpdateTask(RequestBuilder<crate::model::UpdateTaskRequest>);
19531
19532 impl UpdateTask {
19533 pub(crate) fn new(
19534 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19535 ) -> Self {
19536 Self(RequestBuilder::new(stub))
19537 }
19538
19539 pub fn with_request<V: Into<crate::model::UpdateTaskRequest>>(mut self, v: V) -> Self {
19541 self.0.request = v.into();
19542 self
19543 }
19544
19545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19547 self.0.options = v.into();
19548 self
19549 }
19550
19551 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19558 (*self.0.stub)
19559 .update_task(self.0.request, self.0.options)
19560 .await
19561 .map(crate::Response::into_body)
19562 }
19563
19564 pub fn poller(
19566 self,
19567 ) -> impl google_cloud_lro::Poller<crate::model::Task, crate::model::OperationMetadata>
19568 {
19569 type Operation = google_cloud_lro::internal::Operation<
19570 crate::model::Task,
19571 crate::model::OperationMetadata,
19572 >;
19573 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19574 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19575
19576 let stub = self.0.stub.clone();
19577 let mut options = self.0.options.clone();
19578 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19579 let query = move |name| {
19580 let stub = stub.clone();
19581 let options = options.clone();
19582 async {
19583 let op = GetOperation::new(stub)
19584 .set_name(name)
19585 .with_options(options)
19586 .send()
19587 .await?;
19588 Ok(Operation::new(op))
19589 }
19590 };
19591
19592 let start = move || async {
19593 let op = self.send().await?;
19594 Ok(Operation::new(op))
19595 };
19596
19597 google_cloud_lro::internal::new_poller(
19598 polling_error_policy,
19599 polling_backoff_policy,
19600 start,
19601 query,
19602 )
19603 }
19604
19605 pub fn set_update_mask<T>(mut self, v: T) -> Self
19609 where
19610 T: std::convert::Into<wkt::FieldMask>,
19611 {
19612 self.0.request.update_mask = std::option::Option::Some(v.into());
19613 self
19614 }
19615
19616 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19620 where
19621 T: std::convert::Into<wkt::FieldMask>,
19622 {
19623 self.0.request.update_mask = v.map(|x| x.into());
19624 self
19625 }
19626
19627 pub fn set_task<T>(mut self, v: T) -> Self
19631 where
19632 T: std::convert::Into<crate::model::Task>,
19633 {
19634 self.0.request.task = std::option::Option::Some(v.into());
19635 self
19636 }
19637
19638 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
19642 where
19643 T: std::convert::Into<crate::model::Task>,
19644 {
19645 self.0.request.task = v.map(|x| x.into());
19646 self
19647 }
19648
19649 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
19651 self.0.request.validate_only = v.into();
19652 self
19653 }
19654 }
19655
19656 #[doc(hidden)]
19657 impl crate::RequestBuilder for UpdateTask {
19658 fn request_options(&mut self) -> &mut crate::RequestOptions {
19659 &mut self.0.options
19660 }
19661 }
19662
19663 #[derive(Clone, Debug)]
19681 pub struct DeleteTask(RequestBuilder<crate::model::DeleteTaskRequest>);
19682
19683 impl DeleteTask {
19684 pub(crate) fn new(
19685 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19686 ) -> Self {
19687 Self(RequestBuilder::new(stub))
19688 }
19689
19690 pub fn with_request<V: Into<crate::model::DeleteTaskRequest>>(mut self, v: V) -> Self {
19692 self.0.request = v.into();
19693 self
19694 }
19695
19696 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19698 self.0.options = v.into();
19699 self
19700 }
19701
19702 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19709 (*self.0.stub)
19710 .delete_task(self.0.request, self.0.options)
19711 .await
19712 .map(crate::Response::into_body)
19713 }
19714
19715 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
19717 type Operation =
19718 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
19719 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19720 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19721
19722 let stub = self.0.stub.clone();
19723 let mut options = self.0.options.clone();
19724 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19725 let query = move |name| {
19726 let stub = stub.clone();
19727 let options = options.clone();
19728 async {
19729 let op = GetOperation::new(stub)
19730 .set_name(name)
19731 .with_options(options)
19732 .send()
19733 .await?;
19734 Ok(Operation::new(op))
19735 }
19736 };
19737
19738 let start = move || async {
19739 let op = self.send().await?;
19740 Ok(Operation::new(op))
19741 };
19742
19743 google_cloud_lro::internal::new_unit_response_poller(
19744 polling_error_policy,
19745 polling_backoff_policy,
19746 start,
19747 query,
19748 )
19749 }
19750
19751 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19755 self.0.request.name = v.into();
19756 self
19757 }
19758 }
19759
19760 #[doc(hidden)]
19761 impl crate::RequestBuilder for DeleteTask {
19762 fn request_options(&mut self) -> &mut crate::RequestOptions {
19763 &mut self.0.options
19764 }
19765 }
19766
19767 #[derive(Clone, Debug)]
19788 pub struct ListTasks(RequestBuilder<crate::model::ListTasksRequest>);
19789
19790 impl ListTasks {
19791 pub(crate) fn new(
19792 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19793 ) -> Self {
19794 Self(RequestBuilder::new(stub))
19795 }
19796
19797 pub fn with_request<V: Into<crate::model::ListTasksRequest>>(mut self, v: V) -> Self {
19799 self.0.request = v.into();
19800 self
19801 }
19802
19803 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19805 self.0.options = v.into();
19806 self
19807 }
19808
19809 pub async fn send(self) -> Result<crate::model::ListTasksResponse> {
19811 (*self.0.stub)
19812 .list_tasks(self.0.request, self.0.options)
19813 .await
19814 .map(crate::Response::into_body)
19815 }
19816
19817 pub fn by_page(
19819 self,
19820 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTasksResponse, crate::Error>
19821 {
19822 use std::clone::Clone;
19823 let token = self.0.request.page_token.clone();
19824 let execute = move |token: String| {
19825 let mut builder = self.clone();
19826 builder.0.request = builder.0.request.set_page_token(token);
19827 builder.send()
19828 };
19829 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19830 }
19831
19832 pub fn by_item(
19834 self,
19835 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListTasksResponse, crate::Error>
19836 {
19837 use google_cloud_gax::paginator::Paginator;
19838 self.by_page().items()
19839 }
19840
19841 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19845 self.0.request.parent = v.into();
19846 self
19847 }
19848
19849 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19851 self.0.request.page_size = v.into();
19852 self
19853 }
19854
19855 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19857 self.0.request.page_token = v.into();
19858 self
19859 }
19860
19861 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19863 self.0.request.filter = v.into();
19864 self
19865 }
19866
19867 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
19869 self.0.request.order_by = v.into();
19870 self
19871 }
19872 }
19873
19874 #[doc(hidden)]
19875 impl crate::RequestBuilder for ListTasks {
19876 fn request_options(&mut self) -> &mut crate::RequestOptions {
19877 &mut self.0.options
19878 }
19879 }
19880
19881 #[derive(Clone, Debug)]
19898 pub struct GetTask(RequestBuilder<crate::model::GetTaskRequest>);
19899
19900 impl GetTask {
19901 pub(crate) fn new(
19902 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19903 ) -> Self {
19904 Self(RequestBuilder::new(stub))
19905 }
19906
19907 pub fn with_request<V: Into<crate::model::GetTaskRequest>>(mut self, v: V) -> Self {
19909 self.0.request = v.into();
19910 self
19911 }
19912
19913 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19915 self.0.options = v.into();
19916 self
19917 }
19918
19919 pub async fn send(self) -> Result<crate::model::Task> {
19921 (*self.0.stub)
19922 .get_task(self.0.request, self.0.options)
19923 .await
19924 .map(crate::Response::into_body)
19925 }
19926
19927 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19931 self.0.request.name = v.into();
19932 self
19933 }
19934 }
19935
19936 #[doc(hidden)]
19937 impl crate::RequestBuilder for GetTask {
19938 fn request_options(&mut self) -> &mut crate::RequestOptions {
19939 &mut self.0.options
19940 }
19941 }
19942
19943 #[derive(Clone, Debug)]
19964 pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
19965
19966 impl ListJobs {
19967 pub(crate) fn new(
19968 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19969 ) -> Self {
19970 Self(RequestBuilder::new(stub))
19971 }
19972
19973 pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
19975 self.0.request = v.into();
19976 self
19977 }
19978
19979 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19981 self.0.options = v.into();
19982 self
19983 }
19984
19985 pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
19987 (*self.0.stub)
19988 .list_jobs(self.0.request, self.0.options)
19989 .await
19990 .map(crate::Response::into_body)
19991 }
19992
19993 pub fn by_page(
19995 self,
19996 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListJobsResponse, crate::Error>
19997 {
19998 use std::clone::Clone;
19999 let token = self.0.request.page_token.clone();
20000 let execute = move |token: String| {
20001 let mut builder = self.clone();
20002 builder.0.request = builder.0.request.set_page_token(token);
20003 builder.send()
20004 };
20005 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20006 }
20007
20008 pub fn by_item(
20010 self,
20011 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListJobsResponse, crate::Error>
20012 {
20013 use google_cloud_gax::paginator::Paginator;
20014 self.by_page().items()
20015 }
20016
20017 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20021 self.0.request.parent = v.into();
20022 self
20023 }
20024
20025 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20027 self.0.request.page_size = v.into();
20028 self
20029 }
20030
20031 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20033 self.0.request.page_token = v.into();
20034 self
20035 }
20036 }
20037
20038 #[doc(hidden)]
20039 impl crate::RequestBuilder for ListJobs {
20040 fn request_options(&mut self) -> &mut crate::RequestOptions {
20041 &mut self.0.options
20042 }
20043 }
20044
20045 #[derive(Clone, Debug)]
20062 pub struct RunTask(RequestBuilder<crate::model::RunTaskRequest>);
20063
20064 impl RunTask {
20065 pub(crate) fn new(
20066 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20067 ) -> Self {
20068 Self(RequestBuilder::new(stub))
20069 }
20070
20071 pub fn with_request<V: Into<crate::model::RunTaskRequest>>(mut self, v: V) -> Self {
20073 self.0.request = v.into();
20074 self
20075 }
20076
20077 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20079 self.0.options = v.into();
20080 self
20081 }
20082
20083 pub async fn send(self) -> Result<crate::model::RunTaskResponse> {
20085 (*self.0.stub)
20086 .run_task(self.0.request, self.0.options)
20087 .await
20088 .map(crate::Response::into_body)
20089 }
20090
20091 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20095 self.0.request.name = v.into();
20096 self
20097 }
20098
20099 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
20101 where
20102 T: std::iter::IntoIterator<Item = (K, V)>,
20103 K: std::convert::Into<std::string::String>,
20104 V: std::convert::Into<std::string::String>,
20105 {
20106 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20107 self
20108 }
20109
20110 pub fn set_args<T, K, V>(mut self, v: T) -> Self
20112 where
20113 T: std::iter::IntoIterator<Item = (K, V)>,
20114 K: std::convert::Into<std::string::String>,
20115 V: std::convert::Into<std::string::String>,
20116 {
20117 self.0.request.args = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20118 self
20119 }
20120 }
20121
20122 #[doc(hidden)]
20123 impl crate::RequestBuilder for RunTask {
20124 fn request_options(&mut self) -> &mut crate::RequestOptions {
20125 &mut self.0.options
20126 }
20127 }
20128
20129 #[derive(Clone, Debug)]
20146 pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
20147
20148 impl GetJob {
20149 pub(crate) fn new(
20150 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20151 ) -> Self {
20152 Self(RequestBuilder::new(stub))
20153 }
20154
20155 pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
20157 self.0.request = v.into();
20158 self
20159 }
20160
20161 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20163 self.0.options = v.into();
20164 self
20165 }
20166
20167 pub async fn send(self) -> Result<crate::model::Job> {
20169 (*self.0.stub)
20170 .get_job(self.0.request, self.0.options)
20171 .await
20172 .map(crate::Response::into_body)
20173 }
20174
20175 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20179 self.0.request.name = v.into();
20180 self
20181 }
20182 }
20183
20184 #[doc(hidden)]
20185 impl crate::RequestBuilder for GetJob {
20186 fn request_options(&mut self) -> &mut crate::RequestOptions {
20187 &mut self.0.options
20188 }
20189 }
20190
20191 #[derive(Clone, Debug)]
20208 pub struct CancelJob(RequestBuilder<crate::model::CancelJobRequest>);
20209
20210 impl CancelJob {
20211 pub(crate) fn new(
20212 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20213 ) -> Self {
20214 Self(RequestBuilder::new(stub))
20215 }
20216
20217 pub fn with_request<V: Into<crate::model::CancelJobRequest>>(mut self, v: V) -> Self {
20219 self.0.request = v.into();
20220 self
20221 }
20222
20223 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20225 self.0.options = v.into();
20226 self
20227 }
20228
20229 pub async fn send(self) -> Result<()> {
20231 (*self.0.stub)
20232 .cancel_job(self.0.request, self.0.options)
20233 .await
20234 .map(crate::Response::into_body)
20235 }
20236
20237 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20241 self.0.request.name = v.into();
20242 self
20243 }
20244 }
20245
20246 #[doc(hidden)]
20247 impl crate::RequestBuilder for CancelJob {
20248 fn request_options(&mut self) -> &mut crate::RequestOptions {
20249 &mut self.0.options
20250 }
20251 }
20252
20253 #[derive(Clone, Debug)]
20274 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20275
20276 impl ListLocations {
20277 pub(crate) fn new(
20278 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20279 ) -> Self {
20280 Self(RequestBuilder::new(stub))
20281 }
20282
20283 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
20285 mut self,
20286 v: V,
20287 ) -> Self {
20288 self.0.request = v.into();
20289 self
20290 }
20291
20292 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20294 self.0.options = v.into();
20295 self
20296 }
20297
20298 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
20300 (*self.0.stub)
20301 .list_locations(self.0.request, self.0.options)
20302 .await
20303 .map(crate::Response::into_body)
20304 }
20305
20306 pub fn by_page(
20308 self,
20309 ) -> impl google_cloud_gax::paginator::Paginator<
20310 google_cloud_location::model::ListLocationsResponse,
20311 crate::Error,
20312 > {
20313 use std::clone::Clone;
20314 let token = self.0.request.page_token.clone();
20315 let execute = move |token: String| {
20316 let mut builder = self.clone();
20317 builder.0.request = builder.0.request.set_page_token(token);
20318 builder.send()
20319 };
20320 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20321 }
20322
20323 pub fn by_item(
20325 self,
20326 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20327 google_cloud_location::model::ListLocationsResponse,
20328 crate::Error,
20329 > {
20330 use google_cloud_gax::paginator::Paginator;
20331 self.by_page().items()
20332 }
20333
20334 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20336 self.0.request.name = v.into();
20337 self
20338 }
20339
20340 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20342 self.0.request.filter = v.into();
20343 self
20344 }
20345
20346 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20348 self.0.request.page_size = v.into();
20349 self
20350 }
20351
20352 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20354 self.0.request.page_token = v.into();
20355 self
20356 }
20357 }
20358
20359 #[doc(hidden)]
20360 impl crate::RequestBuilder for ListLocations {
20361 fn request_options(&mut self) -> &mut crate::RequestOptions {
20362 &mut self.0.options
20363 }
20364 }
20365
20366 #[derive(Clone, Debug)]
20383 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
20384
20385 impl GetLocation {
20386 pub(crate) fn new(
20387 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20388 ) -> Self {
20389 Self(RequestBuilder::new(stub))
20390 }
20391
20392 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
20394 mut self,
20395 v: V,
20396 ) -> Self {
20397 self.0.request = v.into();
20398 self
20399 }
20400
20401 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20403 self.0.options = v.into();
20404 self
20405 }
20406
20407 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
20409 (*self.0.stub)
20410 .get_location(self.0.request, self.0.options)
20411 .await
20412 .map(crate::Response::into_body)
20413 }
20414
20415 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20417 self.0.request.name = v.into();
20418 self
20419 }
20420 }
20421
20422 #[doc(hidden)]
20423 impl crate::RequestBuilder for GetLocation {
20424 fn request_options(&mut self) -> &mut crate::RequestOptions {
20425 &mut self.0.options
20426 }
20427 }
20428
20429 #[derive(Clone, Debug)]
20446 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
20447
20448 impl SetIamPolicy {
20449 pub(crate) fn new(
20450 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20451 ) -> Self {
20452 Self(RequestBuilder::new(stub))
20453 }
20454
20455 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
20457 mut self,
20458 v: V,
20459 ) -> Self {
20460 self.0.request = v.into();
20461 self
20462 }
20463
20464 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20466 self.0.options = v.into();
20467 self
20468 }
20469
20470 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
20472 (*self.0.stub)
20473 .set_iam_policy(self.0.request, self.0.options)
20474 .await
20475 .map(crate::Response::into_body)
20476 }
20477
20478 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20482 self.0.request.resource = v.into();
20483 self
20484 }
20485
20486 pub fn set_policy<T>(mut self, v: T) -> Self
20490 where
20491 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
20492 {
20493 self.0.request.policy = std::option::Option::Some(v.into());
20494 self
20495 }
20496
20497 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
20501 where
20502 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
20503 {
20504 self.0.request.policy = v.map(|x| x.into());
20505 self
20506 }
20507
20508 pub fn set_update_mask<T>(mut self, v: T) -> Self
20510 where
20511 T: std::convert::Into<wkt::FieldMask>,
20512 {
20513 self.0.request.update_mask = std::option::Option::Some(v.into());
20514 self
20515 }
20516
20517 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20519 where
20520 T: std::convert::Into<wkt::FieldMask>,
20521 {
20522 self.0.request.update_mask = v.map(|x| x.into());
20523 self
20524 }
20525 }
20526
20527 #[doc(hidden)]
20528 impl crate::RequestBuilder for SetIamPolicy {
20529 fn request_options(&mut self) -> &mut crate::RequestOptions {
20530 &mut self.0.options
20531 }
20532 }
20533
20534 #[derive(Clone, Debug)]
20551 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
20552
20553 impl GetIamPolicy {
20554 pub(crate) fn new(
20555 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20556 ) -> Self {
20557 Self(RequestBuilder::new(stub))
20558 }
20559
20560 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
20562 mut self,
20563 v: V,
20564 ) -> Self {
20565 self.0.request = v.into();
20566 self
20567 }
20568
20569 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20571 self.0.options = v.into();
20572 self
20573 }
20574
20575 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
20577 (*self.0.stub)
20578 .get_iam_policy(self.0.request, self.0.options)
20579 .await
20580 .map(crate::Response::into_body)
20581 }
20582
20583 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20587 self.0.request.resource = v.into();
20588 self
20589 }
20590
20591 pub fn set_options<T>(mut self, v: T) -> Self
20593 where
20594 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
20595 {
20596 self.0.request.options = std::option::Option::Some(v.into());
20597 self
20598 }
20599
20600 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
20602 where
20603 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
20604 {
20605 self.0.request.options = v.map(|x| x.into());
20606 self
20607 }
20608 }
20609
20610 #[doc(hidden)]
20611 impl crate::RequestBuilder for GetIamPolicy {
20612 fn request_options(&mut self) -> &mut crate::RequestOptions {
20613 &mut self.0.options
20614 }
20615 }
20616
20617 #[derive(Clone, Debug)]
20634 pub struct TestIamPermissions(
20635 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
20636 );
20637
20638 impl TestIamPermissions {
20639 pub(crate) fn new(
20640 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20641 ) -> Self {
20642 Self(RequestBuilder::new(stub))
20643 }
20644
20645 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
20647 mut self,
20648 v: V,
20649 ) -> Self {
20650 self.0.request = v.into();
20651 self
20652 }
20653
20654 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20656 self.0.options = v.into();
20657 self
20658 }
20659
20660 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
20662 (*self.0.stub)
20663 .test_iam_permissions(self.0.request, self.0.options)
20664 .await
20665 .map(crate::Response::into_body)
20666 }
20667
20668 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20672 self.0.request.resource = v.into();
20673 self
20674 }
20675
20676 pub fn set_permissions<T, V>(mut self, v: T) -> Self
20680 where
20681 T: std::iter::IntoIterator<Item = V>,
20682 V: std::convert::Into<std::string::String>,
20683 {
20684 use std::iter::Iterator;
20685 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
20686 self
20687 }
20688 }
20689
20690 #[doc(hidden)]
20691 impl crate::RequestBuilder for TestIamPermissions {
20692 fn request_options(&mut self) -> &mut crate::RequestOptions {
20693 &mut self.0.options
20694 }
20695 }
20696
20697 #[derive(Clone, Debug)]
20718 pub struct ListOperations(
20719 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
20720 );
20721
20722 impl ListOperations {
20723 pub(crate) fn new(
20724 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20725 ) -> Self {
20726 Self(RequestBuilder::new(stub))
20727 }
20728
20729 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
20731 mut self,
20732 v: V,
20733 ) -> Self {
20734 self.0.request = v.into();
20735 self
20736 }
20737
20738 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20740 self.0.options = v.into();
20741 self
20742 }
20743
20744 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
20746 (*self.0.stub)
20747 .list_operations(self.0.request, self.0.options)
20748 .await
20749 .map(crate::Response::into_body)
20750 }
20751
20752 pub fn by_page(
20754 self,
20755 ) -> impl google_cloud_gax::paginator::Paginator<
20756 google_cloud_longrunning::model::ListOperationsResponse,
20757 crate::Error,
20758 > {
20759 use std::clone::Clone;
20760 let token = self.0.request.page_token.clone();
20761 let execute = move |token: String| {
20762 let mut builder = self.clone();
20763 builder.0.request = builder.0.request.set_page_token(token);
20764 builder.send()
20765 };
20766 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20767 }
20768
20769 pub fn by_item(
20771 self,
20772 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20773 google_cloud_longrunning::model::ListOperationsResponse,
20774 crate::Error,
20775 > {
20776 use google_cloud_gax::paginator::Paginator;
20777 self.by_page().items()
20778 }
20779
20780 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20782 self.0.request.name = v.into();
20783 self
20784 }
20785
20786 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20788 self.0.request.filter = v.into();
20789 self
20790 }
20791
20792 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20794 self.0.request.page_size = v.into();
20795 self
20796 }
20797
20798 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20800 self.0.request.page_token = v.into();
20801 self
20802 }
20803
20804 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20806 self.0.request.return_partial_success = v.into();
20807 self
20808 }
20809 }
20810
20811 #[doc(hidden)]
20812 impl crate::RequestBuilder for ListOperations {
20813 fn request_options(&mut self) -> &mut crate::RequestOptions {
20814 &mut self.0.options
20815 }
20816 }
20817
20818 #[derive(Clone, Debug)]
20835 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20836
20837 impl GetOperation {
20838 pub(crate) fn new(
20839 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20840 ) -> Self {
20841 Self(RequestBuilder::new(stub))
20842 }
20843
20844 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20846 mut self,
20847 v: V,
20848 ) -> Self {
20849 self.0.request = v.into();
20850 self
20851 }
20852
20853 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20855 self.0.options = v.into();
20856 self
20857 }
20858
20859 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20861 (*self.0.stub)
20862 .get_operation(self.0.request, self.0.options)
20863 .await
20864 .map(crate::Response::into_body)
20865 }
20866
20867 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20869 self.0.request.name = v.into();
20870 self
20871 }
20872 }
20873
20874 #[doc(hidden)]
20875 impl crate::RequestBuilder for GetOperation {
20876 fn request_options(&mut self) -> &mut crate::RequestOptions {
20877 &mut self.0.options
20878 }
20879 }
20880
20881 #[derive(Clone, Debug)]
20898 pub struct DeleteOperation(
20899 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
20900 );
20901
20902 impl DeleteOperation {
20903 pub(crate) fn new(
20904 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20905 ) -> Self {
20906 Self(RequestBuilder::new(stub))
20907 }
20908
20909 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
20911 mut self,
20912 v: V,
20913 ) -> Self {
20914 self.0.request = v.into();
20915 self
20916 }
20917
20918 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20920 self.0.options = v.into();
20921 self
20922 }
20923
20924 pub async fn send(self) -> Result<()> {
20926 (*self.0.stub)
20927 .delete_operation(self.0.request, self.0.options)
20928 .await
20929 .map(crate::Response::into_body)
20930 }
20931
20932 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20934 self.0.request.name = v.into();
20935 self
20936 }
20937 }
20938
20939 #[doc(hidden)]
20940 impl crate::RequestBuilder for DeleteOperation {
20941 fn request_options(&mut self) -> &mut crate::RequestOptions {
20942 &mut self.0.options
20943 }
20944 }
20945
20946 #[derive(Clone, Debug)]
20963 pub struct CancelOperation(
20964 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20965 );
20966
20967 impl CancelOperation {
20968 pub(crate) fn new(
20969 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20970 ) -> Self {
20971 Self(RequestBuilder::new(stub))
20972 }
20973
20974 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20976 mut self,
20977 v: V,
20978 ) -> Self {
20979 self.0.request = v.into();
20980 self
20981 }
20982
20983 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20985 self.0.options = v.into();
20986 self
20987 }
20988
20989 pub async fn send(self) -> Result<()> {
20991 (*self.0.stub)
20992 .cancel_operation(self.0.request, self.0.options)
20993 .await
20994 .map(crate::Response::into_body)
20995 }
20996
20997 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20999 self.0.request.name = v.into();
21000 self
21001 }
21002 }
21003
21004 #[doc(hidden)]
21005 impl crate::RequestBuilder for CancelOperation {
21006 fn request_options(&mut self) -> &mut crate::RequestOptions {
21007 &mut self.0.options
21008 }
21009 }
21010}