1pub mod business_glossary_service {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::BusinessGlossaryService;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = BusinessGlossaryService;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
91 pub struct CreateGlossary(RequestBuilder<crate::model::CreateGlossaryRequest>);
92
93 impl CreateGlossary {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::CreateGlossaryRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
119 (*self.0.stub)
120 .create_glossary(self.0.request, self.0.options)
121 .await
122 .map(crate::Response::into_body)
123 }
124
125 pub fn poller(
127 self,
128 ) -> impl google_cloud_lro::Poller<crate::model::Glossary, crate::model::OperationMetadata>
129 {
130 type Operation = google_cloud_lro::internal::Operation<
131 crate::model::Glossary,
132 crate::model::OperationMetadata,
133 >;
134 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
135 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
136
137 let stub = self.0.stub.clone();
138 let mut options = self.0.options.clone();
139 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
140 let query = move |name| {
141 let stub = stub.clone();
142 let options = options.clone();
143 async {
144 let op = GetOperation::new(stub)
145 .set_name(name)
146 .with_options(options)
147 .send()
148 .await?;
149 Ok(Operation::new(op))
150 }
151 };
152
153 let start = move || async {
154 let op = self.send().await?;
155 Ok(Operation::new(op))
156 };
157
158 google_cloud_lro::internal::new_poller(
159 polling_error_policy,
160 polling_backoff_policy,
161 start,
162 query,
163 )
164 }
165
166 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.parent = v.into();
171 self
172 }
173
174 pub fn set_glossary_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
178 self.0.request.glossary_id = v.into();
179 self
180 }
181
182 pub fn set_glossary<T>(mut self, v: T) -> Self
186 where
187 T: std::convert::Into<crate::model::Glossary>,
188 {
189 self.0.request.glossary = std::option::Option::Some(v.into());
190 self
191 }
192
193 pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
197 where
198 T: std::convert::Into<crate::model::Glossary>,
199 {
200 self.0.request.glossary = v.map(|x| x.into());
201 self
202 }
203
204 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
206 self.0.request.validate_only = v.into();
207 self
208 }
209 }
210
211 #[doc(hidden)]
212 impl crate::RequestBuilder for CreateGlossary {
213 fn request_options(&mut self) -> &mut crate::RequestOptions {
214 &mut self.0.options
215 }
216 }
217
218 #[derive(Clone, Debug)]
236 pub struct UpdateGlossary(RequestBuilder<crate::model::UpdateGlossaryRequest>);
237
238 impl UpdateGlossary {
239 pub(crate) fn new(
240 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
241 ) -> Self {
242 Self(RequestBuilder::new(stub))
243 }
244
245 pub fn with_request<V: Into<crate::model::UpdateGlossaryRequest>>(mut self, v: V) -> Self {
247 self.0.request = v.into();
248 self
249 }
250
251 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
253 self.0.options = v.into();
254 self
255 }
256
257 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
264 (*self.0.stub)
265 .update_glossary(self.0.request, self.0.options)
266 .await
267 .map(crate::Response::into_body)
268 }
269
270 pub fn poller(
272 self,
273 ) -> impl google_cloud_lro::Poller<crate::model::Glossary, crate::model::OperationMetadata>
274 {
275 type Operation = google_cloud_lro::internal::Operation<
276 crate::model::Glossary,
277 crate::model::OperationMetadata,
278 >;
279 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
280 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
281
282 let stub = self.0.stub.clone();
283 let mut options = self.0.options.clone();
284 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
285 let query = move |name| {
286 let stub = stub.clone();
287 let options = options.clone();
288 async {
289 let op = GetOperation::new(stub)
290 .set_name(name)
291 .with_options(options)
292 .send()
293 .await?;
294 Ok(Operation::new(op))
295 }
296 };
297
298 let start = move || async {
299 let op = self.send().await?;
300 Ok(Operation::new(op))
301 };
302
303 google_cloud_lro::internal::new_poller(
304 polling_error_policy,
305 polling_backoff_policy,
306 start,
307 query,
308 )
309 }
310
311 pub fn set_glossary<T>(mut self, v: T) -> Self
315 where
316 T: std::convert::Into<crate::model::Glossary>,
317 {
318 self.0.request.glossary = std::option::Option::Some(v.into());
319 self
320 }
321
322 pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
326 where
327 T: std::convert::Into<crate::model::Glossary>,
328 {
329 self.0.request.glossary = v.map(|x| x.into());
330 self
331 }
332
333 pub fn set_update_mask<T>(mut self, v: T) -> Self
337 where
338 T: std::convert::Into<wkt::FieldMask>,
339 {
340 self.0.request.update_mask = std::option::Option::Some(v.into());
341 self
342 }
343
344 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
348 where
349 T: std::convert::Into<wkt::FieldMask>,
350 {
351 self.0.request.update_mask = v.map(|x| x.into());
352 self
353 }
354
355 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
357 self.0.request.validate_only = v.into();
358 self
359 }
360 }
361
362 #[doc(hidden)]
363 impl crate::RequestBuilder for UpdateGlossary {
364 fn request_options(&mut self) -> &mut crate::RequestOptions {
365 &mut self.0.options
366 }
367 }
368
369 #[derive(Clone, Debug)]
387 pub struct DeleteGlossary(RequestBuilder<crate::model::DeleteGlossaryRequest>);
388
389 impl DeleteGlossary {
390 pub(crate) fn new(
391 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
392 ) -> Self {
393 Self(RequestBuilder::new(stub))
394 }
395
396 pub fn with_request<V: Into<crate::model::DeleteGlossaryRequest>>(mut self, v: V) -> Self {
398 self.0.request = v.into();
399 self
400 }
401
402 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
404 self.0.options = v.into();
405 self
406 }
407
408 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
415 (*self.0.stub)
416 .delete_glossary(self.0.request, self.0.options)
417 .await
418 .map(crate::Response::into_body)
419 }
420
421 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
423 type Operation =
424 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
425 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
426 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
427
428 let stub = self.0.stub.clone();
429 let mut options = self.0.options.clone();
430 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
431 let query = move |name| {
432 let stub = stub.clone();
433 let options = options.clone();
434 async {
435 let op = GetOperation::new(stub)
436 .set_name(name)
437 .with_options(options)
438 .send()
439 .await?;
440 Ok(Operation::new(op))
441 }
442 };
443
444 let start = move || async {
445 let op = self.send().await?;
446 Ok(Operation::new(op))
447 };
448
449 google_cloud_lro::internal::new_unit_response_poller(
450 polling_error_policy,
451 polling_backoff_policy,
452 start,
453 query,
454 )
455 }
456
457 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
461 self.0.request.name = v.into();
462 self
463 }
464
465 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
467 self.0.request.etag = v.into();
468 self
469 }
470 }
471
472 #[doc(hidden)]
473 impl crate::RequestBuilder for DeleteGlossary {
474 fn request_options(&mut self) -> &mut crate::RequestOptions {
475 &mut self.0.options
476 }
477 }
478
479 #[derive(Clone, Debug)]
496 pub struct GetGlossary(RequestBuilder<crate::model::GetGlossaryRequest>);
497
498 impl GetGlossary {
499 pub(crate) fn new(
500 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
501 ) -> Self {
502 Self(RequestBuilder::new(stub))
503 }
504
505 pub fn with_request<V: Into<crate::model::GetGlossaryRequest>>(mut self, v: V) -> Self {
507 self.0.request = v.into();
508 self
509 }
510
511 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
513 self.0.options = v.into();
514 self
515 }
516
517 pub async fn send(self) -> Result<crate::model::Glossary> {
519 (*self.0.stub)
520 .get_glossary(self.0.request, self.0.options)
521 .await
522 .map(crate::Response::into_body)
523 }
524
525 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
529 self.0.request.name = v.into();
530 self
531 }
532 }
533
534 #[doc(hidden)]
535 impl crate::RequestBuilder for GetGlossary {
536 fn request_options(&mut self) -> &mut crate::RequestOptions {
537 &mut self.0.options
538 }
539 }
540
541 #[derive(Clone, Debug)]
562 pub struct ListGlossaries(RequestBuilder<crate::model::ListGlossariesRequest>);
563
564 impl ListGlossaries {
565 pub(crate) fn new(
566 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
567 ) -> Self {
568 Self(RequestBuilder::new(stub))
569 }
570
571 pub fn with_request<V: Into<crate::model::ListGlossariesRequest>>(mut self, v: V) -> Self {
573 self.0.request = v.into();
574 self
575 }
576
577 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
579 self.0.options = v.into();
580 self
581 }
582
583 pub async fn send(self) -> Result<crate::model::ListGlossariesResponse> {
585 (*self.0.stub)
586 .list_glossaries(self.0.request, self.0.options)
587 .await
588 .map(crate::Response::into_body)
589 }
590
591 pub fn by_page(
593 self,
594 ) -> impl google_cloud_gax::paginator::Paginator<
595 crate::model::ListGlossariesResponse,
596 crate::Error,
597 > {
598 use std::clone::Clone;
599 let token = self.0.request.page_token.clone();
600 let execute = move |token: String| {
601 let mut builder = self.clone();
602 builder.0.request = builder.0.request.set_page_token(token);
603 builder.send()
604 };
605 google_cloud_gax::paginator::internal::new_paginator(token, execute)
606 }
607
608 pub fn by_item(
610 self,
611 ) -> impl google_cloud_gax::paginator::ItemPaginator<
612 crate::model::ListGlossariesResponse,
613 crate::Error,
614 > {
615 use google_cloud_gax::paginator::Paginator;
616 self.by_page().items()
617 }
618
619 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
623 self.0.request.parent = v.into();
624 self
625 }
626
627 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
629 self.0.request.page_size = v.into();
630 self
631 }
632
633 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
635 self.0.request.page_token = v.into();
636 self
637 }
638
639 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
641 self.0.request.filter = v.into();
642 self
643 }
644
645 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
647 self.0.request.order_by = v.into();
648 self
649 }
650 }
651
652 #[doc(hidden)]
653 impl crate::RequestBuilder for ListGlossaries {
654 fn request_options(&mut self) -> &mut crate::RequestOptions {
655 &mut self.0.options
656 }
657 }
658
659 #[derive(Clone, Debug)]
676 pub struct CreateGlossaryCategory(RequestBuilder<crate::model::CreateGlossaryCategoryRequest>);
677
678 impl CreateGlossaryCategory {
679 pub(crate) fn new(
680 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
681 ) -> Self {
682 Self(RequestBuilder::new(stub))
683 }
684
685 pub fn with_request<V: Into<crate::model::CreateGlossaryCategoryRequest>>(
687 mut self,
688 v: V,
689 ) -> Self {
690 self.0.request = v.into();
691 self
692 }
693
694 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
696 self.0.options = v.into();
697 self
698 }
699
700 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
702 (*self.0.stub)
703 .create_glossary_category(self.0.request, self.0.options)
704 .await
705 .map(crate::Response::into_body)
706 }
707
708 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
712 self.0.request.parent = v.into();
713 self
714 }
715
716 pub fn set_category_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
720 self.0.request.category_id = v.into();
721 self
722 }
723
724 pub fn set_category<T>(mut self, v: T) -> Self
728 where
729 T: std::convert::Into<crate::model::GlossaryCategory>,
730 {
731 self.0.request.category = std::option::Option::Some(v.into());
732 self
733 }
734
735 pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
739 where
740 T: std::convert::Into<crate::model::GlossaryCategory>,
741 {
742 self.0.request.category = v.map(|x| x.into());
743 self
744 }
745 }
746
747 #[doc(hidden)]
748 impl crate::RequestBuilder for CreateGlossaryCategory {
749 fn request_options(&mut self) -> &mut crate::RequestOptions {
750 &mut self.0.options
751 }
752 }
753
754 #[derive(Clone, Debug)]
771 pub struct UpdateGlossaryCategory(RequestBuilder<crate::model::UpdateGlossaryCategoryRequest>);
772
773 impl UpdateGlossaryCategory {
774 pub(crate) fn new(
775 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
776 ) -> Self {
777 Self(RequestBuilder::new(stub))
778 }
779
780 pub fn with_request<V: Into<crate::model::UpdateGlossaryCategoryRequest>>(
782 mut self,
783 v: V,
784 ) -> Self {
785 self.0.request = v.into();
786 self
787 }
788
789 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
791 self.0.options = v.into();
792 self
793 }
794
795 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
797 (*self.0.stub)
798 .update_glossary_category(self.0.request, self.0.options)
799 .await
800 .map(crate::Response::into_body)
801 }
802
803 pub fn set_category<T>(mut self, v: T) -> Self
807 where
808 T: std::convert::Into<crate::model::GlossaryCategory>,
809 {
810 self.0.request.category = std::option::Option::Some(v.into());
811 self
812 }
813
814 pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
818 where
819 T: std::convert::Into<crate::model::GlossaryCategory>,
820 {
821 self.0.request.category = v.map(|x| x.into());
822 self
823 }
824
825 pub fn set_update_mask<T>(mut self, v: T) -> Self
829 where
830 T: std::convert::Into<wkt::FieldMask>,
831 {
832 self.0.request.update_mask = std::option::Option::Some(v.into());
833 self
834 }
835
836 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
840 where
841 T: std::convert::Into<wkt::FieldMask>,
842 {
843 self.0.request.update_mask = v.map(|x| x.into());
844 self
845 }
846 }
847
848 #[doc(hidden)]
849 impl crate::RequestBuilder for UpdateGlossaryCategory {
850 fn request_options(&mut self) -> &mut crate::RequestOptions {
851 &mut self.0.options
852 }
853 }
854
855 #[derive(Clone, Debug)]
872 pub struct DeleteGlossaryCategory(RequestBuilder<crate::model::DeleteGlossaryCategoryRequest>);
873
874 impl DeleteGlossaryCategory {
875 pub(crate) fn new(
876 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
877 ) -> Self {
878 Self(RequestBuilder::new(stub))
879 }
880
881 pub fn with_request<V: Into<crate::model::DeleteGlossaryCategoryRequest>>(
883 mut self,
884 v: V,
885 ) -> Self {
886 self.0.request = v.into();
887 self
888 }
889
890 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
892 self.0.options = v.into();
893 self
894 }
895
896 pub async fn send(self) -> Result<()> {
898 (*self.0.stub)
899 .delete_glossary_category(self.0.request, self.0.options)
900 .await
901 .map(crate::Response::into_body)
902 }
903
904 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
908 self.0.request.name = v.into();
909 self
910 }
911 }
912
913 #[doc(hidden)]
914 impl crate::RequestBuilder for DeleteGlossaryCategory {
915 fn request_options(&mut self) -> &mut crate::RequestOptions {
916 &mut self.0.options
917 }
918 }
919
920 #[derive(Clone, Debug)]
937 pub struct GetGlossaryCategory(RequestBuilder<crate::model::GetGlossaryCategoryRequest>);
938
939 impl GetGlossaryCategory {
940 pub(crate) fn new(
941 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
942 ) -> Self {
943 Self(RequestBuilder::new(stub))
944 }
945
946 pub fn with_request<V: Into<crate::model::GetGlossaryCategoryRequest>>(
948 mut self,
949 v: V,
950 ) -> Self {
951 self.0.request = v.into();
952 self
953 }
954
955 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
957 self.0.options = v.into();
958 self
959 }
960
961 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
963 (*self.0.stub)
964 .get_glossary_category(self.0.request, self.0.options)
965 .await
966 .map(crate::Response::into_body)
967 }
968
969 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
973 self.0.request.name = v.into();
974 self
975 }
976 }
977
978 #[doc(hidden)]
979 impl crate::RequestBuilder for GetGlossaryCategory {
980 fn request_options(&mut self) -> &mut crate::RequestOptions {
981 &mut self.0.options
982 }
983 }
984
985 #[derive(Clone, Debug)]
1006 pub struct ListGlossaryCategories(RequestBuilder<crate::model::ListGlossaryCategoriesRequest>);
1007
1008 impl ListGlossaryCategories {
1009 pub(crate) fn new(
1010 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1011 ) -> Self {
1012 Self(RequestBuilder::new(stub))
1013 }
1014
1015 pub fn with_request<V: Into<crate::model::ListGlossaryCategoriesRequest>>(
1017 mut self,
1018 v: V,
1019 ) -> Self {
1020 self.0.request = v.into();
1021 self
1022 }
1023
1024 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1026 self.0.options = v.into();
1027 self
1028 }
1029
1030 pub async fn send(self) -> Result<crate::model::ListGlossaryCategoriesResponse> {
1032 (*self.0.stub)
1033 .list_glossary_categories(self.0.request, self.0.options)
1034 .await
1035 .map(crate::Response::into_body)
1036 }
1037
1038 pub fn by_page(
1040 self,
1041 ) -> impl google_cloud_gax::paginator::Paginator<
1042 crate::model::ListGlossaryCategoriesResponse,
1043 crate::Error,
1044 > {
1045 use std::clone::Clone;
1046 let token = self.0.request.page_token.clone();
1047 let execute = move |token: String| {
1048 let mut builder = self.clone();
1049 builder.0.request = builder.0.request.set_page_token(token);
1050 builder.send()
1051 };
1052 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1053 }
1054
1055 pub fn by_item(
1057 self,
1058 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1059 crate::model::ListGlossaryCategoriesResponse,
1060 crate::Error,
1061 > {
1062 use google_cloud_gax::paginator::Paginator;
1063 self.by_page().items()
1064 }
1065
1066 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1070 self.0.request.parent = v.into();
1071 self
1072 }
1073
1074 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1076 self.0.request.page_size = v.into();
1077 self
1078 }
1079
1080 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1082 self.0.request.page_token = v.into();
1083 self
1084 }
1085
1086 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1088 self.0.request.filter = v.into();
1089 self
1090 }
1091
1092 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1094 self.0.request.order_by = v.into();
1095 self
1096 }
1097 }
1098
1099 #[doc(hidden)]
1100 impl crate::RequestBuilder for ListGlossaryCategories {
1101 fn request_options(&mut self) -> &mut crate::RequestOptions {
1102 &mut self.0.options
1103 }
1104 }
1105
1106 #[derive(Clone, Debug)]
1123 pub struct CreateGlossaryTerm(RequestBuilder<crate::model::CreateGlossaryTermRequest>);
1124
1125 impl CreateGlossaryTerm {
1126 pub(crate) fn new(
1127 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1128 ) -> Self {
1129 Self(RequestBuilder::new(stub))
1130 }
1131
1132 pub fn with_request<V: Into<crate::model::CreateGlossaryTermRequest>>(
1134 mut self,
1135 v: V,
1136 ) -> Self {
1137 self.0.request = v.into();
1138 self
1139 }
1140
1141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1143 self.0.options = v.into();
1144 self
1145 }
1146
1147 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1149 (*self.0.stub)
1150 .create_glossary_term(self.0.request, self.0.options)
1151 .await
1152 .map(crate::Response::into_body)
1153 }
1154
1155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1159 self.0.request.parent = v.into();
1160 self
1161 }
1162
1163 pub fn set_term_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1167 self.0.request.term_id = v.into();
1168 self
1169 }
1170
1171 pub fn set_term<T>(mut self, v: T) -> Self
1175 where
1176 T: std::convert::Into<crate::model::GlossaryTerm>,
1177 {
1178 self.0.request.term = std::option::Option::Some(v.into());
1179 self
1180 }
1181
1182 pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
1186 where
1187 T: std::convert::Into<crate::model::GlossaryTerm>,
1188 {
1189 self.0.request.term = v.map(|x| x.into());
1190 self
1191 }
1192 }
1193
1194 #[doc(hidden)]
1195 impl crate::RequestBuilder for CreateGlossaryTerm {
1196 fn request_options(&mut self) -> &mut crate::RequestOptions {
1197 &mut self.0.options
1198 }
1199 }
1200
1201 #[derive(Clone, Debug)]
1218 pub struct UpdateGlossaryTerm(RequestBuilder<crate::model::UpdateGlossaryTermRequest>);
1219
1220 impl UpdateGlossaryTerm {
1221 pub(crate) fn new(
1222 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1223 ) -> Self {
1224 Self(RequestBuilder::new(stub))
1225 }
1226
1227 pub fn with_request<V: Into<crate::model::UpdateGlossaryTermRequest>>(
1229 mut self,
1230 v: V,
1231 ) -> Self {
1232 self.0.request = v.into();
1233 self
1234 }
1235
1236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1238 self.0.options = v.into();
1239 self
1240 }
1241
1242 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1244 (*self.0.stub)
1245 .update_glossary_term(self.0.request, self.0.options)
1246 .await
1247 .map(crate::Response::into_body)
1248 }
1249
1250 pub fn set_term<T>(mut self, v: T) -> Self
1254 where
1255 T: std::convert::Into<crate::model::GlossaryTerm>,
1256 {
1257 self.0.request.term = std::option::Option::Some(v.into());
1258 self
1259 }
1260
1261 pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
1265 where
1266 T: std::convert::Into<crate::model::GlossaryTerm>,
1267 {
1268 self.0.request.term = v.map(|x| x.into());
1269 self
1270 }
1271
1272 pub fn set_update_mask<T>(mut self, v: T) -> Self
1276 where
1277 T: std::convert::Into<wkt::FieldMask>,
1278 {
1279 self.0.request.update_mask = std::option::Option::Some(v.into());
1280 self
1281 }
1282
1283 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1287 where
1288 T: std::convert::Into<wkt::FieldMask>,
1289 {
1290 self.0.request.update_mask = v.map(|x| x.into());
1291 self
1292 }
1293 }
1294
1295 #[doc(hidden)]
1296 impl crate::RequestBuilder for UpdateGlossaryTerm {
1297 fn request_options(&mut self) -> &mut crate::RequestOptions {
1298 &mut self.0.options
1299 }
1300 }
1301
1302 #[derive(Clone, Debug)]
1319 pub struct DeleteGlossaryTerm(RequestBuilder<crate::model::DeleteGlossaryTermRequest>);
1320
1321 impl DeleteGlossaryTerm {
1322 pub(crate) fn new(
1323 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1324 ) -> Self {
1325 Self(RequestBuilder::new(stub))
1326 }
1327
1328 pub fn with_request<V: Into<crate::model::DeleteGlossaryTermRequest>>(
1330 mut self,
1331 v: V,
1332 ) -> Self {
1333 self.0.request = v.into();
1334 self
1335 }
1336
1337 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1339 self.0.options = v.into();
1340 self
1341 }
1342
1343 pub async fn send(self) -> Result<()> {
1345 (*self.0.stub)
1346 .delete_glossary_term(self.0.request, self.0.options)
1347 .await
1348 .map(crate::Response::into_body)
1349 }
1350
1351 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1355 self.0.request.name = v.into();
1356 self
1357 }
1358 }
1359
1360 #[doc(hidden)]
1361 impl crate::RequestBuilder for DeleteGlossaryTerm {
1362 fn request_options(&mut self) -> &mut crate::RequestOptions {
1363 &mut self.0.options
1364 }
1365 }
1366
1367 #[derive(Clone, Debug)]
1384 pub struct GetGlossaryTerm(RequestBuilder<crate::model::GetGlossaryTermRequest>);
1385
1386 impl GetGlossaryTerm {
1387 pub(crate) fn new(
1388 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1389 ) -> Self {
1390 Self(RequestBuilder::new(stub))
1391 }
1392
1393 pub fn with_request<V: Into<crate::model::GetGlossaryTermRequest>>(mut self, v: V) -> Self {
1395 self.0.request = v.into();
1396 self
1397 }
1398
1399 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1401 self.0.options = v.into();
1402 self
1403 }
1404
1405 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1407 (*self.0.stub)
1408 .get_glossary_term(self.0.request, self.0.options)
1409 .await
1410 .map(crate::Response::into_body)
1411 }
1412
1413 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1417 self.0.request.name = v.into();
1418 self
1419 }
1420 }
1421
1422 #[doc(hidden)]
1423 impl crate::RequestBuilder for GetGlossaryTerm {
1424 fn request_options(&mut self) -> &mut crate::RequestOptions {
1425 &mut self.0.options
1426 }
1427 }
1428
1429 #[derive(Clone, Debug)]
1450 pub struct ListGlossaryTerms(RequestBuilder<crate::model::ListGlossaryTermsRequest>);
1451
1452 impl ListGlossaryTerms {
1453 pub(crate) fn new(
1454 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1455 ) -> Self {
1456 Self(RequestBuilder::new(stub))
1457 }
1458
1459 pub fn with_request<V: Into<crate::model::ListGlossaryTermsRequest>>(
1461 mut self,
1462 v: V,
1463 ) -> Self {
1464 self.0.request = v.into();
1465 self
1466 }
1467
1468 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1470 self.0.options = v.into();
1471 self
1472 }
1473
1474 pub async fn send(self) -> Result<crate::model::ListGlossaryTermsResponse> {
1476 (*self.0.stub)
1477 .list_glossary_terms(self.0.request, self.0.options)
1478 .await
1479 .map(crate::Response::into_body)
1480 }
1481
1482 pub fn by_page(
1484 self,
1485 ) -> impl google_cloud_gax::paginator::Paginator<
1486 crate::model::ListGlossaryTermsResponse,
1487 crate::Error,
1488 > {
1489 use std::clone::Clone;
1490 let token = self.0.request.page_token.clone();
1491 let execute = move |token: String| {
1492 let mut builder = self.clone();
1493 builder.0.request = builder.0.request.set_page_token(token);
1494 builder.send()
1495 };
1496 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1497 }
1498
1499 pub fn by_item(
1501 self,
1502 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1503 crate::model::ListGlossaryTermsResponse,
1504 crate::Error,
1505 > {
1506 use google_cloud_gax::paginator::Paginator;
1507 self.by_page().items()
1508 }
1509
1510 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1514 self.0.request.parent = v.into();
1515 self
1516 }
1517
1518 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1520 self.0.request.page_size = v.into();
1521 self
1522 }
1523
1524 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1526 self.0.request.page_token = v.into();
1527 self
1528 }
1529
1530 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1532 self.0.request.filter = v.into();
1533 self
1534 }
1535
1536 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1538 self.0.request.order_by = v.into();
1539 self
1540 }
1541 }
1542
1543 #[doc(hidden)]
1544 impl crate::RequestBuilder for ListGlossaryTerms {
1545 fn request_options(&mut self) -> &mut crate::RequestOptions {
1546 &mut self.0.options
1547 }
1548 }
1549
1550 #[derive(Clone, Debug)]
1571 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1572
1573 impl ListLocations {
1574 pub(crate) fn new(
1575 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1576 ) -> Self {
1577 Self(RequestBuilder::new(stub))
1578 }
1579
1580 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1582 mut self,
1583 v: V,
1584 ) -> Self {
1585 self.0.request = v.into();
1586 self
1587 }
1588
1589 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1591 self.0.options = v.into();
1592 self
1593 }
1594
1595 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1597 (*self.0.stub)
1598 .list_locations(self.0.request, self.0.options)
1599 .await
1600 .map(crate::Response::into_body)
1601 }
1602
1603 pub fn by_page(
1605 self,
1606 ) -> impl google_cloud_gax::paginator::Paginator<
1607 google_cloud_location::model::ListLocationsResponse,
1608 crate::Error,
1609 > {
1610 use std::clone::Clone;
1611 let token = self.0.request.page_token.clone();
1612 let execute = move |token: String| {
1613 let mut builder = self.clone();
1614 builder.0.request = builder.0.request.set_page_token(token);
1615 builder.send()
1616 };
1617 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1618 }
1619
1620 pub fn by_item(
1622 self,
1623 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1624 google_cloud_location::model::ListLocationsResponse,
1625 crate::Error,
1626 > {
1627 use google_cloud_gax::paginator::Paginator;
1628 self.by_page().items()
1629 }
1630
1631 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1633 self.0.request.name = v.into();
1634 self
1635 }
1636
1637 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1639 self.0.request.filter = v.into();
1640 self
1641 }
1642
1643 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1645 self.0.request.page_size = v.into();
1646 self
1647 }
1648
1649 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1651 self.0.request.page_token = v.into();
1652 self
1653 }
1654 }
1655
1656 #[doc(hidden)]
1657 impl crate::RequestBuilder for ListLocations {
1658 fn request_options(&mut self) -> &mut crate::RequestOptions {
1659 &mut self.0.options
1660 }
1661 }
1662
1663 #[derive(Clone, Debug)]
1680 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1681
1682 impl GetLocation {
1683 pub(crate) fn new(
1684 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1685 ) -> Self {
1686 Self(RequestBuilder::new(stub))
1687 }
1688
1689 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1691 mut self,
1692 v: V,
1693 ) -> Self {
1694 self.0.request = v.into();
1695 self
1696 }
1697
1698 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1700 self.0.options = v.into();
1701 self
1702 }
1703
1704 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1706 (*self.0.stub)
1707 .get_location(self.0.request, self.0.options)
1708 .await
1709 .map(crate::Response::into_body)
1710 }
1711
1712 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1714 self.0.request.name = v.into();
1715 self
1716 }
1717 }
1718
1719 #[doc(hidden)]
1720 impl crate::RequestBuilder for GetLocation {
1721 fn request_options(&mut self) -> &mut crate::RequestOptions {
1722 &mut self.0.options
1723 }
1724 }
1725
1726 #[derive(Clone, Debug)]
1743 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1744
1745 impl SetIamPolicy {
1746 pub(crate) fn new(
1747 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1748 ) -> Self {
1749 Self(RequestBuilder::new(stub))
1750 }
1751
1752 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1754 mut self,
1755 v: V,
1756 ) -> Self {
1757 self.0.request = v.into();
1758 self
1759 }
1760
1761 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1763 self.0.options = v.into();
1764 self
1765 }
1766
1767 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1769 (*self.0.stub)
1770 .set_iam_policy(self.0.request, self.0.options)
1771 .await
1772 .map(crate::Response::into_body)
1773 }
1774
1775 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1779 self.0.request.resource = v.into();
1780 self
1781 }
1782
1783 pub fn set_policy<T>(mut self, v: T) -> Self
1787 where
1788 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1789 {
1790 self.0.request.policy = std::option::Option::Some(v.into());
1791 self
1792 }
1793
1794 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1798 where
1799 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1800 {
1801 self.0.request.policy = v.map(|x| x.into());
1802 self
1803 }
1804
1805 pub fn set_update_mask<T>(mut self, v: T) -> Self
1807 where
1808 T: std::convert::Into<wkt::FieldMask>,
1809 {
1810 self.0.request.update_mask = std::option::Option::Some(v.into());
1811 self
1812 }
1813
1814 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1816 where
1817 T: std::convert::Into<wkt::FieldMask>,
1818 {
1819 self.0.request.update_mask = v.map(|x| x.into());
1820 self
1821 }
1822 }
1823
1824 #[doc(hidden)]
1825 impl crate::RequestBuilder for SetIamPolicy {
1826 fn request_options(&mut self) -> &mut crate::RequestOptions {
1827 &mut self.0.options
1828 }
1829 }
1830
1831 #[derive(Clone, Debug)]
1848 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1849
1850 impl GetIamPolicy {
1851 pub(crate) fn new(
1852 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1853 ) -> Self {
1854 Self(RequestBuilder::new(stub))
1855 }
1856
1857 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1859 mut self,
1860 v: V,
1861 ) -> Self {
1862 self.0.request = v.into();
1863 self
1864 }
1865
1866 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1868 self.0.options = v.into();
1869 self
1870 }
1871
1872 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1874 (*self.0.stub)
1875 .get_iam_policy(self.0.request, self.0.options)
1876 .await
1877 .map(crate::Response::into_body)
1878 }
1879
1880 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1884 self.0.request.resource = v.into();
1885 self
1886 }
1887
1888 pub fn set_options<T>(mut self, v: T) -> Self
1890 where
1891 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1892 {
1893 self.0.request.options = std::option::Option::Some(v.into());
1894 self
1895 }
1896
1897 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1899 where
1900 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1901 {
1902 self.0.request.options = v.map(|x| x.into());
1903 self
1904 }
1905 }
1906
1907 #[doc(hidden)]
1908 impl crate::RequestBuilder for GetIamPolicy {
1909 fn request_options(&mut self) -> &mut crate::RequestOptions {
1910 &mut self.0.options
1911 }
1912 }
1913
1914 #[derive(Clone, Debug)]
1931 pub struct TestIamPermissions(
1932 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1933 );
1934
1935 impl TestIamPermissions {
1936 pub(crate) fn new(
1937 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1938 ) -> Self {
1939 Self(RequestBuilder::new(stub))
1940 }
1941
1942 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1944 mut self,
1945 v: V,
1946 ) -> Self {
1947 self.0.request = v.into();
1948 self
1949 }
1950
1951 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1953 self.0.options = v.into();
1954 self
1955 }
1956
1957 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1959 (*self.0.stub)
1960 .test_iam_permissions(self.0.request, self.0.options)
1961 .await
1962 .map(crate::Response::into_body)
1963 }
1964
1965 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1969 self.0.request.resource = v.into();
1970 self
1971 }
1972
1973 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1977 where
1978 T: std::iter::IntoIterator<Item = V>,
1979 V: std::convert::Into<std::string::String>,
1980 {
1981 use std::iter::Iterator;
1982 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1983 self
1984 }
1985 }
1986
1987 #[doc(hidden)]
1988 impl crate::RequestBuilder for TestIamPermissions {
1989 fn request_options(&mut self) -> &mut crate::RequestOptions {
1990 &mut self.0.options
1991 }
1992 }
1993
1994 #[derive(Clone, Debug)]
2015 pub struct ListOperations(
2016 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2017 );
2018
2019 impl ListOperations {
2020 pub(crate) fn new(
2021 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2022 ) -> Self {
2023 Self(RequestBuilder::new(stub))
2024 }
2025
2026 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2028 mut self,
2029 v: V,
2030 ) -> Self {
2031 self.0.request = v.into();
2032 self
2033 }
2034
2035 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2037 self.0.options = v.into();
2038 self
2039 }
2040
2041 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2043 (*self.0.stub)
2044 .list_operations(self.0.request, self.0.options)
2045 .await
2046 .map(crate::Response::into_body)
2047 }
2048
2049 pub fn by_page(
2051 self,
2052 ) -> impl google_cloud_gax::paginator::Paginator<
2053 google_cloud_longrunning::model::ListOperationsResponse,
2054 crate::Error,
2055 > {
2056 use std::clone::Clone;
2057 let token = self.0.request.page_token.clone();
2058 let execute = move |token: String| {
2059 let mut builder = self.clone();
2060 builder.0.request = builder.0.request.set_page_token(token);
2061 builder.send()
2062 };
2063 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2064 }
2065
2066 pub fn by_item(
2068 self,
2069 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2070 google_cloud_longrunning::model::ListOperationsResponse,
2071 crate::Error,
2072 > {
2073 use google_cloud_gax::paginator::Paginator;
2074 self.by_page().items()
2075 }
2076
2077 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2079 self.0.request.name = v.into();
2080 self
2081 }
2082
2083 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2085 self.0.request.filter = v.into();
2086 self
2087 }
2088
2089 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2091 self.0.request.page_size = v.into();
2092 self
2093 }
2094
2095 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2097 self.0.request.page_token = v.into();
2098 self
2099 }
2100
2101 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2103 self.0.request.return_partial_success = v.into();
2104 self
2105 }
2106 }
2107
2108 #[doc(hidden)]
2109 impl crate::RequestBuilder for ListOperations {
2110 fn request_options(&mut self) -> &mut crate::RequestOptions {
2111 &mut self.0.options
2112 }
2113 }
2114
2115 #[derive(Clone, Debug)]
2132 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2133
2134 impl GetOperation {
2135 pub(crate) fn new(
2136 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2137 ) -> Self {
2138 Self(RequestBuilder::new(stub))
2139 }
2140
2141 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2143 mut self,
2144 v: V,
2145 ) -> Self {
2146 self.0.request = v.into();
2147 self
2148 }
2149
2150 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2152 self.0.options = v.into();
2153 self
2154 }
2155
2156 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2158 (*self.0.stub)
2159 .get_operation(self.0.request, self.0.options)
2160 .await
2161 .map(crate::Response::into_body)
2162 }
2163
2164 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2166 self.0.request.name = v.into();
2167 self
2168 }
2169 }
2170
2171 #[doc(hidden)]
2172 impl crate::RequestBuilder for GetOperation {
2173 fn request_options(&mut self) -> &mut crate::RequestOptions {
2174 &mut self.0.options
2175 }
2176 }
2177
2178 #[derive(Clone, Debug)]
2195 pub struct DeleteOperation(
2196 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2197 );
2198
2199 impl DeleteOperation {
2200 pub(crate) fn new(
2201 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2202 ) -> Self {
2203 Self(RequestBuilder::new(stub))
2204 }
2205
2206 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2208 mut self,
2209 v: V,
2210 ) -> Self {
2211 self.0.request = v.into();
2212 self
2213 }
2214
2215 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2217 self.0.options = v.into();
2218 self
2219 }
2220
2221 pub async fn send(self) -> Result<()> {
2223 (*self.0.stub)
2224 .delete_operation(self.0.request, self.0.options)
2225 .await
2226 .map(crate::Response::into_body)
2227 }
2228
2229 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2231 self.0.request.name = v.into();
2232 self
2233 }
2234 }
2235
2236 #[doc(hidden)]
2237 impl crate::RequestBuilder for DeleteOperation {
2238 fn request_options(&mut self) -> &mut crate::RequestOptions {
2239 &mut self.0.options
2240 }
2241 }
2242
2243 #[derive(Clone, Debug)]
2260 pub struct CancelOperation(
2261 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2262 );
2263
2264 impl CancelOperation {
2265 pub(crate) fn new(
2266 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2267 ) -> Self {
2268 Self(RequestBuilder::new(stub))
2269 }
2270
2271 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2273 mut self,
2274 v: V,
2275 ) -> Self {
2276 self.0.request = v.into();
2277 self
2278 }
2279
2280 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2282 self.0.options = v.into();
2283 self
2284 }
2285
2286 pub async fn send(self) -> Result<()> {
2288 (*self.0.stub)
2289 .cancel_operation(self.0.request, self.0.options)
2290 .await
2291 .map(crate::Response::into_body)
2292 }
2293
2294 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2296 self.0.request.name = v.into();
2297 self
2298 }
2299 }
2300
2301 #[doc(hidden)]
2302 impl crate::RequestBuilder for CancelOperation {
2303 fn request_options(&mut self) -> &mut crate::RequestOptions {
2304 &mut self.0.options
2305 }
2306 }
2307}
2308
2309pub mod catalog_service {
2310 use crate::Result;
2311
2312 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2326
2327 pub(crate) mod client {
2328 use super::super::super::client::CatalogService;
2329 pub struct Factory;
2330 impl crate::ClientFactory for Factory {
2331 type Client = CatalogService;
2332 type Credentials = gaxi::options::Credentials;
2333 async fn build(
2334 self,
2335 config: gaxi::options::ClientConfig,
2336 ) -> crate::ClientBuilderResult<Self::Client> {
2337 Self::Client::new(config).await
2338 }
2339 }
2340 }
2341
2342 #[derive(Clone, Debug)]
2344 pub(crate) struct RequestBuilder<R: std::default::Default> {
2345 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2346 request: R,
2347 options: crate::RequestOptions,
2348 }
2349
2350 impl<R> RequestBuilder<R>
2351 where
2352 R: std::default::Default,
2353 {
2354 pub(crate) fn new(
2355 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2356 ) -> Self {
2357 Self {
2358 stub,
2359 request: R::default(),
2360 options: crate::RequestOptions::default(),
2361 }
2362 }
2363 }
2364
2365 #[derive(Clone, Debug)]
2383 pub struct CreateEntryType(RequestBuilder<crate::model::CreateEntryTypeRequest>);
2384
2385 impl CreateEntryType {
2386 pub(crate) fn new(
2387 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2388 ) -> Self {
2389 Self(RequestBuilder::new(stub))
2390 }
2391
2392 pub fn with_request<V: Into<crate::model::CreateEntryTypeRequest>>(mut self, v: V) -> Self {
2394 self.0.request = v.into();
2395 self
2396 }
2397
2398 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2400 self.0.options = v.into();
2401 self
2402 }
2403
2404 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2411 (*self.0.stub)
2412 .create_entry_type(self.0.request, self.0.options)
2413 .await
2414 .map(crate::Response::into_body)
2415 }
2416
2417 pub fn poller(
2419 self,
2420 ) -> impl google_cloud_lro::Poller<crate::model::EntryType, crate::model::OperationMetadata>
2421 {
2422 type Operation = google_cloud_lro::internal::Operation<
2423 crate::model::EntryType,
2424 crate::model::OperationMetadata,
2425 >;
2426 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2427 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2428
2429 let stub = self.0.stub.clone();
2430 let mut options = self.0.options.clone();
2431 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2432 let query = move |name| {
2433 let stub = stub.clone();
2434 let options = options.clone();
2435 async {
2436 let op = GetOperation::new(stub)
2437 .set_name(name)
2438 .with_options(options)
2439 .send()
2440 .await?;
2441 Ok(Operation::new(op))
2442 }
2443 };
2444
2445 let start = move || async {
2446 let op = self.send().await?;
2447 Ok(Operation::new(op))
2448 };
2449
2450 google_cloud_lro::internal::new_poller(
2451 polling_error_policy,
2452 polling_backoff_policy,
2453 start,
2454 query,
2455 )
2456 }
2457
2458 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2462 self.0.request.parent = v.into();
2463 self
2464 }
2465
2466 pub fn set_entry_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2470 self.0.request.entry_type_id = v.into();
2471 self
2472 }
2473
2474 pub fn set_entry_type<T>(mut self, v: T) -> Self
2478 where
2479 T: std::convert::Into<crate::model::EntryType>,
2480 {
2481 self.0.request.entry_type = std::option::Option::Some(v.into());
2482 self
2483 }
2484
2485 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
2489 where
2490 T: std::convert::Into<crate::model::EntryType>,
2491 {
2492 self.0.request.entry_type = v.map(|x| x.into());
2493 self
2494 }
2495
2496 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2498 self.0.request.validate_only = v.into();
2499 self
2500 }
2501 }
2502
2503 #[doc(hidden)]
2504 impl crate::RequestBuilder for CreateEntryType {
2505 fn request_options(&mut self) -> &mut crate::RequestOptions {
2506 &mut self.0.options
2507 }
2508 }
2509
2510 #[derive(Clone, Debug)]
2528 pub struct UpdateEntryType(RequestBuilder<crate::model::UpdateEntryTypeRequest>);
2529
2530 impl UpdateEntryType {
2531 pub(crate) fn new(
2532 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2533 ) -> Self {
2534 Self(RequestBuilder::new(stub))
2535 }
2536
2537 pub fn with_request<V: Into<crate::model::UpdateEntryTypeRequest>>(mut self, v: V) -> Self {
2539 self.0.request = v.into();
2540 self
2541 }
2542
2543 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2545 self.0.options = v.into();
2546 self
2547 }
2548
2549 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2556 (*self.0.stub)
2557 .update_entry_type(self.0.request, self.0.options)
2558 .await
2559 .map(crate::Response::into_body)
2560 }
2561
2562 pub fn poller(
2564 self,
2565 ) -> impl google_cloud_lro::Poller<crate::model::EntryType, crate::model::OperationMetadata>
2566 {
2567 type Operation = google_cloud_lro::internal::Operation<
2568 crate::model::EntryType,
2569 crate::model::OperationMetadata,
2570 >;
2571 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2572 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2573
2574 let stub = self.0.stub.clone();
2575 let mut options = self.0.options.clone();
2576 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2577 let query = move |name| {
2578 let stub = stub.clone();
2579 let options = options.clone();
2580 async {
2581 let op = GetOperation::new(stub)
2582 .set_name(name)
2583 .with_options(options)
2584 .send()
2585 .await?;
2586 Ok(Operation::new(op))
2587 }
2588 };
2589
2590 let start = move || async {
2591 let op = self.send().await?;
2592 Ok(Operation::new(op))
2593 };
2594
2595 google_cloud_lro::internal::new_poller(
2596 polling_error_policy,
2597 polling_backoff_policy,
2598 start,
2599 query,
2600 )
2601 }
2602
2603 pub fn set_entry_type<T>(mut self, v: T) -> Self
2607 where
2608 T: std::convert::Into<crate::model::EntryType>,
2609 {
2610 self.0.request.entry_type = std::option::Option::Some(v.into());
2611 self
2612 }
2613
2614 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
2618 where
2619 T: std::convert::Into<crate::model::EntryType>,
2620 {
2621 self.0.request.entry_type = v.map(|x| x.into());
2622 self
2623 }
2624
2625 pub fn set_update_mask<T>(mut self, v: T) -> Self
2629 where
2630 T: std::convert::Into<wkt::FieldMask>,
2631 {
2632 self.0.request.update_mask = std::option::Option::Some(v.into());
2633 self
2634 }
2635
2636 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2640 where
2641 T: std::convert::Into<wkt::FieldMask>,
2642 {
2643 self.0.request.update_mask = v.map(|x| x.into());
2644 self
2645 }
2646
2647 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2649 self.0.request.validate_only = v.into();
2650 self
2651 }
2652 }
2653
2654 #[doc(hidden)]
2655 impl crate::RequestBuilder for UpdateEntryType {
2656 fn request_options(&mut self) -> &mut crate::RequestOptions {
2657 &mut self.0.options
2658 }
2659 }
2660
2661 #[derive(Clone, Debug)]
2679 pub struct DeleteEntryType(RequestBuilder<crate::model::DeleteEntryTypeRequest>);
2680
2681 impl DeleteEntryType {
2682 pub(crate) fn new(
2683 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2684 ) -> Self {
2685 Self(RequestBuilder::new(stub))
2686 }
2687
2688 pub fn with_request<V: Into<crate::model::DeleteEntryTypeRequest>>(mut self, v: V) -> Self {
2690 self.0.request = v.into();
2691 self
2692 }
2693
2694 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2696 self.0.options = v.into();
2697 self
2698 }
2699
2700 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2707 (*self.0.stub)
2708 .delete_entry_type(self.0.request, self.0.options)
2709 .await
2710 .map(crate::Response::into_body)
2711 }
2712
2713 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2715 type Operation =
2716 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2717 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2718 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2719
2720 let stub = self.0.stub.clone();
2721 let mut options = self.0.options.clone();
2722 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2723 let query = move |name| {
2724 let stub = stub.clone();
2725 let options = options.clone();
2726 async {
2727 let op = GetOperation::new(stub)
2728 .set_name(name)
2729 .with_options(options)
2730 .send()
2731 .await?;
2732 Ok(Operation::new(op))
2733 }
2734 };
2735
2736 let start = move || async {
2737 let op = self.send().await?;
2738 Ok(Operation::new(op))
2739 };
2740
2741 google_cloud_lro::internal::new_unit_response_poller(
2742 polling_error_policy,
2743 polling_backoff_policy,
2744 start,
2745 query,
2746 )
2747 }
2748
2749 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2753 self.0.request.name = v.into();
2754 self
2755 }
2756
2757 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2759 self.0.request.etag = v.into();
2760 self
2761 }
2762 }
2763
2764 #[doc(hidden)]
2765 impl crate::RequestBuilder for DeleteEntryType {
2766 fn request_options(&mut self) -> &mut crate::RequestOptions {
2767 &mut self.0.options
2768 }
2769 }
2770
2771 #[derive(Clone, Debug)]
2792 pub struct ListEntryTypes(RequestBuilder<crate::model::ListEntryTypesRequest>);
2793
2794 impl ListEntryTypes {
2795 pub(crate) fn new(
2796 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2797 ) -> Self {
2798 Self(RequestBuilder::new(stub))
2799 }
2800
2801 pub fn with_request<V: Into<crate::model::ListEntryTypesRequest>>(mut self, v: V) -> Self {
2803 self.0.request = v.into();
2804 self
2805 }
2806
2807 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2809 self.0.options = v.into();
2810 self
2811 }
2812
2813 pub async fn send(self) -> Result<crate::model::ListEntryTypesResponse> {
2815 (*self.0.stub)
2816 .list_entry_types(self.0.request, self.0.options)
2817 .await
2818 .map(crate::Response::into_body)
2819 }
2820
2821 pub fn by_page(
2823 self,
2824 ) -> impl google_cloud_gax::paginator::Paginator<
2825 crate::model::ListEntryTypesResponse,
2826 crate::Error,
2827 > {
2828 use std::clone::Clone;
2829 let token = self.0.request.page_token.clone();
2830 let execute = move |token: String| {
2831 let mut builder = self.clone();
2832 builder.0.request = builder.0.request.set_page_token(token);
2833 builder.send()
2834 };
2835 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2836 }
2837
2838 pub fn by_item(
2840 self,
2841 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2842 crate::model::ListEntryTypesResponse,
2843 crate::Error,
2844 > {
2845 use google_cloud_gax::paginator::Paginator;
2846 self.by_page().items()
2847 }
2848
2849 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2853 self.0.request.parent = v.into();
2854 self
2855 }
2856
2857 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2859 self.0.request.page_size = v.into();
2860 self
2861 }
2862
2863 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2865 self.0.request.page_token = v.into();
2866 self
2867 }
2868
2869 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2871 self.0.request.filter = v.into();
2872 self
2873 }
2874
2875 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2877 self.0.request.order_by = v.into();
2878 self
2879 }
2880 }
2881
2882 #[doc(hidden)]
2883 impl crate::RequestBuilder for ListEntryTypes {
2884 fn request_options(&mut self) -> &mut crate::RequestOptions {
2885 &mut self.0.options
2886 }
2887 }
2888
2889 #[derive(Clone, Debug)]
2906 pub struct GetEntryType(RequestBuilder<crate::model::GetEntryTypeRequest>);
2907
2908 impl GetEntryType {
2909 pub(crate) fn new(
2910 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2911 ) -> Self {
2912 Self(RequestBuilder::new(stub))
2913 }
2914
2915 pub fn with_request<V: Into<crate::model::GetEntryTypeRequest>>(mut self, v: V) -> Self {
2917 self.0.request = v.into();
2918 self
2919 }
2920
2921 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2923 self.0.options = v.into();
2924 self
2925 }
2926
2927 pub async fn send(self) -> Result<crate::model::EntryType> {
2929 (*self.0.stub)
2930 .get_entry_type(self.0.request, self.0.options)
2931 .await
2932 .map(crate::Response::into_body)
2933 }
2934
2935 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2939 self.0.request.name = v.into();
2940 self
2941 }
2942 }
2943
2944 #[doc(hidden)]
2945 impl crate::RequestBuilder for GetEntryType {
2946 fn request_options(&mut self) -> &mut crate::RequestOptions {
2947 &mut self.0.options
2948 }
2949 }
2950
2951 #[derive(Clone, Debug)]
2969 pub struct CreateAspectType(RequestBuilder<crate::model::CreateAspectTypeRequest>);
2970
2971 impl CreateAspectType {
2972 pub(crate) fn new(
2973 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2974 ) -> Self {
2975 Self(RequestBuilder::new(stub))
2976 }
2977
2978 pub fn with_request<V: Into<crate::model::CreateAspectTypeRequest>>(
2980 mut self,
2981 v: V,
2982 ) -> Self {
2983 self.0.request = v.into();
2984 self
2985 }
2986
2987 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2989 self.0.options = v.into();
2990 self
2991 }
2992
2993 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3000 (*self.0.stub)
3001 .create_aspect_type(self.0.request, self.0.options)
3002 .await
3003 .map(crate::Response::into_body)
3004 }
3005
3006 pub fn poller(
3008 self,
3009 ) -> impl google_cloud_lro::Poller<crate::model::AspectType, crate::model::OperationMetadata>
3010 {
3011 type Operation = google_cloud_lro::internal::Operation<
3012 crate::model::AspectType,
3013 crate::model::OperationMetadata,
3014 >;
3015 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3016 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3017
3018 let stub = self.0.stub.clone();
3019 let mut options = self.0.options.clone();
3020 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3021 let query = move |name| {
3022 let stub = stub.clone();
3023 let options = options.clone();
3024 async {
3025 let op = GetOperation::new(stub)
3026 .set_name(name)
3027 .with_options(options)
3028 .send()
3029 .await?;
3030 Ok(Operation::new(op))
3031 }
3032 };
3033
3034 let start = move || async {
3035 let op = self.send().await?;
3036 Ok(Operation::new(op))
3037 };
3038
3039 google_cloud_lro::internal::new_poller(
3040 polling_error_policy,
3041 polling_backoff_policy,
3042 start,
3043 query,
3044 )
3045 }
3046
3047 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3051 self.0.request.parent = v.into();
3052 self
3053 }
3054
3055 pub fn set_aspect_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3059 self.0.request.aspect_type_id = v.into();
3060 self
3061 }
3062
3063 pub fn set_aspect_type<T>(mut self, v: T) -> Self
3067 where
3068 T: std::convert::Into<crate::model::AspectType>,
3069 {
3070 self.0.request.aspect_type = std::option::Option::Some(v.into());
3071 self
3072 }
3073
3074 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
3078 where
3079 T: std::convert::Into<crate::model::AspectType>,
3080 {
3081 self.0.request.aspect_type = v.map(|x| x.into());
3082 self
3083 }
3084
3085 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3087 self.0.request.validate_only = v.into();
3088 self
3089 }
3090 }
3091
3092 #[doc(hidden)]
3093 impl crate::RequestBuilder for CreateAspectType {
3094 fn request_options(&mut self) -> &mut crate::RequestOptions {
3095 &mut self.0.options
3096 }
3097 }
3098
3099 #[derive(Clone, Debug)]
3117 pub struct UpdateAspectType(RequestBuilder<crate::model::UpdateAspectTypeRequest>);
3118
3119 impl UpdateAspectType {
3120 pub(crate) fn new(
3121 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3122 ) -> Self {
3123 Self(RequestBuilder::new(stub))
3124 }
3125
3126 pub fn with_request<V: Into<crate::model::UpdateAspectTypeRequest>>(
3128 mut self,
3129 v: V,
3130 ) -> Self {
3131 self.0.request = v.into();
3132 self
3133 }
3134
3135 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3137 self.0.options = v.into();
3138 self
3139 }
3140
3141 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3148 (*self.0.stub)
3149 .update_aspect_type(self.0.request, self.0.options)
3150 .await
3151 .map(crate::Response::into_body)
3152 }
3153
3154 pub fn poller(
3156 self,
3157 ) -> impl google_cloud_lro::Poller<crate::model::AspectType, crate::model::OperationMetadata>
3158 {
3159 type Operation = google_cloud_lro::internal::Operation<
3160 crate::model::AspectType,
3161 crate::model::OperationMetadata,
3162 >;
3163 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3164 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3165
3166 let stub = self.0.stub.clone();
3167 let mut options = self.0.options.clone();
3168 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3169 let query = move |name| {
3170 let stub = stub.clone();
3171 let options = options.clone();
3172 async {
3173 let op = GetOperation::new(stub)
3174 .set_name(name)
3175 .with_options(options)
3176 .send()
3177 .await?;
3178 Ok(Operation::new(op))
3179 }
3180 };
3181
3182 let start = move || async {
3183 let op = self.send().await?;
3184 Ok(Operation::new(op))
3185 };
3186
3187 google_cloud_lro::internal::new_poller(
3188 polling_error_policy,
3189 polling_backoff_policy,
3190 start,
3191 query,
3192 )
3193 }
3194
3195 pub fn set_aspect_type<T>(mut self, v: T) -> Self
3199 where
3200 T: std::convert::Into<crate::model::AspectType>,
3201 {
3202 self.0.request.aspect_type = std::option::Option::Some(v.into());
3203 self
3204 }
3205
3206 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
3210 where
3211 T: std::convert::Into<crate::model::AspectType>,
3212 {
3213 self.0.request.aspect_type = v.map(|x| x.into());
3214 self
3215 }
3216
3217 pub fn set_update_mask<T>(mut self, v: T) -> Self
3221 where
3222 T: std::convert::Into<wkt::FieldMask>,
3223 {
3224 self.0.request.update_mask = std::option::Option::Some(v.into());
3225 self
3226 }
3227
3228 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3232 where
3233 T: std::convert::Into<wkt::FieldMask>,
3234 {
3235 self.0.request.update_mask = v.map(|x| x.into());
3236 self
3237 }
3238
3239 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3241 self.0.request.validate_only = v.into();
3242 self
3243 }
3244 }
3245
3246 #[doc(hidden)]
3247 impl crate::RequestBuilder for UpdateAspectType {
3248 fn request_options(&mut self) -> &mut crate::RequestOptions {
3249 &mut self.0.options
3250 }
3251 }
3252
3253 #[derive(Clone, Debug)]
3271 pub struct DeleteAspectType(RequestBuilder<crate::model::DeleteAspectTypeRequest>);
3272
3273 impl DeleteAspectType {
3274 pub(crate) fn new(
3275 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3276 ) -> Self {
3277 Self(RequestBuilder::new(stub))
3278 }
3279
3280 pub fn with_request<V: Into<crate::model::DeleteAspectTypeRequest>>(
3282 mut self,
3283 v: V,
3284 ) -> Self {
3285 self.0.request = v.into();
3286 self
3287 }
3288
3289 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3291 self.0.options = v.into();
3292 self
3293 }
3294
3295 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3302 (*self.0.stub)
3303 .delete_aspect_type(self.0.request, self.0.options)
3304 .await
3305 .map(crate::Response::into_body)
3306 }
3307
3308 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3310 type Operation =
3311 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3312 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3313 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3314
3315 let stub = self.0.stub.clone();
3316 let mut options = self.0.options.clone();
3317 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3318 let query = move |name| {
3319 let stub = stub.clone();
3320 let options = options.clone();
3321 async {
3322 let op = GetOperation::new(stub)
3323 .set_name(name)
3324 .with_options(options)
3325 .send()
3326 .await?;
3327 Ok(Operation::new(op))
3328 }
3329 };
3330
3331 let start = move || async {
3332 let op = self.send().await?;
3333 Ok(Operation::new(op))
3334 };
3335
3336 google_cloud_lro::internal::new_unit_response_poller(
3337 polling_error_policy,
3338 polling_backoff_policy,
3339 start,
3340 query,
3341 )
3342 }
3343
3344 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3348 self.0.request.name = v.into();
3349 self
3350 }
3351
3352 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3354 self.0.request.etag = v.into();
3355 self
3356 }
3357 }
3358
3359 #[doc(hidden)]
3360 impl crate::RequestBuilder for DeleteAspectType {
3361 fn request_options(&mut self) -> &mut crate::RequestOptions {
3362 &mut self.0.options
3363 }
3364 }
3365
3366 #[derive(Clone, Debug)]
3387 pub struct ListAspectTypes(RequestBuilder<crate::model::ListAspectTypesRequest>);
3388
3389 impl ListAspectTypes {
3390 pub(crate) fn new(
3391 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3392 ) -> Self {
3393 Self(RequestBuilder::new(stub))
3394 }
3395
3396 pub fn with_request<V: Into<crate::model::ListAspectTypesRequest>>(mut self, v: V) -> Self {
3398 self.0.request = v.into();
3399 self
3400 }
3401
3402 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3404 self.0.options = v.into();
3405 self
3406 }
3407
3408 pub async fn send(self) -> Result<crate::model::ListAspectTypesResponse> {
3410 (*self.0.stub)
3411 .list_aspect_types(self.0.request, self.0.options)
3412 .await
3413 .map(crate::Response::into_body)
3414 }
3415
3416 pub fn by_page(
3418 self,
3419 ) -> impl google_cloud_gax::paginator::Paginator<
3420 crate::model::ListAspectTypesResponse,
3421 crate::Error,
3422 > {
3423 use std::clone::Clone;
3424 let token = self.0.request.page_token.clone();
3425 let execute = move |token: String| {
3426 let mut builder = self.clone();
3427 builder.0.request = builder.0.request.set_page_token(token);
3428 builder.send()
3429 };
3430 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3431 }
3432
3433 pub fn by_item(
3435 self,
3436 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3437 crate::model::ListAspectTypesResponse,
3438 crate::Error,
3439 > {
3440 use google_cloud_gax::paginator::Paginator;
3441 self.by_page().items()
3442 }
3443
3444 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3448 self.0.request.parent = v.into();
3449 self
3450 }
3451
3452 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3454 self.0.request.page_size = v.into();
3455 self
3456 }
3457
3458 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3460 self.0.request.page_token = v.into();
3461 self
3462 }
3463
3464 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3466 self.0.request.filter = v.into();
3467 self
3468 }
3469
3470 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3472 self.0.request.order_by = v.into();
3473 self
3474 }
3475 }
3476
3477 #[doc(hidden)]
3478 impl crate::RequestBuilder for ListAspectTypes {
3479 fn request_options(&mut self) -> &mut crate::RequestOptions {
3480 &mut self.0.options
3481 }
3482 }
3483
3484 #[derive(Clone, Debug)]
3501 pub struct GetAspectType(RequestBuilder<crate::model::GetAspectTypeRequest>);
3502
3503 impl GetAspectType {
3504 pub(crate) fn new(
3505 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3506 ) -> Self {
3507 Self(RequestBuilder::new(stub))
3508 }
3509
3510 pub fn with_request<V: Into<crate::model::GetAspectTypeRequest>>(mut self, v: V) -> Self {
3512 self.0.request = v.into();
3513 self
3514 }
3515
3516 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3518 self.0.options = v.into();
3519 self
3520 }
3521
3522 pub async fn send(self) -> Result<crate::model::AspectType> {
3524 (*self.0.stub)
3525 .get_aspect_type(self.0.request, self.0.options)
3526 .await
3527 .map(crate::Response::into_body)
3528 }
3529
3530 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3534 self.0.request.name = v.into();
3535 self
3536 }
3537 }
3538
3539 #[doc(hidden)]
3540 impl crate::RequestBuilder for GetAspectType {
3541 fn request_options(&mut self) -> &mut crate::RequestOptions {
3542 &mut self.0.options
3543 }
3544 }
3545
3546 #[derive(Clone, Debug)]
3564 pub struct CreateEntryGroup(RequestBuilder<crate::model::CreateEntryGroupRequest>);
3565
3566 impl CreateEntryGroup {
3567 pub(crate) fn new(
3568 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3569 ) -> Self {
3570 Self(RequestBuilder::new(stub))
3571 }
3572
3573 pub fn with_request<V: Into<crate::model::CreateEntryGroupRequest>>(
3575 mut self,
3576 v: V,
3577 ) -> Self {
3578 self.0.request = v.into();
3579 self
3580 }
3581
3582 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3584 self.0.options = v.into();
3585 self
3586 }
3587
3588 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3595 (*self.0.stub)
3596 .create_entry_group(self.0.request, self.0.options)
3597 .await
3598 .map(crate::Response::into_body)
3599 }
3600
3601 pub fn poller(
3603 self,
3604 ) -> impl google_cloud_lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata>
3605 {
3606 type Operation = google_cloud_lro::internal::Operation<
3607 crate::model::EntryGroup,
3608 crate::model::OperationMetadata,
3609 >;
3610 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3611 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3612
3613 let stub = self.0.stub.clone();
3614 let mut options = self.0.options.clone();
3615 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3616 let query = move |name| {
3617 let stub = stub.clone();
3618 let options = options.clone();
3619 async {
3620 let op = GetOperation::new(stub)
3621 .set_name(name)
3622 .with_options(options)
3623 .send()
3624 .await?;
3625 Ok(Operation::new(op))
3626 }
3627 };
3628
3629 let start = move || async {
3630 let op = self.send().await?;
3631 Ok(Operation::new(op))
3632 };
3633
3634 google_cloud_lro::internal::new_poller(
3635 polling_error_policy,
3636 polling_backoff_policy,
3637 start,
3638 query,
3639 )
3640 }
3641
3642 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3646 self.0.request.parent = v.into();
3647 self
3648 }
3649
3650 pub fn set_entry_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3654 self.0.request.entry_group_id = v.into();
3655 self
3656 }
3657
3658 pub fn set_entry_group<T>(mut self, v: T) -> Self
3662 where
3663 T: std::convert::Into<crate::model::EntryGroup>,
3664 {
3665 self.0.request.entry_group = std::option::Option::Some(v.into());
3666 self
3667 }
3668
3669 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
3673 where
3674 T: std::convert::Into<crate::model::EntryGroup>,
3675 {
3676 self.0.request.entry_group = v.map(|x| x.into());
3677 self
3678 }
3679
3680 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3682 self.0.request.validate_only = v.into();
3683 self
3684 }
3685 }
3686
3687 #[doc(hidden)]
3688 impl crate::RequestBuilder for CreateEntryGroup {
3689 fn request_options(&mut self) -> &mut crate::RequestOptions {
3690 &mut self.0.options
3691 }
3692 }
3693
3694 #[derive(Clone, Debug)]
3712 pub struct UpdateEntryGroup(RequestBuilder<crate::model::UpdateEntryGroupRequest>);
3713
3714 impl UpdateEntryGroup {
3715 pub(crate) fn new(
3716 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3717 ) -> Self {
3718 Self(RequestBuilder::new(stub))
3719 }
3720
3721 pub fn with_request<V: Into<crate::model::UpdateEntryGroupRequest>>(
3723 mut self,
3724 v: V,
3725 ) -> Self {
3726 self.0.request = v.into();
3727 self
3728 }
3729
3730 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3732 self.0.options = v.into();
3733 self
3734 }
3735
3736 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3743 (*self.0.stub)
3744 .update_entry_group(self.0.request, self.0.options)
3745 .await
3746 .map(crate::Response::into_body)
3747 }
3748
3749 pub fn poller(
3751 self,
3752 ) -> impl google_cloud_lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata>
3753 {
3754 type Operation = google_cloud_lro::internal::Operation<
3755 crate::model::EntryGroup,
3756 crate::model::OperationMetadata,
3757 >;
3758 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3759 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3760
3761 let stub = self.0.stub.clone();
3762 let mut options = self.0.options.clone();
3763 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3764 let query = move |name| {
3765 let stub = stub.clone();
3766 let options = options.clone();
3767 async {
3768 let op = GetOperation::new(stub)
3769 .set_name(name)
3770 .with_options(options)
3771 .send()
3772 .await?;
3773 Ok(Operation::new(op))
3774 }
3775 };
3776
3777 let start = move || async {
3778 let op = self.send().await?;
3779 Ok(Operation::new(op))
3780 };
3781
3782 google_cloud_lro::internal::new_poller(
3783 polling_error_policy,
3784 polling_backoff_policy,
3785 start,
3786 query,
3787 )
3788 }
3789
3790 pub fn set_entry_group<T>(mut self, v: T) -> Self
3794 where
3795 T: std::convert::Into<crate::model::EntryGroup>,
3796 {
3797 self.0.request.entry_group = std::option::Option::Some(v.into());
3798 self
3799 }
3800
3801 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
3805 where
3806 T: std::convert::Into<crate::model::EntryGroup>,
3807 {
3808 self.0.request.entry_group = v.map(|x| x.into());
3809 self
3810 }
3811
3812 pub fn set_update_mask<T>(mut self, v: T) -> Self
3816 where
3817 T: std::convert::Into<wkt::FieldMask>,
3818 {
3819 self.0.request.update_mask = std::option::Option::Some(v.into());
3820 self
3821 }
3822
3823 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3827 where
3828 T: std::convert::Into<wkt::FieldMask>,
3829 {
3830 self.0.request.update_mask = v.map(|x| x.into());
3831 self
3832 }
3833
3834 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3836 self.0.request.validate_only = v.into();
3837 self
3838 }
3839 }
3840
3841 #[doc(hidden)]
3842 impl crate::RequestBuilder for UpdateEntryGroup {
3843 fn request_options(&mut self) -> &mut crate::RequestOptions {
3844 &mut self.0.options
3845 }
3846 }
3847
3848 #[derive(Clone, Debug)]
3866 pub struct DeleteEntryGroup(RequestBuilder<crate::model::DeleteEntryGroupRequest>);
3867
3868 impl DeleteEntryGroup {
3869 pub(crate) fn new(
3870 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3871 ) -> Self {
3872 Self(RequestBuilder::new(stub))
3873 }
3874
3875 pub fn with_request<V: Into<crate::model::DeleteEntryGroupRequest>>(
3877 mut self,
3878 v: V,
3879 ) -> Self {
3880 self.0.request = v.into();
3881 self
3882 }
3883
3884 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3886 self.0.options = v.into();
3887 self
3888 }
3889
3890 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3897 (*self.0.stub)
3898 .delete_entry_group(self.0.request, self.0.options)
3899 .await
3900 .map(crate::Response::into_body)
3901 }
3902
3903 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3905 type Operation =
3906 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3907 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3908 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3909
3910 let stub = self.0.stub.clone();
3911 let mut options = self.0.options.clone();
3912 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3913 let query = move |name| {
3914 let stub = stub.clone();
3915 let options = options.clone();
3916 async {
3917 let op = GetOperation::new(stub)
3918 .set_name(name)
3919 .with_options(options)
3920 .send()
3921 .await?;
3922 Ok(Operation::new(op))
3923 }
3924 };
3925
3926 let start = move || async {
3927 let op = self.send().await?;
3928 Ok(Operation::new(op))
3929 };
3930
3931 google_cloud_lro::internal::new_unit_response_poller(
3932 polling_error_policy,
3933 polling_backoff_policy,
3934 start,
3935 query,
3936 )
3937 }
3938
3939 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3943 self.0.request.name = v.into();
3944 self
3945 }
3946
3947 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3949 self.0.request.etag = v.into();
3950 self
3951 }
3952 }
3953
3954 #[doc(hidden)]
3955 impl crate::RequestBuilder for DeleteEntryGroup {
3956 fn request_options(&mut self) -> &mut crate::RequestOptions {
3957 &mut self.0.options
3958 }
3959 }
3960
3961 #[derive(Clone, Debug)]
3982 pub struct ListEntryGroups(RequestBuilder<crate::model::ListEntryGroupsRequest>);
3983
3984 impl ListEntryGroups {
3985 pub(crate) fn new(
3986 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3987 ) -> Self {
3988 Self(RequestBuilder::new(stub))
3989 }
3990
3991 pub fn with_request<V: Into<crate::model::ListEntryGroupsRequest>>(mut self, v: V) -> Self {
3993 self.0.request = v.into();
3994 self
3995 }
3996
3997 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3999 self.0.options = v.into();
4000 self
4001 }
4002
4003 pub async fn send(self) -> Result<crate::model::ListEntryGroupsResponse> {
4005 (*self.0.stub)
4006 .list_entry_groups(self.0.request, self.0.options)
4007 .await
4008 .map(crate::Response::into_body)
4009 }
4010
4011 pub fn by_page(
4013 self,
4014 ) -> impl google_cloud_gax::paginator::Paginator<
4015 crate::model::ListEntryGroupsResponse,
4016 crate::Error,
4017 > {
4018 use std::clone::Clone;
4019 let token = self.0.request.page_token.clone();
4020 let execute = move |token: String| {
4021 let mut builder = self.clone();
4022 builder.0.request = builder.0.request.set_page_token(token);
4023 builder.send()
4024 };
4025 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4026 }
4027
4028 pub fn by_item(
4030 self,
4031 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4032 crate::model::ListEntryGroupsResponse,
4033 crate::Error,
4034 > {
4035 use google_cloud_gax::paginator::Paginator;
4036 self.by_page().items()
4037 }
4038
4039 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4043 self.0.request.parent = v.into();
4044 self
4045 }
4046
4047 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4049 self.0.request.page_size = v.into();
4050 self
4051 }
4052
4053 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4055 self.0.request.page_token = v.into();
4056 self
4057 }
4058
4059 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4061 self.0.request.filter = v.into();
4062 self
4063 }
4064
4065 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4067 self.0.request.order_by = v.into();
4068 self
4069 }
4070 }
4071
4072 #[doc(hidden)]
4073 impl crate::RequestBuilder for ListEntryGroups {
4074 fn request_options(&mut self) -> &mut crate::RequestOptions {
4075 &mut self.0.options
4076 }
4077 }
4078
4079 #[derive(Clone, Debug)]
4096 pub struct GetEntryGroup(RequestBuilder<crate::model::GetEntryGroupRequest>);
4097
4098 impl GetEntryGroup {
4099 pub(crate) fn new(
4100 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4101 ) -> Self {
4102 Self(RequestBuilder::new(stub))
4103 }
4104
4105 pub fn with_request<V: Into<crate::model::GetEntryGroupRequest>>(mut self, v: V) -> Self {
4107 self.0.request = v.into();
4108 self
4109 }
4110
4111 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4113 self.0.options = v.into();
4114 self
4115 }
4116
4117 pub async fn send(self) -> Result<crate::model::EntryGroup> {
4119 (*self.0.stub)
4120 .get_entry_group(self.0.request, self.0.options)
4121 .await
4122 .map(crate::Response::into_body)
4123 }
4124
4125 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4129 self.0.request.name = v.into();
4130 self
4131 }
4132 }
4133
4134 #[doc(hidden)]
4135 impl crate::RequestBuilder for GetEntryGroup {
4136 fn request_options(&mut self) -> &mut crate::RequestOptions {
4137 &mut self.0.options
4138 }
4139 }
4140
4141 #[derive(Clone, Debug)]
4158 pub struct CreateEntry(RequestBuilder<crate::model::CreateEntryRequest>);
4159
4160 impl CreateEntry {
4161 pub(crate) fn new(
4162 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4163 ) -> Self {
4164 Self(RequestBuilder::new(stub))
4165 }
4166
4167 pub fn with_request<V: Into<crate::model::CreateEntryRequest>>(mut self, v: V) -> Self {
4169 self.0.request = v.into();
4170 self
4171 }
4172
4173 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4175 self.0.options = v.into();
4176 self
4177 }
4178
4179 pub async fn send(self) -> Result<crate::model::Entry> {
4181 (*self.0.stub)
4182 .create_entry(self.0.request, self.0.options)
4183 .await
4184 .map(crate::Response::into_body)
4185 }
4186
4187 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4191 self.0.request.parent = v.into();
4192 self
4193 }
4194
4195 pub fn set_entry_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4199 self.0.request.entry_id = v.into();
4200 self
4201 }
4202
4203 pub fn set_entry<T>(mut self, v: T) -> Self
4207 where
4208 T: std::convert::Into<crate::model::Entry>,
4209 {
4210 self.0.request.entry = std::option::Option::Some(v.into());
4211 self
4212 }
4213
4214 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
4218 where
4219 T: std::convert::Into<crate::model::Entry>,
4220 {
4221 self.0.request.entry = v.map(|x| x.into());
4222 self
4223 }
4224 }
4225
4226 #[doc(hidden)]
4227 impl crate::RequestBuilder for CreateEntry {
4228 fn request_options(&mut self) -> &mut crate::RequestOptions {
4229 &mut self.0.options
4230 }
4231 }
4232
4233 #[derive(Clone, Debug)]
4250 pub struct UpdateEntry(RequestBuilder<crate::model::UpdateEntryRequest>);
4251
4252 impl UpdateEntry {
4253 pub(crate) fn new(
4254 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4255 ) -> Self {
4256 Self(RequestBuilder::new(stub))
4257 }
4258
4259 pub fn with_request<V: Into<crate::model::UpdateEntryRequest>>(mut self, v: V) -> Self {
4261 self.0.request = v.into();
4262 self
4263 }
4264
4265 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4267 self.0.options = v.into();
4268 self
4269 }
4270
4271 pub async fn send(self) -> Result<crate::model::Entry> {
4273 (*self.0.stub)
4274 .update_entry(self.0.request, self.0.options)
4275 .await
4276 .map(crate::Response::into_body)
4277 }
4278
4279 pub fn set_entry<T>(mut self, v: T) -> Self
4283 where
4284 T: std::convert::Into<crate::model::Entry>,
4285 {
4286 self.0.request.entry = std::option::Option::Some(v.into());
4287 self
4288 }
4289
4290 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
4294 where
4295 T: std::convert::Into<crate::model::Entry>,
4296 {
4297 self.0.request.entry = v.map(|x| x.into());
4298 self
4299 }
4300
4301 pub fn set_update_mask<T>(mut self, v: T) -> Self
4303 where
4304 T: std::convert::Into<wkt::FieldMask>,
4305 {
4306 self.0.request.update_mask = std::option::Option::Some(v.into());
4307 self
4308 }
4309
4310 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4312 where
4313 T: std::convert::Into<wkt::FieldMask>,
4314 {
4315 self.0.request.update_mask = v.map(|x| x.into());
4316 self
4317 }
4318
4319 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4321 self.0.request.allow_missing = v.into();
4322 self
4323 }
4324
4325 pub fn set_delete_missing_aspects<T: Into<bool>>(mut self, v: T) -> Self {
4327 self.0.request.delete_missing_aspects = v.into();
4328 self
4329 }
4330
4331 pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
4333 where
4334 T: std::iter::IntoIterator<Item = V>,
4335 V: std::convert::Into<std::string::String>,
4336 {
4337 use std::iter::Iterator;
4338 self.0.request.aspect_keys = v.into_iter().map(|i| i.into()).collect();
4339 self
4340 }
4341 }
4342
4343 #[doc(hidden)]
4344 impl crate::RequestBuilder for UpdateEntry {
4345 fn request_options(&mut self) -> &mut crate::RequestOptions {
4346 &mut self.0.options
4347 }
4348 }
4349
4350 #[derive(Clone, Debug)]
4367 pub struct DeleteEntry(RequestBuilder<crate::model::DeleteEntryRequest>);
4368
4369 impl DeleteEntry {
4370 pub(crate) fn new(
4371 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4372 ) -> Self {
4373 Self(RequestBuilder::new(stub))
4374 }
4375
4376 pub fn with_request<V: Into<crate::model::DeleteEntryRequest>>(mut self, v: V) -> Self {
4378 self.0.request = v.into();
4379 self
4380 }
4381
4382 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4384 self.0.options = v.into();
4385 self
4386 }
4387
4388 pub async fn send(self) -> Result<crate::model::Entry> {
4390 (*self.0.stub)
4391 .delete_entry(self.0.request, self.0.options)
4392 .await
4393 .map(crate::Response::into_body)
4394 }
4395
4396 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4400 self.0.request.name = v.into();
4401 self
4402 }
4403 }
4404
4405 #[doc(hidden)]
4406 impl crate::RequestBuilder for DeleteEntry {
4407 fn request_options(&mut self) -> &mut crate::RequestOptions {
4408 &mut self.0.options
4409 }
4410 }
4411
4412 #[derive(Clone, Debug)]
4433 pub struct ListEntries(RequestBuilder<crate::model::ListEntriesRequest>);
4434
4435 impl ListEntries {
4436 pub(crate) fn new(
4437 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4438 ) -> Self {
4439 Self(RequestBuilder::new(stub))
4440 }
4441
4442 pub fn with_request<V: Into<crate::model::ListEntriesRequest>>(mut self, v: V) -> Self {
4444 self.0.request = v.into();
4445 self
4446 }
4447
4448 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4450 self.0.options = v.into();
4451 self
4452 }
4453
4454 pub async fn send(self) -> Result<crate::model::ListEntriesResponse> {
4456 (*self.0.stub)
4457 .list_entries(self.0.request, self.0.options)
4458 .await
4459 .map(crate::Response::into_body)
4460 }
4461
4462 pub fn by_page(
4464 self,
4465 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListEntriesResponse, crate::Error>
4466 {
4467 use std::clone::Clone;
4468 let token = self.0.request.page_token.clone();
4469 let execute = move |token: String| {
4470 let mut builder = self.clone();
4471 builder.0.request = builder.0.request.set_page_token(token);
4472 builder.send()
4473 };
4474 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4475 }
4476
4477 pub fn by_item(
4479 self,
4480 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4481 crate::model::ListEntriesResponse,
4482 crate::Error,
4483 > {
4484 use google_cloud_gax::paginator::Paginator;
4485 self.by_page().items()
4486 }
4487
4488 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4492 self.0.request.parent = v.into();
4493 self
4494 }
4495
4496 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4498 self.0.request.page_size = v.into();
4499 self
4500 }
4501
4502 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4504 self.0.request.page_token = v.into();
4505 self
4506 }
4507
4508 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4510 self.0.request.filter = v.into();
4511 self
4512 }
4513 }
4514
4515 #[doc(hidden)]
4516 impl crate::RequestBuilder for ListEntries {
4517 fn request_options(&mut self) -> &mut crate::RequestOptions {
4518 &mut self.0.options
4519 }
4520 }
4521
4522 #[derive(Clone, Debug)]
4539 pub struct GetEntry(RequestBuilder<crate::model::GetEntryRequest>);
4540
4541 impl GetEntry {
4542 pub(crate) fn new(
4543 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4544 ) -> Self {
4545 Self(RequestBuilder::new(stub))
4546 }
4547
4548 pub fn with_request<V: Into<crate::model::GetEntryRequest>>(mut self, v: V) -> Self {
4550 self.0.request = v.into();
4551 self
4552 }
4553
4554 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4556 self.0.options = v.into();
4557 self
4558 }
4559
4560 pub async fn send(self) -> Result<crate::model::Entry> {
4562 (*self.0.stub)
4563 .get_entry(self.0.request, self.0.options)
4564 .await
4565 .map(crate::Response::into_body)
4566 }
4567
4568 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4572 self.0.request.name = v.into();
4573 self
4574 }
4575
4576 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
4578 self.0.request.view = v.into();
4579 self
4580 }
4581
4582 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
4584 where
4585 T: std::iter::IntoIterator<Item = V>,
4586 V: std::convert::Into<std::string::String>,
4587 {
4588 use std::iter::Iterator;
4589 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
4590 self
4591 }
4592
4593 pub fn set_paths<T, V>(mut self, v: T) -> Self
4595 where
4596 T: std::iter::IntoIterator<Item = V>,
4597 V: std::convert::Into<std::string::String>,
4598 {
4599 use std::iter::Iterator;
4600 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
4601 self
4602 }
4603 }
4604
4605 #[doc(hidden)]
4606 impl crate::RequestBuilder for GetEntry {
4607 fn request_options(&mut self) -> &mut crate::RequestOptions {
4608 &mut self.0.options
4609 }
4610 }
4611
4612 #[derive(Clone, Debug)]
4629 pub struct LookupEntry(RequestBuilder<crate::model::LookupEntryRequest>);
4630
4631 impl LookupEntry {
4632 pub(crate) fn new(
4633 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4634 ) -> Self {
4635 Self(RequestBuilder::new(stub))
4636 }
4637
4638 pub fn with_request<V: Into<crate::model::LookupEntryRequest>>(mut self, v: V) -> Self {
4640 self.0.request = v.into();
4641 self
4642 }
4643
4644 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4646 self.0.options = v.into();
4647 self
4648 }
4649
4650 pub async fn send(self) -> Result<crate::model::Entry> {
4652 (*self.0.stub)
4653 .lookup_entry(self.0.request, self.0.options)
4654 .await
4655 .map(crate::Response::into_body)
4656 }
4657
4658 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4662 self.0.request.name = v.into();
4663 self
4664 }
4665
4666 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
4668 self.0.request.view = v.into();
4669 self
4670 }
4671
4672 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
4674 where
4675 T: std::iter::IntoIterator<Item = V>,
4676 V: std::convert::Into<std::string::String>,
4677 {
4678 use std::iter::Iterator;
4679 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
4680 self
4681 }
4682
4683 pub fn set_paths<T, V>(mut self, v: T) -> Self
4685 where
4686 T: std::iter::IntoIterator<Item = V>,
4687 V: std::convert::Into<std::string::String>,
4688 {
4689 use std::iter::Iterator;
4690 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
4691 self
4692 }
4693
4694 pub fn set_entry<T: Into<std::string::String>>(mut self, v: T) -> Self {
4698 self.0.request.entry = v.into();
4699 self
4700 }
4701 }
4702
4703 #[doc(hidden)]
4704 impl crate::RequestBuilder for LookupEntry {
4705 fn request_options(&mut self) -> &mut crate::RequestOptions {
4706 &mut self.0.options
4707 }
4708 }
4709
4710 #[derive(Clone, Debug)]
4731 pub struct SearchEntries(RequestBuilder<crate::model::SearchEntriesRequest>);
4732
4733 impl SearchEntries {
4734 pub(crate) fn new(
4735 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4736 ) -> Self {
4737 Self(RequestBuilder::new(stub))
4738 }
4739
4740 pub fn with_request<V: Into<crate::model::SearchEntriesRequest>>(mut self, v: V) -> Self {
4742 self.0.request = v.into();
4743 self
4744 }
4745
4746 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4748 self.0.options = v.into();
4749 self
4750 }
4751
4752 pub async fn send(self) -> Result<crate::model::SearchEntriesResponse> {
4754 (*self.0.stub)
4755 .search_entries(self.0.request, self.0.options)
4756 .await
4757 .map(crate::Response::into_body)
4758 }
4759
4760 pub fn by_page(
4762 self,
4763 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchEntriesResponse, crate::Error>
4764 {
4765 use std::clone::Clone;
4766 let token = self.0.request.page_token.clone();
4767 let execute = move |token: String| {
4768 let mut builder = self.clone();
4769 builder.0.request = builder.0.request.set_page_token(token);
4770 builder.send()
4771 };
4772 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4773 }
4774
4775 pub fn by_item(
4777 self,
4778 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4779 crate::model::SearchEntriesResponse,
4780 crate::Error,
4781 > {
4782 use google_cloud_gax::paginator::Paginator;
4783 self.by_page().items()
4784 }
4785
4786 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4790 self.0.request.name = v.into();
4791 self
4792 }
4793
4794 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
4798 self.0.request.query = v.into();
4799 self
4800 }
4801
4802 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4804 self.0.request.page_size = v.into();
4805 self
4806 }
4807
4808 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4810 self.0.request.page_token = v.into();
4811 self
4812 }
4813
4814 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4816 self.0.request.order_by = v.into();
4817 self
4818 }
4819
4820 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
4822 self.0.request.scope = v.into();
4823 self
4824 }
4825
4826 pub fn set_semantic_search<T: Into<bool>>(mut self, v: T) -> Self {
4828 self.0.request.semantic_search = v.into();
4829 self
4830 }
4831 }
4832
4833 #[doc(hidden)]
4834 impl crate::RequestBuilder for SearchEntries {
4835 fn request_options(&mut self) -> &mut crate::RequestOptions {
4836 &mut self.0.options
4837 }
4838 }
4839
4840 #[derive(Clone, Debug)]
4858 pub struct CreateMetadataJob(RequestBuilder<crate::model::CreateMetadataJobRequest>);
4859
4860 impl CreateMetadataJob {
4861 pub(crate) fn new(
4862 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4863 ) -> Self {
4864 Self(RequestBuilder::new(stub))
4865 }
4866
4867 pub fn with_request<V: Into<crate::model::CreateMetadataJobRequest>>(
4869 mut self,
4870 v: V,
4871 ) -> Self {
4872 self.0.request = v.into();
4873 self
4874 }
4875
4876 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4878 self.0.options = v.into();
4879 self
4880 }
4881
4882 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4889 (*self.0.stub)
4890 .create_metadata_job(self.0.request, self.0.options)
4891 .await
4892 .map(crate::Response::into_body)
4893 }
4894
4895 pub fn poller(
4897 self,
4898 ) -> impl google_cloud_lro::Poller<crate::model::MetadataJob, crate::model::OperationMetadata>
4899 {
4900 type Operation = google_cloud_lro::internal::Operation<
4901 crate::model::MetadataJob,
4902 crate::model::OperationMetadata,
4903 >;
4904 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4905 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4906
4907 let stub = self.0.stub.clone();
4908 let mut options = self.0.options.clone();
4909 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4910 let query = move |name| {
4911 let stub = stub.clone();
4912 let options = options.clone();
4913 async {
4914 let op = GetOperation::new(stub)
4915 .set_name(name)
4916 .with_options(options)
4917 .send()
4918 .await?;
4919 Ok(Operation::new(op))
4920 }
4921 };
4922
4923 let start = move || async {
4924 let op = self.send().await?;
4925 Ok(Operation::new(op))
4926 };
4927
4928 google_cloud_lro::internal::new_poller(
4929 polling_error_policy,
4930 polling_backoff_policy,
4931 start,
4932 query,
4933 )
4934 }
4935
4936 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4940 self.0.request.parent = v.into();
4941 self
4942 }
4943
4944 pub fn set_metadata_job<T>(mut self, v: T) -> Self
4948 where
4949 T: std::convert::Into<crate::model::MetadataJob>,
4950 {
4951 self.0.request.metadata_job = std::option::Option::Some(v.into());
4952 self
4953 }
4954
4955 pub fn set_or_clear_metadata_job<T>(mut self, v: std::option::Option<T>) -> Self
4959 where
4960 T: std::convert::Into<crate::model::MetadataJob>,
4961 {
4962 self.0.request.metadata_job = v.map(|x| x.into());
4963 self
4964 }
4965
4966 pub fn set_metadata_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4968 self.0.request.metadata_job_id = v.into();
4969 self
4970 }
4971
4972 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4974 self.0.request.validate_only = v.into();
4975 self
4976 }
4977 }
4978
4979 #[doc(hidden)]
4980 impl crate::RequestBuilder for CreateMetadataJob {
4981 fn request_options(&mut self) -> &mut crate::RequestOptions {
4982 &mut self.0.options
4983 }
4984 }
4985
4986 #[derive(Clone, Debug)]
5003 pub struct GetMetadataJob(RequestBuilder<crate::model::GetMetadataJobRequest>);
5004
5005 impl GetMetadataJob {
5006 pub(crate) fn new(
5007 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5008 ) -> Self {
5009 Self(RequestBuilder::new(stub))
5010 }
5011
5012 pub fn with_request<V: Into<crate::model::GetMetadataJobRequest>>(mut self, v: V) -> Self {
5014 self.0.request = v.into();
5015 self
5016 }
5017
5018 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5020 self.0.options = v.into();
5021 self
5022 }
5023
5024 pub async fn send(self) -> Result<crate::model::MetadataJob> {
5026 (*self.0.stub)
5027 .get_metadata_job(self.0.request, self.0.options)
5028 .await
5029 .map(crate::Response::into_body)
5030 }
5031
5032 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5036 self.0.request.name = v.into();
5037 self
5038 }
5039 }
5040
5041 #[doc(hidden)]
5042 impl crate::RequestBuilder for GetMetadataJob {
5043 fn request_options(&mut self) -> &mut crate::RequestOptions {
5044 &mut self.0.options
5045 }
5046 }
5047
5048 #[derive(Clone, Debug)]
5069 pub struct ListMetadataJobs(RequestBuilder<crate::model::ListMetadataJobsRequest>);
5070
5071 impl ListMetadataJobs {
5072 pub(crate) fn new(
5073 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5074 ) -> Self {
5075 Self(RequestBuilder::new(stub))
5076 }
5077
5078 pub fn with_request<V: Into<crate::model::ListMetadataJobsRequest>>(
5080 mut self,
5081 v: V,
5082 ) -> Self {
5083 self.0.request = v.into();
5084 self
5085 }
5086
5087 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5089 self.0.options = v.into();
5090 self
5091 }
5092
5093 pub async fn send(self) -> Result<crate::model::ListMetadataJobsResponse> {
5095 (*self.0.stub)
5096 .list_metadata_jobs(self.0.request, self.0.options)
5097 .await
5098 .map(crate::Response::into_body)
5099 }
5100
5101 pub fn by_page(
5103 self,
5104 ) -> impl google_cloud_gax::paginator::Paginator<
5105 crate::model::ListMetadataJobsResponse,
5106 crate::Error,
5107 > {
5108 use std::clone::Clone;
5109 let token = self.0.request.page_token.clone();
5110 let execute = move |token: String| {
5111 let mut builder = self.clone();
5112 builder.0.request = builder.0.request.set_page_token(token);
5113 builder.send()
5114 };
5115 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5116 }
5117
5118 pub fn by_item(
5120 self,
5121 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5122 crate::model::ListMetadataJobsResponse,
5123 crate::Error,
5124 > {
5125 use google_cloud_gax::paginator::Paginator;
5126 self.by_page().items()
5127 }
5128
5129 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5133 self.0.request.parent = v.into();
5134 self
5135 }
5136
5137 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5139 self.0.request.page_size = v.into();
5140 self
5141 }
5142
5143 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5145 self.0.request.page_token = v.into();
5146 self
5147 }
5148
5149 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5151 self.0.request.filter = v.into();
5152 self
5153 }
5154
5155 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5157 self.0.request.order_by = v.into();
5158 self
5159 }
5160 }
5161
5162 #[doc(hidden)]
5163 impl crate::RequestBuilder for ListMetadataJobs {
5164 fn request_options(&mut self) -> &mut crate::RequestOptions {
5165 &mut self.0.options
5166 }
5167 }
5168
5169 #[derive(Clone, Debug)]
5186 pub struct CancelMetadataJob(RequestBuilder<crate::model::CancelMetadataJobRequest>);
5187
5188 impl CancelMetadataJob {
5189 pub(crate) fn new(
5190 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5191 ) -> Self {
5192 Self(RequestBuilder::new(stub))
5193 }
5194
5195 pub fn with_request<V: Into<crate::model::CancelMetadataJobRequest>>(
5197 mut self,
5198 v: V,
5199 ) -> Self {
5200 self.0.request = v.into();
5201 self
5202 }
5203
5204 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5206 self.0.options = v.into();
5207 self
5208 }
5209
5210 pub async fn send(self) -> Result<()> {
5212 (*self.0.stub)
5213 .cancel_metadata_job(self.0.request, self.0.options)
5214 .await
5215 .map(crate::Response::into_body)
5216 }
5217
5218 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5222 self.0.request.name = v.into();
5223 self
5224 }
5225 }
5226
5227 #[doc(hidden)]
5228 impl crate::RequestBuilder for CancelMetadataJob {
5229 fn request_options(&mut self) -> &mut crate::RequestOptions {
5230 &mut self.0.options
5231 }
5232 }
5233
5234 #[derive(Clone, Debug)]
5251 pub struct CreateEntryLink(RequestBuilder<crate::model::CreateEntryLinkRequest>);
5252
5253 impl CreateEntryLink {
5254 pub(crate) fn new(
5255 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5256 ) -> Self {
5257 Self(RequestBuilder::new(stub))
5258 }
5259
5260 pub fn with_request<V: Into<crate::model::CreateEntryLinkRequest>>(mut self, v: V) -> Self {
5262 self.0.request = v.into();
5263 self
5264 }
5265
5266 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5268 self.0.options = v.into();
5269 self
5270 }
5271
5272 pub async fn send(self) -> Result<crate::model::EntryLink> {
5274 (*self.0.stub)
5275 .create_entry_link(self.0.request, self.0.options)
5276 .await
5277 .map(crate::Response::into_body)
5278 }
5279
5280 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5284 self.0.request.parent = v.into();
5285 self
5286 }
5287
5288 pub fn set_entry_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5292 self.0.request.entry_link_id = v.into();
5293 self
5294 }
5295
5296 pub fn set_entry_link<T>(mut self, v: T) -> Self
5300 where
5301 T: std::convert::Into<crate::model::EntryLink>,
5302 {
5303 self.0.request.entry_link = std::option::Option::Some(v.into());
5304 self
5305 }
5306
5307 pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
5311 where
5312 T: std::convert::Into<crate::model::EntryLink>,
5313 {
5314 self.0.request.entry_link = v.map(|x| x.into());
5315 self
5316 }
5317 }
5318
5319 #[doc(hidden)]
5320 impl crate::RequestBuilder for CreateEntryLink {
5321 fn request_options(&mut self) -> &mut crate::RequestOptions {
5322 &mut self.0.options
5323 }
5324 }
5325
5326 #[derive(Clone, Debug)]
5343 pub struct DeleteEntryLink(RequestBuilder<crate::model::DeleteEntryLinkRequest>);
5344
5345 impl DeleteEntryLink {
5346 pub(crate) fn new(
5347 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5348 ) -> Self {
5349 Self(RequestBuilder::new(stub))
5350 }
5351
5352 pub fn with_request<V: Into<crate::model::DeleteEntryLinkRequest>>(mut self, v: V) -> Self {
5354 self.0.request = v.into();
5355 self
5356 }
5357
5358 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5360 self.0.options = v.into();
5361 self
5362 }
5363
5364 pub async fn send(self) -> Result<crate::model::EntryLink> {
5366 (*self.0.stub)
5367 .delete_entry_link(self.0.request, self.0.options)
5368 .await
5369 .map(crate::Response::into_body)
5370 }
5371
5372 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5376 self.0.request.name = v.into();
5377 self
5378 }
5379 }
5380
5381 #[doc(hidden)]
5382 impl crate::RequestBuilder for DeleteEntryLink {
5383 fn request_options(&mut self) -> &mut crate::RequestOptions {
5384 &mut self.0.options
5385 }
5386 }
5387
5388 #[derive(Clone, Debug)]
5405 pub struct GetEntryLink(RequestBuilder<crate::model::GetEntryLinkRequest>);
5406
5407 impl GetEntryLink {
5408 pub(crate) fn new(
5409 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5410 ) -> Self {
5411 Self(RequestBuilder::new(stub))
5412 }
5413
5414 pub fn with_request<V: Into<crate::model::GetEntryLinkRequest>>(mut self, v: V) -> Self {
5416 self.0.request = v.into();
5417 self
5418 }
5419
5420 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5422 self.0.options = v.into();
5423 self
5424 }
5425
5426 pub async fn send(self) -> Result<crate::model::EntryLink> {
5428 (*self.0.stub)
5429 .get_entry_link(self.0.request, self.0.options)
5430 .await
5431 .map(crate::Response::into_body)
5432 }
5433
5434 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5438 self.0.request.name = v.into();
5439 self
5440 }
5441 }
5442
5443 #[doc(hidden)]
5444 impl crate::RequestBuilder for GetEntryLink {
5445 fn request_options(&mut self) -> &mut crate::RequestOptions {
5446 &mut self.0.options
5447 }
5448 }
5449
5450 #[derive(Clone, Debug)]
5471 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5472
5473 impl ListLocations {
5474 pub(crate) fn new(
5475 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5476 ) -> Self {
5477 Self(RequestBuilder::new(stub))
5478 }
5479
5480 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5482 mut self,
5483 v: V,
5484 ) -> Self {
5485 self.0.request = v.into();
5486 self
5487 }
5488
5489 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5491 self.0.options = v.into();
5492 self
5493 }
5494
5495 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5497 (*self.0.stub)
5498 .list_locations(self.0.request, self.0.options)
5499 .await
5500 .map(crate::Response::into_body)
5501 }
5502
5503 pub fn by_page(
5505 self,
5506 ) -> impl google_cloud_gax::paginator::Paginator<
5507 google_cloud_location::model::ListLocationsResponse,
5508 crate::Error,
5509 > {
5510 use std::clone::Clone;
5511 let token = self.0.request.page_token.clone();
5512 let execute = move |token: String| {
5513 let mut builder = self.clone();
5514 builder.0.request = builder.0.request.set_page_token(token);
5515 builder.send()
5516 };
5517 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5518 }
5519
5520 pub fn by_item(
5522 self,
5523 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5524 google_cloud_location::model::ListLocationsResponse,
5525 crate::Error,
5526 > {
5527 use google_cloud_gax::paginator::Paginator;
5528 self.by_page().items()
5529 }
5530
5531 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5533 self.0.request.name = v.into();
5534 self
5535 }
5536
5537 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5539 self.0.request.filter = v.into();
5540 self
5541 }
5542
5543 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5545 self.0.request.page_size = v.into();
5546 self
5547 }
5548
5549 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5551 self.0.request.page_token = v.into();
5552 self
5553 }
5554 }
5555
5556 #[doc(hidden)]
5557 impl crate::RequestBuilder for ListLocations {
5558 fn request_options(&mut self) -> &mut crate::RequestOptions {
5559 &mut self.0.options
5560 }
5561 }
5562
5563 #[derive(Clone, Debug)]
5580 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5581
5582 impl GetLocation {
5583 pub(crate) fn new(
5584 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5585 ) -> Self {
5586 Self(RequestBuilder::new(stub))
5587 }
5588
5589 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5591 mut self,
5592 v: V,
5593 ) -> Self {
5594 self.0.request = v.into();
5595 self
5596 }
5597
5598 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5600 self.0.options = v.into();
5601 self
5602 }
5603
5604 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5606 (*self.0.stub)
5607 .get_location(self.0.request, self.0.options)
5608 .await
5609 .map(crate::Response::into_body)
5610 }
5611
5612 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5614 self.0.request.name = v.into();
5615 self
5616 }
5617 }
5618
5619 #[doc(hidden)]
5620 impl crate::RequestBuilder for GetLocation {
5621 fn request_options(&mut self) -> &mut crate::RequestOptions {
5622 &mut self.0.options
5623 }
5624 }
5625
5626 #[derive(Clone, Debug)]
5643 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
5644
5645 impl SetIamPolicy {
5646 pub(crate) fn new(
5647 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5648 ) -> Self {
5649 Self(RequestBuilder::new(stub))
5650 }
5651
5652 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
5654 mut self,
5655 v: V,
5656 ) -> Self {
5657 self.0.request = v.into();
5658 self
5659 }
5660
5661 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5663 self.0.options = v.into();
5664 self
5665 }
5666
5667 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5669 (*self.0.stub)
5670 .set_iam_policy(self.0.request, self.0.options)
5671 .await
5672 .map(crate::Response::into_body)
5673 }
5674
5675 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5679 self.0.request.resource = v.into();
5680 self
5681 }
5682
5683 pub fn set_policy<T>(mut self, v: T) -> Self
5687 where
5688 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5689 {
5690 self.0.request.policy = std::option::Option::Some(v.into());
5691 self
5692 }
5693
5694 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5698 where
5699 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5700 {
5701 self.0.request.policy = v.map(|x| x.into());
5702 self
5703 }
5704
5705 pub fn set_update_mask<T>(mut self, v: T) -> Self
5707 where
5708 T: std::convert::Into<wkt::FieldMask>,
5709 {
5710 self.0.request.update_mask = std::option::Option::Some(v.into());
5711 self
5712 }
5713
5714 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5716 where
5717 T: std::convert::Into<wkt::FieldMask>,
5718 {
5719 self.0.request.update_mask = v.map(|x| x.into());
5720 self
5721 }
5722 }
5723
5724 #[doc(hidden)]
5725 impl crate::RequestBuilder for SetIamPolicy {
5726 fn request_options(&mut self) -> &mut crate::RequestOptions {
5727 &mut self.0.options
5728 }
5729 }
5730
5731 #[derive(Clone, Debug)]
5748 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
5749
5750 impl GetIamPolicy {
5751 pub(crate) fn new(
5752 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5753 ) -> Self {
5754 Self(RequestBuilder::new(stub))
5755 }
5756
5757 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
5759 mut self,
5760 v: V,
5761 ) -> Self {
5762 self.0.request = v.into();
5763 self
5764 }
5765
5766 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5768 self.0.options = v.into();
5769 self
5770 }
5771
5772 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5774 (*self.0.stub)
5775 .get_iam_policy(self.0.request, self.0.options)
5776 .await
5777 .map(crate::Response::into_body)
5778 }
5779
5780 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5784 self.0.request.resource = v.into();
5785 self
5786 }
5787
5788 pub fn set_options<T>(mut self, v: T) -> Self
5790 where
5791 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5792 {
5793 self.0.request.options = std::option::Option::Some(v.into());
5794 self
5795 }
5796
5797 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5799 where
5800 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5801 {
5802 self.0.request.options = v.map(|x| x.into());
5803 self
5804 }
5805 }
5806
5807 #[doc(hidden)]
5808 impl crate::RequestBuilder for GetIamPolicy {
5809 fn request_options(&mut self) -> &mut crate::RequestOptions {
5810 &mut self.0.options
5811 }
5812 }
5813
5814 #[derive(Clone, Debug)]
5831 pub struct TestIamPermissions(
5832 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
5833 );
5834
5835 impl TestIamPermissions {
5836 pub(crate) fn new(
5837 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5838 ) -> Self {
5839 Self(RequestBuilder::new(stub))
5840 }
5841
5842 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
5844 mut self,
5845 v: V,
5846 ) -> Self {
5847 self.0.request = v.into();
5848 self
5849 }
5850
5851 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5853 self.0.options = v.into();
5854 self
5855 }
5856
5857 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
5859 (*self.0.stub)
5860 .test_iam_permissions(self.0.request, self.0.options)
5861 .await
5862 .map(crate::Response::into_body)
5863 }
5864
5865 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5869 self.0.request.resource = v.into();
5870 self
5871 }
5872
5873 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5877 where
5878 T: std::iter::IntoIterator<Item = V>,
5879 V: std::convert::Into<std::string::String>,
5880 {
5881 use std::iter::Iterator;
5882 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5883 self
5884 }
5885 }
5886
5887 #[doc(hidden)]
5888 impl crate::RequestBuilder for TestIamPermissions {
5889 fn request_options(&mut self) -> &mut crate::RequestOptions {
5890 &mut self.0.options
5891 }
5892 }
5893
5894 #[derive(Clone, Debug)]
5915 pub struct ListOperations(
5916 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5917 );
5918
5919 impl ListOperations {
5920 pub(crate) fn new(
5921 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5922 ) -> Self {
5923 Self(RequestBuilder::new(stub))
5924 }
5925
5926 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5928 mut self,
5929 v: V,
5930 ) -> Self {
5931 self.0.request = v.into();
5932 self
5933 }
5934
5935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5937 self.0.options = v.into();
5938 self
5939 }
5940
5941 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5943 (*self.0.stub)
5944 .list_operations(self.0.request, self.0.options)
5945 .await
5946 .map(crate::Response::into_body)
5947 }
5948
5949 pub fn by_page(
5951 self,
5952 ) -> impl google_cloud_gax::paginator::Paginator<
5953 google_cloud_longrunning::model::ListOperationsResponse,
5954 crate::Error,
5955 > {
5956 use std::clone::Clone;
5957 let token = self.0.request.page_token.clone();
5958 let execute = move |token: String| {
5959 let mut builder = self.clone();
5960 builder.0.request = builder.0.request.set_page_token(token);
5961 builder.send()
5962 };
5963 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5964 }
5965
5966 pub fn by_item(
5968 self,
5969 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5970 google_cloud_longrunning::model::ListOperationsResponse,
5971 crate::Error,
5972 > {
5973 use google_cloud_gax::paginator::Paginator;
5974 self.by_page().items()
5975 }
5976
5977 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5979 self.0.request.name = v.into();
5980 self
5981 }
5982
5983 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5985 self.0.request.filter = v.into();
5986 self
5987 }
5988
5989 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5991 self.0.request.page_size = v.into();
5992 self
5993 }
5994
5995 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5997 self.0.request.page_token = v.into();
5998 self
5999 }
6000
6001 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6003 self.0.request.return_partial_success = v.into();
6004 self
6005 }
6006 }
6007
6008 #[doc(hidden)]
6009 impl crate::RequestBuilder for ListOperations {
6010 fn request_options(&mut self) -> &mut crate::RequestOptions {
6011 &mut self.0.options
6012 }
6013 }
6014
6015 #[derive(Clone, Debug)]
6032 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6033
6034 impl GetOperation {
6035 pub(crate) fn new(
6036 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6037 ) -> Self {
6038 Self(RequestBuilder::new(stub))
6039 }
6040
6041 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6043 mut self,
6044 v: V,
6045 ) -> Self {
6046 self.0.request = v.into();
6047 self
6048 }
6049
6050 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6052 self.0.options = v.into();
6053 self
6054 }
6055
6056 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6058 (*self.0.stub)
6059 .get_operation(self.0.request, self.0.options)
6060 .await
6061 .map(crate::Response::into_body)
6062 }
6063
6064 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6066 self.0.request.name = v.into();
6067 self
6068 }
6069 }
6070
6071 #[doc(hidden)]
6072 impl crate::RequestBuilder for GetOperation {
6073 fn request_options(&mut self) -> &mut crate::RequestOptions {
6074 &mut self.0.options
6075 }
6076 }
6077
6078 #[derive(Clone, Debug)]
6095 pub struct DeleteOperation(
6096 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
6097 );
6098
6099 impl DeleteOperation {
6100 pub(crate) fn new(
6101 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6102 ) -> Self {
6103 Self(RequestBuilder::new(stub))
6104 }
6105
6106 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
6108 mut self,
6109 v: V,
6110 ) -> Self {
6111 self.0.request = v.into();
6112 self
6113 }
6114
6115 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6117 self.0.options = v.into();
6118 self
6119 }
6120
6121 pub async fn send(self) -> Result<()> {
6123 (*self.0.stub)
6124 .delete_operation(self.0.request, self.0.options)
6125 .await
6126 .map(crate::Response::into_body)
6127 }
6128
6129 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6131 self.0.request.name = v.into();
6132 self
6133 }
6134 }
6135
6136 #[doc(hidden)]
6137 impl crate::RequestBuilder for DeleteOperation {
6138 fn request_options(&mut self) -> &mut crate::RequestOptions {
6139 &mut self.0.options
6140 }
6141 }
6142
6143 #[derive(Clone, Debug)]
6160 pub struct CancelOperation(
6161 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6162 );
6163
6164 impl CancelOperation {
6165 pub(crate) fn new(
6166 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6167 ) -> Self {
6168 Self(RequestBuilder::new(stub))
6169 }
6170
6171 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6173 mut self,
6174 v: V,
6175 ) -> Self {
6176 self.0.request = v.into();
6177 self
6178 }
6179
6180 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6182 self.0.options = v.into();
6183 self
6184 }
6185
6186 pub async fn send(self) -> Result<()> {
6188 (*self.0.stub)
6189 .cancel_operation(self.0.request, self.0.options)
6190 .await
6191 .map(crate::Response::into_body)
6192 }
6193
6194 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6196 self.0.request.name = v.into();
6197 self
6198 }
6199 }
6200
6201 #[doc(hidden)]
6202 impl crate::RequestBuilder for CancelOperation {
6203 fn request_options(&mut self) -> &mut crate::RequestOptions {
6204 &mut self.0.options
6205 }
6206 }
6207}
6208
6209pub mod cmek_service {
6210 use crate::Result;
6211
6212 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6226
6227 pub(crate) mod client {
6228 use super::super::super::client::CmekService;
6229 pub struct Factory;
6230 impl crate::ClientFactory for Factory {
6231 type Client = CmekService;
6232 type Credentials = gaxi::options::Credentials;
6233 async fn build(
6234 self,
6235 config: gaxi::options::ClientConfig,
6236 ) -> crate::ClientBuilderResult<Self::Client> {
6237 Self::Client::new(config).await
6238 }
6239 }
6240 }
6241
6242 #[derive(Clone, Debug)]
6244 pub(crate) struct RequestBuilder<R: std::default::Default> {
6245 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6246 request: R,
6247 options: crate::RequestOptions,
6248 }
6249
6250 impl<R> RequestBuilder<R>
6251 where
6252 R: std::default::Default,
6253 {
6254 pub(crate) fn new(
6255 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6256 ) -> Self {
6257 Self {
6258 stub,
6259 request: R::default(),
6260 options: crate::RequestOptions::default(),
6261 }
6262 }
6263 }
6264
6265 #[derive(Clone, Debug)]
6283 pub struct CreateEncryptionConfig(RequestBuilder<crate::model::CreateEncryptionConfigRequest>);
6284
6285 impl CreateEncryptionConfig {
6286 pub(crate) fn new(
6287 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6288 ) -> Self {
6289 Self(RequestBuilder::new(stub))
6290 }
6291
6292 pub fn with_request<V: Into<crate::model::CreateEncryptionConfigRequest>>(
6294 mut self,
6295 v: V,
6296 ) -> Self {
6297 self.0.request = v.into();
6298 self
6299 }
6300
6301 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6303 self.0.options = v.into();
6304 self
6305 }
6306
6307 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6314 (*self.0.stub)
6315 .create_encryption_config(self.0.request, self.0.options)
6316 .await
6317 .map(crate::Response::into_body)
6318 }
6319
6320 pub fn poller(
6322 self,
6323 ) -> impl google_cloud_lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
6324 {
6325 type Operation = google_cloud_lro::internal::Operation<
6326 crate::model::EncryptionConfig,
6327 crate::model::OperationMetadata,
6328 >;
6329 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6330 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6331
6332 let stub = self.0.stub.clone();
6333 let mut options = self.0.options.clone();
6334 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6335 let query = move |name| {
6336 let stub = stub.clone();
6337 let options = options.clone();
6338 async {
6339 let op = GetOperation::new(stub)
6340 .set_name(name)
6341 .with_options(options)
6342 .send()
6343 .await?;
6344 Ok(Operation::new(op))
6345 }
6346 };
6347
6348 let start = move || async {
6349 let op = self.send().await?;
6350 Ok(Operation::new(op))
6351 };
6352
6353 google_cloud_lro::internal::new_poller(
6354 polling_error_policy,
6355 polling_backoff_policy,
6356 start,
6357 query,
6358 )
6359 }
6360
6361 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6365 self.0.request.parent = v.into();
6366 self
6367 }
6368
6369 pub fn set_encryption_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6373 self.0.request.encryption_config_id = v.into();
6374 self
6375 }
6376
6377 pub fn set_encryption_config<T>(mut self, v: T) -> Self
6381 where
6382 T: std::convert::Into<crate::model::EncryptionConfig>,
6383 {
6384 self.0.request.encryption_config = std::option::Option::Some(v.into());
6385 self
6386 }
6387
6388 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
6392 where
6393 T: std::convert::Into<crate::model::EncryptionConfig>,
6394 {
6395 self.0.request.encryption_config = v.map(|x| x.into());
6396 self
6397 }
6398 }
6399
6400 #[doc(hidden)]
6401 impl crate::RequestBuilder for CreateEncryptionConfig {
6402 fn request_options(&mut self) -> &mut crate::RequestOptions {
6403 &mut self.0.options
6404 }
6405 }
6406
6407 #[derive(Clone, Debug)]
6425 pub struct UpdateEncryptionConfig(RequestBuilder<crate::model::UpdateEncryptionConfigRequest>);
6426
6427 impl UpdateEncryptionConfig {
6428 pub(crate) fn new(
6429 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6430 ) -> Self {
6431 Self(RequestBuilder::new(stub))
6432 }
6433
6434 pub fn with_request<V: Into<crate::model::UpdateEncryptionConfigRequest>>(
6436 mut self,
6437 v: V,
6438 ) -> Self {
6439 self.0.request = v.into();
6440 self
6441 }
6442
6443 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6445 self.0.options = v.into();
6446 self
6447 }
6448
6449 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6456 (*self.0.stub)
6457 .update_encryption_config(self.0.request, self.0.options)
6458 .await
6459 .map(crate::Response::into_body)
6460 }
6461
6462 pub fn poller(
6464 self,
6465 ) -> impl google_cloud_lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
6466 {
6467 type Operation = google_cloud_lro::internal::Operation<
6468 crate::model::EncryptionConfig,
6469 crate::model::OperationMetadata,
6470 >;
6471 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6472 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6473
6474 let stub = self.0.stub.clone();
6475 let mut options = self.0.options.clone();
6476 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6477 let query = move |name| {
6478 let stub = stub.clone();
6479 let options = options.clone();
6480 async {
6481 let op = GetOperation::new(stub)
6482 .set_name(name)
6483 .with_options(options)
6484 .send()
6485 .await?;
6486 Ok(Operation::new(op))
6487 }
6488 };
6489
6490 let start = move || async {
6491 let op = self.send().await?;
6492 Ok(Operation::new(op))
6493 };
6494
6495 google_cloud_lro::internal::new_poller(
6496 polling_error_policy,
6497 polling_backoff_policy,
6498 start,
6499 query,
6500 )
6501 }
6502
6503 pub fn set_encryption_config<T>(mut self, v: T) -> Self
6507 where
6508 T: std::convert::Into<crate::model::EncryptionConfig>,
6509 {
6510 self.0.request.encryption_config = std::option::Option::Some(v.into());
6511 self
6512 }
6513
6514 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
6518 where
6519 T: std::convert::Into<crate::model::EncryptionConfig>,
6520 {
6521 self.0.request.encryption_config = v.map(|x| x.into());
6522 self
6523 }
6524
6525 pub fn set_update_mask<T>(mut self, v: T) -> Self
6527 where
6528 T: std::convert::Into<wkt::FieldMask>,
6529 {
6530 self.0.request.update_mask = std::option::Option::Some(v.into());
6531 self
6532 }
6533
6534 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6536 where
6537 T: std::convert::Into<wkt::FieldMask>,
6538 {
6539 self.0.request.update_mask = v.map(|x| x.into());
6540 self
6541 }
6542 }
6543
6544 #[doc(hidden)]
6545 impl crate::RequestBuilder for UpdateEncryptionConfig {
6546 fn request_options(&mut self) -> &mut crate::RequestOptions {
6547 &mut self.0.options
6548 }
6549 }
6550
6551 #[derive(Clone, Debug)]
6569 pub struct DeleteEncryptionConfig(RequestBuilder<crate::model::DeleteEncryptionConfigRequest>);
6570
6571 impl DeleteEncryptionConfig {
6572 pub(crate) fn new(
6573 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6574 ) -> Self {
6575 Self(RequestBuilder::new(stub))
6576 }
6577
6578 pub fn with_request<V: Into<crate::model::DeleteEncryptionConfigRequest>>(
6580 mut self,
6581 v: V,
6582 ) -> Self {
6583 self.0.request = v.into();
6584 self
6585 }
6586
6587 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6589 self.0.options = v.into();
6590 self
6591 }
6592
6593 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6600 (*self.0.stub)
6601 .delete_encryption_config(self.0.request, self.0.options)
6602 .await
6603 .map(crate::Response::into_body)
6604 }
6605
6606 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6608 type Operation =
6609 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6610 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6611 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6612
6613 let stub = self.0.stub.clone();
6614 let mut options = self.0.options.clone();
6615 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6616 let query = move |name| {
6617 let stub = stub.clone();
6618 let options = options.clone();
6619 async {
6620 let op = GetOperation::new(stub)
6621 .set_name(name)
6622 .with_options(options)
6623 .send()
6624 .await?;
6625 Ok(Operation::new(op))
6626 }
6627 };
6628
6629 let start = move || async {
6630 let op = self.send().await?;
6631 Ok(Operation::new(op))
6632 };
6633
6634 google_cloud_lro::internal::new_unit_response_poller(
6635 polling_error_policy,
6636 polling_backoff_policy,
6637 start,
6638 query,
6639 )
6640 }
6641
6642 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6646 self.0.request.name = v.into();
6647 self
6648 }
6649
6650 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
6652 self.0.request.etag = v.into();
6653 self
6654 }
6655 }
6656
6657 #[doc(hidden)]
6658 impl crate::RequestBuilder for DeleteEncryptionConfig {
6659 fn request_options(&mut self) -> &mut crate::RequestOptions {
6660 &mut self.0.options
6661 }
6662 }
6663
6664 #[derive(Clone, Debug)]
6685 pub struct ListEncryptionConfigs(RequestBuilder<crate::model::ListEncryptionConfigsRequest>);
6686
6687 impl ListEncryptionConfigs {
6688 pub(crate) fn new(
6689 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6690 ) -> Self {
6691 Self(RequestBuilder::new(stub))
6692 }
6693
6694 pub fn with_request<V: Into<crate::model::ListEncryptionConfigsRequest>>(
6696 mut self,
6697 v: V,
6698 ) -> Self {
6699 self.0.request = v.into();
6700 self
6701 }
6702
6703 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6705 self.0.options = v.into();
6706 self
6707 }
6708
6709 pub async fn send(self) -> Result<crate::model::ListEncryptionConfigsResponse> {
6711 (*self.0.stub)
6712 .list_encryption_configs(self.0.request, self.0.options)
6713 .await
6714 .map(crate::Response::into_body)
6715 }
6716
6717 pub fn by_page(
6719 self,
6720 ) -> impl google_cloud_gax::paginator::Paginator<
6721 crate::model::ListEncryptionConfigsResponse,
6722 crate::Error,
6723 > {
6724 use std::clone::Clone;
6725 let token = self.0.request.page_token.clone();
6726 let execute = move |token: String| {
6727 let mut builder = self.clone();
6728 builder.0.request = builder.0.request.set_page_token(token);
6729 builder.send()
6730 };
6731 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6732 }
6733
6734 pub fn by_item(
6736 self,
6737 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6738 crate::model::ListEncryptionConfigsResponse,
6739 crate::Error,
6740 > {
6741 use google_cloud_gax::paginator::Paginator;
6742 self.by_page().items()
6743 }
6744
6745 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6749 self.0.request.parent = v.into();
6750 self
6751 }
6752
6753 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6755 self.0.request.page_size = v.into();
6756 self
6757 }
6758
6759 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6761 self.0.request.page_token = v.into();
6762 self
6763 }
6764
6765 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6767 self.0.request.filter = v.into();
6768 self
6769 }
6770
6771 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6773 self.0.request.order_by = v.into();
6774 self
6775 }
6776 }
6777
6778 #[doc(hidden)]
6779 impl crate::RequestBuilder for ListEncryptionConfigs {
6780 fn request_options(&mut self) -> &mut crate::RequestOptions {
6781 &mut self.0.options
6782 }
6783 }
6784
6785 #[derive(Clone, Debug)]
6802 pub struct GetEncryptionConfig(RequestBuilder<crate::model::GetEncryptionConfigRequest>);
6803
6804 impl GetEncryptionConfig {
6805 pub(crate) fn new(
6806 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6807 ) -> Self {
6808 Self(RequestBuilder::new(stub))
6809 }
6810
6811 pub fn with_request<V: Into<crate::model::GetEncryptionConfigRequest>>(
6813 mut self,
6814 v: V,
6815 ) -> Self {
6816 self.0.request = v.into();
6817 self
6818 }
6819
6820 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6822 self.0.options = v.into();
6823 self
6824 }
6825
6826 pub async fn send(self) -> Result<crate::model::EncryptionConfig> {
6828 (*self.0.stub)
6829 .get_encryption_config(self.0.request, self.0.options)
6830 .await
6831 .map(crate::Response::into_body)
6832 }
6833
6834 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6838 self.0.request.name = v.into();
6839 self
6840 }
6841 }
6842
6843 #[doc(hidden)]
6844 impl crate::RequestBuilder for GetEncryptionConfig {
6845 fn request_options(&mut self) -> &mut crate::RequestOptions {
6846 &mut self.0.options
6847 }
6848 }
6849
6850 #[derive(Clone, Debug)]
6871 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6872
6873 impl ListLocations {
6874 pub(crate) fn new(
6875 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6876 ) -> Self {
6877 Self(RequestBuilder::new(stub))
6878 }
6879
6880 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6882 mut self,
6883 v: V,
6884 ) -> Self {
6885 self.0.request = v.into();
6886 self
6887 }
6888
6889 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6891 self.0.options = v.into();
6892 self
6893 }
6894
6895 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6897 (*self.0.stub)
6898 .list_locations(self.0.request, self.0.options)
6899 .await
6900 .map(crate::Response::into_body)
6901 }
6902
6903 pub fn by_page(
6905 self,
6906 ) -> impl google_cloud_gax::paginator::Paginator<
6907 google_cloud_location::model::ListLocationsResponse,
6908 crate::Error,
6909 > {
6910 use std::clone::Clone;
6911 let token = self.0.request.page_token.clone();
6912 let execute = move |token: String| {
6913 let mut builder = self.clone();
6914 builder.0.request = builder.0.request.set_page_token(token);
6915 builder.send()
6916 };
6917 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6918 }
6919
6920 pub fn by_item(
6922 self,
6923 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6924 google_cloud_location::model::ListLocationsResponse,
6925 crate::Error,
6926 > {
6927 use google_cloud_gax::paginator::Paginator;
6928 self.by_page().items()
6929 }
6930
6931 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6933 self.0.request.name = v.into();
6934 self
6935 }
6936
6937 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6939 self.0.request.filter = v.into();
6940 self
6941 }
6942
6943 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6945 self.0.request.page_size = v.into();
6946 self
6947 }
6948
6949 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6951 self.0.request.page_token = v.into();
6952 self
6953 }
6954 }
6955
6956 #[doc(hidden)]
6957 impl crate::RequestBuilder for ListLocations {
6958 fn request_options(&mut self) -> &mut crate::RequestOptions {
6959 &mut self.0.options
6960 }
6961 }
6962
6963 #[derive(Clone, Debug)]
6980 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6981
6982 impl GetLocation {
6983 pub(crate) fn new(
6984 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6985 ) -> Self {
6986 Self(RequestBuilder::new(stub))
6987 }
6988
6989 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6991 mut self,
6992 v: V,
6993 ) -> Self {
6994 self.0.request = v.into();
6995 self
6996 }
6997
6998 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7000 self.0.options = v.into();
7001 self
7002 }
7003
7004 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7006 (*self.0.stub)
7007 .get_location(self.0.request, self.0.options)
7008 .await
7009 .map(crate::Response::into_body)
7010 }
7011
7012 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7014 self.0.request.name = v.into();
7015 self
7016 }
7017 }
7018
7019 #[doc(hidden)]
7020 impl crate::RequestBuilder for GetLocation {
7021 fn request_options(&mut self) -> &mut crate::RequestOptions {
7022 &mut self.0.options
7023 }
7024 }
7025
7026 #[derive(Clone, Debug)]
7043 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
7044
7045 impl SetIamPolicy {
7046 pub(crate) fn new(
7047 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7048 ) -> Self {
7049 Self(RequestBuilder::new(stub))
7050 }
7051
7052 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
7054 mut self,
7055 v: V,
7056 ) -> Self {
7057 self.0.request = v.into();
7058 self
7059 }
7060
7061 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7063 self.0.options = v.into();
7064 self
7065 }
7066
7067 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7069 (*self.0.stub)
7070 .set_iam_policy(self.0.request, self.0.options)
7071 .await
7072 .map(crate::Response::into_body)
7073 }
7074
7075 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7079 self.0.request.resource = v.into();
7080 self
7081 }
7082
7083 pub fn set_policy<T>(mut self, v: T) -> Self
7087 where
7088 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7089 {
7090 self.0.request.policy = std::option::Option::Some(v.into());
7091 self
7092 }
7093
7094 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7098 where
7099 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
7100 {
7101 self.0.request.policy = v.map(|x| x.into());
7102 self
7103 }
7104
7105 pub fn set_update_mask<T>(mut self, v: T) -> Self
7107 where
7108 T: std::convert::Into<wkt::FieldMask>,
7109 {
7110 self.0.request.update_mask = std::option::Option::Some(v.into());
7111 self
7112 }
7113
7114 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7116 where
7117 T: std::convert::Into<wkt::FieldMask>,
7118 {
7119 self.0.request.update_mask = v.map(|x| x.into());
7120 self
7121 }
7122 }
7123
7124 #[doc(hidden)]
7125 impl crate::RequestBuilder for SetIamPolicy {
7126 fn request_options(&mut self) -> &mut crate::RequestOptions {
7127 &mut self.0.options
7128 }
7129 }
7130
7131 #[derive(Clone, Debug)]
7148 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
7149
7150 impl GetIamPolicy {
7151 pub(crate) fn new(
7152 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7153 ) -> Self {
7154 Self(RequestBuilder::new(stub))
7155 }
7156
7157 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
7159 mut self,
7160 v: V,
7161 ) -> Self {
7162 self.0.request = v.into();
7163 self
7164 }
7165
7166 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7168 self.0.options = v.into();
7169 self
7170 }
7171
7172 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
7174 (*self.0.stub)
7175 .get_iam_policy(self.0.request, self.0.options)
7176 .await
7177 .map(crate::Response::into_body)
7178 }
7179
7180 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7184 self.0.request.resource = v.into();
7185 self
7186 }
7187
7188 pub fn set_options<T>(mut self, v: T) -> Self
7190 where
7191 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
7192 {
7193 self.0.request.options = std::option::Option::Some(v.into());
7194 self
7195 }
7196
7197 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7199 where
7200 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
7201 {
7202 self.0.request.options = v.map(|x| x.into());
7203 self
7204 }
7205 }
7206
7207 #[doc(hidden)]
7208 impl crate::RequestBuilder for GetIamPolicy {
7209 fn request_options(&mut self) -> &mut crate::RequestOptions {
7210 &mut self.0.options
7211 }
7212 }
7213
7214 #[derive(Clone, Debug)]
7231 pub struct TestIamPermissions(
7232 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
7233 );
7234
7235 impl TestIamPermissions {
7236 pub(crate) fn new(
7237 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7238 ) -> Self {
7239 Self(RequestBuilder::new(stub))
7240 }
7241
7242 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
7244 mut self,
7245 v: V,
7246 ) -> Self {
7247 self.0.request = v.into();
7248 self
7249 }
7250
7251 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7253 self.0.options = v.into();
7254 self
7255 }
7256
7257 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
7259 (*self.0.stub)
7260 .test_iam_permissions(self.0.request, self.0.options)
7261 .await
7262 .map(crate::Response::into_body)
7263 }
7264
7265 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7269 self.0.request.resource = v.into();
7270 self
7271 }
7272
7273 pub fn set_permissions<T, V>(mut self, v: T) -> Self
7277 where
7278 T: std::iter::IntoIterator<Item = V>,
7279 V: std::convert::Into<std::string::String>,
7280 {
7281 use std::iter::Iterator;
7282 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
7283 self
7284 }
7285 }
7286
7287 #[doc(hidden)]
7288 impl crate::RequestBuilder for TestIamPermissions {
7289 fn request_options(&mut self) -> &mut crate::RequestOptions {
7290 &mut self.0.options
7291 }
7292 }
7293
7294 #[derive(Clone, Debug)]
7315 pub struct ListOperations(
7316 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7317 );
7318
7319 impl ListOperations {
7320 pub(crate) fn new(
7321 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7322 ) -> Self {
7323 Self(RequestBuilder::new(stub))
7324 }
7325
7326 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7328 mut self,
7329 v: V,
7330 ) -> Self {
7331 self.0.request = v.into();
7332 self
7333 }
7334
7335 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7337 self.0.options = v.into();
7338 self
7339 }
7340
7341 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7343 (*self.0.stub)
7344 .list_operations(self.0.request, self.0.options)
7345 .await
7346 .map(crate::Response::into_body)
7347 }
7348
7349 pub fn by_page(
7351 self,
7352 ) -> impl google_cloud_gax::paginator::Paginator<
7353 google_cloud_longrunning::model::ListOperationsResponse,
7354 crate::Error,
7355 > {
7356 use std::clone::Clone;
7357 let token = self.0.request.page_token.clone();
7358 let execute = move |token: String| {
7359 let mut builder = self.clone();
7360 builder.0.request = builder.0.request.set_page_token(token);
7361 builder.send()
7362 };
7363 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7364 }
7365
7366 pub fn by_item(
7368 self,
7369 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7370 google_cloud_longrunning::model::ListOperationsResponse,
7371 crate::Error,
7372 > {
7373 use google_cloud_gax::paginator::Paginator;
7374 self.by_page().items()
7375 }
7376
7377 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7379 self.0.request.name = v.into();
7380 self
7381 }
7382
7383 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7385 self.0.request.filter = v.into();
7386 self
7387 }
7388
7389 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7391 self.0.request.page_size = v.into();
7392 self
7393 }
7394
7395 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7397 self.0.request.page_token = v.into();
7398 self
7399 }
7400
7401 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7403 self.0.request.return_partial_success = v.into();
7404 self
7405 }
7406 }
7407
7408 #[doc(hidden)]
7409 impl crate::RequestBuilder for ListOperations {
7410 fn request_options(&mut self) -> &mut crate::RequestOptions {
7411 &mut self.0.options
7412 }
7413 }
7414
7415 #[derive(Clone, Debug)]
7432 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7433
7434 impl GetOperation {
7435 pub(crate) fn new(
7436 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7437 ) -> Self {
7438 Self(RequestBuilder::new(stub))
7439 }
7440
7441 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7443 mut self,
7444 v: V,
7445 ) -> Self {
7446 self.0.request = v.into();
7447 self
7448 }
7449
7450 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7452 self.0.options = v.into();
7453 self
7454 }
7455
7456 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7458 (*self.0.stub)
7459 .get_operation(self.0.request, self.0.options)
7460 .await
7461 .map(crate::Response::into_body)
7462 }
7463
7464 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7466 self.0.request.name = v.into();
7467 self
7468 }
7469 }
7470
7471 #[doc(hidden)]
7472 impl crate::RequestBuilder for GetOperation {
7473 fn request_options(&mut self) -> &mut crate::RequestOptions {
7474 &mut self.0.options
7475 }
7476 }
7477
7478 #[derive(Clone, Debug)]
7495 pub struct DeleteOperation(
7496 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7497 );
7498
7499 impl DeleteOperation {
7500 pub(crate) fn new(
7501 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7502 ) -> Self {
7503 Self(RequestBuilder::new(stub))
7504 }
7505
7506 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7508 mut self,
7509 v: V,
7510 ) -> Self {
7511 self.0.request = v.into();
7512 self
7513 }
7514
7515 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7517 self.0.options = v.into();
7518 self
7519 }
7520
7521 pub async fn send(self) -> Result<()> {
7523 (*self.0.stub)
7524 .delete_operation(self.0.request, self.0.options)
7525 .await
7526 .map(crate::Response::into_body)
7527 }
7528
7529 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7531 self.0.request.name = v.into();
7532 self
7533 }
7534 }
7535
7536 #[doc(hidden)]
7537 impl crate::RequestBuilder for DeleteOperation {
7538 fn request_options(&mut self) -> &mut crate::RequestOptions {
7539 &mut self.0.options
7540 }
7541 }
7542
7543 #[derive(Clone, Debug)]
7560 pub struct CancelOperation(
7561 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7562 );
7563
7564 impl CancelOperation {
7565 pub(crate) fn new(
7566 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7567 ) -> Self {
7568 Self(RequestBuilder::new(stub))
7569 }
7570
7571 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7573 mut self,
7574 v: V,
7575 ) -> Self {
7576 self.0.request = v.into();
7577 self
7578 }
7579
7580 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7582 self.0.options = v.into();
7583 self
7584 }
7585
7586 pub async fn send(self) -> Result<()> {
7588 (*self.0.stub)
7589 .cancel_operation(self.0.request, self.0.options)
7590 .await
7591 .map(crate::Response::into_body)
7592 }
7593
7594 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7596 self.0.request.name = v.into();
7597 self
7598 }
7599 }
7600
7601 #[doc(hidden)]
7602 impl crate::RequestBuilder for CancelOperation {
7603 fn request_options(&mut self) -> &mut crate::RequestOptions {
7604 &mut self.0.options
7605 }
7606 }
7607}
7608
7609pub mod content_service {
7610 use crate::Result;
7611
7612 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7626
7627 pub(crate) mod client {
7628 use super::super::super::client::ContentService;
7629 pub struct Factory;
7630 impl crate::ClientFactory for Factory {
7631 type Client = ContentService;
7632 type Credentials = gaxi::options::Credentials;
7633 async fn build(
7634 self,
7635 config: gaxi::options::ClientConfig,
7636 ) -> crate::ClientBuilderResult<Self::Client> {
7637 Self::Client::new(config).await
7638 }
7639 }
7640 }
7641
7642 #[derive(Clone, Debug)]
7644 pub(crate) struct RequestBuilder<R: std::default::Default> {
7645 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7646 request: R,
7647 options: crate::RequestOptions,
7648 }
7649
7650 impl<R> RequestBuilder<R>
7651 where
7652 R: std::default::Default,
7653 {
7654 pub(crate) fn new(
7655 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7656 ) -> Self {
7657 Self {
7658 stub,
7659 request: R::default(),
7660 options: crate::RequestOptions::default(),
7661 }
7662 }
7663 }
7664
7665 #[derive(Clone, Debug)]
7682 pub struct CreateContent(RequestBuilder<crate::model::CreateContentRequest>);
7683
7684 impl CreateContent {
7685 pub(crate) fn new(
7686 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7687 ) -> Self {
7688 Self(RequestBuilder::new(stub))
7689 }
7690
7691 pub fn with_request<V: Into<crate::model::CreateContentRequest>>(mut self, v: V) -> Self {
7693 self.0.request = v.into();
7694 self
7695 }
7696
7697 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7699 self.0.options = v.into();
7700 self
7701 }
7702
7703 pub async fn send(self) -> Result<crate::model::Content> {
7705 (*self.0.stub)
7706 .create_content(self.0.request, self.0.options)
7707 .await
7708 .map(crate::Response::into_body)
7709 }
7710
7711 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7715 self.0.request.parent = v.into();
7716 self
7717 }
7718
7719 pub fn set_content<T>(mut self, v: T) -> Self
7723 where
7724 T: std::convert::Into<crate::model::Content>,
7725 {
7726 self.0.request.content = std::option::Option::Some(v.into());
7727 self
7728 }
7729
7730 pub fn set_or_clear_content<T>(mut self, v: std::option::Option<T>) -> Self
7734 where
7735 T: std::convert::Into<crate::model::Content>,
7736 {
7737 self.0.request.content = v.map(|x| x.into());
7738 self
7739 }
7740
7741 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
7743 self.0.request.validate_only = v.into();
7744 self
7745 }
7746 }
7747
7748 #[doc(hidden)]
7749 impl crate::RequestBuilder for CreateContent {
7750 fn request_options(&mut self) -> &mut crate::RequestOptions {
7751 &mut self.0.options
7752 }
7753 }
7754
7755 #[derive(Clone, Debug)]
7772 pub struct UpdateContent(RequestBuilder<crate::model::UpdateContentRequest>);
7773
7774 impl UpdateContent {
7775 pub(crate) fn new(
7776 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7777 ) -> Self {
7778 Self(RequestBuilder::new(stub))
7779 }
7780
7781 pub fn with_request<V: Into<crate::model::UpdateContentRequest>>(mut self, v: V) -> Self {
7783 self.0.request = v.into();
7784 self
7785 }
7786
7787 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7789 self.0.options = v.into();
7790 self
7791 }
7792
7793 pub async fn send(self) -> Result<crate::model::Content> {
7795 (*self.0.stub)
7796 .update_content(self.0.request, self.0.options)
7797 .await
7798 .map(crate::Response::into_body)
7799 }
7800
7801 pub fn set_update_mask<T>(mut self, v: T) -> Self
7805 where
7806 T: std::convert::Into<wkt::FieldMask>,
7807 {
7808 self.0.request.update_mask = std::option::Option::Some(v.into());
7809 self
7810 }
7811
7812 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7816 where
7817 T: std::convert::Into<wkt::FieldMask>,
7818 {
7819 self.0.request.update_mask = v.map(|x| x.into());
7820 self
7821 }
7822
7823 pub fn set_content<T>(mut self, v: T) -> Self
7827 where
7828 T: std::convert::Into<crate::model::Content>,
7829 {
7830 self.0.request.content = std::option::Option::Some(v.into());
7831 self
7832 }
7833
7834 pub fn set_or_clear_content<T>(mut self, v: std::option::Option<T>) -> Self
7838 where
7839 T: std::convert::Into<crate::model::Content>,
7840 {
7841 self.0.request.content = v.map(|x| x.into());
7842 self
7843 }
7844
7845 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
7847 self.0.request.validate_only = v.into();
7848 self
7849 }
7850 }
7851
7852 #[doc(hidden)]
7853 impl crate::RequestBuilder for UpdateContent {
7854 fn request_options(&mut self) -> &mut crate::RequestOptions {
7855 &mut self.0.options
7856 }
7857 }
7858
7859 #[derive(Clone, Debug)]
7876 pub struct DeleteContent(RequestBuilder<crate::model::DeleteContentRequest>);
7877
7878 impl DeleteContent {
7879 pub(crate) fn new(
7880 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7881 ) -> Self {
7882 Self(RequestBuilder::new(stub))
7883 }
7884
7885 pub fn with_request<V: Into<crate::model::DeleteContentRequest>>(mut self, v: V) -> Self {
7887 self.0.request = v.into();
7888 self
7889 }
7890
7891 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7893 self.0.options = v.into();
7894 self
7895 }
7896
7897 pub async fn send(self) -> Result<()> {
7899 (*self.0.stub)
7900 .delete_content(self.0.request, self.0.options)
7901 .await
7902 .map(crate::Response::into_body)
7903 }
7904
7905 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7909 self.0.request.name = v.into();
7910 self
7911 }
7912 }
7913
7914 #[doc(hidden)]
7915 impl crate::RequestBuilder for DeleteContent {
7916 fn request_options(&mut self) -> &mut crate::RequestOptions {
7917 &mut self.0.options
7918 }
7919 }
7920
7921 #[derive(Clone, Debug)]
7938 pub struct GetContent(RequestBuilder<crate::model::GetContentRequest>);
7939
7940 impl GetContent {
7941 pub(crate) fn new(
7942 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7943 ) -> Self {
7944 Self(RequestBuilder::new(stub))
7945 }
7946
7947 pub fn with_request<V: Into<crate::model::GetContentRequest>>(mut self, v: V) -> Self {
7949 self.0.request = v.into();
7950 self
7951 }
7952
7953 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7955 self.0.options = v.into();
7956 self
7957 }
7958
7959 pub async fn send(self) -> Result<crate::model::Content> {
7961 (*self.0.stub)
7962 .get_content(self.0.request, self.0.options)
7963 .await
7964 .map(crate::Response::into_body)
7965 }
7966
7967 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7971 self.0.request.name = v.into();
7972 self
7973 }
7974
7975 pub fn set_view<T: Into<crate::model::get_content_request::ContentView>>(
7977 mut self,
7978 v: T,
7979 ) -> Self {
7980 self.0.request.view = v.into();
7981 self
7982 }
7983 }
7984
7985 #[doc(hidden)]
7986 impl crate::RequestBuilder for GetContent {
7987 fn request_options(&mut self) -> &mut crate::RequestOptions {
7988 &mut self.0.options
7989 }
7990 }
7991
7992 #[derive(Clone, Debug)]
8009 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8010
8011 impl GetIamPolicy {
8012 pub(crate) fn new(
8013 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8014 ) -> Self {
8015 Self(RequestBuilder::new(stub))
8016 }
8017
8018 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8020 mut self,
8021 v: V,
8022 ) -> Self {
8023 self.0.request = v.into();
8024 self
8025 }
8026
8027 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8029 self.0.options = v.into();
8030 self
8031 }
8032
8033 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8035 (*self.0.stub)
8036 .get_iam_policy(self.0.request, self.0.options)
8037 .await
8038 .map(crate::Response::into_body)
8039 }
8040
8041 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8045 self.0.request.resource = v.into();
8046 self
8047 }
8048
8049 pub fn set_options<T>(mut self, v: T) -> Self
8051 where
8052 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8053 {
8054 self.0.request.options = std::option::Option::Some(v.into());
8055 self
8056 }
8057
8058 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8060 where
8061 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8062 {
8063 self.0.request.options = v.map(|x| x.into());
8064 self
8065 }
8066 }
8067
8068 #[doc(hidden)]
8069 impl crate::RequestBuilder for GetIamPolicy {
8070 fn request_options(&mut self) -> &mut crate::RequestOptions {
8071 &mut self.0.options
8072 }
8073 }
8074
8075 #[derive(Clone, Debug)]
8092 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8093
8094 impl SetIamPolicy {
8095 pub(crate) fn new(
8096 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8097 ) -> Self {
8098 Self(RequestBuilder::new(stub))
8099 }
8100
8101 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8103 mut self,
8104 v: V,
8105 ) -> Self {
8106 self.0.request = v.into();
8107 self
8108 }
8109
8110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8112 self.0.options = v.into();
8113 self
8114 }
8115
8116 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8118 (*self.0.stub)
8119 .set_iam_policy(self.0.request, self.0.options)
8120 .await
8121 .map(crate::Response::into_body)
8122 }
8123
8124 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8128 self.0.request.resource = v.into();
8129 self
8130 }
8131
8132 pub fn set_policy<T>(mut self, v: T) -> Self
8136 where
8137 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8138 {
8139 self.0.request.policy = std::option::Option::Some(v.into());
8140 self
8141 }
8142
8143 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8147 where
8148 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8149 {
8150 self.0.request.policy = v.map(|x| x.into());
8151 self
8152 }
8153
8154 pub fn set_update_mask<T>(mut self, v: T) -> Self
8156 where
8157 T: std::convert::Into<wkt::FieldMask>,
8158 {
8159 self.0.request.update_mask = std::option::Option::Some(v.into());
8160 self
8161 }
8162
8163 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8165 where
8166 T: std::convert::Into<wkt::FieldMask>,
8167 {
8168 self.0.request.update_mask = v.map(|x| x.into());
8169 self
8170 }
8171 }
8172
8173 #[doc(hidden)]
8174 impl crate::RequestBuilder for SetIamPolicy {
8175 fn request_options(&mut self) -> &mut crate::RequestOptions {
8176 &mut self.0.options
8177 }
8178 }
8179
8180 #[derive(Clone, Debug)]
8197 pub struct TestIamPermissions(
8198 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8199 );
8200
8201 impl TestIamPermissions {
8202 pub(crate) fn new(
8203 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8204 ) -> Self {
8205 Self(RequestBuilder::new(stub))
8206 }
8207
8208 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8210 mut self,
8211 v: V,
8212 ) -> Self {
8213 self.0.request = v.into();
8214 self
8215 }
8216
8217 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8219 self.0.options = v.into();
8220 self
8221 }
8222
8223 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8225 (*self.0.stub)
8226 .test_iam_permissions(self.0.request, self.0.options)
8227 .await
8228 .map(crate::Response::into_body)
8229 }
8230
8231 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8235 self.0.request.resource = v.into();
8236 self
8237 }
8238
8239 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8243 where
8244 T: std::iter::IntoIterator<Item = V>,
8245 V: std::convert::Into<std::string::String>,
8246 {
8247 use std::iter::Iterator;
8248 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8249 self
8250 }
8251 }
8252
8253 #[doc(hidden)]
8254 impl crate::RequestBuilder for TestIamPermissions {
8255 fn request_options(&mut self) -> &mut crate::RequestOptions {
8256 &mut self.0.options
8257 }
8258 }
8259
8260 #[derive(Clone, Debug)]
8281 pub struct ListContent(RequestBuilder<crate::model::ListContentRequest>);
8282
8283 impl ListContent {
8284 pub(crate) fn new(
8285 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8286 ) -> Self {
8287 Self(RequestBuilder::new(stub))
8288 }
8289
8290 pub fn with_request<V: Into<crate::model::ListContentRequest>>(mut self, v: V) -> Self {
8292 self.0.request = v.into();
8293 self
8294 }
8295
8296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8298 self.0.options = v.into();
8299 self
8300 }
8301
8302 pub async fn send(self) -> Result<crate::model::ListContentResponse> {
8304 (*self.0.stub)
8305 .list_content(self.0.request, self.0.options)
8306 .await
8307 .map(crate::Response::into_body)
8308 }
8309
8310 pub fn by_page(
8312 self,
8313 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListContentResponse, crate::Error>
8314 {
8315 use std::clone::Clone;
8316 let token = self.0.request.page_token.clone();
8317 let execute = move |token: String| {
8318 let mut builder = self.clone();
8319 builder.0.request = builder.0.request.set_page_token(token);
8320 builder.send()
8321 };
8322 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8323 }
8324
8325 pub fn by_item(
8327 self,
8328 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8329 crate::model::ListContentResponse,
8330 crate::Error,
8331 > {
8332 use google_cloud_gax::paginator::Paginator;
8333 self.by_page().items()
8334 }
8335
8336 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8340 self.0.request.parent = v.into();
8341 self
8342 }
8343
8344 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8346 self.0.request.page_size = v.into();
8347 self
8348 }
8349
8350 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8352 self.0.request.page_token = v.into();
8353 self
8354 }
8355
8356 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8358 self.0.request.filter = v.into();
8359 self
8360 }
8361 }
8362
8363 #[doc(hidden)]
8364 impl crate::RequestBuilder for ListContent {
8365 fn request_options(&mut self) -> &mut crate::RequestOptions {
8366 &mut self.0.options
8367 }
8368 }
8369
8370 #[derive(Clone, Debug)]
8391 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
8392
8393 impl ListLocations {
8394 pub(crate) fn new(
8395 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8396 ) -> Self {
8397 Self(RequestBuilder::new(stub))
8398 }
8399
8400 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
8402 mut self,
8403 v: V,
8404 ) -> Self {
8405 self.0.request = v.into();
8406 self
8407 }
8408
8409 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8411 self.0.options = v.into();
8412 self
8413 }
8414
8415 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8417 (*self.0.stub)
8418 .list_locations(self.0.request, self.0.options)
8419 .await
8420 .map(crate::Response::into_body)
8421 }
8422
8423 pub fn by_page(
8425 self,
8426 ) -> impl google_cloud_gax::paginator::Paginator<
8427 google_cloud_location::model::ListLocationsResponse,
8428 crate::Error,
8429 > {
8430 use std::clone::Clone;
8431 let token = self.0.request.page_token.clone();
8432 let execute = move |token: String| {
8433 let mut builder = self.clone();
8434 builder.0.request = builder.0.request.set_page_token(token);
8435 builder.send()
8436 };
8437 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8438 }
8439
8440 pub fn by_item(
8442 self,
8443 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8444 google_cloud_location::model::ListLocationsResponse,
8445 crate::Error,
8446 > {
8447 use google_cloud_gax::paginator::Paginator;
8448 self.by_page().items()
8449 }
8450
8451 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8453 self.0.request.name = v.into();
8454 self
8455 }
8456
8457 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8459 self.0.request.filter = v.into();
8460 self
8461 }
8462
8463 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8465 self.0.request.page_size = v.into();
8466 self
8467 }
8468
8469 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8471 self.0.request.page_token = v.into();
8472 self
8473 }
8474 }
8475
8476 #[doc(hidden)]
8477 impl crate::RequestBuilder for ListLocations {
8478 fn request_options(&mut self) -> &mut crate::RequestOptions {
8479 &mut self.0.options
8480 }
8481 }
8482
8483 #[derive(Clone, Debug)]
8500 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8501
8502 impl GetLocation {
8503 pub(crate) fn new(
8504 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8505 ) -> Self {
8506 Self(RequestBuilder::new(stub))
8507 }
8508
8509 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8511 mut self,
8512 v: V,
8513 ) -> Self {
8514 self.0.request = v.into();
8515 self
8516 }
8517
8518 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8520 self.0.options = v.into();
8521 self
8522 }
8523
8524 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8526 (*self.0.stub)
8527 .get_location(self.0.request, self.0.options)
8528 .await
8529 .map(crate::Response::into_body)
8530 }
8531
8532 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8534 self.0.request.name = v.into();
8535 self
8536 }
8537 }
8538
8539 #[doc(hidden)]
8540 impl crate::RequestBuilder for GetLocation {
8541 fn request_options(&mut self) -> &mut crate::RequestOptions {
8542 &mut self.0.options
8543 }
8544 }
8545
8546 #[derive(Clone, Debug)]
8567 pub struct ListOperations(
8568 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8569 );
8570
8571 impl ListOperations {
8572 pub(crate) fn new(
8573 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8574 ) -> Self {
8575 Self(RequestBuilder::new(stub))
8576 }
8577
8578 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8580 mut self,
8581 v: V,
8582 ) -> Self {
8583 self.0.request = v.into();
8584 self
8585 }
8586
8587 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8589 self.0.options = v.into();
8590 self
8591 }
8592
8593 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8595 (*self.0.stub)
8596 .list_operations(self.0.request, self.0.options)
8597 .await
8598 .map(crate::Response::into_body)
8599 }
8600
8601 pub fn by_page(
8603 self,
8604 ) -> impl google_cloud_gax::paginator::Paginator<
8605 google_cloud_longrunning::model::ListOperationsResponse,
8606 crate::Error,
8607 > {
8608 use std::clone::Clone;
8609 let token = self.0.request.page_token.clone();
8610 let execute = move |token: String| {
8611 let mut builder = self.clone();
8612 builder.0.request = builder.0.request.set_page_token(token);
8613 builder.send()
8614 };
8615 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8616 }
8617
8618 pub fn by_item(
8620 self,
8621 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8622 google_cloud_longrunning::model::ListOperationsResponse,
8623 crate::Error,
8624 > {
8625 use google_cloud_gax::paginator::Paginator;
8626 self.by_page().items()
8627 }
8628
8629 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8631 self.0.request.name = v.into();
8632 self
8633 }
8634
8635 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8637 self.0.request.filter = v.into();
8638 self
8639 }
8640
8641 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8643 self.0.request.page_size = v.into();
8644 self
8645 }
8646
8647 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8649 self.0.request.page_token = v.into();
8650 self
8651 }
8652
8653 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8655 self.0.request.return_partial_success = v.into();
8656 self
8657 }
8658 }
8659
8660 #[doc(hidden)]
8661 impl crate::RequestBuilder for ListOperations {
8662 fn request_options(&mut self) -> &mut crate::RequestOptions {
8663 &mut self.0.options
8664 }
8665 }
8666
8667 #[derive(Clone, Debug)]
8684 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8685
8686 impl GetOperation {
8687 pub(crate) fn new(
8688 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8689 ) -> Self {
8690 Self(RequestBuilder::new(stub))
8691 }
8692
8693 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8695 mut self,
8696 v: V,
8697 ) -> Self {
8698 self.0.request = v.into();
8699 self
8700 }
8701
8702 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8704 self.0.options = v.into();
8705 self
8706 }
8707
8708 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8710 (*self.0.stub)
8711 .get_operation(self.0.request, self.0.options)
8712 .await
8713 .map(crate::Response::into_body)
8714 }
8715
8716 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8718 self.0.request.name = v.into();
8719 self
8720 }
8721 }
8722
8723 #[doc(hidden)]
8724 impl crate::RequestBuilder for GetOperation {
8725 fn request_options(&mut self) -> &mut crate::RequestOptions {
8726 &mut self.0.options
8727 }
8728 }
8729
8730 #[derive(Clone, Debug)]
8747 pub struct DeleteOperation(
8748 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8749 );
8750
8751 impl DeleteOperation {
8752 pub(crate) fn new(
8753 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8754 ) -> Self {
8755 Self(RequestBuilder::new(stub))
8756 }
8757
8758 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8760 mut self,
8761 v: V,
8762 ) -> Self {
8763 self.0.request = v.into();
8764 self
8765 }
8766
8767 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8769 self.0.options = v.into();
8770 self
8771 }
8772
8773 pub async fn send(self) -> Result<()> {
8775 (*self.0.stub)
8776 .delete_operation(self.0.request, self.0.options)
8777 .await
8778 .map(crate::Response::into_body)
8779 }
8780
8781 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8783 self.0.request.name = v.into();
8784 self
8785 }
8786 }
8787
8788 #[doc(hidden)]
8789 impl crate::RequestBuilder for DeleteOperation {
8790 fn request_options(&mut self) -> &mut crate::RequestOptions {
8791 &mut self.0.options
8792 }
8793 }
8794
8795 #[derive(Clone, Debug)]
8812 pub struct CancelOperation(
8813 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8814 );
8815
8816 impl CancelOperation {
8817 pub(crate) fn new(
8818 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8819 ) -> Self {
8820 Self(RequestBuilder::new(stub))
8821 }
8822
8823 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8825 mut self,
8826 v: V,
8827 ) -> Self {
8828 self.0.request = v.into();
8829 self
8830 }
8831
8832 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8834 self.0.options = v.into();
8835 self
8836 }
8837
8838 pub async fn send(self) -> Result<()> {
8840 (*self.0.stub)
8841 .cancel_operation(self.0.request, self.0.options)
8842 .await
8843 .map(crate::Response::into_body)
8844 }
8845
8846 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8848 self.0.request.name = v.into();
8849 self
8850 }
8851 }
8852
8853 #[doc(hidden)]
8854 impl crate::RequestBuilder for CancelOperation {
8855 fn request_options(&mut self) -> &mut crate::RequestOptions {
8856 &mut self.0.options
8857 }
8858 }
8859}
8860
8861pub mod data_taxonomy_service {
8862 use crate::Result;
8863
8864 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8878
8879 pub(crate) mod client {
8880 use super::super::super::client::DataTaxonomyService;
8881 pub struct Factory;
8882 impl crate::ClientFactory for Factory {
8883 type Client = DataTaxonomyService;
8884 type Credentials = gaxi::options::Credentials;
8885 async fn build(
8886 self,
8887 config: gaxi::options::ClientConfig,
8888 ) -> crate::ClientBuilderResult<Self::Client> {
8889 Self::Client::new(config).await
8890 }
8891 }
8892 }
8893
8894 #[derive(Clone, Debug)]
8896 pub(crate) struct RequestBuilder<R: std::default::Default> {
8897 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8898 request: R,
8899 options: crate::RequestOptions,
8900 }
8901
8902 impl<R> RequestBuilder<R>
8903 where
8904 R: std::default::Default,
8905 {
8906 pub(crate) fn new(
8907 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8908 ) -> Self {
8909 Self {
8910 stub,
8911 request: R::default(),
8912 options: crate::RequestOptions::default(),
8913 }
8914 }
8915 }
8916
8917 #[derive(Clone, Debug)]
8935 pub struct CreateDataTaxonomy(RequestBuilder<crate::model::CreateDataTaxonomyRequest>);
8936
8937 impl CreateDataTaxonomy {
8938 pub(crate) fn new(
8939 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8940 ) -> Self {
8941 Self(RequestBuilder::new(stub))
8942 }
8943
8944 pub fn with_request<V: Into<crate::model::CreateDataTaxonomyRequest>>(
8946 mut self,
8947 v: V,
8948 ) -> Self {
8949 self.0.request = v.into();
8950 self
8951 }
8952
8953 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8955 self.0.options = v.into();
8956 self
8957 }
8958
8959 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8966 (*self.0.stub)
8967 .create_data_taxonomy(self.0.request, self.0.options)
8968 .await
8969 .map(crate::Response::into_body)
8970 }
8971
8972 pub fn poller(
8974 self,
8975 ) -> impl google_cloud_lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata>
8976 {
8977 type Operation = google_cloud_lro::internal::Operation<
8978 crate::model::DataTaxonomy,
8979 crate::model::OperationMetadata,
8980 >;
8981 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8982 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8983
8984 let stub = self.0.stub.clone();
8985 let mut options = self.0.options.clone();
8986 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8987 let query = move |name| {
8988 let stub = stub.clone();
8989 let options = options.clone();
8990 async {
8991 let op = GetOperation::new(stub)
8992 .set_name(name)
8993 .with_options(options)
8994 .send()
8995 .await?;
8996 Ok(Operation::new(op))
8997 }
8998 };
8999
9000 let start = move || async {
9001 let op = self.send().await?;
9002 Ok(Operation::new(op))
9003 };
9004
9005 google_cloud_lro::internal::new_poller(
9006 polling_error_policy,
9007 polling_backoff_policy,
9008 start,
9009 query,
9010 )
9011 }
9012
9013 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9017 self.0.request.parent = v.into();
9018 self
9019 }
9020
9021 pub fn set_data_taxonomy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9025 self.0.request.data_taxonomy_id = v.into();
9026 self
9027 }
9028
9029 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
9033 where
9034 T: std::convert::Into<crate::model::DataTaxonomy>,
9035 {
9036 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
9037 self
9038 }
9039
9040 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
9044 where
9045 T: std::convert::Into<crate::model::DataTaxonomy>,
9046 {
9047 self.0.request.data_taxonomy = v.map(|x| x.into());
9048 self
9049 }
9050
9051 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9053 self.0.request.validate_only = v.into();
9054 self
9055 }
9056 }
9057
9058 #[doc(hidden)]
9059 impl crate::RequestBuilder for CreateDataTaxonomy {
9060 fn request_options(&mut self) -> &mut crate::RequestOptions {
9061 &mut self.0.options
9062 }
9063 }
9064
9065 #[derive(Clone, Debug)]
9083 pub struct UpdateDataTaxonomy(RequestBuilder<crate::model::UpdateDataTaxonomyRequest>);
9084
9085 impl UpdateDataTaxonomy {
9086 pub(crate) fn new(
9087 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9088 ) -> Self {
9089 Self(RequestBuilder::new(stub))
9090 }
9091
9092 pub fn with_request<V: Into<crate::model::UpdateDataTaxonomyRequest>>(
9094 mut self,
9095 v: V,
9096 ) -> Self {
9097 self.0.request = v.into();
9098 self
9099 }
9100
9101 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9103 self.0.options = v.into();
9104 self
9105 }
9106
9107 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9114 (*self.0.stub)
9115 .update_data_taxonomy(self.0.request, self.0.options)
9116 .await
9117 .map(crate::Response::into_body)
9118 }
9119
9120 pub fn poller(
9122 self,
9123 ) -> impl google_cloud_lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata>
9124 {
9125 type Operation = google_cloud_lro::internal::Operation<
9126 crate::model::DataTaxonomy,
9127 crate::model::OperationMetadata,
9128 >;
9129 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9130 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9131
9132 let stub = self.0.stub.clone();
9133 let mut options = self.0.options.clone();
9134 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9135 let query = move |name| {
9136 let stub = stub.clone();
9137 let options = options.clone();
9138 async {
9139 let op = GetOperation::new(stub)
9140 .set_name(name)
9141 .with_options(options)
9142 .send()
9143 .await?;
9144 Ok(Operation::new(op))
9145 }
9146 };
9147
9148 let start = move || async {
9149 let op = self.send().await?;
9150 Ok(Operation::new(op))
9151 };
9152
9153 google_cloud_lro::internal::new_poller(
9154 polling_error_policy,
9155 polling_backoff_policy,
9156 start,
9157 query,
9158 )
9159 }
9160
9161 pub fn set_update_mask<T>(mut self, v: T) -> Self
9165 where
9166 T: std::convert::Into<wkt::FieldMask>,
9167 {
9168 self.0.request.update_mask = std::option::Option::Some(v.into());
9169 self
9170 }
9171
9172 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9176 where
9177 T: std::convert::Into<wkt::FieldMask>,
9178 {
9179 self.0.request.update_mask = v.map(|x| x.into());
9180 self
9181 }
9182
9183 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
9187 where
9188 T: std::convert::Into<crate::model::DataTaxonomy>,
9189 {
9190 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
9191 self
9192 }
9193
9194 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
9198 where
9199 T: std::convert::Into<crate::model::DataTaxonomy>,
9200 {
9201 self.0.request.data_taxonomy = v.map(|x| x.into());
9202 self
9203 }
9204
9205 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9207 self.0.request.validate_only = v.into();
9208 self
9209 }
9210 }
9211
9212 #[doc(hidden)]
9213 impl crate::RequestBuilder for UpdateDataTaxonomy {
9214 fn request_options(&mut self) -> &mut crate::RequestOptions {
9215 &mut self.0.options
9216 }
9217 }
9218
9219 #[derive(Clone, Debug)]
9237 pub struct DeleteDataTaxonomy(RequestBuilder<crate::model::DeleteDataTaxonomyRequest>);
9238
9239 impl DeleteDataTaxonomy {
9240 pub(crate) fn new(
9241 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9242 ) -> Self {
9243 Self(RequestBuilder::new(stub))
9244 }
9245
9246 pub fn with_request<V: Into<crate::model::DeleteDataTaxonomyRequest>>(
9248 mut self,
9249 v: V,
9250 ) -> Self {
9251 self.0.request = v.into();
9252 self
9253 }
9254
9255 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9257 self.0.options = v.into();
9258 self
9259 }
9260
9261 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9268 (*self.0.stub)
9269 .delete_data_taxonomy(self.0.request, self.0.options)
9270 .await
9271 .map(crate::Response::into_body)
9272 }
9273
9274 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9276 type Operation =
9277 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9278 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9279 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9280
9281 let stub = self.0.stub.clone();
9282 let mut options = self.0.options.clone();
9283 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9284 let query = move |name| {
9285 let stub = stub.clone();
9286 let options = options.clone();
9287 async {
9288 let op = GetOperation::new(stub)
9289 .set_name(name)
9290 .with_options(options)
9291 .send()
9292 .await?;
9293 Ok(Operation::new(op))
9294 }
9295 };
9296
9297 let start = move || async {
9298 let op = self.send().await?;
9299 Ok(Operation::new(op))
9300 };
9301
9302 google_cloud_lro::internal::new_unit_response_poller(
9303 polling_error_policy,
9304 polling_backoff_policy,
9305 start,
9306 query,
9307 )
9308 }
9309
9310 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9314 self.0.request.name = v.into();
9315 self
9316 }
9317
9318 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
9320 self.0.request.etag = v.into();
9321 self
9322 }
9323 }
9324
9325 #[doc(hidden)]
9326 impl crate::RequestBuilder for DeleteDataTaxonomy {
9327 fn request_options(&mut self) -> &mut crate::RequestOptions {
9328 &mut self.0.options
9329 }
9330 }
9331
9332 #[derive(Clone, Debug)]
9353 pub struct ListDataTaxonomies(RequestBuilder<crate::model::ListDataTaxonomiesRequest>);
9354
9355 impl ListDataTaxonomies {
9356 pub(crate) fn new(
9357 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9358 ) -> Self {
9359 Self(RequestBuilder::new(stub))
9360 }
9361
9362 pub fn with_request<V: Into<crate::model::ListDataTaxonomiesRequest>>(
9364 mut self,
9365 v: V,
9366 ) -> Self {
9367 self.0.request = v.into();
9368 self
9369 }
9370
9371 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9373 self.0.options = v.into();
9374 self
9375 }
9376
9377 pub async fn send(self) -> Result<crate::model::ListDataTaxonomiesResponse> {
9379 (*self.0.stub)
9380 .list_data_taxonomies(self.0.request, self.0.options)
9381 .await
9382 .map(crate::Response::into_body)
9383 }
9384
9385 pub fn by_page(
9387 self,
9388 ) -> impl google_cloud_gax::paginator::Paginator<
9389 crate::model::ListDataTaxonomiesResponse,
9390 crate::Error,
9391 > {
9392 use std::clone::Clone;
9393 let token = self.0.request.page_token.clone();
9394 let execute = move |token: String| {
9395 let mut builder = self.clone();
9396 builder.0.request = builder.0.request.set_page_token(token);
9397 builder.send()
9398 };
9399 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9400 }
9401
9402 pub fn by_item(
9404 self,
9405 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9406 crate::model::ListDataTaxonomiesResponse,
9407 crate::Error,
9408 > {
9409 use google_cloud_gax::paginator::Paginator;
9410 self.by_page().items()
9411 }
9412
9413 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9417 self.0.request.parent = v.into();
9418 self
9419 }
9420
9421 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9423 self.0.request.page_size = v.into();
9424 self
9425 }
9426
9427 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9429 self.0.request.page_token = v.into();
9430 self
9431 }
9432
9433 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9435 self.0.request.filter = v.into();
9436 self
9437 }
9438
9439 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9441 self.0.request.order_by = v.into();
9442 self
9443 }
9444 }
9445
9446 #[doc(hidden)]
9447 impl crate::RequestBuilder for ListDataTaxonomies {
9448 fn request_options(&mut self) -> &mut crate::RequestOptions {
9449 &mut self.0.options
9450 }
9451 }
9452
9453 #[derive(Clone, Debug)]
9470 pub struct GetDataTaxonomy(RequestBuilder<crate::model::GetDataTaxonomyRequest>);
9471
9472 impl GetDataTaxonomy {
9473 pub(crate) fn new(
9474 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9475 ) -> Self {
9476 Self(RequestBuilder::new(stub))
9477 }
9478
9479 pub fn with_request<V: Into<crate::model::GetDataTaxonomyRequest>>(mut self, v: V) -> Self {
9481 self.0.request = v.into();
9482 self
9483 }
9484
9485 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9487 self.0.options = v.into();
9488 self
9489 }
9490
9491 pub async fn send(self) -> Result<crate::model::DataTaxonomy> {
9493 (*self.0.stub)
9494 .get_data_taxonomy(self.0.request, self.0.options)
9495 .await
9496 .map(crate::Response::into_body)
9497 }
9498
9499 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9503 self.0.request.name = v.into();
9504 self
9505 }
9506 }
9507
9508 #[doc(hidden)]
9509 impl crate::RequestBuilder for GetDataTaxonomy {
9510 fn request_options(&mut self) -> &mut crate::RequestOptions {
9511 &mut self.0.options
9512 }
9513 }
9514
9515 #[derive(Clone, Debug)]
9533 pub struct CreateDataAttributeBinding(
9534 RequestBuilder<crate::model::CreateDataAttributeBindingRequest>,
9535 );
9536
9537 impl CreateDataAttributeBinding {
9538 pub(crate) fn new(
9539 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9540 ) -> Self {
9541 Self(RequestBuilder::new(stub))
9542 }
9543
9544 pub fn with_request<V: Into<crate::model::CreateDataAttributeBindingRequest>>(
9546 mut self,
9547 v: V,
9548 ) -> Self {
9549 self.0.request = v.into();
9550 self
9551 }
9552
9553 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9555 self.0.options = v.into();
9556 self
9557 }
9558
9559 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9566 (*self.0.stub)
9567 .create_data_attribute_binding(self.0.request, self.0.options)
9568 .await
9569 .map(crate::Response::into_body)
9570 }
9571
9572 pub fn poller(
9574 self,
9575 ) -> impl google_cloud_lro::Poller<
9576 crate::model::DataAttributeBinding,
9577 crate::model::OperationMetadata,
9578 > {
9579 type Operation = google_cloud_lro::internal::Operation<
9580 crate::model::DataAttributeBinding,
9581 crate::model::OperationMetadata,
9582 >;
9583 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9584 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9585
9586 let stub = self.0.stub.clone();
9587 let mut options = self.0.options.clone();
9588 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9589 let query = move |name| {
9590 let stub = stub.clone();
9591 let options = options.clone();
9592 async {
9593 let op = GetOperation::new(stub)
9594 .set_name(name)
9595 .with_options(options)
9596 .send()
9597 .await?;
9598 Ok(Operation::new(op))
9599 }
9600 };
9601
9602 let start = move || async {
9603 let op = self.send().await?;
9604 Ok(Operation::new(op))
9605 };
9606
9607 google_cloud_lro::internal::new_poller(
9608 polling_error_policy,
9609 polling_backoff_policy,
9610 start,
9611 query,
9612 )
9613 }
9614
9615 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9619 self.0.request.parent = v.into();
9620 self
9621 }
9622
9623 pub fn set_data_attribute_binding_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9627 self.0.request.data_attribute_binding_id = v.into();
9628 self
9629 }
9630
9631 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
9635 where
9636 T: std::convert::Into<crate::model::DataAttributeBinding>,
9637 {
9638 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
9639 self
9640 }
9641
9642 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
9646 where
9647 T: std::convert::Into<crate::model::DataAttributeBinding>,
9648 {
9649 self.0.request.data_attribute_binding = v.map(|x| x.into());
9650 self
9651 }
9652
9653 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9655 self.0.request.validate_only = v.into();
9656 self
9657 }
9658 }
9659
9660 #[doc(hidden)]
9661 impl crate::RequestBuilder for CreateDataAttributeBinding {
9662 fn request_options(&mut self) -> &mut crate::RequestOptions {
9663 &mut self.0.options
9664 }
9665 }
9666
9667 #[derive(Clone, Debug)]
9685 pub struct UpdateDataAttributeBinding(
9686 RequestBuilder<crate::model::UpdateDataAttributeBindingRequest>,
9687 );
9688
9689 impl UpdateDataAttributeBinding {
9690 pub(crate) fn new(
9691 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9692 ) -> Self {
9693 Self(RequestBuilder::new(stub))
9694 }
9695
9696 pub fn with_request<V: Into<crate::model::UpdateDataAttributeBindingRequest>>(
9698 mut self,
9699 v: V,
9700 ) -> Self {
9701 self.0.request = v.into();
9702 self
9703 }
9704
9705 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9707 self.0.options = v.into();
9708 self
9709 }
9710
9711 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9718 (*self.0.stub)
9719 .update_data_attribute_binding(self.0.request, self.0.options)
9720 .await
9721 .map(crate::Response::into_body)
9722 }
9723
9724 pub fn poller(
9726 self,
9727 ) -> impl google_cloud_lro::Poller<
9728 crate::model::DataAttributeBinding,
9729 crate::model::OperationMetadata,
9730 > {
9731 type Operation = google_cloud_lro::internal::Operation<
9732 crate::model::DataAttributeBinding,
9733 crate::model::OperationMetadata,
9734 >;
9735 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9736 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9737
9738 let stub = self.0.stub.clone();
9739 let mut options = self.0.options.clone();
9740 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9741 let query = move |name| {
9742 let stub = stub.clone();
9743 let options = options.clone();
9744 async {
9745 let op = GetOperation::new(stub)
9746 .set_name(name)
9747 .with_options(options)
9748 .send()
9749 .await?;
9750 Ok(Operation::new(op))
9751 }
9752 };
9753
9754 let start = move || async {
9755 let op = self.send().await?;
9756 Ok(Operation::new(op))
9757 };
9758
9759 google_cloud_lro::internal::new_poller(
9760 polling_error_policy,
9761 polling_backoff_policy,
9762 start,
9763 query,
9764 )
9765 }
9766
9767 pub fn set_update_mask<T>(mut self, v: T) -> Self
9771 where
9772 T: std::convert::Into<wkt::FieldMask>,
9773 {
9774 self.0.request.update_mask = std::option::Option::Some(v.into());
9775 self
9776 }
9777
9778 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9782 where
9783 T: std::convert::Into<wkt::FieldMask>,
9784 {
9785 self.0.request.update_mask = v.map(|x| x.into());
9786 self
9787 }
9788
9789 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
9793 where
9794 T: std::convert::Into<crate::model::DataAttributeBinding>,
9795 {
9796 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
9797 self
9798 }
9799
9800 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
9804 where
9805 T: std::convert::Into<crate::model::DataAttributeBinding>,
9806 {
9807 self.0.request.data_attribute_binding = v.map(|x| x.into());
9808 self
9809 }
9810
9811 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9813 self.0.request.validate_only = v.into();
9814 self
9815 }
9816 }
9817
9818 #[doc(hidden)]
9819 impl crate::RequestBuilder for UpdateDataAttributeBinding {
9820 fn request_options(&mut self) -> &mut crate::RequestOptions {
9821 &mut self.0.options
9822 }
9823 }
9824
9825 #[derive(Clone, Debug)]
9843 pub struct DeleteDataAttributeBinding(
9844 RequestBuilder<crate::model::DeleteDataAttributeBindingRequest>,
9845 );
9846
9847 impl DeleteDataAttributeBinding {
9848 pub(crate) fn new(
9849 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9850 ) -> Self {
9851 Self(RequestBuilder::new(stub))
9852 }
9853
9854 pub fn with_request<V: Into<crate::model::DeleteDataAttributeBindingRequest>>(
9856 mut self,
9857 v: V,
9858 ) -> Self {
9859 self.0.request = v.into();
9860 self
9861 }
9862
9863 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9865 self.0.options = v.into();
9866 self
9867 }
9868
9869 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9876 (*self.0.stub)
9877 .delete_data_attribute_binding(self.0.request, self.0.options)
9878 .await
9879 .map(crate::Response::into_body)
9880 }
9881
9882 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9884 type Operation =
9885 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9886 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9887 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9888
9889 let stub = self.0.stub.clone();
9890 let mut options = self.0.options.clone();
9891 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9892 let query = move |name| {
9893 let stub = stub.clone();
9894 let options = options.clone();
9895 async {
9896 let op = GetOperation::new(stub)
9897 .set_name(name)
9898 .with_options(options)
9899 .send()
9900 .await?;
9901 Ok(Operation::new(op))
9902 }
9903 };
9904
9905 let start = move || async {
9906 let op = self.send().await?;
9907 Ok(Operation::new(op))
9908 };
9909
9910 google_cloud_lro::internal::new_unit_response_poller(
9911 polling_error_policy,
9912 polling_backoff_policy,
9913 start,
9914 query,
9915 )
9916 }
9917
9918 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9922 self.0.request.name = v.into();
9923 self
9924 }
9925
9926 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
9930 self.0.request.etag = v.into();
9931 self
9932 }
9933 }
9934
9935 #[doc(hidden)]
9936 impl crate::RequestBuilder for DeleteDataAttributeBinding {
9937 fn request_options(&mut self) -> &mut crate::RequestOptions {
9938 &mut self.0.options
9939 }
9940 }
9941
9942 #[derive(Clone, Debug)]
9963 pub struct ListDataAttributeBindings(
9964 RequestBuilder<crate::model::ListDataAttributeBindingsRequest>,
9965 );
9966
9967 impl ListDataAttributeBindings {
9968 pub(crate) fn new(
9969 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9970 ) -> Self {
9971 Self(RequestBuilder::new(stub))
9972 }
9973
9974 pub fn with_request<V: Into<crate::model::ListDataAttributeBindingsRequest>>(
9976 mut self,
9977 v: V,
9978 ) -> Self {
9979 self.0.request = v.into();
9980 self
9981 }
9982
9983 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9985 self.0.options = v.into();
9986 self
9987 }
9988
9989 pub async fn send(self) -> Result<crate::model::ListDataAttributeBindingsResponse> {
9991 (*self.0.stub)
9992 .list_data_attribute_bindings(self.0.request, self.0.options)
9993 .await
9994 .map(crate::Response::into_body)
9995 }
9996
9997 pub fn by_page(
9999 self,
10000 ) -> impl google_cloud_gax::paginator::Paginator<
10001 crate::model::ListDataAttributeBindingsResponse,
10002 crate::Error,
10003 > {
10004 use std::clone::Clone;
10005 let token = self.0.request.page_token.clone();
10006 let execute = move |token: String| {
10007 let mut builder = self.clone();
10008 builder.0.request = builder.0.request.set_page_token(token);
10009 builder.send()
10010 };
10011 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10012 }
10013
10014 pub fn by_item(
10016 self,
10017 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10018 crate::model::ListDataAttributeBindingsResponse,
10019 crate::Error,
10020 > {
10021 use google_cloud_gax::paginator::Paginator;
10022 self.by_page().items()
10023 }
10024
10025 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10029 self.0.request.parent = v.into();
10030 self
10031 }
10032
10033 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10035 self.0.request.page_size = v.into();
10036 self
10037 }
10038
10039 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10041 self.0.request.page_token = v.into();
10042 self
10043 }
10044
10045 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10047 self.0.request.filter = v.into();
10048 self
10049 }
10050
10051 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10053 self.0.request.order_by = v.into();
10054 self
10055 }
10056 }
10057
10058 #[doc(hidden)]
10059 impl crate::RequestBuilder for ListDataAttributeBindings {
10060 fn request_options(&mut self) -> &mut crate::RequestOptions {
10061 &mut self.0.options
10062 }
10063 }
10064
10065 #[derive(Clone, Debug)]
10082 pub struct GetDataAttributeBinding(
10083 RequestBuilder<crate::model::GetDataAttributeBindingRequest>,
10084 );
10085
10086 impl GetDataAttributeBinding {
10087 pub(crate) fn new(
10088 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10089 ) -> Self {
10090 Self(RequestBuilder::new(stub))
10091 }
10092
10093 pub fn with_request<V: Into<crate::model::GetDataAttributeBindingRequest>>(
10095 mut self,
10096 v: V,
10097 ) -> Self {
10098 self.0.request = v.into();
10099 self
10100 }
10101
10102 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10104 self.0.options = v.into();
10105 self
10106 }
10107
10108 pub async fn send(self) -> Result<crate::model::DataAttributeBinding> {
10110 (*self.0.stub)
10111 .get_data_attribute_binding(self.0.request, self.0.options)
10112 .await
10113 .map(crate::Response::into_body)
10114 }
10115
10116 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10120 self.0.request.name = v.into();
10121 self
10122 }
10123 }
10124
10125 #[doc(hidden)]
10126 impl crate::RequestBuilder for GetDataAttributeBinding {
10127 fn request_options(&mut self) -> &mut crate::RequestOptions {
10128 &mut self.0.options
10129 }
10130 }
10131
10132 #[derive(Clone, Debug)]
10150 pub struct CreateDataAttribute(RequestBuilder<crate::model::CreateDataAttributeRequest>);
10151
10152 impl CreateDataAttribute {
10153 pub(crate) fn new(
10154 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10155 ) -> Self {
10156 Self(RequestBuilder::new(stub))
10157 }
10158
10159 pub fn with_request<V: Into<crate::model::CreateDataAttributeRequest>>(
10161 mut self,
10162 v: V,
10163 ) -> Self {
10164 self.0.request = v.into();
10165 self
10166 }
10167
10168 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10170 self.0.options = v.into();
10171 self
10172 }
10173
10174 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10181 (*self.0.stub)
10182 .create_data_attribute(self.0.request, self.0.options)
10183 .await
10184 .map(crate::Response::into_body)
10185 }
10186
10187 pub fn poller(
10189 self,
10190 ) -> impl google_cloud_lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
10191 {
10192 type Operation = google_cloud_lro::internal::Operation<
10193 crate::model::DataAttribute,
10194 crate::model::OperationMetadata,
10195 >;
10196 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10197 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10198
10199 let stub = self.0.stub.clone();
10200 let mut options = self.0.options.clone();
10201 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10202 let query = move |name| {
10203 let stub = stub.clone();
10204 let options = options.clone();
10205 async {
10206 let op = GetOperation::new(stub)
10207 .set_name(name)
10208 .with_options(options)
10209 .send()
10210 .await?;
10211 Ok(Operation::new(op))
10212 }
10213 };
10214
10215 let start = move || async {
10216 let op = self.send().await?;
10217 Ok(Operation::new(op))
10218 };
10219
10220 google_cloud_lro::internal::new_poller(
10221 polling_error_policy,
10222 polling_backoff_policy,
10223 start,
10224 query,
10225 )
10226 }
10227
10228 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10232 self.0.request.parent = v.into();
10233 self
10234 }
10235
10236 pub fn set_data_attribute_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10240 self.0.request.data_attribute_id = v.into();
10241 self
10242 }
10243
10244 pub fn set_data_attribute<T>(mut self, v: T) -> Self
10248 where
10249 T: std::convert::Into<crate::model::DataAttribute>,
10250 {
10251 self.0.request.data_attribute = std::option::Option::Some(v.into());
10252 self
10253 }
10254
10255 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
10259 where
10260 T: std::convert::Into<crate::model::DataAttribute>,
10261 {
10262 self.0.request.data_attribute = v.map(|x| x.into());
10263 self
10264 }
10265
10266 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10268 self.0.request.validate_only = v.into();
10269 self
10270 }
10271 }
10272
10273 #[doc(hidden)]
10274 impl crate::RequestBuilder for CreateDataAttribute {
10275 fn request_options(&mut self) -> &mut crate::RequestOptions {
10276 &mut self.0.options
10277 }
10278 }
10279
10280 #[derive(Clone, Debug)]
10298 pub struct UpdateDataAttribute(RequestBuilder<crate::model::UpdateDataAttributeRequest>);
10299
10300 impl UpdateDataAttribute {
10301 pub(crate) fn new(
10302 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10303 ) -> Self {
10304 Self(RequestBuilder::new(stub))
10305 }
10306
10307 pub fn with_request<V: Into<crate::model::UpdateDataAttributeRequest>>(
10309 mut self,
10310 v: V,
10311 ) -> Self {
10312 self.0.request = v.into();
10313 self
10314 }
10315
10316 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10318 self.0.options = v.into();
10319 self
10320 }
10321
10322 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10329 (*self.0.stub)
10330 .update_data_attribute(self.0.request, self.0.options)
10331 .await
10332 .map(crate::Response::into_body)
10333 }
10334
10335 pub fn poller(
10337 self,
10338 ) -> impl google_cloud_lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
10339 {
10340 type Operation = google_cloud_lro::internal::Operation<
10341 crate::model::DataAttribute,
10342 crate::model::OperationMetadata,
10343 >;
10344 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10345 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10346
10347 let stub = self.0.stub.clone();
10348 let mut options = self.0.options.clone();
10349 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10350 let query = move |name| {
10351 let stub = stub.clone();
10352 let options = options.clone();
10353 async {
10354 let op = GetOperation::new(stub)
10355 .set_name(name)
10356 .with_options(options)
10357 .send()
10358 .await?;
10359 Ok(Operation::new(op))
10360 }
10361 };
10362
10363 let start = move || async {
10364 let op = self.send().await?;
10365 Ok(Operation::new(op))
10366 };
10367
10368 google_cloud_lro::internal::new_poller(
10369 polling_error_policy,
10370 polling_backoff_policy,
10371 start,
10372 query,
10373 )
10374 }
10375
10376 pub fn set_update_mask<T>(mut self, v: T) -> Self
10380 where
10381 T: std::convert::Into<wkt::FieldMask>,
10382 {
10383 self.0.request.update_mask = std::option::Option::Some(v.into());
10384 self
10385 }
10386
10387 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10391 where
10392 T: std::convert::Into<wkt::FieldMask>,
10393 {
10394 self.0.request.update_mask = v.map(|x| x.into());
10395 self
10396 }
10397
10398 pub fn set_data_attribute<T>(mut self, v: T) -> Self
10402 where
10403 T: std::convert::Into<crate::model::DataAttribute>,
10404 {
10405 self.0.request.data_attribute = std::option::Option::Some(v.into());
10406 self
10407 }
10408
10409 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
10413 where
10414 T: std::convert::Into<crate::model::DataAttribute>,
10415 {
10416 self.0.request.data_attribute = v.map(|x| x.into());
10417 self
10418 }
10419
10420 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10422 self.0.request.validate_only = v.into();
10423 self
10424 }
10425 }
10426
10427 #[doc(hidden)]
10428 impl crate::RequestBuilder for UpdateDataAttribute {
10429 fn request_options(&mut self) -> &mut crate::RequestOptions {
10430 &mut self.0.options
10431 }
10432 }
10433
10434 #[derive(Clone, Debug)]
10452 pub struct DeleteDataAttribute(RequestBuilder<crate::model::DeleteDataAttributeRequest>);
10453
10454 impl DeleteDataAttribute {
10455 pub(crate) fn new(
10456 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10457 ) -> Self {
10458 Self(RequestBuilder::new(stub))
10459 }
10460
10461 pub fn with_request<V: Into<crate::model::DeleteDataAttributeRequest>>(
10463 mut self,
10464 v: V,
10465 ) -> Self {
10466 self.0.request = v.into();
10467 self
10468 }
10469
10470 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10472 self.0.options = v.into();
10473 self
10474 }
10475
10476 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10483 (*self.0.stub)
10484 .delete_data_attribute(self.0.request, self.0.options)
10485 .await
10486 .map(crate::Response::into_body)
10487 }
10488
10489 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10491 type Operation =
10492 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10493 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10494 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10495
10496 let stub = self.0.stub.clone();
10497 let mut options = self.0.options.clone();
10498 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10499 let query = move |name| {
10500 let stub = stub.clone();
10501 let options = options.clone();
10502 async {
10503 let op = GetOperation::new(stub)
10504 .set_name(name)
10505 .with_options(options)
10506 .send()
10507 .await?;
10508 Ok(Operation::new(op))
10509 }
10510 };
10511
10512 let start = move || async {
10513 let op = self.send().await?;
10514 Ok(Operation::new(op))
10515 };
10516
10517 google_cloud_lro::internal::new_unit_response_poller(
10518 polling_error_policy,
10519 polling_backoff_policy,
10520 start,
10521 query,
10522 )
10523 }
10524
10525 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10529 self.0.request.name = v.into();
10530 self
10531 }
10532
10533 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
10535 self.0.request.etag = v.into();
10536 self
10537 }
10538 }
10539
10540 #[doc(hidden)]
10541 impl crate::RequestBuilder for DeleteDataAttribute {
10542 fn request_options(&mut self) -> &mut crate::RequestOptions {
10543 &mut self.0.options
10544 }
10545 }
10546
10547 #[derive(Clone, Debug)]
10568 pub struct ListDataAttributes(RequestBuilder<crate::model::ListDataAttributesRequest>);
10569
10570 impl ListDataAttributes {
10571 pub(crate) fn new(
10572 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10573 ) -> Self {
10574 Self(RequestBuilder::new(stub))
10575 }
10576
10577 pub fn with_request<V: Into<crate::model::ListDataAttributesRequest>>(
10579 mut self,
10580 v: V,
10581 ) -> Self {
10582 self.0.request = v.into();
10583 self
10584 }
10585
10586 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10588 self.0.options = v.into();
10589 self
10590 }
10591
10592 pub async fn send(self) -> Result<crate::model::ListDataAttributesResponse> {
10594 (*self.0.stub)
10595 .list_data_attributes(self.0.request, self.0.options)
10596 .await
10597 .map(crate::Response::into_body)
10598 }
10599
10600 pub fn by_page(
10602 self,
10603 ) -> impl google_cloud_gax::paginator::Paginator<
10604 crate::model::ListDataAttributesResponse,
10605 crate::Error,
10606 > {
10607 use std::clone::Clone;
10608 let token = self.0.request.page_token.clone();
10609 let execute = move |token: String| {
10610 let mut builder = self.clone();
10611 builder.0.request = builder.0.request.set_page_token(token);
10612 builder.send()
10613 };
10614 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10615 }
10616
10617 pub fn by_item(
10619 self,
10620 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10621 crate::model::ListDataAttributesResponse,
10622 crate::Error,
10623 > {
10624 use google_cloud_gax::paginator::Paginator;
10625 self.by_page().items()
10626 }
10627
10628 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10632 self.0.request.parent = v.into();
10633 self
10634 }
10635
10636 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10638 self.0.request.page_size = v.into();
10639 self
10640 }
10641
10642 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10644 self.0.request.page_token = v.into();
10645 self
10646 }
10647
10648 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10650 self.0.request.filter = v.into();
10651 self
10652 }
10653
10654 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10656 self.0.request.order_by = v.into();
10657 self
10658 }
10659 }
10660
10661 #[doc(hidden)]
10662 impl crate::RequestBuilder for ListDataAttributes {
10663 fn request_options(&mut self) -> &mut crate::RequestOptions {
10664 &mut self.0.options
10665 }
10666 }
10667
10668 #[derive(Clone, Debug)]
10685 pub struct GetDataAttribute(RequestBuilder<crate::model::GetDataAttributeRequest>);
10686
10687 impl GetDataAttribute {
10688 pub(crate) fn new(
10689 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10690 ) -> Self {
10691 Self(RequestBuilder::new(stub))
10692 }
10693
10694 pub fn with_request<V: Into<crate::model::GetDataAttributeRequest>>(
10696 mut self,
10697 v: V,
10698 ) -> Self {
10699 self.0.request = v.into();
10700 self
10701 }
10702
10703 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10705 self.0.options = v.into();
10706 self
10707 }
10708
10709 pub async fn send(self) -> Result<crate::model::DataAttribute> {
10711 (*self.0.stub)
10712 .get_data_attribute(self.0.request, self.0.options)
10713 .await
10714 .map(crate::Response::into_body)
10715 }
10716
10717 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10721 self.0.request.name = v.into();
10722 self
10723 }
10724 }
10725
10726 #[doc(hidden)]
10727 impl crate::RequestBuilder for GetDataAttribute {
10728 fn request_options(&mut self) -> &mut crate::RequestOptions {
10729 &mut self.0.options
10730 }
10731 }
10732
10733 #[derive(Clone, Debug)]
10754 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10755
10756 impl ListLocations {
10757 pub(crate) fn new(
10758 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10759 ) -> Self {
10760 Self(RequestBuilder::new(stub))
10761 }
10762
10763 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10765 mut self,
10766 v: V,
10767 ) -> Self {
10768 self.0.request = v.into();
10769 self
10770 }
10771
10772 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10774 self.0.options = v.into();
10775 self
10776 }
10777
10778 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10780 (*self.0.stub)
10781 .list_locations(self.0.request, self.0.options)
10782 .await
10783 .map(crate::Response::into_body)
10784 }
10785
10786 pub fn by_page(
10788 self,
10789 ) -> impl google_cloud_gax::paginator::Paginator<
10790 google_cloud_location::model::ListLocationsResponse,
10791 crate::Error,
10792 > {
10793 use std::clone::Clone;
10794 let token = self.0.request.page_token.clone();
10795 let execute = move |token: String| {
10796 let mut builder = self.clone();
10797 builder.0.request = builder.0.request.set_page_token(token);
10798 builder.send()
10799 };
10800 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10801 }
10802
10803 pub fn by_item(
10805 self,
10806 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10807 google_cloud_location::model::ListLocationsResponse,
10808 crate::Error,
10809 > {
10810 use google_cloud_gax::paginator::Paginator;
10811 self.by_page().items()
10812 }
10813
10814 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10816 self.0.request.name = v.into();
10817 self
10818 }
10819
10820 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10822 self.0.request.filter = v.into();
10823 self
10824 }
10825
10826 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10828 self.0.request.page_size = v.into();
10829 self
10830 }
10831
10832 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10834 self.0.request.page_token = v.into();
10835 self
10836 }
10837 }
10838
10839 #[doc(hidden)]
10840 impl crate::RequestBuilder for ListLocations {
10841 fn request_options(&mut self) -> &mut crate::RequestOptions {
10842 &mut self.0.options
10843 }
10844 }
10845
10846 #[derive(Clone, Debug)]
10863 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10864
10865 impl GetLocation {
10866 pub(crate) fn new(
10867 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10868 ) -> Self {
10869 Self(RequestBuilder::new(stub))
10870 }
10871
10872 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10874 mut self,
10875 v: V,
10876 ) -> Self {
10877 self.0.request = v.into();
10878 self
10879 }
10880
10881 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10883 self.0.options = v.into();
10884 self
10885 }
10886
10887 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10889 (*self.0.stub)
10890 .get_location(self.0.request, self.0.options)
10891 .await
10892 .map(crate::Response::into_body)
10893 }
10894
10895 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10897 self.0.request.name = v.into();
10898 self
10899 }
10900 }
10901
10902 #[doc(hidden)]
10903 impl crate::RequestBuilder for GetLocation {
10904 fn request_options(&mut self) -> &mut crate::RequestOptions {
10905 &mut self.0.options
10906 }
10907 }
10908
10909 #[derive(Clone, Debug)]
10926 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10927
10928 impl SetIamPolicy {
10929 pub(crate) fn new(
10930 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10931 ) -> Self {
10932 Self(RequestBuilder::new(stub))
10933 }
10934
10935 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10937 mut self,
10938 v: V,
10939 ) -> Self {
10940 self.0.request = v.into();
10941 self
10942 }
10943
10944 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10946 self.0.options = v.into();
10947 self
10948 }
10949
10950 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10952 (*self.0.stub)
10953 .set_iam_policy(self.0.request, self.0.options)
10954 .await
10955 .map(crate::Response::into_body)
10956 }
10957
10958 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10962 self.0.request.resource = v.into();
10963 self
10964 }
10965
10966 pub fn set_policy<T>(mut self, v: T) -> Self
10970 where
10971 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10972 {
10973 self.0.request.policy = std::option::Option::Some(v.into());
10974 self
10975 }
10976
10977 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10981 where
10982 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10983 {
10984 self.0.request.policy = v.map(|x| x.into());
10985 self
10986 }
10987
10988 pub fn set_update_mask<T>(mut self, v: T) -> Self
10990 where
10991 T: std::convert::Into<wkt::FieldMask>,
10992 {
10993 self.0.request.update_mask = std::option::Option::Some(v.into());
10994 self
10995 }
10996
10997 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10999 where
11000 T: std::convert::Into<wkt::FieldMask>,
11001 {
11002 self.0.request.update_mask = v.map(|x| x.into());
11003 self
11004 }
11005 }
11006
11007 #[doc(hidden)]
11008 impl crate::RequestBuilder for SetIamPolicy {
11009 fn request_options(&mut self) -> &mut crate::RequestOptions {
11010 &mut self.0.options
11011 }
11012 }
11013
11014 #[derive(Clone, Debug)]
11031 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
11032
11033 impl GetIamPolicy {
11034 pub(crate) fn new(
11035 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11036 ) -> Self {
11037 Self(RequestBuilder::new(stub))
11038 }
11039
11040 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
11042 mut self,
11043 v: V,
11044 ) -> Self {
11045 self.0.request = v.into();
11046 self
11047 }
11048
11049 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11051 self.0.options = v.into();
11052 self
11053 }
11054
11055 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
11057 (*self.0.stub)
11058 .get_iam_policy(self.0.request, self.0.options)
11059 .await
11060 .map(crate::Response::into_body)
11061 }
11062
11063 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11067 self.0.request.resource = v.into();
11068 self
11069 }
11070
11071 pub fn set_options<T>(mut self, v: T) -> Self
11073 where
11074 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
11075 {
11076 self.0.request.options = std::option::Option::Some(v.into());
11077 self
11078 }
11079
11080 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
11082 where
11083 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
11084 {
11085 self.0.request.options = v.map(|x| x.into());
11086 self
11087 }
11088 }
11089
11090 #[doc(hidden)]
11091 impl crate::RequestBuilder for GetIamPolicy {
11092 fn request_options(&mut self) -> &mut crate::RequestOptions {
11093 &mut self.0.options
11094 }
11095 }
11096
11097 #[derive(Clone, Debug)]
11114 pub struct TestIamPermissions(
11115 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
11116 );
11117
11118 impl TestIamPermissions {
11119 pub(crate) fn new(
11120 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11121 ) -> Self {
11122 Self(RequestBuilder::new(stub))
11123 }
11124
11125 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
11127 mut self,
11128 v: V,
11129 ) -> Self {
11130 self.0.request = v.into();
11131 self
11132 }
11133
11134 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11136 self.0.options = v.into();
11137 self
11138 }
11139
11140 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
11142 (*self.0.stub)
11143 .test_iam_permissions(self.0.request, self.0.options)
11144 .await
11145 .map(crate::Response::into_body)
11146 }
11147
11148 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11152 self.0.request.resource = v.into();
11153 self
11154 }
11155
11156 pub fn set_permissions<T, V>(mut self, v: T) -> Self
11160 where
11161 T: std::iter::IntoIterator<Item = V>,
11162 V: std::convert::Into<std::string::String>,
11163 {
11164 use std::iter::Iterator;
11165 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
11166 self
11167 }
11168 }
11169
11170 #[doc(hidden)]
11171 impl crate::RequestBuilder for TestIamPermissions {
11172 fn request_options(&mut self) -> &mut crate::RequestOptions {
11173 &mut self.0.options
11174 }
11175 }
11176
11177 #[derive(Clone, Debug)]
11198 pub struct ListOperations(
11199 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11200 );
11201
11202 impl ListOperations {
11203 pub(crate) fn new(
11204 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11205 ) -> Self {
11206 Self(RequestBuilder::new(stub))
11207 }
11208
11209 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11211 mut self,
11212 v: V,
11213 ) -> Self {
11214 self.0.request = v.into();
11215 self
11216 }
11217
11218 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11220 self.0.options = v.into();
11221 self
11222 }
11223
11224 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11226 (*self.0.stub)
11227 .list_operations(self.0.request, self.0.options)
11228 .await
11229 .map(crate::Response::into_body)
11230 }
11231
11232 pub fn by_page(
11234 self,
11235 ) -> impl google_cloud_gax::paginator::Paginator<
11236 google_cloud_longrunning::model::ListOperationsResponse,
11237 crate::Error,
11238 > {
11239 use std::clone::Clone;
11240 let token = self.0.request.page_token.clone();
11241 let execute = move |token: String| {
11242 let mut builder = self.clone();
11243 builder.0.request = builder.0.request.set_page_token(token);
11244 builder.send()
11245 };
11246 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11247 }
11248
11249 pub fn by_item(
11251 self,
11252 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11253 google_cloud_longrunning::model::ListOperationsResponse,
11254 crate::Error,
11255 > {
11256 use google_cloud_gax::paginator::Paginator;
11257 self.by_page().items()
11258 }
11259
11260 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11262 self.0.request.name = v.into();
11263 self
11264 }
11265
11266 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11268 self.0.request.filter = v.into();
11269 self
11270 }
11271
11272 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11274 self.0.request.page_size = v.into();
11275 self
11276 }
11277
11278 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11280 self.0.request.page_token = v.into();
11281 self
11282 }
11283
11284 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11286 self.0.request.return_partial_success = v.into();
11287 self
11288 }
11289 }
11290
11291 #[doc(hidden)]
11292 impl crate::RequestBuilder for ListOperations {
11293 fn request_options(&mut self) -> &mut crate::RequestOptions {
11294 &mut self.0.options
11295 }
11296 }
11297
11298 #[derive(Clone, Debug)]
11315 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11316
11317 impl GetOperation {
11318 pub(crate) fn new(
11319 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11320 ) -> Self {
11321 Self(RequestBuilder::new(stub))
11322 }
11323
11324 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11326 mut self,
11327 v: V,
11328 ) -> Self {
11329 self.0.request = v.into();
11330 self
11331 }
11332
11333 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11335 self.0.options = v.into();
11336 self
11337 }
11338
11339 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11341 (*self.0.stub)
11342 .get_operation(self.0.request, self.0.options)
11343 .await
11344 .map(crate::Response::into_body)
11345 }
11346
11347 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11349 self.0.request.name = v.into();
11350 self
11351 }
11352 }
11353
11354 #[doc(hidden)]
11355 impl crate::RequestBuilder for GetOperation {
11356 fn request_options(&mut self) -> &mut crate::RequestOptions {
11357 &mut self.0.options
11358 }
11359 }
11360
11361 #[derive(Clone, Debug)]
11378 pub struct DeleteOperation(
11379 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11380 );
11381
11382 impl DeleteOperation {
11383 pub(crate) fn new(
11384 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11385 ) -> Self {
11386 Self(RequestBuilder::new(stub))
11387 }
11388
11389 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11391 mut self,
11392 v: V,
11393 ) -> Self {
11394 self.0.request = v.into();
11395 self
11396 }
11397
11398 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11400 self.0.options = v.into();
11401 self
11402 }
11403
11404 pub async fn send(self) -> Result<()> {
11406 (*self.0.stub)
11407 .delete_operation(self.0.request, self.0.options)
11408 .await
11409 .map(crate::Response::into_body)
11410 }
11411
11412 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11414 self.0.request.name = v.into();
11415 self
11416 }
11417 }
11418
11419 #[doc(hidden)]
11420 impl crate::RequestBuilder for DeleteOperation {
11421 fn request_options(&mut self) -> &mut crate::RequestOptions {
11422 &mut self.0.options
11423 }
11424 }
11425
11426 #[derive(Clone, Debug)]
11443 pub struct CancelOperation(
11444 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11445 );
11446
11447 impl CancelOperation {
11448 pub(crate) fn new(
11449 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11450 ) -> Self {
11451 Self(RequestBuilder::new(stub))
11452 }
11453
11454 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11456 mut self,
11457 v: V,
11458 ) -> Self {
11459 self.0.request = v.into();
11460 self
11461 }
11462
11463 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11465 self.0.options = v.into();
11466 self
11467 }
11468
11469 pub async fn send(self) -> Result<()> {
11471 (*self.0.stub)
11472 .cancel_operation(self.0.request, self.0.options)
11473 .await
11474 .map(crate::Response::into_body)
11475 }
11476
11477 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11479 self.0.request.name = v.into();
11480 self
11481 }
11482 }
11483
11484 #[doc(hidden)]
11485 impl crate::RequestBuilder for CancelOperation {
11486 fn request_options(&mut self) -> &mut crate::RequestOptions {
11487 &mut self.0.options
11488 }
11489 }
11490}
11491
11492pub mod data_scan_service {
11493 use crate::Result;
11494
11495 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11509
11510 pub(crate) mod client {
11511 use super::super::super::client::DataScanService;
11512 pub struct Factory;
11513 impl crate::ClientFactory for Factory {
11514 type Client = DataScanService;
11515 type Credentials = gaxi::options::Credentials;
11516 async fn build(
11517 self,
11518 config: gaxi::options::ClientConfig,
11519 ) -> crate::ClientBuilderResult<Self::Client> {
11520 Self::Client::new(config).await
11521 }
11522 }
11523 }
11524
11525 #[derive(Clone, Debug)]
11527 pub(crate) struct RequestBuilder<R: std::default::Default> {
11528 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11529 request: R,
11530 options: crate::RequestOptions,
11531 }
11532
11533 impl<R> RequestBuilder<R>
11534 where
11535 R: std::default::Default,
11536 {
11537 pub(crate) fn new(
11538 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11539 ) -> Self {
11540 Self {
11541 stub,
11542 request: R::default(),
11543 options: crate::RequestOptions::default(),
11544 }
11545 }
11546 }
11547
11548 #[derive(Clone, Debug)]
11566 pub struct CreateDataScan(RequestBuilder<crate::model::CreateDataScanRequest>);
11567
11568 impl CreateDataScan {
11569 pub(crate) fn new(
11570 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11571 ) -> Self {
11572 Self(RequestBuilder::new(stub))
11573 }
11574
11575 pub fn with_request<V: Into<crate::model::CreateDataScanRequest>>(mut self, v: V) -> Self {
11577 self.0.request = v.into();
11578 self
11579 }
11580
11581 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11583 self.0.options = v.into();
11584 self
11585 }
11586
11587 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11594 (*self.0.stub)
11595 .create_data_scan(self.0.request, self.0.options)
11596 .await
11597 .map(crate::Response::into_body)
11598 }
11599
11600 pub fn poller(
11602 self,
11603 ) -> impl google_cloud_lro::Poller<crate::model::DataScan, crate::model::OperationMetadata>
11604 {
11605 type Operation = google_cloud_lro::internal::Operation<
11606 crate::model::DataScan,
11607 crate::model::OperationMetadata,
11608 >;
11609 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11610 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11611
11612 let stub = self.0.stub.clone();
11613 let mut options = self.0.options.clone();
11614 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11615 let query = move |name| {
11616 let stub = stub.clone();
11617 let options = options.clone();
11618 async {
11619 let op = GetOperation::new(stub)
11620 .set_name(name)
11621 .with_options(options)
11622 .send()
11623 .await?;
11624 Ok(Operation::new(op))
11625 }
11626 };
11627
11628 let start = move || async {
11629 let op = self.send().await?;
11630 Ok(Operation::new(op))
11631 };
11632
11633 google_cloud_lro::internal::new_poller(
11634 polling_error_policy,
11635 polling_backoff_policy,
11636 start,
11637 query,
11638 )
11639 }
11640
11641 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11645 self.0.request.parent = v.into();
11646 self
11647 }
11648
11649 pub fn set_data_scan<T>(mut self, v: T) -> Self
11653 where
11654 T: std::convert::Into<crate::model::DataScan>,
11655 {
11656 self.0.request.data_scan = std::option::Option::Some(v.into());
11657 self
11658 }
11659
11660 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
11664 where
11665 T: std::convert::Into<crate::model::DataScan>,
11666 {
11667 self.0.request.data_scan = v.map(|x| x.into());
11668 self
11669 }
11670
11671 pub fn set_data_scan_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11675 self.0.request.data_scan_id = v.into();
11676 self
11677 }
11678
11679 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11681 self.0.request.validate_only = v.into();
11682 self
11683 }
11684 }
11685
11686 #[doc(hidden)]
11687 impl crate::RequestBuilder for CreateDataScan {
11688 fn request_options(&mut self) -> &mut crate::RequestOptions {
11689 &mut self.0.options
11690 }
11691 }
11692
11693 #[derive(Clone, Debug)]
11711 pub struct UpdateDataScan(RequestBuilder<crate::model::UpdateDataScanRequest>);
11712
11713 impl UpdateDataScan {
11714 pub(crate) fn new(
11715 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11716 ) -> Self {
11717 Self(RequestBuilder::new(stub))
11718 }
11719
11720 pub fn with_request<V: Into<crate::model::UpdateDataScanRequest>>(mut self, v: V) -> Self {
11722 self.0.request = v.into();
11723 self
11724 }
11725
11726 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11728 self.0.options = v.into();
11729 self
11730 }
11731
11732 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11739 (*self.0.stub)
11740 .update_data_scan(self.0.request, self.0.options)
11741 .await
11742 .map(crate::Response::into_body)
11743 }
11744
11745 pub fn poller(
11747 self,
11748 ) -> impl google_cloud_lro::Poller<crate::model::DataScan, crate::model::OperationMetadata>
11749 {
11750 type Operation = google_cloud_lro::internal::Operation<
11751 crate::model::DataScan,
11752 crate::model::OperationMetadata,
11753 >;
11754 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11755 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11756
11757 let stub = self.0.stub.clone();
11758 let mut options = self.0.options.clone();
11759 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11760 let query = move |name| {
11761 let stub = stub.clone();
11762 let options = options.clone();
11763 async {
11764 let op = GetOperation::new(stub)
11765 .set_name(name)
11766 .with_options(options)
11767 .send()
11768 .await?;
11769 Ok(Operation::new(op))
11770 }
11771 };
11772
11773 let start = move || async {
11774 let op = self.send().await?;
11775 Ok(Operation::new(op))
11776 };
11777
11778 google_cloud_lro::internal::new_poller(
11779 polling_error_policy,
11780 polling_backoff_policy,
11781 start,
11782 query,
11783 )
11784 }
11785
11786 pub fn set_data_scan<T>(mut self, v: T) -> Self
11790 where
11791 T: std::convert::Into<crate::model::DataScan>,
11792 {
11793 self.0.request.data_scan = std::option::Option::Some(v.into());
11794 self
11795 }
11796
11797 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
11801 where
11802 T: std::convert::Into<crate::model::DataScan>,
11803 {
11804 self.0.request.data_scan = v.map(|x| x.into());
11805 self
11806 }
11807
11808 pub fn set_update_mask<T>(mut self, v: T) -> Self
11810 where
11811 T: std::convert::Into<wkt::FieldMask>,
11812 {
11813 self.0.request.update_mask = std::option::Option::Some(v.into());
11814 self
11815 }
11816
11817 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11819 where
11820 T: std::convert::Into<wkt::FieldMask>,
11821 {
11822 self.0.request.update_mask = v.map(|x| x.into());
11823 self
11824 }
11825
11826 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11828 self.0.request.validate_only = v.into();
11829 self
11830 }
11831 }
11832
11833 #[doc(hidden)]
11834 impl crate::RequestBuilder for UpdateDataScan {
11835 fn request_options(&mut self) -> &mut crate::RequestOptions {
11836 &mut self.0.options
11837 }
11838 }
11839
11840 #[derive(Clone, Debug)]
11858 pub struct DeleteDataScan(RequestBuilder<crate::model::DeleteDataScanRequest>);
11859
11860 impl DeleteDataScan {
11861 pub(crate) fn new(
11862 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11863 ) -> Self {
11864 Self(RequestBuilder::new(stub))
11865 }
11866
11867 pub fn with_request<V: Into<crate::model::DeleteDataScanRequest>>(mut self, v: V) -> Self {
11869 self.0.request = v.into();
11870 self
11871 }
11872
11873 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11875 self.0.options = v.into();
11876 self
11877 }
11878
11879 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11886 (*self.0.stub)
11887 .delete_data_scan(self.0.request, self.0.options)
11888 .await
11889 .map(crate::Response::into_body)
11890 }
11891
11892 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
11894 type Operation =
11895 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11896 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11897 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11898
11899 let stub = self.0.stub.clone();
11900 let mut options = self.0.options.clone();
11901 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11902 let query = move |name| {
11903 let stub = stub.clone();
11904 let options = options.clone();
11905 async {
11906 let op = GetOperation::new(stub)
11907 .set_name(name)
11908 .with_options(options)
11909 .send()
11910 .await?;
11911 Ok(Operation::new(op))
11912 }
11913 };
11914
11915 let start = move || async {
11916 let op = self.send().await?;
11917 Ok(Operation::new(op))
11918 };
11919
11920 google_cloud_lro::internal::new_unit_response_poller(
11921 polling_error_policy,
11922 polling_backoff_policy,
11923 start,
11924 query,
11925 )
11926 }
11927
11928 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11932 self.0.request.name = v.into();
11933 self
11934 }
11935
11936 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
11938 self.0.request.force = v.into();
11939 self
11940 }
11941 }
11942
11943 #[doc(hidden)]
11944 impl crate::RequestBuilder for DeleteDataScan {
11945 fn request_options(&mut self) -> &mut crate::RequestOptions {
11946 &mut self.0.options
11947 }
11948 }
11949
11950 #[derive(Clone, Debug)]
11967 pub struct GetDataScan(RequestBuilder<crate::model::GetDataScanRequest>);
11968
11969 impl GetDataScan {
11970 pub(crate) fn new(
11971 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11972 ) -> Self {
11973 Self(RequestBuilder::new(stub))
11974 }
11975
11976 pub fn with_request<V: Into<crate::model::GetDataScanRequest>>(mut self, v: V) -> Self {
11978 self.0.request = v.into();
11979 self
11980 }
11981
11982 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11984 self.0.options = v.into();
11985 self
11986 }
11987
11988 pub async fn send(self) -> Result<crate::model::DataScan> {
11990 (*self.0.stub)
11991 .get_data_scan(self.0.request, self.0.options)
11992 .await
11993 .map(crate::Response::into_body)
11994 }
11995
11996 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12000 self.0.request.name = v.into();
12001 self
12002 }
12003
12004 pub fn set_view<T: Into<crate::model::get_data_scan_request::DataScanView>>(
12006 mut self,
12007 v: T,
12008 ) -> Self {
12009 self.0.request.view = v.into();
12010 self
12011 }
12012 }
12013
12014 #[doc(hidden)]
12015 impl crate::RequestBuilder for GetDataScan {
12016 fn request_options(&mut self) -> &mut crate::RequestOptions {
12017 &mut self.0.options
12018 }
12019 }
12020
12021 #[derive(Clone, Debug)]
12042 pub struct ListDataScans(RequestBuilder<crate::model::ListDataScansRequest>);
12043
12044 impl ListDataScans {
12045 pub(crate) fn new(
12046 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12047 ) -> Self {
12048 Self(RequestBuilder::new(stub))
12049 }
12050
12051 pub fn with_request<V: Into<crate::model::ListDataScansRequest>>(mut self, v: V) -> Self {
12053 self.0.request = v.into();
12054 self
12055 }
12056
12057 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12059 self.0.options = v.into();
12060 self
12061 }
12062
12063 pub async fn send(self) -> Result<crate::model::ListDataScansResponse> {
12065 (*self.0.stub)
12066 .list_data_scans(self.0.request, self.0.options)
12067 .await
12068 .map(crate::Response::into_body)
12069 }
12070
12071 pub fn by_page(
12073 self,
12074 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListDataScansResponse, crate::Error>
12075 {
12076 use std::clone::Clone;
12077 let token = self.0.request.page_token.clone();
12078 let execute = move |token: String| {
12079 let mut builder = self.clone();
12080 builder.0.request = builder.0.request.set_page_token(token);
12081 builder.send()
12082 };
12083 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12084 }
12085
12086 pub fn by_item(
12088 self,
12089 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12090 crate::model::ListDataScansResponse,
12091 crate::Error,
12092 > {
12093 use google_cloud_gax::paginator::Paginator;
12094 self.by_page().items()
12095 }
12096
12097 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12101 self.0.request.parent = v.into();
12102 self
12103 }
12104
12105 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12107 self.0.request.page_size = v.into();
12108 self
12109 }
12110
12111 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12113 self.0.request.page_token = v.into();
12114 self
12115 }
12116
12117 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12119 self.0.request.filter = v.into();
12120 self
12121 }
12122
12123 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12125 self.0.request.order_by = v.into();
12126 self
12127 }
12128 }
12129
12130 #[doc(hidden)]
12131 impl crate::RequestBuilder for ListDataScans {
12132 fn request_options(&mut self) -> &mut crate::RequestOptions {
12133 &mut self.0.options
12134 }
12135 }
12136
12137 #[derive(Clone, Debug)]
12154 pub struct RunDataScan(RequestBuilder<crate::model::RunDataScanRequest>);
12155
12156 impl RunDataScan {
12157 pub(crate) fn new(
12158 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12159 ) -> Self {
12160 Self(RequestBuilder::new(stub))
12161 }
12162
12163 pub fn with_request<V: Into<crate::model::RunDataScanRequest>>(mut self, v: V) -> Self {
12165 self.0.request = v.into();
12166 self
12167 }
12168
12169 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12171 self.0.options = v.into();
12172 self
12173 }
12174
12175 pub async fn send(self) -> Result<crate::model::RunDataScanResponse> {
12177 (*self.0.stub)
12178 .run_data_scan(self.0.request, self.0.options)
12179 .await
12180 .map(crate::Response::into_body)
12181 }
12182
12183 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12187 self.0.request.name = v.into();
12188 self
12189 }
12190 }
12191
12192 #[doc(hidden)]
12193 impl crate::RequestBuilder for RunDataScan {
12194 fn request_options(&mut self) -> &mut crate::RequestOptions {
12195 &mut self.0.options
12196 }
12197 }
12198
12199 #[derive(Clone, Debug)]
12216 pub struct GetDataScanJob(RequestBuilder<crate::model::GetDataScanJobRequest>);
12217
12218 impl GetDataScanJob {
12219 pub(crate) fn new(
12220 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12221 ) -> Self {
12222 Self(RequestBuilder::new(stub))
12223 }
12224
12225 pub fn with_request<V: Into<crate::model::GetDataScanJobRequest>>(mut self, v: V) -> Self {
12227 self.0.request = v.into();
12228 self
12229 }
12230
12231 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12233 self.0.options = v.into();
12234 self
12235 }
12236
12237 pub async fn send(self) -> Result<crate::model::DataScanJob> {
12239 (*self.0.stub)
12240 .get_data_scan_job(self.0.request, self.0.options)
12241 .await
12242 .map(crate::Response::into_body)
12243 }
12244
12245 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12249 self.0.request.name = v.into();
12250 self
12251 }
12252
12253 pub fn set_view<T: Into<crate::model::get_data_scan_job_request::DataScanJobView>>(
12255 mut self,
12256 v: T,
12257 ) -> Self {
12258 self.0.request.view = v.into();
12259 self
12260 }
12261 }
12262
12263 #[doc(hidden)]
12264 impl crate::RequestBuilder for GetDataScanJob {
12265 fn request_options(&mut self) -> &mut crate::RequestOptions {
12266 &mut self.0.options
12267 }
12268 }
12269
12270 #[derive(Clone, Debug)]
12291 pub struct ListDataScanJobs(RequestBuilder<crate::model::ListDataScanJobsRequest>);
12292
12293 impl ListDataScanJobs {
12294 pub(crate) fn new(
12295 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12296 ) -> Self {
12297 Self(RequestBuilder::new(stub))
12298 }
12299
12300 pub fn with_request<V: Into<crate::model::ListDataScanJobsRequest>>(
12302 mut self,
12303 v: V,
12304 ) -> Self {
12305 self.0.request = v.into();
12306 self
12307 }
12308
12309 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12311 self.0.options = v.into();
12312 self
12313 }
12314
12315 pub async fn send(self) -> Result<crate::model::ListDataScanJobsResponse> {
12317 (*self.0.stub)
12318 .list_data_scan_jobs(self.0.request, self.0.options)
12319 .await
12320 .map(crate::Response::into_body)
12321 }
12322
12323 pub fn by_page(
12325 self,
12326 ) -> impl google_cloud_gax::paginator::Paginator<
12327 crate::model::ListDataScanJobsResponse,
12328 crate::Error,
12329 > {
12330 use std::clone::Clone;
12331 let token = self.0.request.page_token.clone();
12332 let execute = move |token: String| {
12333 let mut builder = self.clone();
12334 builder.0.request = builder.0.request.set_page_token(token);
12335 builder.send()
12336 };
12337 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12338 }
12339
12340 pub fn by_item(
12342 self,
12343 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12344 crate::model::ListDataScanJobsResponse,
12345 crate::Error,
12346 > {
12347 use google_cloud_gax::paginator::Paginator;
12348 self.by_page().items()
12349 }
12350
12351 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12355 self.0.request.parent = v.into();
12356 self
12357 }
12358
12359 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12361 self.0.request.page_size = v.into();
12362 self
12363 }
12364
12365 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12367 self.0.request.page_token = v.into();
12368 self
12369 }
12370
12371 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12373 self.0.request.filter = v.into();
12374 self
12375 }
12376 }
12377
12378 #[doc(hidden)]
12379 impl crate::RequestBuilder for ListDataScanJobs {
12380 fn request_options(&mut self) -> &mut crate::RequestOptions {
12381 &mut self.0.options
12382 }
12383 }
12384
12385 #[derive(Clone, Debug)]
12402 pub struct GenerateDataQualityRules(
12403 RequestBuilder<crate::model::GenerateDataQualityRulesRequest>,
12404 );
12405
12406 impl GenerateDataQualityRules {
12407 pub(crate) fn new(
12408 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12409 ) -> Self {
12410 Self(RequestBuilder::new(stub))
12411 }
12412
12413 pub fn with_request<V: Into<crate::model::GenerateDataQualityRulesRequest>>(
12415 mut self,
12416 v: V,
12417 ) -> Self {
12418 self.0.request = v.into();
12419 self
12420 }
12421
12422 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12424 self.0.options = v.into();
12425 self
12426 }
12427
12428 pub async fn send(self) -> Result<crate::model::GenerateDataQualityRulesResponse> {
12430 (*self.0.stub)
12431 .generate_data_quality_rules(self.0.request, self.0.options)
12432 .await
12433 .map(crate::Response::into_body)
12434 }
12435
12436 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12440 self.0.request.name = v.into();
12441 self
12442 }
12443 }
12444
12445 #[doc(hidden)]
12446 impl crate::RequestBuilder for GenerateDataQualityRules {
12447 fn request_options(&mut self) -> &mut crate::RequestOptions {
12448 &mut self.0.options
12449 }
12450 }
12451
12452 #[derive(Clone, Debug)]
12473 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
12474
12475 impl ListLocations {
12476 pub(crate) fn new(
12477 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12478 ) -> Self {
12479 Self(RequestBuilder::new(stub))
12480 }
12481
12482 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
12484 mut self,
12485 v: V,
12486 ) -> Self {
12487 self.0.request = v.into();
12488 self
12489 }
12490
12491 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12493 self.0.options = v.into();
12494 self
12495 }
12496
12497 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
12499 (*self.0.stub)
12500 .list_locations(self.0.request, self.0.options)
12501 .await
12502 .map(crate::Response::into_body)
12503 }
12504
12505 pub fn by_page(
12507 self,
12508 ) -> impl google_cloud_gax::paginator::Paginator<
12509 google_cloud_location::model::ListLocationsResponse,
12510 crate::Error,
12511 > {
12512 use std::clone::Clone;
12513 let token = self.0.request.page_token.clone();
12514 let execute = move |token: String| {
12515 let mut builder = self.clone();
12516 builder.0.request = builder.0.request.set_page_token(token);
12517 builder.send()
12518 };
12519 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12520 }
12521
12522 pub fn by_item(
12524 self,
12525 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12526 google_cloud_location::model::ListLocationsResponse,
12527 crate::Error,
12528 > {
12529 use google_cloud_gax::paginator::Paginator;
12530 self.by_page().items()
12531 }
12532
12533 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12535 self.0.request.name = v.into();
12536 self
12537 }
12538
12539 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12541 self.0.request.filter = v.into();
12542 self
12543 }
12544
12545 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12547 self.0.request.page_size = v.into();
12548 self
12549 }
12550
12551 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12553 self.0.request.page_token = v.into();
12554 self
12555 }
12556 }
12557
12558 #[doc(hidden)]
12559 impl crate::RequestBuilder for ListLocations {
12560 fn request_options(&mut self) -> &mut crate::RequestOptions {
12561 &mut self.0.options
12562 }
12563 }
12564
12565 #[derive(Clone, Debug)]
12582 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
12583
12584 impl GetLocation {
12585 pub(crate) fn new(
12586 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12587 ) -> Self {
12588 Self(RequestBuilder::new(stub))
12589 }
12590
12591 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
12593 mut self,
12594 v: V,
12595 ) -> Self {
12596 self.0.request = v.into();
12597 self
12598 }
12599
12600 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12602 self.0.options = v.into();
12603 self
12604 }
12605
12606 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
12608 (*self.0.stub)
12609 .get_location(self.0.request, self.0.options)
12610 .await
12611 .map(crate::Response::into_body)
12612 }
12613
12614 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12616 self.0.request.name = v.into();
12617 self
12618 }
12619 }
12620
12621 #[doc(hidden)]
12622 impl crate::RequestBuilder for GetLocation {
12623 fn request_options(&mut self) -> &mut crate::RequestOptions {
12624 &mut self.0.options
12625 }
12626 }
12627
12628 #[derive(Clone, Debug)]
12645 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
12646
12647 impl SetIamPolicy {
12648 pub(crate) fn new(
12649 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12650 ) -> Self {
12651 Self(RequestBuilder::new(stub))
12652 }
12653
12654 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
12656 mut self,
12657 v: V,
12658 ) -> Self {
12659 self.0.request = v.into();
12660 self
12661 }
12662
12663 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12665 self.0.options = v.into();
12666 self
12667 }
12668
12669 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
12671 (*self.0.stub)
12672 .set_iam_policy(self.0.request, self.0.options)
12673 .await
12674 .map(crate::Response::into_body)
12675 }
12676
12677 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
12681 self.0.request.resource = v.into();
12682 self
12683 }
12684
12685 pub fn set_policy<T>(mut self, v: T) -> Self
12689 where
12690 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
12691 {
12692 self.0.request.policy = std::option::Option::Some(v.into());
12693 self
12694 }
12695
12696 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
12700 where
12701 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
12702 {
12703 self.0.request.policy = v.map(|x| x.into());
12704 self
12705 }
12706
12707 pub fn set_update_mask<T>(mut self, v: T) -> Self
12709 where
12710 T: std::convert::Into<wkt::FieldMask>,
12711 {
12712 self.0.request.update_mask = std::option::Option::Some(v.into());
12713 self
12714 }
12715
12716 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12718 where
12719 T: std::convert::Into<wkt::FieldMask>,
12720 {
12721 self.0.request.update_mask = v.map(|x| x.into());
12722 self
12723 }
12724 }
12725
12726 #[doc(hidden)]
12727 impl crate::RequestBuilder for SetIamPolicy {
12728 fn request_options(&mut self) -> &mut crate::RequestOptions {
12729 &mut self.0.options
12730 }
12731 }
12732
12733 #[derive(Clone, Debug)]
12750 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
12751
12752 impl GetIamPolicy {
12753 pub(crate) fn new(
12754 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12755 ) -> Self {
12756 Self(RequestBuilder::new(stub))
12757 }
12758
12759 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
12761 mut self,
12762 v: V,
12763 ) -> Self {
12764 self.0.request = v.into();
12765 self
12766 }
12767
12768 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12770 self.0.options = v.into();
12771 self
12772 }
12773
12774 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
12776 (*self.0.stub)
12777 .get_iam_policy(self.0.request, self.0.options)
12778 .await
12779 .map(crate::Response::into_body)
12780 }
12781
12782 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
12786 self.0.request.resource = v.into();
12787 self
12788 }
12789
12790 pub fn set_options<T>(mut self, v: T) -> Self
12792 where
12793 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
12794 {
12795 self.0.request.options = std::option::Option::Some(v.into());
12796 self
12797 }
12798
12799 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
12801 where
12802 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
12803 {
12804 self.0.request.options = v.map(|x| x.into());
12805 self
12806 }
12807 }
12808
12809 #[doc(hidden)]
12810 impl crate::RequestBuilder for GetIamPolicy {
12811 fn request_options(&mut self) -> &mut crate::RequestOptions {
12812 &mut self.0.options
12813 }
12814 }
12815
12816 #[derive(Clone, Debug)]
12833 pub struct TestIamPermissions(
12834 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
12835 );
12836
12837 impl TestIamPermissions {
12838 pub(crate) fn new(
12839 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12840 ) -> Self {
12841 Self(RequestBuilder::new(stub))
12842 }
12843
12844 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
12846 mut self,
12847 v: V,
12848 ) -> Self {
12849 self.0.request = v.into();
12850 self
12851 }
12852
12853 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12855 self.0.options = v.into();
12856 self
12857 }
12858
12859 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
12861 (*self.0.stub)
12862 .test_iam_permissions(self.0.request, self.0.options)
12863 .await
12864 .map(crate::Response::into_body)
12865 }
12866
12867 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
12871 self.0.request.resource = v.into();
12872 self
12873 }
12874
12875 pub fn set_permissions<T, V>(mut self, v: T) -> Self
12879 where
12880 T: std::iter::IntoIterator<Item = V>,
12881 V: std::convert::Into<std::string::String>,
12882 {
12883 use std::iter::Iterator;
12884 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
12885 self
12886 }
12887 }
12888
12889 #[doc(hidden)]
12890 impl crate::RequestBuilder for TestIamPermissions {
12891 fn request_options(&mut self) -> &mut crate::RequestOptions {
12892 &mut self.0.options
12893 }
12894 }
12895
12896 #[derive(Clone, Debug)]
12917 pub struct ListOperations(
12918 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
12919 );
12920
12921 impl ListOperations {
12922 pub(crate) fn new(
12923 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12924 ) -> Self {
12925 Self(RequestBuilder::new(stub))
12926 }
12927
12928 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
12930 mut self,
12931 v: V,
12932 ) -> Self {
12933 self.0.request = v.into();
12934 self
12935 }
12936
12937 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12939 self.0.options = v.into();
12940 self
12941 }
12942
12943 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
12945 (*self.0.stub)
12946 .list_operations(self.0.request, self.0.options)
12947 .await
12948 .map(crate::Response::into_body)
12949 }
12950
12951 pub fn by_page(
12953 self,
12954 ) -> impl google_cloud_gax::paginator::Paginator<
12955 google_cloud_longrunning::model::ListOperationsResponse,
12956 crate::Error,
12957 > {
12958 use std::clone::Clone;
12959 let token = self.0.request.page_token.clone();
12960 let execute = move |token: String| {
12961 let mut builder = self.clone();
12962 builder.0.request = builder.0.request.set_page_token(token);
12963 builder.send()
12964 };
12965 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12966 }
12967
12968 pub fn by_item(
12970 self,
12971 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12972 google_cloud_longrunning::model::ListOperationsResponse,
12973 crate::Error,
12974 > {
12975 use google_cloud_gax::paginator::Paginator;
12976 self.by_page().items()
12977 }
12978
12979 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12981 self.0.request.name = v.into();
12982 self
12983 }
12984
12985 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12987 self.0.request.filter = v.into();
12988 self
12989 }
12990
12991 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12993 self.0.request.page_size = v.into();
12994 self
12995 }
12996
12997 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12999 self.0.request.page_token = v.into();
13000 self
13001 }
13002
13003 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13005 self.0.request.return_partial_success = v.into();
13006 self
13007 }
13008 }
13009
13010 #[doc(hidden)]
13011 impl crate::RequestBuilder for ListOperations {
13012 fn request_options(&mut self) -> &mut crate::RequestOptions {
13013 &mut self.0.options
13014 }
13015 }
13016
13017 #[derive(Clone, Debug)]
13034 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13035
13036 impl GetOperation {
13037 pub(crate) fn new(
13038 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
13039 ) -> Self {
13040 Self(RequestBuilder::new(stub))
13041 }
13042
13043 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13045 mut self,
13046 v: V,
13047 ) -> Self {
13048 self.0.request = v.into();
13049 self
13050 }
13051
13052 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13054 self.0.options = v.into();
13055 self
13056 }
13057
13058 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13060 (*self.0.stub)
13061 .get_operation(self.0.request, self.0.options)
13062 .await
13063 .map(crate::Response::into_body)
13064 }
13065
13066 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13068 self.0.request.name = v.into();
13069 self
13070 }
13071 }
13072
13073 #[doc(hidden)]
13074 impl crate::RequestBuilder for GetOperation {
13075 fn request_options(&mut self) -> &mut crate::RequestOptions {
13076 &mut self.0.options
13077 }
13078 }
13079
13080 #[derive(Clone, Debug)]
13097 pub struct DeleteOperation(
13098 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
13099 );
13100
13101 impl DeleteOperation {
13102 pub(crate) fn new(
13103 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
13104 ) -> Self {
13105 Self(RequestBuilder::new(stub))
13106 }
13107
13108 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
13110 mut self,
13111 v: V,
13112 ) -> Self {
13113 self.0.request = v.into();
13114 self
13115 }
13116
13117 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13119 self.0.options = v.into();
13120 self
13121 }
13122
13123 pub async fn send(self) -> Result<()> {
13125 (*self.0.stub)
13126 .delete_operation(self.0.request, self.0.options)
13127 .await
13128 .map(crate::Response::into_body)
13129 }
13130
13131 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13133 self.0.request.name = v.into();
13134 self
13135 }
13136 }
13137
13138 #[doc(hidden)]
13139 impl crate::RequestBuilder for DeleteOperation {
13140 fn request_options(&mut self) -> &mut crate::RequestOptions {
13141 &mut self.0.options
13142 }
13143 }
13144
13145 #[derive(Clone, Debug)]
13162 pub struct CancelOperation(
13163 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13164 );
13165
13166 impl CancelOperation {
13167 pub(crate) fn new(
13168 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
13169 ) -> Self {
13170 Self(RequestBuilder::new(stub))
13171 }
13172
13173 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13175 mut self,
13176 v: V,
13177 ) -> Self {
13178 self.0.request = v.into();
13179 self
13180 }
13181
13182 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13184 self.0.options = v.into();
13185 self
13186 }
13187
13188 pub async fn send(self) -> Result<()> {
13190 (*self.0.stub)
13191 .cancel_operation(self.0.request, self.0.options)
13192 .await
13193 .map(crate::Response::into_body)
13194 }
13195
13196 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13198 self.0.request.name = v.into();
13199 self
13200 }
13201 }
13202
13203 #[doc(hidden)]
13204 impl crate::RequestBuilder for CancelOperation {
13205 fn request_options(&mut self) -> &mut crate::RequestOptions {
13206 &mut self.0.options
13207 }
13208 }
13209}
13210
13211pub mod metadata_service {
13212 use crate::Result;
13213
13214 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13228
13229 pub(crate) mod client {
13230 use super::super::super::client::MetadataService;
13231 pub struct Factory;
13232 impl crate::ClientFactory for Factory {
13233 type Client = MetadataService;
13234 type Credentials = gaxi::options::Credentials;
13235 async fn build(
13236 self,
13237 config: gaxi::options::ClientConfig,
13238 ) -> crate::ClientBuilderResult<Self::Client> {
13239 Self::Client::new(config).await
13240 }
13241 }
13242 }
13243
13244 #[derive(Clone, Debug)]
13246 pub(crate) struct RequestBuilder<R: std::default::Default> {
13247 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13248 request: R,
13249 options: crate::RequestOptions,
13250 }
13251
13252 impl<R> RequestBuilder<R>
13253 where
13254 R: std::default::Default,
13255 {
13256 pub(crate) fn new(
13257 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13258 ) -> Self {
13259 Self {
13260 stub,
13261 request: R::default(),
13262 options: crate::RequestOptions::default(),
13263 }
13264 }
13265 }
13266
13267 #[derive(Clone, Debug)]
13284 pub struct CreateEntity(RequestBuilder<crate::model::CreateEntityRequest>);
13285
13286 impl CreateEntity {
13287 pub(crate) fn new(
13288 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13289 ) -> Self {
13290 Self(RequestBuilder::new(stub))
13291 }
13292
13293 pub fn with_request<V: Into<crate::model::CreateEntityRequest>>(mut self, v: V) -> Self {
13295 self.0.request = v.into();
13296 self
13297 }
13298
13299 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13301 self.0.options = v.into();
13302 self
13303 }
13304
13305 pub async fn send(self) -> Result<crate::model::Entity> {
13307 (*self.0.stub)
13308 .create_entity(self.0.request, self.0.options)
13309 .await
13310 .map(crate::Response::into_body)
13311 }
13312
13313 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13317 self.0.request.parent = v.into();
13318 self
13319 }
13320
13321 pub fn set_entity<T>(mut self, v: T) -> Self
13325 where
13326 T: std::convert::Into<crate::model::Entity>,
13327 {
13328 self.0.request.entity = std::option::Option::Some(v.into());
13329 self
13330 }
13331
13332 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
13336 where
13337 T: std::convert::Into<crate::model::Entity>,
13338 {
13339 self.0.request.entity = v.map(|x| x.into());
13340 self
13341 }
13342
13343 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13345 self.0.request.validate_only = v.into();
13346 self
13347 }
13348 }
13349
13350 #[doc(hidden)]
13351 impl crate::RequestBuilder for CreateEntity {
13352 fn request_options(&mut self) -> &mut crate::RequestOptions {
13353 &mut self.0.options
13354 }
13355 }
13356
13357 #[derive(Clone, Debug)]
13374 pub struct UpdateEntity(RequestBuilder<crate::model::UpdateEntityRequest>);
13375
13376 impl UpdateEntity {
13377 pub(crate) fn new(
13378 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13379 ) -> Self {
13380 Self(RequestBuilder::new(stub))
13381 }
13382
13383 pub fn with_request<V: Into<crate::model::UpdateEntityRequest>>(mut self, v: V) -> Self {
13385 self.0.request = v.into();
13386 self
13387 }
13388
13389 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13391 self.0.options = v.into();
13392 self
13393 }
13394
13395 pub async fn send(self) -> Result<crate::model::Entity> {
13397 (*self.0.stub)
13398 .update_entity(self.0.request, self.0.options)
13399 .await
13400 .map(crate::Response::into_body)
13401 }
13402
13403 pub fn set_entity<T>(mut self, v: T) -> Self
13407 where
13408 T: std::convert::Into<crate::model::Entity>,
13409 {
13410 self.0.request.entity = std::option::Option::Some(v.into());
13411 self
13412 }
13413
13414 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
13418 where
13419 T: std::convert::Into<crate::model::Entity>,
13420 {
13421 self.0.request.entity = v.map(|x| x.into());
13422 self
13423 }
13424
13425 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13427 self.0.request.validate_only = v.into();
13428 self
13429 }
13430 }
13431
13432 #[doc(hidden)]
13433 impl crate::RequestBuilder for UpdateEntity {
13434 fn request_options(&mut self) -> &mut crate::RequestOptions {
13435 &mut self.0.options
13436 }
13437 }
13438
13439 #[derive(Clone, Debug)]
13456 pub struct DeleteEntity(RequestBuilder<crate::model::DeleteEntityRequest>);
13457
13458 impl DeleteEntity {
13459 pub(crate) fn new(
13460 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13461 ) -> Self {
13462 Self(RequestBuilder::new(stub))
13463 }
13464
13465 pub fn with_request<V: Into<crate::model::DeleteEntityRequest>>(mut self, v: V) -> Self {
13467 self.0.request = v.into();
13468 self
13469 }
13470
13471 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13473 self.0.options = v.into();
13474 self
13475 }
13476
13477 pub async fn send(self) -> Result<()> {
13479 (*self.0.stub)
13480 .delete_entity(self.0.request, self.0.options)
13481 .await
13482 .map(crate::Response::into_body)
13483 }
13484
13485 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13489 self.0.request.name = v.into();
13490 self
13491 }
13492
13493 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
13497 self.0.request.etag = v.into();
13498 self
13499 }
13500 }
13501
13502 #[doc(hidden)]
13503 impl crate::RequestBuilder for DeleteEntity {
13504 fn request_options(&mut self) -> &mut crate::RequestOptions {
13505 &mut self.0.options
13506 }
13507 }
13508
13509 #[derive(Clone, Debug)]
13526 pub struct GetEntity(RequestBuilder<crate::model::GetEntityRequest>);
13527
13528 impl GetEntity {
13529 pub(crate) fn new(
13530 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13531 ) -> Self {
13532 Self(RequestBuilder::new(stub))
13533 }
13534
13535 pub fn with_request<V: Into<crate::model::GetEntityRequest>>(mut self, v: V) -> Self {
13537 self.0.request = v.into();
13538 self
13539 }
13540
13541 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13543 self.0.options = v.into();
13544 self
13545 }
13546
13547 pub async fn send(self) -> Result<crate::model::Entity> {
13549 (*self.0.stub)
13550 .get_entity(self.0.request, self.0.options)
13551 .await
13552 .map(crate::Response::into_body)
13553 }
13554
13555 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13559 self.0.request.name = v.into();
13560 self
13561 }
13562
13563 pub fn set_view<T: Into<crate::model::get_entity_request::EntityView>>(
13565 mut self,
13566 v: T,
13567 ) -> Self {
13568 self.0.request.view = v.into();
13569 self
13570 }
13571 }
13572
13573 #[doc(hidden)]
13574 impl crate::RequestBuilder for GetEntity {
13575 fn request_options(&mut self) -> &mut crate::RequestOptions {
13576 &mut self.0.options
13577 }
13578 }
13579
13580 #[derive(Clone, Debug)]
13601 pub struct ListEntities(RequestBuilder<crate::model::ListEntitiesRequest>);
13602
13603 impl ListEntities {
13604 pub(crate) fn new(
13605 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13606 ) -> Self {
13607 Self(RequestBuilder::new(stub))
13608 }
13609
13610 pub fn with_request<V: Into<crate::model::ListEntitiesRequest>>(mut self, v: V) -> Self {
13612 self.0.request = v.into();
13613 self
13614 }
13615
13616 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13618 self.0.options = v.into();
13619 self
13620 }
13621
13622 pub async fn send(self) -> Result<crate::model::ListEntitiesResponse> {
13624 (*self.0.stub)
13625 .list_entities(self.0.request, self.0.options)
13626 .await
13627 .map(crate::Response::into_body)
13628 }
13629
13630 pub fn by_page(
13632 self,
13633 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListEntitiesResponse, crate::Error>
13634 {
13635 use std::clone::Clone;
13636 let token = self.0.request.page_token.clone();
13637 let execute = move |token: String| {
13638 let mut builder = self.clone();
13639 builder.0.request = builder.0.request.set_page_token(token);
13640 builder.send()
13641 };
13642 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13643 }
13644
13645 pub fn by_item(
13647 self,
13648 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13649 crate::model::ListEntitiesResponse,
13650 crate::Error,
13651 > {
13652 use google_cloud_gax::paginator::Paginator;
13653 self.by_page().items()
13654 }
13655
13656 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13660 self.0.request.parent = v.into();
13661 self
13662 }
13663
13664 pub fn set_view<T: Into<crate::model::list_entities_request::EntityView>>(
13668 mut self,
13669 v: T,
13670 ) -> Self {
13671 self.0.request.view = v.into();
13672 self
13673 }
13674
13675 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13677 self.0.request.page_size = v.into();
13678 self
13679 }
13680
13681 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13683 self.0.request.page_token = v.into();
13684 self
13685 }
13686
13687 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13689 self.0.request.filter = v.into();
13690 self
13691 }
13692 }
13693
13694 #[doc(hidden)]
13695 impl crate::RequestBuilder for ListEntities {
13696 fn request_options(&mut self) -> &mut crate::RequestOptions {
13697 &mut self.0.options
13698 }
13699 }
13700
13701 #[derive(Clone, Debug)]
13718 pub struct CreatePartition(RequestBuilder<crate::model::CreatePartitionRequest>);
13719
13720 impl CreatePartition {
13721 pub(crate) fn new(
13722 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13723 ) -> Self {
13724 Self(RequestBuilder::new(stub))
13725 }
13726
13727 pub fn with_request<V: Into<crate::model::CreatePartitionRequest>>(mut self, v: V) -> Self {
13729 self.0.request = v.into();
13730 self
13731 }
13732
13733 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13735 self.0.options = v.into();
13736 self
13737 }
13738
13739 pub async fn send(self) -> Result<crate::model::Partition> {
13741 (*self.0.stub)
13742 .create_partition(self.0.request, self.0.options)
13743 .await
13744 .map(crate::Response::into_body)
13745 }
13746
13747 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13751 self.0.request.parent = v.into();
13752 self
13753 }
13754
13755 pub fn set_partition<T>(mut self, v: T) -> Self
13759 where
13760 T: std::convert::Into<crate::model::Partition>,
13761 {
13762 self.0.request.partition = std::option::Option::Some(v.into());
13763 self
13764 }
13765
13766 pub fn set_or_clear_partition<T>(mut self, v: std::option::Option<T>) -> Self
13770 where
13771 T: std::convert::Into<crate::model::Partition>,
13772 {
13773 self.0.request.partition = v.map(|x| x.into());
13774 self
13775 }
13776
13777 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13779 self.0.request.validate_only = v.into();
13780 self
13781 }
13782 }
13783
13784 #[doc(hidden)]
13785 impl crate::RequestBuilder for CreatePartition {
13786 fn request_options(&mut self) -> &mut crate::RequestOptions {
13787 &mut self.0.options
13788 }
13789 }
13790
13791 #[derive(Clone, Debug)]
13808 pub struct DeletePartition(RequestBuilder<crate::model::DeletePartitionRequest>);
13809
13810 impl DeletePartition {
13811 pub(crate) fn new(
13812 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13813 ) -> Self {
13814 Self(RequestBuilder::new(stub))
13815 }
13816
13817 pub fn with_request<V: Into<crate::model::DeletePartitionRequest>>(mut self, v: V) -> Self {
13819 self.0.request = v.into();
13820 self
13821 }
13822
13823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13825 self.0.options = v.into();
13826 self
13827 }
13828
13829 pub async fn send(self) -> Result<()> {
13831 (*self.0.stub)
13832 .delete_partition(self.0.request, self.0.options)
13833 .await
13834 .map(crate::Response::into_body)
13835 }
13836
13837 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13841 self.0.request.name = v.into();
13842 self
13843 }
13844
13845 #[deprecated]
13847 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
13848 self.0.request.etag = v.into();
13849 self
13850 }
13851 }
13852
13853 #[doc(hidden)]
13854 impl crate::RequestBuilder for DeletePartition {
13855 fn request_options(&mut self) -> &mut crate::RequestOptions {
13856 &mut self.0.options
13857 }
13858 }
13859
13860 #[derive(Clone, Debug)]
13877 pub struct GetPartition(RequestBuilder<crate::model::GetPartitionRequest>);
13878
13879 impl GetPartition {
13880 pub(crate) fn new(
13881 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13882 ) -> Self {
13883 Self(RequestBuilder::new(stub))
13884 }
13885
13886 pub fn with_request<V: Into<crate::model::GetPartitionRequest>>(mut self, v: V) -> Self {
13888 self.0.request = v.into();
13889 self
13890 }
13891
13892 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13894 self.0.options = v.into();
13895 self
13896 }
13897
13898 pub async fn send(self) -> Result<crate::model::Partition> {
13900 (*self.0.stub)
13901 .get_partition(self.0.request, self.0.options)
13902 .await
13903 .map(crate::Response::into_body)
13904 }
13905
13906 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13910 self.0.request.name = v.into();
13911 self
13912 }
13913 }
13914
13915 #[doc(hidden)]
13916 impl crate::RequestBuilder for GetPartition {
13917 fn request_options(&mut self) -> &mut crate::RequestOptions {
13918 &mut self.0.options
13919 }
13920 }
13921
13922 #[derive(Clone, Debug)]
13943 pub struct ListPartitions(RequestBuilder<crate::model::ListPartitionsRequest>);
13944
13945 impl ListPartitions {
13946 pub(crate) fn new(
13947 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13948 ) -> Self {
13949 Self(RequestBuilder::new(stub))
13950 }
13951
13952 pub fn with_request<V: Into<crate::model::ListPartitionsRequest>>(mut self, v: V) -> Self {
13954 self.0.request = v.into();
13955 self
13956 }
13957
13958 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13960 self.0.options = v.into();
13961 self
13962 }
13963
13964 pub async fn send(self) -> Result<crate::model::ListPartitionsResponse> {
13966 (*self.0.stub)
13967 .list_partitions(self.0.request, self.0.options)
13968 .await
13969 .map(crate::Response::into_body)
13970 }
13971
13972 pub fn by_page(
13974 self,
13975 ) -> impl google_cloud_gax::paginator::Paginator<
13976 crate::model::ListPartitionsResponse,
13977 crate::Error,
13978 > {
13979 use std::clone::Clone;
13980 let token = self.0.request.page_token.clone();
13981 let execute = move |token: String| {
13982 let mut builder = self.clone();
13983 builder.0.request = builder.0.request.set_page_token(token);
13984 builder.send()
13985 };
13986 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13987 }
13988
13989 pub fn by_item(
13991 self,
13992 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13993 crate::model::ListPartitionsResponse,
13994 crate::Error,
13995 > {
13996 use google_cloud_gax::paginator::Paginator;
13997 self.by_page().items()
13998 }
13999
14000 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14004 self.0.request.parent = v.into();
14005 self
14006 }
14007
14008 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14010 self.0.request.page_size = v.into();
14011 self
14012 }
14013
14014 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14016 self.0.request.page_token = v.into();
14017 self
14018 }
14019
14020 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14022 self.0.request.filter = v.into();
14023 self
14024 }
14025 }
14026
14027 #[doc(hidden)]
14028 impl crate::RequestBuilder for ListPartitions {
14029 fn request_options(&mut self) -> &mut crate::RequestOptions {
14030 &mut self.0.options
14031 }
14032 }
14033
14034 #[derive(Clone, Debug)]
14055 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
14056
14057 impl ListLocations {
14058 pub(crate) fn new(
14059 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14060 ) -> Self {
14061 Self(RequestBuilder::new(stub))
14062 }
14063
14064 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
14066 mut self,
14067 v: V,
14068 ) -> Self {
14069 self.0.request = v.into();
14070 self
14071 }
14072
14073 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14075 self.0.options = v.into();
14076 self
14077 }
14078
14079 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
14081 (*self.0.stub)
14082 .list_locations(self.0.request, self.0.options)
14083 .await
14084 .map(crate::Response::into_body)
14085 }
14086
14087 pub fn by_page(
14089 self,
14090 ) -> impl google_cloud_gax::paginator::Paginator<
14091 google_cloud_location::model::ListLocationsResponse,
14092 crate::Error,
14093 > {
14094 use std::clone::Clone;
14095 let token = self.0.request.page_token.clone();
14096 let execute = move |token: String| {
14097 let mut builder = self.clone();
14098 builder.0.request = builder.0.request.set_page_token(token);
14099 builder.send()
14100 };
14101 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14102 }
14103
14104 pub fn by_item(
14106 self,
14107 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14108 google_cloud_location::model::ListLocationsResponse,
14109 crate::Error,
14110 > {
14111 use google_cloud_gax::paginator::Paginator;
14112 self.by_page().items()
14113 }
14114
14115 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14117 self.0.request.name = v.into();
14118 self
14119 }
14120
14121 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14123 self.0.request.filter = v.into();
14124 self
14125 }
14126
14127 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14129 self.0.request.page_size = v.into();
14130 self
14131 }
14132
14133 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14135 self.0.request.page_token = v.into();
14136 self
14137 }
14138 }
14139
14140 #[doc(hidden)]
14141 impl crate::RequestBuilder for ListLocations {
14142 fn request_options(&mut self) -> &mut crate::RequestOptions {
14143 &mut self.0.options
14144 }
14145 }
14146
14147 #[derive(Clone, Debug)]
14164 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
14165
14166 impl GetLocation {
14167 pub(crate) fn new(
14168 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14169 ) -> Self {
14170 Self(RequestBuilder::new(stub))
14171 }
14172
14173 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
14175 mut self,
14176 v: V,
14177 ) -> Self {
14178 self.0.request = v.into();
14179 self
14180 }
14181
14182 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14184 self.0.options = v.into();
14185 self
14186 }
14187
14188 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
14190 (*self.0.stub)
14191 .get_location(self.0.request, self.0.options)
14192 .await
14193 .map(crate::Response::into_body)
14194 }
14195
14196 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14198 self.0.request.name = v.into();
14199 self
14200 }
14201 }
14202
14203 #[doc(hidden)]
14204 impl crate::RequestBuilder for GetLocation {
14205 fn request_options(&mut self) -> &mut crate::RequestOptions {
14206 &mut self.0.options
14207 }
14208 }
14209
14210 #[derive(Clone, Debug)]
14227 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
14228
14229 impl SetIamPolicy {
14230 pub(crate) fn new(
14231 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14232 ) -> Self {
14233 Self(RequestBuilder::new(stub))
14234 }
14235
14236 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
14238 mut self,
14239 v: V,
14240 ) -> Self {
14241 self.0.request = v.into();
14242 self
14243 }
14244
14245 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14247 self.0.options = v.into();
14248 self
14249 }
14250
14251 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
14253 (*self.0.stub)
14254 .set_iam_policy(self.0.request, self.0.options)
14255 .await
14256 .map(crate::Response::into_body)
14257 }
14258
14259 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14263 self.0.request.resource = v.into();
14264 self
14265 }
14266
14267 pub fn set_policy<T>(mut self, v: T) -> Self
14271 where
14272 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
14273 {
14274 self.0.request.policy = std::option::Option::Some(v.into());
14275 self
14276 }
14277
14278 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
14282 where
14283 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
14284 {
14285 self.0.request.policy = v.map(|x| x.into());
14286 self
14287 }
14288
14289 pub fn set_update_mask<T>(mut self, v: T) -> Self
14291 where
14292 T: std::convert::Into<wkt::FieldMask>,
14293 {
14294 self.0.request.update_mask = std::option::Option::Some(v.into());
14295 self
14296 }
14297
14298 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14300 where
14301 T: std::convert::Into<wkt::FieldMask>,
14302 {
14303 self.0.request.update_mask = v.map(|x| x.into());
14304 self
14305 }
14306 }
14307
14308 #[doc(hidden)]
14309 impl crate::RequestBuilder for SetIamPolicy {
14310 fn request_options(&mut self) -> &mut crate::RequestOptions {
14311 &mut self.0.options
14312 }
14313 }
14314
14315 #[derive(Clone, Debug)]
14332 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
14333
14334 impl GetIamPolicy {
14335 pub(crate) fn new(
14336 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14337 ) -> Self {
14338 Self(RequestBuilder::new(stub))
14339 }
14340
14341 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
14343 mut self,
14344 v: V,
14345 ) -> Self {
14346 self.0.request = v.into();
14347 self
14348 }
14349
14350 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14352 self.0.options = v.into();
14353 self
14354 }
14355
14356 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
14358 (*self.0.stub)
14359 .get_iam_policy(self.0.request, self.0.options)
14360 .await
14361 .map(crate::Response::into_body)
14362 }
14363
14364 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14368 self.0.request.resource = v.into();
14369 self
14370 }
14371
14372 pub fn set_options<T>(mut self, v: T) -> Self
14374 where
14375 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
14376 {
14377 self.0.request.options = std::option::Option::Some(v.into());
14378 self
14379 }
14380
14381 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
14383 where
14384 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
14385 {
14386 self.0.request.options = v.map(|x| x.into());
14387 self
14388 }
14389 }
14390
14391 #[doc(hidden)]
14392 impl crate::RequestBuilder for GetIamPolicy {
14393 fn request_options(&mut self) -> &mut crate::RequestOptions {
14394 &mut self.0.options
14395 }
14396 }
14397
14398 #[derive(Clone, Debug)]
14415 pub struct TestIamPermissions(
14416 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
14417 );
14418
14419 impl TestIamPermissions {
14420 pub(crate) fn new(
14421 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14422 ) -> Self {
14423 Self(RequestBuilder::new(stub))
14424 }
14425
14426 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
14428 mut self,
14429 v: V,
14430 ) -> Self {
14431 self.0.request = v.into();
14432 self
14433 }
14434
14435 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14437 self.0.options = v.into();
14438 self
14439 }
14440
14441 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
14443 (*self.0.stub)
14444 .test_iam_permissions(self.0.request, self.0.options)
14445 .await
14446 .map(crate::Response::into_body)
14447 }
14448
14449 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14453 self.0.request.resource = v.into();
14454 self
14455 }
14456
14457 pub fn set_permissions<T, V>(mut self, v: T) -> Self
14461 where
14462 T: std::iter::IntoIterator<Item = V>,
14463 V: std::convert::Into<std::string::String>,
14464 {
14465 use std::iter::Iterator;
14466 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
14467 self
14468 }
14469 }
14470
14471 #[doc(hidden)]
14472 impl crate::RequestBuilder for TestIamPermissions {
14473 fn request_options(&mut self) -> &mut crate::RequestOptions {
14474 &mut self.0.options
14475 }
14476 }
14477
14478 #[derive(Clone, Debug)]
14499 pub struct ListOperations(
14500 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
14501 );
14502
14503 impl ListOperations {
14504 pub(crate) fn new(
14505 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14506 ) -> Self {
14507 Self(RequestBuilder::new(stub))
14508 }
14509
14510 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
14512 mut self,
14513 v: V,
14514 ) -> Self {
14515 self.0.request = v.into();
14516 self
14517 }
14518
14519 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14521 self.0.options = v.into();
14522 self
14523 }
14524
14525 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
14527 (*self.0.stub)
14528 .list_operations(self.0.request, self.0.options)
14529 .await
14530 .map(crate::Response::into_body)
14531 }
14532
14533 pub fn by_page(
14535 self,
14536 ) -> impl google_cloud_gax::paginator::Paginator<
14537 google_cloud_longrunning::model::ListOperationsResponse,
14538 crate::Error,
14539 > {
14540 use std::clone::Clone;
14541 let token = self.0.request.page_token.clone();
14542 let execute = move |token: String| {
14543 let mut builder = self.clone();
14544 builder.0.request = builder.0.request.set_page_token(token);
14545 builder.send()
14546 };
14547 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14548 }
14549
14550 pub fn by_item(
14552 self,
14553 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14554 google_cloud_longrunning::model::ListOperationsResponse,
14555 crate::Error,
14556 > {
14557 use google_cloud_gax::paginator::Paginator;
14558 self.by_page().items()
14559 }
14560
14561 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14563 self.0.request.name = v.into();
14564 self
14565 }
14566
14567 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14569 self.0.request.filter = v.into();
14570 self
14571 }
14572
14573 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14575 self.0.request.page_size = v.into();
14576 self
14577 }
14578
14579 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14581 self.0.request.page_token = v.into();
14582 self
14583 }
14584
14585 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14587 self.0.request.return_partial_success = v.into();
14588 self
14589 }
14590 }
14591
14592 #[doc(hidden)]
14593 impl crate::RequestBuilder for ListOperations {
14594 fn request_options(&mut self) -> &mut crate::RequestOptions {
14595 &mut self.0.options
14596 }
14597 }
14598
14599 #[derive(Clone, Debug)]
14616 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14617
14618 impl GetOperation {
14619 pub(crate) fn new(
14620 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14621 ) -> Self {
14622 Self(RequestBuilder::new(stub))
14623 }
14624
14625 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14627 mut self,
14628 v: V,
14629 ) -> Self {
14630 self.0.request = v.into();
14631 self
14632 }
14633
14634 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14636 self.0.options = v.into();
14637 self
14638 }
14639
14640 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14642 (*self.0.stub)
14643 .get_operation(self.0.request, self.0.options)
14644 .await
14645 .map(crate::Response::into_body)
14646 }
14647
14648 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14650 self.0.request.name = v.into();
14651 self
14652 }
14653 }
14654
14655 #[doc(hidden)]
14656 impl crate::RequestBuilder for GetOperation {
14657 fn request_options(&mut self) -> &mut crate::RequestOptions {
14658 &mut self.0.options
14659 }
14660 }
14661
14662 #[derive(Clone, Debug)]
14679 pub struct DeleteOperation(
14680 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
14681 );
14682
14683 impl DeleteOperation {
14684 pub(crate) fn new(
14685 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14686 ) -> Self {
14687 Self(RequestBuilder::new(stub))
14688 }
14689
14690 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
14692 mut self,
14693 v: V,
14694 ) -> Self {
14695 self.0.request = v.into();
14696 self
14697 }
14698
14699 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14701 self.0.options = v.into();
14702 self
14703 }
14704
14705 pub async fn send(self) -> Result<()> {
14707 (*self.0.stub)
14708 .delete_operation(self.0.request, self.0.options)
14709 .await
14710 .map(crate::Response::into_body)
14711 }
14712
14713 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14715 self.0.request.name = v.into();
14716 self
14717 }
14718 }
14719
14720 #[doc(hidden)]
14721 impl crate::RequestBuilder for DeleteOperation {
14722 fn request_options(&mut self) -> &mut crate::RequestOptions {
14723 &mut self.0.options
14724 }
14725 }
14726
14727 #[derive(Clone, Debug)]
14744 pub struct CancelOperation(
14745 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14746 );
14747
14748 impl CancelOperation {
14749 pub(crate) fn new(
14750 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14751 ) -> Self {
14752 Self(RequestBuilder::new(stub))
14753 }
14754
14755 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14757 mut self,
14758 v: V,
14759 ) -> Self {
14760 self.0.request = v.into();
14761 self
14762 }
14763
14764 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14766 self.0.options = v.into();
14767 self
14768 }
14769
14770 pub async fn send(self) -> Result<()> {
14772 (*self.0.stub)
14773 .cancel_operation(self.0.request, self.0.options)
14774 .await
14775 .map(crate::Response::into_body)
14776 }
14777
14778 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14780 self.0.request.name = v.into();
14781 self
14782 }
14783 }
14784
14785 #[doc(hidden)]
14786 impl crate::RequestBuilder for CancelOperation {
14787 fn request_options(&mut self) -> &mut crate::RequestOptions {
14788 &mut self.0.options
14789 }
14790 }
14791}
14792
14793pub mod dataplex_service {
14794 use crate::Result;
14795
14796 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14810
14811 pub(crate) mod client {
14812 use super::super::super::client::DataplexService;
14813 pub struct Factory;
14814 impl crate::ClientFactory for Factory {
14815 type Client = DataplexService;
14816 type Credentials = gaxi::options::Credentials;
14817 async fn build(
14818 self,
14819 config: gaxi::options::ClientConfig,
14820 ) -> crate::ClientBuilderResult<Self::Client> {
14821 Self::Client::new(config).await
14822 }
14823 }
14824 }
14825
14826 #[derive(Clone, Debug)]
14828 pub(crate) struct RequestBuilder<R: std::default::Default> {
14829 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14830 request: R,
14831 options: crate::RequestOptions,
14832 }
14833
14834 impl<R> RequestBuilder<R>
14835 where
14836 R: std::default::Default,
14837 {
14838 pub(crate) fn new(
14839 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14840 ) -> Self {
14841 Self {
14842 stub,
14843 request: R::default(),
14844 options: crate::RequestOptions::default(),
14845 }
14846 }
14847 }
14848
14849 #[derive(Clone, Debug)]
14867 pub struct CreateLake(RequestBuilder<crate::model::CreateLakeRequest>);
14868
14869 impl CreateLake {
14870 pub(crate) fn new(
14871 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14872 ) -> Self {
14873 Self(RequestBuilder::new(stub))
14874 }
14875
14876 pub fn with_request<V: Into<crate::model::CreateLakeRequest>>(mut self, v: V) -> Self {
14878 self.0.request = v.into();
14879 self
14880 }
14881
14882 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14884 self.0.options = v.into();
14885 self
14886 }
14887
14888 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14895 (*self.0.stub)
14896 .create_lake(self.0.request, self.0.options)
14897 .await
14898 .map(crate::Response::into_body)
14899 }
14900
14901 pub fn poller(
14903 self,
14904 ) -> impl google_cloud_lro::Poller<crate::model::Lake, crate::model::OperationMetadata>
14905 {
14906 type Operation = google_cloud_lro::internal::Operation<
14907 crate::model::Lake,
14908 crate::model::OperationMetadata,
14909 >;
14910 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14911 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14912
14913 let stub = self.0.stub.clone();
14914 let mut options = self.0.options.clone();
14915 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
14916 let query = move |name| {
14917 let stub = stub.clone();
14918 let options = options.clone();
14919 async {
14920 let op = GetOperation::new(stub)
14921 .set_name(name)
14922 .with_options(options)
14923 .send()
14924 .await?;
14925 Ok(Operation::new(op))
14926 }
14927 };
14928
14929 let start = move || async {
14930 let op = self.send().await?;
14931 Ok(Operation::new(op))
14932 };
14933
14934 google_cloud_lro::internal::new_poller(
14935 polling_error_policy,
14936 polling_backoff_policy,
14937 start,
14938 query,
14939 )
14940 }
14941
14942 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14946 self.0.request.parent = v.into();
14947 self
14948 }
14949
14950 pub fn set_lake_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14954 self.0.request.lake_id = v.into();
14955 self
14956 }
14957
14958 pub fn set_lake<T>(mut self, v: T) -> Self
14962 where
14963 T: std::convert::Into<crate::model::Lake>,
14964 {
14965 self.0.request.lake = std::option::Option::Some(v.into());
14966 self
14967 }
14968
14969 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
14973 where
14974 T: std::convert::Into<crate::model::Lake>,
14975 {
14976 self.0.request.lake = v.map(|x| x.into());
14977 self
14978 }
14979
14980 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14982 self.0.request.validate_only = v.into();
14983 self
14984 }
14985 }
14986
14987 #[doc(hidden)]
14988 impl crate::RequestBuilder for CreateLake {
14989 fn request_options(&mut self) -> &mut crate::RequestOptions {
14990 &mut self.0.options
14991 }
14992 }
14993
14994 #[derive(Clone, Debug)]
15012 pub struct UpdateLake(RequestBuilder<crate::model::UpdateLakeRequest>);
15013
15014 impl UpdateLake {
15015 pub(crate) fn new(
15016 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15017 ) -> Self {
15018 Self(RequestBuilder::new(stub))
15019 }
15020
15021 pub fn with_request<V: Into<crate::model::UpdateLakeRequest>>(mut self, v: V) -> Self {
15023 self.0.request = v.into();
15024 self
15025 }
15026
15027 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15029 self.0.options = v.into();
15030 self
15031 }
15032
15033 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15040 (*self.0.stub)
15041 .update_lake(self.0.request, self.0.options)
15042 .await
15043 .map(crate::Response::into_body)
15044 }
15045
15046 pub fn poller(
15048 self,
15049 ) -> impl google_cloud_lro::Poller<crate::model::Lake, crate::model::OperationMetadata>
15050 {
15051 type Operation = google_cloud_lro::internal::Operation<
15052 crate::model::Lake,
15053 crate::model::OperationMetadata,
15054 >;
15055 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15056 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15057
15058 let stub = self.0.stub.clone();
15059 let mut options = self.0.options.clone();
15060 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15061 let query = move |name| {
15062 let stub = stub.clone();
15063 let options = options.clone();
15064 async {
15065 let op = GetOperation::new(stub)
15066 .set_name(name)
15067 .with_options(options)
15068 .send()
15069 .await?;
15070 Ok(Operation::new(op))
15071 }
15072 };
15073
15074 let start = move || async {
15075 let op = self.send().await?;
15076 Ok(Operation::new(op))
15077 };
15078
15079 google_cloud_lro::internal::new_poller(
15080 polling_error_policy,
15081 polling_backoff_policy,
15082 start,
15083 query,
15084 )
15085 }
15086
15087 pub fn set_update_mask<T>(mut self, v: T) -> Self
15091 where
15092 T: std::convert::Into<wkt::FieldMask>,
15093 {
15094 self.0.request.update_mask = std::option::Option::Some(v.into());
15095 self
15096 }
15097
15098 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15102 where
15103 T: std::convert::Into<wkt::FieldMask>,
15104 {
15105 self.0.request.update_mask = v.map(|x| x.into());
15106 self
15107 }
15108
15109 pub fn set_lake<T>(mut self, v: T) -> Self
15113 where
15114 T: std::convert::Into<crate::model::Lake>,
15115 {
15116 self.0.request.lake = std::option::Option::Some(v.into());
15117 self
15118 }
15119
15120 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
15124 where
15125 T: std::convert::Into<crate::model::Lake>,
15126 {
15127 self.0.request.lake = v.map(|x| x.into());
15128 self
15129 }
15130
15131 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15133 self.0.request.validate_only = v.into();
15134 self
15135 }
15136 }
15137
15138 #[doc(hidden)]
15139 impl crate::RequestBuilder for UpdateLake {
15140 fn request_options(&mut self) -> &mut crate::RequestOptions {
15141 &mut self.0.options
15142 }
15143 }
15144
15145 #[derive(Clone, Debug)]
15163 pub struct DeleteLake(RequestBuilder<crate::model::DeleteLakeRequest>);
15164
15165 impl DeleteLake {
15166 pub(crate) fn new(
15167 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15168 ) -> Self {
15169 Self(RequestBuilder::new(stub))
15170 }
15171
15172 pub fn with_request<V: Into<crate::model::DeleteLakeRequest>>(mut self, v: V) -> Self {
15174 self.0.request = v.into();
15175 self
15176 }
15177
15178 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15180 self.0.options = v.into();
15181 self
15182 }
15183
15184 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15191 (*self.0.stub)
15192 .delete_lake(self.0.request, self.0.options)
15193 .await
15194 .map(crate::Response::into_body)
15195 }
15196
15197 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15199 type Operation =
15200 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15201 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15202 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15203
15204 let stub = self.0.stub.clone();
15205 let mut options = self.0.options.clone();
15206 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15207 let query = move |name| {
15208 let stub = stub.clone();
15209 let options = options.clone();
15210 async {
15211 let op = GetOperation::new(stub)
15212 .set_name(name)
15213 .with_options(options)
15214 .send()
15215 .await?;
15216 Ok(Operation::new(op))
15217 }
15218 };
15219
15220 let start = move || async {
15221 let op = self.send().await?;
15222 Ok(Operation::new(op))
15223 };
15224
15225 google_cloud_lro::internal::new_unit_response_poller(
15226 polling_error_policy,
15227 polling_backoff_policy,
15228 start,
15229 query,
15230 )
15231 }
15232
15233 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15237 self.0.request.name = v.into();
15238 self
15239 }
15240 }
15241
15242 #[doc(hidden)]
15243 impl crate::RequestBuilder for DeleteLake {
15244 fn request_options(&mut self) -> &mut crate::RequestOptions {
15245 &mut self.0.options
15246 }
15247 }
15248
15249 #[derive(Clone, Debug)]
15270 pub struct ListLakes(RequestBuilder<crate::model::ListLakesRequest>);
15271
15272 impl ListLakes {
15273 pub(crate) fn new(
15274 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15275 ) -> Self {
15276 Self(RequestBuilder::new(stub))
15277 }
15278
15279 pub fn with_request<V: Into<crate::model::ListLakesRequest>>(mut self, v: V) -> Self {
15281 self.0.request = v.into();
15282 self
15283 }
15284
15285 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15287 self.0.options = v.into();
15288 self
15289 }
15290
15291 pub async fn send(self) -> Result<crate::model::ListLakesResponse> {
15293 (*self.0.stub)
15294 .list_lakes(self.0.request, self.0.options)
15295 .await
15296 .map(crate::Response::into_body)
15297 }
15298
15299 pub fn by_page(
15301 self,
15302 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListLakesResponse, crate::Error>
15303 {
15304 use std::clone::Clone;
15305 let token = self.0.request.page_token.clone();
15306 let execute = move |token: String| {
15307 let mut builder = self.clone();
15308 builder.0.request = builder.0.request.set_page_token(token);
15309 builder.send()
15310 };
15311 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15312 }
15313
15314 pub fn by_item(
15316 self,
15317 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListLakesResponse, crate::Error>
15318 {
15319 use google_cloud_gax::paginator::Paginator;
15320 self.by_page().items()
15321 }
15322
15323 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15327 self.0.request.parent = v.into();
15328 self
15329 }
15330
15331 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15333 self.0.request.page_size = v.into();
15334 self
15335 }
15336
15337 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15339 self.0.request.page_token = v.into();
15340 self
15341 }
15342
15343 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15345 self.0.request.filter = v.into();
15346 self
15347 }
15348
15349 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
15351 self.0.request.order_by = v.into();
15352 self
15353 }
15354 }
15355
15356 #[doc(hidden)]
15357 impl crate::RequestBuilder for ListLakes {
15358 fn request_options(&mut self) -> &mut crate::RequestOptions {
15359 &mut self.0.options
15360 }
15361 }
15362
15363 #[derive(Clone, Debug)]
15380 pub struct GetLake(RequestBuilder<crate::model::GetLakeRequest>);
15381
15382 impl GetLake {
15383 pub(crate) fn new(
15384 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15385 ) -> Self {
15386 Self(RequestBuilder::new(stub))
15387 }
15388
15389 pub fn with_request<V: Into<crate::model::GetLakeRequest>>(mut self, v: V) -> Self {
15391 self.0.request = v.into();
15392 self
15393 }
15394
15395 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15397 self.0.options = v.into();
15398 self
15399 }
15400
15401 pub async fn send(self) -> Result<crate::model::Lake> {
15403 (*self.0.stub)
15404 .get_lake(self.0.request, self.0.options)
15405 .await
15406 .map(crate::Response::into_body)
15407 }
15408
15409 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15413 self.0.request.name = v.into();
15414 self
15415 }
15416 }
15417
15418 #[doc(hidden)]
15419 impl crate::RequestBuilder for GetLake {
15420 fn request_options(&mut self) -> &mut crate::RequestOptions {
15421 &mut self.0.options
15422 }
15423 }
15424
15425 #[derive(Clone, Debug)]
15446 pub struct ListLakeActions(RequestBuilder<crate::model::ListLakeActionsRequest>);
15447
15448 impl ListLakeActions {
15449 pub(crate) fn new(
15450 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15451 ) -> Self {
15452 Self(RequestBuilder::new(stub))
15453 }
15454
15455 pub fn with_request<V: Into<crate::model::ListLakeActionsRequest>>(mut self, v: V) -> Self {
15457 self.0.request = v.into();
15458 self
15459 }
15460
15461 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15463 self.0.options = v.into();
15464 self
15465 }
15466
15467 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
15469 (*self.0.stub)
15470 .list_lake_actions(self.0.request, self.0.options)
15471 .await
15472 .map(crate::Response::into_body)
15473 }
15474
15475 pub fn by_page(
15477 self,
15478 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
15479 {
15480 use std::clone::Clone;
15481 let token = self.0.request.page_token.clone();
15482 let execute = move |token: String| {
15483 let mut builder = self.clone();
15484 builder.0.request = builder.0.request.set_page_token(token);
15485 builder.send()
15486 };
15487 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15488 }
15489
15490 pub fn by_item(
15492 self,
15493 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15494 crate::model::ListActionsResponse,
15495 crate::Error,
15496 > {
15497 use google_cloud_gax::paginator::Paginator;
15498 self.by_page().items()
15499 }
15500
15501 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15505 self.0.request.parent = v.into();
15506 self
15507 }
15508
15509 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15511 self.0.request.page_size = v.into();
15512 self
15513 }
15514
15515 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15517 self.0.request.page_token = v.into();
15518 self
15519 }
15520 }
15521
15522 #[doc(hidden)]
15523 impl crate::RequestBuilder for ListLakeActions {
15524 fn request_options(&mut self) -> &mut crate::RequestOptions {
15525 &mut self.0.options
15526 }
15527 }
15528
15529 #[derive(Clone, Debug)]
15547 pub struct CreateZone(RequestBuilder<crate::model::CreateZoneRequest>);
15548
15549 impl CreateZone {
15550 pub(crate) fn new(
15551 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15552 ) -> Self {
15553 Self(RequestBuilder::new(stub))
15554 }
15555
15556 pub fn with_request<V: Into<crate::model::CreateZoneRequest>>(mut self, v: V) -> Self {
15558 self.0.request = v.into();
15559 self
15560 }
15561
15562 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15564 self.0.options = v.into();
15565 self
15566 }
15567
15568 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15575 (*self.0.stub)
15576 .create_zone(self.0.request, self.0.options)
15577 .await
15578 .map(crate::Response::into_body)
15579 }
15580
15581 pub fn poller(
15583 self,
15584 ) -> impl google_cloud_lro::Poller<crate::model::Zone, crate::model::OperationMetadata>
15585 {
15586 type Operation = google_cloud_lro::internal::Operation<
15587 crate::model::Zone,
15588 crate::model::OperationMetadata,
15589 >;
15590 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15591 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15592
15593 let stub = self.0.stub.clone();
15594 let mut options = self.0.options.clone();
15595 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15596 let query = move |name| {
15597 let stub = stub.clone();
15598 let options = options.clone();
15599 async {
15600 let op = GetOperation::new(stub)
15601 .set_name(name)
15602 .with_options(options)
15603 .send()
15604 .await?;
15605 Ok(Operation::new(op))
15606 }
15607 };
15608
15609 let start = move || async {
15610 let op = self.send().await?;
15611 Ok(Operation::new(op))
15612 };
15613
15614 google_cloud_lro::internal::new_poller(
15615 polling_error_policy,
15616 polling_backoff_policy,
15617 start,
15618 query,
15619 )
15620 }
15621
15622 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15626 self.0.request.parent = v.into();
15627 self
15628 }
15629
15630 pub fn set_zone_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15634 self.0.request.zone_id = v.into();
15635 self
15636 }
15637
15638 pub fn set_zone<T>(mut self, v: T) -> Self
15642 where
15643 T: std::convert::Into<crate::model::Zone>,
15644 {
15645 self.0.request.zone = std::option::Option::Some(v.into());
15646 self
15647 }
15648
15649 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
15653 where
15654 T: std::convert::Into<crate::model::Zone>,
15655 {
15656 self.0.request.zone = v.map(|x| x.into());
15657 self
15658 }
15659
15660 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15662 self.0.request.validate_only = v.into();
15663 self
15664 }
15665 }
15666
15667 #[doc(hidden)]
15668 impl crate::RequestBuilder for CreateZone {
15669 fn request_options(&mut self) -> &mut crate::RequestOptions {
15670 &mut self.0.options
15671 }
15672 }
15673
15674 #[derive(Clone, Debug)]
15692 pub struct UpdateZone(RequestBuilder<crate::model::UpdateZoneRequest>);
15693
15694 impl UpdateZone {
15695 pub(crate) fn new(
15696 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15697 ) -> Self {
15698 Self(RequestBuilder::new(stub))
15699 }
15700
15701 pub fn with_request<V: Into<crate::model::UpdateZoneRequest>>(mut self, v: V) -> Self {
15703 self.0.request = v.into();
15704 self
15705 }
15706
15707 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15709 self.0.options = v.into();
15710 self
15711 }
15712
15713 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15720 (*self.0.stub)
15721 .update_zone(self.0.request, self.0.options)
15722 .await
15723 .map(crate::Response::into_body)
15724 }
15725
15726 pub fn poller(
15728 self,
15729 ) -> impl google_cloud_lro::Poller<crate::model::Zone, crate::model::OperationMetadata>
15730 {
15731 type Operation = google_cloud_lro::internal::Operation<
15732 crate::model::Zone,
15733 crate::model::OperationMetadata,
15734 >;
15735 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15736 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15737
15738 let stub = self.0.stub.clone();
15739 let mut options = self.0.options.clone();
15740 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15741 let query = move |name| {
15742 let stub = stub.clone();
15743 let options = options.clone();
15744 async {
15745 let op = GetOperation::new(stub)
15746 .set_name(name)
15747 .with_options(options)
15748 .send()
15749 .await?;
15750 Ok(Operation::new(op))
15751 }
15752 };
15753
15754 let start = move || async {
15755 let op = self.send().await?;
15756 Ok(Operation::new(op))
15757 };
15758
15759 google_cloud_lro::internal::new_poller(
15760 polling_error_policy,
15761 polling_backoff_policy,
15762 start,
15763 query,
15764 )
15765 }
15766
15767 pub fn set_update_mask<T>(mut self, v: T) -> Self
15771 where
15772 T: std::convert::Into<wkt::FieldMask>,
15773 {
15774 self.0.request.update_mask = std::option::Option::Some(v.into());
15775 self
15776 }
15777
15778 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15782 where
15783 T: std::convert::Into<wkt::FieldMask>,
15784 {
15785 self.0.request.update_mask = v.map(|x| x.into());
15786 self
15787 }
15788
15789 pub fn set_zone<T>(mut self, v: T) -> Self
15793 where
15794 T: std::convert::Into<crate::model::Zone>,
15795 {
15796 self.0.request.zone = std::option::Option::Some(v.into());
15797 self
15798 }
15799
15800 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
15804 where
15805 T: std::convert::Into<crate::model::Zone>,
15806 {
15807 self.0.request.zone = v.map(|x| x.into());
15808 self
15809 }
15810
15811 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15813 self.0.request.validate_only = v.into();
15814 self
15815 }
15816 }
15817
15818 #[doc(hidden)]
15819 impl crate::RequestBuilder for UpdateZone {
15820 fn request_options(&mut self) -> &mut crate::RequestOptions {
15821 &mut self.0.options
15822 }
15823 }
15824
15825 #[derive(Clone, Debug)]
15843 pub struct DeleteZone(RequestBuilder<crate::model::DeleteZoneRequest>);
15844
15845 impl DeleteZone {
15846 pub(crate) fn new(
15847 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15848 ) -> Self {
15849 Self(RequestBuilder::new(stub))
15850 }
15851
15852 pub fn with_request<V: Into<crate::model::DeleteZoneRequest>>(mut self, v: V) -> Self {
15854 self.0.request = v.into();
15855 self
15856 }
15857
15858 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15860 self.0.options = v.into();
15861 self
15862 }
15863
15864 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15871 (*self.0.stub)
15872 .delete_zone(self.0.request, self.0.options)
15873 .await
15874 .map(crate::Response::into_body)
15875 }
15876
15877 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
15879 type Operation =
15880 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15881 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15882 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15883
15884 let stub = self.0.stub.clone();
15885 let mut options = self.0.options.clone();
15886 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15887 let query = move |name| {
15888 let stub = stub.clone();
15889 let options = options.clone();
15890 async {
15891 let op = GetOperation::new(stub)
15892 .set_name(name)
15893 .with_options(options)
15894 .send()
15895 .await?;
15896 Ok(Operation::new(op))
15897 }
15898 };
15899
15900 let start = move || async {
15901 let op = self.send().await?;
15902 Ok(Operation::new(op))
15903 };
15904
15905 google_cloud_lro::internal::new_unit_response_poller(
15906 polling_error_policy,
15907 polling_backoff_policy,
15908 start,
15909 query,
15910 )
15911 }
15912
15913 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15917 self.0.request.name = v.into();
15918 self
15919 }
15920 }
15921
15922 #[doc(hidden)]
15923 impl crate::RequestBuilder for DeleteZone {
15924 fn request_options(&mut self) -> &mut crate::RequestOptions {
15925 &mut self.0.options
15926 }
15927 }
15928
15929 #[derive(Clone, Debug)]
15950 pub struct ListZones(RequestBuilder<crate::model::ListZonesRequest>);
15951
15952 impl ListZones {
15953 pub(crate) fn new(
15954 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15955 ) -> Self {
15956 Self(RequestBuilder::new(stub))
15957 }
15958
15959 pub fn with_request<V: Into<crate::model::ListZonesRequest>>(mut self, v: V) -> Self {
15961 self.0.request = v.into();
15962 self
15963 }
15964
15965 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15967 self.0.options = v.into();
15968 self
15969 }
15970
15971 pub async fn send(self) -> Result<crate::model::ListZonesResponse> {
15973 (*self.0.stub)
15974 .list_zones(self.0.request, self.0.options)
15975 .await
15976 .map(crate::Response::into_body)
15977 }
15978
15979 pub fn by_page(
15981 self,
15982 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListZonesResponse, crate::Error>
15983 {
15984 use std::clone::Clone;
15985 let token = self.0.request.page_token.clone();
15986 let execute = move |token: String| {
15987 let mut builder = self.clone();
15988 builder.0.request = builder.0.request.set_page_token(token);
15989 builder.send()
15990 };
15991 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15992 }
15993
15994 pub fn by_item(
15996 self,
15997 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListZonesResponse, crate::Error>
15998 {
15999 use google_cloud_gax::paginator::Paginator;
16000 self.by_page().items()
16001 }
16002
16003 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16007 self.0.request.parent = v.into();
16008 self
16009 }
16010
16011 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16013 self.0.request.page_size = v.into();
16014 self
16015 }
16016
16017 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16019 self.0.request.page_token = v.into();
16020 self
16021 }
16022
16023 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16025 self.0.request.filter = v.into();
16026 self
16027 }
16028
16029 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
16031 self.0.request.order_by = v.into();
16032 self
16033 }
16034 }
16035
16036 #[doc(hidden)]
16037 impl crate::RequestBuilder for ListZones {
16038 fn request_options(&mut self) -> &mut crate::RequestOptions {
16039 &mut self.0.options
16040 }
16041 }
16042
16043 #[derive(Clone, Debug)]
16060 pub struct GetZone(RequestBuilder<crate::model::GetZoneRequest>);
16061
16062 impl GetZone {
16063 pub(crate) fn new(
16064 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16065 ) -> Self {
16066 Self(RequestBuilder::new(stub))
16067 }
16068
16069 pub fn with_request<V: Into<crate::model::GetZoneRequest>>(mut self, v: V) -> Self {
16071 self.0.request = v.into();
16072 self
16073 }
16074
16075 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16077 self.0.options = v.into();
16078 self
16079 }
16080
16081 pub async fn send(self) -> Result<crate::model::Zone> {
16083 (*self.0.stub)
16084 .get_zone(self.0.request, self.0.options)
16085 .await
16086 .map(crate::Response::into_body)
16087 }
16088
16089 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16093 self.0.request.name = v.into();
16094 self
16095 }
16096 }
16097
16098 #[doc(hidden)]
16099 impl crate::RequestBuilder for GetZone {
16100 fn request_options(&mut self) -> &mut crate::RequestOptions {
16101 &mut self.0.options
16102 }
16103 }
16104
16105 #[derive(Clone, Debug)]
16126 pub struct ListZoneActions(RequestBuilder<crate::model::ListZoneActionsRequest>);
16127
16128 impl ListZoneActions {
16129 pub(crate) fn new(
16130 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16131 ) -> Self {
16132 Self(RequestBuilder::new(stub))
16133 }
16134
16135 pub fn with_request<V: Into<crate::model::ListZoneActionsRequest>>(mut self, v: V) -> Self {
16137 self.0.request = v.into();
16138 self
16139 }
16140
16141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16143 self.0.options = v.into();
16144 self
16145 }
16146
16147 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
16149 (*self.0.stub)
16150 .list_zone_actions(self.0.request, self.0.options)
16151 .await
16152 .map(crate::Response::into_body)
16153 }
16154
16155 pub fn by_page(
16157 self,
16158 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
16159 {
16160 use std::clone::Clone;
16161 let token = self.0.request.page_token.clone();
16162 let execute = move |token: String| {
16163 let mut builder = self.clone();
16164 builder.0.request = builder.0.request.set_page_token(token);
16165 builder.send()
16166 };
16167 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16168 }
16169
16170 pub fn by_item(
16172 self,
16173 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16174 crate::model::ListActionsResponse,
16175 crate::Error,
16176 > {
16177 use google_cloud_gax::paginator::Paginator;
16178 self.by_page().items()
16179 }
16180
16181 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16185 self.0.request.parent = v.into();
16186 self
16187 }
16188
16189 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16191 self.0.request.page_size = v.into();
16192 self
16193 }
16194
16195 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16197 self.0.request.page_token = v.into();
16198 self
16199 }
16200 }
16201
16202 #[doc(hidden)]
16203 impl crate::RequestBuilder for ListZoneActions {
16204 fn request_options(&mut self) -> &mut crate::RequestOptions {
16205 &mut self.0.options
16206 }
16207 }
16208
16209 #[derive(Clone, Debug)]
16227 pub struct CreateAsset(RequestBuilder<crate::model::CreateAssetRequest>);
16228
16229 impl CreateAsset {
16230 pub(crate) fn new(
16231 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16232 ) -> Self {
16233 Self(RequestBuilder::new(stub))
16234 }
16235
16236 pub fn with_request<V: Into<crate::model::CreateAssetRequest>>(mut self, v: V) -> Self {
16238 self.0.request = v.into();
16239 self
16240 }
16241
16242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16244 self.0.options = v.into();
16245 self
16246 }
16247
16248 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16255 (*self.0.stub)
16256 .create_asset(self.0.request, self.0.options)
16257 .await
16258 .map(crate::Response::into_body)
16259 }
16260
16261 pub fn poller(
16263 self,
16264 ) -> impl google_cloud_lro::Poller<crate::model::Asset, crate::model::OperationMetadata>
16265 {
16266 type Operation = google_cloud_lro::internal::Operation<
16267 crate::model::Asset,
16268 crate::model::OperationMetadata,
16269 >;
16270 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16271 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16272
16273 let stub = self.0.stub.clone();
16274 let mut options = self.0.options.clone();
16275 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16276 let query = move |name| {
16277 let stub = stub.clone();
16278 let options = options.clone();
16279 async {
16280 let op = GetOperation::new(stub)
16281 .set_name(name)
16282 .with_options(options)
16283 .send()
16284 .await?;
16285 Ok(Operation::new(op))
16286 }
16287 };
16288
16289 let start = move || async {
16290 let op = self.send().await?;
16291 Ok(Operation::new(op))
16292 };
16293
16294 google_cloud_lro::internal::new_poller(
16295 polling_error_policy,
16296 polling_backoff_policy,
16297 start,
16298 query,
16299 )
16300 }
16301
16302 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16306 self.0.request.parent = v.into();
16307 self
16308 }
16309
16310 pub fn set_asset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
16314 self.0.request.asset_id = v.into();
16315 self
16316 }
16317
16318 pub fn set_asset<T>(mut self, v: T) -> Self
16322 where
16323 T: std::convert::Into<crate::model::Asset>,
16324 {
16325 self.0.request.asset = std::option::Option::Some(v.into());
16326 self
16327 }
16328
16329 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
16333 where
16334 T: std::convert::Into<crate::model::Asset>,
16335 {
16336 self.0.request.asset = v.map(|x| x.into());
16337 self
16338 }
16339
16340 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16342 self.0.request.validate_only = v.into();
16343 self
16344 }
16345 }
16346
16347 #[doc(hidden)]
16348 impl crate::RequestBuilder for CreateAsset {
16349 fn request_options(&mut self) -> &mut crate::RequestOptions {
16350 &mut self.0.options
16351 }
16352 }
16353
16354 #[derive(Clone, Debug)]
16372 pub struct UpdateAsset(RequestBuilder<crate::model::UpdateAssetRequest>);
16373
16374 impl UpdateAsset {
16375 pub(crate) fn new(
16376 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16377 ) -> Self {
16378 Self(RequestBuilder::new(stub))
16379 }
16380
16381 pub fn with_request<V: Into<crate::model::UpdateAssetRequest>>(mut self, v: V) -> Self {
16383 self.0.request = v.into();
16384 self
16385 }
16386
16387 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16389 self.0.options = v.into();
16390 self
16391 }
16392
16393 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16400 (*self.0.stub)
16401 .update_asset(self.0.request, self.0.options)
16402 .await
16403 .map(crate::Response::into_body)
16404 }
16405
16406 pub fn poller(
16408 self,
16409 ) -> impl google_cloud_lro::Poller<crate::model::Asset, crate::model::OperationMetadata>
16410 {
16411 type Operation = google_cloud_lro::internal::Operation<
16412 crate::model::Asset,
16413 crate::model::OperationMetadata,
16414 >;
16415 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16416 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16417
16418 let stub = self.0.stub.clone();
16419 let mut options = self.0.options.clone();
16420 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16421 let query = move |name| {
16422 let stub = stub.clone();
16423 let options = options.clone();
16424 async {
16425 let op = GetOperation::new(stub)
16426 .set_name(name)
16427 .with_options(options)
16428 .send()
16429 .await?;
16430 Ok(Operation::new(op))
16431 }
16432 };
16433
16434 let start = move || async {
16435 let op = self.send().await?;
16436 Ok(Operation::new(op))
16437 };
16438
16439 google_cloud_lro::internal::new_poller(
16440 polling_error_policy,
16441 polling_backoff_policy,
16442 start,
16443 query,
16444 )
16445 }
16446
16447 pub fn set_update_mask<T>(mut self, v: T) -> Self
16451 where
16452 T: std::convert::Into<wkt::FieldMask>,
16453 {
16454 self.0.request.update_mask = std::option::Option::Some(v.into());
16455 self
16456 }
16457
16458 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16462 where
16463 T: std::convert::Into<wkt::FieldMask>,
16464 {
16465 self.0.request.update_mask = v.map(|x| x.into());
16466 self
16467 }
16468
16469 pub fn set_asset<T>(mut self, v: T) -> Self
16473 where
16474 T: std::convert::Into<crate::model::Asset>,
16475 {
16476 self.0.request.asset = std::option::Option::Some(v.into());
16477 self
16478 }
16479
16480 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
16484 where
16485 T: std::convert::Into<crate::model::Asset>,
16486 {
16487 self.0.request.asset = v.map(|x| x.into());
16488 self
16489 }
16490
16491 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16493 self.0.request.validate_only = v.into();
16494 self
16495 }
16496 }
16497
16498 #[doc(hidden)]
16499 impl crate::RequestBuilder for UpdateAsset {
16500 fn request_options(&mut self) -> &mut crate::RequestOptions {
16501 &mut self.0.options
16502 }
16503 }
16504
16505 #[derive(Clone, Debug)]
16523 pub struct DeleteAsset(RequestBuilder<crate::model::DeleteAssetRequest>);
16524
16525 impl DeleteAsset {
16526 pub(crate) fn new(
16527 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16528 ) -> Self {
16529 Self(RequestBuilder::new(stub))
16530 }
16531
16532 pub fn with_request<V: Into<crate::model::DeleteAssetRequest>>(mut self, v: V) -> Self {
16534 self.0.request = v.into();
16535 self
16536 }
16537
16538 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16540 self.0.options = v.into();
16541 self
16542 }
16543
16544 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16551 (*self.0.stub)
16552 .delete_asset(self.0.request, self.0.options)
16553 .await
16554 .map(crate::Response::into_body)
16555 }
16556
16557 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
16559 type Operation =
16560 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16561 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16562 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16563
16564 let stub = self.0.stub.clone();
16565 let mut options = self.0.options.clone();
16566 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16567 let query = move |name| {
16568 let stub = stub.clone();
16569 let options = options.clone();
16570 async {
16571 let op = GetOperation::new(stub)
16572 .set_name(name)
16573 .with_options(options)
16574 .send()
16575 .await?;
16576 Ok(Operation::new(op))
16577 }
16578 };
16579
16580 let start = move || async {
16581 let op = self.send().await?;
16582 Ok(Operation::new(op))
16583 };
16584
16585 google_cloud_lro::internal::new_unit_response_poller(
16586 polling_error_policy,
16587 polling_backoff_policy,
16588 start,
16589 query,
16590 )
16591 }
16592
16593 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16597 self.0.request.name = v.into();
16598 self
16599 }
16600 }
16601
16602 #[doc(hidden)]
16603 impl crate::RequestBuilder for DeleteAsset {
16604 fn request_options(&mut self) -> &mut crate::RequestOptions {
16605 &mut self.0.options
16606 }
16607 }
16608
16609 #[derive(Clone, Debug)]
16630 pub struct ListAssets(RequestBuilder<crate::model::ListAssetsRequest>);
16631
16632 impl ListAssets {
16633 pub(crate) fn new(
16634 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16635 ) -> Self {
16636 Self(RequestBuilder::new(stub))
16637 }
16638
16639 pub fn with_request<V: Into<crate::model::ListAssetsRequest>>(mut self, v: V) -> Self {
16641 self.0.request = v.into();
16642 self
16643 }
16644
16645 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16647 self.0.options = v.into();
16648 self
16649 }
16650
16651 pub async fn send(self) -> Result<crate::model::ListAssetsResponse> {
16653 (*self.0.stub)
16654 .list_assets(self.0.request, self.0.options)
16655 .await
16656 .map(crate::Response::into_body)
16657 }
16658
16659 pub fn by_page(
16661 self,
16662 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListAssetsResponse, crate::Error>
16663 {
16664 use std::clone::Clone;
16665 let token = self.0.request.page_token.clone();
16666 let execute = move |token: String| {
16667 let mut builder = self.clone();
16668 builder.0.request = builder.0.request.set_page_token(token);
16669 builder.send()
16670 };
16671 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16672 }
16673
16674 pub fn by_item(
16676 self,
16677 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16678 crate::model::ListAssetsResponse,
16679 crate::Error,
16680 > {
16681 use google_cloud_gax::paginator::Paginator;
16682 self.by_page().items()
16683 }
16684
16685 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16689 self.0.request.parent = v.into();
16690 self
16691 }
16692
16693 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16695 self.0.request.page_size = v.into();
16696 self
16697 }
16698
16699 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16701 self.0.request.page_token = v.into();
16702 self
16703 }
16704
16705 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16707 self.0.request.filter = v.into();
16708 self
16709 }
16710
16711 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
16713 self.0.request.order_by = v.into();
16714 self
16715 }
16716 }
16717
16718 #[doc(hidden)]
16719 impl crate::RequestBuilder for ListAssets {
16720 fn request_options(&mut self) -> &mut crate::RequestOptions {
16721 &mut self.0.options
16722 }
16723 }
16724
16725 #[derive(Clone, Debug)]
16742 pub struct GetAsset(RequestBuilder<crate::model::GetAssetRequest>);
16743
16744 impl GetAsset {
16745 pub(crate) fn new(
16746 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16747 ) -> Self {
16748 Self(RequestBuilder::new(stub))
16749 }
16750
16751 pub fn with_request<V: Into<crate::model::GetAssetRequest>>(mut self, v: V) -> Self {
16753 self.0.request = v.into();
16754 self
16755 }
16756
16757 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16759 self.0.options = v.into();
16760 self
16761 }
16762
16763 pub async fn send(self) -> Result<crate::model::Asset> {
16765 (*self.0.stub)
16766 .get_asset(self.0.request, self.0.options)
16767 .await
16768 .map(crate::Response::into_body)
16769 }
16770
16771 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16775 self.0.request.name = v.into();
16776 self
16777 }
16778 }
16779
16780 #[doc(hidden)]
16781 impl crate::RequestBuilder for GetAsset {
16782 fn request_options(&mut self) -> &mut crate::RequestOptions {
16783 &mut self.0.options
16784 }
16785 }
16786
16787 #[derive(Clone, Debug)]
16808 pub struct ListAssetActions(RequestBuilder<crate::model::ListAssetActionsRequest>);
16809
16810 impl ListAssetActions {
16811 pub(crate) fn new(
16812 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16813 ) -> Self {
16814 Self(RequestBuilder::new(stub))
16815 }
16816
16817 pub fn with_request<V: Into<crate::model::ListAssetActionsRequest>>(
16819 mut self,
16820 v: V,
16821 ) -> Self {
16822 self.0.request = v.into();
16823 self
16824 }
16825
16826 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16828 self.0.options = v.into();
16829 self
16830 }
16831
16832 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
16834 (*self.0.stub)
16835 .list_asset_actions(self.0.request, self.0.options)
16836 .await
16837 .map(crate::Response::into_body)
16838 }
16839
16840 pub fn by_page(
16842 self,
16843 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListActionsResponse, crate::Error>
16844 {
16845 use std::clone::Clone;
16846 let token = self.0.request.page_token.clone();
16847 let execute = move |token: String| {
16848 let mut builder = self.clone();
16849 builder.0.request = builder.0.request.set_page_token(token);
16850 builder.send()
16851 };
16852 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16853 }
16854
16855 pub fn by_item(
16857 self,
16858 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16859 crate::model::ListActionsResponse,
16860 crate::Error,
16861 > {
16862 use google_cloud_gax::paginator::Paginator;
16863 self.by_page().items()
16864 }
16865
16866 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16870 self.0.request.parent = v.into();
16871 self
16872 }
16873
16874 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16876 self.0.request.page_size = v.into();
16877 self
16878 }
16879
16880 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16882 self.0.request.page_token = v.into();
16883 self
16884 }
16885 }
16886
16887 #[doc(hidden)]
16888 impl crate::RequestBuilder for ListAssetActions {
16889 fn request_options(&mut self) -> &mut crate::RequestOptions {
16890 &mut self.0.options
16891 }
16892 }
16893
16894 #[derive(Clone, Debug)]
16912 pub struct CreateTask(RequestBuilder<crate::model::CreateTaskRequest>);
16913
16914 impl CreateTask {
16915 pub(crate) fn new(
16916 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16917 ) -> Self {
16918 Self(RequestBuilder::new(stub))
16919 }
16920
16921 pub fn with_request<V: Into<crate::model::CreateTaskRequest>>(mut self, v: V) -> Self {
16923 self.0.request = v.into();
16924 self
16925 }
16926
16927 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16929 self.0.options = v.into();
16930 self
16931 }
16932
16933 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16940 (*self.0.stub)
16941 .create_task(self.0.request, self.0.options)
16942 .await
16943 .map(crate::Response::into_body)
16944 }
16945
16946 pub fn poller(
16948 self,
16949 ) -> impl google_cloud_lro::Poller<crate::model::Task, crate::model::OperationMetadata>
16950 {
16951 type Operation = google_cloud_lro::internal::Operation<
16952 crate::model::Task,
16953 crate::model::OperationMetadata,
16954 >;
16955 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16956 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16957
16958 let stub = self.0.stub.clone();
16959 let mut options = self.0.options.clone();
16960 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16961 let query = move |name| {
16962 let stub = stub.clone();
16963 let options = options.clone();
16964 async {
16965 let op = GetOperation::new(stub)
16966 .set_name(name)
16967 .with_options(options)
16968 .send()
16969 .await?;
16970 Ok(Operation::new(op))
16971 }
16972 };
16973
16974 let start = move || async {
16975 let op = self.send().await?;
16976 Ok(Operation::new(op))
16977 };
16978
16979 google_cloud_lro::internal::new_poller(
16980 polling_error_policy,
16981 polling_backoff_policy,
16982 start,
16983 query,
16984 )
16985 }
16986
16987 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16991 self.0.request.parent = v.into();
16992 self
16993 }
16994
16995 pub fn set_task_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
16999 self.0.request.task_id = v.into();
17000 self
17001 }
17002
17003 pub fn set_task<T>(mut self, v: T) -> Self
17007 where
17008 T: std::convert::Into<crate::model::Task>,
17009 {
17010 self.0.request.task = std::option::Option::Some(v.into());
17011 self
17012 }
17013
17014 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
17018 where
17019 T: std::convert::Into<crate::model::Task>,
17020 {
17021 self.0.request.task = v.map(|x| x.into());
17022 self
17023 }
17024
17025 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17027 self.0.request.validate_only = v.into();
17028 self
17029 }
17030 }
17031
17032 #[doc(hidden)]
17033 impl crate::RequestBuilder for CreateTask {
17034 fn request_options(&mut self) -> &mut crate::RequestOptions {
17035 &mut self.0.options
17036 }
17037 }
17038
17039 #[derive(Clone, Debug)]
17057 pub struct UpdateTask(RequestBuilder<crate::model::UpdateTaskRequest>);
17058
17059 impl UpdateTask {
17060 pub(crate) fn new(
17061 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17062 ) -> Self {
17063 Self(RequestBuilder::new(stub))
17064 }
17065
17066 pub fn with_request<V: Into<crate::model::UpdateTaskRequest>>(mut self, v: V) -> Self {
17068 self.0.request = v.into();
17069 self
17070 }
17071
17072 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17074 self.0.options = v.into();
17075 self
17076 }
17077
17078 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17085 (*self.0.stub)
17086 .update_task(self.0.request, self.0.options)
17087 .await
17088 .map(crate::Response::into_body)
17089 }
17090
17091 pub fn poller(
17093 self,
17094 ) -> impl google_cloud_lro::Poller<crate::model::Task, crate::model::OperationMetadata>
17095 {
17096 type Operation = google_cloud_lro::internal::Operation<
17097 crate::model::Task,
17098 crate::model::OperationMetadata,
17099 >;
17100 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17101 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17102
17103 let stub = self.0.stub.clone();
17104 let mut options = self.0.options.clone();
17105 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17106 let query = move |name| {
17107 let stub = stub.clone();
17108 let options = options.clone();
17109 async {
17110 let op = GetOperation::new(stub)
17111 .set_name(name)
17112 .with_options(options)
17113 .send()
17114 .await?;
17115 Ok(Operation::new(op))
17116 }
17117 };
17118
17119 let start = move || async {
17120 let op = self.send().await?;
17121 Ok(Operation::new(op))
17122 };
17123
17124 google_cloud_lro::internal::new_poller(
17125 polling_error_policy,
17126 polling_backoff_policy,
17127 start,
17128 query,
17129 )
17130 }
17131
17132 pub fn set_update_mask<T>(mut self, v: T) -> Self
17136 where
17137 T: std::convert::Into<wkt::FieldMask>,
17138 {
17139 self.0.request.update_mask = std::option::Option::Some(v.into());
17140 self
17141 }
17142
17143 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17147 where
17148 T: std::convert::Into<wkt::FieldMask>,
17149 {
17150 self.0.request.update_mask = v.map(|x| x.into());
17151 self
17152 }
17153
17154 pub fn set_task<T>(mut self, v: T) -> Self
17158 where
17159 T: std::convert::Into<crate::model::Task>,
17160 {
17161 self.0.request.task = std::option::Option::Some(v.into());
17162 self
17163 }
17164
17165 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
17169 where
17170 T: std::convert::Into<crate::model::Task>,
17171 {
17172 self.0.request.task = v.map(|x| x.into());
17173 self
17174 }
17175
17176 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17178 self.0.request.validate_only = v.into();
17179 self
17180 }
17181 }
17182
17183 #[doc(hidden)]
17184 impl crate::RequestBuilder for UpdateTask {
17185 fn request_options(&mut self) -> &mut crate::RequestOptions {
17186 &mut self.0.options
17187 }
17188 }
17189
17190 #[derive(Clone, Debug)]
17208 pub struct DeleteTask(RequestBuilder<crate::model::DeleteTaskRequest>);
17209
17210 impl DeleteTask {
17211 pub(crate) fn new(
17212 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17213 ) -> Self {
17214 Self(RequestBuilder::new(stub))
17215 }
17216
17217 pub fn with_request<V: Into<crate::model::DeleteTaskRequest>>(mut self, v: V) -> Self {
17219 self.0.request = v.into();
17220 self
17221 }
17222
17223 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17225 self.0.options = v.into();
17226 self
17227 }
17228
17229 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17236 (*self.0.stub)
17237 .delete_task(self.0.request, self.0.options)
17238 .await
17239 .map(crate::Response::into_body)
17240 }
17241
17242 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
17244 type Operation =
17245 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17246 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17247 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17248
17249 let stub = self.0.stub.clone();
17250 let mut options = self.0.options.clone();
17251 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17252 let query = move |name| {
17253 let stub = stub.clone();
17254 let options = options.clone();
17255 async {
17256 let op = GetOperation::new(stub)
17257 .set_name(name)
17258 .with_options(options)
17259 .send()
17260 .await?;
17261 Ok(Operation::new(op))
17262 }
17263 };
17264
17265 let start = move || async {
17266 let op = self.send().await?;
17267 Ok(Operation::new(op))
17268 };
17269
17270 google_cloud_lro::internal::new_unit_response_poller(
17271 polling_error_policy,
17272 polling_backoff_policy,
17273 start,
17274 query,
17275 )
17276 }
17277
17278 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17282 self.0.request.name = v.into();
17283 self
17284 }
17285 }
17286
17287 #[doc(hidden)]
17288 impl crate::RequestBuilder for DeleteTask {
17289 fn request_options(&mut self) -> &mut crate::RequestOptions {
17290 &mut self.0.options
17291 }
17292 }
17293
17294 #[derive(Clone, Debug)]
17315 pub struct ListTasks(RequestBuilder<crate::model::ListTasksRequest>);
17316
17317 impl ListTasks {
17318 pub(crate) fn new(
17319 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17320 ) -> Self {
17321 Self(RequestBuilder::new(stub))
17322 }
17323
17324 pub fn with_request<V: Into<crate::model::ListTasksRequest>>(mut self, v: V) -> Self {
17326 self.0.request = v.into();
17327 self
17328 }
17329
17330 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17332 self.0.options = v.into();
17333 self
17334 }
17335
17336 pub async fn send(self) -> Result<crate::model::ListTasksResponse> {
17338 (*self.0.stub)
17339 .list_tasks(self.0.request, self.0.options)
17340 .await
17341 .map(crate::Response::into_body)
17342 }
17343
17344 pub fn by_page(
17346 self,
17347 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTasksResponse, crate::Error>
17348 {
17349 use std::clone::Clone;
17350 let token = self.0.request.page_token.clone();
17351 let execute = move |token: String| {
17352 let mut builder = self.clone();
17353 builder.0.request = builder.0.request.set_page_token(token);
17354 builder.send()
17355 };
17356 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17357 }
17358
17359 pub fn by_item(
17361 self,
17362 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListTasksResponse, crate::Error>
17363 {
17364 use google_cloud_gax::paginator::Paginator;
17365 self.by_page().items()
17366 }
17367
17368 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17372 self.0.request.parent = v.into();
17373 self
17374 }
17375
17376 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17378 self.0.request.page_size = v.into();
17379 self
17380 }
17381
17382 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17384 self.0.request.page_token = v.into();
17385 self
17386 }
17387
17388 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17390 self.0.request.filter = v.into();
17391 self
17392 }
17393
17394 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
17396 self.0.request.order_by = v.into();
17397 self
17398 }
17399 }
17400
17401 #[doc(hidden)]
17402 impl crate::RequestBuilder for ListTasks {
17403 fn request_options(&mut self) -> &mut crate::RequestOptions {
17404 &mut self.0.options
17405 }
17406 }
17407
17408 #[derive(Clone, Debug)]
17425 pub struct GetTask(RequestBuilder<crate::model::GetTaskRequest>);
17426
17427 impl GetTask {
17428 pub(crate) fn new(
17429 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17430 ) -> Self {
17431 Self(RequestBuilder::new(stub))
17432 }
17433
17434 pub fn with_request<V: Into<crate::model::GetTaskRequest>>(mut self, v: V) -> Self {
17436 self.0.request = v.into();
17437 self
17438 }
17439
17440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17442 self.0.options = v.into();
17443 self
17444 }
17445
17446 pub async fn send(self) -> Result<crate::model::Task> {
17448 (*self.0.stub)
17449 .get_task(self.0.request, self.0.options)
17450 .await
17451 .map(crate::Response::into_body)
17452 }
17453
17454 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17458 self.0.request.name = v.into();
17459 self
17460 }
17461 }
17462
17463 #[doc(hidden)]
17464 impl crate::RequestBuilder for GetTask {
17465 fn request_options(&mut self) -> &mut crate::RequestOptions {
17466 &mut self.0.options
17467 }
17468 }
17469
17470 #[derive(Clone, Debug)]
17491 pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
17492
17493 impl ListJobs {
17494 pub(crate) fn new(
17495 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17496 ) -> Self {
17497 Self(RequestBuilder::new(stub))
17498 }
17499
17500 pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
17502 self.0.request = v.into();
17503 self
17504 }
17505
17506 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17508 self.0.options = v.into();
17509 self
17510 }
17511
17512 pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
17514 (*self.0.stub)
17515 .list_jobs(self.0.request, self.0.options)
17516 .await
17517 .map(crate::Response::into_body)
17518 }
17519
17520 pub fn by_page(
17522 self,
17523 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListJobsResponse, crate::Error>
17524 {
17525 use std::clone::Clone;
17526 let token = self.0.request.page_token.clone();
17527 let execute = move |token: String| {
17528 let mut builder = self.clone();
17529 builder.0.request = builder.0.request.set_page_token(token);
17530 builder.send()
17531 };
17532 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17533 }
17534
17535 pub fn by_item(
17537 self,
17538 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListJobsResponse, crate::Error>
17539 {
17540 use google_cloud_gax::paginator::Paginator;
17541 self.by_page().items()
17542 }
17543
17544 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17548 self.0.request.parent = v.into();
17549 self
17550 }
17551
17552 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17554 self.0.request.page_size = v.into();
17555 self
17556 }
17557
17558 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17560 self.0.request.page_token = v.into();
17561 self
17562 }
17563 }
17564
17565 #[doc(hidden)]
17566 impl crate::RequestBuilder for ListJobs {
17567 fn request_options(&mut self) -> &mut crate::RequestOptions {
17568 &mut self.0.options
17569 }
17570 }
17571
17572 #[derive(Clone, Debug)]
17589 pub struct RunTask(RequestBuilder<crate::model::RunTaskRequest>);
17590
17591 impl RunTask {
17592 pub(crate) fn new(
17593 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17594 ) -> Self {
17595 Self(RequestBuilder::new(stub))
17596 }
17597
17598 pub fn with_request<V: Into<crate::model::RunTaskRequest>>(mut self, v: V) -> Self {
17600 self.0.request = v.into();
17601 self
17602 }
17603
17604 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17606 self.0.options = v.into();
17607 self
17608 }
17609
17610 pub async fn send(self) -> Result<crate::model::RunTaskResponse> {
17612 (*self.0.stub)
17613 .run_task(self.0.request, self.0.options)
17614 .await
17615 .map(crate::Response::into_body)
17616 }
17617
17618 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17622 self.0.request.name = v.into();
17623 self
17624 }
17625
17626 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17628 where
17629 T: std::iter::IntoIterator<Item = (K, V)>,
17630 K: std::convert::Into<std::string::String>,
17631 V: std::convert::Into<std::string::String>,
17632 {
17633 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17634 self
17635 }
17636
17637 pub fn set_args<T, K, V>(mut self, v: T) -> Self
17639 where
17640 T: std::iter::IntoIterator<Item = (K, V)>,
17641 K: std::convert::Into<std::string::String>,
17642 V: std::convert::Into<std::string::String>,
17643 {
17644 self.0.request.args = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17645 self
17646 }
17647 }
17648
17649 #[doc(hidden)]
17650 impl crate::RequestBuilder for RunTask {
17651 fn request_options(&mut self) -> &mut crate::RequestOptions {
17652 &mut self.0.options
17653 }
17654 }
17655
17656 #[derive(Clone, Debug)]
17673 pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
17674
17675 impl GetJob {
17676 pub(crate) fn new(
17677 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17678 ) -> Self {
17679 Self(RequestBuilder::new(stub))
17680 }
17681
17682 pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
17684 self.0.request = v.into();
17685 self
17686 }
17687
17688 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17690 self.0.options = v.into();
17691 self
17692 }
17693
17694 pub async fn send(self) -> Result<crate::model::Job> {
17696 (*self.0.stub)
17697 .get_job(self.0.request, self.0.options)
17698 .await
17699 .map(crate::Response::into_body)
17700 }
17701
17702 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17706 self.0.request.name = v.into();
17707 self
17708 }
17709 }
17710
17711 #[doc(hidden)]
17712 impl crate::RequestBuilder for GetJob {
17713 fn request_options(&mut self) -> &mut crate::RequestOptions {
17714 &mut self.0.options
17715 }
17716 }
17717
17718 #[derive(Clone, Debug)]
17735 pub struct CancelJob(RequestBuilder<crate::model::CancelJobRequest>);
17736
17737 impl CancelJob {
17738 pub(crate) fn new(
17739 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17740 ) -> Self {
17741 Self(RequestBuilder::new(stub))
17742 }
17743
17744 pub fn with_request<V: Into<crate::model::CancelJobRequest>>(mut self, v: V) -> Self {
17746 self.0.request = v.into();
17747 self
17748 }
17749
17750 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17752 self.0.options = v.into();
17753 self
17754 }
17755
17756 pub async fn send(self) -> Result<()> {
17758 (*self.0.stub)
17759 .cancel_job(self.0.request, self.0.options)
17760 .await
17761 .map(crate::Response::into_body)
17762 }
17763
17764 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17768 self.0.request.name = v.into();
17769 self
17770 }
17771 }
17772
17773 #[doc(hidden)]
17774 impl crate::RequestBuilder for CancelJob {
17775 fn request_options(&mut self) -> &mut crate::RequestOptions {
17776 &mut self.0.options
17777 }
17778 }
17779
17780 #[derive(Clone, Debug)]
17798 pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
17799
17800 impl CreateEnvironment {
17801 pub(crate) fn new(
17802 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17803 ) -> Self {
17804 Self(RequestBuilder::new(stub))
17805 }
17806
17807 pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
17809 mut self,
17810 v: V,
17811 ) -> Self {
17812 self.0.request = v.into();
17813 self
17814 }
17815
17816 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17818 self.0.options = v.into();
17819 self
17820 }
17821
17822 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17829 (*self.0.stub)
17830 .create_environment(self.0.request, self.0.options)
17831 .await
17832 .map(crate::Response::into_body)
17833 }
17834
17835 pub fn poller(
17837 self,
17838 ) -> impl google_cloud_lro::Poller<crate::model::Environment, crate::model::OperationMetadata>
17839 {
17840 type Operation = google_cloud_lro::internal::Operation<
17841 crate::model::Environment,
17842 crate::model::OperationMetadata,
17843 >;
17844 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17845 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17846
17847 let stub = self.0.stub.clone();
17848 let mut options = self.0.options.clone();
17849 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17850 let query = move |name| {
17851 let stub = stub.clone();
17852 let options = options.clone();
17853 async {
17854 let op = GetOperation::new(stub)
17855 .set_name(name)
17856 .with_options(options)
17857 .send()
17858 .await?;
17859 Ok(Operation::new(op))
17860 }
17861 };
17862
17863 let start = move || async {
17864 let op = self.send().await?;
17865 Ok(Operation::new(op))
17866 };
17867
17868 google_cloud_lro::internal::new_poller(
17869 polling_error_policy,
17870 polling_backoff_policy,
17871 start,
17872 query,
17873 )
17874 }
17875
17876 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17880 self.0.request.parent = v.into();
17881 self
17882 }
17883
17884 pub fn set_environment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17888 self.0.request.environment_id = v.into();
17889 self
17890 }
17891
17892 pub fn set_environment<T>(mut self, v: T) -> Self
17896 where
17897 T: std::convert::Into<crate::model::Environment>,
17898 {
17899 self.0.request.environment = std::option::Option::Some(v.into());
17900 self
17901 }
17902
17903 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
17907 where
17908 T: std::convert::Into<crate::model::Environment>,
17909 {
17910 self.0.request.environment = v.map(|x| x.into());
17911 self
17912 }
17913
17914 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17916 self.0.request.validate_only = v.into();
17917 self
17918 }
17919 }
17920
17921 #[doc(hidden)]
17922 impl crate::RequestBuilder for CreateEnvironment {
17923 fn request_options(&mut self) -> &mut crate::RequestOptions {
17924 &mut self.0.options
17925 }
17926 }
17927
17928 #[derive(Clone, Debug)]
17946 pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
17947
17948 impl UpdateEnvironment {
17949 pub(crate) fn new(
17950 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17951 ) -> Self {
17952 Self(RequestBuilder::new(stub))
17953 }
17954
17955 pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
17957 mut self,
17958 v: V,
17959 ) -> Self {
17960 self.0.request = v.into();
17961 self
17962 }
17963
17964 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17966 self.0.options = v.into();
17967 self
17968 }
17969
17970 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17977 (*self.0.stub)
17978 .update_environment(self.0.request, self.0.options)
17979 .await
17980 .map(crate::Response::into_body)
17981 }
17982
17983 pub fn poller(
17985 self,
17986 ) -> impl google_cloud_lro::Poller<crate::model::Environment, crate::model::OperationMetadata>
17987 {
17988 type Operation = google_cloud_lro::internal::Operation<
17989 crate::model::Environment,
17990 crate::model::OperationMetadata,
17991 >;
17992 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17993 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17994
17995 let stub = self.0.stub.clone();
17996 let mut options = self.0.options.clone();
17997 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17998 let query = move |name| {
17999 let stub = stub.clone();
18000 let options = options.clone();
18001 async {
18002 let op = GetOperation::new(stub)
18003 .set_name(name)
18004 .with_options(options)
18005 .send()
18006 .await?;
18007 Ok(Operation::new(op))
18008 }
18009 };
18010
18011 let start = move || async {
18012 let op = self.send().await?;
18013 Ok(Operation::new(op))
18014 };
18015
18016 google_cloud_lro::internal::new_poller(
18017 polling_error_policy,
18018 polling_backoff_policy,
18019 start,
18020 query,
18021 )
18022 }
18023
18024 pub fn set_update_mask<T>(mut self, v: T) -> Self
18028 where
18029 T: std::convert::Into<wkt::FieldMask>,
18030 {
18031 self.0.request.update_mask = std::option::Option::Some(v.into());
18032 self
18033 }
18034
18035 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18039 where
18040 T: std::convert::Into<wkt::FieldMask>,
18041 {
18042 self.0.request.update_mask = v.map(|x| x.into());
18043 self
18044 }
18045
18046 pub fn set_environment<T>(mut self, v: T) -> Self
18050 where
18051 T: std::convert::Into<crate::model::Environment>,
18052 {
18053 self.0.request.environment = std::option::Option::Some(v.into());
18054 self
18055 }
18056
18057 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
18061 where
18062 T: std::convert::Into<crate::model::Environment>,
18063 {
18064 self.0.request.environment = v.map(|x| x.into());
18065 self
18066 }
18067
18068 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
18070 self.0.request.validate_only = v.into();
18071 self
18072 }
18073 }
18074
18075 #[doc(hidden)]
18076 impl crate::RequestBuilder for UpdateEnvironment {
18077 fn request_options(&mut self) -> &mut crate::RequestOptions {
18078 &mut self.0.options
18079 }
18080 }
18081
18082 #[derive(Clone, Debug)]
18100 pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
18101
18102 impl DeleteEnvironment {
18103 pub(crate) fn new(
18104 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18105 ) -> Self {
18106 Self(RequestBuilder::new(stub))
18107 }
18108
18109 pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
18111 mut self,
18112 v: V,
18113 ) -> Self {
18114 self.0.request = v.into();
18115 self
18116 }
18117
18118 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18120 self.0.options = v.into();
18121 self
18122 }
18123
18124 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
18131 (*self.0.stub)
18132 .delete_environment(self.0.request, self.0.options)
18133 .await
18134 .map(crate::Response::into_body)
18135 }
18136
18137 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
18139 type Operation =
18140 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
18141 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
18142 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
18143
18144 let stub = self.0.stub.clone();
18145 let mut options = self.0.options.clone();
18146 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
18147 let query = move |name| {
18148 let stub = stub.clone();
18149 let options = options.clone();
18150 async {
18151 let op = GetOperation::new(stub)
18152 .set_name(name)
18153 .with_options(options)
18154 .send()
18155 .await?;
18156 Ok(Operation::new(op))
18157 }
18158 };
18159
18160 let start = move || async {
18161 let op = self.send().await?;
18162 Ok(Operation::new(op))
18163 };
18164
18165 google_cloud_lro::internal::new_unit_response_poller(
18166 polling_error_policy,
18167 polling_backoff_policy,
18168 start,
18169 query,
18170 )
18171 }
18172
18173 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18177 self.0.request.name = v.into();
18178 self
18179 }
18180 }
18181
18182 #[doc(hidden)]
18183 impl crate::RequestBuilder for DeleteEnvironment {
18184 fn request_options(&mut self) -> &mut crate::RequestOptions {
18185 &mut self.0.options
18186 }
18187 }
18188
18189 #[derive(Clone, Debug)]
18210 pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
18211
18212 impl ListEnvironments {
18213 pub(crate) fn new(
18214 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18215 ) -> Self {
18216 Self(RequestBuilder::new(stub))
18217 }
18218
18219 pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
18221 mut self,
18222 v: V,
18223 ) -> Self {
18224 self.0.request = v.into();
18225 self
18226 }
18227
18228 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18230 self.0.options = v.into();
18231 self
18232 }
18233
18234 pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
18236 (*self.0.stub)
18237 .list_environments(self.0.request, self.0.options)
18238 .await
18239 .map(crate::Response::into_body)
18240 }
18241
18242 pub fn by_page(
18244 self,
18245 ) -> impl google_cloud_gax::paginator::Paginator<
18246 crate::model::ListEnvironmentsResponse,
18247 crate::Error,
18248 > {
18249 use std::clone::Clone;
18250 let token = self.0.request.page_token.clone();
18251 let execute = move |token: String| {
18252 let mut builder = self.clone();
18253 builder.0.request = builder.0.request.set_page_token(token);
18254 builder.send()
18255 };
18256 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18257 }
18258
18259 pub fn by_item(
18261 self,
18262 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18263 crate::model::ListEnvironmentsResponse,
18264 crate::Error,
18265 > {
18266 use google_cloud_gax::paginator::Paginator;
18267 self.by_page().items()
18268 }
18269
18270 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18274 self.0.request.parent = v.into();
18275 self
18276 }
18277
18278 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18280 self.0.request.page_size = v.into();
18281 self
18282 }
18283
18284 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18286 self.0.request.page_token = v.into();
18287 self
18288 }
18289
18290 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18292 self.0.request.filter = v.into();
18293 self
18294 }
18295
18296 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
18298 self.0.request.order_by = v.into();
18299 self
18300 }
18301 }
18302
18303 #[doc(hidden)]
18304 impl crate::RequestBuilder for ListEnvironments {
18305 fn request_options(&mut self) -> &mut crate::RequestOptions {
18306 &mut self.0.options
18307 }
18308 }
18309
18310 #[derive(Clone, Debug)]
18327 pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
18328
18329 impl GetEnvironment {
18330 pub(crate) fn new(
18331 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18332 ) -> Self {
18333 Self(RequestBuilder::new(stub))
18334 }
18335
18336 pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
18338 self.0.request = v.into();
18339 self
18340 }
18341
18342 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18344 self.0.options = v.into();
18345 self
18346 }
18347
18348 pub async fn send(self) -> Result<crate::model::Environment> {
18350 (*self.0.stub)
18351 .get_environment(self.0.request, self.0.options)
18352 .await
18353 .map(crate::Response::into_body)
18354 }
18355
18356 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18360 self.0.request.name = v.into();
18361 self
18362 }
18363 }
18364
18365 #[doc(hidden)]
18366 impl crate::RequestBuilder for GetEnvironment {
18367 fn request_options(&mut self) -> &mut crate::RequestOptions {
18368 &mut self.0.options
18369 }
18370 }
18371
18372 #[derive(Clone, Debug)]
18393 pub struct ListSessions(RequestBuilder<crate::model::ListSessionsRequest>);
18394
18395 impl ListSessions {
18396 pub(crate) fn new(
18397 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18398 ) -> Self {
18399 Self(RequestBuilder::new(stub))
18400 }
18401
18402 pub fn with_request<V: Into<crate::model::ListSessionsRequest>>(mut self, v: V) -> Self {
18404 self.0.request = v.into();
18405 self
18406 }
18407
18408 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18410 self.0.options = v.into();
18411 self
18412 }
18413
18414 pub async fn send(self) -> Result<crate::model::ListSessionsResponse> {
18416 (*self.0.stub)
18417 .list_sessions(self.0.request, self.0.options)
18418 .await
18419 .map(crate::Response::into_body)
18420 }
18421
18422 pub fn by_page(
18424 self,
18425 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSessionsResponse, crate::Error>
18426 {
18427 use std::clone::Clone;
18428 let token = self.0.request.page_token.clone();
18429 let execute = move |token: String| {
18430 let mut builder = self.clone();
18431 builder.0.request = builder.0.request.set_page_token(token);
18432 builder.send()
18433 };
18434 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18435 }
18436
18437 pub fn by_item(
18439 self,
18440 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18441 crate::model::ListSessionsResponse,
18442 crate::Error,
18443 > {
18444 use google_cloud_gax::paginator::Paginator;
18445 self.by_page().items()
18446 }
18447
18448 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18452 self.0.request.parent = v.into();
18453 self
18454 }
18455
18456 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18458 self.0.request.page_size = v.into();
18459 self
18460 }
18461
18462 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18464 self.0.request.page_token = v.into();
18465 self
18466 }
18467
18468 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18470 self.0.request.filter = v.into();
18471 self
18472 }
18473 }
18474
18475 #[doc(hidden)]
18476 impl crate::RequestBuilder for ListSessions {
18477 fn request_options(&mut self) -> &mut crate::RequestOptions {
18478 &mut self.0.options
18479 }
18480 }
18481
18482 #[derive(Clone, Debug)]
18503 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
18504
18505 impl ListLocations {
18506 pub(crate) fn new(
18507 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18508 ) -> Self {
18509 Self(RequestBuilder::new(stub))
18510 }
18511
18512 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
18514 mut self,
18515 v: V,
18516 ) -> Self {
18517 self.0.request = v.into();
18518 self
18519 }
18520
18521 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18523 self.0.options = v.into();
18524 self
18525 }
18526
18527 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
18529 (*self.0.stub)
18530 .list_locations(self.0.request, self.0.options)
18531 .await
18532 .map(crate::Response::into_body)
18533 }
18534
18535 pub fn by_page(
18537 self,
18538 ) -> impl google_cloud_gax::paginator::Paginator<
18539 google_cloud_location::model::ListLocationsResponse,
18540 crate::Error,
18541 > {
18542 use std::clone::Clone;
18543 let token = self.0.request.page_token.clone();
18544 let execute = move |token: String| {
18545 let mut builder = self.clone();
18546 builder.0.request = builder.0.request.set_page_token(token);
18547 builder.send()
18548 };
18549 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18550 }
18551
18552 pub fn by_item(
18554 self,
18555 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18556 google_cloud_location::model::ListLocationsResponse,
18557 crate::Error,
18558 > {
18559 use google_cloud_gax::paginator::Paginator;
18560 self.by_page().items()
18561 }
18562
18563 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18565 self.0.request.name = v.into();
18566 self
18567 }
18568
18569 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18571 self.0.request.filter = v.into();
18572 self
18573 }
18574
18575 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18577 self.0.request.page_size = v.into();
18578 self
18579 }
18580
18581 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18583 self.0.request.page_token = v.into();
18584 self
18585 }
18586 }
18587
18588 #[doc(hidden)]
18589 impl crate::RequestBuilder for ListLocations {
18590 fn request_options(&mut self) -> &mut crate::RequestOptions {
18591 &mut self.0.options
18592 }
18593 }
18594
18595 #[derive(Clone, Debug)]
18612 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
18613
18614 impl GetLocation {
18615 pub(crate) fn new(
18616 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18617 ) -> Self {
18618 Self(RequestBuilder::new(stub))
18619 }
18620
18621 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
18623 mut self,
18624 v: V,
18625 ) -> Self {
18626 self.0.request = v.into();
18627 self
18628 }
18629
18630 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18632 self.0.options = v.into();
18633 self
18634 }
18635
18636 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
18638 (*self.0.stub)
18639 .get_location(self.0.request, self.0.options)
18640 .await
18641 .map(crate::Response::into_body)
18642 }
18643
18644 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18646 self.0.request.name = v.into();
18647 self
18648 }
18649 }
18650
18651 #[doc(hidden)]
18652 impl crate::RequestBuilder for GetLocation {
18653 fn request_options(&mut self) -> &mut crate::RequestOptions {
18654 &mut self.0.options
18655 }
18656 }
18657
18658 #[derive(Clone, Debug)]
18675 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
18676
18677 impl SetIamPolicy {
18678 pub(crate) fn new(
18679 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18680 ) -> Self {
18681 Self(RequestBuilder::new(stub))
18682 }
18683
18684 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
18686 mut self,
18687 v: V,
18688 ) -> Self {
18689 self.0.request = v.into();
18690 self
18691 }
18692
18693 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18695 self.0.options = v.into();
18696 self
18697 }
18698
18699 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
18701 (*self.0.stub)
18702 .set_iam_policy(self.0.request, self.0.options)
18703 .await
18704 .map(crate::Response::into_body)
18705 }
18706
18707 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
18711 self.0.request.resource = v.into();
18712 self
18713 }
18714
18715 pub fn set_policy<T>(mut self, v: T) -> Self
18719 where
18720 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
18721 {
18722 self.0.request.policy = std::option::Option::Some(v.into());
18723 self
18724 }
18725
18726 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
18730 where
18731 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
18732 {
18733 self.0.request.policy = v.map(|x| x.into());
18734 self
18735 }
18736
18737 pub fn set_update_mask<T>(mut self, v: T) -> Self
18739 where
18740 T: std::convert::Into<wkt::FieldMask>,
18741 {
18742 self.0.request.update_mask = std::option::Option::Some(v.into());
18743 self
18744 }
18745
18746 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18748 where
18749 T: std::convert::Into<wkt::FieldMask>,
18750 {
18751 self.0.request.update_mask = v.map(|x| x.into());
18752 self
18753 }
18754 }
18755
18756 #[doc(hidden)]
18757 impl crate::RequestBuilder for SetIamPolicy {
18758 fn request_options(&mut self) -> &mut crate::RequestOptions {
18759 &mut self.0.options
18760 }
18761 }
18762
18763 #[derive(Clone, Debug)]
18780 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
18781
18782 impl GetIamPolicy {
18783 pub(crate) fn new(
18784 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18785 ) -> Self {
18786 Self(RequestBuilder::new(stub))
18787 }
18788
18789 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
18791 mut self,
18792 v: V,
18793 ) -> Self {
18794 self.0.request = v.into();
18795 self
18796 }
18797
18798 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18800 self.0.options = v.into();
18801 self
18802 }
18803
18804 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
18806 (*self.0.stub)
18807 .get_iam_policy(self.0.request, self.0.options)
18808 .await
18809 .map(crate::Response::into_body)
18810 }
18811
18812 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
18816 self.0.request.resource = v.into();
18817 self
18818 }
18819
18820 pub fn set_options<T>(mut self, v: T) -> Self
18822 where
18823 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
18824 {
18825 self.0.request.options = std::option::Option::Some(v.into());
18826 self
18827 }
18828
18829 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
18831 where
18832 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
18833 {
18834 self.0.request.options = v.map(|x| x.into());
18835 self
18836 }
18837 }
18838
18839 #[doc(hidden)]
18840 impl crate::RequestBuilder for GetIamPolicy {
18841 fn request_options(&mut self) -> &mut crate::RequestOptions {
18842 &mut self.0.options
18843 }
18844 }
18845
18846 #[derive(Clone, Debug)]
18863 pub struct TestIamPermissions(
18864 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
18865 );
18866
18867 impl TestIamPermissions {
18868 pub(crate) fn new(
18869 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18870 ) -> Self {
18871 Self(RequestBuilder::new(stub))
18872 }
18873
18874 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
18876 mut self,
18877 v: V,
18878 ) -> Self {
18879 self.0.request = v.into();
18880 self
18881 }
18882
18883 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18885 self.0.options = v.into();
18886 self
18887 }
18888
18889 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
18891 (*self.0.stub)
18892 .test_iam_permissions(self.0.request, self.0.options)
18893 .await
18894 .map(crate::Response::into_body)
18895 }
18896
18897 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
18901 self.0.request.resource = v.into();
18902 self
18903 }
18904
18905 pub fn set_permissions<T, V>(mut self, v: T) -> Self
18909 where
18910 T: std::iter::IntoIterator<Item = V>,
18911 V: std::convert::Into<std::string::String>,
18912 {
18913 use std::iter::Iterator;
18914 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
18915 self
18916 }
18917 }
18918
18919 #[doc(hidden)]
18920 impl crate::RequestBuilder for TestIamPermissions {
18921 fn request_options(&mut self) -> &mut crate::RequestOptions {
18922 &mut self.0.options
18923 }
18924 }
18925
18926 #[derive(Clone, Debug)]
18947 pub struct ListOperations(
18948 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
18949 );
18950
18951 impl ListOperations {
18952 pub(crate) fn new(
18953 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18954 ) -> Self {
18955 Self(RequestBuilder::new(stub))
18956 }
18957
18958 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
18960 mut self,
18961 v: V,
18962 ) -> Self {
18963 self.0.request = v.into();
18964 self
18965 }
18966
18967 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18969 self.0.options = v.into();
18970 self
18971 }
18972
18973 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
18975 (*self.0.stub)
18976 .list_operations(self.0.request, self.0.options)
18977 .await
18978 .map(crate::Response::into_body)
18979 }
18980
18981 pub fn by_page(
18983 self,
18984 ) -> impl google_cloud_gax::paginator::Paginator<
18985 google_cloud_longrunning::model::ListOperationsResponse,
18986 crate::Error,
18987 > {
18988 use std::clone::Clone;
18989 let token = self.0.request.page_token.clone();
18990 let execute = move |token: String| {
18991 let mut builder = self.clone();
18992 builder.0.request = builder.0.request.set_page_token(token);
18993 builder.send()
18994 };
18995 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18996 }
18997
18998 pub fn by_item(
19000 self,
19001 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19002 google_cloud_longrunning::model::ListOperationsResponse,
19003 crate::Error,
19004 > {
19005 use google_cloud_gax::paginator::Paginator;
19006 self.by_page().items()
19007 }
19008
19009 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19011 self.0.request.name = v.into();
19012 self
19013 }
19014
19015 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19017 self.0.request.filter = v.into();
19018 self
19019 }
19020
19021 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19023 self.0.request.page_size = v.into();
19024 self
19025 }
19026
19027 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19029 self.0.request.page_token = v.into();
19030 self
19031 }
19032
19033 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19035 self.0.request.return_partial_success = v.into();
19036 self
19037 }
19038 }
19039
19040 #[doc(hidden)]
19041 impl crate::RequestBuilder for ListOperations {
19042 fn request_options(&mut self) -> &mut crate::RequestOptions {
19043 &mut self.0.options
19044 }
19045 }
19046
19047 #[derive(Clone, Debug)]
19064 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19065
19066 impl GetOperation {
19067 pub(crate) fn new(
19068 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19069 ) -> Self {
19070 Self(RequestBuilder::new(stub))
19071 }
19072
19073 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19075 mut self,
19076 v: V,
19077 ) -> Self {
19078 self.0.request = v.into();
19079 self
19080 }
19081
19082 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19084 self.0.options = v.into();
19085 self
19086 }
19087
19088 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19090 (*self.0.stub)
19091 .get_operation(self.0.request, self.0.options)
19092 .await
19093 .map(crate::Response::into_body)
19094 }
19095
19096 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19098 self.0.request.name = v.into();
19099 self
19100 }
19101 }
19102
19103 #[doc(hidden)]
19104 impl crate::RequestBuilder for GetOperation {
19105 fn request_options(&mut self) -> &mut crate::RequestOptions {
19106 &mut self.0.options
19107 }
19108 }
19109
19110 #[derive(Clone, Debug)]
19127 pub struct DeleteOperation(
19128 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
19129 );
19130
19131 impl DeleteOperation {
19132 pub(crate) fn new(
19133 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19134 ) -> Self {
19135 Self(RequestBuilder::new(stub))
19136 }
19137
19138 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
19140 mut self,
19141 v: V,
19142 ) -> Self {
19143 self.0.request = v.into();
19144 self
19145 }
19146
19147 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19149 self.0.options = v.into();
19150 self
19151 }
19152
19153 pub async fn send(self) -> Result<()> {
19155 (*self.0.stub)
19156 .delete_operation(self.0.request, self.0.options)
19157 .await
19158 .map(crate::Response::into_body)
19159 }
19160
19161 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19163 self.0.request.name = v.into();
19164 self
19165 }
19166 }
19167
19168 #[doc(hidden)]
19169 impl crate::RequestBuilder for DeleteOperation {
19170 fn request_options(&mut self) -> &mut crate::RequestOptions {
19171 &mut self.0.options
19172 }
19173 }
19174
19175 #[derive(Clone, Debug)]
19192 pub struct CancelOperation(
19193 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19194 );
19195
19196 impl CancelOperation {
19197 pub(crate) fn new(
19198 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
19199 ) -> Self {
19200 Self(RequestBuilder::new(stub))
19201 }
19202
19203 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19205 mut self,
19206 v: V,
19207 ) -> Self {
19208 self.0.request = v.into();
19209 self
19210 }
19211
19212 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19214 self.0.options = v.into();
19215 self
19216 }
19217
19218 pub async fn send(self) -> Result<()> {
19220 (*self.0.stub)
19221 .cancel_operation(self.0.request, self.0.options)
19222 .await
19223 .map(crate::Response::into_body)
19224 }
19225
19226 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19228 self.0.request.name = v.into();
19229 self
19230 }
19231 }
19232
19233 #[doc(hidden)]
19234 impl crate::RequestBuilder for CancelOperation {
19235 fn request_options(&mut self) -> &mut crate::RequestOptions {
19236 &mut self.0.options
19237 }
19238 }
19239}