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)]
4729 pub struct ModifyEntry(RequestBuilder<crate::model::ModifyEntryRequest>);
4730
4731 impl ModifyEntry {
4732 pub(crate) fn new(
4733 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4734 ) -> Self {
4735 Self(RequestBuilder::new(stub))
4736 }
4737
4738 pub fn with_request<V: Into<crate::model::ModifyEntryRequest>>(mut self, v: V) -> Self {
4740 self.0.request = v.into();
4741 self
4742 }
4743
4744 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4746 self.0.options = v.into();
4747 self
4748 }
4749
4750 pub async fn send(self) -> Result<crate::model::Entry> {
4752 (*self.0.stub)
4753 .modify_entry(self.0.request, self.0.options)
4754 .await
4755 .map(crate::Response::into_body)
4756 }
4757
4758 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4762 self.0.request.name = v.into();
4763 self
4764 }
4765
4766 pub fn set_entry<T>(mut self, v: T) -> Self
4770 where
4771 T: std::convert::Into<crate::model::Entry>,
4772 {
4773 self.0.request.entry = std::option::Option::Some(v.into());
4774 self
4775 }
4776
4777 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
4781 where
4782 T: std::convert::Into<crate::model::Entry>,
4783 {
4784 self.0.request.entry = v.map(|x| x.into());
4785 self
4786 }
4787
4788 pub fn set_update_mask<T>(mut self, v: T) -> Self
4790 where
4791 T: std::convert::Into<wkt::FieldMask>,
4792 {
4793 self.0.request.update_mask = std::option::Option::Some(v.into());
4794 self
4795 }
4796
4797 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4799 where
4800 T: std::convert::Into<wkt::FieldMask>,
4801 {
4802 self.0.request.update_mask = v.map(|x| x.into());
4803 self
4804 }
4805
4806 pub fn set_delete_missing_aspects<T: Into<bool>>(mut self, v: T) -> Self {
4808 self.0.request.delete_missing_aspects = v.into();
4809 self
4810 }
4811
4812 pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
4814 where
4815 T: std::iter::IntoIterator<Item = V>,
4816 V: std::convert::Into<std::string::String>,
4817 {
4818 use std::iter::Iterator;
4819 self.0.request.aspect_keys = v.into_iter().map(|i| i.into()).collect();
4820 self
4821 }
4822 }
4823
4824 #[doc(hidden)]
4825 impl crate::RequestBuilder for ModifyEntry {
4826 fn request_options(&mut self) -> &mut crate::RequestOptions {
4827 &mut self.0.options
4828 }
4829 }
4830
4831 #[derive(Clone, Debug)]
4852 pub struct SearchEntries(RequestBuilder<crate::model::SearchEntriesRequest>);
4853
4854 impl SearchEntries {
4855 pub(crate) fn new(
4856 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4857 ) -> Self {
4858 Self(RequestBuilder::new(stub))
4859 }
4860
4861 pub fn with_request<V: Into<crate::model::SearchEntriesRequest>>(mut self, v: V) -> Self {
4863 self.0.request = v.into();
4864 self
4865 }
4866
4867 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4869 self.0.options = v.into();
4870 self
4871 }
4872
4873 pub async fn send(self) -> Result<crate::model::SearchEntriesResponse> {
4875 (*self.0.stub)
4876 .search_entries(self.0.request, self.0.options)
4877 .await
4878 .map(crate::Response::into_body)
4879 }
4880
4881 pub fn by_page(
4883 self,
4884 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchEntriesResponse, crate::Error>
4885 {
4886 use std::clone::Clone;
4887 let token = self.0.request.page_token.clone();
4888 let execute = move |token: String| {
4889 let mut builder = self.clone();
4890 builder.0.request = builder.0.request.set_page_token(token);
4891 builder.send()
4892 };
4893 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4894 }
4895
4896 pub fn by_item(
4898 self,
4899 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4900 crate::model::SearchEntriesResponse,
4901 crate::Error,
4902 > {
4903 use google_cloud_gax::paginator::Paginator;
4904 self.by_page().items()
4905 }
4906
4907 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4911 self.0.request.name = v.into();
4912 self
4913 }
4914
4915 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
4919 self.0.request.query = v.into();
4920 self
4921 }
4922
4923 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4925 self.0.request.page_size = v.into();
4926 self
4927 }
4928
4929 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4931 self.0.request.page_token = v.into();
4932 self
4933 }
4934
4935 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4937 self.0.request.order_by = v.into();
4938 self
4939 }
4940
4941 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
4943 self.0.request.scope = v.into();
4944 self
4945 }
4946
4947 pub fn set_semantic_search<T: Into<bool>>(mut self, v: T) -> Self {
4949 self.0.request.semantic_search = v.into();
4950 self
4951 }
4952 }
4953
4954 #[doc(hidden)]
4955 impl crate::RequestBuilder for SearchEntries {
4956 fn request_options(&mut self) -> &mut crate::RequestOptions {
4957 &mut self.0.options
4958 }
4959 }
4960
4961 #[derive(Clone, Debug)]
4979 pub struct CreateMetadataJob(RequestBuilder<crate::model::CreateMetadataJobRequest>);
4980
4981 impl CreateMetadataJob {
4982 pub(crate) fn new(
4983 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4984 ) -> Self {
4985 Self(RequestBuilder::new(stub))
4986 }
4987
4988 pub fn with_request<V: Into<crate::model::CreateMetadataJobRequest>>(
4990 mut self,
4991 v: V,
4992 ) -> Self {
4993 self.0.request = v.into();
4994 self
4995 }
4996
4997 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4999 self.0.options = v.into();
5000 self
5001 }
5002
5003 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5010 (*self.0.stub)
5011 .create_metadata_job(self.0.request, self.0.options)
5012 .await
5013 .map(crate::Response::into_body)
5014 }
5015
5016 pub fn poller(
5018 self,
5019 ) -> impl google_cloud_lro::Poller<crate::model::MetadataJob, crate::model::OperationMetadata>
5020 {
5021 type Operation = google_cloud_lro::internal::Operation<
5022 crate::model::MetadataJob,
5023 crate::model::OperationMetadata,
5024 >;
5025 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5026 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5027
5028 let stub = self.0.stub.clone();
5029 let mut options = self.0.options.clone();
5030 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5031 let query = move |name| {
5032 let stub = stub.clone();
5033 let options = options.clone();
5034 async {
5035 let op = GetOperation::new(stub)
5036 .set_name(name)
5037 .with_options(options)
5038 .send()
5039 .await?;
5040 Ok(Operation::new(op))
5041 }
5042 };
5043
5044 let start = move || async {
5045 let op = self.send().await?;
5046 Ok(Operation::new(op))
5047 };
5048
5049 google_cloud_lro::internal::new_poller(
5050 polling_error_policy,
5051 polling_backoff_policy,
5052 start,
5053 query,
5054 )
5055 }
5056
5057 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5061 self.0.request.parent = v.into();
5062 self
5063 }
5064
5065 pub fn set_metadata_job<T>(mut self, v: T) -> Self
5069 where
5070 T: std::convert::Into<crate::model::MetadataJob>,
5071 {
5072 self.0.request.metadata_job = std::option::Option::Some(v.into());
5073 self
5074 }
5075
5076 pub fn set_or_clear_metadata_job<T>(mut self, v: std::option::Option<T>) -> Self
5080 where
5081 T: std::convert::Into<crate::model::MetadataJob>,
5082 {
5083 self.0.request.metadata_job = v.map(|x| x.into());
5084 self
5085 }
5086
5087 pub fn set_metadata_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5089 self.0.request.metadata_job_id = v.into();
5090 self
5091 }
5092
5093 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5095 self.0.request.validate_only = v.into();
5096 self
5097 }
5098 }
5099
5100 #[doc(hidden)]
5101 impl crate::RequestBuilder for CreateMetadataJob {
5102 fn request_options(&mut self) -> &mut crate::RequestOptions {
5103 &mut self.0.options
5104 }
5105 }
5106
5107 #[derive(Clone, Debug)]
5124 pub struct GetMetadataJob(RequestBuilder<crate::model::GetMetadataJobRequest>);
5125
5126 impl GetMetadataJob {
5127 pub(crate) fn new(
5128 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5129 ) -> Self {
5130 Self(RequestBuilder::new(stub))
5131 }
5132
5133 pub fn with_request<V: Into<crate::model::GetMetadataJobRequest>>(mut self, v: V) -> Self {
5135 self.0.request = v.into();
5136 self
5137 }
5138
5139 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5141 self.0.options = v.into();
5142 self
5143 }
5144
5145 pub async fn send(self) -> Result<crate::model::MetadataJob> {
5147 (*self.0.stub)
5148 .get_metadata_job(self.0.request, self.0.options)
5149 .await
5150 .map(crate::Response::into_body)
5151 }
5152
5153 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5157 self.0.request.name = v.into();
5158 self
5159 }
5160 }
5161
5162 #[doc(hidden)]
5163 impl crate::RequestBuilder for GetMetadataJob {
5164 fn request_options(&mut self) -> &mut crate::RequestOptions {
5165 &mut self.0.options
5166 }
5167 }
5168
5169 #[derive(Clone, Debug)]
5190 pub struct ListMetadataJobs(RequestBuilder<crate::model::ListMetadataJobsRequest>);
5191
5192 impl ListMetadataJobs {
5193 pub(crate) fn new(
5194 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5195 ) -> Self {
5196 Self(RequestBuilder::new(stub))
5197 }
5198
5199 pub fn with_request<V: Into<crate::model::ListMetadataJobsRequest>>(
5201 mut self,
5202 v: V,
5203 ) -> Self {
5204 self.0.request = v.into();
5205 self
5206 }
5207
5208 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5210 self.0.options = v.into();
5211 self
5212 }
5213
5214 pub async fn send(self) -> Result<crate::model::ListMetadataJobsResponse> {
5216 (*self.0.stub)
5217 .list_metadata_jobs(self.0.request, self.0.options)
5218 .await
5219 .map(crate::Response::into_body)
5220 }
5221
5222 pub fn by_page(
5224 self,
5225 ) -> impl google_cloud_gax::paginator::Paginator<
5226 crate::model::ListMetadataJobsResponse,
5227 crate::Error,
5228 > {
5229 use std::clone::Clone;
5230 let token = self.0.request.page_token.clone();
5231 let execute = move |token: String| {
5232 let mut builder = self.clone();
5233 builder.0.request = builder.0.request.set_page_token(token);
5234 builder.send()
5235 };
5236 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5237 }
5238
5239 pub fn by_item(
5241 self,
5242 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5243 crate::model::ListMetadataJobsResponse,
5244 crate::Error,
5245 > {
5246 use google_cloud_gax::paginator::Paginator;
5247 self.by_page().items()
5248 }
5249
5250 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5254 self.0.request.parent = v.into();
5255 self
5256 }
5257
5258 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5260 self.0.request.page_size = v.into();
5261 self
5262 }
5263
5264 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5266 self.0.request.page_token = v.into();
5267 self
5268 }
5269
5270 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5272 self.0.request.filter = v.into();
5273 self
5274 }
5275
5276 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5278 self.0.request.order_by = v.into();
5279 self
5280 }
5281 }
5282
5283 #[doc(hidden)]
5284 impl crate::RequestBuilder for ListMetadataJobs {
5285 fn request_options(&mut self) -> &mut crate::RequestOptions {
5286 &mut self.0.options
5287 }
5288 }
5289
5290 #[derive(Clone, Debug)]
5307 pub struct CancelMetadataJob(RequestBuilder<crate::model::CancelMetadataJobRequest>);
5308
5309 impl CancelMetadataJob {
5310 pub(crate) fn new(
5311 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5312 ) -> Self {
5313 Self(RequestBuilder::new(stub))
5314 }
5315
5316 pub fn with_request<V: Into<crate::model::CancelMetadataJobRequest>>(
5318 mut self,
5319 v: V,
5320 ) -> Self {
5321 self.0.request = v.into();
5322 self
5323 }
5324
5325 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5327 self.0.options = v.into();
5328 self
5329 }
5330
5331 pub async fn send(self) -> Result<()> {
5333 (*self.0.stub)
5334 .cancel_metadata_job(self.0.request, self.0.options)
5335 .await
5336 .map(crate::Response::into_body)
5337 }
5338
5339 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5343 self.0.request.name = v.into();
5344 self
5345 }
5346 }
5347
5348 #[doc(hidden)]
5349 impl crate::RequestBuilder for CancelMetadataJob {
5350 fn request_options(&mut self) -> &mut crate::RequestOptions {
5351 &mut self.0.options
5352 }
5353 }
5354
5355 #[derive(Clone, Debug)]
5372 pub struct CreateEntryLink(RequestBuilder<crate::model::CreateEntryLinkRequest>);
5373
5374 impl CreateEntryLink {
5375 pub(crate) fn new(
5376 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5377 ) -> Self {
5378 Self(RequestBuilder::new(stub))
5379 }
5380
5381 pub fn with_request<V: Into<crate::model::CreateEntryLinkRequest>>(mut self, v: V) -> Self {
5383 self.0.request = v.into();
5384 self
5385 }
5386
5387 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5389 self.0.options = v.into();
5390 self
5391 }
5392
5393 pub async fn send(self) -> Result<crate::model::EntryLink> {
5395 (*self.0.stub)
5396 .create_entry_link(self.0.request, self.0.options)
5397 .await
5398 .map(crate::Response::into_body)
5399 }
5400
5401 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5405 self.0.request.parent = v.into();
5406 self
5407 }
5408
5409 pub fn set_entry_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5413 self.0.request.entry_link_id = v.into();
5414 self
5415 }
5416
5417 pub fn set_entry_link<T>(mut self, v: T) -> Self
5421 where
5422 T: std::convert::Into<crate::model::EntryLink>,
5423 {
5424 self.0.request.entry_link = std::option::Option::Some(v.into());
5425 self
5426 }
5427
5428 pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
5432 where
5433 T: std::convert::Into<crate::model::EntryLink>,
5434 {
5435 self.0.request.entry_link = v.map(|x| x.into());
5436 self
5437 }
5438 }
5439
5440 #[doc(hidden)]
5441 impl crate::RequestBuilder for CreateEntryLink {
5442 fn request_options(&mut self) -> &mut crate::RequestOptions {
5443 &mut self.0.options
5444 }
5445 }
5446
5447 #[derive(Clone, Debug)]
5464 pub struct UpdateEntryLink(RequestBuilder<crate::model::UpdateEntryLinkRequest>);
5465
5466 impl UpdateEntryLink {
5467 pub(crate) fn new(
5468 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5469 ) -> Self {
5470 Self(RequestBuilder::new(stub))
5471 }
5472
5473 pub fn with_request<V: Into<crate::model::UpdateEntryLinkRequest>>(mut self, v: V) -> Self {
5475 self.0.request = v.into();
5476 self
5477 }
5478
5479 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5481 self.0.options = v.into();
5482 self
5483 }
5484
5485 pub async fn send(self) -> Result<crate::model::EntryLink> {
5487 (*self.0.stub)
5488 .update_entry_link(self.0.request, self.0.options)
5489 .await
5490 .map(crate::Response::into_body)
5491 }
5492
5493 pub fn set_entry_link<T>(mut self, v: T) -> Self
5497 where
5498 T: std::convert::Into<crate::model::EntryLink>,
5499 {
5500 self.0.request.entry_link = std::option::Option::Some(v.into());
5501 self
5502 }
5503
5504 pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
5508 where
5509 T: std::convert::Into<crate::model::EntryLink>,
5510 {
5511 self.0.request.entry_link = v.map(|x| x.into());
5512 self
5513 }
5514
5515 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
5517 self.0.request.allow_missing = v.into();
5518 self
5519 }
5520
5521 pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
5523 where
5524 T: std::iter::IntoIterator<Item = V>,
5525 V: std::convert::Into<std::string::String>,
5526 {
5527 use std::iter::Iterator;
5528 self.0.request.aspect_keys = v.into_iter().map(|i| i.into()).collect();
5529 self
5530 }
5531 }
5532
5533 #[doc(hidden)]
5534 impl crate::RequestBuilder for UpdateEntryLink {
5535 fn request_options(&mut self) -> &mut crate::RequestOptions {
5536 &mut self.0.options
5537 }
5538 }
5539
5540 #[derive(Clone, Debug)]
5557 pub struct DeleteEntryLink(RequestBuilder<crate::model::DeleteEntryLinkRequest>);
5558
5559 impl DeleteEntryLink {
5560 pub(crate) fn new(
5561 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5562 ) -> Self {
5563 Self(RequestBuilder::new(stub))
5564 }
5565
5566 pub fn with_request<V: Into<crate::model::DeleteEntryLinkRequest>>(mut self, v: V) -> Self {
5568 self.0.request = v.into();
5569 self
5570 }
5571
5572 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5574 self.0.options = v.into();
5575 self
5576 }
5577
5578 pub async fn send(self) -> Result<crate::model::EntryLink> {
5580 (*self.0.stub)
5581 .delete_entry_link(self.0.request, self.0.options)
5582 .await
5583 .map(crate::Response::into_body)
5584 }
5585
5586 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5590 self.0.request.name = v.into();
5591 self
5592 }
5593 }
5594
5595 #[doc(hidden)]
5596 impl crate::RequestBuilder for DeleteEntryLink {
5597 fn request_options(&mut self) -> &mut crate::RequestOptions {
5598 &mut self.0.options
5599 }
5600 }
5601
5602 #[derive(Clone, Debug)]
5623 pub struct LookupEntryLinks(RequestBuilder<crate::model::LookupEntryLinksRequest>);
5624
5625 impl LookupEntryLinks {
5626 pub(crate) fn new(
5627 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5628 ) -> Self {
5629 Self(RequestBuilder::new(stub))
5630 }
5631
5632 pub fn with_request<V: Into<crate::model::LookupEntryLinksRequest>>(
5634 mut self,
5635 v: V,
5636 ) -> Self {
5637 self.0.request = v.into();
5638 self
5639 }
5640
5641 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5643 self.0.options = v.into();
5644 self
5645 }
5646
5647 pub async fn send(self) -> Result<crate::model::LookupEntryLinksResponse> {
5649 (*self.0.stub)
5650 .lookup_entry_links(self.0.request, self.0.options)
5651 .await
5652 .map(crate::Response::into_body)
5653 }
5654
5655 pub fn by_page(
5657 self,
5658 ) -> impl google_cloud_gax::paginator::Paginator<
5659 crate::model::LookupEntryLinksResponse,
5660 crate::Error,
5661 > {
5662 use std::clone::Clone;
5663 let token = self.0.request.page_token.clone();
5664 let execute = move |token: String| {
5665 let mut builder = self.clone();
5666 builder.0.request = builder.0.request.set_page_token(token);
5667 builder.send()
5668 };
5669 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5670 }
5671
5672 pub fn by_item(
5674 self,
5675 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5676 crate::model::LookupEntryLinksResponse,
5677 crate::Error,
5678 > {
5679 use google_cloud_gax::paginator::Paginator;
5680 self.by_page().items()
5681 }
5682
5683 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5687 self.0.request.name = v.into();
5688 self
5689 }
5690
5691 pub fn set_entry<T: Into<std::string::String>>(mut self, v: T) -> Self {
5695 self.0.request.entry = v.into();
5696 self
5697 }
5698
5699 pub fn set_entry_mode<T: Into<crate::model::lookup_entry_links_request::EntryMode>>(
5701 mut self,
5702 v: T,
5703 ) -> Self {
5704 self.0.request.entry_mode = v.into();
5705 self
5706 }
5707
5708 pub fn set_entry_link_types<T, V>(mut self, v: T) -> Self
5710 where
5711 T: std::iter::IntoIterator<Item = V>,
5712 V: std::convert::Into<std::string::String>,
5713 {
5714 use std::iter::Iterator;
5715 self.0.request.entry_link_types = v.into_iter().map(|i| i.into()).collect();
5716 self
5717 }
5718
5719 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5721 self.0.request.page_size = v.into();
5722 self
5723 }
5724
5725 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5727 self.0.request.page_token = v.into();
5728 self
5729 }
5730 }
5731
5732 #[doc(hidden)]
5733 impl crate::RequestBuilder for LookupEntryLinks {
5734 fn request_options(&mut self) -> &mut crate::RequestOptions {
5735 &mut self.0.options
5736 }
5737 }
5738
5739 #[derive(Clone, Debug)]
5756 pub struct LookupContext(RequestBuilder<crate::model::LookupContextRequest>);
5757
5758 impl LookupContext {
5759 pub(crate) fn new(
5760 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5761 ) -> Self {
5762 Self(RequestBuilder::new(stub))
5763 }
5764
5765 pub fn with_request<V: Into<crate::model::LookupContextRequest>>(mut self, v: V) -> Self {
5767 self.0.request = v.into();
5768 self
5769 }
5770
5771 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5773 self.0.options = v.into();
5774 self
5775 }
5776
5777 pub async fn send(self) -> Result<crate::model::LookupContextResponse> {
5779 (*self.0.stub)
5780 .lookup_context(self.0.request, self.0.options)
5781 .await
5782 .map(crate::Response::into_body)
5783 }
5784
5785 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5789 self.0.request.name = v.into();
5790 self
5791 }
5792
5793 pub fn set_resources<T, V>(mut self, v: T) -> Self
5797 where
5798 T: std::iter::IntoIterator<Item = V>,
5799 V: std::convert::Into<std::string::String>,
5800 {
5801 use std::iter::Iterator;
5802 self.0.request.resources = v.into_iter().map(|i| i.into()).collect();
5803 self
5804 }
5805
5806 pub fn set_context<T: Into<std::string::String>>(mut self, v: T) -> Self {
5808 self.0.request.context = v.into();
5809 self
5810 }
5811
5812 pub fn set_options<T, K, V>(mut self, v: T) -> Self
5814 where
5815 T: std::iter::IntoIterator<Item = (K, V)>,
5816 K: std::convert::Into<std::string::String>,
5817 V: std::convert::Into<std::string::String>,
5818 {
5819 self.0.request.options = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5820 self
5821 }
5822 }
5823
5824 #[doc(hidden)]
5825 impl crate::RequestBuilder for LookupContext {
5826 fn request_options(&mut self) -> &mut crate::RequestOptions {
5827 &mut self.0.options
5828 }
5829 }
5830
5831 #[derive(Clone, Debug)]
5848 pub struct GetEntryLink(RequestBuilder<crate::model::GetEntryLinkRequest>);
5849
5850 impl GetEntryLink {
5851 pub(crate) fn new(
5852 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5853 ) -> Self {
5854 Self(RequestBuilder::new(stub))
5855 }
5856
5857 pub fn with_request<V: Into<crate::model::GetEntryLinkRequest>>(mut self, v: V) -> Self {
5859 self.0.request = v.into();
5860 self
5861 }
5862
5863 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5865 self.0.options = v.into();
5866 self
5867 }
5868
5869 pub async fn send(self) -> Result<crate::model::EntryLink> {
5871 (*self.0.stub)
5872 .get_entry_link(self.0.request, self.0.options)
5873 .await
5874 .map(crate::Response::into_body)
5875 }
5876
5877 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5881 self.0.request.name = v.into();
5882 self
5883 }
5884 }
5885
5886 #[doc(hidden)]
5887 impl crate::RequestBuilder for GetEntryLink {
5888 fn request_options(&mut self) -> &mut crate::RequestOptions {
5889 &mut self.0.options
5890 }
5891 }
5892
5893 #[derive(Clone, Debug)]
5911 pub struct CreateMetadataFeed(RequestBuilder<crate::model::CreateMetadataFeedRequest>);
5912
5913 impl CreateMetadataFeed {
5914 pub(crate) fn new(
5915 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5916 ) -> Self {
5917 Self(RequestBuilder::new(stub))
5918 }
5919
5920 pub fn with_request<V: Into<crate::model::CreateMetadataFeedRequest>>(
5922 mut self,
5923 v: V,
5924 ) -> Self {
5925 self.0.request = v.into();
5926 self
5927 }
5928
5929 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5931 self.0.options = v.into();
5932 self
5933 }
5934
5935 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5942 (*self.0.stub)
5943 .create_metadata_feed(self.0.request, self.0.options)
5944 .await
5945 .map(crate::Response::into_body)
5946 }
5947
5948 pub fn poller(
5950 self,
5951 ) -> impl google_cloud_lro::Poller<crate::model::MetadataFeed, crate::model::OperationMetadata>
5952 {
5953 type Operation = google_cloud_lro::internal::Operation<
5954 crate::model::MetadataFeed,
5955 crate::model::OperationMetadata,
5956 >;
5957 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5958 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5959
5960 let stub = self.0.stub.clone();
5961 let mut options = self.0.options.clone();
5962 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5963 let query = move |name| {
5964 let stub = stub.clone();
5965 let options = options.clone();
5966 async {
5967 let op = GetOperation::new(stub)
5968 .set_name(name)
5969 .with_options(options)
5970 .send()
5971 .await?;
5972 Ok(Operation::new(op))
5973 }
5974 };
5975
5976 let start = move || async {
5977 let op = self.send().await?;
5978 Ok(Operation::new(op))
5979 };
5980
5981 google_cloud_lro::internal::new_poller(
5982 polling_error_policy,
5983 polling_backoff_policy,
5984 start,
5985 query,
5986 )
5987 }
5988
5989 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5993 self.0.request.parent = v.into();
5994 self
5995 }
5996
5997 pub fn set_metadata_feed<T>(mut self, v: T) -> Self
6001 where
6002 T: std::convert::Into<crate::model::MetadataFeed>,
6003 {
6004 self.0.request.metadata_feed = std::option::Option::Some(v.into());
6005 self
6006 }
6007
6008 pub fn set_or_clear_metadata_feed<T>(mut self, v: std::option::Option<T>) -> Self
6012 where
6013 T: std::convert::Into<crate::model::MetadataFeed>,
6014 {
6015 self.0.request.metadata_feed = v.map(|x| x.into());
6016 self
6017 }
6018
6019 pub fn set_metadata_feed_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6021 self.0.request.metadata_feed_id = v.into();
6022 self
6023 }
6024
6025 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
6027 self.0.request.validate_only = v.into();
6028 self
6029 }
6030 }
6031
6032 #[doc(hidden)]
6033 impl crate::RequestBuilder for CreateMetadataFeed {
6034 fn request_options(&mut self) -> &mut crate::RequestOptions {
6035 &mut self.0.options
6036 }
6037 }
6038
6039 #[derive(Clone, Debug)]
6056 pub struct GetMetadataFeed(RequestBuilder<crate::model::GetMetadataFeedRequest>);
6057
6058 impl GetMetadataFeed {
6059 pub(crate) fn new(
6060 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6061 ) -> Self {
6062 Self(RequestBuilder::new(stub))
6063 }
6064
6065 pub fn with_request<V: Into<crate::model::GetMetadataFeedRequest>>(mut self, v: V) -> Self {
6067 self.0.request = v.into();
6068 self
6069 }
6070
6071 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6073 self.0.options = v.into();
6074 self
6075 }
6076
6077 pub async fn send(self) -> Result<crate::model::MetadataFeed> {
6079 (*self.0.stub)
6080 .get_metadata_feed(self.0.request, self.0.options)
6081 .await
6082 .map(crate::Response::into_body)
6083 }
6084
6085 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6089 self.0.request.name = v.into();
6090 self
6091 }
6092 }
6093
6094 #[doc(hidden)]
6095 impl crate::RequestBuilder for GetMetadataFeed {
6096 fn request_options(&mut self) -> &mut crate::RequestOptions {
6097 &mut self.0.options
6098 }
6099 }
6100
6101 #[derive(Clone, Debug)]
6122 pub struct ListMetadataFeeds(RequestBuilder<crate::model::ListMetadataFeedsRequest>);
6123
6124 impl ListMetadataFeeds {
6125 pub(crate) fn new(
6126 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6127 ) -> Self {
6128 Self(RequestBuilder::new(stub))
6129 }
6130
6131 pub fn with_request<V: Into<crate::model::ListMetadataFeedsRequest>>(
6133 mut self,
6134 v: V,
6135 ) -> Self {
6136 self.0.request = v.into();
6137 self
6138 }
6139
6140 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6142 self.0.options = v.into();
6143 self
6144 }
6145
6146 pub async fn send(self) -> Result<crate::model::ListMetadataFeedsResponse> {
6148 (*self.0.stub)
6149 .list_metadata_feeds(self.0.request, self.0.options)
6150 .await
6151 .map(crate::Response::into_body)
6152 }
6153
6154 pub fn by_page(
6156 self,
6157 ) -> impl google_cloud_gax::paginator::Paginator<
6158 crate::model::ListMetadataFeedsResponse,
6159 crate::Error,
6160 > {
6161 use std::clone::Clone;
6162 let token = self.0.request.page_token.clone();
6163 let execute = move |token: String| {
6164 let mut builder = self.clone();
6165 builder.0.request = builder.0.request.set_page_token(token);
6166 builder.send()
6167 };
6168 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6169 }
6170
6171 pub fn by_item(
6173 self,
6174 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6175 crate::model::ListMetadataFeedsResponse,
6176 crate::Error,
6177 > {
6178 use google_cloud_gax::paginator::Paginator;
6179 self.by_page().items()
6180 }
6181
6182 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6186 self.0.request.parent = v.into();
6187 self
6188 }
6189
6190 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6192 self.0.request.page_size = v.into();
6193 self
6194 }
6195
6196 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6198 self.0.request.page_token = v.into();
6199 self
6200 }
6201
6202 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6204 self.0.request.filter = v.into();
6205 self
6206 }
6207
6208 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6210 self.0.request.order_by = v.into();
6211 self
6212 }
6213 }
6214
6215 #[doc(hidden)]
6216 impl crate::RequestBuilder for ListMetadataFeeds {
6217 fn request_options(&mut self) -> &mut crate::RequestOptions {
6218 &mut self.0.options
6219 }
6220 }
6221
6222 #[derive(Clone, Debug)]
6240 pub struct DeleteMetadataFeed(RequestBuilder<crate::model::DeleteMetadataFeedRequest>);
6241
6242 impl DeleteMetadataFeed {
6243 pub(crate) fn new(
6244 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6245 ) -> Self {
6246 Self(RequestBuilder::new(stub))
6247 }
6248
6249 pub fn with_request<V: Into<crate::model::DeleteMetadataFeedRequest>>(
6251 mut self,
6252 v: V,
6253 ) -> Self {
6254 self.0.request = v.into();
6255 self
6256 }
6257
6258 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6260 self.0.options = v.into();
6261 self
6262 }
6263
6264 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6271 (*self.0.stub)
6272 .delete_metadata_feed(self.0.request, self.0.options)
6273 .await
6274 .map(crate::Response::into_body)
6275 }
6276
6277 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6279 type Operation =
6280 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6281 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6282 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6283
6284 let stub = self.0.stub.clone();
6285 let mut options = self.0.options.clone();
6286 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6287 let query = move |name| {
6288 let stub = stub.clone();
6289 let options = options.clone();
6290 async {
6291 let op = GetOperation::new(stub)
6292 .set_name(name)
6293 .with_options(options)
6294 .send()
6295 .await?;
6296 Ok(Operation::new(op))
6297 }
6298 };
6299
6300 let start = move || async {
6301 let op = self.send().await?;
6302 Ok(Operation::new(op))
6303 };
6304
6305 google_cloud_lro::internal::new_unit_response_poller(
6306 polling_error_policy,
6307 polling_backoff_policy,
6308 start,
6309 query,
6310 )
6311 }
6312
6313 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6317 self.0.request.name = v.into();
6318 self
6319 }
6320 }
6321
6322 #[doc(hidden)]
6323 impl crate::RequestBuilder for DeleteMetadataFeed {
6324 fn request_options(&mut self) -> &mut crate::RequestOptions {
6325 &mut self.0.options
6326 }
6327 }
6328
6329 #[derive(Clone, Debug)]
6347 pub struct UpdateMetadataFeed(RequestBuilder<crate::model::UpdateMetadataFeedRequest>);
6348
6349 impl UpdateMetadataFeed {
6350 pub(crate) fn new(
6351 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6352 ) -> Self {
6353 Self(RequestBuilder::new(stub))
6354 }
6355
6356 pub fn with_request<V: Into<crate::model::UpdateMetadataFeedRequest>>(
6358 mut self,
6359 v: V,
6360 ) -> Self {
6361 self.0.request = v.into();
6362 self
6363 }
6364
6365 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6367 self.0.options = v.into();
6368 self
6369 }
6370
6371 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6378 (*self.0.stub)
6379 .update_metadata_feed(self.0.request, self.0.options)
6380 .await
6381 .map(crate::Response::into_body)
6382 }
6383
6384 pub fn poller(
6386 self,
6387 ) -> impl google_cloud_lro::Poller<crate::model::MetadataFeed, crate::model::OperationMetadata>
6388 {
6389 type Operation = google_cloud_lro::internal::Operation<
6390 crate::model::MetadataFeed,
6391 crate::model::OperationMetadata,
6392 >;
6393 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6394 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6395
6396 let stub = self.0.stub.clone();
6397 let mut options = self.0.options.clone();
6398 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6399 let query = move |name| {
6400 let stub = stub.clone();
6401 let options = options.clone();
6402 async {
6403 let op = GetOperation::new(stub)
6404 .set_name(name)
6405 .with_options(options)
6406 .send()
6407 .await?;
6408 Ok(Operation::new(op))
6409 }
6410 };
6411
6412 let start = move || async {
6413 let op = self.send().await?;
6414 Ok(Operation::new(op))
6415 };
6416
6417 google_cloud_lro::internal::new_poller(
6418 polling_error_policy,
6419 polling_backoff_policy,
6420 start,
6421 query,
6422 )
6423 }
6424
6425 pub fn set_metadata_feed<T>(mut self, v: T) -> Self
6429 where
6430 T: std::convert::Into<crate::model::MetadataFeed>,
6431 {
6432 self.0.request.metadata_feed = std::option::Option::Some(v.into());
6433 self
6434 }
6435
6436 pub fn set_or_clear_metadata_feed<T>(mut self, v: std::option::Option<T>) -> Self
6440 where
6441 T: std::convert::Into<crate::model::MetadataFeed>,
6442 {
6443 self.0.request.metadata_feed = v.map(|x| x.into());
6444 self
6445 }
6446
6447 pub fn set_update_mask<T>(mut self, v: T) -> Self
6449 where
6450 T: std::convert::Into<wkt::FieldMask>,
6451 {
6452 self.0.request.update_mask = std::option::Option::Some(v.into());
6453 self
6454 }
6455
6456 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6458 where
6459 T: std::convert::Into<wkt::FieldMask>,
6460 {
6461 self.0.request.update_mask = v.map(|x| x.into());
6462 self
6463 }
6464
6465 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
6467 self.0.request.validate_only = v.into();
6468 self
6469 }
6470 }
6471
6472 #[doc(hidden)]
6473 impl crate::RequestBuilder for UpdateMetadataFeed {
6474 fn request_options(&mut self) -> &mut crate::RequestOptions {
6475 &mut self.0.options
6476 }
6477 }
6478
6479 #[derive(Clone, Debug)]
6500 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6501
6502 impl ListLocations {
6503 pub(crate) fn new(
6504 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6505 ) -> Self {
6506 Self(RequestBuilder::new(stub))
6507 }
6508
6509 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6511 mut self,
6512 v: V,
6513 ) -> Self {
6514 self.0.request = v.into();
6515 self
6516 }
6517
6518 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6520 self.0.options = v.into();
6521 self
6522 }
6523
6524 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6526 (*self.0.stub)
6527 .list_locations(self.0.request, self.0.options)
6528 .await
6529 .map(crate::Response::into_body)
6530 }
6531
6532 pub fn by_page(
6534 self,
6535 ) -> impl google_cloud_gax::paginator::Paginator<
6536 google_cloud_location::model::ListLocationsResponse,
6537 crate::Error,
6538 > {
6539 use std::clone::Clone;
6540 let token = self.0.request.page_token.clone();
6541 let execute = move |token: String| {
6542 let mut builder = self.clone();
6543 builder.0.request = builder.0.request.set_page_token(token);
6544 builder.send()
6545 };
6546 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6547 }
6548
6549 pub fn by_item(
6551 self,
6552 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6553 google_cloud_location::model::ListLocationsResponse,
6554 crate::Error,
6555 > {
6556 use google_cloud_gax::paginator::Paginator;
6557 self.by_page().items()
6558 }
6559
6560 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6562 self.0.request.name = v.into();
6563 self
6564 }
6565
6566 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6568 self.0.request.filter = v.into();
6569 self
6570 }
6571
6572 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6574 self.0.request.page_size = v.into();
6575 self
6576 }
6577
6578 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6580 self.0.request.page_token = v.into();
6581 self
6582 }
6583 }
6584
6585 #[doc(hidden)]
6586 impl crate::RequestBuilder for ListLocations {
6587 fn request_options(&mut self) -> &mut crate::RequestOptions {
6588 &mut self.0.options
6589 }
6590 }
6591
6592 #[derive(Clone, Debug)]
6609 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6610
6611 impl GetLocation {
6612 pub(crate) fn new(
6613 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6614 ) -> Self {
6615 Self(RequestBuilder::new(stub))
6616 }
6617
6618 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6620 mut self,
6621 v: V,
6622 ) -> Self {
6623 self.0.request = v.into();
6624 self
6625 }
6626
6627 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6629 self.0.options = v.into();
6630 self
6631 }
6632
6633 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6635 (*self.0.stub)
6636 .get_location(self.0.request, self.0.options)
6637 .await
6638 .map(crate::Response::into_body)
6639 }
6640
6641 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6643 self.0.request.name = v.into();
6644 self
6645 }
6646 }
6647
6648 #[doc(hidden)]
6649 impl crate::RequestBuilder for GetLocation {
6650 fn request_options(&mut self) -> &mut crate::RequestOptions {
6651 &mut self.0.options
6652 }
6653 }
6654
6655 #[derive(Clone, Debug)]
6672 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6673
6674 impl SetIamPolicy {
6675 pub(crate) fn new(
6676 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6677 ) -> Self {
6678 Self(RequestBuilder::new(stub))
6679 }
6680
6681 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6683 mut self,
6684 v: V,
6685 ) -> Self {
6686 self.0.request = v.into();
6687 self
6688 }
6689
6690 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6692 self.0.options = v.into();
6693 self
6694 }
6695
6696 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6698 (*self.0.stub)
6699 .set_iam_policy(self.0.request, self.0.options)
6700 .await
6701 .map(crate::Response::into_body)
6702 }
6703
6704 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6708 self.0.request.resource = v.into();
6709 self
6710 }
6711
6712 pub fn set_policy<T>(mut self, v: T) -> Self
6716 where
6717 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6718 {
6719 self.0.request.policy = std::option::Option::Some(v.into());
6720 self
6721 }
6722
6723 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6727 where
6728 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6729 {
6730 self.0.request.policy = v.map(|x| x.into());
6731 self
6732 }
6733
6734 pub fn set_update_mask<T>(mut self, v: T) -> Self
6736 where
6737 T: std::convert::Into<wkt::FieldMask>,
6738 {
6739 self.0.request.update_mask = std::option::Option::Some(v.into());
6740 self
6741 }
6742
6743 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6745 where
6746 T: std::convert::Into<wkt::FieldMask>,
6747 {
6748 self.0.request.update_mask = v.map(|x| x.into());
6749 self
6750 }
6751 }
6752
6753 #[doc(hidden)]
6754 impl crate::RequestBuilder for SetIamPolicy {
6755 fn request_options(&mut self) -> &mut crate::RequestOptions {
6756 &mut self.0.options
6757 }
6758 }
6759
6760 #[derive(Clone, Debug)]
6777 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6778
6779 impl GetIamPolicy {
6780 pub(crate) fn new(
6781 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6782 ) -> Self {
6783 Self(RequestBuilder::new(stub))
6784 }
6785
6786 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6788 mut self,
6789 v: V,
6790 ) -> Self {
6791 self.0.request = v.into();
6792 self
6793 }
6794
6795 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6797 self.0.options = v.into();
6798 self
6799 }
6800
6801 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6803 (*self.0.stub)
6804 .get_iam_policy(self.0.request, self.0.options)
6805 .await
6806 .map(crate::Response::into_body)
6807 }
6808
6809 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6813 self.0.request.resource = v.into();
6814 self
6815 }
6816
6817 pub fn set_options<T>(mut self, v: T) -> Self
6819 where
6820 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6821 {
6822 self.0.request.options = std::option::Option::Some(v.into());
6823 self
6824 }
6825
6826 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6828 where
6829 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6830 {
6831 self.0.request.options = v.map(|x| x.into());
6832 self
6833 }
6834 }
6835
6836 #[doc(hidden)]
6837 impl crate::RequestBuilder for GetIamPolicy {
6838 fn request_options(&mut self) -> &mut crate::RequestOptions {
6839 &mut self.0.options
6840 }
6841 }
6842
6843 #[derive(Clone, Debug)]
6860 pub struct TestIamPermissions(
6861 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6862 );
6863
6864 impl TestIamPermissions {
6865 pub(crate) fn new(
6866 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6867 ) -> Self {
6868 Self(RequestBuilder::new(stub))
6869 }
6870
6871 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6873 mut self,
6874 v: V,
6875 ) -> Self {
6876 self.0.request = v.into();
6877 self
6878 }
6879
6880 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6882 self.0.options = v.into();
6883 self
6884 }
6885
6886 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6888 (*self.0.stub)
6889 .test_iam_permissions(self.0.request, self.0.options)
6890 .await
6891 .map(crate::Response::into_body)
6892 }
6893
6894 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6898 self.0.request.resource = v.into();
6899 self
6900 }
6901
6902 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6906 where
6907 T: std::iter::IntoIterator<Item = V>,
6908 V: std::convert::Into<std::string::String>,
6909 {
6910 use std::iter::Iterator;
6911 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6912 self
6913 }
6914 }
6915
6916 #[doc(hidden)]
6917 impl crate::RequestBuilder for TestIamPermissions {
6918 fn request_options(&mut self) -> &mut crate::RequestOptions {
6919 &mut self.0.options
6920 }
6921 }
6922
6923 #[derive(Clone, Debug)]
6944 pub struct ListOperations(
6945 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6946 );
6947
6948 impl ListOperations {
6949 pub(crate) fn new(
6950 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6951 ) -> Self {
6952 Self(RequestBuilder::new(stub))
6953 }
6954
6955 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6957 mut self,
6958 v: V,
6959 ) -> Self {
6960 self.0.request = v.into();
6961 self
6962 }
6963
6964 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6966 self.0.options = v.into();
6967 self
6968 }
6969
6970 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6972 (*self.0.stub)
6973 .list_operations(self.0.request, self.0.options)
6974 .await
6975 .map(crate::Response::into_body)
6976 }
6977
6978 pub fn by_page(
6980 self,
6981 ) -> impl google_cloud_gax::paginator::Paginator<
6982 google_cloud_longrunning::model::ListOperationsResponse,
6983 crate::Error,
6984 > {
6985 use std::clone::Clone;
6986 let token = self.0.request.page_token.clone();
6987 let execute = move |token: String| {
6988 let mut builder = self.clone();
6989 builder.0.request = builder.0.request.set_page_token(token);
6990 builder.send()
6991 };
6992 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6993 }
6994
6995 pub fn by_item(
6997 self,
6998 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6999 google_cloud_longrunning::model::ListOperationsResponse,
7000 crate::Error,
7001 > {
7002 use google_cloud_gax::paginator::Paginator;
7003 self.by_page().items()
7004 }
7005
7006 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7008 self.0.request.name = v.into();
7009 self
7010 }
7011
7012 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7014 self.0.request.filter = v.into();
7015 self
7016 }
7017
7018 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7020 self.0.request.page_size = v.into();
7021 self
7022 }
7023
7024 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7026 self.0.request.page_token = v.into();
7027 self
7028 }
7029
7030 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7032 self.0.request.return_partial_success = v.into();
7033 self
7034 }
7035 }
7036
7037 #[doc(hidden)]
7038 impl crate::RequestBuilder for ListOperations {
7039 fn request_options(&mut self) -> &mut crate::RequestOptions {
7040 &mut self.0.options
7041 }
7042 }
7043
7044 #[derive(Clone, Debug)]
7061 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7062
7063 impl GetOperation {
7064 pub(crate) fn new(
7065 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
7066 ) -> Self {
7067 Self(RequestBuilder::new(stub))
7068 }
7069
7070 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7072 mut self,
7073 v: V,
7074 ) -> Self {
7075 self.0.request = v.into();
7076 self
7077 }
7078
7079 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7081 self.0.options = v.into();
7082 self
7083 }
7084
7085 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7087 (*self.0.stub)
7088 .get_operation(self.0.request, self.0.options)
7089 .await
7090 .map(crate::Response::into_body)
7091 }
7092
7093 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7095 self.0.request.name = v.into();
7096 self
7097 }
7098 }
7099
7100 #[doc(hidden)]
7101 impl crate::RequestBuilder for GetOperation {
7102 fn request_options(&mut self) -> &mut crate::RequestOptions {
7103 &mut self.0.options
7104 }
7105 }
7106
7107 #[derive(Clone, Debug)]
7124 pub struct DeleteOperation(
7125 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7126 );
7127
7128 impl DeleteOperation {
7129 pub(crate) fn new(
7130 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
7131 ) -> Self {
7132 Self(RequestBuilder::new(stub))
7133 }
7134
7135 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7137 mut self,
7138 v: V,
7139 ) -> Self {
7140 self.0.request = v.into();
7141 self
7142 }
7143
7144 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7146 self.0.options = v.into();
7147 self
7148 }
7149
7150 pub async fn send(self) -> Result<()> {
7152 (*self.0.stub)
7153 .delete_operation(self.0.request, self.0.options)
7154 .await
7155 .map(crate::Response::into_body)
7156 }
7157
7158 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7160 self.0.request.name = v.into();
7161 self
7162 }
7163 }
7164
7165 #[doc(hidden)]
7166 impl crate::RequestBuilder for DeleteOperation {
7167 fn request_options(&mut self) -> &mut crate::RequestOptions {
7168 &mut self.0.options
7169 }
7170 }
7171
7172 #[derive(Clone, Debug)]
7189 pub struct CancelOperation(
7190 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7191 );
7192
7193 impl CancelOperation {
7194 pub(crate) fn new(
7195 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
7196 ) -> Self {
7197 Self(RequestBuilder::new(stub))
7198 }
7199
7200 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7202 mut self,
7203 v: V,
7204 ) -> Self {
7205 self.0.request = v.into();
7206 self
7207 }
7208
7209 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7211 self.0.options = v.into();
7212 self
7213 }
7214
7215 pub async fn send(self) -> Result<()> {
7217 (*self.0.stub)
7218 .cancel_operation(self.0.request, self.0.options)
7219 .await
7220 .map(crate::Response::into_body)
7221 }
7222
7223 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7225 self.0.request.name = v.into();
7226 self
7227 }
7228 }
7229
7230 #[doc(hidden)]
7231 impl crate::RequestBuilder for CancelOperation {
7232 fn request_options(&mut self) -> &mut crate::RequestOptions {
7233 &mut self.0.options
7234 }
7235 }
7236}
7237
7238pub mod cmek_service {
7240 use crate::Result;
7241
7242 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7256
7257 pub(crate) mod client {
7258 use super::super::super::client::CmekService;
7259 pub struct Factory;
7260 impl crate::ClientFactory for Factory {
7261 type Client = CmekService;
7262 type Credentials = gaxi::options::Credentials;
7263 async fn build(
7264 self,
7265 config: gaxi::options::ClientConfig,
7266 ) -> crate::ClientBuilderResult<Self::Client> {
7267 Self::Client::new(config).await
7268 }
7269 }
7270 }
7271
7272 #[derive(Clone, Debug)]
7274 pub(crate) struct RequestBuilder<R: std::default::Default> {
7275 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7276 request: R,
7277 options: crate::RequestOptions,
7278 }
7279
7280 impl<R> RequestBuilder<R>
7281 where
7282 R: std::default::Default,
7283 {
7284 pub(crate) fn new(
7285 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7286 ) -> Self {
7287 Self {
7288 stub,
7289 request: R::default(),
7290 options: crate::RequestOptions::default(),
7291 }
7292 }
7293 }
7294
7295 #[derive(Clone, Debug)]
7313 pub struct CreateEncryptionConfig(RequestBuilder<crate::model::CreateEncryptionConfigRequest>);
7314
7315 impl CreateEncryptionConfig {
7316 pub(crate) fn new(
7317 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7318 ) -> Self {
7319 Self(RequestBuilder::new(stub))
7320 }
7321
7322 pub fn with_request<V: Into<crate::model::CreateEncryptionConfigRequest>>(
7324 mut self,
7325 v: V,
7326 ) -> Self {
7327 self.0.request = v.into();
7328 self
7329 }
7330
7331 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7333 self.0.options = v.into();
7334 self
7335 }
7336
7337 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7344 (*self.0.stub)
7345 .create_encryption_config(self.0.request, self.0.options)
7346 .await
7347 .map(crate::Response::into_body)
7348 }
7349
7350 pub fn poller(
7352 self,
7353 ) -> impl google_cloud_lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
7354 {
7355 type Operation = google_cloud_lro::internal::Operation<
7356 crate::model::EncryptionConfig,
7357 crate::model::OperationMetadata,
7358 >;
7359 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7360 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7361
7362 let stub = self.0.stub.clone();
7363 let mut options = self.0.options.clone();
7364 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7365 let query = move |name| {
7366 let stub = stub.clone();
7367 let options = options.clone();
7368 async {
7369 let op = GetOperation::new(stub)
7370 .set_name(name)
7371 .with_options(options)
7372 .send()
7373 .await?;
7374 Ok(Operation::new(op))
7375 }
7376 };
7377
7378 let start = move || async {
7379 let op = self.send().await?;
7380 Ok(Operation::new(op))
7381 };
7382
7383 google_cloud_lro::internal::new_poller(
7384 polling_error_policy,
7385 polling_backoff_policy,
7386 start,
7387 query,
7388 )
7389 }
7390
7391 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7395 self.0.request.parent = v.into();
7396 self
7397 }
7398
7399 pub fn set_encryption_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7403 self.0.request.encryption_config_id = v.into();
7404 self
7405 }
7406
7407 pub fn set_encryption_config<T>(mut self, v: T) -> Self
7411 where
7412 T: std::convert::Into<crate::model::EncryptionConfig>,
7413 {
7414 self.0.request.encryption_config = std::option::Option::Some(v.into());
7415 self
7416 }
7417
7418 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
7422 where
7423 T: std::convert::Into<crate::model::EncryptionConfig>,
7424 {
7425 self.0.request.encryption_config = v.map(|x| x.into());
7426 self
7427 }
7428 }
7429
7430 #[doc(hidden)]
7431 impl crate::RequestBuilder for CreateEncryptionConfig {
7432 fn request_options(&mut self) -> &mut crate::RequestOptions {
7433 &mut self.0.options
7434 }
7435 }
7436
7437 #[derive(Clone, Debug)]
7455 pub struct UpdateEncryptionConfig(RequestBuilder<crate::model::UpdateEncryptionConfigRequest>);
7456
7457 impl UpdateEncryptionConfig {
7458 pub(crate) fn new(
7459 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7460 ) -> Self {
7461 Self(RequestBuilder::new(stub))
7462 }
7463
7464 pub fn with_request<V: Into<crate::model::UpdateEncryptionConfigRequest>>(
7466 mut self,
7467 v: V,
7468 ) -> Self {
7469 self.0.request = v.into();
7470 self
7471 }
7472
7473 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7475 self.0.options = v.into();
7476 self
7477 }
7478
7479 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7486 (*self.0.stub)
7487 .update_encryption_config(self.0.request, self.0.options)
7488 .await
7489 .map(crate::Response::into_body)
7490 }
7491
7492 pub fn poller(
7494 self,
7495 ) -> impl google_cloud_lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
7496 {
7497 type Operation = google_cloud_lro::internal::Operation<
7498 crate::model::EncryptionConfig,
7499 crate::model::OperationMetadata,
7500 >;
7501 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7502 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7503
7504 let stub = self.0.stub.clone();
7505 let mut options = self.0.options.clone();
7506 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7507 let query = move |name| {
7508 let stub = stub.clone();
7509 let options = options.clone();
7510 async {
7511 let op = GetOperation::new(stub)
7512 .set_name(name)
7513 .with_options(options)
7514 .send()
7515 .await?;
7516 Ok(Operation::new(op))
7517 }
7518 };
7519
7520 let start = move || async {
7521 let op = self.send().await?;
7522 Ok(Operation::new(op))
7523 };
7524
7525 google_cloud_lro::internal::new_poller(
7526 polling_error_policy,
7527 polling_backoff_policy,
7528 start,
7529 query,
7530 )
7531 }
7532
7533 pub fn set_encryption_config<T>(mut self, v: T) -> Self
7537 where
7538 T: std::convert::Into<crate::model::EncryptionConfig>,
7539 {
7540 self.0.request.encryption_config = std::option::Option::Some(v.into());
7541 self
7542 }
7543
7544 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
7548 where
7549 T: std::convert::Into<crate::model::EncryptionConfig>,
7550 {
7551 self.0.request.encryption_config = v.map(|x| x.into());
7552 self
7553 }
7554
7555 pub fn set_update_mask<T>(mut self, v: T) -> Self
7557 where
7558 T: std::convert::Into<wkt::FieldMask>,
7559 {
7560 self.0.request.update_mask = std::option::Option::Some(v.into());
7561 self
7562 }
7563
7564 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7566 where
7567 T: std::convert::Into<wkt::FieldMask>,
7568 {
7569 self.0.request.update_mask = v.map(|x| x.into());
7570 self
7571 }
7572 }
7573
7574 #[doc(hidden)]
7575 impl crate::RequestBuilder for UpdateEncryptionConfig {
7576 fn request_options(&mut self) -> &mut crate::RequestOptions {
7577 &mut self.0.options
7578 }
7579 }
7580
7581 #[derive(Clone, Debug)]
7599 pub struct DeleteEncryptionConfig(RequestBuilder<crate::model::DeleteEncryptionConfigRequest>);
7600
7601 impl DeleteEncryptionConfig {
7602 pub(crate) fn new(
7603 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7604 ) -> Self {
7605 Self(RequestBuilder::new(stub))
7606 }
7607
7608 pub fn with_request<V: Into<crate::model::DeleteEncryptionConfigRequest>>(
7610 mut self,
7611 v: V,
7612 ) -> Self {
7613 self.0.request = v.into();
7614 self
7615 }
7616
7617 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7619 self.0.options = v.into();
7620 self
7621 }
7622
7623 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7630 (*self.0.stub)
7631 .delete_encryption_config(self.0.request, self.0.options)
7632 .await
7633 .map(crate::Response::into_body)
7634 }
7635
7636 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7638 type Operation =
7639 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7640 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7641 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7642
7643 let stub = self.0.stub.clone();
7644 let mut options = self.0.options.clone();
7645 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7646 let query = move |name| {
7647 let stub = stub.clone();
7648 let options = options.clone();
7649 async {
7650 let op = GetOperation::new(stub)
7651 .set_name(name)
7652 .with_options(options)
7653 .send()
7654 .await?;
7655 Ok(Operation::new(op))
7656 }
7657 };
7658
7659 let start = move || async {
7660 let op = self.send().await?;
7661 Ok(Operation::new(op))
7662 };
7663
7664 google_cloud_lro::internal::new_unit_response_poller(
7665 polling_error_policy,
7666 polling_backoff_policy,
7667 start,
7668 query,
7669 )
7670 }
7671
7672 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7676 self.0.request.name = v.into();
7677 self
7678 }
7679
7680 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7682 self.0.request.etag = v.into();
7683 self
7684 }
7685 }
7686
7687 #[doc(hidden)]
7688 impl crate::RequestBuilder for DeleteEncryptionConfig {
7689 fn request_options(&mut self) -> &mut crate::RequestOptions {
7690 &mut self.0.options
7691 }
7692 }
7693
7694 #[derive(Clone, Debug)]
7715 pub struct ListEncryptionConfigs(RequestBuilder<crate::model::ListEncryptionConfigsRequest>);
7716
7717 impl ListEncryptionConfigs {
7718 pub(crate) fn new(
7719 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7720 ) -> Self {
7721 Self(RequestBuilder::new(stub))
7722 }
7723
7724 pub fn with_request<V: Into<crate::model::ListEncryptionConfigsRequest>>(
7726 mut self,
7727 v: V,
7728 ) -> Self {
7729 self.0.request = v.into();
7730 self
7731 }
7732
7733 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7735 self.0.options = v.into();
7736 self
7737 }
7738
7739 pub async fn send(self) -> Result<crate::model::ListEncryptionConfigsResponse> {
7741 (*self.0.stub)
7742 .list_encryption_configs(self.0.request, self.0.options)
7743 .await
7744 .map(crate::Response::into_body)
7745 }
7746
7747 pub fn by_page(
7749 self,
7750 ) -> impl google_cloud_gax::paginator::Paginator<
7751 crate::model::ListEncryptionConfigsResponse,
7752 crate::Error,
7753 > {
7754 use std::clone::Clone;
7755 let token = self.0.request.page_token.clone();
7756 let execute = move |token: String| {
7757 let mut builder = self.clone();
7758 builder.0.request = builder.0.request.set_page_token(token);
7759 builder.send()
7760 };
7761 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7762 }
7763
7764 pub fn by_item(
7766 self,
7767 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7768 crate::model::ListEncryptionConfigsResponse,
7769 crate::Error,
7770 > {
7771 use google_cloud_gax::paginator::Paginator;
7772 self.by_page().items()
7773 }
7774
7775 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7779 self.0.request.parent = v.into();
7780 self
7781 }
7782
7783 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7785 self.0.request.page_size = v.into();
7786 self
7787 }
7788
7789 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7791 self.0.request.page_token = v.into();
7792 self
7793 }
7794
7795 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7797 self.0.request.filter = v.into();
7798 self
7799 }
7800
7801 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7803 self.0.request.order_by = v.into();
7804 self
7805 }
7806 }
7807
7808 #[doc(hidden)]
7809 impl crate::RequestBuilder for ListEncryptionConfigs {
7810 fn request_options(&mut self) -> &mut crate::RequestOptions {
7811 &mut self.0.options
7812 }
7813 }
7814
7815 #[derive(Clone, Debug)]
7832 pub struct GetEncryptionConfig(RequestBuilder<crate::model::GetEncryptionConfigRequest>);
7833
7834 impl GetEncryptionConfig {
7835 pub(crate) fn new(
7836 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7837 ) -> Self {
7838 Self(RequestBuilder::new(stub))
7839 }
7840
7841 pub fn with_request<V: Into<crate::model::GetEncryptionConfigRequest>>(
7843 mut self,
7844 v: V,
7845 ) -> Self {
7846 self.0.request = v.into();
7847 self
7848 }
7849
7850 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7852 self.0.options = v.into();
7853 self
7854 }
7855
7856 pub async fn send(self) -> Result<crate::model::EncryptionConfig> {
7858 (*self.0.stub)
7859 .get_encryption_config(self.0.request, self.0.options)
7860 .await
7861 .map(crate::Response::into_body)
7862 }
7863
7864 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7868 self.0.request.name = v.into();
7869 self
7870 }
7871 }
7872
7873 #[doc(hidden)]
7874 impl crate::RequestBuilder for GetEncryptionConfig {
7875 fn request_options(&mut self) -> &mut crate::RequestOptions {
7876 &mut self.0.options
7877 }
7878 }
7879
7880 #[derive(Clone, Debug)]
7901 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7902
7903 impl ListLocations {
7904 pub(crate) fn new(
7905 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7906 ) -> Self {
7907 Self(RequestBuilder::new(stub))
7908 }
7909
7910 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7912 mut self,
7913 v: V,
7914 ) -> Self {
7915 self.0.request = v.into();
7916 self
7917 }
7918
7919 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7921 self.0.options = v.into();
7922 self
7923 }
7924
7925 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7927 (*self.0.stub)
7928 .list_locations(self.0.request, self.0.options)
7929 .await
7930 .map(crate::Response::into_body)
7931 }
7932
7933 pub fn by_page(
7935 self,
7936 ) -> impl google_cloud_gax::paginator::Paginator<
7937 google_cloud_location::model::ListLocationsResponse,
7938 crate::Error,
7939 > {
7940 use std::clone::Clone;
7941 let token = self.0.request.page_token.clone();
7942 let execute = move |token: String| {
7943 let mut builder = self.clone();
7944 builder.0.request = builder.0.request.set_page_token(token);
7945 builder.send()
7946 };
7947 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7948 }
7949
7950 pub fn by_item(
7952 self,
7953 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7954 google_cloud_location::model::ListLocationsResponse,
7955 crate::Error,
7956 > {
7957 use google_cloud_gax::paginator::Paginator;
7958 self.by_page().items()
7959 }
7960
7961 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7963 self.0.request.name = v.into();
7964 self
7965 }
7966
7967 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7969 self.0.request.filter = v.into();
7970 self
7971 }
7972
7973 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7975 self.0.request.page_size = v.into();
7976 self
7977 }
7978
7979 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7981 self.0.request.page_token = v.into();
7982 self
7983 }
7984 }
7985
7986 #[doc(hidden)]
7987 impl crate::RequestBuilder for ListLocations {
7988 fn request_options(&mut self) -> &mut crate::RequestOptions {
7989 &mut self.0.options
7990 }
7991 }
7992
7993 #[derive(Clone, Debug)]
8010 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8011
8012 impl GetLocation {
8013 pub(crate) fn new(
8014 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8015 ) -> Self {
8016 Self(RequestBuilder::new(stub))
8017 }
8018
8019 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8021 mut self,
8022 v: V,
8023 ) -> Self {
8024 self.0.request = v.into();
8025 self
8026 }
8027
8028 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8030 self.0.options = v.into();
8031 self
8032 }
8033
8034 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8036 (*self.0.stub)
8037 .get_location(self.0.request, self.0.options)
8038 .await
8039 .map(crate::Response::into_body)
8040 }
8041
8042 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8044 self.0.request.name = v.into();
8045 self
8046 }
8047 }
8048
8049 #[doc(hidden)]
8050 impl crate::RequestBuilder for GetLocation {
8051 fn request_options(&mut self) -> &mut crate::RequestOptions {
8052 &mut self.0.options
8053 }
8054 }
8055
8056 #[derive(Clone, Debug)]
8073 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8074
8075 impl SetIamPolicy {
8076 pub(crate) fn new(
8077 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8078 ) -> Self {
8079 Self(RequestBuilder::new(stub))
8080 }
8081
8082 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8084 mut self,
8085 v: V,
8086 ) -> Self {
8087 self.0.request = v.into();
8088 self
8089 }
8090
8091 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8093 self.0.options = v.into();
8094 self
8095 }
8096
8097 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8099 (*self.0.stub)
8100 .set_iam_policy(self.0.request, self.0.options)
8101 .await
8102 .map(crate::Response::into_body)
8103 }
8104
8105 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8109 self.0.request.resource = v.into();
8110 self
8111 }
8112
8113 pub fn set_policy<T>(mut self, v: T) -> Self
8117 where
8118 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8119 {
8120 self.0.request.policy = std::option::Option::Some(v.into());
8121 self
8122 }
8123
8124 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8128 where
8129 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8130 {
8131 self.0.request.policy = v.map(|x| x.into());
8132 self
8133 }
8134
8135 pub fn set_update_mask<T>(mut self, v: T) -> Self
8137 where
8138 T: std::convert::Into<wkt::FieldMask>,
8139 {
8140 self.0.request.update_mask = std::option::Option::Some(v.into());
8141 self
8142 }
8143
8144 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8146 where
8147 T: std::convert::Into<wkt::FieldMask>,
8148 {
8149 self.0.request.update_mask = v.map(|x| x.into());
8150 self
8151 }
8152 }
8153
8154 #[doc(hidden)]
8155 impl crate::RequestBuilder for SetIamPolicy {
8156 fn request_options(&mut self) -> &mut crate::RequestOptions {
8157 &mut self.0.options
8158 }
8159 }
8160
8161 #[derive(Clone, Debug)]
8178 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8179
8180 impl GetIamPolicy {
8181 pub(crate) fn new(
8182 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8183 ) -> Self {
8184 Self(RequestBuilder::new(stub))
8185 }
8186
8187 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8189 mut self,
8190 v: V,
8191 ) -> Self {
8192 self.0.request = v.into();
8193 self
8194 }
8195
8196 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8198 self.0.options = v.into();
8199 self
8200 }
8201
8202 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8204 (*self.0.stub)
8205 .get_iam_policy(self.0.request, self.0.options)
8206 .await
8207 .map(crate::Response::into_body)
8208 }
8209
8210 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8214 self.0.request.resource = v.into();
8215 self
8216 }
8217
8218 pub fn set_options<T>(mut self, v: T) -> Self
8220 where
8221 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8222 {
8223 self.0.request.options = std::option::Option::Some(v.into());
8224 self
8225 }
8226
8227 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8229 where
8230 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8231 {
8232 self.0.request.options = v.map(|x| x.into());
8233 self
8234 }
8235 }
8236
8237 #[doc(hidden)]
8238 impl crate::RequestBuilder for GetIamPolicy {
8239 fn request_options(&mut self) -> &mut crate::RequestOptions {
8240 &mut self.0.options
8241 }
8242 }
8243
8244 #[derive(Clone, Debug)]
8261 pub struct TestIamPermissions(
8262 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8263 );
8264
8265 impl TestIamPermissions {
8266 pub(crate) fn new(
8267 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8268 ) -> Self {
8269 Self(RequestBuilder::new(stub))
8270 }
8271
8272 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8274 mut self,
8275 v: V,
8276 ) -> Self {
8277 self.0.request = v.into();
8278 self
8279 }
8280
8281 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8283 self.0.options = v.into();
8284 self
8285 }
8286
8287 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8289 (*self.0.stub)
8290 .test_iam_permissions(self.0.request, self.0.options)
8291 .await
8292 .map(crate::Response::into_body)
8293 }
8294
8295 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8299 self.0.request.resource = v.into();
8300 self
8301 }
8302
8303 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8307 where
8308 T: std::iter::IntoIterator<Item = V>,
8309 V: std::convert::Into<std::string::String>,
8310 {
8311 use std::iter::Iterator;
8312 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8313 self
8314 }
8315 }
8316
8317 #[doc(hidden)]
8318 impl crate::RequestBuilder for TestIamPermissions {
8319 fn request_options(&mut self) -> &mut crate::RequestOptions {
8320 &mut self.0.options
8321 }
8322 }
8323
8324 #[derive(Clone, Debug)]
8345 pub struct ListOperations(
8346 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8347 );
8348
8349 impl ListOperations {
8350 pub(crate) fn new(
8351 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8352 ) -> Self {
8353 Self(RequestBuilder::new(stub))
8354 }
8355
8356 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8358 mut self,
8359 v: V,
8360 ) -> Self {
8361 self.0.request = v.into();
8362 self
8363 }
8364
8365 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8367 self.0.options = v.into();
8368 self
8369 }
8370
8371 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8373 (*self.0.stub)
8374 .list_operations(self.0.request, self.0.options)
8375 .await
8376 .map(crate::Response::into_body)
8377 }
8378
8379 pub fn by_page(
8381 self,
8382 ) -> impl google_cloud_gax::paginator::Paginator<
8383 google_cloud_longrunning::model::ListOperationsResponse,
8384 crate::Error,
8385 > {
8386 use std::clone::Clone;
8387 let token = self.0.request.page_token.clone();
8388 let execute = move |token: String| {
8389 let mut builder = self.clone();
8390 builder.0.request = builder.0.request.set_page_token(token);
8391 builder.send()
8392 };
8393 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8394 }
8395
8396 pub fn by_item(
8398 self,
8399 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8400 google_cloud_longrunning::model::ListOperationsResponse,
8401 crate::Error,
8402 > {
8403 use google_cloud_gax::paginator::Paginator;
8404 self.by_page().items()
8405 }
8406
8407 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8409 self.0.request.name = v.into();
8410 self
8411 }
8412
8413 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8415 self.0.request.filter = v.into();
8416 self
8417 }
8418
8419 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8421 self.0.request.page_size = v.into();
8422 self
8423 }
8424
8425 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8427 self.0.request.page_token = v.into();
8428 self
8429 }
8430
8431 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8433 self.0.request.return_partial_success = v.into();
8434 self
8435 }
8436 }
8437
8438 #[doc(hidden)]
8439 impl crate::RequestBuilder for ListOperations {
8440 fn request_options(&mut self) -> &mut crate::RequestOptions {
8441 &mut self.0.options
8442 }
8443 }
8444
8445 #[derive(Clone, Debug)]
8462 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8463
8464 impl GetOperation {
8465 pub(crate) fn new(
8466 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8467 ) -> Self {
8468 Self(RequestBuilder::new(stub))
8469 }
8470
8471 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8473 mut self,
8474 v: V,
8475 ) -> Self {
8476 self.0.request = v.into();
8477 self
8478 }
8479
8480 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8482 self.0.options = v.into();
8483 self
8484 }
8485
8486 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8488 (*self.0.stub)
8489 .get_operation(self.0.request, self.0.options)
8490 .await
8491 .map(crate::Response::into_body)
8492 }
8493
8494 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8496 self.0.request.name = v.into();
8497 self
8498 }
8499 }
8500
8501 #[doc(hidden)]
8502 impl crate::RequestBuilder for GetOperation {
8503 fn request_options(&mut self) -> &mut crate::RequestOptions {
8504 &mut self.0.options
8505 }
8506 }
8507
8508 #[derive(Clone, Debug)]
8525 pub struct DeleteOperation(
8526 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8527 );
8528
8529 impl DeleteOperation {
8530 pub(crate) fn new(
8531 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8532 ) -> Self {
8533 Self(RequestBuilder::new(stub))
8534 }
8535
8536 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8538 mut self,
8539 v: V,
8540 ) -> Self {
8541 self.0.request = v.into();
8542 self
8543 }
8544
8545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8547 self.0.options = v.into();
8548 self
8549 }
8550
8551 pub async fn send(self) -> Result<()> {
8553 (*self.0.stub)
8554 .delete_operation(self.0.request, self.0.options)
8555 .await
8556 .map(crate::Response::into_body)
8557 }
8558
8559 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8561 self.0.request.name = v.into();
8562 self
8563 }
8564 }
8565
8566 #[doc(hidden)]
8567 impl crate::RequestBuilder for DeleteOperation {
8568 fn request_options(&mut self) -> &mut crate::RequestOptions {
8569 &mut self.0.options
8570 }
8571 }
8572
8573 #[derive(Clone, Debug)]
8590 pub struct CancelOperation(
8591 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8592 );
8593
8594 impl CancelOperation {
8595 pub(crate) fn new(
8596 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
8597 ) -> Self {
8598 Self(RequestBuilder::new(stub))
8599 }
8600
8601 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
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<()> {
8618 (*self.0.stub)
8619 .cancel_operation(self.0.request, self.0.options)
8620 .await
8621 .map(crate::Response::into_body)
8622 }
8623
8624 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8626 self.0.request.name = v.into();
8627 self
8628 }
8629 }
8630
8631 #[doc(hidden)]
8632 impl crate::RequestBuilder for CancelOperation {
8633 fn request_options(&mut self) -> &mut crate::RequestOptions {
8634 &mut self.0.options
8635 }
8636 }
8637}
8638
8639pub mod content_service {
8641 use crate::Result;
8642
8643 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8657
8658 pub(crate) mod client {
8659 use super::super::super::client::ContentService;
8660 pub struct Factory;
8661 impl crate::ClientFactory for Factory {
8662 type Client = ContentService;
8663 type Credentials = gaxi::options::Credentials;
8664 async fn build(
8665 self,
8666 config: gaxi::options::ClientConfig,
8667 ) -> crate::ClientBuilderResult<Self::Client> {
8668 Self::Client::new(config).await
8669 }
8670 }
8671 }
8672
8673 #[derive(Clone, Debug)]
8675 pub(crate) struct RequestBuilder<R: std::default::Default> {
8676 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8677 request: R,
8678 options: crate::RequestOptions,
8679 }
8680
8681 impl<R> RequestBuilder<R>
8682 where
8683 R: std::default::Default,
8684 {
8685 pub(crate) fn new(
8686 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8687 ) -> Self {
8688 Self {
8689 stub,
8690 request: R::default(),
8691 options: crate::RequestOptions::default(),
8692 }
8693 }
8694 }
8695
8696 #[derive(Clone, Debug)]
8717 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
8718
8719 impl ListLocations {
8720 pub(crate) fn new(
8721 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8722 ) -> Self {
8723 Self(RequestBuilder::new(stub))
8724 }
8725
8726 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
8728 mut self,
8729 v: V,
8730 ) -> Self {
8731 self.0.request = v.into();
8732 self
8733 }
8734
8735 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8737 self.0.options = v.into();
8738 self
8739 }
8740
8741 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8743 (*self.0.stub)
8744 .list_locations(self.0.request, self.0.options)
8745 .await
8746 .map(crate::Response::into_body)
8747 }
8748
8749 pub fn by_page(
8751 self,
8752 ) -> impl google_cloud_gax::paginator::Paginator<
8753 google_cloud_location::model::ListLocationsResponse,
8754 crate::Error,
8755 > {
8756 use std::clone::Clone;
8757 let token = self.0.request.page_token.clone();
8758 let execute = move |token: String| {
8759 let mut builder = self.clone();
8760 builder.0.request = builder.0.request.set_page_token(token);
8761 builder.send()
8762 };
8763 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8764 }
8765
8766 pub fn by_item(
8768 self,
8769 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8770 google_cloud_location::model::ListLocationsResponse,
8771 crate::Error,
8772 > {
8773 use google_cloud_gax::paginator::Paginator;
8774 self.by_page().items()
8775 }
8776
8777 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8779 self.0.request.name = v.into();
8780 self
8781 }
8782
8783 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8785 self.0.request.filter = v.into();
8786 self
8787 }
8788
8789 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8791 self.0.request.page_size = v.into();
8792 self
8793 }
8794
8795 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8797 self.0.request.page_token = v.into();
8798 self
8799 }
8800 }
8801
8802 #[doc(hidden)]
8803 impl crate::RequestBuilder for ListLocations {
8804 fn request_options(&mut self) -> &mut crate::RequestOptions {
8805 &mut self.0.options
8806 }
8807 }
8808
8809 #[derive(Clone, Debug)]
8826 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8827
8828 impl GetLocation {
8829 pub(crate) fn new(
8830 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8831 ) -> Self {
8832 Self(RequestBuilder::new(stub))
8833 }
8834
8835 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8837 mut self,
8838 v: V,
8839 ) -> Self {
8840 self.0.request = v.into();
8841 self
8842 }
8843
8844 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8846 self.0.options = v.into();
8847 self
8848 }
8849
8850 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8852 (*self.0.stub)
8853 .get_location(self.0.request, self.0.options)
8854 .await
8855 .map(crate::Response::into_body)
8856 }
8857
8858 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8860 self.0.request.name = v.into();
8861 self
8862 }
8863 }
8864
8865 #[doc(hidden)]
8866 impl crate::RequestBuilder for GetLocation {
8867 fn request_options(&mut self) -> &mut crate::RequestOptions {
8868 &mut self.0.options
8869 }
8870 }
8871
8872 #[derive(Clone, Debug)]
8889 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8890
8891 impl SetIamPolicy {
8892 pub(crate) fn new(
8893 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8894 ) -> Self {
8895 Self(RequestBuilder::new(stub))
8896 }
8897
8898 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8900 mut self,
8901 v: V,
8902 ) -> Self {
8903 self.0.request = v.into();
8904 self
8905 }
8906
8907 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8909 self.0.options = v.into();
8910 self
8911 }
8912
8913 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8915 (*self.0.stub)
8916 .set_iam_policy(self.0.request, self.0.options)
8917 .await
8918 .map(crate::Response::into_body)
8919 }
8920
8921 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8925 self.0.request.resource = v.into();
8926 self
8927 }
8928
8929 pub fn set_policy<T>(mut self, v: T) -> Self
8933 where
8934 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8935 {
8936 self.0.request.policy = std::option::Option::Some(v.into());
8937 self
8938 }
8939
8940 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8944 where
8945 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8946 {
8947 self.0.request.policy = v.map(|x| x.into());
8948 self
8949 }
8950
8951 pub fn set_update_mask<T>(mut self, v: T) -> Self
8953 where
8954 T: std::convert::Into<wkt::FieldMask>,
8955 {
8956 self.0.request.update_mask = std::option::Option::Some(v.into());
8957 self
8958 }
8959
8960 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8962 where
8963 T: std::convert::Into<wkt::FieldMask>,
8964 {
8965 self.0.request.update_mask = v.map(|x| x.into());
8966 self
8967 }
8968 }
8969
8970 #[doc(hidden)]
8971 impl crate::RequestBuilder for SetIamPolicy {
8972 fn request_options(&mut self) -> &mut crate::RequestOptions {
8973 &mut self.0.options
8974 }
8975 }
8976
8977 #[derive(Clone, Debug)]
8994 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8995
8996 impl GetIamPolicy {
8997 pub(crate) fn new(
8998 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8999 ) -> Self {
9000 Self(RequestBuilder::new(stub))
9001 }
9002
9003 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9005 mut self,
9006 v: V,
9007 ) -> Self {
9008 self.0.request = v.into();
9009 self
9010 }
9011
9012 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9014 self.0.options = v.into();
9015 self
9016 }
9017
9018 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9020 (*self.0.stub)
9021 .get_iam_policy(self.0.request, self.0.options)
9022 .await
9023 .map(crate::Response::into_body)
9024 }
9025
9026 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9030 self.0.request.resource = v.into();
9031 self
9032 }
9033
9034 pub fn set_options<T>(mut self, v: T) -> Self
9036 where
9037 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9038 {
9039 self.0.request.options = std::option::Option::Some(v.into());
9040 self
9041 }
9042
9043 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9045 where
9046 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9047 {
9048 self.0.request.options = v.map(|x| x.into());
9049 self
9050 }
9051 }
9052
9053 #[doc(hidden)]
9054 impl crate::RequestBuilder for GetIamPolicy {
9055 fn request_options(&mut self) -> &mut crate::RequestOptions {
9056 &mut self.0.options
9057 }
9058 }
9059
9060 #[derive(Clone, Debug)]
9077 pub struct TestIamPermissions(
9078 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
9079 );
9080
9081 impl TestIamPermissions {
9082 pub(crate) fn new(
9083 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9084 ) -> Self {
9085 Self(RequestBuilder::new(stub))
9086 }
9087
9088 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
9090 mut self,
9091 v: V,
9092 ) -> Self {
9093 self.0.request = v.into();
9094 self
9095 }
9096
9097 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9099 self.0.options = v.into();
9100 self
9101 }
9102
9103 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
9105 (*self.0.stub)
9106 .test_iam_permissions(self.0.request, self.0.options)
9107 .await
9108 .map(crate::Response::into_body)
9109 }
9110
9111 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9115 self.0.request.resource = v.into();
9116 self
9117 }
9118
9119 pub fn set_permissions<T, V>(mut self, v: T) -> Self
9123 where
9124 T: std::iter::IntoIterator<Item = V>,
9125 V: std::convert::Into<std::string::String>,
9126 {
9127 use std::iter::Iterator;
9128 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9129 self
9130 }
9131 }
9132
9133 #[doc(hidden)]
9134 impl crate::RequestBuilder for TestIamPermissions {
9135 fn request_options(&mut self) -> &mut crate::RequestOptions {
9136 &mut self.0.options
9137 }
9138 }
9139
9140 #[derive(Clone, Debug)]
9161 pub struct ListOperations(
9162 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9163 );
9164
9165 impl ListOperations {
9166 pub(crate) fn new(
9167 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9168 ) -> Self {
9169 Self(RequestBuilder::new(stub))
9170 }
9171
9172 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9174 mut self,
9175 v: V,
9176 ) -> Self {
9177 self.0.request = v.into();
9178 self
9179 }
9180
9181 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9183 self.0.options = v.into();
9184 self
9185 }
9186
9187 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9189 (*self.0.stub)
9190 .list_operations(self.0.request, self.0.options)
9191 .await
9192 .map(crate::Response::into_body)
9193 }
9194
9195 pub fn by_page(
9197 self,
9198 ) -> impl google_cloud_gax::paginator::Paginator<
9199 google_cloud_longrunning::model::ListOperationsResponse,
9200 crate::Error,
9201 > {
9202 use std::clone::Clone;
9203 let token = self.0.request.page_token.clone();
9204 let execute = move |token: String| {
9205 let mut builder = self.clone();
9206 builder.0.request = builder.0.request.set_page_token(token);
9207 builder.send()
9208 };
9209 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9210 }
9211
9212 pub fn by_item(
9214 self,
9215 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9216 google_cloud_longrunning::model::ListOperationsResponse,
9217 crate::Error,
9218 > {
9219 use google_cloud_gax::paginator::Paginator;
9220 self.by_page().items()
9221 }
9222
9223 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9225 self.0.request.name = v.into();
9226 self
9227 }
9228
9229 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9231 self.0.request.filter = v.into();
9232 self
9233 }
9234
9235 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9237 self.0.request.page_size = v.into();
9238 self
9239 }
9240
9241 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9243 self.0.request.page_token = v.into();
9244 self
9245 }
9246
9247 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9249 self.0.request.return_partial_success = v.into();
9250 self
9251 }
9252 }
9253
9254 #[doc(hidden)]
9255 impl crate::RequestBuilder for ListOperations {
9256 fn request_options(&mut self) -> &mut crate::RequestOptions {
9257 &mut self.0.options
9258 }
9259 }
9260
9261 #[derive(Clone, Debug)]
9278 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9279
9280 impl GetOperation {
9281 pub(crate) fn new(
9282 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9283 ) -> Self {
9284 Self(RequestBuilder::new(stub))
9285 }
9286
9287 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9289 mut self,
9290 v: V,
9291 ) -> Self {
9292 self.0.request = v.into();
9293 self
9294 }
9295
9296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9298 self.0.options = v.into();
9299 self
9300 }
9301
9302 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9304 (*self.0.stub)
9305 .get_operation(self.0.request, self.0.options)
9306 .await
9307 .map(crate::Response::into_body)
9308 }
9309
9310 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9312 self.0.request.name = v.into();
9313 self
9314 }
9315 }
9316
9317 #[doc(hidden)]
9318 impl crate::RequestBuilder for GetOperation {
9319 fn request_options(&mut self) -> &mut crate::RequestOptions {
9320 &mut self.0.options
9321 }
9322 }
9323
9324 #[derive(Clone, Debug)]
9341 pub struct DeleteOperation(
9342 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
9343 );
9344
9345 impl DeleteOperation {
9346 pub(crate) fn new(
9347 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9348 ) -> Self {
9349 Self(RequestBuilder::new(stub))
9350 }
9351
9352 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
9354 mut self,
9355 v: V,
9356 ) -> Self {
9357 self.0.request = v.into();
9358 self
9359 }
9360
9361 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9363 self.0.options = v.into();
9364 self
9365 }
9366
9367 pub async fn send(self) -> Result<()> {
9369 (*self.0.stub)
9370 .delete_operation(self.0.request, self.0.options)
9371 .await
9372 .map(crate::Response::into_body)
9373 }
9374
9375 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9377 self.0.request.name = v.into();
9378 self
9379 }
9380 }
9381
9382 #[doc(hidden)]
9383 impl crate::RequestBuilder for DeleteOperation {
9384 fn request_options(&mut self) -> &mut crate::RequestOptions {
9385 &mut self.0.options
9386 }
9387 }
9388
9389 #[derive(Clone, Debug)]
9406 pub struct CancelOperation(
9407 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
9408 );
9409
9410 impl CancelOperation {
9411 pub(crate) fn new(
9412 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
9413 ) -> Self {
9414 Self(RequestBuilder::new(stub))
9415 }
9416
9417 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
9419 mut self,
9420 v: V,
9421 ) -> Self {
9422 self.0.request = v.into();
9423 self
9424 }
9425
9426 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9428 self.0.options = v.into();
9429 self
9430 }
9431
9432 pub async fn send(self) -> Result<()> {
9434 (*self.0.stub)
9435 .cancel_operation(self.0.request, self.0.options)
9436 .await
9437 .map(crate::Response::into_body)
9438 }
9439
9440 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9442 self.0.request.name = v.into();
9443 self
9444 }
9445 }
9446
9447 #[doc(hidden)]
9448 impl crate::RequestBuilder for CancelOperation {
9449 fn request_options(&mut self) -> &mut crate::RequestOptions {
9450 &mut self.0.options
9451 }
9452 }
9453}
9454
9455pub mod data_product_service {
9457 use crate::Result;
9458
9459 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9473
9474 pub(crate) mod client {
9475 use super::super::super::client::DataProductService;
9476 pub struct Factory;
9477 impl crate::ClientFactory for Factory {
9478 type Client = DataProductService;
9479 type Credentials = gaxi::options::Credentials;
9480 async fn build(
9481 self,
9482 config: gaxi::options::ClientConfig,
9483 ) -> crate::ClientBuilderResult<Self::Client> {
9484 Self::Client::new(config).await
9485 }
9486 }
9487 }
9488
9489 #[derive(Clone, Debug)]
9491 pub(crate) struct RequestBuilder<R: std::default::Default> {
9492 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9493 request: R,
9494 options: crate::RequestOptions,
9495 }
9496
9497 impl<R> RequestBuilder<R>
9498 where
9499 R: std::default::Default,
9500 {
9501 pub(crate) fn new(
9502 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9503 ) -> Self {
9504 Self {
9505 stub,
9506 request: R::default(),
9507 options: crate::RequestOptions::default(),
9508 }
9509 }
9510 }
9511
9512 #[derive(Clone, Debug)]
9530 pub struct CreateDataProduct(RequestBuilder<crate::model::CreateDataProductRequest>);
9531
9532 impl CreateDataProduct {
9533 pub(crate) fn new(
9534 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9535 ) -> Self {
9536 Self(RequestBuilder::new(stub))
9537 }
9538
9539 pub fn with_request<V: Into<crate::model::CreateDataProductRequest>>(
9541 mut self,
9542 v: V,
9543 ) -> Self {
9544 self.0.request = v.into();
9545 self
9546 }
9547
9548 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9550 self.0.options = v.into();
9551 self
9552 }
9553
9554 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9561 (*self.0.stub)
9562 .create_data_product(self.0.request, self.0.options)
9563 .await
9564 .map(crate::Response::into_body)
9565 }
9566
9567 pub fn poller(
9569 self,
9570 ) -> impl google_cloud_lro::Poller<crate::model::DataProduct, crate::model::OperationMetadata>
9571 {
9572 type Operation = google_cloud_lro::internal::Operation<
9573 crate::model::DataProduct,
9574 crate::model::OperationMetadata,
9575 >;
9576 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9577 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9578
9579 let stub = self.0.stub.clone();
9580 let mut options = self.0.options.clone();
9581 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9582 let query = move |name| {
9583 let stub = stub.clone();
9584 let options = options.clone();
9585 async {
9586 let op = GetOperation::new(stub)
9587 .set_name(name)
9588 .with_options(options)
9589 .send()
9590 .await?;
9591 Ok(Operation::new(op))
9592 }
9593 };
9594
9595 let start = move || async {
9596 let op = self.send().await?;
9597 Ok(Operation::new(op))
9598 };
9599
9600 google_cloud_lro::internal::new_poller(
9601 polling_error_policy,
9602 polling_backoff_policy,
9603 start,
9604 query,
9605 )
9606 }
9607
9608 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9612 self.0.request.parent = v.into();
9613 self
9614 }
9615
9616 pub fn set_data_product_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9618 self.0.request.data_product_id = v.into();
9619 self
9620 }
9621
9622 pub fn set_data_product<T>(mut self, v: T) -> Self
9626 where
9627 T: std::convert::Into<crate::model::DataProduct>,
9628 {
9629 self.0.request.data_product = std::option::Option::Some(v.into());
9630 self
9631 }
9632
9633 pub fn set_or_clear_data_product<T>(mut self, v: std::option::Option<T>) -> Self
9637 where
9638 T: std::convert::Into<crate::model::DataProduct>,
9639 {
9640 self.0.request.data_product = v.map(|x| x.into());
9641 self
9642 }
9643
9644 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9646 self.0.request.validate_only = v.into();
9647 self
9648 }
9649 }
9650
9651 #[doc(hidden)]
9652 impl crate::RequestBuilder for CreateDataProduct {
9653 fn request_options(&mut self) -> &mut crate::RequestOptions {
9654 &mut self.0.options
9655 }
9656 }
9657
9658 #[derive(Clone, Debug)]
9676 pub struct DeleteDataProduct(RequestBuilder<crate::model::DeleteDataProductRequest>);
9677
9678 impl DeleteDataProduct {
9679 pub(crate) fn new(
9680 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9681 ) -> Self {
9682 Self(RequestBuilder::new(stub))
9683 }
9684
9685 pub fn with_request<V: Into<crate::model::DeleteDataProductRequest>>(
9687 mut self,
9688 v: V,
9689 ) -> Self {
9690 self.0.request = v.into();
9691 self
9692 }
9693
9694 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9696 self.0.options = v.into();
9697 self
9698 }
9699
9700 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9707 (*self.0.stub)
9708 .delete_data_product(self.0.request, self.0.options)
9709 .await
9710 .map(crate::Response::into_body)
9711 }
9712
9713 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9715 type Operation =
9716 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9717 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9718 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9719
9720 let stub = self.0.stub.clone();
9721 let mut options = self.0.options.clone();
9722 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9723 let query = move |name| {
9724 let stub = stub.clone();
9725 let options = options.clone();
9726 async {
9727 let op = GetOperation::new(stub)
9728 .set_name(name)
9729 .with_options(options)
9730 .send()
9731 .await?;
9732 Ok(Operation::new(op))
9733 }
9734 };
9735
9736 let start = move || async {
9737 let op = self.send().await?;
9738 Ok(Operation::new(op))
9739 };
9740
9741 google_cloud_lro::internal::new_unit_response_poller(
9742 polling_error_policy,
9743 polling_backoff_policy,
9744 start,
9745 query,
9746 )
9747 }
9748
9749 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9753 self.0.request.name = v.into();
9754 self
9755 }
9756
9757 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
9759 self.0.request.etag = v.into();
9760 self
9761 }
9762
9763 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9765 self.0.request.validate_only = v.into();
9766 self
9767 }
9768 }
9769
9770 #[doc(hidden)]
9771 impl crate::RequestBuilder for DeleteDataProduct {
9772 fn request_options(&mut self) -> &mut crate::RequestOptions {
9773 &mut self.0.options
9774 }
9775 }
9776
9777 #[derive(Clone, Debug)]
9794 pub struct GetDataProduct(RequestBuilder<crate::model::GetDataProductRequest>);
9795
9796 impl GetDataProduct {
9797 pub(crate) fn new(
9798 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9799 ) -> Self {
9800 Self(RequestBuilder::new(stub))
9801 }
9802
9803 pub fn with_request<V: Into<crate::model::GetDataProductRequest>>(mut self, v: V) -> Self {
9805 self.0.request = v.into();
9806 self
9807 }
9808
9809 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9811 self.0.options = v.into();
9812 self
9813 }
9814
9815 pub async fn send(self) -> Result<crate::model::DataProduct> {
9817 (*self.0.stub)
9818 .get_data_product(self.0.request, self.0.options)
9819 .await
9820 .map(crate::Response::into_body)
9821 }
9822
9823 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9827 self.0.request.name = v.into();
9828 self
9829 }
9830 }
9831
9832 #[doc(hidden)]
9833 impl crate::RequestBuilder for GetDataProduct {
9834 fn request_options(&mut self) -> &mut crate::RequestOptions {
9835 &mut self.0.options
9836 }
9837 }
9838
9839 #[derive(Clone, Debug)]
9860 pub struct ListDataProducts(RequestBuilder<crate::model::ListDataProductsRequest>);
9861
9862 impl ListDataProducts {
9863 pub(crate) fn new(
9864 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9865 ) -> Self {
9866 Self(RequestBuilder::new(stub))
9867 }
9868
9869 pub fn with_request<V: Into<crate::model::ListDataProductsRequest>>(
9871 mut self,
9872 v: V,
9873 ) -> Self {
9874 self.0.request = v.into();
9875 self
9876 }
9877
9878 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9880 self.0.options = v.into();
9881 self
9882 }
9883
9884 pub async fn send(self) -> Result<crate::model::ListDataProductsResponse> {
9886 (*self.0.stub)
9887 .list_data_products(self.0.request, self.0.options)
9888 .await
9889 .map(crate::Response::into_body)
9890 }
9891
9892 pub fn by_page(
9894 self,
9895 ) -> impl google_cloud_gax::paginator::Paginator<
9896 crate::model::ListDataProductsResponse,
9897 crate::Error,
9898 > {
9899 use std::clone::Clone;
9900 let token = self.0.request.page_token.clone();
9901 let execute = move |token: String| {
9902 let mut builder = self.clone();
9903 builder.0.request = builder.0.request.set_page_token(token);
9904 builder.send()
9905 };
9906 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9907 }
9908
9909 pub fn by_item(
9911 self,
9912 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9913 crate::model::ListDataProductsResponse,
9914 crate::Error,
9915 > {
9916 use google_cloud_gax::paginator::Paginator;
9917 self.by_page().items()
9918 }
9919
9920 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9924 self.0.request.parent = v.into();
9925 self
9926 }
9927
9928 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9930 self.0.request.filter = v.into();
9931 self
9932 }
9933
9934 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9936 self.0.request.page_size = v.into();
9937 self
9938 }
9939
9940 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9942 self.0.request.page_token = v.into();
9943 self
9944 }
9945
9946 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9948 self.0.request.order_by = v.into();
9949 self
9950 }
9951 }
9952
9953 #[doc(hidden)]
9954 impl crate::RequestBuilder for ListDataProducts {
9955 fn request_options(&mut self) -> &mut crate::RequestOptions {
9956 &mut self.0.options
9957 }
9958 }
9959
9960 #[derive(Clone, Debug)]
9978 pub struct UpdateDataProduct(RequestBuilder<crate::model::UpdateDataProductRequest>);
9979
9980 impl UpdateDataProduct {
9981 pub(crate) fn new(
9982 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
9983 ) -> Self {
9984 Self(RequestBuilder::new(stub))
9985 }
9986
9987 pub fn with_request<V: Into<crate::model::UpdateDataProductRequest>>(
9989 mut self,
9990 v: V,
9991 ) -> Self {
9992 self.0.request = v.into();
9993 self
9994 }
9995
9996 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9998 self.0.options = v.into();
9999 self
10000 }
10001
10002 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10009 (*self.0.stub)
10010 .update_data_product(self.0.request, self.0.options)
10011 .await
10012 .map(crate::Response::into_body)
10013 }
10014
10015 pub fn poller(
10017 self,
10018 ) -> impl google_cloud_lro::Poller<crate::model::DataProduct, crate::model::OperationMetadata>
10019 {
10020 type Operation = google_cloud_lro::internal::Operation<
10021 crate::model::DataProduct,
10022 crate::model::OperationMetadata,
10023 >;
10024 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10025 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10026
10027 let stub = self.0.stub.clone();
10028 let mut options = self.0.options.clone();
10029 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10030 let query = move |name| {
10031 let stub = stub.clone();
10032 let options = options.clone();
10033 async {
10034 let op = GetOperation::new(stub)
10035 .set_name(name)
10036 .with_options(options)
10037 .send()
10038 .await?;
10039 Ok(Operation::new(op))
10040 }
10041 };
10042
10043 let start = move || async {
10044 let op = self.send().await?;
10045 Ok(Operation::new(op))
10046 };
10047
10048 google_cloud_lro::internal::new_poller(
10049 polling_error_policy,
10050 polling_backoff_policy,
10051 start,
10052 query,
10053 )
10054 }
10055
10056 pub fn set_data_product<T>(mut self, v: T) -> Self
10060 where
10061 T: std::convert::Into<crate::model::DataProduct>,
10062 {
10063 self.0.request.data_product = std::option::Option::Some(v.into());
10064 self
10065 }
10066
10067 pub fn set_or_clear_data_product<T>(mut self, v: std::option::Option<T>) -> Self
10071 where
10072 T: std::convert::Into<crate::model::DataProduct>,
10073 {
10074 self.0.request.data_product = v.map(|x| x.into());
10075 self
10076 }
10077
10078 pub fn set_update_mask<T>(mut self, v: T) -> Self
10080 where
10081 T: std::convert::Into<wkt::FieldMask>,
10082 {
10083 self.0.request.update_mask = std::option::Option::Some(v.into());
10084 self
10085 }
10086
10087 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10089 where
10090 T: std::convert::Into<wkt::FieldMask>,
10091 {
10092 self.0.request.update_mask = v.map(|x| x.into());
10093 self
10094 }
10095
10096 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10098 self.0.request.validate_only = v.into();
10099 self
10100 }
10101 }
10102
10103 #[doc(hidden)]
10104 impl crate::RequestBuilder for UpdateDataProduct {
10105 fn request_options(&mut self) -> &mut crate::RequestOptions {
10106 &mut self.0.options
10107 }
10108 }
10109
10110 #[derive(Clone, Debug)]
10127 pub struct RequestDataProductAccess(
10128 RequestBuilder<crate::model::RequestDataProductAccessRequest>,
10129 );
10130
10131 impl RequestDataProductAccess {
10132 pub(crate) fn new(
10133 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10134 ) -> Self {
10135 Self(RequestBuilder::new(stub))
10136 }
10137
10138 pub fn with_request<V: Into<crate::model::RequestDataProductAccessRequest>>(
10140 mut self,
10141 v: V,
10142 ) -> Self {
10143 self.0.request = v.into();
10144 self
10145 }
10146
10147 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10149 self.0.options = v.into();
10150 self
10151 }
10152
10153 pub async fn send(self) -> Result<crate::model::RequestDataProductAccessResponse> {
10155 (*self.0.stub)
10156 .request_data_product_access(self.0.request, self.0.options)
10157 .await
10158 .map(crate::Response::into_body)
10159 }
10160
10161 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10165 self.0.request.parent = v.into();
10166 self
10167 }
10168
10169 pub fn set_change_request<T>(mut self, v: T) -> Self
10173 where
10174 T: std::convert::Into<crate::model::ChangeRequest>,
10175 {
10176 self.0.request.change_request = std::option::Option::Some(v.into());
10177 self
10178 }
10179
10180 pub fn set_or_clear_change_request<T>(mut self, v: std::option::Option<T>) -> Self
10184 where
10185 T: std::convert::Into<crate::model::ChangeRequest>,
10186 {
10187 self.0.request.change_request = v.map(|x| x.into());
10188 self
10189 }
10190
10191 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10193 self.0.request.validate_only = v.into();
10194 self
10195 }
10196 }
10197
10198 #[doc(hidden)]
10199 impl crate::RequestBuilder for RequestDataProductAccess {
10200 fn request_options(&mut self) -> &mut crate::RequestOptions {
10201 &mut self.0.options
10202 }
10203 }
10204
10205 #[derive(Clone, Debug)]
10223 pub struct CreateDataAsset(RequestBuilder<crate::model::CreateDataAssetRequest>);
10224
10225 impl CreateDataAsset {
10226 pub(crate) fn new(
10227 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10228 ) -> Self {
10229 Self(RequestBuilder::new(stub))
10230 }
10231
10232 pub fn with_request<V: Into<crate::model::CreateDataAssetRequest>>(mut self, v: V) -> Self {
10234 self.0.request = v.into();
10235 self
10236 }
10237
10238 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10240 self.0.options = v.into();
10241 self
10242 }
10243
10244 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10251 (*self.0.stub)
10252 .create_data_asset(self.0.request, self.0.options)
10253 .await
10254 .map(crate::Response::into_body)
10255 }
10256
10257 pub fn poller(
10259 self,
10260 ) -> impl google_cloud_lro::Poller<crate::model::DataAsset, crate::model::OperationMetadata>
10261 {
10262 type Operation = google_cloud_lro::internal::Operation<
10263 crate::model::DataAsset,
10264 crate::model::OperationMetadata,
10265 >;
10266 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10267 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10268
10269 let stub = self.0.stub.clone();
10270 let mut options = self.0.options.clone();
10271 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10272 let query = move |name| {
10273 let stub = stub.clone();
10274 let options = options.clone();
10275 async {
10276 let op = GetOperation::new(stub)
10277 .set_name(name)
10278 .with_options(options)
10279 .send()
10280 .await?;
10281 Ok(Operation::new(op))
10282 }
10283 };
10284
10285 let start = move || async {
10286 let op = self.send().await?;
10287 Ok(Operation::new(op))
10288 };
10289
10290 google_cloud_lro::internal::new_poller(
10291 polling_error_policy,
10292 polling_backoff_policy,
10293 start,
10294 query,
10295 )
10296 }
10297
10298 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10302 self.0.request.parent = v.into();
10303 self
10304 }
10305
10306 pub fn set_data_asset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10308 self.0.request.data_asset_id = v.into();
10309 self
10310 }
10311
10312 pub fn set_data_asset<T>(mut self, v: T) -> Self
10316 where
10317 T: std::convert::Into<crate::model::DataAsset>,
10318 {
10319 self.0.request.data_asset = std::option::Option::Some(v.into());
10320 self
10321 }
10322
10323 pub fn set_or_clear_data_asset<T>(mut self, v: std::option::Option<T>) -> Self
10327 where
10328 T: std::convert::Into<crate::model::DataAsset>,
10329 {
10330 self.0.request.data_asset = v.map(|x| x.into());
10331 self
10332 }
10333
10334 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10336 self.0.request.validate_only = v.into();
10337 self
10338 }
10339 }
10340
10341 #[doc(hidden)]
10342 impl crate::RequestBuilder for CreateDataAsset {
10343 fn request_options(&mut self) -> &mut crate::RequestOptions {
10344 &mut self.0.options
10345 }
10346 }
10347
10348 #[derive(Clone, Debug)]
10366 pub struct UpdateDataAsset(RequestBuilder<crate::model::UpdateDataAssetRequest>);
10367
10368 impl UpdateDataAsset {
10369 pub(crate) fn new(
10370 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10371 ) -> Self {
10372 Self(RequestBuilder::new(stub))
10373 }
10374
10375 pub fn with_request<V: Into<crate::model::UpdateDataAssetRequest>>(mut self, v: V) -> Self {
10377 self.0.request = v.into();
10378 self
10379 }
10380
10381 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10383 self.0.options = v.into();
10384 self
10385 }
10386
10387 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10394 (*self.0.stub)
10395 .update_data_asset(self.0.request, self.0.options)
10396 .await
10397 .map(crate::Response::into_body)
10398 }
10399
10400 pub fn poller(
10402 self,
10403 ) -> impl google_cloud_lro::Poller<crate::model::DataAsset, crate::model::OperationMetadata>
10404 {
10405 type Operation = google_cloud_lro::internal::Operation<
10406 crate::model::DataAsset,
10407 crate::model::OperationMetadata,
10408 >;
10409 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10410 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10411
10412 let stub = self.0.stub.clone();
10413 let mut options = self.0.options.clone();
10414 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10415 let query = move |name| {
10416 let stub = stub.clone();
10417 let options = options.clone();
10418 async {
10419 let op = GetOperation::new(stub)
10420 .set_name(name)
10421 .with_options(options)
10422 .send()
10423 .await?;
10424 Ok(Operation::new(op))
10425 }
10426 };
10427
10428 let start = move || async {
10429 let op = self.send().await?;
10430 Ok(Operation::new(op))
10431 };
10432
10433 google_cloud_lro::internal::new_poller(
10434 polling_error_policy,
10435 polling_backoff_policy,
10436 start,
10437 query,
10438 )
10439 }
10440
10441 pub fn set_data_asset<T>(mut self, v: T) -> Self
10445 where
10446 T: std::convert::Into<crate::model::DataAsset>,
10447 {
10448 self.0.request.data_asset = std::option::Option::Some(v.into());
10449 self
10450 }
10451
10452 pub fn set_or_clear_data_asset<T>(mut self, v: std::option::Option<T>) -> Self
10456 where
10457 T: std::convert::Into<crate::model::DataAsset>,
10458 {
10459 self.0.request.data_asset = v.map(|x| x.into());
10460 self
10461 }
10462
10463 pub fn set_update_mask<T>(mut self, v: T) -> Self
10465 where
10466 T: std::convert::Into<wkt::FieldMask>,
10467 {
10468 self.0.request.update_mask = std::option::Option::Some(v.into());
10469 self
10470 }
10471
10472 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10474 where
10475 T: std::convert::Into<wkt::FieldMask>,
10476 {
10477 self.0.request.update_mask = v.map(|x| x.into());
10478 self
10479 }
10480
10481 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10483 self.0.request.validate_only = v.into();
10484 self
10485 }
10486 }
10487
10488 #[doc(hidden)]
10489 impl crate::RequestBuilder for UpdateDataAsset {
10490 fn request_options(&mut self) -> &mut crate::RequestOptions {
10491 &mut self.0.options
10492 }
10493 }
10494
10495 #[derive(Clone, Debug)]
10513 pub struct DeleteDataAsset(RequestBuilder<crate::model::DeleteDataAssetRequest>);
10514
10515 impl DeleteDataAsset {
10516 pub(crate) fn new(
10517 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10518 ) -> Self {
10519 Self(RequestBuilder::new(stub))
10520 }
10521
10522 pub fn with_request<V: Into<crate::model::DeleteDataAssetRequest>>(mut self, v: V) -> Self {
10524 self.0.request = v.into();
10525 self
10526 }
10527
10528 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10530 self.0.options = v.into();
10531 self
10532 }
10533
10534 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10541 (*self.0.stub)
10542 .delete_data_asset(self.0.request, self.0.options)
10543 .await
10544 .map(crate::Response::into_body)
10545 }
10546
10547 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10549 type Operation =
10550 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10551 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10552 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10553
10554 let stub = self.0.stub.clone();
10555 let mut options = self.0.options.clone();
10556 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10557 let query = move |name| {
10558 let stub = stub.clone();
10559 let options = options.clone();
10560 async {
10561 let op = GetOperation::new(stub)
10562 .set_name(name)
10563 .with_options(options)
10564 .send()
10565 .await?;
10566 Ok(Operation::new(op))
10567 }
10568 };
10569
10570 let start = move || async {
10571 let op = self.send().await?;
10572 Ok(Operation::new(op))
10573 };
10574
10575 google_cloud_lro::internal::new_unit_response_poller(
10576 polling_error_policy,
10577 polling_backoff_policy,
10578 start,
10579 query,
10580 )
10581 }
10582
10583 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10587 self.0.request.name = v.into();
10588 self
10589 }
10590
10591 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
10593 self.0.request.etag = v.into();
10594 self
10595 }
10596
10597 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10599 self.0.request.validate_only = v.into();
10600 self
10601 }
10602 }
10603
10604 #[doc(hidden)]
10605 impl crate::RequestBuilder for DeleteDataAsset {
10606 fn request_options(&mut self) -> &mut crate::RequestOptions {
10607 &mut self.0.options
10608 }
10609 }
10610
10611 #[derive(Clone, Debug)]
10628 pub struct GetDataAsset(RequestBuilder<crate::model::GetDataAssetRequest>);
10629
10630 impl GetDataAsset {
10631 pub(crate) fn new(
10632 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10633 ) -> Self {
10634 Self(RequestBuilder::new(stub))
10635 }
10636
10637 pub fn with_request<V: Into<crate::model::GetDataAssetRequest>>(mut self, v: V) -> Self {
10639 self.0.request = v.into();
10640 self
10641 }
10642
10643 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10645 self.0.options = v.into();
10646 self
10647 }
10648
10649 pub async fn send(self) -> Result<crate::model::DataAsset> {
10651 (*self.0.stub)
10652 .get_data_asset(self.0.request, self.0.options)
10653 .await
10654 .map(crate::Response::into_body)
10655 }
10656
10657 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10661 self.0.request.name = v.into();
10662 self
10663 }
10664 }
10665
10666 #[doc(hidden)]
10667 impl crate::RequestBuilder for GetDataAsset {
10668 fn request_options(&mut self) -> &mut crate::RequestOptions {
10669 &mut self.0.options
10670 }
10671 }
10672
10673 #[derive(Clone, Debug)]
10694 pub struct ListDataAssets(RequestBuilder<crate::model::ListDataAssetsRequest>);
10695
10696 impl ListDataAssets {
10697 pub(crate) fn new(
10698 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10699 ) -> Self {
10700 Self(RequestBuilder::new(stub))
10701 }
10702
10703 pub fn with_request<V: Into<crate::model::ListDataAssetsRequest>>(mut self, v: V) -> Self {
10705 self.0.request = v.into();
10706 self
10707 }
10708
10709 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10711 self.0.options = v.into();
10712 self
10713 }
10714
10715 pub async fn send(self) -> Result<crate::model::ListDataAssetsResponse> {
10717 (*self.0.stub)
10718 .list_data_assets(self.0.request, self.0.options)
10719 .await
10720 .map(crate::Response::into_body)
10721 }
10722
10723 pub fn by_page(
10725 self,
10726 ) -> impl google_cloud_gax::paginator::Paginator<
10727 crate::model::ListDataAssetsResponse,
10728 crate::Error,
10729 > {
10730 use std::clone::Clone;
10731 let token = self.0.request.page_token.clone();
10732 let execute = move |token: String| {
10733 let mut builder = self.clone();
10734 builder.0.request = builder.0.request.set_page_token(token);
10735 builder.send()
10736 };
10737 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10738 }
10739
10740 pub fn by_item(
10742 self,
10743 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10744 crate::model::ListDataAssetsResponse,
10745 crate::Error,
10746 > {
10747 use google_cloud_gax::paginator::Paginator;
10748 self.by_page().items()
10749 }
10750
10751 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10755 self.0.request.parent = v.into();
10756 self
10757 }
10758
10759 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10761 self.0.request.filter = v.into();
10762 self
10763 }
10764
10765 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10767 self.0.request.order_by = v.into();
10768 self
10769 }
10770
10771 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10773 self.0.request.page_size = v.into();
10774 self
10775 }
10776
10777 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10779 self.0.request.page_token = v.into();
10780 self
10781 }
10782 }
10783
10784 #[doc(hidden)]
10785 impl crate::RequestBuilder for ListDataAssets {
10786 fn request_options(&mut self) -> &mut crate::RequestOptions {
10787 &mut self.0.options
10788 }
10789 }
10790
10791 #[derive(Clone, Debug)]
10812 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10813
10814 impl ListLocations {
10815 pub(crate) fn new(
10816 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10817 ) -> Self {
10818 Self(RequestBuilder::new(stub))
10819 }
10820
10821 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10823 mut self,
10824 v: V,
10825 ) -> Self {
10826 self.0.request = v.into();
10827 self
10828 }
10829
10830 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10832 self.0.options = v.into();
10833 self
10834 }
10835
10836 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10838 (*self.0.stub)
10839 .list_locations(self.0.request, self.0.options)
10840 .await
10841 .map(crate::Response::into_body)
10842 }
10843
10844 pub fn by_page(
10846 self,
10847 ) -> impl google_cloud_gax::paginator::Paginator<
10848 google_cloud_location::model::ListLocationsResponse,
10849 crate::Error,
10850 > {
10851 use std::clone::Clone;
10852 let token = self.0.request.page_token.clone();
10853 let execute = move |token: String| {
10854 let mut builder = self.clone();
10855 builder.0.request = builder.0.request.set_page_token(token);
10856 builder.send()
10857 };
10858 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10859 }
10860
10861 pub fn by_item(
10863 self,
10864 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10865 google_cloud_location::model::ListLocationsResponse,
10866 crate::Error,
10867 > {
10868 use google_cloud_gax::paginator::Paginator;
10869 self.by_page().items()
10870 }
10871
10872 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10874 self.0.request.name = v.into();
10875 self
10876 }
10877
10878 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10880 self.0.request.filter = v.into();
10881 self
10882 }
10883
10884 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10886 self.0.request.page_size = v.into();
10887 self
10888 }
10889
10890 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10892 self.0.request.page_token = v.into();
10893 self
10894 }
10895 }
10896
10897 #[doc(hidden)]
10898 impl crate::RequestBuilder for ListLocations {
10899 fn request_options(&mut self) -> &mut crate::RequestOptions {
10900 &mut self.0.options
10901 }
10902 }
10903
10904 #[derive(Clone, Debug)]
10921 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10922
10923 impl GetLocation {
10924 pub(crate) fn new(
10925 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10926 ) -> Self {
10927 Self(RequestBuilder::new(stub))
10928 }
10929
10930 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10932 mut self,
10933 v: V,
10934 ) -> Self {
10935 self.0.request = v.into();
10936 self
10937 }
10938
10939 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10941 self.0.options = v.into();
10942 self
10943 }
10944
10945 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10947 (*self.0.stub)
10948 .get_location(self.0.request, self.0.options)
10949 .await
10950 .map(crate::Response::into_body)
10951 }
10952
10953 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10955 self.0.request.name = v.into();
10956 self
10957 }
10958 }
10959
10960 #[doc(hidden)]
10961 impl crate::RequestBuilder for GetLocation {
10962 fn request_options(&mut self) -> &mut crate::RequestOptions {
10963 &mut self.0.options
10964 }
10965 }
10966
10967 #[derive(Clone, Debug)]
10984 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10985
10986 impl SetIamPolicy {
10987 pub(crate) fn new(
10988 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
10989 ) -> Self {
10990 Self(RequestBuilder::new(stub))
10991 }
10992
10993 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10995 mut self,
10996 v: V,
10997 ) -> Self {
10998 self.0.request = v.into();
10999 self
11000 }
11001
11002 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11004 self.0.options = v.into();
11005 self
11006 }
11007
11008 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
11010 (*self.0.stub)
11011 .set_iam_policy(self.0.request, self.0.options)
11012 .await
11013 .map(crate::Response::into_body)
11014 }
11015
11016 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11020 self.0.request.resource = v.into();
11021 self
11022 }
11023
11024 pub fn set_policy<T>(mut self, v: T) -> Self
11028 where
11029 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
11030 {
11031 self.0.request.policy = std::option::Option::Some(v.into());
11032 self
11033 }
11034
11035 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
11039 where
11040 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
11041 {
11042 self.0.request.policy = v.map(|x| x.into());
11043 self
11044 }
11045
11046 pub fn set_update_mask<T>(mut self, v: T) -> Self
11048 where
11049 T: std::convert::Into<wkt::FieldMask>,
11050 {
11051 self.0.request.update_mask = std::option::Option::Some(v.into());
11052 self
11053 }
11054
11055 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11057 where
11058 T: std::convert::Into<wkt::FieldMask>,
11059 {
11060 self.0.request.update_mask = v.map(|x| x.into());
11061 self
11062 }
11063 }
11064
11065 #[doc(hidden)]
11066 impl crate::RequestBuilder for SetIamPolicy {
11067 fn request_options(&mut self) -> &mut crate::RequestOptions {
11068 &mut self.0.options
11069 }
11070 }
11071
11072 #[derive(Clone, Debug)]
11089 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
11090
11091 impl GetIamPolicy {
11092 pub(crate) fn new(
11093 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11094 ) -> Self {
11095 Self(RequestBuilder::new(stub))
11096 }
11097
11098 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
11100 mut self,
11101 v: V,
11102 ) -> Self {
11103 self.0.request = v.into();
11104 self
11105 }
11106
11107 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11109 self.0.options = v.into();
11110 self
11111 }
11112
11113 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
11115 (*self.0.stub)
11116 .get_iam_policy(self.0.request, self.0.options)
11117 .await
11118 .map(crate::Response::into_body)
11119 }
11120
11121 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11125 self.0.request.resource = v.into();
11126 self
11127 }
11128
11129 pub fn set_options<T>(mut self, v: T) -> Self
11131 where
11132 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
11133 {
11134 self.0.request.options = std::option::Option::Some(v.into());
11135 self
11136 }
11137
11138 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
11140 where
11141 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
11142 {
11143 self.0.request.options = v.map(|x| x.into());
11144 self
11145 }
11146 }
11147
11148 #[doc(hidden)]
11149 impl crate::RequestBuilder for GetIamPolicy {
11150 fn request_options(&mut self) -> &mut crate::RequestOptions {
11151 &mut self.0.options
11152 }
11153 }
11154
11155 #[derive(Clone, Debug)]
11172 pub struct TestIamPermissions(
11173 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
11174 );
11175
11176 impl TestIamPermissions {
11177 pub(crate) fn new(
11178 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11179 ) -> Self {
11180 Self(RequestBuilder::new(stub))
11181 }
11182
11183 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
11185 mut self,
11186 v: V,
11187 ) -> Self {
11188 self.0.request = v.into();
11189 self
11190 }
11191
11192 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11194 self.0.options = v.into();
11195 self
11196 }
11197
11198 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
11200 (*self.0.stub)
11201 .test_iam_permissions(self.0.request, self.0.options)
11202 .await
11203 .map(crate::Response::into_body)
11204 }
11205
11206 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11210 self.0.request.resource = v.into();
11211 self
11212 }
11213
11214 pub fn set_permissions<T, V>(mut self, v: T) -> Self
11218 where
11219 T: std::iter::IntoIterator<Item = V>,
11220 V: std::convert::Into<std::string::String>,
11221 {
11222 use std::iter::Iterator;
11223 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
11224 self
11225 }
11226 }
11227
11228 #[doc(hidden)]
11229 impl crate::RequestBuilder for TestIamPermissions {
11230 fn request_options(&mut self) -> &mut crate::RequestOptions {
11231 &mut self.0.options
11232 }
11233 }
11234
11235 #[derive(Clone, Debug)]
11256 pub struct ListOperations(
11257 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11258 );
11259
11260 impl ListOperations {
11261 pub(crate) fn new(
11262 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11263 ) -> Self {
11264 Self(RequestBuilder::new(stub))
11265 }
11266
11267 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11269 mut self,
11270 v: V,
11271 ) -> Self {
11272 self.0.request = v.into();
11273 self
11274 }
11275
11276 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11278 self.0.options = v.into();
11279 self
11280 }
11281
11282 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11284 (*self.0.stub)
11285 .list_operations(self.0.request, self.0.options)
11286 .await
11287 .map(crate::Response::into_body)
11288 }
11289
11290 pub fn by_page(
11292 self,
11293 ) -> impl google_cloud_gax::paginator::Paginator<
11294 google_cloud_longrunning::model::ListOperationsResponse,
11295 crate::Error,
11296 > {
11297 use std::clone::Clone;
11298 let token = self.0.request.page_token.clone();
11299 let execute = move |token: String| {
11300 let mut builder = self.clone();
11301 builder.0.request = builder.0.request.set_page_token(token);
11302 builder.send()
11303 };
11304 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11305 }
11306
11307 pub fn by_item(
11309 self,
11310 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11311 google_cloud_longrunning::model::ListOperationsResponse,
11312 crate::Error,
11313 > {
11314 use google_cloud_gax::paginator::Paginator;
11315 self.by_page().items()
11316 }
11317
11318 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11320 self.0.request.name = v.into();
11321 self
11322 }
11323
11324 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11326 self.0.request.filter = v.into();
11327 self
11328 }
11329
11330 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11332 self.0.request.page_size = v.into();
11333 self
11334 }
11335
11336 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11338 self.0.request.page_token = v.into();
11339 self
11340 }
11341
11342 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11344 self.0.request.return_partial_success = v.into();
11345 self
11346 }
11347 }
11348
11349 #[doc(hidden)]
11350 impl crate::RequestBuilder for ListOperations {
11351 fn request_options(&mut self) -> &mut crate::RequestOptions {
11352 &mut self.0.options
11353 }
11354 }
11355
11356 #[derive(Clone, Debug)]
11373 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11374
11375 impl GetOperation {
11376 pub(crate) fn new(
11377 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11378 ) -> Self {
11379 Self(RequestBuilder::new(stub))
11380 }
11381
11382 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11384 mut self,
11385 v: V,
11386 ) -> Self {
11387 self.0.request = v.into();
11388 self
11389 }
11390
11391 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11393 self.0.options = v.into();
11394 self
11395 }
11396
11397 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11399 (*self.0.stub)
11400 .get_operation(self.0.request, self.0.options)
11401 .await
11402 .map(crate::Response::into_body)
11403 }
11404
11405 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11407 self.0.request.name = v.into();
11408 self
11409 }
11410 }
11411
11412 #[doc(hidden)]
11413 impl crate::RequestBuilder for GetOperation {
11414 fn request_options(&mut self) -> &mut crate::RequestOptions {
11415 &mut self.0.options
11416 }
11417 }
11418
11419 #[derive(Clone, Debug)]
11436 pub struct DeleteOperation(
11437 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11438 );
11439
11440 impl DeleteOperation {
11441 pub(crate) fn new(
11442 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11443 ) -> Self {
11444 Self(RequestBuilder::new(stub))
11445 }
11446
11447 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11449 mut self,
11450 v: V,
11451 ) -> Self {
11452 self.0.request = v.into();
11453 self
11454 }
11455
11456 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11458 self.0.options = v.into();
11459 self
11460 }
11461
11462 pub async fn send(self) -> Result<()> {
11464 (*self.0.stub)
11465 .delete_operation(self.0.request, self.0.options)
11466 .await
11467 .map(crate::Response::into_body)
11468 }
11469
11470 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11472 self.0.request.name = v.into();
11473 self
11474 }
11475 }
11476
11477 #[doc(hidden)]
11478 impl crate::RequestBuilder for DeleteOperation {
11479 fn request_options(&mut self) -> &mut crate::RequestOptions {
11480 &mut self.0.options
11481 }
11482 }
11483
11484 #[derive(Clone, Debug)]
11501 pub struct CancelOperation(
11502 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11503 );
11504
11505 impl CancelOperation {
11506 pub(crate) fn new(
11507 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataProductService>,
11508 ) -> Self {
11509 Self(RequestBuilder::new(stub))
11510 }
11511
11512 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11514 mut self,
11515 v: V,
11516 ) -> Self {
11517 self.0.request = v.into();
11518 self
11519 }
11520
11521 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11523 self.0.options = v.into();
11524 self
11525 }
11526
11527 pub async fn send(self) -> Result<()> {
11529 (*self.0.stub)
11530 .cancel_operation(self.0.request, self.0.options)
11531 .await
11532 .map(crate::Response::into_body)
11533 }
11534
11535 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11537 self.0.request.name = v.into();
11538 self
11539 }
11540 }
11541
11542 #[doc(hidden)]
11543 impl crate::RequestBuilder for CancelOperation {
11544 fn request_options(&mut self) -> &mut crate::RequestOptions {
11545 &mut self.0.options
11546 }
11547 }
11548}
11549
11550pub mod data_taxonomy_service {
11552 use crate::Result;
11553
11554 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11568
11569 pub(crate) mod client {
11570 use super::super::super::client::DataTaxonomyService;
11571 pub struct Factory;
11572 impl crate::ClientFactory for Factory {
11573 type Client = DataTaxonomyService;
11574 type Credentials = gaxi::options::Credentials;
11575 async fn build(
11576 self,
11577 config: gaxi::options::ClientConfig,
11578 ) -> crate::ClientBuilderResult<Self::Client> {
11579 Self::Client::new(config).await
11580 }
11581 }
11582 }
11583
11584 #[derive(Clone, Debug)]
11586 pub(crate) struct RequestBuilder<R: std::default::Default> {
11587 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11588 request: R,
11589 options: crate::RequestOptions,
11590 }
11591
11592 impl<R> RequestBuilder<R>
11593 where
11594 R: std::default::Default,
11595 {
11596 pub(crate) fn new(
11597 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11598 ) -> Self {
11599 Self {
11600 stub,
11601 request: R::default(),
11602 options: crate::RequestOptions::default(),
11603 }
11604 }
11605 }
11606
11607 #[derive(Clone, Debug)]
11625 pub struct CreateDataTaxonomy(RequestBuilder<crate::model::CreateDataTaxonomyRequest>);
11626
11627 impl CreateDataTaxonomy {
11628 pub(crate) fn new(
11629 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11630 ) -> Self {
11631 Self(RequestBuilder::new(stub))
11632 }
11633
11634 pub fn with_request<V: Into<crate::model::CreateDataTaxonomyRequest>>(
11636 mut self,
11637 v: V,
11638 ) -> Self {
11639 self.0.request = v.into();
11640 self
11641 }
11642
11643 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11645 self.0.options = v.into();
11646 self
11647 }
11648
11649 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11656 (*self.0.stub)
11657 .create_data_taxonomy(self.0.request, self.0.options)
11658 .await
11659 .map(crate::Response::into_body)
11660 }
11661
11662 pub fn poller(
11664 self,
11665 ) -> impl google_cloud_lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata>
11666 {
11667 type Operation = google_cloud_lro::internal::Operation<
11668 crate::model::DataTaxonomy,
11669 crate::model::OperationMetadata,
11670 >;
11671 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11672 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11673
11674 let stub = self.0.stub.clone();
11675 let mut options = self.0.options.clone();
11676 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11677 let query = move |name| {
11678 let stub = stub.clone();
11679 let options = options.clone();
11680 async {
11681 let op = GetOperation::new(stub)
11682 .set_name(name)
11683 .with_options(options)
11684 .send()
11685 .await?;
11686 Ok(Operation::new(op))
11687 }
11688 };
11689
11690 let start = move || async {
11691 let op = self.send().await?;
11692 Ok(Operation::new(op))
11693 };
11694
11695 google_cloud_lro::internal::new_poller(
11696 polling_error_policy,
11697 polling_backoff_policy,
11698 start,
11699 query,
11700 )
11701 }
11702
11703 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11707 self.0.request.parent = v.into();
11708 self
11709 }
11710
11711 pub fn set_data_taxonomy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11715 self.0.request.data_taxonomy_id = v.into();
11716 self
11717 }
11718
11719 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
11723 where
11724 T: std::convert::Into<crate::model::DataTaxonomy>,
11725 {
11726 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
11727 self
11728 }
11729
11730 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
11734 where
11735 T: std::convert::Into<crate::model::DataTaxonomy>,
11736 {
11737 self.0.request.data_taxonomy = v.map(|x| x.into());
11738 self
11739 }
11740
11741 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11743 self.0.request.validate_only = v.into();
11744 self
11745 }
11746 }
11747
11748 #[doc(hidden)]
11749 impl crate::RequestBuilder for CreateDataTaxonomy {
11750 fn request_options(&mut self) -> &mut crate::RequestOptions {
11751 &mut self.0.options
11752 }
11753 }
11754
11755 #[derive(Clone, Debug)]
11773 pub struct UpdateDataTaxonomy(RequestBuilder<crate::model::UpdateDataTaxonomyRequest>);
11774
11775 impl UpdateDataTaxonomy {
11776 pub(crate) fn new(
11777 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11778 ) -> Self {
11779 Self(RequestBuilder::new(stub))
11780 }
11781
11782 pub fn with_request<V: Into<crate::model::UpdateDataTaxonomyRequest>>(
11784 mut self,
11785 v: V,
11786 ) -> Self {
11787 self.0.request = v.into();
11788 self
11789 }
11790
11791 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11793 self.0.options = v.into();
11794 self
11795 }
11796
11797 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11804 (*self.0.stub)
11805 .update_data_taxonomy(self.0.request, self.0.options)
11806 .await
11807 .map(crate::Response::into_body)
11808 }
11809
11810 pub fn poller(
11812 self,
11813 ) -> impl google_cloud_lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata>
11814 {
11815 type Operation = google_cloud_lro::internal::Operation<
11816 crate::model::DataTaxonomy,
11817 crate::model::OperationMetadata,
11818 >;
11819 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11820 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11821
11822 let stub = self.0.stub.clone();
11823 let mut options = self.0.options.clone();
11824 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11825 let query = move |name| {
11826 let stub = stub.clone();
11827 let options = options.clone();
11828 async {
11829 let op = GetOperation::new(stub)
11830 .set_name(name)
11831 .with_options(options)
11832 .send()
11833 .await?;
11834 Ok(Operation::new(op))
11835 }
11836 };
11837
11838 let start = move || async {
11839 let op = self.send().await?;
11840 Ok(Operation::new(op))
11841 };
11842
11843 google_cloud_lro::internal::new_poller(
11844 polling_error_policy,
11845 polling_backoff_policy,
11846 start,
11847 query,
11848 )
11849 }
11850
11851 pub fn set_update_mask<T>(mut self, v: T) -> Self
11855 where
11856 T: std::convert::Into<wkt::FieldMask>,
11857 {
11858 self.0.request.update_mask = std::option::Option::Some(v.into());
11859 self
11860 }
11861
11862 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11866 where
11867 T: std::convert::Into<wkt::FieldMask>,
11868 {
11869 self.0.request.update_mask = v.map(|x| x.into());
11870 self
11871 }
11872
11873 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
11877 where
11878 T: std::convert::Into<crate::model::DataTaxonomy>,
11879 {
11880 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
11881 self
11882 }
11883
11884 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
11888 where
11889 T: std::convert::Into<crate::model::DataTaxonomy>,
11890 {
11891 self.0.request.data_taxonomy = v.map(|x| x.into());
11892 self
11893 }
11894
11895 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11897 self.0.request.validate_only = v.into();
11898 self
11899 }
11900 }
11901
11902 #[doc(hidden)]
11903 impl crate::RequestBuilder for UpdateDataTaxonomy {
11904 fn request_options(&mut self) -> &mut crate::RequestOptions {
11905 &mut self.0.options
11906 }
11907 }
11908
11909 #[derive(Clone, Debug)]
11927 pub struct DeleteDataTaxonomy(RequestBuilder<crate::model::DeleteDataTaxonomyRequest>);
11928
11929 impl DeleteDataTaxonomy {
11930 pub(crate) fn new(
11931 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11932 ) -> Self {
11933 Self(RequestBuilder::new(stub))
11934 }
11935
11936 pub fn with_request<V: Into<crate::model::DeleteDataTaxonomyRequest>>(
11938 mut self,
11939 v: V,
11940 ) -> Self {
11941 self.0.request = v.into();
11942 self
11943 }
11944
11945 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11947 self.0.options = v.into();
11948 self
11949 }
11950
11951 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11958 (*self.0.stub)
11959 .delete_data_taxonomy(self.0.request, self.0.options)
11960 .await
11961 .map(crate::Response::into_body)
11962 }
11963
11964 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11966 type Operation =
11967 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11968 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11969 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11970
11971 let stub = self.0.stub.clone();
11972 let mut options = self.0.options.clone();
11973 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11974 let query = move |name| {
11975 let stub = stub.clone();
11976 let options = options.clone();
11977 async {
11978 let op = GetOperation::new(stub)
11979 .set_name(name)
11980 .with_options(options)
11981 .send()
11982 .await?;
11983 Ok(Operation::new(op))
11984 }
11985 };
11986
11987 let start = move || async {
11988 let op = self.send().await?;
11989 Ok(Operation::new(op))
11990 };
11991
11992 google_cloud_lro::internal::new_unit_response_poller(
11993 polling_error_policy,
11994 polling_backoff_policy,
11995 start,
11996 query,
11997 )
11998 }
11999
12000 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12004 self.0.request.name = v.into();
12005 self
12006 }
12007
12008 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
12010 self.0.request.etag = v.into();
12011 self
12012 }
12013 }
12014
12015 #[doc(hidden)]
12016 impl crate::RequestBuilder for DeleteDataTaxonomy {
12017 fn request_options(&mut self) -> &mut crate::RequestOptions {
12018 &mut self.0.options
12019 }
12020 }
12021
12022 #[derive(Clone, Debug)]
12043 pub struct ListDataTaxonomies(RequestBuilder<crate::model::ListDataTaxonomiesRequest>);
12044
12045 impl ListDataTaxonomies {
12046 pub(crate) fn new(
12047 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12048 ) -> Self {
12049 Self(RequestBuilder::new(stub))
12050 }
12051
12052 pub fn with_request<V: Into<crate::model::ListDataTaxonomiesRequest>>(
12054 mut self,
12055 v: V,
12056 ) -> Self {
12057 self.0.request = v.into();
12058 self
12059 }
12060
12061 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12063 self.0.options = v.into();
12064 self
12065 }
12066
12067 pub async fn send(self) -> Result<crate::model::ListDataTaxonomiesResponse> {
12069 (*self.0.stub)
12070 .list_data_taxonomies(self.0.request, self.0.options)
12071 .await
12072 .map(crate::Response::into_body)
12073 }
12074
12075 pub fn by_page(
12077 self,
12078 ) -> impl google_cloud_gax::paginator::Paginator<
12079 crate::model::ListDataTaxonomiesResponse,
12080 crate::Error,
12081 > {
12082 use std::clone::Clone;
12083 let token = self.0.request.page_token.clone();
12084 let execute = move |token: String| {
12085 let mut builder = self.clone();
12086 builder.0.request = builder.0.request.set_page_token(token);
12087 builder.send()
12088 };
12089 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12090 }
12091
12092 pub fn by_item(
12094 self,
12095 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12096 crate::model::ListDataTaxonomiesResponse,
12097 crate::Error,
12098 > {
12099 use google_cloud_gax::paginator::Paginator;
12100 self.by_page().items()
12101 }
12102
12103 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12107 self.0.request.parent = v.into();
12108 self
12109 }
12110
12111 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12113 self.0.request.page_size = v.into();
12114 self
12115 }
12116
12117 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12119 self.0.request.page_token = v.into();
12120 self
12121 }
12122
12123 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12125 self.0.request.filter = v.into();
12126 self
12127 }
12128
12129 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12131 self.0.request.order_by = v.into();
12132 self
12133 }
12134 }
12135
12136 #[doc(hidden)]
12137 impl crate::RequestBuilder for ListDataTaxonomies {
12138 fn request_options(&mut self) -> &mut crate::RequestOptions {
12139 &mut self.0.options
12140 }
12141 }
12142
12143 #[derive(Clone, Debug)]
12160 pub struct GetDataTaxonomy(RequestBuilder<crate::model::GetDataTaxonomyRequest>);
12161
12162 impl GetDataTaxonomy {
12163 pub(crate) fn new(
12164 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12165 ) -> Self {
12166 Self(RequestBuilder::new(stub))
12167 }
12168
12169 pub fn with_request<V: Into<crate::model::GetDataTaxonomyRequest>>(mut self, v: V) -> 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<crate::model::DataTaxonomy> {
12183 (*self.0.stub)
12184 .get_data_taxonomy(self.0.request, self.0.options)
12185 .await
12186 .map(crate::Response::into_body)
12187 }
12188
12189 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12193 self.0.request.name = v.into();
12194 self
12195 }
12196 }
12197
12198 #[doc(hidden)]
12199 impl crate::RequestBuilder for GetDataTaxonomy {
12200 fn request_options(&mut self) -> &mut crate::RequestOptions {
12201 &mut self.0.options
12202 }
12203 }
12204
12205 #[derive(Clone, Debug)]
12223 pub struct CreateDataAttributeBinding(
12224 RequestBuilder<crate::model::CreateDataAttributeBindingRequest>,
12225 );
12226
12227 impl CreateDataAttributeBinding {
12228 pub(crate) fn new(
12229 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12230 ) -> Self {
12231 Self(RequestBuilder::new(stub))
12232 }
12233
12234 pub fn with_request<V: Into<crate::model::CreateDataAttributeBindingRequest>>(
12236 mut self,
12237 v: V,
12238 ) -> Self {
12239 self.0.request = v.into();
12240 self
12241 }
12242
12243 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12245 self.0.options = v.into();
12246 self
12247 }
12248
12249 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12256 (*self.0.stub)
12257 .create_data_attribute_binding(self.0.request, self.0.options)
12258 .await
12259 .map(crate::Response::into_body)
12260 }
12261
12262 pub fn poller(
12264 self,
12265 ) -> impl google_cloud_lro::Poller<
12266 crate::model::DataAttributeBinding,
12267 crate::model::OperationMetadata,
12268 > {
12269 type Operation = google_cloud_lro::internal::Operation<
12270 crate::model::DataAttributeBinding,
12271 crate::model::OperationMetadata,
12272 >;
12273 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12274 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12275
12276 let stub = self.0.stub.clone();
12277 let mut options = self.0.options.clone();
12278 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12279 let query = move |name| {
12280 let stub = stub.clone();
12281 let options = options.clone();
12282 async {
12283 let op = GetOperation::new(stub)
12284 .set_name(name)
12285 .with_options(options)
12286 .send()
12287 .await?;
12288 Ok(Operation::new(op))
12289 }
12290 };
12291
12292 let start = move || async {
12293 let op = self.send().await?;
12294 Ok(Operation::new(op))
12295 };
12296
12297 google_cloud_lro::internal::new_poller(
12298 polling_error_policy,
12299 polling_backoff_policy,
12300 start,
12301 query,
12302 )
12303 }
12304
12305 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12309 self.0.request.parent = v.into();
12310 self
12311 }
12312
12313 pub fn set_data_attribute_binding_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12317 self.0.request.data_attribute_binding_id = v.into();
12318 self
12319 }
12320
12321 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
12325 where
12326 T: std::convert::Into<crate::model::DataAttributeBinding>,
12327 {
12328 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
12329 self
12330 }
12331
12332 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
12336 where
12337 T: std::convert::Into<crate::model::DataAttributeBinding>,
12338 {
12339 self.0.request.data_attribute_binding = v.map(|x| x.into());
12340 self
12341 }
12342
12343 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12345 self.0.request.validate_only = v.into();
12346 self
12347 }
12348 }
12349
12350 #[doc(hidden)]
12351 impl crate::RequestBuilder for CreateDataAttributeBinding {
12352 fn request_options(&mut self) -> &mut crate::RequestOptions {
12353 &mut self.0.options
12354 }
12355 }
12356
12357 #[derive(Clone, Debug)]
12375 pub struct UpdateDataAttributeBinding(
12376 RequestBuilder<crate::model::UpdateDataAttributeBindingRequest>,
12377 );
12378
12379 impl UpdateDataAttributeBinding {
12380 pub(crate) fn new(
12381 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12382 ) -> Self {
12383 Self(RequestBuilder::new(stub))
12384 }
12385
12386 pub fn with_request<V: Into<crate::model::UpdateDataAttributeBindingRequest>>(
12388 mut self,
12389 v: V,
12390 ) -> Self {
12391 self.0.request = v.into();
12392 self
12393 }
12394
12395 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12397 self.0.options = v.into();
12398 self
12399 }
12400
12401 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12408 (*self.0.stub)
12409 .update_data_attribute_binding(self.0.request, self.0.options)
12410 .await
12411 .map(crate::Response::into_body)
12412 }
12413
12414 pub fn poller(
12416 self,
12417 ) -> impl google_cloud_lro::Poller<
12418 crate::model::DataAttributeBinding,
12419 crate::model::OperationMetadata,
12420 > {
12421 type Operation = google_cloud_lro::internal::Operation<
12422 crate::model::DataAttributeBinding,
12423 crate::model::OperationMetadata,
12424 >;
12425 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12426 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12427
12428 let stub = self.0.stub.clone();
12429 let mut options = self.0.options.clone();
12430 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12431 let query = move |name| {
12432 let stub = stub.clone();
12433 let options = options.clone();
12434 async {
12435 let op = GetOperation::new(stub)
12436 .set_name(name)
12437 .with_options(options)
12438 .send()
12439 .await?;
12440 Ok(Operation::new(op))
12441 }
12442 };
12443
12444 let start = move || async {
12445 let op = self.send().await?;
12446 Ok(Operation::new(op))
12447 };
12448
12449 google_cloud_lro::internal::new_poller(
12450 polling_error_policy,
12451 polling_backoff_policy,
12452 start,
12453 query,
12454 )
12455 }
12456
12457 pub fn set_update_mask<T>(mut self, v: T) -> Self
12461 where
12462 T: std::convert::Into<wkt::FieldMask>,
12463 {
12464 self.0.request.update_mask = std::option::Option::Some(v.into());
12465 self
12466 }
12467
12468 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12472 where
12473 T: std::convert::Into<wkt::FieldMask>,
12474 {
12475 self.0.request.update_mask = v.map(|x| x.into());
12476 self
12477 }
12478
12479 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
12483 where
12484 T: std::convert::Into<crate::model::DataAttributeBinding>,
12485 {
12486 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
12487 self
12488 }
12489
12490 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
12494 where
12495 T: std::convert::Into<crate::model::DataAttributeBinding>,
12496 {
12497 self.0.request.data_attribute_binding = v.map(|x| x.into());
12498 self
12499 }
12500
12501 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12503 self.0.request.validate_only = v.into();
12504 self
12505 }
12506 }
12507
12508 #[doc(hidden)]
12509 impl crate::RequestBuilder for UpdateDataAttributeBinding {
12510 fn request_options(&mut self) -> &mut crate::RequestOptions {
12511 &mut self.0.options
12512 }
12513 }
12514
12515 #[derive(Clone, Debug)]
12533 pub struct DeleteDataAttributeBinding(
12534 RequestBuilder<crate::model::DeleteDataAttributeBindingRequest>,
12535 );
12536
12537 impl DeleteDataAttributeBinding {
12538 pub(crate) fn new(
12539 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12540 ) -> Self {
12541 Self(RequestBuilder::new(stub))
12542 }
12543
12544 pub fn with_request<V: Into<crate::model::DeleteDataAttributeBindingRequest>>(
12546 mut self,
12547 v: V,
12548 ) -> Self {
12549 self.0.request = v.into();
12550 self
12551 }
12552
12553 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12555 self.0.options = v.into();
12556 self
12557 }
12558
12559 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12566 (*self.0.stub)
12567 .delete_data_attribute_binding(self.0.request, self.0.options)
12568 .await
12569 .map(crate::Response::into_body)
12570 }
12571
12572 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
12574 type Operation =
12575 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12576 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12577 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12578
12579 let stub = self.0.stub.clone();
12580 let mut options = self.0.options.clone();
12581 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12582 let query = move |name| {
12583 let stub = stub.clone();
12584 let options = options.clone();
12585 async {
12586 let op = GetOperation::new(stub)
12587 .set_name(name)
12588 .with_options(options)
12589 .send()
12590 .await?;
12591 Ok(Operation::new(op))
12592 }
12593 };
12594
12595 let start = move || async {
12596 let op = self.send().await?;
12597 Ok(Operation::new(op))
12598 };
12599
12600 google_cloud_lro::internal::new_unit_response_poller(
12601 polling_error_policy,
12602 polling_backoff_policy,
12603 start,
12604 query,
12605 )
12606 }
12607
12608 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12612 self.0.request.name = v.into();
12613 self
12614 }
12615
12616 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
12620 self.0.request.etag = v.into();
12621 self
12622 }
12623 }
12624
12625 #[doc(hidden)]
12626 impl crate::RequestBuilder for DeleteDataAttributeBinding {
12627 fn request_options(&mut self) -> &mut crate::RequestOptions {
12628 &mut self.0.options
12629 }
12630 }
12631
12632 #[derive(Clone, Debug)]
12653 pub struct ListDataAttributeBindings(
12654 RequestBuilder<crate::model::ListDataAttributeBindingsRequest>,
12655 );
12656
12657 impl ListDataAttributeBindings {
12658 pub(crate) fn new(
12659 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12660 ) -> Self {
12661 Self(RequestBuilder::new(stub))
12662 }
12663
12664 pub fn with_request<V: Into<crate::model::ListDataAttributeBindingsRequest>>(
12666 mut self,
12667 v: V,
12668 ) -> Self {
12669 self.0.request = v.into();
12670 self
12671 }
12672
12673 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12675 self.0.options = v.into();
12676 self
12677 }
12678
12679 pub async fn send(self) -> Result<crate::model::ListDataAttributeBindingsResponse> {
12681 (*self.0.stub)
12682 .list_data_attribute_bindings(self.0.request, self.0.options)
12683 .await
12684 .map(crate::Response::into_body)
12685 }
12686
12687 pub fn by_page(
12689 self,
12690 ) -> impl google_cloud_gax::paginator::Paginator<
12691 crate::model::ListDataAttributeBindingsResponse,
12692 crate::Error,
12693 > {
12694 use std::clone::Clone;
12695 let token = self.0.request.page_token.clone();
12696 let execute = move |token: String| {
12697 let mut builder = self.clone();
12698 builder.0.request = builder.0.request.set_page_token(token);
12699 builder.send()
12700 };
12701 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12702 }
12703
12704 pub fn by_item(
12706 self,
12707 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12708 crate::model::ListDataAttributeBindingsResponse,
12709 crate::Error,
12710 > {
12711 use google_cloud_gax::paginator::Paginator;
12712 self.by_page().items()
12713 }
12714
12715 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12719 self.0.request.parent = v.into();
12720 self
12721 }
12722
12723 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12725 self.0.request.page_size = v.into();
12726 self
12727 }
12728
12729 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12731 self.0.request.page_token = v.into();
12732 self
12733 }
12734
12735 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12737 self.0.request.filter = v.into();
12738 self
12739 }
12740
12741 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12743 self.0.request.order_by = v.into();
12744 self
12745 }
12746 }
12747
12748 #[doc(hidden)]
12749 impl crate::RequestBuilder for ListDataAttributeBindings {
12750 fn request_options(&mut self) -> &mut crate::RequestOptions {
12751 &mut self.0.options
12752 }
12753 }
12754
12755 #[derive(Clone, Debug)]
12772 pub struct GetDataAttributeBinding(
12773 RequestBuilder<crate::model::GetDataAttributeBindingRequest>,
12774 );
12775
12776 impl GetDataAttributeBinding {
12777 pub(crate) fn new(
12778 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12779 ) -> Self {
12780 Self(RequestBuilder::new(stub))
12781 }
12782
12783 pub fn with_request<V: Into<crate::model::GetDataAttributeBindingRequest>>(
12785 mut self,
12786 v: V,
12787 ) -> Self {
12788 self.0.request = v.into();
12789 self
12790 }
12791
12792 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12794 self.0.options = v.into();
12795 self
12796 }
12797
12798 pub async fn send(self) -> Result<crate::model::DataAttributeBinding> {
12800 (*self.0.stub)
12801 .get_data_attribute_binding(self.0.request, self.0.options)
12802 .await
12803 .map(crate::Response::into_body)
12804 }
12805
12806 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12810 self.0.request.name = v.into();
12811 self
12812 }
12813 }
12814
12815 #[doc(hidden)]
12816 impl crate::RequestBuilder for GetDataAttributeBinding {
12817 fn request_options(&mut self) -> &mut crate::RequestOptions {
12818 &mut self.0.options
12819 }
12820 }
12821
12822 #[derive(Clone, Debug)]
12840 pub struct CreateDataAttribute(RequestBuilder<crate::model::CreateDataAttributeRequest>);
12841
12842 impl CreateDataAttribute {
12843 pub(crate) fn new(
12844 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12845 ) -> Self {
12846 Self(RequestBuilder::new(stub))
12847 }
12848
12849 pub fn with_request<V: Into<crate::model::CreateDataAttributeRequest>>(
12851 mut self,
12852 v: V,
12853 ) -> Self {
12854 self.0.request = v.into();
12855 self
12856 }
12857
12858 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12860 self.0.options = v.into();
12861 self
12862 }
12863
12864 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12871 (*self.0.stub)
12872 .create_data_attribute(self.0.request, self.0.options)
12873 .await
12874 .map(crate::Response::into_body)
12875 }
12876
12877 pub fn poller(
12879 self,
12880 ) -> impl google_cloud_lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
12881 {
12882 type Operation = google_cloud_lro::internal::Operation<
12883 crate::model::DataAttribute,
12884 crate::model::OperationMetadata,
12885 >;
12886 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12887 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12888
12889 let stub = self.0.stub.clone();
12890 let mut options = self.0.options.clone();
12891 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12892 let query = move |name| {
12893 let stub = stub.clone();
12894 let options = options.clone();
12895 async {
12896 let op = GetOperation::new(stub)
12897 .set_name(name)
12898 .with_options(options)
12899 .send()
12900 .await?;
12901 Ok(Operation::new(op))
12902 }
12903 };
12904
12905 let start = move || async {
12906 let op = self.send().await?;
12907 Ok(Operation::new(op))
12908 };
12909
12910 google_cloud_lro::internal::new_poller(
12911 polling_error_policy,
12912 polling_backoff_policy,
12913 start,
12914 query,
12915 )
12916 }
12917
12918 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12922 self.0.request.parent = v.into();
12923 self
12924 }
12925
12926 pub fn set_data_attribute_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12930 self.0.request.data_attribute_id = v.into();
12931 self
12932 }
12933
12934 pub fn set_data_attribute<T>(mut self, v: T) -> Self
12938 where
12939 T: std::convert::Into<crate::model::DataAttribute>,
12940 {
12941 self.0.request.data_attribute = std::option::Option::Some(v.into());
12942 self
12943 }
12944
12945 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
12949 where
12950 T: std::convert::Into<crate::model::DataAttribute>,
12951 {
12952 self.0.request.data_attribute = v.map(|x| x.into());
12953 self
12954 }
12955
12956 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12958 self.0.request.validate_only = v.into();
12959 self
12960 }
12961 }
12962
12963 #[doc(hidden)]
12964 impl crate::RequestBuilder for CreateDataAttribute {
12965 fn request_options(&mut self) -> &mut crate::RequestOptions {
12966 &mut self.0.options
12967 }
12968 }
12969
12970 #[derive(Clone, Debug)]
12988 pub struct UpdateDataAttribute(RequestBuilder<crate::model::UpdateDataAttributeRequest>);
12989
12990 impl UpdateDataAttribute {
12991 pub(crate) fn new(
12992 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
12993 ) -> Self {
12994 Self(RequestBuilder::new(stub))
12995 }
12996
12997 pub fn with_request<V: Into<crate::model::UpdateDataAttributeRequest>>(
12999 mut self,
13000 v: V,
13001 ) -> Self {
13002 self.0.request = v.into();
13003 self
13004 }
13005
13006 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13008 self.0.options = v.into();
13009 self
13010 }
13011
13012 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13019 (*self.0.stub)
13020 .update_data_attribute(self.0.request, self.0.options)
13021 .await
13022 .map(crate::Response::into_body)
13023 }
13024
13025 pub fn poller(
13027 self,
13028 ) -> impl google_cloud_lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
13029 {
13030 type Operation = google_cloud_lro::internal::Operation<
13031 crate::model::DataAttribute,
13032 crate::model::OperationMetadata,
13033 >;
13034 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13035 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13036
13037 let stub = self.0.stub.clone();
13038 let mut options = self.0.options.clone();
13039 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13040 let query = move |name| {
13041 let stub = stub.clone();
13042 let options = options.clone();
13043 async {
13044 let op = GetOperation::new(stub)
13045 .set_name(name)
13046 .with_options(options)
13047 .send()
13048 .await?;
13049 Ok(Operation::new(op))
13050 }
13051 };
13052
13053 let start = move || async {
13054 let op = self.send().await?;
13055 Ok(Operation::new(op))
13056 };
13057
13058 google_cloud_lro::internal::new_poller(
13059 polling_error_policy,
13060 polling_backoff_policy,
13061 start,
13062 query,
13063 )
13064 }
13065
13066 pub fn set_update_mask<T>(mut self, v: T) -> Self
13070 where
13071 T: std::convert::Into<wkt::FieldMask>,
13072 {
13073 self.0.request.update_mask = std::option::Option::Some(v.into());
13074 self
13075 }
13076
13077 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13081 where
13082 T: std::convert::Into<wkt::FieldMask>,
13083 {
13084 self.0.request.update_mask = v.map(|x| x.into());
13085 self
13086 }
13087
13088 pub fn set_data_attribute<T>(mut self, v: T) -> Self
13092 where
13093 T: std::convert::Into<crate::model::DataAttribute>,
13094 {
13095 self.0.request.data_attribute = std::option::Option::Some(v.into());
13096 self
13097 }
13098
13099 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
13103 where
13104 T: std::convert::Into<crate::model::DataAttribute>,
13105 {
13106 self.0.request.data_attribute = v.map(|x| x.into());
13107 self
13108 }
13109
13110 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13112 self.0.request.validate_only = v.into();
13113 self
13114 }
13115 }
13116
13117 #[doc(hidden)]
13118 impl crate::RequestBuilder for UpdateDataAttribute {
13119 fn request_options(&mut self) -> &mut crate::RequestOptions {
13120 &mut self.0.options
13121 }
13122 }
13123
13124 #[derive(Clone, Debug)]
13142 pub struct DeleteDataAttribute(RequestBuilder<crate::model::DeleteDataAttributeRequest>);
13143
13144 impl DeleteDataAttribute {
13145 pub(crate) fn new(
13146 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13147 ) -> Self {
13148 Self(RequestBuilder::new(stub))
13149 }
13150
13151 pub fn with_request<V: Into<crate::model::DeleteDataAttributeRequest>>(
13153 mut self,
13154 v: V,
13155 ) -> Self {
13156 self.0.request = v.into();
13157 self
13158 }
13159
13160 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13162 self.0.options = v.into();
13163 self
13164 }
13165
13166 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13173 (*self.0.stub)
13174 .delete_data_attribute(self.0.request, self.0.options)
13175 .await
13176 .map(crate::Response::into_body)
13177 }
13178
13179 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
13181 type Operation =
13182 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
13183 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13184 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13185
13186 let stub = self.0.stub.clone();
13187 let mut options = self.0.options.clone();
13188 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
13189 let query = move |name| {
13190 let stub = stub.clone();
13191 let options = options.clone();
13192 async {
13193 let op = GetOperation::new(stub)
13194 .set_name(name)
13195 .with_options(options)
13196 .send()
13197 .await?;
13198 Ok(Operation::new(op))
13199 }
13200 };
13201
13202 let start = move || async {
13203 let op = self.send().await?;
13204 Ok(Operation::new(op))
13205 };
13206
13207 google_cloud_lro::internal::new_unit_response_poller(
13208 polling_error_policy,
13209 polling_backoff_policy,
13210 start,
13211 query,
13212 )
13213 }
13214
13215 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13219 self.0.request.name = v.into();
13220 self
13221 }
13222
13223 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
13225 self.0.request.etag = v.into();
13226 self
13227 }
13228 }
13229
13230 #[doc(hidden)]
13231 impl crate::RequestBuilder for DeleteDataAttribute {
13232 fn request_options(&mut self) -> &mut crate::RequestOptions {
13233 &mut self.0.options
13234 }
13235 }
13236
13237 #[derive(Clone, Debug)]
13258 pub struct ListDataAttributes(RequestBuilder<crate::model::ListDataAttributesRequest>);
13259
13260 impl ListDataAttributes {
13261 pub(crate) fn new(
13262 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13263 ) -> Self {
13264 Self(RequestBuilder::new(stub))
13265 }
13266
13267 pub fn with_request<V: Into<crate::model::ListDataAttributesRequest>>(
13269 mut self,
13270 v: V,
13271 ) -> Self {
13272 self.0.request = v.into();
13273 self
13274 }
13275
13276 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13278 self.0.options = v.into();
13279 self
13280 }
13281
13282 pub async fn send(self) -> Result<crate::model::ListDataAttributesResponse> {
13284 (*self.0.stub)
13285 .list_data_attributes(self.0.request, self.0.options)
13286 .await
13287 .map(crate::Response::into_body)
13288 }
13289
13290 pub fn by_page(
13292 self,
13293 ) -> impl google_cloud_gax::paginator::Paginator<
13294 crate::model::ListDataAttributesResponse,
13295 crate::Error,
13296 > {
13297 use std::clone::Clone;
13298 let token = self.0.request.page_token.clone();
13299 let execute = move |token: String| {
13300 let mut builder = self.clone();
13301 builder.0.request = builder.0.request.set_page_token(token);
13302 builder.send()
13303 };
13304 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13305 }
13306
13307 pub fn by_item(
13309 self,
13310 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13311 crate::model::ListDataAttributesResponse,
13312 crate::Error,
13313 > {
13314 use google_cloud_gax::paginator::Paginator;
13315 self.by_page().items()
13316 }
13317
13318 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13322 self.0.request.parent = v.into();
13323 self
13324 }
13325
13326 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13328 self.0.request.page_size = v.into();
13329 self
13330 }
13331
13332 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13334 self.0.request.page_token = v.into();
13335 self
13336 }
13337
13338 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13340 self.0.request.filter = v.into();
13341 self
13342 }
13343
13344 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
13346 self.0.request.order_by = v.into();
13347 self
13348 }
13349 }
13350
13351 #[doc(hidden)]
13352 impl crate::RequestBuilder for ListDataAttributes {
13353 fn request_options(&mut self) -> &mut crate::RequestOptions {
13354 &mut self.0.options
13355 }
13356 }
13357
13358 #[derive(Clone, Debug)]
13375 pub struct GetDataAttribute(RequestBuilder<crate::model::GetDataAttributeRequest>);
13376
13377 impl GetDataAttribute {
13378 pub(crate) fn new(
13379 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13380 ) -> Self {
13381 Self(RequestBuilder::new(stub))
13382 }
13383
13384 pub fn with_request<V: Into<crate::model::GetDataAttributeRequest>>(
13386 mut self,
13387 v: V,
13388 ) -> Self {
13389 self.0.request = v.into();
13390 self
13391 }
13392
13393 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13395 self.0.options = v.into();
13396 self
13397 }
13398
13399 pub async fn send(self) -> Result<crate::model::DataAttribute> {
13401 (*self.0.stub)
13402 .get_data_attribute(self.0.request, self.0.options)
13403 .await
13404 .map(crate::Response::into_body)
13405 }
13406
13407 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13411 self.0.request.name = v.into();
13412 self
13413 }
13414 }
13415
13416 #[doc(hidden)]
13417 impl crate::RequestBuilder for GetDataAttribute {
13418 fn request_options(&mut self) -> &mut crate::RequestOptions {
13419 &mut self.0.options
13420 }
13421 }
13422
13423 #[derive(Clone, Debug)]
13444 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13445
13446 impl ListLocations {
13447 pub(crate) fn new(
13448 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13449 ) -> Self {
13450 Self(RequestBuilder::new(stub))
13451 }
13452
13453 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13455 mut self,
13456 v: V,
13457 ) -> Self {
13458 self.0.request = v.into();
13459 self
13460 }
13461
13462 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13464 self.0.options = v.into();
13465 self
13466 }
13467
13468 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13470 (*self.0.stub)
13471 .list_locations(self.0.request, self.0.options)
13472 .await
13473 .map(crate::Response::into_body)
13474 }
13475
13476 pub fn by_page(
13478 self,
13479 ) -> impl google_cloud_gax::paginator::Paginator<
13480 google_cloud_location::model::ListLocationsResponse,
13481 crate::Error,
13482 > {
13483 use std::clone::Clone;
13484 let token = self.0.request.page_token.clone();
13485 let execute = move |token: String| {
13486 let mut builder = self.clone();
13487 builder.0.request = builder.0.request.set_page_token(token);
13488 builder.send()
13489 };
13490 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13491 }
13492
13493 pub fn by_item(
13495 self,
13496 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13497 google_cloud_location::model::ListLocationsResponse,
13498 crate::Error,
13499 > {
13500 use google_cloud_gax::paginator::Paginator;
13501 self.by_page().items()
13502 }
13503
13504 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13506 self.0.request.name = v.into();
13507 self
13508 }
13509
13510 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13512 self.0.request.filter = v.into();
13513 self
13514 }
13515
13516 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13518 self.0.request.page_size = v.into();
13519 self
13520 }
13521
13522 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13524 self.0.request.page_token = v.into();
13525 self
13526 }
13527 }
13528
13529 #[doc(hidden)]
13530 impl crate::RequestBuilder for ListLocations {
13531 fn request_options(&mut self) -> &mut crate::RequestOptions {
13532 &mut self.0.options
13533 }
13534 }
13535
13536 #[derive(Clone, Debug)]
13553 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13554
13555 impl GetLocation {
13556 pub(crate) fn new(
13557 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13558 ) -> Self {
13559 Self(RequestBuilder::new(stub))
13560 }
13561
13562 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13564 mut self,
13565 v: V,
13566 ) -> Self {
13567 self.0.request = v.into();
13568 self
13569 }
13570
13571 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13573 self.0.options = v.into();
13574 self
13575 }
13576
13577 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13579 (*self.0.stub)
13580 .get_location(self.0.request, self.0.options)
13581 .await
13582 .map(crate::Response::into_body)
13583 }
13584
13585 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13587 self.0.request.name = v.into();
13588 self
13589 }
13590 }
13591
13592 #[doc(hidden)]
13593 impl crate::RequestBuilder for GetLocation {
13594 fn request_options(&mut self) -> &mut crate::RequestOptions {
13595 &mut self.0.options
13596 }
13597 }
13598
13599 #[derive(Clone, Debug)]
13616 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
13617
13618 impl SetIamPolicy {
13619 pub(crate) fn new(
13620 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13621 ) -> Self {
13622 Self(RequestBuilder::new(stub))
13623 }
13624
13625 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
13627 mut self,
13628 v: V,
13629 ) -> Self {
13630 self.0.request = v.into();
13631 self
13632 }
13633
13634 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13636 self.0.options = v.into();
13637 self
13638 }
13639
13640 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13642 (*self.0.stub)
13643 .set_iam_policy(self.0.request, self.0.options)
13644 .await
13645 .map(crate::Response::into_body)
13646 }
13647
13648 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13652 self.0.request.resource = v.into();
13653 self
13654 }
13655
13656 pub fn set_policy<T>(mut self, v: T) -> Self
13660 where
13661 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13662 {
13663 self.0.request.policy = std::option::Option::Some(v.into());
13664 self
13665 }
13666
13667 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
13671 where
13672 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
13673 {
13674 self.0.request.policy = v.map(|x| x.into());
13675 self
13676 }
13677
13678 pub fn set_update_mask<T>(mut self, v: T) -> Self
13680 where
13681 T: std::convert::Into<wkt::FieldMask>,
13682 {
13683 self.0.request.update_mask = std::option::Option::Some(v.into());
13684 self
13685 }
13686
13687 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13689 where
13690 T: std::convert::Into<wkt::FieldMask>,
13691 {
13692 self.0.request.update_mask = v.map(|x| x.into());
13693 self
13694 }
13695 }
13696
13697 #[doc(hidden)]
13698 impl crate::RequestBuilder for SetIamPolicy {
13699 fn request_options(&mut self) -> &mut crate::RequestOptions {
13700 &mut self.0.options
13701 }
13702 }
13703
13704 #[derive(Clone, Debug)]
13721 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
13722
13723 impl GetIamPolicy {
13724 pub(crate) fn new(
13725 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13726 ) -> Self {
13727 Self(RequestBuilder::new(stub))
13728 }
13729
13730 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
13732 mut self,
13733 v: V,
13734 ) -> Self {
13735 self.0.request = v.into();
13736 self
13737 }
13738
13739 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13741 self.0.options = v.into();
13742 self
13743 }
13744
13745 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
13747 (*self.0.stub)
13748 .get_iam_policy(self.0.request, self.0.options)
13749 .await
13750 .map(crate::Response::into_body)
13751 }
13752
13753 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13757 self.0.request.resource = v.into();
13758 self
13759 }
13760
13761 pub fn set_options<T>(mut self, v: T) -> Self
13763 where
13764 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13765 {
13766 self.0.request.options = std::option::Option::Some(v.into());
13767 self
13768 }
13769
13770 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
13772 where
13773 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
13774 {
13775 self.0.request.options = v.map(|x| x.into());
13776 self
13777 }
13778 }
13779
13780 #[doc(hidden)]
13781 impl crate::RequestBuilder for GetIamPolicy {
13782 fn request_options(&mut self) -> &mut crate::RequestOptions {
13783 &mut self.0.options
13784 }
13785 }
13786
13787 #[derive(Clone, Debug)]
13804 pub struct TestIamPermissions(
13805 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
13806 );
13807
13808 impl TestIamPermissions {
13809 pub(crate) fn new(
13810 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13811 ) -> Self {
13812 Self(RequestBuilder::new(stub))
13813 }
13814
13815 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
13817 mut self,
13818 v: V,
13819 ) -> Self {
13820 self.0.request = v.into();
13821 self
13822 }
13823
13824 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13826 self.0.options = v.into();
13827 self
13828 }
13829
13830 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
13832 (*self.0.stub)
13833 .test_iam_permissions(self.0.request, self.0.options)
13834 .await
13835 .map(crate::Response::into_body)
13836 }
13837
13838 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13842 self.0.request.resource = v.into();
13843 self
13844 }
13845
13846 pub fn set_permissions<T, V>(mut self, v: T) -> Self
13850 where
13851 T: std::iter::IntoIterator<Item = V>,
13852 V: std::convert::Into<std::string::String>,
13853 {
13854 use std::iter::Iterator;
13855 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
13856 self
13857 }
13858 }
13859
13860 #[doc(hidden)]
13861 impl crate::RequestBuilder for TestIamPermissions {
13862 fn request_options(&mut self) -> &mut crate::RequestOptions {
13863 &mut self.0.options
13864 }
13865 }
13866
13867 #[derive(Clone, Debug)]
13888 pub struct ListOperations(
13889 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13890 );
13891
13892 impl ListOperations {
13893 pub(crate) fn new(
13894 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
13895 ) -> Self {
13896 Self(RequestBuilder::new(stub))
13897 }
13898
13899 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13901 mut self,
13902 v: V,
13903 ) -> Self {
13904 self.0.request = v.into();
13905 self
13906 }
13907
13908 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13910 self.0.options = v.into();
13911 self
13912 }
13913
13914 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13916 (*self.0.stub)
13917 .list_operations(self.0.request, self.0.options)
13918 .await
13919 .map(crate::Response::into_body)
13920 }
13921
13922 pub fn by_page(
13924 self,
13925 ) -> impl google_cloud_gax::paginator::Paginator<
13926 google_cloud_longrunning::model::ListOperationsResponse,
13927 crate::Error,
13928 > {
13929 use std::clone::Clone;
13930 let token = self.0.request.page_token.clone();
13931 let execute = move |token: String| {
13932 let mut builder = self.clone();
13933 builder.0.request = builder.0.request.set_page_token(token);
13934 builder.send()
13935 };
13936 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13937 }
13938
13939 pub fn by_item(
13941 self,
13942 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13943 google_cloud_longrunning::model::ListOperationsResponse,
13944 crate::Error,
13945 > {
13946 use google_cloud_gax::paginator::Paginator;
13947 self.by_page().items()
13948 }
13949
13950 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13952 self.0.request.name = v.into();
13953 self
13954 }
13955
13956 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13958 self.0.request.filter = v.into();
13959 self
13960 }
13961
13962 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13964 self.0.request.page_size = v.into();
13965 self
13966 }
13967
13968 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13970 self.0.request.page_token = v.into();
13971 self
13972 }
13973
13974 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13976 self.0.request.return_partial_success = v.into();
13977 self
13978 }
13979 }
13980
13981 #[doc(hidden)]
13982 impl crate::RequestBuilder for ListOperations {
13983 fn request_options(&mut self) -> &mut crate::RequestOptions {
13984 &mut self.0.options
13985 }
13986 }
13987
13988 #[derive(Clone, Debug)]
14005 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14006
14007 impl GetOperation {
14008 pub(crate) fn new(
14009 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
14010 ) -> Self {
14011 Self(RequestBuilder::new(stub))
14012 }
14013
14014 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14016 mut self,
14017 v: V,
14018 ) -> Self {
14019 self.0.request = v.into();
14020 self
14021 }
14022
14023 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14025 self.0.options = v.into();
14026 self
14027 }
14028
14029 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14031 (*self.0.stub)
14032 .get_operation(self.0.request, self.0.options)
14033 .await
14034 .map(crate::Response::into_body)
14035 }
14036
14037 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14039 self.0.request.name = v.into();
14040 self
14041 }
14042 }
14043
14044 #[doc(hidden)]
14045 impl crate::RequestBuilder for GetOperation {
14046 fn request_options(&mut self) -> &mut crate::RequestOptions {
14047 &mut self.0.options
14048 }
14049 }
14050
14051 #[derive(Clone, Debug)]
14068 pub struct DeleteOperation(
14069 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
14070 );
14071
14072 impl DeleteOperation {
14073 pub(crate) fn new(
14074 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
14075 ) -> Self {
14076 Self(RequestBuilder::new(stub))
14077 }
14078
14079 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
14081 mut self,
14082 v: V,
14083 ) -> Self {
14084 self.0.request = v.into();
14085 self
14086 }
14087
14088 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14090 self.0.options = v.into();
14091 self
14092 }
14093
14094 pub async fn send(self) -> Result<()> {
14096 (*self.0.stub)
14097 .delete_operation(self.0.request, self.0.options)
14098 .await
14099 .map(crate::Response::into_body)
14100 }
14101
14102 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14104 self.0.request.name = v.into();
14105 self
14106 }
14107 }
14108
14109 #[doc(hidden)]
14110 impl crate::RequestBuilder for DeleteOperation {
14111 fn request_options(&mut self) -> &mut crate::RequestOptions {
14112 &mut self.0.options
14113 }
14114 }
14115
14116 #[derive(Clone, Debug)]
14133 pub struct CancelOperation(
14134 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14135 );
14136
14137 impl CancelOperation {
14138 pub(crate) fn new(
14139 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
14140 ) -> Self {
14141 Self(RequestBuilder::new(stub))
14142 }
14143
14144 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14146 mut self,
14147 v: V,
14148 ) -> Self {
14149 self.0.request = v.into();
14150 self
14151 }
14152
14153 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14155 self.0.options = v.into();
14156 self
14157 }
14158
14159 pub async fn send(self) -> Result<()> {
14161 (*self.0.stub)
14162 .cancel_operation(self.0.request, self.0.options)
14163 .await
14164 .map(crate::Response::into_body)
14165 }
14166
14167 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14169 self.0.request.name = v.into();
14170 self
14171 }
14172 }
14173
14174 #[doc(hidden)]
14175 impl crate::RequestBuilder for CancelOperation {
14176 fn request_options(&mut self) -> &mut crate::RequestOptions {
14177 &mut self.0.options
14178 }
14179 }
14180}
14181
14182pub mod data_scan_service {
14184 use crate::Result;
14185
14186 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14200
14201 pub(crate) mod client {
14202 use super::super::super::client::DataScanService;
14203 pub struct Factory;
14204 impl crate::ClientFactory for Factory {
14205 type Client = DataScanService;
14206 type Credentials = gaxi::options::Credentials;
14207 async fn build(
14208 self,
14209 config: gaxi::options::ClientConfig,
14210 ) -> crate::ClientBuilderResult<Self::Client> {
14211 Self::Client::new(config).await
14212 }
14213 }
14214 }
14215
14216 #[derive(Clone, Debug)]
14218 pub(crate) struct RequestBuilder<R: std::default::Default> {
14219 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14220 request: R,
14221 options: crate::RequestOptions,
14222 }
14223
14224 impl<R> RequestBuilder<R>
14225 where
14226 R: std::default::Default,
14227 {
14228 pub(crate) fn new(
14229 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14230 ) -> Self {
14231 Self {
14232 stub,
14233 request: R::default(),
14234 options: crate::RequestOptions::default(),
14235 }
14236 }
14237 }
14238
14239 #[derive(Clone, Debug)]
14257 pub struct CreateDataScan(RequestBuilder<crate::model::CreateDataScanRequest>);
14258
14259 impl CreateDataScan {
14260 pub(crate) fn new(
14261 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14262 ) -> Self {
14263 Self(RequestBuilder::new(stub))
14264 }
14265
14266 pub fn with_request<V: Into<crate::model::CreateDataScanRequest>>(mut self, v: V) -> Self {
14268 self.0.request = v.into();
14269 self
14270 }
14271
14272 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14274 self.0.options = v.into();
14275 self
14276 }
14277
14278 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14285 (*self.0.stub)
14286 .create_data_scan(self.0.request, self.0.options)
14287 .await
14288 .map(crate::Response::into_body)
14289 }
14290
14291 pub fn poller(
14293 self,
14294 ) -> impl google_cloud_lro::Poller<crate::model::DataScan, crate::model::OperationMetadata>
14295 {
14296 type Operation = google_cloud_lro::internal::Operation<
14297 crate::model::DataScan,
14298 crate::model::OperationMetadata,
14299 >;
14300 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14301 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14302
14303 let stub = self.0.stub.clone();
14304 let mut options = self.0.options.clone();
14305 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14306 let query = move |name| {
14307 let stub = stub.clone();
14308 let options = options.clone();
14309 async {
14310 let op = GetOperation::new(stub)
14311 .set_name(name)
14312 .with_options(options)
14313 .send()
14314 .await?;
14315 Ok(Operation::new(op))
14316 }
14317 };
14318
14319 let start = move || async {
14320 let op = self.send().await?;
14321 Ok(Operation::new(op))
14322 };
14323
14324 google_cloud_lro::internal::new_poller(
14325 polling_error_policy,
14326 polling_backoff_policy,
14327 start,
14328 query,
14329 )
14330 }
14331
14332 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14336 self.0.request.parent = v.into();
14337 self
14338 }
14339
14340 pub fn set_data_scan<T>(mut self, v: T) -> Self
14344 where
14345 T: std::convert::Into<crate::model::DataScan>,
14346 {
14347 self.0.request.data_scan = std::option::Option::Some(v.into());
14348 self
14349 }
14350
14351 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
14355 where
14356 T: std::convert::Into<crate::model::DataScan>,
14357 {
14358 self.0.request.data_scan = v.map(|x| x.into());
14359 self
14360 }
14361
14362 pub fn set_data_scan_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14364 self.0.request.data_scan_id = v.into();
14365 self
14366 }
14367
14368 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14370 self.0.request.validate_only = v.into();
14371 self
14372 }
14373 }
14374
14375 #[doc(hidden)]
14376 impl crate::RequestBuilder for CreateDataScan {
14377 fn request_options(&mut self) -> &mut crate::RequestOptions {
14378 &mut self.0.options
14379 }
14380 }
14381
14382 #[derive(Clone, Debug)]
14400 pub struct UpdateDataScan(RequestBuilder<crate::model::UpdateDataScanRequest>);
14401
14402 impl UpdateDataScan {
14403 pub(crate) fn new(
14404 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14405 ) -> Self {
14406 Self(RequestBuilder::new(stub))
14407 }
14408
14409 pub fn with_request<V: Into<crate::model::UpdateDataScanRequest>>(mut self, v: V) -> Self {
14411 self.0.request = v.into();
14412 self
14413 }
14414
14415 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14417 self.0.options = v.into();
14418 self
14419 }
14420
14421 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14428 (*self.0.stub)
14429 .update_data_scan(self.0.request, self.0.options)
14430 .await
14431 .map(crate::Response::into_body)
14432 }
14433
14434 pub fn poller(
14436 self,
14437 ) -> impl google_cloud_lro::Poller<crate::model::DataScan, crate::model::OperationMetadata>
14438 {
14439 type Operation = google_cloud_lro::internal::Operation<
14440 crate::model::DataScan,
14441 crate::model::OperationMetadata,
14442 >;
14443 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14444 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14445
14446 let stub = self.0.stub.clone();
14447 let mut options = self.0.options.clone();
14448 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14449 let query = move |name| {
14450 let stub = stub.clone();
14451 let options = options.clone();
14452 async {
14453 let op = GetOperation::new(stub)
14454 .set_name(name)
14455 .with_options(options)
14456 .send()
14457 .await?;
14458 Ok(Operation::new(op))
14459 }
14460 };
14461
14462 let start = move || async {
14463 let op = self.send().await?;
14464 Ok(Operation::new(op))
14465 };
14466
14467 google_cloud_lro::internal::new_poller(
14468 polling_error_policy,
14469 polling_backoff_policy,
14470 start,
14471 query,
14472 )
14473 }
14474
14475 pub fn set_data_scan<T>(mut self, v: T) -> Self
14479 where
14480 T: std::convert::Into<crate::model::DataScan>,
14481 {
14482 self.0.request.data_scan = std::option::Option::Some(v.into());
14483 self
14484 }
14485
14486 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
14490 where
14491 T: std::convert::Into<crate::model::DataScan>,
14492 {
14493 self.0.request.data_scan = v.map(|x| x.into());
14494 self
14495 }
14496
14497 pub fn set_update_mask<T>(mut self, v: T) -> Self
14499 where
14500 T: std::convert::Into<wkt::FieldMask>,
14501 {
14502 self.0.request.update_mask = std::option::Option::Some(v.into());
14503 self
14504 }
14505
14506 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14508 where
14509 T: std::convert::Into<wkt::FieldMask>,
14510 {
14511 self.0.request.update_mask = v.map(|x| x.into());
14512 self
14513 }
14514
14515 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14517 self.0.request.validate_only = v.into();
14518 self
14519 }
14520 }
14521
14522 #[doc(hidden)]
14523 impl crate::RequestBuilder for UpdateDataScan {
14524 fn request_options(&mut self) -> &mut crate::RequestOptions {
14525 &mut self.0.options
14526 }
14527 }
14528
14529 #[derive(Clone, Debug)]
14547 pub struct DeleteDataScan(RequestBuilder<crate::model::DeleteDataScanRequest>);
14548
14549 impl DeleteDataScan {
14550 pub(crate) fn new(
14551 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14552 ) -> Self {
14553 Self(RequestBuilder::new(stub))
14554 }
14555
14556 pub fn with_request<V: Into<crate::model::DeleteDataScanRequest>>(mut self, v: V) -> Self {
14558 self.0.request = v.into();
14559 self
14560 }
14561
14562 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14564 self.0.options = v.into();
14565 self
14566 }
14567
14568 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14575 (*self.0.stub)
14576 .delete_data_scan(self.0.request, self.0.options)
14577 .await
14578 .map(crate::Response::into_body)
14579 }
14580
14581 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
14583 type Operation =
14584 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14585 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14586 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14587
14588 let stub = self.0.stub.clone();
14589 let mut options = self.0.options.clone();
14590 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14591 let query = move |name| {
14592 let stub = stub.clone();
14593 let options = options.clone();
14594 async {
14595 let op = GetOperation::new(stub)
14596 .set_name(name)
14597 .with_options(options)
14598 .send()
14599 .await?;
14600 Ok(Operation::new(op))
14601 }
14602 };
14603
14604 let start = move || async {
14605 let op = self.send().await?;
14606 Ok(Operation::new(op))
14607 };
14608
14609 google_cloud_lro::internal::new_unit_response_poller(
14610 polling_error_policy,
14611 polling_backoff_policy,
14612 start,
14613 query,
14614 )
14615 }
14616
14617 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14621 self.0.request.name = v.into();
14622 self
14623 }
14624
14625 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
14627 self.0.request.force = v.into();
14628 self
14629 }
14630 }
14631
14632 #[doc(hidden)]
14633 impl crate::RequestBuilder for DeleteDataScan {
14634 fn request_options(&mut self) -> &mut crate::RequestOptions {
14635 &mut self.0.options
14636 }
14637 }
14638
14639 #[derive(Clone, Debug)]
14656 pub struct GetDataScan(RequestBuilder<crate::model::GetDataScanRequest>);
14657
14658 impl GetDataScan {
14659 pub(crate) fn new(
14660 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14661 ) -> Self {
14662 Self(RequestBuilder::new(stub))
14663 }
14664
14665 pub fn with_request<V: Into<crate::model::GetDataScanRequest>>(mut self, v: V) -> Self {
14667 self.0.request = v.into();
14668 self
14669 }
14670
14671 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14673 self.0.options = v.into();
14674 self
14675 }
14676
14677 pub async fn send(self) -> Result<crate::model::DataScan> {
14679 (*self.0.stub)
14680 .get_data_scan(self.0.request, self.0.options)
14681 .await
14682 .map(crate::Response::into_body)
14683 }
14684
14685 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14689 self.0.request.name = v.into();
14690 self
14691 }
14692
14693 pub fn set_view<T: Into<crate::model::get_data_scan_request::DataScanView>>(
14695 mut self,
14696 v: T,
14697 ) -> Self {
14698 self.0.request.view = v.into();
14699 self
14700 }
14701 }
14702
14703 #[doc(hidden)]
14704 impl crate::RequestBuilder for GetDataScan {
14705 fn request_options(&mut self) -> &mut crate::RequestOptions {
14706 &mut self.0.options
14707 }
14708 }
14709
14710 #[derive(Clone, Debug)]
14731 pub struct ListDataScans(RequestBuilder<crate::model::ListDataScansRequest>);
14732
14733 impl ListDataScans {
14734 pub(crate) fn new(
14735 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14736 ) -> Self {
14737 Self(RequestBuilder::new(stub))
14738 }
14739
14740 pub fn with_request<V: Into<crate::model::ListDataScansRequest>>(mut self, v: V) -> Self {
14742 self.0.request = v.into();
14743 self
14744 }
14745
14746 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14748 self.0.options = v.into();
14749 self
14750 }
14751
14752 pub async fn send(self) -> Result<crate::model::ListDataScansResponse> {
14754 (*self.0.stub)
14755 .list_data_scans(self.0.request, self.0.options)
14756 .await
14757 .map(crate::Response::into_body)
14758 }
14759
14760 pub fn by_page(
14762 self,
14763 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListDataScansResponse, crate::Error>
14764 {
14765 use std::clone::Clone;
14766 let token = self.0.request.page_token.clone();
14767 let execute = move |token: String| {
14768 let mut builder = self.clone();
14769 builder.0.request = builder.0.request.set_page_token(token);
14770 builder.send()
14771 };
14772 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14773 }
14774
14775 pub fn by_item(
14777 self,
14778 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14779 crate::model::ListDataScansResponse,
14780 crate::Error,
14781 > {
14782 use google_cloud_gax::paginator::Paginator;
14783 self.by_page().items()
14784 }
14785
14786 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14790 self.0.request.parent = v.into();
14791 self
14792 }
14793
14794 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14796 self.0.request.page_size = v.into();
14797 self
14798 }
14799
14800 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14802 self.0.request.page_token = v.into();
14803 self
14804 }
14805
14806 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14808 self.0.request.filter = v.into();
14809 self
14810 }
14811
14812 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
14814 self.0.request.order_by = v.into();
14815 self
14816 }
14817 }
14818
14819 #[doc(hidden)]
14820 impl crate::RequestBuilder for ListDataScans {
14821 fn request_options(&mut self) -> &mut crate::RequestOptions {
14822 &mut self.0.options
14823 }
14824 }
14825
14826 #[derive(Clone, Debug)]
14843 pub struct RunDataScan(RequestBuilder<crate::model::RunDataScanRequest>);
14844
14845 impl RunDataScan {
14846 pub(crate) fn new(
14847 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14848 ) -> Self {
14849 Self(RequestBuilder::new(stub))
14850 }
14851
14852 pub fn with_request<V: Into<crate::model::RunDataScanRequest>>(mut self, v: V) -> Self {
14854 self.0.request = v.into();
14855 self
14856 }
14857
14858 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14860 self.0.options = v.into();
14861 self
14862 }
14863
14864 pub async fn send(self) -> Result<crate::model::RunDataScanResponse> {
14866 (*self.0.stub)
14867 .run_data_scan(self.0.request, self.0.options)
14868 .await
14869 .map(crate::Response::into_body)
14870 }
14871
14872 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14876 self.0.request.name = v.into();
14877 self
14878 }
14879 }
14880
14881 #[doc(hidden)]
14882 impl crate::RequestBuilder for RunDataScan {
14883 fn request_options(&mut self) -> &mut crate::RequestOptions {
14884 &mut self.0.options
14885 }
14886 }
14887
14888 #[derive(Clone, Debug)]
14905 pub struct GetDataScanJob(RequestBuilder<crate::model::GetDataScanJobRequest>);
14906
14907 impl GetDataScanJob {
14908 pub(crate) fn new(
14909 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14910 ) -> Self {
14911 Self(RequestBuilder::new(stub))
14912 }
14913
14914 pub fn with_request<V: Into<crate::model::GetDataScanJobRequest>>(mut self, v: V) -> Self {
14916 self.0.request = v.into();
14917 self
14918 }
14919
14920 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14922 self.0.options = v.into();
14923 self
14924 }
14925
14926 pub async fn send(self) -> Result<crate::model::DataScanJob> {
14928 (*self.0.stub)
14929 .get_data_scan_job(self.0.request, self.0.options)
14930 .await
14931 .map(crate::Response::into_body)
14932 }
14933
14934 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14938 self.0.request.name = v.into();
14939 self
14940 }
14941
14942 pub fn set_view<T: Into<crate::model::get_data_scan_job_request::DataScanJobView>>(
14944 mut self,
14945 v: T,
14946 ) -> Self {
14947 self.0.request.view = v.into();
14948 self
14949 }
14950 }
14951
14952 #[doc(hidden)]
14953 impl crate::RequestBuilder for GetDataScanJob {
14954 fn request_options(&mut self) -> &mut crate::RequestOptions {
14955 &mut self.0.options
14956 }
14957 }
14958
14959 #[derive(Clone, Debug)]
14980 pub struct ListDataScanJobs(RequestBuilder<crate::model::ListDataScanJobsRequest>);
14981
14982 impl ListDataScanJobs {
14983 pub(crate) fn new(
14984 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
14985 ) -> Self {
14986 Self(RequestBuilder::new(stub))
14987 }
14988
14989 pub fn with_request<V: Into<crate::model::ListDataScanJobsRequest>>(
14991 mut self,
14992 v: V,
14993 ) -> Self {
14994 self.0.request = v.into();
14995 self
14996 }
14997
14998 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15000 self.0.options = v.into();
15001 self
15002 }
15003
15004 pub async fn send(self) -> Result<crate::model::ListDataScanJobsResponse> {
15006 (*self.0.stub)
15007 .list_data_scan_jobs(self.0.request, self.0.options)
15008 .await
15009 .map(crate::Response::into_body)
15010 }
15011
15012 pub fn by_page(
15014 self,
15015 ) -> impl google_cloud_gax::paginator::Paginator<
15016 crate::model::ListDataScanJobsResponse,
15017 crate::Error,
15018 > {
15019 use std::clone::Clone;
15020 let token = self.0.request.page_token.clone();
15021 let execute = move |token: String| {
15022 let mut builder = self.clone();
15023 builder.0.request = builder.0.request.set_page_token(token);
15024 builder.send()
15025 };
15026 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15027 }
15028
15029 pub fn by_item(
15031 self,
15032 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15033 crate::model::ListDataScanJobsResponse,
15034 crate::Error,
15035 > {
15036 use google_cloud_gax::paginator::Paginator;
15037 self.by_page().items()
15038 }
15039
15040 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15044 self.0.request.parent = v.into();
15045 self
15046 }
15047
15048 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15050 self.0.request.page_size = v.into();
15051 self
15052 }
15053
15054 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15056 self.0.request.page_token = v.into();
15057 self
15058 }
15059
15060 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15062 self.0.request.filter = v.into();
15063 self
15064 }
15065 }
15066
15067 #[doc(hidden)]
15068 impl crate::RequestBuilder for ListDataScanJobs {
15069 fn request_options(&mut self) -> &mut crate::RequestOptions {
15070 &mut self.0.options
15071 }
15072 }
15073
15074 #[derive(Clone, Debug)]
15091 pub struct CancelDataScanJob(RequestBuilder<crate::model::CancelDataScanJobRequest>);
15092
15093 impl CancelDataScanJob {
15094 pub(crate) fn new(
15095 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15096 ) -> Self {
15097 Self(RequestBuilder::new(stub))
15098 }
15099
15100 pub fn with_request<V: Into<crate::model::CancelDataScanJobRequest>>(
15102 mut self,
15103 v: V,
15104 ) -> Self {
15105 self.0.request = v.into();
15106 self
15107 }
15108
15109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15111 self.0.options = v.into();
15112 self
15113 }
15114
15115 pub async fn send(self) -> Result<crate::model::CancelDataScanJobResponse> {
15117 (*self.0.stub)
15118 .cancel_data_scan_job(self.0.request, self.0.options)
15119 .await
15120 .map(crate::Response::into_body)
15121 }
15122
15123 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15127 self.0.request.name = v.into();
15128 self
15129 }
15130 }
15131
15132 #[doc(hidden)]
15133 impl crate::RequestBuilder for CancelDataScanJob {
15134 fn request_options(&mut self) -> &mut crate::RequestOptions {
15135 &mut self.0.options
15136 }
15137 }
15138
15139 #[derive(Clone, Debug)]
15156 pub struct GenerateDataQualityRules(
15157 RequestBuilder<crate::model::GenerateDataQualityRulesRequest>,
15158 );
15159
15160 impl GenerateDataQualityRules {
15161 pub(crate) fn new(
15162 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15163 ) -> Self {
15164 Self(RequestBuilder::new(stub))
15165 }
15166
15167 pub fn with_request<V: Into<crate::model::GenerateDataQualityRulesRequest>>(
15169 mut self,
15170 v: V,
15171 ) -> Self {
15172 self.0.request = v.into();
15173 self
15174 }
15175
15176 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15178 self.0.options = v.into();
15179 self
15180 }
15181
15182 pub async fn send(self) -> Result<crate::model::GenerateDataQualityRulesResponse> {
15184 (*self.0.stub)
15185 .generate_data_quality_rules(self.0.request, self.0.options)
15186 .await
15187 .map(crate::Response::into_body)
15188 }
15189
15190 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15194 self.0.request.name = v.into();
15195 self
15196 }
15197 }
15198
15199 #[doc(hidden)]
15200 impl crate::RequestBuilder for GenerateDataQualityRules {
15201 fn request_options(&mut self) -> &mut crate::RequestOptions {
15202 &mut self.0.options
15203 }
15204 }
15205
15206 #[derive(Clone, Debug)]
15227 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
15228
15229 impl ListLocations {
15230 pub(crate) fn new(
15231 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15232 ) -> Self {
15233 Self(RequestBuilder::new(stub))
15234 }
15235
15236 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
15238 mut self,
15239 v: V,
15240 ) -> Self {
15241 self.0.request = v.into();
15242 self
15243 }
15244
15245 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15247 self.0.options = v.into();
15248 self
15249 }
15250
15251 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
15253 (*self.0.stub)
15254 .list_locations(self.0.request, self.0.options)
15255 .await
15256 .map(crate::Response::into_body)
15257 }
15258
15259 pub fn by_page(
15261 self,
15262 ) -> impl google_cloud_gax::paginator::Paginator<
15263 google_cloud_location::model::ListLocationsResponse,
15264 crate::Error,
15265 > {
15266 use std::clone::Clone;
15267 let token = self.0.request.page_token.clone();
15268 let execute = move |token: String| {
15269 let mut builder = self.clone();
15270 builder.0.request = builder.0.request.set_page_token(token);
15271 builder.send()
15272 };
15273 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15274 }
15275
15276 pub fn by_item(
15278 self,
15279 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15280 google_cloud_location::model::ListLocationsResponse,
15281 crate::Error,
15282 > {
15283 use google_cloud_gax::paginator::Paginator;
15284 self.by_page().items()
15285 }
15286
15287 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15289 self.0.request.name = v.into();
15290 self
15291 }
15292
15293 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15295 self.0.request.filter = v.into();
15296 self
15297 }
15298
15299 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15301 self.0.request.page_size = v.into();
15302 self
15303 }
15304
15305 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15307 self.0.request.page_token = v.into();
15308 self
15309 }
15310 }
15311
15312 #[doc(hidden)]
15313 impl crate::RequestBuilder for ListLocations {
15314 fn request_options(&mut self) -> &mut crate::RequestOptions {
15315 &mut self.0.options
15316 }
15317 }
15318
15319 #[derive(Clone, Debug)]
15336 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
15337
15338 impl GetLocation {
15339 pub(crate) fn new(
15340 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15341 ) -> Self {
15342 Self(RequestBuilder::new(stub))
15343 }
15344
15345 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
15347 mut self,
15348 v: V,
15349 ) -> Self {
15350 self.0.request = v.into();
15351 self
15352 }
15353
15354 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15356 self.0.options = v.into();
15357 self
15358 }
15359
15360 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
15362 (*self.0.stub)
15363 .get_location(self.0.request, self.0.options)
15364 .await
15365 .map(crate::Response::into_body)
15366 }
15367
15368 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15370 self.0.request.name = v.into();
15371 self
15372 }
15373 }
15374
15375 #[doc(hidden)]
15376 impl crate::RequestBuilder for GetLocation {
15377 fn request_options(&mut self) -> &mut crate::RequestOptions {
15378 &mut self.0.options
15379 }
15380 }
15381
15382 #[derive(Clone, Debug)]
15399 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
15400
15401 impl SetIamPolicy {
15402 pub(crate) fn new(
15403 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15404 ) -> Self {
15405 Self(RequestBuilder::new(stub))
15406 }
15407
15408 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
15410 mut self,
15411 v: V,
15412 ) -> Self {
15413 self.0.request = v.into();
15414 self
15415 }
15416
15417 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15419 self.0.options = v.into();
15420 self
15421 }
15422
15423 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
15425 (*self.0.stub)
15426 .set_iam_policy(self.0.request, self.0.options)
15427 .await
15428 .map(crate::Response::into_body)
15429 }
15430
15431 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
15435 self.0.request.resource = v.into();
15436 self
15437 }
15438
15439 pub fn set_policy<T>(mut self, v: T) -> Self
15443 where
15444 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
15445 {
15446 self.0.request.policy = std::option::Option::Some(v.into());
15447 self
15448 }
15449
15450 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
15454 where
15455 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
15456 {
15457 self.0.request.policy = v.map(|x| x.into());
15458 self
15459 }
15460
15461 pub fn set_update_mask<T>(mut self, v: T) -> Self
15463 where
15464 T: std::convert::Into<wkt::FieldMask>,
15465 {
15466 self.0.request.update_mask = std::option::Option::Some(v.into());
15467 self
15468 }
15469
15470 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15472 where
15473 T: std::convert::Into<wkt::FieldMask>,
15474 {
15475 self.0.request.update_mask = v.map(|x| x.into());
15476 self
15477 }
15478 }
15479
15480 #[doc(hidden)]
15481 impl crate::RequestBuilder for SetIamPolicy {
15482 fn request_options(&mut self) -> &mut crate::RequestOptions {
15483 &mut self.0.options
15484 }
15485 }
15486
15487 #[derive(Clone, Debug)]
15504 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
15505
15506 impl GetIamPolicy {
15507 pub(crate) fn new(
15508 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15509 ) -> Self {
15510 Self(RequestBuilder::new(stub))
15511 }
15512
15513 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
15515 mut self,
15516 v: V,
15517 ) -> Self {
15518 self.0.request = v.into();
15519 self
15520 }
15521
15522 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15524 self.0.options = v.into();
15525 self
15526 }
15527
15528 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
15530 (*self.0.stub)
15531 .get_iam_policy(self.0.request, self.0.options)
15532 .await
15533 .map(crate::Response::into_body)
15534 }
15535
15536 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
15540 self.0.request.resource = v.into();
15541 self
15542 }
15543
15544 pub fn set_options<T>(mut self, v: T) -> Self
15546 where
15547 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
15548 {
15549 self.0.request.options = std::option::Option::Some(v.into());
15550 self
15551 }
15552
15553 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
15555 where
15556 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
15557 {
15558 self.0.request.options = v.map(|x| x.into());
15559 self
15560 }
15561 }
15562
15563 #[doc(hidden)]
15564 impl crate::RequestBuilder for GetIamPolicy {
15565 fn request_options(&mut self) -> &mut crate::RequestOptions {
15566 &mut self.0.options
15567 }
15568 }
15569
15570 #[derive(Clone, Debug)]
15587 pub struct TestIamPermissions(
15588 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
15589 );
15590
15591 impl TestIamPermissions {
15592 pub(crate) fn new(
15593 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15594 ) -> Self {
15595 Self(RequestBuilder::new(stub))
15596 }
15597
15598 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
15600 mut self,
15601 v: V,
15602 ) -> Self {
15603 self.0.request = v.into();
15604 self
15605 }
15606
15607 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15609 self.0.options = v.into();
15610 self
15611 }
15612
15613 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
15615 (*self.0.stub)
15616 .test_iam_permissions(self.0.request, self.0.options)
15617 .await
15618 .map(crate::Response::into_body)
15619 }
15620
15621 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
15625 self.0.request.resource = v.into();
15626 self
15627 }
15628
15629 pub fn set_permissions<T, V>(mut self, v: T) -> Self
15633 where
15634 T: std::iter::IntoIterator<Item = V>,
15635 V: std::convert::Into<std::string::String>,
15636 {
15637 use std::iter::Iterator;
15638 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
15639 self
15640 }
15641 }
15642
15643 #[doc(hidden)]
15644 impl crate::RequestBuilder for TestIamPermissions {
15645 fn request_options(&mut self) -> &mut crate::RequestOptions {
15646 &mut self.0.options
15647 }
15648 }
15649
15650 #[derive(Clone, Debug)]
15671 pub struct ListOperations(
15672 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
15673 );
15674
15675 impl ListOperations {
15676 pub(crate) fn new(
15677 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15678 ) -> Self {
15679 Self(RequestBuilder::new(stub))
15680 }
15681
15682 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
15684 mut self,
15685 v: V,
15686 ) -> Self {
15687 self.0.request = v.into();
15688 self
15689 }
15690
15691 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15693 self.0.options = v.into();
15694 self
15695 }
15696
15697 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
15699 (*self.0.stub)
15700 .list_operations(self.0.request, self.0.options)
15701 .await
15702 .map(crate::Response::into_body)
15703 }
15704
15705 pub fn by_page(
15707 self,
15708 ) -> impl google_cloud_gax::paginator::Paginator<
15709 google_cloud_longrunning::model::ListOperationsResponse,
15710 crate::Error,
15711 > {
15712 use std::clone::Clone;
15713 let token = self.0.request.page_token.clone();
15714 let execute = move |token: String| {
15715 let mut builder = self.clone();
15716 builder.0.request = builder.0.request.set_page_token(token);
15717 builder.send()
15718 };
15719 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15720 }
15721
15722 pub fn by_item(
15724 self,
15725 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15726 google_cloud_longrunning::model::ListOperationsResponse,
15727 crate::Error,
15728 > {
15729 use google_cloud_gax::paginator::Paginator;
15730 self.by_page().items()
15731 }
15732
15733 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15735 self.0.request.name = v.into();
15736 self
15737 }
15738
15739 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15741 self.0.request.filter = v.into();
15742 self
15743 }
15744
15745 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15747 self.0.request.page_size = v.into();
15748 self
15749 }
15750
15751 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15753 self.0.request.page_token = v.into();
15754 self
15755 }
15756
15757 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15759 self.0.request.return_partial_success = v.into();
15760 self
15761 }
15762 }
15763
15764 #[doc(hidden)]
15765 impl crate::RequestBuilder for ListOperations {
15766 fn request_options(&mut self) -> &mut crate::RequestOptions {
15767 &mut self.0.options
15768 }
15769 }
15770
15771 #[derive(Clone, Debug)]
15788 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
15789
15790 impl GetOperation {
15791 pub(crate) fn new(
15792 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15793 ) -> Self {
15794 Self(RequestBuilder::new(stub))
15795 }
15796
15797 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
15799 mut self,
15800 v: V,
15801 ) -> Self {
15802 self.0.request = v.into();
15803 self
15804 }
15805
15806 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15808 self.0.options = v.into();
15809 self
15810 }
15811
15812 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15814 (*self.0.stub)
15815 .get_operation(self.0.request, self.0.options)
15816 .await
15817 .map(crate::Response::into_body)
15818 }
15819
15820 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15822 self.0.request.name = v.into();
15823 self
15824 }
15825 }
15826
15827 #[doc(hidden)]
15828 impl crate::RequestBuilder for GetOperation {
15829 fn request_options(&mut self) -> &mut crate::RequestOptions {
15830 &mut self.0.options
15831 }
15832 }
15833
15834 #[derive(Clone, Debug)]
15851 pub struct DeleteOperation(
15852 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
15853 );
15854
15855 impl DeleteOperation {
15856 pub(crate) fn new(
15857 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15858 ) -> Self {
15859 Self(RequestBuilder::new(stub))
15860 }
15861
15862 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
15864 mut self,
15865 v: V,
15866 ) -> Self {
15867 self.0.request = v.into();
15868 self
15869 }
15870
15871 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15873 self.0.options = v.into();
15874 self
15875 }
15876
15877 pub async fn send(self) -> Result<()> {
15879 (*self.0.stub)
15880 .delete_operation(self.0.request, self.0.options)
15881 .await
15882 .map(crate::Response::into_body)
15883 }
15884
15885 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15887 self.0.request.name = v.into();
15888 self
15889 }
15890 }
15891
15892 #[doc(hidden)]
15893 impl crate::RequestBuilder for DeleteOperation {
15894 fn request_options(&mut self) -> &mut crate::RequestOptions {
15895 &mut self.0.options
15896 }
15897 }
15898
15899 #[derive(Clone, Debug)]
15916 pub struct CancelOperation(
15917 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
15918 );
15919
15920 impl CancelOperation {
15921 pub(crate) fn new(
15922 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
15923 ) -> Self {
15924 Self(RequestBuilder::new(stub))
15925 }
15926
15927 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
15929 mut self,
15930 v: V,
15931 ) -> Self {
15932 self.0.request = v.into();
15933 self
15934 }
15935
15936 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15938 self.0.options = v.into();
15939 self
15940 }
15941
15942 pub async fn send(self) -> Result<()> {
15944 (*self.0.stub)
15945 .cancel_operation(self.0.request, self.0.options)
15946 .await
15947 .map(crate::Response::into_body)
15948 }
15949
15950 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15952 self.0.request.name = v.into();
15953 self
15954 }
15955 }
15956
15957 #[doc(hidden)]
15958 impl crate::RequestBuilder for CancelOperation {
15959 fn request_options(&mut self) -> &mut crate::RequestOptions {
15960 &mut self.0.options
15961 }
15962 }
15963}
15964
15965pub mod metadata_service {
15967 use crate::Result;
15968
15969 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15983
15984 pub(crate) mod client {
15985 use super::super::super::client::MetadataService;
15986 pub struct Factory;
15987 impl crate::ClientFactory for Factory {
15988 type Client = MetadataService;
15989 type Credentials = gaxi::options::Credentials;
15990 async fn build(
15991 self,
15992 config: gaxi::options::ClientConfig,
15993 ) -> crate::ClientBuilderResult<Self::Client> {
15994 Self::Client::new(config).await
15995 }
15996 }
15997 }
15998
15999 #[derive(Clone, Debug)]
16001 pub(crate) struct RequestBuilder<R: std::default::Default> {
16002 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16003 request: R,
16004 options: crate::RequestOptions,
16005 }
16006
16007 impl<R> RequestBuilder<R>
16008 where
16009 R: std::default::Default,
16010 {
16011 pub(crate) fn new(
16012 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16013 ) -> Self {
16014 Self {
16015 stub,
16016 request: R::default(),
16017 options: crate::RequestOptions::default(),
16018 }
16019 }
16020 }
16021
16022 #[derive(Clone, Debug)]
16039 pub struct CreateEntity(RequestBuilder<crate::model::CreateEntityRequest>);
16040
16041 impl CreateEntity {
16042 pub(crate) fn new(
16043 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16044 ) -> Self {
16045 Self(RequestBuilder::new(stub))
16046 }
16047
16048 pub fn with_request<V: Into<crate::model::CreateEntityRequest>>(mut self, v: V) -> Self {
16050 self.0.request = v.into();
16051 self
16052 }
16053
16054 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16056 self.0.options = v.into();
16057 self
16058 }
16059
16060 pub async fn send(self) -> Result<crate::model::Entity> {
16062 (*self.0.stub)
16063 .create_entity(self.0.request, self.0.options)
16064 .await
16065 .map(crate::Response::into_body)
16066 }
16067
16068 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16072 self.0.request.parent = v.into();
16073 self
16074 }
16075
16076 pub fn set_entity<T>(mut self, v: T) -> Self
16080 where
16081 T: std::convert::Into<crate::model::Entity>,
16082 {
16083 self.0.request.entity = std::option::Option::Some(v.into());
16084 self
16085 }
16086
16087 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
16091 where
16092 T: std::convert::Into<crate::model::Entity>,
16093 {
16094 self.0.request.entity = v.map(|x| x.into());
16095 self
16096 }
16097
16098 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16100 self.0.request.validate_only = v.into();
16101 self
16102 }
16103 }
16104
16105 #[doc(hidden)]
16106 impl crate::RequestBuilder for CreateEntity {
16107 fn request_options(&mut self) -> &mut crate::RequestOptions {
16108 &mut self.0.options
16109 }
16110 }
16111
16112 #[derive(Clone, Debug)]
16129 pub struct UpdateEntity(RequestBuilder<crate::model::UpdateEntityRequest>);
16130
16131 impl UpdateEntity {
16132 pub(crate) fn new(
16133 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16134 ) -> Self {
16135 Self(RequestBuilder::new(stub))
16136 }
16137
16138 pub fn with_request<V: Into<crate::model::UpdateEntityRequest>>(mut self, v: V) -> Self {
16140 self.0.request = v.into();
16141 self
16142 }
16143
16144 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16146 self.0.options = v.into();
16147 self
16148 }
16149
16150 pub async fn send(self) -> Result<crate::model::Entity> {
16152 (*self.0.stub)
16153 .update_entity(self.0.request, self.0.options)
16154 .await
16155 .map(crate::Response::into_body)
16156 }
16157
16158 pub fn set_entity<T>(mut self, v: T) -> Self
16162 where
16163 T: std::convert::Into<crate::model::Entity>,
16164 {
16165 self.0.request.entity = std::option::Option::Some(v.into());
16166 self
16167 }
16168
16169 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
16173 where
16174 T: std::convert::Into<crate::model::Entity>,
16175 {
16176 self.0.request.entity = v.map(|x| x.into());
16177 self
16178 }
16179
16180 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16182 self.0.request.validate_only = v.into();
16183 self
16184 }
16185 }
16186
16187 #[doc(hidden)]
16188 impl crate::RequestBuilder for UpdateEntity {
16189 fn request_options(&mut self) -> &mut crate::RequestOptions {
16190 &mut self.0.options
16191 }
16192 }
16193
16194 #[derive(Clone, Debug)]
16211 pub struct DeleteEntity(RequestBuilder<crate::model::DeleteEntityRequest>);
16212
16213 impl DeleteEntity {
16214 pub(crate) fn new(
16215 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16216 ) -> Self {
16217 Self(RequestBuilder::new(stub))
16218 }
16219
16220 pub fn with_request<V: Into<crate::model::DeleteEntityRequest>>(mut self, v: V) -> Self {
16222 self.0.request = v.into();
16223 self
16224 }
16225
16226 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16228 self.0.options = v.into();
16229 self
16230 }
16231
16232 pub async fn send(self) -> Result<()> {
16234 (*self.0.stub)
16235 .delete_entity(self.0.request, self.0.options)
16236 .await
16237 .map(crate::Response::into_body)
16238 }
16239
16240 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16244 self.0.request.name = v.into();
16245 self
16246 }
16247
16248 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
16252 self.0.request.etag = v.into();
16253 self
16254 }
16255 }
16256
16257 #[doc(hidden)]
16258 impl crate::RequestBuilder for DeleteEntity {
16259 fn request_options(&mut self) -> &mut crate::RequestOptions {
16260 &mut self.0.options
16261 }
16262 }
16263
16264 #[derive(Clone, Debug)]
16281 pub struct GetEntity(RequestBuilder<crate::model::GetEntityRequest>);
16282
16283 impl GetEntity {
16284 pub(crate) fn new(
16285 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16286 ) -> Self {
16287 Self(RequestBuilder::new(stub))
16288 }
16289
16290 pub fn with_request<V: Into<crate::model::GetEntityRequest>>(mut self, v: V) -> Self {
16292 self.0.request = v.into();
16293 self
16294 }
16295
16296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16298 self.0.options = v.into();
16299 self
16300 }
16301
16302 pub async fn send(self) -> Result<crate::model::Entity> {
16304 (*self.0.stub)
16305 .get_entity(self.0.request, self.0.options)
16306 .await
16307 .map(crate::Response::into_body)
16308 }
16309
16310 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16314 self.0.request.name = v.into();
16315 self
16316 }
16317
16318 pub fn set_view<T: Into<crate::model::get_entity_request::EntityView>>(
16320 mut self,
16321 v: T,
16322 ) -> Self {
16323 self.0.request.view = v.into();
16324 self
16325 }
16326 }
16327
16328 #[doc(hidden)]
16329 impl crate::RequestBuilder for GetEntity {
16330 fn request_options(&mut self) -> &mut crate::RequestOptions {
16331 &mut self.0.options
16332 }
16333 }
16334
16335 #[derive(Clone, Debug)]
16356 pub struct ListEntities(RequestBuilder<crate::model::ListEntitiesRequest>);
16357
16358 impl ListEntities {
16359 pub(crate) fn new(
16360 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16361 ) -> Self {
16362 Self(RequestBuilder::new(stub))
16363 }
16364
16365 pub fn with_request<V: Into<crate::model::ListEntitiesRequest>>(mut self, v: V) -> Self {
16367 self.0.request = v.into();
16368 self
16369 }
16370
16371 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16373 self.0.options = v.into();
16374 self
16375 }
16376
16377 pub async fn send(self) -> Result<crate::model::ListEntitiesResponse> {
16379 (*self.0.stub)
16380 .list_entities(self.0.request, self.0.options)
16381 .await
16382 .map(crate::Response::into_body)
16383 }
16384
16385 pub fn by_page(
16387 self,
16388 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListEntitiesResponse, crate::Error>
16389 {
16390 use std::clone::Clone;
16391 let token = self.0.request.page_token.clone();
16392 let execute = move |token: String| {
16393 let mut builder = self.clone();
16394 builder.0.request = builder.0.request.set_page_token(token);
16395 builder.send()
16396 };
16397 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16398 }
16399
16400 pub fn by_item(
16402 self,
16403 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16404 crate::model::ListEntitiesResponse,
16405 crate::Error,
16406 > {
16407 use google_cloud_gax::paginator::Paginator;
16408 self.by_page().items()
16409 }
16410
16411 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16415 self.0.request.parent = v.into();
16416 self
16417 }
16418
16419 pub fn set_view<T: Into<crate::model::list_entities_request::EntityView>>(
16423 mut self,
16424 v: T,
16425 ) -> Self {
16426 self.0.request.view = v.into();
16427 self
16428 }
16429
16430 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16432 self.0.request.page_size = v.into();
16433 self
16434 }
16435
16436 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16438 self.0.request.page_token = v.into();
16439 self
16440 }
16441
16442 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16444 self.0.request.filter = v.into();
16445 self
16446 }
16447 }
16448
16449 #[doc(hidden)]
16450 impl crate::RequestBuilder for ListEntities {
16451 fn request_options(&mut self) -> &mut crate::RequestOptions {
16452 &mut self.0.options
16453 }
16454 }
16455
16456 #[derive(Clone, Debug)]
16473 pub struct CreatePartition(RequestBuilder<crate::model::CreatePartitionRequest>);
16474
16475 impl CreatePartition {
16476 pub(crate) fn new(
16477 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16478 ) -> Self {
16479 Self(RequestBuilder::new(stub))
16480 }
16481
16482 pub fn with_request<V: Into<crate::model::CreatePartitionRequest>>(mut self, v: V) -> Self {
16484 self.0.request = v.into();
16485 self
16486 }
16487
16488 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16490 self.0.options = v.into();
16491 self
16492 }
16493
16494 pub async fn send(self) -> Result<crate::model::Partition> {
16496 (*self.0.stub)
16497 .create_partition(self.0.request, self.0.options)
16498 .await
16499 .map(crate::Response::into_body)
16500 }
16501
16502 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16506 self.0.request.parent = v.into();
16507 self
16508 }
16509
16510 pub fn set_partition<T>(mut self, v: T) -> Self
16514 where
16515 T: std::convert::Into<crate::model::Partition>,
16516 {
16517 self.0.request.partition = std::option::Option::Some(v.into());
16518 self
16519 }
16520
16521 pub fn set_or_clear_partition<T>(mut self, v: std::option::Option<T>) -> Self
16525 where
16526 T: std::convert::Into<crate::model::Partition>,
16527 {
16528 self.0.request.partition = v.map(|x| x.into());
16529 self
16530 }
16531
16532 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16534 self.0.request.validate_only = v.into();
16535 self
16536 }
16537 }
16538
16539 #[doc(hidden)]
16540 impl crate::RequestBuilder for CreatePartition {
16541 fn request_options(&mut self) -> &mut crate::RequestOptions {
16542 &mut self.0.options
16543 }
16544 }
16545
16546 #[derive(Clone, Debug)]
16563 pub struct DeletePartition(RequestBuilder<crate::model::DeletePartitionRequest>);
16564
16565 impl DeletePartition {
16566 pub(crate) fn new(
16567 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16568 ) -> Self {
16569 Self(RequestBuilder::new(stub))
16570 }
16571
16572 pub fn with_request<V: Into<crate::model::DeletePartitionRequest>>(mut self, v: V) -> Self {
16574 self.0.request = v.into();
16575 self
16576 }
16577
16578 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16580 self.0.options = v.into();
16581 self
16582 }
16583
16584 pub async fn send(self) -> Result<()> {
16586 (*self.0.stub)
16587 .delete_partition(self.0.request, self.0.options)
16588 .await
16589 .map(crate::Response::into_body)
16590 }
16591
16592 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16596 self.0.request.name = v.into();
16597 self
16598 }
16599
16600 #[deprecated]
16602 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
16603 self.0.request.etag = v.into();
16604 self
16605 }
16606 }
16607
16608 #[doc(hidden)]
16609 impl crate::RequestBuilder for DeletePartition {
16610 fn request_options(&mut self) -> &mut crate::RequestOptions {
16611 &mut self.0.options
16612 }
16613 }
16614
16615 #[derive(Clone, Debug)]
16632 pub struct GetPartition(RequestBuilder<crate::model::GetPartitionRequest>);
16633
16634 impl GetPartition {
16635 pub(crate) fn new(
16636 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16637 ) -> Self {
16638 Self(RequestBuilder::new(stub))
16639 }
16640
16641 pub fn with_request<V: Into<crate::model::GetPartitionRequest>>(mut self, v: V) -> Self {
16643 self.0.request = v.into();
16644 self
16645 }
16646
16647 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16649 self.0.options = v.into();
16650 self
16651 }
16652
16653 pub async fn send(self) -> Result<crate::model::Partition> {
16655 (*self.0.stub)
16656 .get_partition(self.0.request, self.0.options)
16657 .await
16658 .map(crate::Response::into_body)
16659 }
16660
16661 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16665 self.0.request.name = v.into();
16666 self
16667 }
16668 }
16669
16670 #[doc(hidden)]
16671 impl crate::RequestBuilder for GetPartition {
16672 fn request_options(&mut self) -> &mut crate::RequestOptions {
16673 &mut self.0.options
16674 }
16675 }
16676
16677 #[derive(Clone, Debug)]
16698 pub struct ListPartitions(RequestBuilder<crate::model::ListPartitionsRequest>);
16699
16700 impl ListPartitions {
16701 pub(crate) fn new(
16702 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16703 ) -> Self {
16704 Self(RequestBuilder::new(stub))
16705 }
16706
16707 pub fn with_request<V: Into<crate::model::ListPartitionsRequest>>(mut self, v: V) -> Self {
16709 self.0.request = v.into();
16710 self
16711 }
16712
16713 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16715 self.0.options = v.into();
16716 self
16717 }
16718
16719 pub async fn send(self) -> Result<crate::model::ListPartitionsResponse> {
16721 (*self.0.stub)
16722 .list_partitions(self.0.request, self.0.options)
16723 .await
16724 .map(crate::Response::into_body)
16725 }
16726
16727 pub fn by_page(
16729 self,
16730 ) -> impl google_cloud_gax::paginator::Paginator<
16731 crate::model::ListPartitionsResponse,
16732 crate::Error,
16733 > {
16734 use std::clone::Clone;
16735 let token = self.0.request.page_token.clone();
16736 let execute = move |token: String| {
16737 let mut builder = self.clone();
16738 builder.0.request = builder.0.request.set_page_token(token);
16739 builder.send()
16740 };
16741 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16742 }
16743
16744 pub fn by_item(
16746 self,
16747 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16748 crate::model::ListPartitionsResponse,
16749 crate::Error,
16750 > {
16751 use google_cloud_gax::paginator::Paginator;
16752 self.by_page().items()
16753 }
16754
16755 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16759 self.0.request.parent = v.into();
16760 self
16761 }
16762
16763 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16765 self.0.request.page_size = v.into();
16766 self
16767 }
16768
16769 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16771 self.0.request.page_token = v.into();
16772 self
16773 }
16774
16775 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16777 self.0.request.filter = v.into();
16778 self
16779 }
16780 }
16781
16782 #[doc(hidden)]
16783 impl crate::RequestBuilder for ListPartitions {
16784 fn request_options(&mut self) -> &mut crate::RequestOptions {
16785 &mut self.0.options
16786 }
16787 }
16788
16789 #[derive(Clone, Debug)]
16810 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
16811
16812 impl ListLocations {
16813 pub(crate) fn new(
16814 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16815 ) -> Self {
16816 Self(RequestBuilder::new(stub))
16817 }
16818
16819 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
16821 mut self,
16822 v: V,
16823 ) -> Self {
16824 self.0.request = v.into();
16825 self
16826 }
16827
16828 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16830 self.0.options = v.into();
16831 self
16832 }
16833
16834 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
16836 (*self.0.stub)
16837 .list_locations(self.0.request, self.0.options)
16838 .await
16839 .map(crate::Response::into_body)
16840 }
16841
16842 pub fn by_page(
16844 self,
16845 ) -> impl google_cloud_gax::paginator::Paginator<
16846 google_cloud_location::model::ListLocationsResponse,
16847 crate::Error,
16848 > {
16849 use std::clone::Clone;
16850 let token = self.0.request.page_token.clone();
16851 let execute = move |token: String| {
16852 let mut builder = self.clone();
16853 builder.0.request = builder.0.request.set_page_token(token);
16854 builder.send()
16855 };
16856 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16857 }
16858
16859 pub fn by_item(
16861 self,
16862 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16863 google_cloud_location::model::ListLocationsResponse,
16864 crate::Error,
16865 > {
16866 use google_cloud_gax::paginator::Paginator;
16867 self.by_page().items()
16868 }
16869
16870 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16872 self.0.request.name = v.into();
16873 self
16874 }
16875
16876 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16878 self.0.request.filter = v.into();
16879 self
16880 }
16881
16882 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16884 self.0.request.page_size = v.into();
16885 self
16886 }
16887
16888 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16890 self.0.request.page_token = v.into();
16891 self
16892 }
16893 }
16894
16895 #[doc(hidden)]
16896 impl crate::RequestBuilder for ListLocations {
16897 fn request_options(&mut self) -> &mut crate::RequestOptions {
16898 &mut self.0.options
16899 }
16900 }
16901
16902 #[derive(Clone, Debug)]
16919 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
16920
16921 impl GetLocation {
16922 pub(crate) fn new(
16923 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16924 ) -> Self {
16925 Self(RequestBuilder::new(stub))
16926 }
16927
16928 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
16930 mut self,
16931 v: V,
16932 ) -> Self {
16933 self.0.request = v.into();
16934 self
16935 }
16936
16937 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16939 self.0.options = v.into();
16940 self
16941 }
16942
16943 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
16945 (*self.0.stub)
16946 .get_location(self.0.request, self.0.options)
16947 .await
16948 .map(crate::Response::into_body)
16949 }
16950
16951 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16953 self.0.request.name = v.into();
16954 self
16955 }
16956 }
16957
16958 #[doc(hidden)]
16959 impl crate::RequestBuilder for GetLocation {
16960 fn request_options(&mut self) -> &mut crate::RequestOptions {
16961 &mut self.0.options
16962 }
16963 }
16964
16965 #[derive(Clone, Debug)]
16982 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
16983
16984 impl SetIamPolicy {
16985 pub(crate) fn new(
16986 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
16987 ) -> Self {
16988 Self(RequestBuilder::new(stub))
16989 }
16990
16991 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
16993 mut self,
16994 v: V,
16995 ) -> Self {
16996 self.0.request = v.into();
16997 self
16998 }
16999
17000 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17002 self.0.options = v.into();
17003 self
17004 }
17005
17006 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
17008 (*self.0.stub)
17009 .set_iam_policy(self.0.request, self.0.options)
17010 .await
17011 .map(crate::Response::into_body)
17012 }
17013
17014 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
17018 self.0.request.resource = v.into();
17019 self
17020 }
17021
17022 pub fn set_policy<T>(mut self, v: T) -> Self
17026 where
17027 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
17028 {
17029 self.0.request.policy = std::option::Option::Some(v.into());
17030 self
17031 }
17032
17033 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
17037 where
17038 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
17039 {
17040 self.0.request.policy = v.map(|x| x.into());
17041 self
17042 }
17043
17044 pub fn set_update_mask<T>(mut self, v: T) -> Self
17046 where
17047 T: std::convert::Into<wkt::FieldMask>,
17048 {
17049 self.0.request.update_mask = std::option::Option::Some(v.into());
17050 self
17051 }
17052
17053 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17055 where
17056 T: std::convert::Into<wkt::FieldMask>,
17057 {
17058 self.0.request.update_mask = v.map(|x| x.into());
17059 self
17060 }
17061 }
17062
17063 #[doc(hidden)]
17064 impl crate::RequestBuilder for SetIamPolicy {
17065 fn request_options(&mut self) -> &mut crate::RequestOptions {
17066 &mut self.0.options
17067 }
17068 }
17069
17070 #[derive(Clone, Debug)]
17087 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
17088
17089 impl GetIamPolicy {
17090 pub(crate) fn new(
17091 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17092 ) -> Self {
17093 Self(RequestBuilder::new(stub))
17094 }
17095
17096 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
17098 mut self,
17099 v: V,
17100 ) -> Self {
17101 self.0.request = v.into();
17102 self
17103 }
17104
17105 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17107 self.0.options = v.into();
17108 self
17109 }
17110
17111 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
17113 (*self.0.stub)
17114 .get_iam_policy(self.0.request, self.0.options)
17115 .await
17116 .map(crate::Response::into_body)
17117 }
17118
17119 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
17123 self.0.request.resource = v.into();
17124 self
17125 }
17126
17127 pub fn set_options<T>(mut self, v: T) -> Self
17129 where
17130 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
17131 {
17132 self.0.request.options = std::option::Option::Some(v.into());
17133 self
17134 }
17135
17136 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
17138 where
17139 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
17140 {
17141 self.0.request.options = v.map(|x| x.into());
17142 self
17143 }
17144 }
17145
17146 #[doc(hidden)]
17147 impl crate::RequestBuilder for GetIamPolicy {
17148 fn request_options(&mut self) -> &mut crate::RequestOptions {
17149 &mut self.0.options
17150 }
17151 }
17152
17153 #[derive(Clone, Debug)]
17170 pub struct TestIamPermissions(
17171 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
17172 );
17173
17174 impl TestIamPermissions {
17175 pub(crate) fn new(
17176 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17177 ) -> Self {
17178 Self(RequestBuilder::new(stub))
17179 }
17180
17181 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
17183 mut self,
17184 v: V,
17185 ) -> Self {
17186 self.0.request = v.into();
17187 self
17188 }
17189
17190 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17192 self.0.options = v.into();
17193 self
17194 }
17195
17196 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
17198 (*self.0.stub)
17199 .test_iam_permissions(self.0.request, self.0.options)
17200 .await
17201 .map(crate::Response::into_body)
17202 }
17203
17204 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
17208 self.0.request.resource = v.into();
17209 self
17210 }
17211
17212 pub fn set_permissions<T, V>(mut self, v: T) -> Self
17216 where
17217 T: std::iter::IntoIterator<Item = V>,
17218 V: std::convert::Into<std::string::String>,
17219 {
17220 use std::iter::Iterator;
17221 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
17222 self
17223 }
17224 }
17225
17226 #[doc(hidden)]
17227 impl crate::RequestBuilder for TestIamPermissions {
17228 fn request_options(&mut self) -> &mut crate::RequestOptions {
17229 &mut self.0.options
17230 }
17231 }
17232
17233 #[derive(Clone, Debug)]
17254 pub struct ListOperations(
17255 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
17256 );
17257
17258 impl ListOperations {
17259 pub(crate) fn new(
17260 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17261 ) -> Self {
17262 Self(RequestBuilder::new(stub))
17263 }
17264
17265 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
17267 mut self,
17268 v: V,
17269 ) -> Self {
17270 self.0.request = v.into();
17271 self
17272 }
17273
17274 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17276 self.0.options = v.into();
17277 self
17278 }
17279
17280 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
17282 (*self.0.stub)
17283 .list_operations(self.0.request, self.0.options)
17284 .await
17285 .map(crate::Response::into_body)
17286 }
17287
17288 pub fn by_page(
17290 self,
17291 ) -> impl google_cloud_gax::paginator::Paginator<
17292 google_cloud_longrunning::model::ListOperationsResponse,
17293 crate::Error,
17294 > {
17295 use std::clone::Clone;
17296 let token = self.0.request.page_token.clone();
17297 let execute = move |token: String| {
17298 let mut builder = self.clone();
17299 builder.0.request = builder.0.request.set_page_token(token);
17300 builder.send()
17301 };
17302 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17303 }
17304
17305 pub fn by_item(
17307 self,
17308 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17309 google_cloud_longrunning::model::ListOperationsResponse,
17310 crate::Error,
17311 > {
17312 use google_cloud_gax::paginator::Paginator;
17313 self.by_page().items()
17314 }
17315
17316 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17318 self.0.request.name = v.into();
17319 self
17320 }
17321
17322 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17324 self.0.request.filter = v.into();
17325 self
17326 }
17327
17328 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17330 self.0.request.page_size = v.into();
17331 self
17332 }
17333
17334 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17336 self.0.request.page_token = v.into();
17337 self
17338 }
17339
17340 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
17342 self.0.request.return_partial_success = v.into();
17343 self
17344 }
17345 }
17346
17347 #[doc(hidden)]
17348 impl crate::RequestBuilder for ListOperations {
17349 fn request_options(&mut self) -> &mut crate::RequestOptions {
17350 &mut self.0.options
17351 }
17352 }
17353
17354 #[derive(Clone, Debug)]
17371 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
17372
17373 impl GetOperation {
17374 pub(crate) fn new(
17375 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17376 ) -> Self {
17377 Self(RequestBuilder::new(stub))
17378 }
17379
17380 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
17382 mut self,
17383 v: V,
17384 ) -> Self {
17385 self.0.request = v.into();
17386 self
17387 }
17388
17389 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17391 self.0.options = v.into();
17392 self
17393 }
17394
17395 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17397 (*self.0.stub)
17398 .get_operation(self.0.request, self.0.options)
17399 .await
17400 .map(crate::Response::into_body)
17401 }
17402
17403 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17405 self.0.request.name = v.into();
17406 self
17407 }
17408 }
17409
17410 #[doc(hidden)]
17411 impl crate::RequestBuilder for GetOperation {
17412 fn request_options(&mut self) -> &mut crate::RequestOptions {
17413 &mut self.0.options
17414 }
17415 }
17416
17417 #[derive(Clone, Debug)]
17434 pub struct DeleteOperation(
17435 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
17436 );
17437
17438 impl DeleteOperation {
17439 pub(crate) fn new(
17440 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17441 ) -> Self {
17442 Self(RequestBuilder::new(stub))
17443 }
17444
17445 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
17447 mut self,
17448 v: V,
17449 ) -> Self {
17450 self.0.request = v.into();
17451 self
17452 }
17453
17454 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17456 self.0.options = v.into();
17457 self
17458 }
17459
17460 pub async fn send(self) -> Result<()> {
17462 (*self.0.stub)
17463 .delete_operation(self.0.request, self.0.options)
17464 .await
17465 .map(crate::Response::into_body)
17466 }
17467
17468 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17470 self.0.request.name = v.into();
17471 self
17472 }
17473 }
17474
17475 #[doc(hidden)]
17476 impl crate::RequestBuilder for DeleteOperation {
17477 fn request_options(&mut self) -> &mut crate::RequestOptions {
17478 &mut self.0.options
17479 }
17480 }
17481
17482 #[derive(Clone, Debug)]
17499 pub struct CancelOperation(
17500 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
17501 );
17502
17503 impl CancelOperation {
17504 pub(crate) fn new(
17505 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
17506 ) -> Self {
17507 Self(RequestBuilder::new(stub))
17508 }
17509
17510 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
17512 mut self,
17513 v: V,
17514 ) -> Self {
17515 self.0.request = v.into();
17516 self
17517 }
17518
17519 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17521 self.0.options = v.into();
17522 self
17523 }
17524
17525 pub async fn send(self) -> Result<()> {
17527 (*self.0.stub)
17528 .cancel_operation(self.0.request, self.0.options)
17529 .await
17530 .map(crate::Response::into_body)
17531 }
17532
17533 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17535 self.0.request.name = v.into();
17536 self
17537 }
17538 }
17539
17540 #[doc(hidden)]
17541 impl crate::RequestBuilder for CancelOperation {
17542 fn request_options(&mut self) -> &mut crate::RequestOptions {
17543 &mut self.0.options
17544 }
17545 }
17546}
17547
17548pub mod dataplex_service {
17550 use crate::Result;
17551
17552 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17566
17567 pub(crate) mod client {
17568 use super::super::super::client::DataplexService;
17569 pub struct Factory;
17570 impl crate::ClientFactory for Factory {
17571 type Client = DataplexService;
17572 type Credentials = gaxi::options::Credentials;
17573 async fn build(
17574 self,
17575 config: gaxi::options::ClientConfig,
17576 ) -> crate::ClientBuilderResult<Self::Client> {
17577 Self::Client::new(config).await
17578 }
17579 }
17580 }
17581
17582 #[derive(Clone, Debug)]
17584 pub(crate) struct RequestBuilder<R: std::default::Default> {
17585 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17586 request: R,
17587 options: crate::RequestOptions,
17588 }
17589
17590 impl<R> RequestBuilder<R>
17591 where
17592 R: std::default::Default,
17593 {
17594 pub(crate) fn new(
17595 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17596 ) -> Self {
17597 Self {
17598 stub,
17599 request: R::default(),
17600 options: crate::RequestOptions::default(),
17601 }
17602 }
17603 }
17604
17605 #[derive(Clone, Debug)]
17623 pub struct CreateLake(RequestBuilder<crate::model::CreateLakeRequest>);
17624
17625 impl CreateLake {
17626 pub(crate) fn new(
17627 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17628 ) -> Self {
17629 Self(RequestBuilder::new(stub))
17630 }
17631
17632 pub fn with_request<V: Into<crate::model::CreateLakeRequest>>(mut self, v: V) -> Self {
17634 self.0.request = v.into();
17635 self
17636 }
17637
17638 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17640 self.0.options = v.into();
17641 self
17642 }
17643
17644 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17651 (*self.0.stub)
17652 .create_lake(self.0.request, self.0.options)
17653 .await
17654 .map(crate::Response::into_body)
17655 }
17656
17657 pub fn poller(
17659 self,
17660 ) -> impl google_cloud_lro::Poller<crate::model::Lake, crate::model::OperationMetadata>
17661 {
17662 type Operation = google_cloud_lro::internal::Operation<
17663 crate::model::Lake,
17664 crate::model::OperationMetadata,
17665 >;
17666 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17667 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17668
17669 let stub = self.0.stub.clone();
17670 let mut options = self.0.options.clone();
17671 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17672 let query = move |name| {
17673 let stub = stub.clone();
17674 let options = options.clone();
17675 async {
17676 let op = GetOperation::new(stub)
17677 .set_name(name)
17678 .with_options(options)
17679 .send()
17680 .await?;
17681 Ok(Operation::new(op))
17682 }
17683 };
17684
17685 let start = move || async {
17686 let op = self.send().await?;
17687 Ok(Operation::new(op))
17688 };
17689
17690 google_cloud_lro::internal::new_poller(
17691 polling_error_policy,
17692 polling_backoff_policy,
17693 start,
17694 query,
17695 )
17696 }
17697
17698 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17702 self.0.request.parent = v.into();
17703 self
17704 }
17705
17706 pub fn set_lake_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17710 self.0.request.lake_id = v.into();
17711 self
17712 }
17713
17714 pub fn set_lake<T>(mut self, v: T) -> Self
17718 where
17719 T: std::convert::Into<crate::model::Lake>,
17720 {
17721 self.0.request.lake = std::option::Option::Some(v.into());
17722 self
17723 }
17724
17725 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
17729 where
17730 T: std::convert::Into<crate::model::Lake>,
17731 {
17732 self.0.request.lake = v.map(|x| x.into());
17733 self
17734 }
17735
17736 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17738 self.0.request.validate_only = v.into();
17739 self
17740 }
17741 }
17742
17743 #[doc(hidden)]
17744 impl crate::RequestBuilder for CreateLake {
17745 fn request_options(&mut self) -> &mut crate::RequestOptions {
17746 &mut self.0.options
17747 }
17748 }
17749
17750 #[derive(Clone, Debug)]
17768 pub struct UpdateLake(RequestBuilder<crate::model::UpdateLakeRequest>);
17769
17770 impl UpdateLake {
17771 pub(crate) fn new(
17772 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17773 ) -> Self {
17774 Self(RequestBuilder::new(stub))
17775 }
17776
17777 pub fn with_request<V: Into<crate::model::UpdateLakeRequest>>(mut self, v: V) -> Self {
17779 self.0.request = v.into();
17780 self
17781 }
17782
17783 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17785 self.0.options = v.into();
17786 self
17787 }
17788
17789 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17796 (*self.0.stub)
17797 .update_lake(self.0.request, self.0.options)
17798 .await
17799 .map(crate::Response::into_body)
17800 }
17801
17802 pub fn poller(
17804 self,
17805 ) -> impl google_cloud_lro::Poller<crate::model::Lake, crate::model::OperationMetadata>
17806 {
17807 type Operation = google_cloud_lro::internal::Operation<
17808 crate::model::Lake,
17809 crate::model::OperationMetadata,
17810 >;
17811 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17812 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17813
17814 let stub = self.0.stub.clone();
17815 let mut options = self.0.options.clone();
17816 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17817 let query = move |name| {
17818 let stub = stub.clone();
17819 let options = options.clone();
17820 async {
17821 let op = GetOperation::new(stub)
17822 .set_name(name)
17823 .with_options(options)
17824 .send()
17825 .await?;
17826 Ok(Operation::new(op))
17827 }
17828 };
17829
17830 let start = move || async {
17831 let op = self.send().await?;
17832 Ok(Operation::new(op))
17833 };
17834
17835 google_cloud_lro::internal::new_poller(
17836 polling_error_policy,
17837 polling_backoff_policy,
17838 start,
17839 query,
17840 )
17841 }
17842
17843 pub fn set_update_mask<T>(mut self, v: T) -> Self
17847 where
17848 T: std::convert::Into<wkt::FieldMask>,
17849 {
17850 self.0.request.update_mask = std::option::Option::Some(v.into());
17851 self
17852 }
17853
17854 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17858 where
17859 T: std::convert::Into<wkt::FieldMask>,
17860 {
17861 self.0.request.update_mask = v.map(|x| x.into());
17862 self
17863 }
17864
17865 pub fn set_lake<T>(mut self, v: T) -> Self
17869 where
17870 T: std::convert::Into<crate::model::Lake>,
17871 {
17872 self.0.request.lake = std::option::Option::Some(v.into());
17873 self
17874 }
17875
17876 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
17880 where
17881 T: std::convert::Into<crate::model::Lake>,
17882 {
17883 self.0.request.lake = v.map(|x| x.into());
17884 self
17885 }
17886
17887 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17889 self.0.request.validate_only = v.into();
17890 self
17891 }
17892 }
17893
17894 #[doc(hidden)]
17895 impl crate::RequestBuilder for UpdateLake {
17896 fn request_options(&mut self) -> &mut crate::RequestOptions {
17897 &mut self.0.options
17898 }
17899 }
17900
17901 #[derive(Clone, Debug)]
17919 pub struct DeleteLake(RequestBuilder<crate::model::DeleteLakeRequest>);
17920
17921 impl DeleteLake {
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::DeleteLakeRequest>>(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<google_cloud_longrunning::model::Operation> {
17947 (*self.0.stub)
17948 .delete_lake(self.0.request, self.0.options)
17949 .await
17950 .map(crate::Response::into_body)
17951 }
17952
17953 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17955 type Operation =
17956 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17957 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17958 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17959
17960 let stub = self.0.stub.clone();
17961 let mut options = self.0.options.clone();
17962 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17963 let query = move |name| {
17964 let stub = stub.clone();
17965 let options = options.clone();
17966 async {
17967 let op = GetOperation::new(stub)
17968 .set_name(name)
17969 .with_options(options)
17970 .send()
17971 .await?;
17972 Ok(Operation::new(op))
17973 }
17974 };
17975
17976 let start = move || async {
17977 let op = self.send().await?;
17978 Ok(Operation::new(op))
17979 };
17980
17981 google_cloud_lro::internal::new_unit_response_poller(
17982 polling_error_policy,
17983 polling_backoff_policy,
17984 start,
17985 query,
17986 )
17987 }
17988
17989 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17993 self.0.request.name = v.into();
17994 self
17995 }
17996 }
17997
17998 #[doc(hidden)]
17999 impl crate::RequestBuilder for DeleteLake {
18000 fn request_options(&mut self) -> &mut crate::RequestOptions {
18001 &mut self.0.options
18002 }
18003 }
18004
18005 #[derive(Clone, Debug)]
18026 pub struct ListLakes(RequestBuilder<crate::model::ListLakesRequest>);
18027
18028 impl ListLakes {
18029 pub(crate) fn new(
18030 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18031 ) -> Self {
18032 Self(RequestBuilder::new(stub))
18033 }
18034
18035 pub fn with_request<V: Into<crate::model::ListLakesRequest>>(mut self, v: V) -> Self {
18037 self.0.request = v.into();
18038 self
18039 }
18040
18041 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18043 self.0.options = v.into();
18044 self
18045 }
18046
18047 pub async fn send(self) -> Result<crate::model::ListLakesResponse> {
18049 (*self.0.stub)
18050 .list_lakes(self.0.request, self.0.options)
18051 .await
18052 .map(crate::Response::into_body)
18053 }
18054
18055 pub fn by_page(
18057 self,
18058 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListLakesResponse, crate::Error>
18059 {
18060 use std::clone::Clone;
18061 let token = self.0.request.page_token.clone();
18062 let execute = move |token: String| {
18063 let mut builder = self.clone();
18064 builder.0.request = builder.0.request.set_page_token(token);
18065 builder.send()
18066 };
18067 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18068 }
18069
18070 pub fn by_item(
18072 self,
18073 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListLakesResponse, crate::Error>
18074 {
18075 use google_cloud_gax::paginator::Paginator;
18076 self.by_page().items()
18077 }
18078
18079 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18083 self.0.request.parent = v.into();
18084 self
18085 }
18086
18087 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18089 self.0.request.page_size = v.into();
18090 self
18091 }
18092
18093 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18095 self.0.request.page_token = v.into();
18096 self
18097 }
18098
18099 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18101 self.0.request.filter = v.into();
18102 self
18103 }
18104
18105 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
18107 self.0.request.order_by = v.into();
18108 self
18109 }
18110 }
18111
18112 #[doc(hidden)]
18113 impl crate::RequestBuilder for ListLakes {
18114 fn request_options(&mut self) -> &mut crate::RequestOptions {
18115 &mut self.0.options
18116 }
18117 }
18118
18119 #[derive(Clone, Debug)]
18136 pub struct GetLake(RequestBuilder<crate::model::GetLakeRequest>);
18137
18138 impl GetLake {
18139 pub(crate) fn new(
18140 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18141 ) -> Self {
18142 Self(RequestBuilder::new(stub))
18143 }
18144
18145 pub fn with_request<V: Into<crate::model::GetLakeRequest>>(mut self, v: V) -> Self {
18147 self.0.request = v.into();
18148 self
18149 }
18150
18151 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18153 self.0.options = v.into();
18154 self
18155 }
18156
18157 pub async fn send(self) -> Result<crate::model::Lake> {
18159 (*self.0.stub)
18160 .get_lake(self.0.request, self.0.options)
18161 .await
18162 .map(crate::Response::into_body)
18163 }
18164
18165 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18169 self.0.request.name = v.into();
18170 self
18171 }
18172 }
18173
18174 #[doc(hidden)]
18175 impl crate::RequestBuilder for GetLake {
18176 fn request_options(&mut self) -> &mut crate::RequestOptions {
18177 &mut self.0.options
18178 }
18179 }
18180
18181 #[derive(Clone, Debug)]
18202 pub struct ListLakeActions(RequestBuilder<crate::model::ListLakeActionsRequest>);
18203
18204 impl ListLakeActions {
18205 pub(crate) fn new(
18206 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18207 ) -> Self {
18208 Self(RequestBuilder::new(stub))
18209 }
18210
18211 pub fn with_request<V: Into<crate::model::ListLakeActionsRequest>>(mut self, v: V) -> Self {
18213 self.0.request = v.into();
18214 self
18215 }
18216
18217 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18219 self.0.options = v.into();
18220 self
18221 }
18222
18223 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
18225 (*self.0.stub)
18226 .list_lake_actions(self.0.request, self.0.options)
18227 .await
18228 .map(crate::Response::into_body)
18229 }
18230
18231 pub fn by_page(
18233 self,
18234 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
18235 {
18236 use std::clone::Clone;
18237 let token = self.0.request.page_token.clone();
18238 let execute = move |token: String| {
18239 let mut builder = self.clone();
18240 builder.0.request = builder.0.request.set_page_token(token);
18241 builder.send()
18242 };
18243 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18244 }
18245
18246 pub fn by_item(
18248 self,
18249 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18250 crate::model::ListActionsResponse,
18251 crate::Error,
18252 > {
18253 use google_cloud_gax::paginator::Paginator;
18254 self.by_page().items()
18255 }
18256
18257 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18261 self.0.request.parent = v.into();
18262 self
18263 }
18264
18265 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18267 self.0.request.page_size = v.into();
18268 self
18269 }
18270
18271 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18273 self.0.request.page_token = v.into();
18274 self
18275 }
18276 }
18277
18278 #[doc(hidden)]
18279 impl crate::RequestBuilder for ListLakeActions {
18280 fn request_options(&mut self) -> &mut crate::RequestOptions {
18281 &mut self.0.options
18282 }
18283 }
18284
18285 #[derive(Clone, Debug)]
18303 pub struct CreateZone(RequestBuilder<crate::model::CreateZoneRequest>);
18304
18305 impl CreateZone {
18306 pub(crate) fn new(
18307 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18308 ) -> Self {
18309 Self(RequestBuilder::new(stub))
18310 }
18311
18312 pub fn with_request<V: Into<crate::model::CreateZoneRequest>>(mut self, v: V) -> Self {
18314 self.0.request = v.into();
18315 self
18316 }
18317
18318 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18320 self.0.options = v.into();
18321 self
18322 }
18323
18324 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18331 (*self.0.stub)
18332 .create_zone(self.0.request, self.0.options)
18333 .await
18334 .map(crate::Response::into_body)
18335 }
18336
18337 pub fn poller(
18339 self,
18340 ) -> impl google_cloud_lro::Poller<crate::model::Zone, crate::model::OperationMetadata>
18341 {
18342 type Operation = google_cloud_lro::internal::Operation<
18343 crate::model::Zone,
18344 crate::model::OperationMetadata,
18345 >;
18346 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18347 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18348
18349 let stub = self.0.stub.clone();
18350 let mut options = self.0.options.clone();
18351 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18352 let query = move |name| {
18353 let stub = stub.clone();
18354 let options = options.clone();
18355 async {
18356 let op = GetOperation::new(stub)
18357 .set_name(name)
18358 .with_options(options)
18359 .send()
18360 .await?;
18361 Ok(Operation::new(op))
18362 }
18363 };
18364
18365 let start = move || async {
18366 let op = self.send().await?;
18367 Ok(Operation::new(op))
18368 };
18369
18370 google_cloud_lro::internal::new_poller(
18371 polling_error_policy,
18372 polling_backoff_policy,
18373 start,
18374 query,
18375 )
18376 }
18377
18378 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18382 self.0.request.parent = v.into();
18383 self
18384 }
18385
18386 pub fn set_zone_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18390 self.0.request.zone_id = v.into();
18391 self
18392 }
18393
18394 pub fn set_zone<T>(mut self, v: T) -> Self
18398 where
18399 T: std::convert::Into<crate::model::Zone>,
18400 {
18401 self.0.request.zone = std::option::Option::Some(v.into());
18402 self
18403 }
18404
18405 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
18409 where
18410 T: std::convert::Into<crate::model::Zone>,
18411 {
18412 self.0.request.zone = v.map(|x| x.into());
18413 self
18414 }
18415
18416 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
18418 self.0.request.validate_only = v.into();
18419 self
18420 }
18421 }
18422
18423 #[doc(hidden)]
18424 impl crate::RequestBuilder for CreateZone {
18425 fn request_options(&mut self) -> &mut crate::RequestOptions {
18426 &mut self.0.options
18427 }
18428 }
18429
18430 #[derive(Clone, Debug)]
18448 pub struct UpdateZone(RequestBuilder<crate::model::UpdateZoneRequest>);
18449
18450 impl UpdateZone {
18451 pub(crate) fn new(
18452 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18453 ) -> Self {
18454 Self(RequestBuilder::new(stub))
18455 }
18456
18457 pub fn with_request<V: Into<crate::model::UpdateZoneRequest>>(mut self, v: V) -> Self {
18459 self.0.request = v.into();
18460 self
18461 }
18462
18463 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18465 self.0.options = v.into();
18466 self
18467 }
18468
18469 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18476 (*self.0.stub)
18477 .update_zone(self.0.request, self.0.options)
18478 .await
18479 .map(crate::Response::into_body)
18480 }
18481
18482 pub fn poller(
18484 self,
18485 ) -> impl google_cloud_lro::Poller<crate::model::Zone, crate::model::OperationMetadata>
18486 {
18487 type Operation = google_cloud_lro::internal::Operation<
18488 crate::model::Zone,
18489 crate::model::OperationMetadata,
18490 >;
18491 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18492 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18493
18494 let stub = self.0.stub.clone();
18495 let mut options = self.0.options.clone();
18496 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18497 let query = move |name| {
18498 let stub = stub.clone();
18499 let options = options.clone();
18500 async {
18501 let op = GetOperation::new(stub)
18502 .set_name(name)
18503 .with_options(options)
18504 .send()
18505 .await?;
18506 Ok(Operation::new(op))
18507 }
18508 };
18509
18510 let start = move || async {
18511 let op = self.send().await?;
18512 Ok(Operation::new(op))
18513 };
18514
18515 google_cloud_lro::internal::new_poller(
18516 polling_error_policy,
18517 polling_backoff_policy,
18518 start,
18519 query,
18520 )
18521 }
18522
18523 pub fn set_update_mask<T>(mut self, v: T) -> Self
18527 where
18528 T: std::convert::Into<wkt::FieldMask>,
18529 {
18530 self.0.request.update_mask = std::option::Option::Some(v.into());
18531 self
18532 }
18533
18534 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18538 where
18539 T: std::convert::Into<wkt::FieldMask>,
18540 {
18541 self.0.request.update_mask = v.map(|x| x.into());
18542 self
18543 }
18544
18545 pub fn set_zone<T>(mut self, v: T) -> Self
18549 where
18550 T: std::convert::Into<crate::model::Zone>,
18551 {
18552 self.0.request.zone = std::option::Option::Some(v.into());
18553 self
18554 }
18555
18556 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
18560 where
18561 T: std::convert::Into<crate::model::Zone>,
18562 {
18563 self.0.request.zone = v.map(|x| x.into());
18564 self
18565 }
18566
18567 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
18569 self.0.request.validate_only = v.into();
18570 self
18571 }
18572 }
18573
18574 #[doc(hidden)]
18575 impl crate::RequestBuilder for UpdateZone {
18576 fn request_options(&mut self) -> &mut crate::RequestOptions {
18577 &mut self.0.options
18578 }
18579 }
18580
18581 #[derive(Clone, Debug)]
18599 pub struct DeleteZone(RequestBuilder<crate::model::DeleteZoneRequest>);
18600
18601 impl DeleteZone {
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::DeleteZoneRequest>>(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<google_cloud_longrunning::model::Operation> {
18627 (*self.0.stub)
18628 .delete_zone(self.0.request, self.0.options)
18629 .await
18630 .map(crate::Response::into_body)
18631 }
18632
18633 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18635 type Operation =
18636 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18637 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18638 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18639
18640 let stub = self.0.stub.clone();
18641 let mut options = self.0.options.clone();
18642 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18643 let query = move |name| {
18644 let stub = stub.clone();
18645 let options = options.clone();
18646 async {
18647 let op = GetOperation::new(stub)
18648 .set_name(name)
18649 .with_options(options)
18650 .send()
18651 .await?;
18652 Ok(Operation::new(op))
18653 }
18654 };
18655
18656 let start = move || async {
18657 let op = self.send().await?;
18658 Ok(Operation::new(op))
18659 };
18660
18661 google_cloud_lro::internal::new_unit_response_poller(
18662 polling_error_policy,
18663 polling_backoff_policy,
18664 start,
18665 query,
18666 )
18667 }
18668
18669 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18673 self.0.request.name = v.into();
18674 self
18675 }
18676 }
18677
18678 #[doc(hidden)]
18679 impl crate::RequestBuilder for DeleteZone {
18680 fn request_options(&mut self) -> &mut crate::RequestOptions {
18681 &mut self.0.options
18682 }
18683 }
18684
18685 #[derive(Clone, Debug)]
18706 pub struct ListZones(RequestBuilder<crate::model::ListZonesRequest>);
18707
18708 impl ListZones {
18709 pub(crate) fn new(
18710 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18711 ) -> Self {
18712 Self(RequestBuilder::new(stub))
18713 }
18714
18715 pub fn with_request<V: Into<crate::model::ListZonesRequest>>(mut self, v: V) -> Self {
18717 self.0.request = v.into();
18718 self
18719 }
18720
18721 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18723 self.0.options = v.into();
18724 self
18725 }
18726
18727 pub async fn send(self) -> Result<crate::model::ListZonesResponse> {
18729 (*self.0.stub)
18730 .list_zones(self.0.request, self.0.options)
18731 .await
18732 .map(crate::Response::into_body)
18733 }
18734
18735 pub fn by_page(
18737 self,
18738 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListZonesResponse, crate::Error>
18739 {
18740 use std::clone::Clone;
18741 let token = self.0.request.page_token.clone();
18742 let execute = move |token: String| {
18743 let mut builder = self.clone();
18744 builder.0.request = builder.0.request.set_page_token(token);
18745 builder.send()
18746 };
18747 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18748 }
18749
18750 pub fn by_item(
18752 self,
18753 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListZonesResponse, crate::Error>
18754 {
18755 use google_cloud_gax::paginator::Paginator;
18756 self.by_page().items()
18757 }
18758
18759 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18763 self.0.request.parent = v.into();
18764 self
18765 }
18766
18767 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18769 self.0.request.page_size = v.into();
18770 self
18771 }
18772
18773 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18775 self.0.request.page_token = v.into();
18776 self
18777 }
18778
18779 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18781 self.0.request.filter = v.into();
18782 self
18783 }
18784
18785 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
18787 self.0.request.order_by = v.into();
18788 self
18789 }
18790 }
18791
18792 #[doc(hidden)]
18793 impl crate::RequestBuilder for ListZones {
18794 fn request_options(&mut self) -> &mut crate::RequestOptions {
18795 &mut self.0.options
18796 }
18797 }
18798
18799 #[derive(Clone, Debug)]
18816 pub struct GetZone(RequestBuilder<crate::model::GetZoneRequest>);
18817
18818 impl GetZone {
18819 pub(crate) fn new(
18820 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18821 ) -> Self {
18822 Self(RequestBuilder::new(stub))
18823 }
18824
18825 pub fn with_request<V: Into<crate::model::GetZoneRequest>>(mut self, v: V) -> Self {
18827 self.0.request = v.into();
18828 self
18829 }
18830
18831 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18833 self.0.options = v.into();
18834 self
18835 }
18836
18837 pub async fn send(self) -> Result<crate::model::Zone> {
18839 (*self.0.stub)
18840 .get_zone(self.0.request, self.0.options)
18841 .await
18842 .map(crate::Response::into_body)
18843 }
18844
18845 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18849 self.0.request.name = v.into();
18850 self
18851 }
18852 }
18853
18854 #[doc(hidden)]
18855 impl crate::RequestBuilder for GetZone {
18856 fn request_options(&mut self) -> &mut crate::RequestOptions {
18857 &mut self.0.options
18858 }
18859 }
18860
18861 #[derive(Clone, Debug)]
18882 pub struct ListZoneActions(RequestBuilder<crate::model::ListZoneActionsRequest>);
18883
18884 impl ListZoneActions {
18885 pub(crate) fn new(
18886 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18887 ) -> Self {
18888 Self(RequestBuilder::new(stub))
18889 }
18890
18891 pub fn with_request<V: Into<crate::model::ListZoneActionsRequest>>(mut self, v: V) -> Self {
18893 self.0.request = v.into();
18894 self
18895 }
18896
18897 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18899 self.0.options = v.into();
18900 self
18901 }
18902
18903 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
18905 (*self.0.stub)
18906 .list_zone_actions(self.0.request, self.0.options)
18907 .await
18908 .map(crate::Response::into_body)
18909 }
18910
18911 pub fn by_page(
18913 self,
18914 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
18915 {
18916 use std::clone::Clone;
18917 let token = self.0.request.page_token.clone();
18918 let execute = move |token: String| {
18919 let mut builder = self.clone();
18920 builder.0.request = builder.0.request.set_page_token(token);
18921 builder.send()
18922 };
18923 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18924 }
18925
18926 pub fn by_item(
18928 self,
18929 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18930 crate::model::ListActionsResponse,
18931 crate::Error,
18932 > {
18933 use google_cloud_gax::paginator::Paginator;
18934 self.by_page().items()
18935 }
18936
18937 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18941 self.0.request.parent = v.into();
18942 self
18943 }
18944
18945 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18947 self.0.request.page_size = v.into();
18948 self
18949 }
18950
18951 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18953 self.0.request.page_token = v.into();
18954 self
18955 }
18956 }
18957
18958 #[doc(hidden)]
18959 impl crate::RequestBuilder for ListZoneActions {
18960 fn request_options(&mut self) -> &mut crate::RequestOptions {
18961 &mut self.0.options
18962 }
18963 }
18964
18965 #[derive(Clone, Debug)]
18983 pub struct CreateAsset(RequestBuilder<crate::model::CreateAssetRequest>);
18984
18985 impl CreateAsset {
18986 pub(crate) fn new(
18987 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18988 ) -> Self {
18989 Self(RequestBuilder::new(stub))
18990 }
18991
18992 pub fn with_request<V: Into<crate::model::CreateAssetRequest>>(mut self, v: V) -> Self {
18994 self.0.request = v.into();
18995 self
18996 }
18997
18998 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19000 self.0.options = v.into();
19001 self
19002 }
19003
19004 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19011 (*self.0.stub)
19012 .create_asset(self.0.request, self.0.options)
19013 .await
19014 .map(crate::Response::into_body)
19015 }
19016
19017 pub fn poller(
19019 self,
19020 ) -> impl google_cloud_lro::Poller<crate::model::Asset, crate::model::OperationMetadata>
19021 {
19022 type Operation = google_cloud_lro::internal::Operation<
19023 crate::model::Asset,
19024 crate::model::OperationMetadata,
19025 >;
19026 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19027 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19028
19029 let stub = self.0.stub.clone();
19030 let mut options = self.0.options.clone();
19031 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19032 let query = move |name| {
19033 let stub = stub.clone();
19034 let options = options.clone();
19035 async {
19036 let op = GetOperation::new(stub)
19037 .set_name(name)
19038 .with_options(options)
19039 .send()
19040 .await?;
19041 Ok(Operation::new(op))
19042 }
19043 };
19044
19045 let start = move || async {
19046 let op = self.send().await?;
19047 Ok(Operation::new(op))
19048 };
19049
19050 google_cloud_lro::internal::new_poller(
19051 polling_error_policy,
19052 polling_backoff_policy,
19053 start,
19054 query,
19055 )
19056 }
19057
19058 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19062 self.0.request.parent = v.into();
19063 self
19064 }
19065
19066 pub fn set_asset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19070 self.0.request.asset_id = v.into();
19071 self
19072 }
19073
19074 pub fn set_asset<T>(mut self, v: T) -> Self
19078 where
19079 T: std::convert::Into<crate::model::Asset>,
19080 {
19081 self.0.request.asset = std::option::Option::Some(v.into());
19082 self
19083 }
19084
19085 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
19089 where
19090 T: std::convert::Into<crate::model::Asset>,
19091 {
19092 self.0.request.asset = v.map(|x| x.into());
19093 self
19094 }
19095
19096 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
19098 self.0.request.validate_only = v.into();
19099 self
19100 }
19101 }
19102
19103 #[doc(hidden)]
19104 impl crate::RequestBuilder for CreateAsset {
19105 fn request_options(&mut self) -> &mut crate::RequestOptions {
19106 &mut self.0.options
19107 }
19108 }
19109
19110 #[derive(Clone, Debug)]
19128 pub struct UpdateAsset(RequestBuilder<crate::model::UpdateAssetRequest>);
19129
19130 impl UpdateAsset {
19131 pub(crate) fn new(
19132 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19133 ) -> Self {
19134 Self(RequestBuilder::new(stub))
19135 }
19136
19137 pub fn with_request<V: Into<crate::model::UpdateAssetRequest>>(mut self, v: V) -> Self {
19139 self.0.request = v.into();
19140 self
19141 }
19142
19143 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19145 self.0.options = v.into();
19146 self
19147 }
19148
19149 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19156 (*self.0.stub)
19157 .update_asset(self.0.request, self.0.options)
19158 .await
19159 .map(crate::Response::into_body)
19160 }
19161
19162 pub fn poller(
19164 self,
19165 ) -> impl google_cloud_lro::Poller<crate::model::Asset, crate::model::OperationMetadata>
19166 {
19167 type Operation = google_cloud_lro::internal::Operation<
19168 crate::model::Asset,
19169 crate::model::OperationMetadata,
19170 >;
19171 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19172 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19173
19174 let stub = self.0.stub.clone();
19175 let mut options = self.0.options.clone();
19176 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19177 let query = move |name| {
19178 let stub = stub.clone();
19179 let options = options.clone();
19180 async {
19181 let op = GetOperation::new(stub)
19182 .set_name(name)
19183 .with_options(options)
19184 .send()
19185 .await?;
19186 Ok(Operation::new(op))
19187 }
19188 };
19189
19190 let start = move || async {
19191 let op = self.send().await?;
19192 Ok(Operation::new(op))
19193 };
19194
19195 google_cloud_lro::internal::new_poller(
19196 polling_error_policy,
19197 polling_backoff_policy,
19198 start,
19199 query,
19200 )
19201 }
19202
19203 pub fn set_update_mask<T>(mut self, v: T) -> Self
19207 where
19208 T: std::convert::Into<wkt::FieldMask>,
19209 {
19210 self.0.request.update_mask = std::option::Option::Some(v.into());
19211 self
19212 }
19213
19214 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19218 where
19219 T: std::convert::Into<wkt::FieldMask>,
19220 {
19221 self.0.request.update_mask = v.map(|x| x.into());
19222 self
19223 }
19224
19225 pub fn set_asset<T>(mut self, v: T) -> Self
19229 where
19230 T: std::convert::Into<crate::model::Asset>,
19231 {
19232 self.0.request.asset = std::option::Option::Some(v.into());
19233 self
19234 }
19235
19236 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
19240 where
19241 T: std::convert::Into<crate::model::Asset>,
19242 {
19243 self.0.request.asset = v.map(|x| x.into());
19244 self
19245 }
19246
19247 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
19249 self.0.request.validate_only = v.into();
19250 self
19251 }
19252 }
19253
19254 #[doc(hidden)]
19255 impl crate::RequestBuilder for UpdateAsset {
19256 fn request_options(&mut self) -> &mut crate::RequestOptions {
19257 &mut self.0.options
19258 }
19259 }
19260
19261 #[derive(Clone, Debug)]
19279 pub struct DeleteAsset(RequestBuilder<crate::model::DeleteAssetRequest>);
19280
19281 impl DeleteAsset {
19282 pub(crate) fn new(
19283 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19284 ) -> Self {
19285 Self(RequestBuilder::new(stub))
19286 }
19287
19288 pub fn with_request<V: Into<crate::model::DeleteAssetRequest>>(mut self, v: V) -> Self {
19290 self.0.request = v.into();
19291 self
19292 }
19293
19294 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19296 self.0.options = v.into();
19297 self
19298 }
19299
19300 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19307 (*self.0.stub)
19308 .delete_asset(self.0.request, self.0.options)
19309 .await
19310 .map(crate::Response::into_body)
19311 }
19312
19313 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
19315 type Operation =
19316 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
19317 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19318 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19319
19320 let stub = self.0.stub.clone();
19321 let mut options = self.0.options.clone();
19322 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19323 let query = move |name| {
19324 let stub = stub.clone();
19325 let options = options.clone();
19326 async {
19327 let op = GetOperation::new(stub)
19328 .set_name(name)
19329 .with_options(options)
19330 .send()
19331 .await?;
19332 Ok(Operation::new(op))
19333 }
19334 };
19335
19336 let start = move || async {
19337 let op = self.send().await?;
19338 Ok(Operation::new(op))
19339 };
19340
19341 google_cloud_lro::internal::new_unit_response_poller(
19342 polling_error_policy,
19343 polling_backoff_policy,
19344 start,
19345 query,
19346 )
19347 }
19348
19349 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19353 self.0.request.name = v.into();
19354 self
19355 }
19356 }
19357
19358 #[doc(hidden)]
19359 impl crate::RequestBuilder for DeleteAsset {
19360 fn request_options(&mut self) -> &mut crate::RequestOptions {
19361 &mut self.0.options
19362 }
19363 }
19364
19365 #[derive(Clone, Debug)]
19386 pub struct ListAssets(RequestBuilder<crate::model::ListAssetsRequest>);
19387
19388 impl ListAssets {
19389 pub(crate) fn new(
19390 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19391 ) -> Self {
19392 Self(RequestBuilder::new(stub))
19393 }
19394
19395 pub fn with_request<V: Into<crate::model::ListAssetsRequest>>(mut self, v: V) -> Self {
19397 self.0.request = v.into();
19398 self
19399 }
19400
19401 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19403 self.0.options = v.into();
19404 self
19405 }
19406
19407 pub async fn send(self) -> Result<crate::model::ListAssetsResponse> {
19409 (*self.0.stub)
19410 .list_assets(self.0.request, self.0.options)
19411 .await
19412 .map(crate::Response::into_body)
19413 }
19414
19415 pub fn by_page(
19417 self,
19418 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListAssetsResponse, crate::Error>
19419 {
19420 use std::clone::Clone;
19421 let token = self.0.request.page_token.clone();
19422 let execute = move |token: String| {
19423 let mut builder = self.clone();
19424 builder.0.request = builder.0.request.set_page_token(token);
19425 builder.send()
19426 };
19427 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19428 }
19429
19430 pub fn by_item(
19432 self,
19433 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19434 crate::model::ListAssetsResponse,
19435 crate::Error,
19436 > {
19437 use google_cloud_gax::paginator::Paginator;
19438 self.by_page().items()
19439 }
19440
19441 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19445 self.0.request.parent = v.into();
19446 self
19447 }
19448
19449 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19451 self.0.request.page_size = v.into();
19452 self
19453 }
19454
19455 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19457 self.0.request.page_token = v.into();
19458 self
19459 }
19460
19461 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19463 self.0.request.filter = v.into();
19464 self
19465 }
19466
19467 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
19469 self.0.request.order_by = v.into();
19470 self
19471 }
19472 }
19473
19474 #[doc(hidden)]
19475 impl crate::RequestBuilder for ListAssets {
19476 fn request_options(&mut self) -> &mut crate::RequestOptions {
19477 &mut self.0.options
19478 }
19479 }
19480
19481 #[derive(Clone, Debug)]
19498 pub struct GetAsset(RequestBuilder<crate::model::GetAssetRequest>);
19499
19500 impl GetAsset {
19501 pub(crate) fn new(
19502 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19503 ) -> Self {
19504 Self(RequestBuilder::new(stub))
19505 }
19506
19507 pub fn with_request<V: Into<crate::model::GetAssetRequest>>(mut self, v: V) -> Self {
19509 self.0.request = v.into();
19510 self
19511 }
19512
19513 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19515 self.0.options = v.into();
19516 self
19517 }
19518
19519 pub async fn send(self) -> Result<crate::model::Asset> {
19521 (*self.0.stub)
19522 .get_asset(self.0.request, self.0.options)
19523 .await
19524 .map(crate::Response::into_body)
19525 }
19526
19527 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19531 self.0.request.name = v.into();
19532 self
19533 }
19534 }
19535
19536 #[doc(hidden)]
19537 impl crate::RequestBuilder for GetAsset {
19538 fn request_options(&mut self) -> &mut crate::RequestOptions {
19539 &mut self.0.options
19540 }
19541 }
19542
19543 #[derive(Clone, Debug)]
19564 pub struct ListAssetActions(RequestBuilder<crate::model::ListAssetActionsRequest>);
19565
19566 impl ListAssetActions {
19567 pub(crate) fn new(
19568 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19569 ) -> Self {
19570 Self(RequestBuilder::new(stub))
19571 }
19572
19573 pub fn with_request<V: Into<crate::model::ListAssetActionsRequest>>(
19575 mut self,
19576 v: V,
19577 ) -> Self {
19578 self.0.request = v.into();
19579 self
19580 }
19581
19582 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19584 self.0.options = v.into();
19585 self
19586 }
19587
19588 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
19590 (*self.0.stub)
19591 .list_asset_actions(self.0.request, self.0.options)
19592 .await
19593 .map(crate::Response::into_body)
19594 }
19595
19596 pub fn by_page(
19598 self,
19599 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
19600 {
19601 use std::clone::Clone;
19602 let token = self.0.request.page_token.clone();
19603 let execute = move |token: String| {
19604 let mut builder = self.clone();
19605 builder.0.request = builder.0.request.set_page_token(token);
19606 builder.send()
19607 };
19608 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19609 }
19610
19611 pub fn by_item(
19613 self,
19614 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19615 crate::model::ListActionsResponse,
19616 crate::Error,
19617 > {
19618 use google_cloud_gax::paginator::Paginator;
19619 self.by_page().items()
19620 }
19621
19622 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19626 self.0.request.parent = v.into();
19627 self
19628 }
19629
19630 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19632 self.0.request.page_size = v.into();
19633 self
19634 }
19635
19636 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19638 self.0.request.page_token = v.into();
19639 self
19640 }
19641 }
19642
19643 #[doc(hidden)]
19644 impl crate::RequestBuilder for ListAssetActions {
19645 fn request_options(&mut self) -> &mut crate::RequestOptions {
19646 &mut self.0.options
19647 }
19648 }
19649
19650 #[derive(Clone, Debug)]
19668 pub struct CreateTask(RequestBuilder<crate::model::CreateTaskRequest>);
19669
19670 impl CreateTask {
19671 pub(crate) fn new(
19672 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19673 ) -> Self {
19674 Self(RequestBuilder::new(stub))
19675 }
19676
19677 pub fn with_request<V: Into<crate::model::CreateTaskRequest>>(mut self, v: V) -> Self {
19679 self.0.request = v.into();
19680 self
19681 }
19682
19683 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19685 self.0.options = v.into();
19686 self
19687 }
19688
19689 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19696 (*self.0.stub)
19697 .create_task(self.0.request, self.0.options)
19698 .await
19699 .map(crate::Response::into_body)
19700 }
19701
19702 pub fn poller(
19704 self,
19705 ) -> impl google_cloud_lro::Poller<crate::model::Task, crate::model::OperationMetadata>
19706 {
19707 type Operation = google_cloud_lro::internal::Operation<
19708 crate::model::Task,
19709 crate::model::OperationMetadata,
19710 >;
19711 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19712 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19713
19714 let stub = self.0.stub.clone();
19715 let mut options = self.0.options.clone();
19716 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19717 let query = move |name| {
19718 let stub = stub.clone();
19719 let options = options.clone();
19720 async {
19721 let op = GetOperation::new(stub)
19722 .set_name(name)
19723 .with_options(options)
19724 .send()
19725 .await?;
19726 Ok(Operation::new(op))
19727 }
19728 };
19729
19730 let start = move || async {
19731 let op = self.send().await?;
19732 Ok(Operation::new(op))
19733 };
19734
19735 google_cloud_lro::internal::new_poller(
19736 polling_error_policy,
19737 polling_backoff_policy,
19738 start,
19739 query,
19740 )
19741 }
19742
19743 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19747 self.0.request.parent = v.into();
19748 self
19749 }
19750
19751 pub fn set_task_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
19755 self.0.request.task_id = v.into();
19756 self
19757 }
19758
19759 pub fn set_task<T>(mut self, v: T) -> Self
19763 where
19764 T: std::convert::Into<crate::model::Task>,
19765 {
19766 self.0.request.task = std::option::Option::Some(v.into());
19767 self
19768 }
19769
19770 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
19774 where
19775 T: std::convert::Into<crate::model::Task>,
19776 {
19777 self.0.request.task = v.map(|x| x.into());
19778 self
19779 }
19780
19781 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
19783 self.0.request.validate_only = v.into();
19784 self
19785 }
19786 }
19787
19788 #[doc(hidden)]
19789 impl crate::RequestBuilder for CreateTask {
19790 fn request_options(&mut self) -> &mut crate::RequestOptions {
19791 &mut self.0.options
19792 }
19793 }
19794
19795 #[derive(Clone, Debug)]
19813 pub struct UpdateTask(RequestBuilder<crate::model::UpdateTaskRequest>);
19814
19815 impl UpdateTask {
19816 pub(crate) fn new(
19817 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19818 ) -> Self {
19819 Self(RequestBuilder::new(stub))
19820 }
19821
19822 pub fn with_request<V: Into<crate::model::UpdateTaskRequest>>(mut self, v: V) -> Self {
19824 self.0.request = v.into();
19825 self
19826 }
19827
19828 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19830 self.0.options = v.into();
19831 self
19832 }
19833
19834 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19841 (*self.0.stub)
19842 .update_task(self.0.request, self.0.options)
19843 .await
19844 .map(crate::Response::into_body)
19845 }
19846
19847 pub fn poller(
19849 self,
19850 ) -> impl google_cloud_lro::Poller<crate::model::Task, crate::model::OperationMetadata>
19851 {
19852 type Operation = google_cloud_lro::internal::Operation<
19853 crate::model::Task,
19854 crate::model::OperationMetadata,
19855 >;
19856 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
19857 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
19858
19859 let stub = self.0.stub.clone();
19860 let mut options = self.0.options.clone();
19861 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
19862 let query = move |name| {
19863 let stub = stub.clone();
19864 let options = options.clone();
19865 async {
19866 let op = GetOperation::new(stub)
19867 .set_name(name)
19868 .with_options(options)
19869 .send()
19870 .await?;
19871 Ok(Operation::new(op))
19872 }
19873 };
19874
19875 let start = move || async {
19876 let op = self.send().await?;
19877 Ok(Operation::new(op))
19878 };
19879
19880 google_cloud_lro::internal::new_poller(
19881 polling_error_policy,
19882 polling_backoff_policy,
19883 start,
19884 query,
19885 )
19886 }
19887
19888 pub fn set_update_mask<T>(mut self, v: T) -> Self
19892 where
19893 T: std::convert::Into<wkt::FieldMask>,
19894 {
19895 self.0.request.update_mask = std::option::Option::Some(v.into());
19896 self
19897 }
19898
19899 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19903 where
19904 T: std::convert::Into<wkt::FieldMask>,
19905 {
19906 self.0.request.update_mask = v.map(|x| x.into());
19907 self
19908 }
19909
19910 pub fn set_task<T>(mut self, v: T) -> Self
19914 where
19915 T: std::convert::Into<crate::model::Task>,
19916 {
19917 self.0.request.task = std::option::Option::Some(v.into());
19918 self
19919 }
19920
19921 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
19925 where
19926 T: std::convert::Into<crate::model::Task>,
19927 {
19928 self.0.request.task = v.map(|x| x.into());
19929 self
19930 }
19931
19932 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
19934 self.0.request.validate_only = v.into();
19935 self
19936 }
19937 }
19938
19939 #[doc(hidden)]
19940 impl crate::RequestBuilder for UpdateTask {
19941 fn request_options(&mut self) -> &mut crate::RequestOptions {
19942 &mut self.0.options
19943 }
19944 }
19945
19946 #[derive(Clone, Debug)]
19964 pub struct DeleteTask(RequestBuilder<crate::model::DeleteTaskRequest>);
19965
19966 impl DeleteTask {
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::DeleteTaskRequest>>(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<google_cloud_longrunning::model::Operation> {
19992 (*self.0.stub)
19993 .delete_task(self.0.request, self.0.options)
19994 .await
19995 .map(crate::Response::into_body)
19996 }
19997
19998 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
20000 type Operation =
20001 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
20002 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20003 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20004
20005 let stub = self.0.stub.clone();
20006 let mut options = self.0.options.clone();
20007 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20008 let query = move |name| {
20009 let stub = stub.clone();
20010 let options = options.clone();
20011 async {
20012 let op = GetOperation::new(stub)
20013 .set_name(name)
20014 .with_options(options)
20015 .send()
20016 .await?;
20017 Ok(Operation::new(op))
20018 }
20019 };
20020
20021 let start = move || async {
20022 let op = self.send().await?;
20023 Ok(Operation::new(op))
20024 };
20025
20026 google_cloud_lro::internal::new_unit_response_poller(
20027 polling_error_policy,
20028 polling_backoff_policy,
20029 start,
20030 query,
20031 )
20032 }
20033
20034 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20038 self.0.request.name = v.into();
20039 self
20040 }
20041 }
20042
20043 #[doc(hidden)]
20044 impl crate::RequestBuilder for DeleteTask {
20045 fn request_options(&mut self) -> &mut crate::RequestOptions {
20046 &mut self.0.options
20047 }
20048 }
20049
20050 #[derive(Clone, Debug)]
20071 pub struct ListTasks(RequestBuilder<crate::model::ListTasksRequest>);
20072
20073 impl ListTasks {
20074 pub(crate) fn new(
20075 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20076 ) -> Self {
20077 Self(RequestBuilder::new(stub))
20078 }
20079
20080 pub fn with_request<V: Into<crate::model::ListTasksRequest>>(mut self, v: V) -> Self {
20082 self.0.request = v.into();
20083 self
20084 }
20085
20086 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20088 self.0.options = v.into();
20089 self
20090 }
20091
20092 pub async fn send(self) -> Result<crate::model::ListTasksResponse> {
20094 (*self.0.stub)
20095 .list_tasks(self.0.request, self.0.options)
20096 .await
20097 .map(crate::Response::into_body)
20098 }
20099
20100 pub fn by_page(
20102 self,
20103 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTasksResponse, crate::Error>
20104 {
20105 use std::clone::Clone;
20106 let token = self.0.request.page_token.clone();
20107 let execute = move |token: String| {
20108 let mut builder = self.clone();
20109 builder.0.request = builder.0.request.set_page_token(token);
20110 builder.send()
20111 };
20112 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20113 }
20114
20115 pub fn by_item(
20117 self,
20118 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListTasksResponse, crate::Error>
20119 {
20120 use google_cloud_gax::paginator::Paginator;
20121 self.by_page().items()
20122 }
20123
20124 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20128 self.0.request.parent = v.into();
20129 self
20130 }
20131
20132 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20134 self.0.request.page_size = v.into();
20135 self
20136 }
20137
20138 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20140 self.0.request.page_token = v.into();
20141 self
20142 }
20143
20144 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20146 self.0.request.filter = v.into();
20147 self
20148 }
20149
20150 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
20152 self.0.request.order_by = v.into();
20153 self
20154 }
20155 }
20156
20157 #[doc(hidden)]
20158 impl crate::RequestBuilder for ListTasks {
20159 fn request_options(&mut self) -> &mut crate::RequestOptions {
20160 &mut self.0.options
20161 }
20162 }
20163
20164 #[derive(Clone, Debug)]
20181 pub struct GetTask(RequestBuilder<crate::model::GetTaskRequest>);
20182
20183 impl GetTask {
20184 pub(crate) fn new(
20185 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20186 ) -> Self {
20187 Self(RequestBuilder::new(stub))
20188 }
20189
20190 pub fn with_request<V: Into<crate::model::GetTaskRequest>>(mut self, v: V) -> Self {
20192 self.0.request = v.into();
20193 self
20194 }
20195
20196 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20198 self.0.options = v.into();
20199 self
20200 }
20201
20202 pub async fn send(self) -> Result<crate::model::Task> {
20204 (*self.0.stub)
20205 .get_task(self.0.request, self.0.options)
20206 .await
20207 .map(crate::Response::into_body)
20208 }
20209
20210 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20214 self.0.request.name = v.into();
20215 self
20216 }
20217 }
20218
20219 #[doc(hidden)]
20220 impl crate::RequestBuilder for GetTask {
20221 fn request_options(&mut self) -> &mut crate::RequestOptions {
20222 &mut self.0.options
20223 }
20224 }
20225
20226 #[derive(Clone, Debug)]
20247 pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
20248
20249 impl ListJobs {
20250 pub(crate) fn new(
20251 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20252 ) -> Self {
20253 Self(RequestBuilder::new(stub))
20254 }
20255
20256 pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
20258 self.0.request = v.into();
20259 self
20260 }
20261
20262 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20264 self.0.options = v.into();
20265 self
20266 }
20267
20268 pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
20270 (*self.0.stub)
20271 .list_jobs(self.0.request, self.0.options)
20272 .await
20273 .map(crate::Response::into_body)
20274 }
20275
20276 pub fn by_page(
20278 self,
20279 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListJobsResponse, crate::Error>
20280 {
20281 use std::clone::Clone;
20282 let token = self.0.request.page_token.clone();
20283 let execute = move |token: String| {
20284 let mut builder = self.clone();
20285 builder.0.request = builder.0.request.set_page_token(token);
20286 builder.send()
20287 };
20288 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20289 }
20290
20291 pub fn by_item(
20293 self,
20294 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListJobsResponse, crate::Error>
20295 {
20296 use google_cloud_gax::paginator::Paginator;
20297 self.by_page().items()
20298 }
20299
20300 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20304 self.0.request.parent = v.into();
20305 self
20306 }
20307
20308 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20310 self.0.request.page_size = v.into();
20311 self
20312 }
20313
20314 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20316 self.0.request.page_token = v.into();
20317 self
20318 }
20319 }
20320
20321 #[doc(hidden)]
20322 impl crate::RequestBuilder for ListJobs {
20323 fn request_options(&mut self) -> &mut crate::RequestOptions {
20324 &mut self.0.options
20325 }
20326 }
20327
20328 #[derive(Clone, Debug)]
20345 pub struct RunTask(RequestBuilder<crate::model::RunTaskRequest>);
20346
20347 impl RunTask {
20348 pub(crate) fn new(
20349 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20350 ) -> Self {
20351 Self(RequestBuilder::new(stub))
20352 }
20353
20354 pub fn with_request<V: Into<crate::model::RunTaskRequest>>(mut self, v: V) -> Self {
20356 self.0.request = v.into();
20357 self
20358 }
20359
20360 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20362 self.0.options = v.into();
20363 self
20364 }
20365
20366 pub async fn send(self) -> Result<crate::model::RunTaskResponse> {
20368 (*self.0.stub)
20369 .run_task(self.0.request, self.0.options)
20370 .await
20371 .map(crate::Response::into_body)
20372 }
20373
20374 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20378 self.0.request.name = v.into();
20379 self
20380 }
20381
20382 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
20384 where
20385 T: std::iter::IntoIterator<Item = (K, V)>,
20386 K: std::convert::Into<std::string::String>,
20387 V: std::convert::Into<std::string::String>,
20388 {
20389 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20390 self
20391 }
20392
20393 pub fn set_args<T, K, V>(mut self, v: T) -> Self
20395 where
20396 T: std::iter::IntoIterator<Item = (K, V)>,
20397 K: std::convert::Into<std::string::String>,
20398 V: std::convert::Into<std::string::String>,
20399 {
20400 self.0.request.args = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20401 self
20402 }
20403 }
20404
20405 #[doc(hidden)]
20406 impl crate::RequestBuilder for RunTask {
20407 fn request_options(&mut self) -> &mut crate::RequestOptions {
20408 &mut self.0.options
20409 }
20410 }
20411
20412 #[derive(Clone, Debug)]
20429 pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
20430
20431 impl GetJob {
20432 pub(crate) fn new(
20433 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20434 ) -> Self {
20435 Self(RequestBuilder::new(stub))
20436 }
20437
20438 pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
20440 self.0.request = v.into();
20441 self
20442 }
20443
20444 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20446 self.0.options = v.into();
20447 self
20448 }
20449
20450 pub async fn send(self) -> Result<crate::model::Job> {
20452 (*self.0.stub)
20453 .get_job(self.0.request, self.0.options)
20454 .await
20455 .map(crate::Response::into_body)
20456 }
20457
20458 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20462 self.0.request.name = v.into();
20463 self
20464 }
20465 }
20466
20467 #[doc(hidden)]
20468 impl crate::RequestBuilder for GetJob {
20469 fn request_options(&mut self) -> &mut crate::RequestOptions {
20470 &mut self.0.options
20471 }
20472 }
20473
20474 #[derive(Clone, Debug)]
20491 pub struct CancelJob(RequestBuilder<crate::model::CancelJobRequest>);
20492
20493 impl CancelJob {
20494 pub(crate) fn new(
20495 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20496 ) -> Self {
20497 Self(RequestBuilder::new(stub))
20498 }
20499
20500 pub fn with_request<V: Into<crate::model::CancelJobRequest>>(mut self, v: V) -> Self {
20502 self.0.request = v.into();
20503 self
20504 }
20505
20506 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20508 self.0.options = v.into();
20509 self
20510 }
20511
20512 pub async fn send(self) -> Result<()> {
20514 (*self.0.stub)
20515 .cancel_job(self.0.request, self.0.options)
20516 .await
20517 .map(crate::Response::into_body)
20518 }
20519
20520 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20524 self.0.request.name = v.into();
20525 self
20526 }
20527 }
20528
20529 #[doc(hidden)]
20530 impl crate::RequestBuilder for CancelJob {
20531 fn request_options(&mut self) -> &mut crate::RequestOptions {
20532 &mut self.0.options
20533 }
20534 }
20535
20536 #[derive(Clone, Debug)]
20557 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20558
20559 impl ListLocations {
20560 pub(crate) fn new(
20561 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20562 ) -> Self {
20563 Self(RequestBuilder::new(stub))
20564 }
20565
20566 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
20568 mut self,
20569 v: V,
20570 ) -> Self {
20571 self.0.request = v.into();
20572 self
20573 }
20574
20575 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20577 self.0.options = v.into();
20578 self
20579 }
20580
20581 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
20583 (*self.0.stub)
20584 .list_locations(self.0.request, self.0.options)
20585 .await
20586 .map(crate::Response::into_body)
20587 }
20588
20589 pub fn by_page(
20591 self,
20592 ) -> impl google_cloud_gax::paginator::Paginator<
20593 google_cloud_location::model::ListLocationsResponse,
20594 crate::Error,
20595 > {
20596 use std::clone::Clone;
20597 let token = self.0.request.page_token.clone();
20598 let execute = move |token: String| {
20599 let mut builder = self.clone();
20600 builder.0.request = builder.0.request.set_page_token(token);
20601 builder.send()
20602 };
20603 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20604 }
20605
20606 pub fn by_item(
20608 self,
20609 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20610 google_cloud_location::model::ListLocationsResponse,
20611 crate::Error,
20612 > {
20613 use google_cloud_gax::paginator::Paginator;
20614 self.by_page().items()
20615 }
20616
20617 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20619 self.0.request.name = v.into();
20620 self
20621 }
20622
20623 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20625 self.0.request.filter = v.into();
20626 self
20627 }
20628
20629 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20631 self.0.request.page_size = v.into();
20632 self
20633 }
20634
20635 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20637 self.0.request.page_token = v.into();
20638 self
20639 }
20640 }
20641
20642 #[doc(hidden)]
20643 impl crate::RequestBuilder for ListLocations {
20644 fn request_options(&mut self) -> &mut crate::RequestOptions {
20645 &mut self.0.options
20646 }
20647 }
20648
20649 #[derive(Clone, Debug)]
20666 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
20667
20668 impl GetLocation {
20669 pub(crate) fn new(
20670 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20671 ) -> Self {
20672 Self(RequestBuilder::new(stub))
20673 }
20674
20675 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
20677 mut self,
20678 v: V,
20679 ) -> Self {
20680 self.0.request = v.into();
20681 self
20682 }
20683
20684 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20686 self.0.options = v.into();
20687 self
20688 }
20689
20690 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
20692 (*self.0.stub)
20693 .get_location(self.0.request, self.0.options)
20694 .await
20695 .map(crate::Response::into_body)
20696 }
20697
20698 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20700 self.0.request.name = v.into();
20701 self
20702 }
20703 }
20704
20705 #[doc(hidden)]
20706 impl crate::RequestBuilder for GetLocation {
20707 fn request_options(&mut self) -> &mut crate::RequestOptions {
20708 &mut self.0.options
20709 }
20710 }
20711
20712 #[derive(Clone, Debug)]
20729 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
20730
20731 impl SetIamPolicy {
20732 pub(crate) fn new(
20733 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20734 ) -> Self {
20735 Self(RequestBuilder::new(stub))
20736 }
20737
20738 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
20740 mut self,
20741 v: V,
20742 ) -> Self {
20743 self.0.request = v.into();
20744 self
20745 }
20746
20747 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20749 self.0.options = v.into();
20750 self
20751 }
20752
20753 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
20755 (*self.0.stub)
20756 .set_iam_policy(self.0.request, self.0.options)
20757 .await
20758 .map(crate::Response::into_body)
20759 }
20760
20761 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20765 self.0.request.resource = v.into();
20766 self
20767 }
20768
20769 pub fn set_policy<T>(mut self, v: T) -> Self
20773 where
20774 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
20775 {
20776 self.0.request.policy = std::option::Option::Some(v.into());
20777 self
20778 }
20779
20780 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
20784 where
20785 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
20786 {
20787 self.0.request.policy = v.map(|x| x.into());
20788 self
20789 }
20790
20791 pub fn set_update_mask<T>(mut self, v: T) -> Self
20793 where
20794 T: std::convert::Into<wkt::FieldMask>,
20795 {
20796 self.0.request.update_mask = std::option::Option::Some(v.into());
20797 self
20798 }
20799
20800 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20802 where
20803 T: std::convert::Into<wkt::FieldMask>,
20804 {
20805 self.0.request.update_mask = v.map(|x| x.into());
20806 self
20807 }
20808 }
20809
20810 #[doc(hidden)]
20811 impl crate::RequestBuilder for SetIamPolicy {
20812 fn request_options(&mut self) -> &mut crate::RequestOptions {
20813 &mut self.0.options
20814 }
20815 }
20816
20817 #[derive(Clone, Debug)]
20834 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
20835
20836 impl GetIamPolicy {
20837 pub(crate) fn new(
20838 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20839 ) -> Self {
20840 Self(RequestBuilder::new(stub))
20841 }
20842
20843 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
20845 mut self,
20846 v: V,
20847 ) -> Self {
20848 self.0.request = v.into();
20849 self
20850 }
20851
20852 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20854 self.0.options = v.into();
20855 self
20856 }
20857
20858 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
20860 (*self.0.stub)
20861 .get_iam_policy(self.0.request, self.0.options)
20862 .await
20863 .map(crate::Response::into_body)
20864 }
20865
20866 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20870 self.0.request.resource = v.into();
20871 self
20872 }
20873
20874 pub fn set_options<T>(mut self, v: T) -> Self
20876 where
20877 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
20878 {
20879 self.0.request.options = std::option::Option::Some(v.into());
20880 self
20881 }
20882
20883 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
20885 where
20886 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
20887 {
20888 self.0.request.options = v.map(|x| x.into());
20889 self
20890 }
20891 }
20892
20893 #[doc(hidden)]
20894 impl crate::RequestBuilder for GetIamPolicy {
20895 fn request_options(&mut self) -> &mut crate::RequestOptions {
20896 &mut self.0.options
20897 }
20898 }
20899
20900 #[derive(Clone, Debug)]
20917 pub struct TestIamPermissions(
20918 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
20919 );
20920
20921 impl TestIamPermissions {
20922 pub(crate) fn new(
20923 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
20924 ) -> Self {
20925 Self(RequestBuilder::new(stub))
20926 }
20927
20928 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
20930 mut self,
20931 v: V,
20932 ) -> Self {
20933 self.0.request = v.into();
20934 self
20935 }
20936
20937 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20939 self.0.options = v.into();
20940 self
20941 }
20942
20943 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
20945 (*self.0.stub)
20946 .test_iam_permissions(self.0.request, self.0.options)
20947 .await
20948 .map(crate::Response::into_body)
20949 }
20950
20951 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
20955 self.0.request.resource = v.into();
20956 self
20957 }
20958
20959 pub fn set_permissions<T, V>(mut self, v: T) -> Self
20963 where
20964 T: std::iter::IntoIterator<Item = V>,
20965 V: std::convert::Into<std::string::String>,
20966 {
20967 use std::iter::Iterator;
20968 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
20969 self
20970 }
20971 }
20972
20973 #[doc(hidden)]
20974 impl crate::RequestBuilder for TestIamPermissions {
20975 fn request_options(&mut self) -> &mut crate::RequestOptions {
20976 &mut self.0.options
20977 }
20978 }
20979
20980 #[derive(Clone, Debug)]
21001 pub struct ListOperations(
21002 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21003 );
21004
21005 impl ListOperations {
21006 pub(crate) fn new(
21007 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
21008 ) -> Self {
21009 Self(RequestBuilder::new(stub))
21010 }
21011
21012 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21014 mut self,
21015 v: V,
21016 ) -> Self {
21017 self.0.request = v.into();
21018 self
21019 }
21020
21021 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21023 self.0.options = v.into();
21024 self
21025 }
21026
21027 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21029 (*self.0.stub)
21030 .list_operations(self.0.request, self.0.options)
21031 .await
21032 .map(crate::Response::into_body)
21033 }
21034
21035 pub fn by_page(
21037 self,
21038 ) -> impl google_cloud_gax::paginator::Paginator<
21039 google_cloud_longrunning::model::ListOperationsResponse,
21040 crate::Error,
21041 > {
21042 use std::clone::Clone;
21043 let token = self.0.request.page_token.clone();
21044 let execute = move |token: String| {
21045 let mut builder = self.clone();
21046 builder.0.request = builder.0.request.set_page_token(token);
21047 builder.send()
21048 };
21049 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21050 }
21051
21052 pub fn by_item(
21054 self,
21055 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21056 google_cloud_longrunning::model::ListOperationsResponse,
21057 crate::Error,
21058 > {
21059 use google_cloud_gax::paginator::Paginator;
21060 self.by_page().items()
21061 }
21062
21063 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21065 self.0.request.name = v.into();
21066 self
21067 }
21068
21069 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21071 self.0.request.filter = v.into();
21072 self
21073 }
21074
21075 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21077 self.0.request.page_size = v.into();
21078 self
21079 }
21080
21081 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21083 self.0.request.page_token = v.into();
21084 self
21085 }
21086
21087 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21089 self.0.request.return_partial_success = v.into();
21090 self
21091 }
21092 }
21093
21094 #[doc(hidden)]
21095 impl crate::RequestBuilder for ListOperations {
21096 fn request_options(&mut self) -> &mut crate::RequestOptions {
21097 &mut self.0.options
21098 }
21099 }
21100
21101 #[derive(Clone, Debug)]
21118 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
21119
21120 impl GetOperation {
21121 pub(crate) fn new(
21122 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
21123 ) -> Self {
21124 Self(RequestBuilder::new(stub))
21125 }
21126
21127 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
21129 mut self,
21130 v: V,
21131 ) -> Self {
21132 self.0.request = v.into();
21133 self
21134 }
21135
21136 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21138 self.0.options = v.into();
21139 self
21140 }
21141
21142 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21144 (*self.0.stub)
21145 .get_operation(self.0.request, self.0.options)
21146 .await
21147 .map(crate::Response::into_body)
21148 }
21149
21150 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21152 self.0.request.name = v.into();
21153 self
21154 }
21155 }
21156
21157 #[doc(hidden)]
21158 impl crate::RequestBuilder for GetOperation {
21159 fn request_options(&mut self) -> &mut crate::RequestOptions {
21160 &mut self.0.options
21161 }
21162 }
21163
21164 #[derive(Clone, Debug)]
21181 pub struct DeleteOperation(
21182 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
21183 );
21184
21185 impl DeleteOperation {
21186 pub(crate) fn new(
21187 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
21188 ) -> Self {
21189 Self(RequestBuilder::new(stub))
21190 }
21191
21192 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
21194 mut self,
21195 v: V,
21196 ) -> Self {
21197 self.0.request = v.into();
21198 self
21199 }
21200
21201 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21203 self.0.options = v.into();
21204 self
21205 }
21206
21207 pub async fn send(self) -> Result<()> {
21209 (*self.0.stub)
21210 .delete_operation(self.0.request, self.0.options)
21211 .await
21212 .map(crate::Response::into_body)
21213 }
21214
21215 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21217 self.0.request.name = v.into();
21218 self
21219 }
21220 }
21221
21222 #[doc(hidden)]
21223 impl crate::RequestBuilder for DeleteOperation {
21224 fn request_options(&mut self) -> &mut crate::RequestOptions {
21225 &mut self.0.options
21226 }
21227 }
21228
21229 #[derive(Clone, Debug)]
21246 pub struct CancelOperation(
21247 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
21248 );
21249
21250 impl CancelOperation {
21251 pub(crate) fn new(
21252 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
21253 ) -> Self {
21254 Self(RequestBuilder::new(stub))
21255 }
21256
21257 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
21259 mut self,
21260 v: V,
21261 ) -> Self {
21262 self.0.request = v.into();
21263 self
21264 }
21265
21266 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21268 self.0.options = v.into();
21269 self
21270 }
21271
21272 pub async fn send(self) -> Result<()> {
21274 (*self.0.stub)
21275 .cancel_operation(self.0.request, self.0.options)
21276 .await
21277 .map(crate::Response::into_body)
21278 }
21279
21280 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21282 self.0.request.name = v.into();
21283 self
21284 }
21285 }
21286
21287 #[doc(hidden)]
21288 impl crate::RequestBuilder for CancelOperation {
21289 fn request_options(&mut self) -> &mut crate::RequestOptions {
21290 &mut self.0.options
21291 }
21292 }
21293}