1pub mod catalog_service {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::CatalogService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = CatalogService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
93 pub struct CreateEntryType(RequestBuilder<crate::model::CreateEntryTypeRequest>);
94
95 impl CreateEntryType {
96 pub(crate) fn new(
97 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
98 ) -> Self {
99 Self(RequestBuilder::new(stub))
100 }
101
102 pub fn with_request<V: Into<crate::model::CreateEntryTypeRequest>>(mut self, v: V) -> Self {
104 self.0.request = v.into();
105 self
106 }
107
108 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
110 self.0.options = v.into();
111 self
112 }
113
114 pub async fn send(self) -> Result<longrunning::model::Operation> {
121 (*self.0.stub)
122 .create_entry_type(self.0.request, self.0.options)
123 .await
124 .map(gax::response::Response::into_body)
125 }
126
127 pub fn poller(
129 self,
130 ) -> impl lro::Poller<crate::model::EntryType, crate::model::OperationMetadata> {
131 type Operation =
132 lro::internal::Operation<crate::model::EntryType, crate::model::OperationMetadata>;
133 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
134 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
135
136 let stub = self.0.stub.clone();
137 let mut options = self.0.options.clone();
138 options.set_retry_policy(gax::retry_policy::NeverRetry);
139 let query = move |name| {
140 let stub = stub.clone();
141 let options = options.clone();
142 async {
143 let op = GetOperation::new(stub)
144 .set_name(name)
145 .with_options(options)
146 .send()
147 .await?;
148 Ok(Operation::new(op))
149 }
150 };
151
152 let start = move || async {
153 let op = self.send().await?;
154 Ok(Operation::new(op))
155 };
156
157 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
158 }
159
160 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.parent = v.into();
165 self
166 }
167
168 pub fn set_entry_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.entry_type_id = v.into();
173 self
174 }
175
176 pub fn set_entry_type<T>(mut self, v: T) -> Self
180 where
181 T: std::convert::Into<crate::model::EntryType>,
182 {
183 self.0.request.entry_type = std::option::Option::Some(v.into());
184 self
185 }
186
187 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
191 where
192 T: std::convert::Into<crate::model::EntryType>,
193 {
194 self.0.request.entry_type = v.map(|x| x.into());
195 self
196 }
197
198 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
200 self.0.request.validate_only = v.into();
201 self
202 }
203 }
204
205 #[doc(hidden)]
206 impl gax::options::internal::RequestBuilder for CreateEntryType {
207 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
208 &mut self.0.options
209 }
210 }
211
212 #[derive(Clone, Debug)]
231 pub struct UpdateEntryType(RequestBuilder<crate::model::UpdateEntryTypeRequest>);
232
233 impl UpdateEntryType {
234 pub(crate) fn new(
235 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
236 ) -> Self {
237 Self(RequestBuilder::new(stub))
238 }
239
240 pub fn with_request<V: Into<crate::model::UpdateEntryTypeRequest>>(mut self, v: V) -> Self {
242 self.0.request = v.into();
243 self
244 }
245
246 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
248 self.0.options = v.into();
249 self
250 }
251
252 pub async fn send(self) -> Result<longrunning::model::Operation> {
259 (*self.0.stub)
260 .update_entry_type(self.0.request, self.0.options)
261 .await
262 .map(gax::response::Response::into_body)
263 }
264
265 pub fn poller(
267 self,
268 ) -> impl lro::Poller<crate::model::EntryType, crate::model::OperationMetadata> {
269 type Operation =
270 lro::internal::Operation<crate::model::EntryType, crate::model::OperationMetadata>;
271 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
272 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
273
274 let stub = self.0.stub.clone();
275 let mut options = self.0.options.clone();
276 options.set_retry_policy(gax::retry_policy::NeverRetry);
277 let query = move |name| {
278 let stub = stub.clone();
279 let options = options.clone();
280 async {
281 let op = GetOperation::new(stub)
282 .set_name(name)
283 .with_options(options)
284 .send()
285 .await?;
286 Ok(Operation::new(op))
287 }
288 };
289
290 let start = move || async {
291 let op = self.send().await?;
292 Ok(Operation::new(op))
293 };
294
295 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
296 }
297
298 pub fn set_entry_type<T>(mut self, v: T) -> Self
302 where
303 T: std::convert::Into<crate::model::EntryType>,
304 {
305 self.0.request.entry_type = std::option::Option::Some(v.into());
306 self
307 }
308
309 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
313 where
314 T: std::convert::Into<crate::model::EntryType>,
315 {
316 self.0.request.entry_type = v.map(|x| x.into());
317 self
318 }
319
320 pub fn set_update_mask<T>(mut self, v: T) -> Self
324 where
325 T: std::convert::Into<wkt::FieldMask>,
326 {
327 self.0.request.update_mask = std::option::Option::Some(v.into());
328 self
329 }
330
331 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
335 where
336 T: std::convert::Into<wkt::FieldMask>,
337 {
338 self.0.request.update_mask = v.map(|x| x.into());
339 self
340 }
341
342 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
344 self.0.request.validate_only = v.into();
345 self
346 }
347 }
348
349 #[doc(hidden)]
350 impl gax::options::internal::RequestBuilder for UpdateEntryType {
351 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
352 &mut self.0.options
353 }
354 }
355
356 #[derive(Clone, Debug)]
375 pub struct DeleteEntryType(RequestBuilder<crate::model::DeleteEntryTypeRequest>);
376
377 impl DeleteEntryType {
378 pub(crate) fn new(
379 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
380 ) -> Self {
381 Self(RequestBuilder::new(stub))
382 }
383
384 pub fn with_request<V: Into<crate::model::DeleteEntryTypeRequest>>(mut self, v: V) -> Self {
386 self.0.request = v.into();
387 self
388 }
389
390 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
392 self.0.options = v.into();
393 self
394 }
395
396 pub async fn send(self) -> Result<longrunning::model::Operation> {
403 (*self.0.stub)
404 .delete_entry_type(self.0.request, self.0.options)
405 .await
406 .map(gax::response::Response::into_body)
407 }
408
409 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
411 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
412 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
413 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
414
415 let stub = self.0.stub.clone();
416 let mut options = self.0.options.clone();
417 options.set_retry_policy(gax::retry_policy::NeverRetry);
418 let query = move |name| {
419 let stub = stub.clone();
420 let options = options.clone();
421 async {
422 let op = GetOperation::new(stub)
423 .set_name(name)
424 .with_options(options)
425 .send()
426 .await?;
427 Ok(Operation::new(op))
428 }
429 };
430
431 let start = move || async {
432 let op = self.send().await?;
433 Ok(Operation::new(op))
434 };
435
436 lro::internal::new_unit_response_poller(
437 polling_error_policy,
438 polling_backoff_policy,
439 start,
440 query,
441 )
442 }
443
444 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
448 self.0.request.name = v.into();
449 self
450 }
451
452 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
454 self.0.request.etag = v.into();
455 self
456 }
457 }
458
459 #[doc(hidden)]
460 impl gax::options::internal::RequestBuilder for DeleteEntryType {
461 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
462 &mut self.0.options
463 }
464 }
465
466 #[derive(Clone, Debug)]
488 pub struct ListEntryTypes(RequestBuilder<crate::model::ListEntryTypesRequest>);
489
490 impl ListEntryTypes {
491 pub(crate) fn new(
492 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
493 ) -> Self {
494 Self(RequestBuilder::new(stub))
495 }
496
497 pub fn with_request<V: Into<crate::model::ListEntryTypesRequest>>(mut self, v: V) -> Self {
499 self.0.request = v.into();
500 self
501 }
502
503 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
505 self.0.options = v.into();
506 self
507 }
508
509 pub async fn send(self) -> Result<crate::model::ListEntryTypesResponse> {
511 (*self.0.stub)
512 .list_entry_types(self.0.request, self.0.options)
513 .await
514 .map(gax::response::Response::into_body)
515 }
516
517 pub fn by_page(
519 self,
520 ) -> impl gax::paginator::Paginator<crate::model::ListEntryTypesResponse, gax::error::Error>
521 {
522 use std::clone::Clone;
523 let token = self.0.request.page_token.clone();
524 let execute = move |token: String| {
525 let mut builder = self.clone();
526 builder.0.request = builder.0.request.set_page_token(token);
527 builder.send()
528 };
529 gax::paginator::internal::new_paginator(token, execute)
530 }
531
532 pub fn by_item(
534 self,
535 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntryTypesResponse, gax::error::Error>
536 {
537 use gax::paginator::Paginator;
538 self.by_page().items()
539 }
540
541 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
545 self.0.request.parent = v.into();
546 self
547 }
548
549 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
551 self.0.request.page_size = v.into();
552 self
553 }
554
555 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
557 self.0.request.page_token = v.into();
558 self
559 }
560
561 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
563 self.0.request.filter = v.into();
564 self
565 }
566
567 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
569 self.0.request.order_by = v.into();
570 self
571 }
572 }
573
574 #[doc(hidden)]
575 impl gax::options::internal::RequestBuilder for ListEntryTypes {
576 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
577 &mut self.0.options
578 }
579 }
580
581 #[derive(Clone, Debug)]
599 pub struct GetEntryType(RequestBuilder<crate::model::GetEntryTypeRequest>);
600
601 impl GetEntryType {
602 pub(crate) fn new(
603 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
604 ) -> Self {
605 Self(RequestBuilder::new(stub))
606 }
607
608 pub fn with_request<V: Into<crate::model::GetEntryTypeRequest>>(mut self, v: V) -> Self {
610 self.0.request = v.into();
611 self
612 }
613
614 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
616 self.0.options = v.into();
617 self
618 }
619
620 pub async fn send(self) -> Result<crate::model::EntryType> {
622 (*self.0.stub)
623 .get_entry_type(self.0.request, self.0.options)
624 .await
625 .map(gax::response::Response::into_body)
626 }
627
628 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
632 self.0.request.name = v.into();
633 self
634 }
635 }
636
637 #[doc(hidden)]
638 impl gax::options::internal::RequestBuilder for GetEntryType {
639 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
640 &mut self.0.options
641 }
642 }
643
644 #[derive(Clone, Debug)]
663 pub struct CreateAspectType(RequestBuilder<crate::model::CreateAspectTypeRequest>);
664
665 impl CreateAspectType {
666 pub(crate) fn new(
667 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
668 ) -> Self {
669 Self(RequestBuilder::new(stub))
670 }
671
672 pub fn with_request<V: Into<crate::model::CreateAspectTypeRequest>>(
674 mut self,
675 v: V,
676 ) -> Self {
677 self.0.request = v.into();
678 self
679 }
680
681 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
683 self.0.options = v.into();
684 self
685 }
686
687 pub async fn send(self) -> Result<longrunning::model::Operation> {
694 (*self.0.stub)
695 .create_aspect_type(self.0.request, self.0.options)
696 .await
697 .map(gax::response::Response::into_body)
698 }
699
700 pub fn poller(
702 self,
703 ) -> impl lro::Poller<crate::model::AspectType, crate::model::OperationMetadata> {
704 type Operation =
705 lro::internal::Operation<crate::model::AspectType, crate::model::OperationMetadata>;
706 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
707 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
708
709 let stub = self.0.stub.clone();
710 let mut options = self.0.options.clone();
711 options.set_retry_policy(gax::retry_policy::NeverRetry);
712 let query = move |name| {
713 let stub = stub.clone();
714 let options = options.clone();
715 async {
716 let op = GetOperation::new(stub)
717 .set_name(name)
718 .with_options(options)
719 .send()
720 .await?;
721 Ok(Operation::new(op))
722 }
723 };
724
725 let start = move || async {
726 let op = self.send().await?;
727 Ok(Operation::new(op))
728 };
729
730 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
731 }
732
733 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
737 self.0.request.parent = v.into();
738 self
739 }
740
741 pub fn set_aspect_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
745 self.0.request.aspect_type_id = v.into();
746 self
747 }
748
749 pub fn set_aspect_type<T>(mut self, v: T) -> Self
753 where
754 T: std::convert::Into<crate::model::AspectType>,
755 {
756 self.0.request.aspect_type = std::option::Option::Some(v.into());
757 self
758 }
759
760 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
764 where
765 T: std::convert::Into<crate::model::AspectType>,
766 {
767 self.0.request.aspect_type = v.map(|x| x.into());
768 self
769 }
770
771 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
773 self.0.request.validate_only = v.into();
774 self
775 }
776 }
777
778 #[doc(hidden)]
779 impl gax::options::internal::RequestBuilder for CreateAspectType {
780 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
781 &mut self.0.options
782 }
783 }
784
785 #[derive(Clone, Debug)]
804 pub struct UpdateAspectType(RequestBuilder<crate::model::UpdateAspectTypeRequest>);
805
806 impl UpdateAspectType {
807 pub(crate) fn new(
808 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
809 ) -> Self {
810 Self(RequestBuilder::new(stub))
811 }
812
813 pub fn with_request<V: Into<crate::model::UpdateAspectTypeRequest>>(
815 mut self,
816 v: V,
817 ) -> Self {
818 self.0.request = v.into();
819 self
820 }
821
822 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
824 self.0.options = v.into();
825 self
826 }
827
828 pub async fn send(self) -> Result<longrunning::model::Operation> {
835 (*self.0.stub)
836 .update_aspect_type(self.0.request, self.0.options)
837 .await
838 .map(gax::response::Response::into_body)
839 }
840
841 pub fn poller(
843 self,
844 ) -> impl lro::Poller<crate::model::AspectType, crate::model::OperationMetadata> {
845 type Operation =
846 lro::internal::Operation<crate::model::AspectType, crate::model::OperationMetadata>;
847 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
848 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
849
850 let stub = self.0.stub.clone();
851 let mut options = self.0.options.clone();
852 options.set_retry_policy(gax::retry_policy::NeverRetry);
853 let query = move |name| {
854 let stub = stub.clone();
855 let options = options.clone();
856 async {
857 let op = GetOperation::new(stub)
858 .set_name(name)
859 .with_options(options)
860 .send()
861 .await?;
862 Ok(Operation::new(op))
863 }
864 };
865
866 let start = move || async {
867 let op = self.send().await?;
868 Ok(Operation::new(op))
869 };
870
871 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
872 }
873
874 pub fn set_aspect_type<T>(mut self, v: T) -> Self
878 where
879 T: std::convert::Into<crate::model::AspectType>,
880 {
881 self.0.request.aspect_type = std::option::Option::Some(v.into());
882 self
883 }
884
885 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
889 where
890 T: std::convert::Into<crate::model::AspectType>,
891 {
892 self.0.request.aspect_type = v.map(|x| x.into());
893 self
894 }
895
896 pub fn set_update_mask<T>(mut self, v: T) -> Self
900 where
901 T: std::convert::Into<wkt::FieldMask>,
902 {
903 self.0.request.update_mask = std::option::Option::Some(v.into());
904 self
905 }
906
907 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
911 where
912 T: std::convert::Into<wkt::FieldMask>,
913 {
914 self.0.request.update_mask = v.map(|x| x.into());
915 self
916 }
917
918 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
920 self.0.request.validate_only = v.into();
921 self
922 }
923 }
924
925 #[doc(hidden)]
926 impl gax::options::internal::RequestBuilder for UpdateAspectType {
927 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
928 &mut self.0.options
929 }
930 }
931
932 #[derive(Clone, Debug)]
951 pub struct DeleteAspectType(RequestBuilder<crate::model::DeleteAspectTypeRequest>);
952
953 impl DeleteAspectType {
954 pub(crate) fn new(
955 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
956 ) -> Self {
957 Self(RequestBuilder::new(stub))
958 }
959
960 pub fn with_request<V: Into<crate::model::DeleteAspectTypeRequest>>(
962 mut self,
963 v: V,
964 ) -> Self {
965 self.0.request = v.into();
966 self
967 }
968
969 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
971 self.0.options = v.into();
972 self
973 }
974
975 pub async fn send(self) -> Result<longrunning::model::Operation> {
982 (*self.0.stub)
983 .delete_aspect_type(self.0.request, self.0.options)
984 .await
985 .map(gax::response::Response::into_body)
986 }
987
988 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
990 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
991 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
992 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
993
994 let stub = self.0.stub.clone();
995 let mut options = self.0.options.clone();
996 options.set_retry_policy(gax::retry_policy::NeverRetry);
997 let query = move |name| {
998 let stub = stub.clone();
999 let options = options.clone();
1000 async {
1001 let op = GetOperation::new(stub)
1002 .set_name(name)
1003 .with_options(options)
1004 .send()
1005 .await?;
1006 Ok(Operation::new(op))
1007 }
1008 };
1009
1010 let start = move || async {
1011 let op = self.send().await?;
1012 Ok(Operation::new(op))
1013 };
1014
1015 lro::internal::new_unit_response_poller(
1016 polling_error_policy,
1017 polling_backoff_policy,
1018 start,
1019 query,
1020 )
1021 }
1022
1023 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1027 self.0.request.name = v.into();
1028 self
1029 }
1030
1031 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1033 self.0.request.etag = v.into();
1034 self
1035 }
1036 }
1037
1038 #[doc(hidden)]
1039 impl gax::options::internal::RequestBuilder for DeleteAspectType {
1040 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1041 &mut self.0.options
1042 }
1043 }
1044
1045 #[derive(Clone, Debug)]
1067 pub struct ListAspectTypes(RequestBuilder<crate::model::ListAspectTypesRequest>);
1068
1069 impl ListAspectTypes {
1070 pub(crate) fn new(
1071 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1072 ) -> Self {
1073 Self(RequestBuilder::new(stub))
1074 }
1075
1076 pub fn with_request<V: Into<crate::model::ListAspectTypesRequest>>(mut self, v: V) -> Self {
1078 self.0.request = v.into();
1079 self
1080 }
1081
1082 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1084 self.0.options = v.into();
1085 self
1086 }
1087
1088 pub async fn send(self) -> Result<crate::model::ListAspectTypesResponse> {
1090 (*self.0.stub)
1091 .list_aspect_types(self.0.request, self.0.options)
1092 .await
1093 .map(gax::response::Response::into_body)
1094 }
1095
1096 pub fn by_page(
1098 self,
1099 ) -> impl gax::paginator::Paginator<crate::model::ListAspectTypesResponse, gax::error::Error>
1100 {
1101 use std::clone::Clone;
1102 let token = self.0.request.page_token.clone();
1103 let execute = move |token: String| {
1104 let mut builder = self.clone();
1105 builder.0.request = builder.0.request.set_page_token(token);
1106 builder.send()
1107 };
1108 gax::paginator::internal::new_paginator(token, execute)
1109 }
1110
1111 pub fn by_item(
1113 self,
1114 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAspectTypesResponse, gax::error::Error>
1115 {
1116 use gax::paginator::Paginator;
1117 self.by_page().items()
1118 }
1119
1120 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1124 self.0.request.parent = v.into();
1125 self
1126 }
1127
1128 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1130 self.0.request.page_size = v.into();
1131 self
1132 }
1133
1134 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1136 self.0.request.page_token = v.into();
1137 self
1138 }
1139
1140 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1142 self.0.request.filter = v.into();
1143 self
1144 }
1145
1146 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1148 self.0.request.order_by = v.into();
1149 self
1150 }
1151 }
1152
1153 #[doc(hidden)]
1154 impl gax::options::internal::RequestBuilder for ListAspectTypes {
1155 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1156 &mut self.0.options
1157 }
1158 }
1159
1160 #[derive(Clone, Debug)]
1178 pub struct GetAspectType(RequestBuilder<crate::model::GetAspectTypeRequest>);
1179
1180 impl GetAspectType {
1181 pub(crate) fn new(
1182 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1183 ) -> Self {
1184 Self(RequestBuilder::new(stub))
1185 }
1186
1187 pub fn with_request<V: Into<crate::model::GetAspectTypeRequest>>(mut self, v: V) -> Self {
1189 self.0.request = v.into();
1190 self
1191 }
1192
1193 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1195 self.0.options = v.into();
1196 self
1197 }
1198
1199 pub async fn send(self) -> Result<crate::model::AspectType> {
1201 (*self.0.stub)
1202 .get_aspect_type(self.0.request, self.0.options)
1203 .await
1204 .map(gax::response::Response::into_body)
1205 }
1206
1207 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1211 self.0.request.name = v.into();
1212 self
1213 }
1214 }
1215
1216 #[doc(hidden)]
1217 impl gax::options::internal::RequestBuilder for GetAspectType {
1218 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1219 &mut self.0.options
1220 }
1221 }
1222
1223 #[derive(Clone, Debug)]
1242 pub struct CreateEntryGroup(RequestBuilder<crate::model::CreateEntryGroupRequest>);
1243
1244 impl CreateEntryGroup {
1245 pub(crate) fn new(
1246 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1247 ) -> Self {
1248 Self(RequestBuilder::new(stub))
1249 }
1250
1251 pub fn with_request<V: Into<crate::model::CreateEntryGroupRequest>>(
1253 mut self,
1254 v: V,
1255 ) -> Self {
1256 self.0.request = v.into();
1257 self
1258 }
1259
1260 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1262 self.0.options = v.into();
1263 self
1264 }
1265
1266 pub async fn send(self) -> Result<longrunning::model::Operation> {
1273 (*self.0.stub)
1274 .create_entry_group(self.0.request, self.0.options)
1275 .await
1276 .map(gax::response::Response::into_body)
1277 }
1278
1279 pub fn poller(
1281 self,
1282 ) -> impl lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata> {
1283 type Operation =
1284 lro::internal::Operation<crate::model::EntryGroup, crate::model::OperationMetadata>;
1285 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1286 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1287
1288 let stub = self.0.stub.clone();
1289 let mut options = self.0.options.clone();
1290 options.set_retry_policy(gax::retry_policy::NeverRetry);
1291 let query = move |name| {
1292 let stub = stub.clone();
1293 let options = options.clone();
1294 async {
1295 let op = GetOperation::new(stub)
1296 .set_name(name)
1297 .with_options(options)
1298 .send()
1299 .await?;
1300 Ok(Operation::new(op))
1301 }
1302 };
1303
1304 let start = move || async {
1305 let op = self.send().await?;
1306 Ok(Operation::new(op))
1307 };
1308
1309 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1310 }
1311
1312 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1316 self.0.request.parent = v.into();
1317 self
1318 }
1319
1320 pub fn set_entry_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1324 self.0.request.entry_group_id = v.into();
1325 self
1326 }
1327
1328 pub fn set_entry_group<T>(mut self, v: T) -> Self
1332 where
1333 T: std::convert::Into<crate::model::EntryGroup>,
1334 {
1335 self.0.request.entry_group = std::option::Option::Some(v.into());
1336 self
1337 }
1338
1339 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
1343 where
1344 T: std::convert::Into<crate::model::EntryGroup>,
1345 {
1346 self.0.request.entry_group = v.map(|x| x.into());
1347 self
1348 }
1349
1350 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1352 self.0.request.validate_only = v.into();
1353 self
1354 }
1355 }
1356
1357 #[doc(hidden)]
1358 impl gax::options::internal::RequestBuilder for CreateEntryGroup {
1359 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1360 &mut self.0.options
1361 }
1362 }
1363
1364 #[derive(Clone, Debug)]
1383 pub struct UpdateEntryGroup(RequestBuilder<crate::model::UpdateEntryGroupRequest>);
1384
1385 impl UpdateEntryGroup {
1386 pub(crate) fn new(
1387 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1388 ) -> Self {
1389 Self(RequestBuilder::new(stub))
1390 }
1391
1392 pub fn with_request<V: Into<crate::model::UpdateEntryGroupRequest>>(
1394 mut self,
1395 v: V,
1396 ) -> Self {
1397 self.0.request = v.into();
1398 self
1399 }
1400
1401 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1403 self.0.options = v.into();
1404 self
1405 }
1406
1407 pub async fn send(self) -> Result<longrunning::model::Operation> {
1414 (*self.0.stub)
1415 .update_entry_group(self.0.request, self.0.options)
1416 .await
1417 .map(gax::response::Response::into_body)
1418 }
1419
1420 pub fn poller(
1422 self,
1423 ) -> impl lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata> {
1424 type Operation =
1425 lro::internal::Operation<crate::model::EntryGroup, crate::model::OperationMetadata>;
1426 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1427 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1428
1429 let stub = self.0.stub.clone();
1430 let mut options = self.0.options.clone();
1431 options.set_retry_policy(gax::retry_policy::NeverRetry);
1432 let query = move |name| {
1433 let stub = stub.clone();
1434 let options = options.clone();
1435 async {
1436 let op = GetOperation::new(stub)
1437 .set_name(name)
1438 .with_options(options)
1439 .send()
1440 .await?;
1441 Ok(Operation::new(op))
1442 }
1443 };
1444
1445 let start = move || async {
1446 let op = self.send().await?;
1447 Ok(Operation::new(op))
1448 };
1449
1450 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1451 }
1452
1453 pub fn set_entry_group<T>(mut self, v: T) -> Self
1457 where
1458 T: std::convert::Into<crate::model::EntryGroup>,
1459 {
1460 self.0.request.entry_group = std::option::Option::Some(v.into());
1461 self
1462 }
1463
1464 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
1468 where
1469 T: std::convert::Into<crate::model::EntryGroup>,
1470 {
1471 self.0.request.entry_group = v.map(|x| x.into());
1472 self
1473 }
1474
1475 pub fn set_update_mask<T>(mut self, v: T) -> Self
1479 where
1480 T: std::convert::Into<wkt::FieldMask>,
1481 {
1482 self.0.request.update_mask = std::option::Option::Some(v.into());
1483 self
1484 }
1485
1486 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1490 where
1491 T: std::convert::Into<wkt::FieldMask>,
1492 {
1493 self.0.request.update_mask = v.map(|x| x.into());
1494 self
1495 }
1496
1497 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1499 self.0.request.validate_only = v.into();
1500 self
1501 }
1502 }
1503
1504 #[doc(hidden)]
1505 impl gax::options::internal::RequestBuilder for UpdateEntryGroup {
1506 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1507 &mut self.0.options
1508 }
1509 }
1510
1511 #[derive(Clone, Debug)]
1530 pub struct DeleteEntryGroup(RequestBuilder<crate::model::DeleteEntryGroupRequest>);
1531
1532 impl DeleteEntryGroup {
1533 pub(crate) fn new(
1534 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1535 ) -> Self {
1536 Self(RequestBuilder::new(stub))
1537 }
1538
1539 pub fn with_request<V: Into<crate::model::DeleteEntryGroupRequest>>(
1541 mut self,
1542 v: V,
1543 ) -> Self {
1544 self.0.request = v.into();
1545 self
1546 }
1547
1548 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1550 self.0.options = v.into();
1551 self
1552 }
1553
1554 pub async fn send(self) -> Result<longrunning::model::Operation> {
1561 (*self.0.stub)
1562 .delete_entry_group(self.0.request, self.0.options)
1563 .await
1564 .map(gax::response::Response::into_body)
1565 }
1566
1567 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1569 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1570 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1571 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1572
1573 let stub = self.0.stub.clone();
1574 let mut options = self.0.options.clone();
1575 options.set_retry_policy(gax::retry_policy::NeverRetry);
1576 let query = move |name| {
1577 let stub = stub.clone();
1578 let options = options.clone();
1579 async {
1580 let op = GetOperation::new(stub)
1581 .set_name(name)
1582 .with_options(options)
1583 .send()
1584 .await?;
1585 Ok(Operation::new(op))
1586 }
1587 };
1588
1589 let start = move || async {
1590 let op = self.send().await?;
1591 Ok(Operation::new(op))
1592 };
1593
1594 lro::internal::new_unit_response_poller(
1595 polling_error_policy,
1596 polling_backoff_policy,
1597 start,
1598 query,
1599 )
1600 }
1601
1602 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1606 self.0.request.name = v.into();
1607 self
1608 }
1609
1610 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1612 self.0.request.etag = v.into();
1613 self
1614 }
1615 }
1616
1617 #[doc(hidden)]
1618 impl gax::options::internal::RequestBuilder for DeleteEntryGroup {
1619 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1620 &mut self.0.options
1621 }
1622 }
1623
1624 #[derive(Clone, Debug)]
1646 pub struct ListEntryGroups(RequestBuilder<crate::model::ListEntryGroupsRequest>);
1647
1648 impl ListEntryGroups {
1649 pub(crate) fn new(
1650 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1651 ) -> Self {
1652 Self(RequestBuilder::new(stub))
1653 }
1654
1655 pub fn with_request<V: Into<crate::model::ListEntryGroupsRequest>>(mut self, v: V) -> Self {
1657 self.0.request = v.into();
1658 self
1659 }
1660
1661 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1663 self.0.options = v.into();
1664 self
1665 }
1666
1667 pub async fn send(self) -> Result<crate::model::ListEntryGroupsResponse> {
1669 (*self.0.stub)
1670 .list_entry_groups(self.0.request, self.0.options)
1671 .await
1672 .map(gax::response::Response::into_body)
1673 }
1674
1675 pub fn by_page(
1677 self,
1678 ) -> impl gax::paginator::Paginator<crate::model::ListEntryGroupsResponse, gax::error::Error>
1679 {
1680 use std::clone::Clone;
1681 let token = self.0.request.page_token.clone();
1682 let execute = move |token: String| {
1683 let mut builder = self.clone();
1684 builder.0.request = builder.0.request.set_page_token(token);
1685 builder.send()
1686 };
1687 gax::paginator::internal::new_paginator(token, execute)
1688 }
1689
1690 pub fn by_item(
1692 self,
1693 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntryGroupsResponse, gax::error::Error>
1694 {
1695 use gax::paginator::Paginator;
1696 self.by_page().items()
1697 }
1698
1699 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1703 self.0.request.parent = v.into();
1704 self
1705 }
1706
1707 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1709 self.0.request.page_size = v.into();
1710 self
1711 }
1712
1713 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1715 self.0.request.page_token = v.into();
1716 self
1717 }
1718
1719 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1721 self.0.request.filter = v.into();
1722 self
1723 }
1724
1725 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1727 self.0.request.order_by = v.into();
1728 self
1729 }
1730 }
1731
1732 #[doc(hidden)]
1733 impl gax::options::internal::RequestBuilder for ListEntryGroups {
1734 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1735 &mut self.0.options
1736 }
1737 }
1738
1739 #[derive(Clone, Debug)]
1757 pub struct GetEntryGroup(RequestBuilder<crate::model::GetEntryGroupRequest>);
1758
1759 impl GetEntryGroup {
1760 pub(crate) fn new(
1761 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1762 ) -> Self {
1763 Self(RequestBuilder::new(stub))
1764 }
1765
1766 pub fn with_request<V: Into<crate::model::GetEntryGroupRequest>>(mut self, v: V) -> Self {
1768 self.0.request = v.into();
1769 self
1770 }
1771
1772 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1774 self.0.options = v.into();
1775 self
1776 }
1777
1778 pub async fn send(self) -> Result<crate::model::EntryGroup> {
1780 (*self.0.stub)
1781 .get_entry_group(self.0.request, self.0.options)
1782 .await
1783 .map(gax::response::Response::into_body)
1784 }
1785
1786 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1790 self.0.request.name = v.into();
1791 self
1792 }
1793 }
1794
1795 #[doc(hidden)]
1796 impl gax::options::internal::RequestBuilder for GetEntryGroup {
1797 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1798 &mut self.0.options
1799 }
1800 }
1801
1802 #[derive(Clone, Debug)]
1820 pub struct CreateEntry(RequestBuilder<crate::model::CreateEntryRequest>);
1821
1822 impl CreateEntry {
1823 pub(crate) fn new(
1824 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1825 ) -> Self {
1826 Self(RequestBuilder::new(stub))
1827 }
1828
1829 pub fn with_request<V: Into<crate::model::CreateEntryRequest>>(mut self, v: V) -> Self {
1831 self.0.request = v.into();
1832 self
1833 }
1834
1835 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1837 self.0.options = v.into();
1838 self
1839 }
1840
1841 pub async fn send(self) -> Result<crate::model::Entry> {
1843 (*self.0.stub)
1844 .create_entry(self.0.request, self.0.options)
1845 .await
1846 .map(gax::response::Response::into_body)
1847 }
1848
1849 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1853 self.0.request.parent = v.into();
1854 self
1855 }
1856
1857 pub fn set_entry_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1861 self.0.request.entry_id = v.into();
1862 self
1863 }
1864
1865 pub fn set_entry<T>(mut self, v: T) -> Self
1869 where
1870 T: std::convert::Into<crate::model::Entry>,
1871 {
1872 self.0.request.entry = std::option::Option::Some(v.into());
1873 self
1874 }
1875
1876 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
1880 where
1881 T: std::convert::Into<crate::model::Entry>,
1882 {
1883 self.0.request.entry = v.map(|x| x.into());
1884 self
1885 }
1886 }
1887
1888 #[doc(hidden)]
1889 impl gax::options::internal::RequestBuilder for CreateEntry {
1890 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1891 &mut self.0.options
1892 }
1893 }
1894
1895 #[derive(Clone, Debug)]
1913 pub struct UpdateEntry(RequestBuilder<crate::model::UpdateEntryRequest>);
1914
1915 impl UpdateEntry {
1916 pub(crate) fn new(
1917 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1918 ) -> Self {
1919 Self(RequestBuilder::new(stub))
1920 }
1921
1922 pub fn with_request<V: Into<crate::model::UpdateEntryRequest>>(mut self, v: V) -> Self {
1924 self.0.request = v.into();
1925 self
1926 }
1927
1928 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1930 self.0.options = v.into();
1931 self
1932 }
1933
1934 pub async fn send(self) -> Result<crate::model::Entry> {
1936 (*self.0.stub)
1937 .update_entry(self.0.request, self.0.options)
1938 .await
1939 .map(gax::response::Response::into_body)
1940 }
1941
1942 pub fn set_entry<T>(mut self, v: T) -> Self
1946 where
1947 T: std::convert::Into<crate::model::Entry>,
1948 {
1949 self.0.request.entry = std::option::Option::Some(v.into());
1950 self
1951 }
1952
1953 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
1957 where
1958 T: std::convert::Into<crate::model::Entry>,
1959 {
1960 self.0.request.entry = v.map(|x| x.into());
1961 self
1962 }
1963
1964 pub fn set_update_mask<T>(mut self, v: T) -> Self
1966 where
1967 T: std::convert::Into<wkt::FieldMask>,
1968 {
1969 self.0.request.update_mask = std::option::Option::Some(v.into());
1970 self
1971 }
1972
1973 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1975 where
1976 T: std::convert::Into<wkt::FieldMask>,
1977 {
1978 self.0.request.update_mask = v.map(|x| x.into());
1979 self
1980 }
1981
1982 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1984 self.0.request.allow_missing = v.into();
1985 self
1986 }
1987
1988 pub fn set_delete_missing_aspects<T: Into<bool>>(mut self, v: T) -> Self {
1990 self.0.request.delete_missing_aspects = v.into();
1991 self
1992 }
1993
1994 pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
1996 where
1997 T: std::iter::IntoIterator<Item = V>,
1998 V: std::convert::Into<std::string::String>,
1999 {
2000 use std::iter::Iterator;
2001 self.0.request.aspect_keys = v.into_iter().map(|i| i.into()).collect();
2002 self
2003 }
2004 }
2005
2006 #[doc(hidden)]
2007 impl gax::options::internal::RequestBuilder for UpdateEntry {
2008 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2009 &mut self.0.options
2010 }
2011 }
2012
2013 #[derive(Clone, Debug)]
2031 pub struct DeleteEntry(RequestBuilder<crate::model::DeleteEntryRequest>);
2032
2033 impl DeleteEntry {
2034 pub(crate) fn new(
2035 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2036 ) -> Self {
2037 Self(RequestBuilder::new(stub))
2038 }
2039
2040 pub fn with_request<V: Into<crate::model::DeleteEntryRequest>>(mut self, v: V) -> Self {
2042 self.0.request = v.into();
2043 self
2044 }
2045
2046 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2048 self.0.options = v.into();
2049 self
2050 }
2051
2052 pub async fn send(self) -> Result<crate::model::Entry> {
2054 (*self.0.stub)
2055 .delete_entry(self.0.request, self.0.options)
2056 .await
2057 .map(gax::response::Response::into_body)
2058 }
2059
2060 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2064 self.0.request.name = v.into();
2065 self
2066 }
2067 }
2068
2069 #[doc(hidden)]
2070 impl gax::options::internal::RequestBuilder for DeleteEntry {
2071 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2072 &mut self.0.options
2073 }
2074 }
2075
2076 #[derive(Clone, Debug)]
2098 pub struct ListEntries(RequestBuilder<crate::model::ListEntriesRequest>);
2099
2100 impl ListEntries {
2101 pub(crate) fn new(
2102 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2103 ) -> Self {
2104 Self(RequestBuilder::new(stub))
2105 }
2106
2107 pub fn with_request<V: Into<crate::model::ListEntriesRequest>>(mut self, v: V) -> Self {
2109 self.0.request = v.into();
2110 self
2111 }
2112
2113 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2115 self.0.options = v.into();
2116 self
2117 }
2118
2119 pub async fn send(self) -> Result<crate::model::ListEntriesResponse> {
2121 (*self.0.stub)
2122 .list_entries(self.0.request, self.0.options)
2123 .await
2124 .map(gax::response::Response::into_body)
2125 }
2126
2127 pub fn by_page(
2129 self,
2130 ) -> impl gax::paginator::Paginator<crate::model::ListEntriesResponse, gax::error::Error>
2131 {
2132 use std::clone::Clone;
2133 let token = self.0.request.page_token.clone();
2134 let execute = move |token: String| {
2135 let mut builder = self.clone();
2136 builder.0.request = builder.0.request.set_page_token(token);
2137 builder.send()
2138 };
2139 gax::paginator::internal::new_paginator(token, execute)
2140 }
2141
2142 pub fn by_item(
2144 self,
2145 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntriesResponse, gax::error::Error>
2146 {
2147 use gax::paginator::Paginator;
2148 self.by_page().items()
2149 }
2150
2151 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2155 self.0.request.parent = v.into();
2156 self
2157 }
2158
2159 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2161 self.0.request.page_size = v.into();
2162 self
2163 }
2164
2165 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2167 self.0.request.page_token = v.into();
2168 self
2169 }
2170
2171 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2173 self.0.request.filter = v.into();
2174 self
2175 }
2176 }
2177
2178 #[doc(hidden)]
2179 impl gax::options::internal::RequestBuilder for ListEntries {
2180 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2181 &mut self.0.options
2182 }
2183 }
2184
2185 #[derive(Clone, Debug)]
2203 pub struct GetEntry(RequestBuilder<crate::model::GetEntryRequest>);
2204
2205 impl GetEntry {
2206 pub(crate) fn new(
2207 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2208 ) -> Self {
2209 Self(RequestBuilder::new(stub))
2210 }
2211
2212 pub fn with_request<V: Into<crate::model::GetEntryRequest>>(mut self, v: V) -> Self {
2214 self.0.request = v.into();
2215 self
2216 }
2217
2218 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2220 self.0.options = v.into();
2221 self
2222 }
2223
2224 pub async fn send(self) -> Result<crate::model::Entry> {
2226 (*self.0.stub)
2227 .get_entry(self.0.request, self.0.options)
2228 .await
2229 .map(gax::response::Response::into_body)
2230 }
2231
2232 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2236 self.0.request.name = v.into();
2237 self
2238 }
2239
2240 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
2242 self.0.request.view = v.into();
2243 self
2244 }
2245
2246 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
2248 where
2249 T: std::iter::IntoIterator<Item = V>,
2250 V: std::convert::Into<std::string::String>,
2251 {
2252 use std::iter::Iterator;
2253 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
2254 self
2255 }
2256
2257 pub fn set_paths<T, V>(mut self, v: T) -> Self
2259 where
2260 T: std::iter::IntoIterator<Item = V>,
2261 V: std::convert::Into<std::string::String>,
2262 {
2263 use std::iter::Iterator;
2264 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
2265 self
2266 }
2267 }
2268
2269 #[doc(hidden)]
2270 impl gax::options::internal::RequestBuilder for GetEntry {
2271 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2272 &mut self.0.options
2273 }
2274 }
2275
2276 #[derive(Clone, Debug)]
2294 pub struct LookupEntry(RequestBuilder<crate::model::LookupEntryRequest>);
2295
2296 impl LookupEntry {
2297 pub(crate) fn new(
2298 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2299 ) -> Self {
2300 Self(RequestBuilder::new(stub))
2301 }
2302
2303 pub fn with_request<V: Into<crate::model::LookupEntryRequest>>(mut self, v: V) -> Self {
2305 self.0.request = v.into();
2306 self
2307 }
2308
2309 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2311 self.0.options = v.into();
2312 self
2313 }
2314
2315 pub async fn send(self) -> Result<crate::model::Entry> {
2317 (*self.0.stub)
2318 .lookup_entry(self.0.request, self.0.options)
2319 .await
2320 .map(gax::response::Response::into_body)
2321 }
2322
2323 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2327 self.0.request.name = v.into();
2328 self
2329 }
2330
2331 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
2333 self.0.request.view = v.into();
2334 self
2335 }
2336
2337 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
2339 where
2340 T: std::iter::IntoIterator<Item = V>,
2341 V: std::convert::Into<std::string::String>,
2342 {
2343 use std::iter::Iterator;
2344 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
2345 self
2346 }
2347
2348 pub fn set_paths<T, V>(mut self, v: T) -> Self
2350 where
2351 T: std::iter::IntoIterator<Item = V>,
2352 V: std::convert::Into<std::string::String>,
2353 {
2354 use std::iter::Iterator;
2355 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
2356 self
2357 }
2358
2359 pub fn set_entry<T: Into<std::string::String>>(mut self, v: T) -> Self {
2363 self.0.request.entry = v.into();
2364 self
2365 }
2366 }
2367
2368 #[doc(hidden)]
2369 impl gax::options::internal::RequestBuilder for LookupEntry {
2370 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2371 &mut self.0.options
2372 }
2373 }
2374
2375 #[derive(Clone, Debug)]
2397 pub struct SearchEntries(RequestBuilder<crate::model::SearchEntriesRequest>);
2398
2399 impl SearchEntries {
2400 pub(crate) fn new(
2401 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2402 ) -> Self {
2403 Self(RequestBuilder::new(stub))
2404 }
2405
2406 pub fn with_request<V: Into<crate::model::SearchEntriesRequest>>(mut self, v: V) -> Self {
2408 self.0.request = v.into();
2409 self
2410 }
2411
2412 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2414 self.0.options = v.into();
2415 self
2416 }
2417
2418 pub async fn send(self) -> Result<crate::model::SearchEntriesResponse> {
2420 (*self.0.stub)
2421 .search_entries(self.0.request, self.0.options)
2422 .await
2423 .map(gax::response::Response::into_body)
2424 }
2425
2426 pub fn by_page(
2428 self,
2429 ) -> impl gax::paginator::Paginator<crate::model::SearchEntriesResponse, gax::error::Error>
2430 {
2431 use std::clone::Clone;
2432 let token = self.0.request.page_token.clone();
2433 let execute = move |token: String| {
2434 let mut builder = self.clone();
2435 builder.0.request = builder.0.request.set_page_token(token);
2436 builder.send()
2437 };
2438 gax::paginator::internal::new_paginator(token, execute)
2439 }
2440
2441 pub fn by_item(
2443 self,
2444 ) -> impl gax::paginator::ItemPaginator<crate::model::SearchEntriesResponse, gax::error::Error>
2445 {
2446 use gax::paginator::Paginator;
2447 self.by_page().items()
2448 }
2449
2450 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2454 self.0.request.name = v.into();
2455 self
2456 }
2457
2458 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
2462 self.0.request.query = v.into();
2463 self
2464 }
2465
2466 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2468 self.0.request.page_size = v.into();
2469 self
2470 }
2471
2472 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2474 self.0.request.page_token = v.into();
2475 self
2476 }
2477
2478 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2480 self.0.request.order_by = v.into();
2481 self
2482 }
2483
2484 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
2486 self.0.request.scope = v.into();
2487 self
2488 }
2489
2490 pub fn set_semantic_search<T: Into<bool>>(mut self, v: T) -> Self {
2492 self.0.request.semantic_search = v.into();
2493 self
2494 }
2495 }
2496
2497 #[doc(hidden)]
2498 impl gax::options::internal::RequestBuilder for SearchEntries {
2499 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2500 &mut self.0.options
2501 }
2502 }
2503
2504 #[derive(Clone, Debug)]
2523 pub struct CreateMetadataJob(RequestBuilder<crate::model::CreateMetadataJobRequest>);
2524
2525 impl CreateMetadataJob {
2526 pub(crate) fn new(
2527 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2528 ) -> Self {
2529 Self(RequestBuilder::new(stub))
2530 }
2531
2532 pub fn with_request<V: Into<crate::model::CreateMetadataJobRequest>>(
2534 mut self,
2535 v: V,
2536 ) -> Self {
2537 self.0.request = v.into();
2538 self
2539 }
2540
2541 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2543 self.0.options = v.into();
2544 self
2545 }
2546
2547 pub async fn send(self) -> Result<longrunning::model::Operation> {
2554 (*self.0.stub)
2555 .create_metadata_job(self.0.request, self.0.options)
2556 .await
2557 .map(gax::response::Response::into_body)
2558 }
2559
2560 pub fn poller(
2562 self,
2563 ) -> impl lro::Poller<crate::model::MetadataJob, crate::model::OperationMetadata> {
2564 type Operation = lro::internal::Operation<
2565 crate::model::MetadataJob,
2566 crate::model::OperationMetadata,
2567 >;
2568 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2569 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2570
2571 let stub = self.0.stub.clone();
2572 let mut options = self.0.options.clone();
2573 options.set_retry_policy(gax::retry_policy::NeverRetry);
2574 let query = move |name| {
2575 let stub = stub.clone();
2576 let options = options.clone();
2577 async {
2578 let op = GetOperation::new(stub)
2579 .set_name(name)
2580 .with_options(options)
2581 .send()
2582 .await?;
2583 Ok(Operation::new(op))
2584 }
2585 };
2586
2587 let start = move || async {
2588 let op = self.send().await?;
2589 Ok(Operation::new(op))
2590 };
2591
2592 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2593 }
2594
2595 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2599 self.0.request.parent = v.into();
2600 self
2601 }
2602
2603 pub fn set_metadata_job<T>(mut self, v: T) -> Self
2607 where
2608 T: std::convert::Into<crate::model::MetadataJob>,
2609 {
2610 self.0.request.metadata_job = std::option::Option::Some(v.into());
2611 self
2612 }
2613
2614 pub fn set_or_clear_metadata_job<T>(mut self, v: std::option::Option<T>) -> Self
2618 where
2619 T: std::convert::Into<crate::model::MetadataJob>,
2620 {
2621 self.0.request.metadata_job = v.map(|x| x.into());
2622 self
2623 }
2624
2625 pub fn set_metadata_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2627 self.0.request.metadata_job_id = v.into();
2628 self
2629 }
2630
2631 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2633 self.0.request.validate_only = v.into();
2634 self
2635 }
2636 }
2637
2638 #[doc(hidden)]
2639 impl gax::options::internal::RequestBuilder for CreateMetadataJob {
2640 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2641 &mut self.0.options
2642 }
2643 }
2644
2645 #[derive(Clone, Debug)]
2663 pub struct GetMetadataJob(RequestBuilder<crate::model::GetMetadataJobRequest>);
2664
2665 impl GetMetadataJob {
2666 pub(crate) fn new(
2667 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2668 ) -> Self {
2669 Self(RequestBuilder::new(stub))
2670 }
2671
2672 pub fn with_request<V: Into<crate::model::GetMetadataJobRequest>>(mut self, v: V) -> Self {
2674 self.0.request = v.into();
2675 self
2676 }
2677
2678 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2680 self.0.options = v.into();
2681 self
2682 }
2683
2684 pub async fn send(self) -> Result<crate::model::MetadataJob> {
2686 (*self.0.stub)
2687 .get_metadata_job(self.0.request, self.0.options)
2688 .await
2689 .map(gax::response::Response::into_body)
2690 }
2691
2692 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2696 self.0.request.name = v.into();
2697 self
2698 }
2699 }
2700
2701 #[doc(hidden)]
2702 impl gax::options::internal::RequestBuilder for GetMetadataJob {
2703 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2704 &mut self.0.options
2705 }
2706 }
2707
2708 #[derive(Clone, Debug)]
2730 pub struct ListMetadataJobs(RequestBuilder<crate::model::ListMetadataJobsRequest>);
2731
2732 impl ListMetadataJobs {
2733 pub(crate) fn new(
2734 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2735 ) -> Self {
2736 Self(RequestBuilder::new(stub))
2737 }
2738
2739 pub fn with_request<V: Into<crate::model::ListMetadataJobsRequest>>(
2741 mut self,
2742 v: V,
2743 ) -> Self {
2744 self.0.request = v.into();
2745 self
2746 }
2747
2748 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2750 self.0.options = v.into();
2751 self
2752 }
2753
2754 pub async fn send(self) -> Result<crate::model::ListMetadataJobsResponse> {
2756 (*self.0.stub)
2757 .list_metadata_jobs(self.0.request, self.0.options)
2758 .await
2759 .map(gax::response::Response::into_body)
2760 }
2761
2762 pub fn by_page(
2764 self,
2765 ) -> impl gax::paginator::Paginator<crate::model::ListMetadataJobsResponse, gax::error::Error>
2766 {
2767 use std::clone::Clone;
2768 let token = self.0.request.page_token.clone();
2769 let execute = move |token: String| {
2770 let mut builder = self.clone();
2771 builder.0.request = builder.0.request.set_page_token(token);
2772 builder.send()
2773 };
2774 gax::paginator::internal::new_paginator(token, execute)
2775 }
2776
2777 pub fn by_item(
2779 self,
2780 ) -> impl gax::paginator::ItemPaginator<crate::model::ListMetadataJobsResponse, gax::error::Error>
2781 {
2782 use gax::paginator::Paginator;
2783 self.by_page().items()
2784 }
2785
2786 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2790 self.0.request.parent = v.into();
2791 self
2792 }
2793
2794 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2796 self.0.request.page_size = v.into();
2797 self
2798 }
2799
2800 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2802 self.0.request.page_token = v.into();
2803 self
2804 }
2805
2806 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2808 self.0.request.filter = v.into();
2809 self
2810 }
2811
2812 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2814 self.0.request.order_by = v.into();
2815 self
2816 }
2817 }
2818
2819 #[doc(hidden)]
2820 impl gax::options::internal::RequestBuilder for ListMetadataJobs {
2821 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2822 &mut self.0.options
2823 }
2824 }
2825
2826 #[derive(Clone, Debug)]
2844 pub struct CancelMetadataJob(RequestBuilder<crate::model::CancelMetadataJobRequest>);
2845
2846 impl CancelMetadataJob {
2847 pub(crate) fn new(
2848 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2849 ) -> Self {
2850 Self(RequestBuilder::new(stub))
2851 }
2852
2853 pub fn with_request<V: Into<crate::model::CancelMetadataJobRequest>>(
2855 mut self,
2856 v: V,
2857 ) -> Self {
2858 self.0.request = v.into();
2859 self
2860 }
2861
2862 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2864 self.0.options = v.into();
2865 self
2866 }
2867
2868 pub async fn send(self) -> Result<()> {
2870 (*self.0.stub)
2871 .cancel_metadata_job(self.0.request, self.0.options)
2872 .await
2873 .map(gax::response::Response::into_body)
2874 }
2875
2876 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2880 self.0.request.name = v.into();
2881 self
2882 }
2883 }
2884
2885 #[doc(hidden)]
2886 impl gax::options::internal::RequestBuilder for CancelMetadataJob {
2887 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2888 &mut self.0.options
2889 }
2890 }
2891
2892 #[derive(Clone, Debug)]
2914 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2915
2916 impl ListLocations {
2917 pub(crate) fn new(
2918 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2919 ) -> Self {
2920 Self(RequestBuilder::new(stub))
2921 }
2922
2923 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2925 mut self,
2926 v: V,
2927 ) -> Self {
2928 self.0.request = v.into();
2929 self
2930 }
2931
2932 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2934 self.0.options = v.into();
2935 self
2936 }
2937
2938 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2940 (*self.0.stub)
2941 .list_locations(self.0.request, self.0.options)
2942 .await
2943 .map(gax::response::Response::into_body)
2944 }
2945
2946 pub fn by_page(
2948 self,
2949 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2950 {
2951 use std::clone::Clone;
2952 let token = self.0.request.page_token.clone();
2953 let execute = move |token: String| {
2954 let mut builder = self.clone();
2955 builder.0.request = builder.0.request.set_page_token(token);
2956 builder.send()
2957 };
2958 gax::paginator::internal::new_paginator(token, execute)
2959 }
2960
2961 pub fn by_item(
2963 self,
2964 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2965 {
2966 use gax::paginator::Paginator;
2967 self.by_page().items()
2968 }
2969
2970 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2972 self.0.request.name = v.into();
2973 self
2974 }
2975
2976 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2978 self.0.request.filter = v.into();
2979 self
2980 }
2981
2982 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2984 self.0.request.page_size = v.into();
2985 self
2986 }
2987
2988 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2990 self.0.request.page_token = v.into();
2991 self
2992 }
2993 }
2994
2995 #[doc(hidden)]
2996 impl gax::options::internal::RequestBuilder for ListLocations {
2997 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2998 &mut self.0.options
2999 }
3000 }
3001
3002 #[derive(Clone, Debug)]
3020 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3021
3022 impl GetLocation {
3023 pub(crate) fn new(
3024 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3025 ) -> Self {
3026 Self(RequestBuilder::new(stub))
3027 }
3028
3029 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3031 self.0.request = v.into();
3032 self
3033 }
3034
3035 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3037 self.0.options = v.into();
3038 self
3039 }
3040
3041 pub async fn send(self) -> Result<location::model::Location> {
3043 (*self.0.stub)
3044 .get_location(self.0.request, self.0.options)
3045 .await
3046 .map(gax::response::Response::into_body)
3047 }
3048
3049 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3051 self.0.request.name = v.into();
3052 self
3053 }
3054 }
3055
3056 #[doc(hidden)]
3057 impl gax::options::internal::RequestBuilder for GetLocation {
3058 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3059 &mut self.0.options
3060 }
3061 }
3062
3063 #[derive(Clone, Debug)]
3081 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
3082
3083 impl SetIamPolicy {
3084 pub(crate) fn new(
3085 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3086 ) -> Self {
3087 Self(RequestBuilder::new(stub))
3088 }
3089
3090 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
3092 self.0.request = v.into();
3093 self
3094 }
3095
3096 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3098 self.0.options = v.into();
3099 self
3100 }
3101
3102 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3104 (*self.0.stub)
3105 .set_iam_policy(self.0.request, self.0.options)
3106 .await
3107 .map(gax::response::Response::into_body)
3108 }
3109
3110 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3114 self.0.request.resource = v.into();
3115 self
3116 }
3117
3118 pub fn set_policy<T>(mut self, v: T) -> Self
3122 where
3123 T: std::convert::Into<iam_v1::model::Policy>,
3124 {
3125 self.0.request.policy = std::option::Option::Some(v.into());
3126 self
3127 }
3128
3129 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3133 where
3134 T: std::convert::Into<iam_v1::model::Policy>,
3135 {
3136 self.0.request.policy = v.map(|x| x.into());
3137 self
3138 }
3139
3140 pub fn set_update_mask<T>(mut self, v: T) -> Self
3142 where
3143 T: std::convert::Into<wkt::FieldMask>,
3144 {
3145 self.0.request.update_mask = std::option::Option::Some(v.into());
3146 self
3147 }
3148
3149 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3151 where
3152 T: std::convert::Into<wkt::FieldMask>,
3153 {
3154 self.0.request.update_mask = v.map(|x| x.into());
3155 self
3156 }
3157 }
3158
3159 #[doc(hidden)]
3160 impl gax::options::internal::RequestBuilder for SetIamPolicy {
3161 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3162 &mut self.0.options
3163 }
3164 }
3165
3166 #[derive(Clone, Debug)]
3184 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
3185
3186 impl GetIamPolicy {
3187 pub(crate) fn new(
3188 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3189 ) -> Self {
3190 Self(RequestBuilder::new(stub))
3191 }
3192
3193 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
3195 self.0.request = v.into();
3196 self
3197 }
3198
3199 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3201 self.0.options = v.into();
3202 self
3203 }
3204
3205 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3207 (*self.0.stub)
3208 .get_iam_policy(self.0.request, self.0.options)
3209 .await
3210 .map(gax::response::Response::into_body)
3211 }
3212
3213 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3217 self.0.request.resource = v.into();
3218 self
3219 }
3220
3221 pub fn set_options<T>(mut self, v: T) -> Self
3223 where
3224 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3225 {
3226 self.0.request.options = std::option::Option::Some(v.into());
3227 self
3228 }
3229
3230 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3232 where
3233 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
3234 {
3235 self.0.request.options = v.map(|x| x.into());
3236 self
3237 }
3238 }
3239
3240 #[doc(hidden)]
3241 impl gax::options::internal::RequestBuilder for GetIamPolicy {
3242 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3243 &mut self.0.options
3244 }
3245 }
3246
3247 #[derive(Clone, Debug)]
3265 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
3266
3267 impl TestIamPermissions {
3268 pub(crate) fn new(
3269 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3270 ) -> Self {
3271 Self(RequestBuilder::new(stub))
3272 }
3273
3274 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
3276 mut self,
3277 v: V,
3278 ) -> Self {
3279 self.0.request = v.into();
3280 self
3281 }
3282
3283 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3285 self.0.options = v.into();
3286 self
3287 }
3288
3289 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
3291 (*self.0.stub)
3292 .test_iam_permissions(self.0.request, self.0.options)
3293 .await
3294 .map(gax::response::Response::into_body)
3295 }
3296
3297 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3301 self.0.request.resource = v.into();
3302 self
3303 }
3304
3305 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3309 where
3310 T: std::iter::IntoIterator<Item = V>,
3311 V: std::convert::Into<std::string::String>,
3312 {
3313 use std::iter::Iterator;
3314 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3315 self
3316 }
3317 }
3318
3319 #[doc(hidden)]
3320 impl gax::options::internal::RequestBuilder for TestIamPermissions {
3321 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3322 &mut self.0.options
3323 }
3324 }
3325
3326 #[derive(Clone, Debug)]
3348 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3349
3350 impl ListOperations {
3351 pub(crate) fn new(
3352 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3353 ) -> Self {
3354 Self(RequestBuilder::new(stub))
3355 }
3356
3357 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3359 mut self,
3360 v: V,
3361 ) -> Self {
3362 self.0.request = v.into();
3363 self
3364 }
3365
3366 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3368 self.0.options = v.into();
3369 self
3370 }
3371
3372 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3374 (*self.0.stub)
3375 .list_operations(self.0.request, self.0.options)
3376 .await
3377 .map(gax::response::Response::into_body)
3378 }
3379
3380 pub fn by_page(
3382 self,
3383 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3384 {
3385 use std::clone::Clone;
3386 let token = self.0.request.page_token.clone();
3387 let execute = move |token: String| {
3388 let mut builder = self.clone();
3389 builder.0.request = builder.0.request.set_page_token(token);
3390 builder.send()
3391 };
3392 gax::paginator::internal::new_paginator(token, execute)
3393 }
3394
3395 pub fn by_item(
3397 self,
3398 ) -> impl gax::paginator::ItemPaginator<
3399 longrunning::model::ListOperationsResponse,
3400 gax::error::Error,
3401 > {
3402 use gax::paginator::Paginator;
3403 self.by_page().items()
3404 }
3405
3406 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3408 self.0.request.name = v.into();
3409 self
3410 }
3411
3412 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3414 self.0.request.filter = v.into();
3415 self
3416 }
3417
3418 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3420 self.0.request.page_size = v.into();
3421 self
3422 }
3423
3424 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3426 self.0.request.page_token = v.into();
3427 self
3428 }
3429 }
3430
3431 #[doc(hidden)]
3432 impl gax::options::internal::RequestBuilder for ListOperations {
3433 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3434 &mut self.0.options
3435 }
3436 }
3437
3438 #[derive(Clone, Debug)]
3456 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3457
3458 impl GetOperation {
3459 pub(crate) fn new(
3460 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3461 ) -> Self {
3462 Self(RequestBuilder::new(stub))
3463 }
3464
3465 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3467 mut self,
3468 v: V,
3469 ) -> Self {
3470 self.0.request = v.into();
3471 self
3472 }
3473
3474 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3476 self.0.options = v.into();
3477 self
3478 }
3479
3480 pub async fn send(self) -> Result<longrunning::model::Operation> {
3482 (*self.0.stub)
3483 .get_operation(self.0.request, self.0.options)
3484 .await
3485 .map(gax::response::Response::into_body)
3486 }
3487
3488 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3490 self.0.request.name = v.into();
3491 self
3492 }
3493 }
3494
3495 #[doc(hidden)]
3496 impl gax::options::internal::RequestBuilder for GetOperation {
3497 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3498 &mut self.0.options
3499 }
3500 }
3501
3502 #[derive(Clone, Debug)]
3520 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3521
3522 impl DeleteOperation {
3523 pub(crate) fn new(
3524 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3525 ) -> Self {
3526 Self(RequestBuilder::new(stub))
3527 }
3528
3529 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3531 mut self,
3532 v: V,
3533 ) -> Self {
3534 self.0.request = v.into();
3535 self
3536 }
3537
3538 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3540 self.0.options = v.into();
3541 self
3542 }
3543
3544 pub async fn send(self) -> Result<()> {
3546 (*self.0.stub)
3547 .delete_operation(self.0.request, self.0.options)
3548 .await
3549 .map(gax::response::Response::into_body)
3550 }
3551
3552 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3554 self.0.request.name = v.into();
3555 self
3556 }
3557 }
3558
3559 #[doc(hidden)]
3560 impl gax::options::internal::RequestBuilder for DeleteOperation {
3561 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3562 &mut self.0.options
3563 }
3564 }
3565
3566 #[derive(Clone, Debug)]
3584 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3585
3586 impl CancelOperation {
3587 pub(crate) fn new(
3588 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3589 ) -> Self {
3590 Self(RequestBuilder::new(stub))
3591 }
3592
3593 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3595 mut self,
3596 v: V,
3597 ) -> Self {
3598 self.0.request = v.into();
3599 self
3600 }
3601
3602 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3604 self.0.options = v.into();
3605 self
3606 }
3607
3608 pub async fn send(self) -> Result<()> {
3610 (*self.0.stub)
3611 .cancel_operation(self.0.request, self.0.options)
3612 .await
3613 .map(gax::response::Response::into_body)
3614 }
3615
3616 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3618 self.0.request.name = v.into();
3619 self
3620 }
3621 }
3622
3623 #[doc(hidden)]
3624 impl gax::options::internal::RequestBuilder for CancelOperation {
3625 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3626 &mut self.0.options
3627 }
3628 }
3629}
3630
3631pub mod cmek_service {
3632 use crate::Result;
3633
3634 pub type ClientBuilder =
3648 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3649
3650 pub(crate) mod client {
3651 use super::super::super::client::CmekService;
3652 pub struct Factory;
3653 impl gax::client_builder::internal::ClientFactory for Factory {
3654 type Client = CmekService;
3655 type Credentials = gaxi::options::Credentials;
3656 async fn build(
3657 self,
3658 config: gaxi::options::ClientConfig,
3659 ) -> gax::client_builder::Result<Self::Client> {
3660 Self::Client::new(config).await
3661 }
3662 }
3663 }
3664
3665 #[derive(Clone, Debug)]
3667 pub(crate) struct RequestBuilder<R: std::default::Default> {
3668 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
3669 request: R,
3670 options: gax::options::RequestOptions,
3671 }
3672
3673 impl<R> RequestBuilder<R>
3674 where
3675 R: std::default::Default,
3676 {
3677 pub(crate) fn new(
3678 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
3679 ) -> Self {
3680 Self {
3681 stub,
3682 request: R::default(),
3683 options: gax::options::RequestOptions::default(),
3684 }
3685 }
3686 }
3687
3688 #[derive(Clone, Debug)]
3707 pub struct CreateEncryptionConfig(RequestBuilder<crate::model::CreateEncryptionConfigRequest>);
3708
3709 impl CreateEncryptionConfig {
3710 pub(crate) fn new(
3711 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
3712 ) -> Self {
3713 Self(RequestBuilder::new(stub))
3714 }
3715
3716 pub fn with_request<V: Into<crate::model::CreateEncryptionConfigRequest>>(
3718 mut self,
3719 v: V,
3720 ) -> Self {
3721 self.0.request = v.into();
3722 self
3723 }
3724
3725 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3727 self.0.options = v.into();
3728 self
3729 }
3730
3731 pub async fn send(self) -> Result<longrunning::model::Operation> {
3738 (*self.0.stub)
3739 .create_encryption_config(self.0.request, self.0.options)
3740 .await
3741 .map(gax::response::Response::into_body)
3742 }
3743
3744 pub fn poller(
3746 self,
3747 ) -> impl lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
3748 {
3749 type Operation = lro::internal::Operation<
3750 crate::model::EncryptionConfig,
3751 crate::model::OperationMetadata,
3752 >;
3753 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3754 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3755
3756 let stub = self.0.stub.clone();
3757 let mut options = self.0.options.clone();
3758 options.set_retry_policy(gax::retry_policy::NeverRetry);
3759 let query = move |name| {
3760 let stub = stub.clone();
3761 let options = options.clone();
3762 async {
3763 let op = GetOperation::new(stub)
3764 .set_name(name)
3765 .with_options(options)
3766 .send()
3767 .await?;
3768 Ok(Operation::new(op))
3769 }
3770 };
3771
3772 let start = move || async {
3773 let op = self.send().await?;
3774 Ok(Operation::new(op))
3775 };
3776
3777 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3778 }
3779
3780 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3784 self.0.request.parent = v.into();
3785 self
3786 }
3787
3788 pub fn set_encryption_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3792 self.0.request.encryption_config_id = v.into();
3793 self
3794 }
3795
3796 pub fn set_encryption_config<T>(mut self, v: T) -> Self
3800 where
3801 T: std::convert::Into<crate::model::EncryptionConfig>,
3802 {
3803 self.0.request.encryption_config = std::option::Option::Some(v.into());
3804 self
3805 }
3806
3807 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
3811 where
3812 T: std::convert::Into<crate::model::EncryptionConfig>,
3813 {
3814 self.0.request.encryption_config = v.map(|x| x.into());
3815 self
3816 }
3817 }
3818
3819 #[doc(hidden)]
3820 impl gax::options::internal::RequestBuilder for CreateEncryptionConfig {
3821 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3822 &mut self.0.options
3823 }
3824 }
3825
3826 #[derive(Clone, Debug)]
3845 pub struct UpdateEncryptionConfig(RequestBuilder<crate::model::UpdateEncryptionConfigRequest>);
3846
3847 impl UpdateEncryptionConfig {
3848 pub(crate) fn new(
3849 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
3850 ) -> Self {
3851 Self(RequestBuilder::new(stub))
3852 }
3853
3854 pub fn with_request<V: Into<crate::model::UpdateEncryptionConfigRequest>>(
3856 mut self,
3857 v: V,
3858 ) -> Self {
3859 self.0.request = v.into();
3860 self
3861 }
3862
3863 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3865 self.0.options = v.into();
3866 self
3867 }
3868
3869 pub async fn send(self) -> Result<longrunning::model::Operation> {
3876 (*self.0.stub)
3877 .update_encryption_config(self.0.request, self.0.options)
3878 .await
3879 .map(gax::response::Response::into_body)
3880 }
3881
3882 pub fn poller(
3884 self,
3885 ) -> impl lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
3886 {
3887 type Operation = lro::internal::Operation<
3888 crate::model::EncryptionConfig,
3889 crate::model::OperationMetadata,
3890 >;
3891 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3892 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3893
3894 let stub = self.0.stub.clone();
3895 let mut options = self.0.options.clone();
3896 options.set_retry_policy(gax::retry_policy::NeverRetry);
3897 let query = move |name| {
3898 let stub = stub.clone();
3899 let options = options.clone();
3900 async {
3901 let op = GetOperation::new(stub)
3902 .set_name(name)
3903 .with_options(options)
3904 .send()
3905 .await?;
3906 Ok(Operation::new(op))
3907 }
3908 };
3909
3910 let start = move || async {
3911 let op = self.send().await?;
3912 Ok(Operation::new(op))
3913 };
3914
3915 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3916 }
3917
3918 pub fn set_encryption_config<T>(mut self, v: T) -> Self
3922 where
3923 T: std::convert::Into<crate::model::EncryptionConfig>,
3924 {
3925 self.0.request.encryption_config = std::option::Option::Some(v.into());
3926 self
3927 }
3928
3929 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
3933 where
3934 T: std::convert::Into<crate::model::EncryptionConfig>,
3935 {
3936 self.0.request.encryption_config = v.map(|x| x.into());
3937 self
3938 }
3939
3940 pub fn set_update_mask<T>(mut self, v: T) -> Self
3942 where
3943 T: std::convert::Into<wkt::FieldMask>,
3944 {
3945 self.0.request.update_mask = std::option::Option::Some(v.into());
3946 self
3947 }
3948
3949 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3951 where
3952 T: std::convert::Into<wkt::FieldMask>,
3953 {
3954 self.0.request.update_mask = v.map(|x| x.into());
3955 self
3956 }
3957 }
3958
3959 #[doc(hidden)]
3960 impl gax::options::internal::RequestBuilder for UpdateEncryptionConfig {
3961 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3962 &mut self.0.options
3963 }
3964 }
3965
3966 #[derive(Clone, Debug)]
3985 pub struct DeleteEncryptionConfig(RequestBuilder<crate::model::DeleteEncryptionConfigRequest>);
3986
3987 impl DeleteEncryptionConfig {
3988 pub(crate) fn new(
3989 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
3990 ) -> Self {
3991 Self(RequestBuilder::new(stub))
3992 }
3993
3994 pub fn with_request<V: Into<crate::model::DeleteEncryptionConfigRequest>>(
3996 mut self,
3997 v: V,
3998 ) -> Self {
3999 self.0.request = v.into();
4000 self
4001 }
4002
4003 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4005 self.0.options = v.into();
4006 self
4007 }
4008
4009 pub async fn send(self) -> Result<longrunning::model::Operation> {
4016 (*self.0.stub)
4017 .delete_encryption_config(self.0.request, self.0.options)
4018 .await
4019 .map(gax::response::Response::into_body)
4020 }
4021
4022 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4024 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4025 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4026 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4027
4028 let stub = self.0.stub.clone();
4029 let mut options = self.0.options.clone();
4030 options.set_retry_policy(gax::retry_policy::NeverRetry);
4031 let query = move |name| {
4032 let stub = stub.clone();
4033 let options = options.clone();
4034 async {
4035 let op = GetOperation::new(stub)
4036 .set_name(name)
4037 .with_options(options)
4038 .send()
4039 .await?;
4040 Ok(Operation::new(op))
4041 }
4042 };
4043
4044 let start = move || async {
4045 let op = self.send().await?;
4046 Ok(Operation::new(op))
4047 };
4048
4049 lro::internal::new_unit_response_poller(
4050 polling_error_policy,
4051 polling_backoff_policy,
4052 start,
4053 query,
4054 )
4055 }
4056
4057 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4061 self.0.request.name = v.into();
4062 self
4063 }
4064
4065 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4067 self.0.request.etag = v.into();
4068 self
4069 }
4070 }
4071
4072 #[doc(hidden)]
4073 impl gax::options::internal::RequestBuilder for DeleteEncryptionConfig {
4074 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4075 &mut self.0.options
4076 }
4077 }
4078
4079 #[derive(Clone, Debug)]
4101 pub struct ListEncryptionConfigs(RequestBuilder<crate::model::ListEncryptionConfigsRequest>);
4102
4103 impl ListEncryptionConfigs {
4104 pub(crate) fn new(
4105 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
4106 ) -> Self {
4107 Self(RequestBuilder::new(stub))
4108 }
4109
4110 pub fn with_request<V: Into<crate::model::ListEncryptionConfigsRequest>>(
4112 mut self,
4113 v: V,
4114 ) -> Self {
4115 self.0.request = v.into();
4116 self
4117 }
4118
4119 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4121 self.0.options = v.into();
4122 self
4123 }
4124
4125 pub async fn send(self) -> Result<crate::model::ListEncryptionConfigsResponse> {
4127 (*self.0.stub)
4128 .list_encryption_configs(self.0.request, self.0.options)
4129 .await
4130 .map(gax::response::Response::into_body)
4131 }
4132
4133 pub fn by_page(
4135 self,
4136 ) -> impl gax::paginator::Paginator<crate::model::ListEncryptionConfigsResponse, gax::error::Error>
4137 {
4138 use std::clone::Clone;
4139 let token = self.0.request.page_token.clone();
4140 let execute = move |token: String| {
4141 let mut builder = self.clone();
4142 builder.0.request = builder.0.request.set_page_token(token);
4143 builder.send()
4144 };
4145 gax::paginator::internal::new_paginator(token, execute)
4146 }
4147
4148 pub fn by_item(
4150 self,
4151 ) -> impl gax::paginator::ItemPaginator<
4152 crate::model::ListEncryptionConfigsResponse,
4153 gax::error::Error,
4154 > {
4155 use gax::paginator::Paginator;
4156 self.by_page().items()
4157 }
4158
4159 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4163 self.0.request.parent = v.into();
4164 self
4165 }
4166
4167 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4169 self.0.request.page_size = v.into();
4170 self
4171 }
4172
4173 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4175 self.0.request.page_token = v.into();
4176 self
4177 }
4178
4179 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4181 self.0.request.filter = v.into();
4182 self
4183 }
4184
4185 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4187 self.0.request.order_by = v.into();
4188 self
4189 }
4190 }
4191
4192 #[doc(hidden)]
4193 impl gax::options::internal::RequestBuilder for ListEncryptionConfigs {
4194 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4195 &mut self.0.options
4196 }
4197 }
4198
4199 #[derive(Clone, Debug)]
4217 pub struct GetEncryptionConfig(RequestBuilder<crate::model::GetEncryptionConfigRequest>);
4218
4219 impl GetEncryptionConfig {
4220 pub(crate) fn new(
4221 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
4222 ) -> Self {
4223 Self(RequestBuilder::new(stub))
4224 }
4225
4226 pub fn with_request<V: Into<crate::model::GetEncryptionConfigRequest>>(
4228 mut self,
4229 v: V,
4230 ) -> Self {
4231 self.0.request = v.into();
4232 self
4233 }
4234
4235 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4237 self.0.options = v.into();
4238 self
4239 }
4240
4241 pub async fn send(self) -> Result<crate::model::EncryptionConfig> {
4243 (*self.0.stub)
4244 .get_encryption_config(self.0.request, self.0.options)
4245 .await
4246 .map(gax::response::Response::into_body)
4247 }
4248
4249 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4253 self.0.request.name = v.into();
4254 self
4255 }
4256 }
4257
4258 #[doc(hidden)]
4259 impl gax::options::internal::RequestBuilder for GetEncryptionConfig {
4260 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4261 &mut self.0.options
4262 }
4263 }
4264
4265 #[derive(Clone, Debug)]
4287 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4288
4289 impl ListLocations {
4290 pub(crate) fn new(
4291 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
4292 ) -> Self {
4293 Self(RequestBuilder::new(stub))
4294 }
4295
4296 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4298 mut self,
4299 v: V,
4300 ) -> Self {
4301 self.0.request = v.into();
4302 self
4303 }
4304
4305 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4307 self.0.options = v.into();
4308 self
4309 }
4310
4311 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4313 (*self.0.stub)
4314 .list_locations(self.0.request, self.0.options)
4315 .await
4316 .map(gax::response::Response::into_body)
4317 }
4318
4319 pub fn by_page(
4321 self,
4322 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4323 {
4324 use std::clone::Clone;
4325 let token = self.0.request.page_token.clone();
4326 let execute = move |token: String| {
4327 let mut builder = self.clone();
4328 builder.0.request = builder.0.request.set_page_token(token);
4329 builder.send()
4330 };
4331 gax::paginator::internal::new_paginator(token, execute)
4332 }
4333
4334 pub fn by_item(
4336 self,
4337 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4338 {
4339 use gax::paginator::Paginator;
4340 self.by_page().items()
4341 }
4342
4343 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4345 self.0.request.name = v.into();
4346 self
4347 }
4348
4349 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4351 self.0.request.filter = v.into();
4352 self
4353 }
4354
4355 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4357 self.0.request.page_size = v.into();
4358 self
4359 }
4360
4361 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4363 self.0.request.page_token = v.into();
4364 self
4365 }
4366 }
4367
4368 #[doc(hidden)]
4369 impl gax::options::internal::RequestBuilder for ListLocations {
4370 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4371 &mut self.0.options
4372 }
4373 }
4374
4375 #[derive(Clone, Debug)]
4393 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4394
4395 impl GetLocation {
4396 pub(crate) fn new(
4397 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
4398 ) -> Self {
4399 Self(RequestBuilder::new(stub))
4400 }
4401
4402 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4404 self.0.request = v.into();
4405 self
4406 }
4407
4408 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4410 self.0.options = v.into();
4411 self
4412 }
4413
4414 pub async fn send(self) -> Result<location::model::Location> {
4416 (*self.0.stub)
4417 .get_location(self.0.request, self.0.options)
4418 .await
4419 .map(gax::response::Response::into_body)
4420 }
4421
4422 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4424 self.0.request.name = v.into();
4425 self
4426 }
4427 }
4428
4429 #[doc(hidden)]
4430 impl gax::options::internal::RequestBuilder for GetLocation {
4431 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4432 &mut self.0.options
4433 }
4434 }
4435
4436 #[derive(Clone, Debug)]
4454 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4455
4456 impl SetIamPolicy {
4457 pub(crate) fn new(
4458 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
4459 ) -> Self {
4460 Self(RequestBuilder::new(stub))
4461 }
4462
4463 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4465 self.0.request = v.into();
4466 self
4467 }
4468
4469 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4471 self.0.options = v.into();
4472 self
4473 }
4474
4475 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4477 (*self.0.stub)
4478 .set_iam_policy(self.0.request, self.0.options)
4479 .await
4480 .map(gax::response::Response::into_body)
4481 }
4482
4483 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4487 self.0.request.resource = v.into();
4488 self
4489 }
4490
4491 pub fn set_policy<T>(mut self, v: T) -> Self
4495 where
4496 T: std::convert::Into<iam_v1::model::Policy>,
4497 {
4498 self.0.request.policy = std::option::Option::Some(v.into());
4499 self
4500 }
4501
4502 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4506 where
4507 T: std::convert::Into<iam_v1::model::Policy>,
4508 {
4509 self.0.request.policy = v.map(|x| x.into());
4510 self
4511 }
4512
4513 pub fn set_update_mask<T>(mut self, v: T) -> Self
4515 where
4516 T: std::convert::Into<wkt::FieldMask>,
4517 {
4518 self.0.request.update_mask = std::option::Option::Some(v.into());
4519 self
4520 }
4521
4522 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4524 where
4525 T: std::convert::Into<wkt::FieldMask>,
4526 {
4527 self.0.request.update_mask = v.map(|x| x.into());
4528 self
4529 }
4530 }
4531
4532 #[doc(hidden)]
4533 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4534 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4535 &mut self.0.options
4536 }
4537 }
4538
4539 #[derive(Clone, Debug)]
4557 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4558
4559 impl GetIamPolicy {
4560 pub(crate) fn new(
4561 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
4562 ) -> Self {
4563 Self(RequestBuilder::new(stub))
4564 }
4565
4566 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4568 self.0.request = v.into();
4569 self
4570 }
4571
4572 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4574 self.0.options = v.into();
4575 self
4576 }
4577
4578 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4580 (*self.0.stub)
4581 .get_iam_policy(self.0.request, self.0.options)
4582 .await
4583 .map(gax::response::Response::into_body)
4584 }
4585
4586 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4590 self.0.request.resource = v.into();
4591 self
4592 }
4593
4594 pub fn set_options<T>(mut self, v: T) -> Self
4596 where
4597 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4598 {
4599 self.0.request.options = std::option::Option::Some(v.into());
4600 self
4601 }
4602
4603 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4605 where
4606 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4607 {
4608 self.0.request.options = v.map(|x| x.into());
4609 self
4610 }
4611 }
4612
4613 #[doc(hidden)]
4614 impl gax::options::internal::RequestBuilder for GetIamPolicy {
4615 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4616 &mut self.0.options
4617 }
4618 }
4619
4620 #[derive(Clone, Debug)]
4638 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4639
4640 impl TestIamPermissions {
4641 pub(crate) fn new(
4642 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
4643 ) -> Self {
4644 Self(RequestBuilder::new(stub))
4645 }
4646
4647 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4649 mut self,
4650 v: V,
4651 ) -> Self {
4652 self.0.request = v.into();
4653 self
4654 }
4655
4656 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4658 self.0.options = v.into();
4659 self
4660 }
4661
4662 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4664 (*self.0.stub)
4665 .test_iam_permissions(self.0.request, self.0.options)
4666 .await
4667 .map(gax::response::Response::into_body)
4668 }
4669
4670 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4674 self.0.request.resource = v.into();
4675 self
4676 }
4677
4678 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4682 where
4683 T: std::iter::IntoIterator<Item = V>,
4684 V: std::convert::Into<std::string::String>,
4685 {
4686 use std::iter::Iterator;
4687 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4688 self
4689 }
4690 }
4691
4692 #[doc(hidden)]
4693 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4694 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4695 &mut self.0.options
4696 }
4697 }
4698
4699 #[derive(Clone, Debug)]
4721 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4722
4723 impl ListOperations {
4724 pub(crate) fn new(
4725 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
4726 ) -> Self {
4727 Self(RequestBuilder::new(stub))
4728 }
4729
4730 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4732 mut self,
4733 v: V,
4734 ) -> Self {
4735 self.0.request = v.into();
4736 self
4737 }
4738
4739 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4741 self.0.options = v.into();
4742 self
4743 }
4744
4745 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4747 (*self.0.stub)
4748 .list_operations(self.0.request, self.0.options)
4749 .await
4750 .map(gax::response::Response::into_body)
4751 }
4752
4753 pub fn by_page(
4755 self,
4756 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4757 {
4758 use std::clone::Clone;
4759 let token = self.0.request.page_token.clone();
4760 let execute = move |token: String| {
4761 let mut builder = self.clone();
4762 builder.0.request = builder.0.request.set_page_token(token);
4763 builder.send()
4764 };
4765 gax::paginator::internal::new_paginator(token, execute)
4766 }
4767
4768 pub fn by_item(
4770 self,
4771 ) -> impl gax::paginator::ItemPaginator<
4772 longrunning::model::ListOperationsResponse,
4773 gax::error::Error,
4774 > {
4775 use gax::paginator::Paginator;
4776 self.by_page().items()
4777 }
4778
4779 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4781 self.0.request.name = v.into();
4782 self
4783 }
4784
4785 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4787 self.0.request.filter = v.into();
4788 self
4789 }
4790
4791 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4793 self.0.request.page_size = v.into();
4794 self
4795 }
4796
4797 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4799 self.0.request.page_token = v.into();
4800 self
4801 }
4802 }
4803
4804 #[doc(hidden)]
4805 impl gax::options::internal::RequestBuilder for ListOperations {
4806 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4807 &mut self.0.options
4808 }
4809 }
4810
4811 #[derive(Clone, Debug)]
4829 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4830
4831 impl GetOperation {
4832 pub(crate) fn new(
4833 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
4834 ) -> Self {
4835 Self(RequestBuilder::new(stub))
4836 }
4837
4838 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4840 mut self,
4841 v: V,
4842 ) -> Self {
4843 self.0.request = v.into();
4844 self
4845 }
4846
4847 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4849 self.0.options = v.into();
4850 self
4851 }
4852
4853 pub async fn send(self) -> Result<longrunning::model::Operation> {
4855 (*self.0.stub)
4856 .get_operation(self.0.request, self.0.options)
4857 .await
4858 .map(gax::response::Response::into_body)
4859 }
4860
4861 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4863 self.0.request.name = v.into();
4864 self
4865 }
4866 }
4867
4868 #[doc(hidden)]
4869 impl gax::options::internal::RequestBuilder for GetOperation {
4870 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4871 &mut self.0.options
4872 }
4873 }
4874
4875 #[derive(Clone, Debug)]
4893 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4894
4895 impl DeleteOperation {
4896 pub(crate) fn new(
4897 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
4898 ) -> Self {
4899 Self(RequestBuilder::new(stub))
4900 }
4901
4902 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4904 mut self,
4905 v: V,
4906 ) -> Self {
4907 self.0.request = v.into();
4908 self
4909 }
4910
4911 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4913 self.0.options = v.into();
4914 self
4915 }
4916
4917 pub async fn send(self) -> Result<()> {
4919 (*self.0.stub)
4920 .delete_operation(self.0.request, self.0.options)
4921 .await
4922 .map(gax::response::Response::into_body)
4923 }
4924
4925 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4927 self.0.request.name = v.into();
4928 self
4929 }
4930 }
4931
4932 #[doc(hidden)]
4933 impl gax::options::internal::RequestBuilder for DeleteOperation {
4934 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4935 &mut self.0.options
4936 }
4937 }
4938
4939 #[derive(Clone, Debug)]
4957 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4958
4959 impl CancelOperation {
4960 pub(crate) fn new(
4961 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
4962 ) -> Self {
4963 Self(RequestBuilder::new(stub))
4964 }
4965
4966 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4968 mut self,
4969 v: V,
4970 ) -> Self {
4971 self.0.request = v.into();
4972 self
4973 }
4974
4975 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4977 self.0.options = v.into();
4978 self
4979 }
4980
4981 pub async fn send(self) -> Result<()> {
4983 (*self.0.stub)
4984 .cancel_operation(self.0.request, self.0.options)
4985 .await
4986 .map(gax::response::Response::into_body)
4987 }
4988
4989 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4991 self.0.request.name = v.into();
4992 self
4993 }
4994 }
4995
4996 #[doc(hidden)]
4997 impl gax::options::internal::RequestBuilder for CancelOperation {
4998 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4999 &mut self.0.options
5000 }
5001 }
5002}
5003
5004pub mod content_service {
5005 use crate::Result;
5006
5007 pub type ClientBuilder =
5021 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5022
5023 pub(crate) mod client {
5024 use super::super::super::client::ContentService;
5025 pub struct Factory;
5026 impl gax::client_builder::internal::ClientFactory for Factory {
5027 type Client = ContentService;
5028 type Credentials = gaxi::options::Credentials;
5029 async fn build(
5030 self,
5031 config: gaxi::options::ClientConfig,
5032 ) -> gax::client_builder::Result<Self::Client> {
5033 Self::Client::new(config).await
5034 }
5035 }
5036 }
5037
5038 #[derive(Clone, Debug)]
5040 pub(crate) struct RequestBuilder<R: std::default::Default> {
5041 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5042 request: R,
5043 options: gax::options::RequestOptions,
5044 }
5045
5046 impl<R> RequestBuilder<R>
5047 where
5048 R: std::default::Default,
5049 {
5050 pub(crate) fn new(
5051 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5052 ) -> Self {
5053 Self {
5054 stub,
5055 request: R::default(),
5056 options: gax::options::RequestOptions::default(),
5057 }
5058 }
5059 }
5060
5061 #[derive(Clone, Debug)]
5079 pub struct CreateContent(RequestBuilder<crate::model::CreateContentRequest>);
5080
5081 impl CreateContent {
5082 pub(crate) fn new(
5083 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5084 ) -> Self {
5085 Self(RequestBuilder::new(stub))
5086 }
5087
5088 pub fn with_request<V: Into<crate::model::CreateContentRequest>>(mut self, v: V) -> Self {
5090 self.0.request = v.into();
5091 self
5092 }
5093
5094 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5096 self.0.options = v.into();
5097 self
5098 }
5099
5100 pub async fn send(self) -> Result<crate::model::Content> {
5102 (*self.0.stub)
5103 .create_content(self.0.request, self.0.options)
5104 .await
5105 .map(gax::response::Response::into_body)
5106 }
5107
5108 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5112 self.0.request.parent = v.into();
5113 self
5114 }
5115
5116 pub fn set_content<T>(mut self, v: T) -> Self
5120 where
5121 T: std::convert::Into<crate::model::Content>,
5122 {
5123 self.0.request.content = std::option::Option::Some(v.into());
5124 self
5125 }
5126
5127 pub fn set_or_clear_content<T>(mut self, v: std::option::Option<T>) -> Self
5131 where
5132 T: std::convert::Into<crate::model::Content>,
5133 {
5134 self.0.request.content = v.map(|x| x.into());
5135 self
5136 }
5137
5138 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5140 self.0.request.validate_only = v.into();
5141 self
5142 }
5143 }
5144
5145 #[doc(hidden)]
5146 impl gax::options::internal::RequestBuilder for CreateContent {
5147 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5148 &mut self.0.options
5149 }
5150 }
5151
5152 #[derive(Clone, Debug)]
5170 pub struct UpdateContent(RequestBuilder<crate::model::UpdateContentRequest>);
5171
5172 impl UpdateContent {
5173 pub(crate) fn new(
5174 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5175 ) -> Self {
5176 Self(RequestBuilder::new(stub))
5177 }
5178
5179 pub fn with_request<V: Into<crate::model::UpdateContentRequest>>(mut self, v: V) -> Self {
5181 self.0.request = v.into();
5182 self
5183 }
5184
5185 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5187 self.0.options = v.into();
5188 self
5189 }
5190
5191 pub async fn send(self) -> Result<crate::model::Content> {
5193 (*self.0.stub)
5194 .update_content(self.0.request, self.0.options)
5195 .await
5196 .map(gax::response::Response::into_body)
5197 }
5198
5199 pub fn set_update_mask<T>(mut self, v: T) -> Self
5203 where
5204 T: std::convert::Into<wkt::FieldMask>,
5205 {
5206 self.0.request.update_mask = std::option::Option::Some(v.into());
5207 self
5208 }
5209
5210 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5214 where
5215 T: std::convert::Into<wkt::FieldMask>,
5216 {
5217 self.0.request.update_mask = v.map(|x| x.into());
5218 self
5219 }
5220
5221 pub fn set_content<T>(mut self, v: T) -> Self
5225 where
5226 T: std::convert::Into<crate::model::Content>,
5227 {
5228 self.0.request.content = std::option::Option::Some(v.into());
5229 self
5230 }
5231
5232 pub fn set_or_clear_content<T>(mut self, v: std::option::Option<T>) -> Self
5236 where
5237 T: std::convert::Into<crate::model::Content>,
5238 {
5239 self.0.request.content = v.map(|x| x.into());
5240 self
5241 }
5242
5243 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5245 self.0.request.validate_only = v.into();
5246 self
5247 }
5248 }
5249
5250 #[doc(hidden)]
5251 impl gax::options::internal::RequestBuilder for UpdateContent {
5252 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5253 &mut self.0.options
5254 }
5255 }
5256
5257 #[derive(Clone, Debug)]
5275 pub struct DeleteContent(RequestBuilder<crate::model::DeleteContentRequest>);
5276
5277 impl DeleteContent {
5278 pub(crate) fn new(
5279 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5280 ) -> Self {
5281 Self(RequestBuilder::new(stub))
5282 }
5283
5284 pub fn with_request<V: Into<crate::model::DeleteContentRequest>>(mut self, v: V) -> Self {
5286 self.0.request = v.into();
5287 self
5288 }
5289
5290 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5292 self.0.options = v.into();
5293 self
5294 }
5295
5296 pub async fn send(self) -> Result<()> {
5298 (*self.0.stub)
5299 .delete_content(self.0.request, self.0.options)
5300 .await
5301 .map(gax::response::Response::into_body)
5302 }
5303
5304 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5308 self.0.request.name = v.into();
5309 self
5310 }
5311 }
5312
5313 #[doc(hidden)]
5314 impl gax::options::internal::RequestBuilder for DeleteContent {
5315 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5316 &mut self.0.options
5317 }
5318 }
5319
5320 #[derive(Clone, Debug)]
5338 pub struct GetContent(RequestBuilder<crate::model::GetContentRequest>);
5339
5340 impl GetContent {
5341 pub(crate) fn new(
5342 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5343 ) -> Self {
5344 Self(RequestBuilder::new(stub))
5345 }
5346
5347 pub fn with_request<V: Into<crate::model::GetContentRequest>>(mut self, v: V) -> Self {
5349 self.0.request = v.into();
5350 self
5351 }
5352
5353 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5355 self.0.options = v.into();
5356 self
5357 }
5358
5359 pub async fn send(self) -> Result<crate::model::Content> {
5361 (*self.0.stub)
5362 .get_content(self.0.request, self.0.options)
5363 .await
5364 .map(gax::response::Response::into_body)
5365 }
5366
5367 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5371 self.0.request.name = v.into();
5372 self
5373 }
5374
5375 pub fn set_view<T: Into<crate::model::get_content_request::ContentView>>(
5377 mut self,
5378 v: T,
5379 ) -> Self {
5380 self.0.request.view = v.into();
5381 self
5382 }
5383 }
5384
5385 #[doc(hidden)]
5386 impl gax::options::internal::RequestBuilder for GetContent {
5387 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5388 &mut self.0.options
5389 }
5390 }
5391
5392 #[derive(Clone, Debug)]
5410 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5411
5412 impl GetIamPolicy {
5413 pub(crate) fn new(
5414 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5415 ) -> Self {
5416 Self(RequestBuilder::new(stub))
5417 }
5418
5419 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5421 self.0.request = v.into();
5422 self
5423 }
5424
5425 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5427 self.0.options = v.into();
5428 self
5429 }
5430
5431 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5433 (*self.0.stub)
5434 .get_iam_policy(self.0.request, self.0.options)
5435 .await
5436 .map(gax::response::Response::into_body)
5437 }
5438
5439 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5443 self.0.request.resource = v.into();
5444 self
5445 }
5446
5447 pub fn set_options<T>(mut self, v: T) -> Self
5449 where
5450 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5451 {
5452 self.0.request.options = std::option::Option::Some(v.into());
5453 self
5454 }
5455
5456 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5458 where
5459 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5460 {
5461 self.0.request.options = v.map(|x| x.into());
5462 self
5463 }
5464 }
5465
5466 #[doc(hidden)]
5467 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5468 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5469 &mut self.0.options
5470 }
5471 }
5472
5473 #[derive(Clone, Debug)]
5491 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5492
5493 impl SetIamPolicy {
5494 pub(crate) fn new(
5495 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5496 ) -> Self {
5497 Self(RequestBuilder::new(stub))
5498 }
5499
5500 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5502 self.0.request = v.into();
5503 self
5504 }
5505
5506 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5508 self.0.options = v.into();
5509 self
5510 }
5511
5512 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5514 (*self.0.stub)
5515 .set_iam_policy(self.0.request, self.0.options)
5516 .await
5517 .map(gax::response::Response::into_body)
5518 }
5519
5520 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5524 self.0.request.resource = v.into();
5525 self
5526 }
5527
5528 pub fn set_policy<T>(mut self, v: T) -> Self
5532 where
5533 T: std::convert::Into<iam_v1::model::Policy>,
5534 {
5535 self.0.request.policy = std::option::Option::Some(v.into());
5536 self
5537 }
5538
5539 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5543 where
5544 T: std::convert::Into<iam_v1::model::Policy>,
5545 {
5546 self.0.request.policy = v.map(|x| x.into());
5547 self
5548 }
5549
5550 pub fn set_update_mask<T>(mut self, v: T) -> Self
5552 where
5553 T: std::convert::Into<wkt::FieldMask>,
5554 {
5555 self.0.request.update_mask = std::option::Option::Some(v.into());
5556 self
5557 }
5558
5559 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5561 where
5562 T: std::convert::Into<wkt::FieldMask>,
5563 {
5564 self.0.request.update_mask = v.map(|x| x.into());
5565 self
5566 }
5567 }
5568
5569 #[doc(hidden)]
5570 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5571 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5572 &mut self.0.options
5573 }
5574 }
5575
5576 #[derive(Clone, Debug)]
5594 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5595
5596 impl TestIamPermissions {
5597 pub(crate) fn new(
5598 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5599 ) -> Self {
5600 Self(RequestBuilder::new(stub))
5601 }
5602
5603 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5605 mut self,
5606 v: V,
5607 ) -> Self {
5608 self.0.request = v.into();
5609 self
5610 }
5611
5612 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5614 self.0.options = v.into();
5615 self
5616 }
5617
5618 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5620 (*self.0.stub)
5621 .test_iam_permissions(self.0.request, self.0.options)
5622 .await
5623 .map(gax::response::Response::into_body)
5624 }
5625
5626 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5630 self.0.request.resource = v.into();
5631 self
5632 }
5633
5634 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5638 where
5639 T: std::iter::IntoIterator<Item = V>,
5640 V: std::convert::Into<std::string::String>,
5641 {
5642 use std::iter::Iterator;
5643 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5644 self
5645 }
5646 }
5647
5648 #[doc(hidden)]
5649 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5650 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5651 &mut self.0.options
5652 }
5653 }
5654
5655 #[derive(Clone, Debug)]
5677 pub struct ListContent(RequestBuilder<crate::model::ListContentRequest>);
5678
5679 impl ListContent {
5680 pub(crate) fn new(
5681 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5682 ) -> Self {
5683 Self(RequestBuilder::new(stub))
5684 }
5685
5686 pub fn with_request<V: Into<crate::model::ListContentRequest>>(mut self, v: V) -> Self {
5688 self.0.request = v.into();
5689 self
5690 }
5691
5692 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5694 self.0.options = v.into();
5695 self
5696 }
5697
5698 pub async fn send(self) -> Result<crate::model::ListContentResponse> {
5700 (*self.0.stub)
5701 .list_content(self.0.request, self.0.options)
5702 .await
5703 .map(gax::response::Response::into_body)
5704 }
5705
5706 pub fn by_page(
5708 self,
5709 ) -> impl gax::paginator::Paginator<crate::model::ListContentResponse, gax::error::Error>
5710 {
5711 use std::clone::Clone;
5712 let token = self.0.request.page_token.clone();
5713 let execute = move |token: String| {
5714 let mut builder = self.clone();
5715 builder.0.request = builder.0.request.set_page_token(token);
5716 builder.send()
5717 };
5718 gax::paginator::internal::new_paginator(token, execute)
5719 }
5720
5721 pub fn by_item(
5723 self,
5724 ) -> impl gax::paginator::ItemPaginator<crate::model::ListContentResponse, gax::error::Error>
5725 {
5726 use gax::paginator::Paginator;
5727 self.by_page().items()
5728 }
5729
5730 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5734 self.0.request.parent = v.into();
5735 self
5736 }
5737
5738 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5740 self.0.request.page_size = v.into();
5741 self
5742 }
5743
5744 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5746 self.0.request.page_token = v.into();
5747 self
5748 }
5749
5750 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5752 self.0.request.filter = v.into();
5753 self
5754 }
5755 }
5756
5757 #[doc(hidden)]
5758 impl gax::options::internal::RequestBuilder for ListContent {
5759 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5760 &mut self.0.options
5761 }
5762 }
5763
5764 #[derive(Clone, Debug)]
5786 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5787
5788 impl ListLocations {
5789 pub(crate) fn new(
5790 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5791 ) -> Self {
5792 Self(RequestBuilder::new(stub))
5793 }
5794
5795 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5797 mut self,
5798 v: V,
5799 ) -> Self {
5800 self.0.request = v.into();
5801 self
5802 }
5803
5804 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5806 self.0.options = v.into();
5807 self
5808 }
5809
5810 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5812 (*self.0.stub)
5813 .list_locations(self.0.request, self.0.options)
5814 .await
5815 .map(gax::response::Response::into_body)
5816 }
5817
5818 pub fn by_page(
5820 self,
5821 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5822 {
5823 use std::clone::Clone;
5824 let token = self.0.request.page_token.clone();
5825 let execute = move |token: String| {
5826 let mut builder = self.clone();
5827 builder.0.request = builder.0.request.set_page_token(token);
5828 builder.send()
5829 };
5830 gax::paginator::internal::new_paginator(token, execute)
5831 }
5832
5833 pub fn by_item(
5835 self,
5836 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5837 {
5838 use gax::paginator::Paginator;
5839 self.by_page().items()
5840 }
5841
5842 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5844 self.0.request.name = v.into();
5845 self
5846 }
5847
5848 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5850 self.0.request.filter = v.into();
5851 self
5852 }
5853
5854 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5856 self.0.request.page_size = v.into();
5857 self
5858 }
5859
5860 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5862 self.0.request.page_token = v.into();
5863 self
5864 }
5865 }
5866
5867 #[doc(hidden)]
5868 impl gax::options::internal::RequestBuilder for ListLocations {
5869 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5870 &mut self.0.options
5871 }
5872 }
5873
5874 #[derive(Clone, Debug)]
5892 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5893
5894 impl GetLocation {
5895 pub(crate) fn new(
5896 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5897 ) -> Self {
5898 Self(RequestBuilder::new(stub))
5899 }
5900
5901 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5903 self.0.request = v.into();
5904 self
5905 }
5906
5907 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5909 self.0.options = v.into();
5910 self
5911 }
5912
5913 pub async fn send(self) -> Result<location::model::Location> {
5915 (*self.0.stub)
5916 .get_location(self.0.request, self.0.options)
5917 .await
5918 .map(gax::response::Response::into_body)
5919 }
5920
5921 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5923 self.0.request.name = v.into();
5924 self
5925 }
5926 }
5927
5928 #[doc(hidden)]
5929 impl gax::options::internal::RequestBuilder for GetLocation {
5930 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5931 &mut self.0.options
5932 }
5933 }
5934
5935 #[derive(Clone, Debug)]
5957 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5958
5959 impl ListOperations {
5960 pub(crate) fn new(
5961 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
5962 ) -> Self {
5963 Self(RequestBuilder::new(stub))
5964 }
5965
5966 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5968 mut self,
5969 v: V,
5970 ) -> Self {
5971 self.0.request = v.into();
5972 self
5973 }
5974
5975 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5977 self.0.options = v.into();
5978 self
5979 }
5980
5981 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5983 (*self.0.stub)
5984 .list_operations(self.0.request, self.0.options)
5985 .await
5986 .map(gax::response::Response::into_body)
5987 }
5988
5989 pub fn by_page(
5991 self,
5992 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5993 {
5994 use std::clone::Clone;
5995 let token = self.0.request.page_token.clone();
5996 let execute = move |token: String| {
5997 let mut builder = self.clone();
5998 builder.0.request = builder.0.request.set_page_token(token);
5999 builder.send()
6000 };
6001 gax::paginator::internal::new_paginator(token, execute)
6002 }
6003
6004 pub fn by_item(
6006 self,
6007 ) -> impl gax::paginator::ItemPaginator<
6008 longrunning::model::ListOperationsResponse,
6009 gax::error::Error,
6010 > {
6011 use gax::paginator::Paginator;
6012 self.by_page().items()
6013 }
6014
6015 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6017 self.0.request.name = v.into();
6018 self
6019 }
6020
6021 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6023 self.0.request.filter = v.into();
6024 self
6025 }
6026
6027 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6029 self.0.request.page_size = v.into();
6030 self
6031 }
6032
6033 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6035 self.0.request.page_token = v.into();
6036 self
6037 }
6038 }
6039
6040 #[doc(hidden)]
6041 impl gax::options::internal::RequestBuilder for ListOperations {
6042 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6043 &mut self.0.options
6044 }
6045 }
6046
6047 #[derive(Clone, Debug)]
6065 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6066
6067 impl GetOperation {
6068 pub(crate) fn new(
6069 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
6070 ) -> Self {
6071 Self(RequestBuilder::new(stub))
6072 }
6073
6074 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6076 mut self,
6077 v: V,
6078 ) -> Self {
6079 self.0.request = v.into();
6080 self
6081 }
6082
6083 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6085 self.0.options = v.into();
6086 self
6087 }
6088
6089 pub async fn send(self) -> Result<longrunning::model::Operation> {
6091 (*self.0.stub)
6092 .get_operation(self.0.request, self.0.options)
6093 .await
6094 .map(gax::response::Response::into_body)
6095 }
6096
6097 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6099 self.0.request.name = v.into();
6100 self
6101 }
6102 }
6103
6104 #[doc(hidden)]
6105 impl gax::options::internal::RequestBuilder for GetOperation {
6106 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6107 &mut self.0.options
6108 }
6109 }
6110
6111 #[derive(Clone, Debug)]
6129 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6130
6131 impl DeleteOperation {
6132 pub(crate) fn new(
6133 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
6134 ) -> Self {
6135 Self(RequestBuilder::new(stub))
6136 }
6137
6138 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6140 mut self,
6141 v: V,
6142 ) -> Self {
6143 self.0.request = v.into();
6144 self
6145 }
6146
6147 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6149 self.0.options = v.into();
6150 self
6151 }
6152
6153 pub async fn send(self) -> Result<()> {
6155 (*self.0.stub)
6156 .delete_operation(self.0.request, self.0.options)
6157 .await
6158 .map(gax::response::Response::into_body)
6159 }
6160
6161 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6163 self.0.request.name = v.into();
6164 self
6165 }
6166 }
6167
6168 #[doc(hidden)]
6169 impl gax::options::internal::RequestBuilder for DeleteOperation {
6170 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6171 &mut self.0.options
6172 }
6173 }
6174
6175 #[derive(Clone, Debug)]
6193 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6194
6195 impl CancelOperation {
6196 pub(crate) fn new(
6197 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
6198 ) -> Self {
6199 Self(RequestBuilder::new(stub))
6200 }
6201
6202 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6204 mut self,
6205 v: V,
6206 ) -> Self {
6207 self.0.request = v.into();
6208 self
6209 }
6210
6211 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6213 self.0.options = v.into();
6214 self
6215 }
6216
6217 pub async fn send(self) -> Result<()> {
6219 (*self.0.stub)
6220 .cancel_operation(self.0.request, self.0.options)
6221 .await
6222 .map(gax::response::Response::into_body)
6223 }
6224
6225 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6227 self.0.request.name = v.into();
6228 self
6229 }
6230 }
6231
6232 #[doc(hidden)]
6233 impl gax::options::internal::RequestBuilder for CancelOperation {
6234 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6235 &mut self.0.options
6236 }
6237 }
6238}
6239
6240pub mod data_taxonomy_service {
6241 use crate::Result;
6242
6243 pub type ClientBuilder =
6257 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6258
6259 pub(crate) mod client {
6260 use super::super::super::client::DataTaxonomyService;
6261 pub struct Factory;
6262 impl gax::client_builder::internal::ClientFactory for Factory {
6263 type Client = DataTaxonomyService;
6264 type Credentials = gaxi::options::Credentials;
6265 async fn build(
6266 self,
6267 config: gaxi::options::ClientConfig,
6268 ) -> gax::client_builder::Result<Self::Client> {
6269 Self::Client::new(config).await
6270 }
6271 }
6272 }
6273
6274 #[derive(Clone, Debug)]
6276 pub(crate) struct RequestBuilder<R: std::default::Default> {
6277 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
6278 request: R,
6279 options: gax::options::RequestOptions,
6280 }
6281
6282 impl<R> RequestBuilder<R>
6283 where
6284 R: std::default::Default,
6285 {
6286 pub(crate) fn new(
6287 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
6288 ) -> Self {
6289 Self {
6290 stub,
6291 request: R::default(),
6292 options: gax::options::RequestOptions::default(),
6293 }
6294 }
6295 }
6296
6297 #[derive(Clone, Debug)]
6316 pub struct CreateDataTaxonomy(RequestBuilder<crate::model::CreateDataTaxonomyRequest>);
6317
6318 impl CreateDataTaxonomy {
6319 pub(crate) fn new(
6320 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
6321 ) -> Self {
6322 Self(RequestBuilder::new(stub))
6323 }
6324
6325 pub fn with_request<V: Into<crate::model::CreateDataTaxonomyRequest>>(
6327 mut self,
6328 v: V,
6329 ) -> Self {
6330 self.0.request = v.into();
6331 self
6332 }
6333
6334 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6336 self.0.options = v.into();
6337 self
6338 }
6339
6340 pub async fn send(self) -> Result<longrunning::model::Operation> {
6347 (*self.0.stub)
6348 .create_data_taxonomy(self.0.request, self.0.options)
6349 .await
6350 .map(gax::response::Response::into_body)
6351 }
6352
6353 pub fn poller(
6355 self,
6356 ) -> impl lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata> {
6357 type Operation = lro::internal::Operation<
6358 crate::model::DataTaxonomy,
6359 crate::model::OperationMetadata,
6360 >;
6361 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6362 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6363
6364 let stub = self.0.stub.clone();
6365 let mut options = self.0.options.clone();
6366 options.set_retry_policy(gax::retry_policy::NeverRetry);
6367 let query = move |name| {
6368 let stub = stub.clone();
6369 let options = options.clone();
6370 async {
6371 let op = GetOperation::new(stub)
6372 .set_name(name)
6373 .with_options(options)
6374 .send()
6375 .await?;
6376 Ok(Operation::new(op))
6377 }
6378 };
6379
6380 let start = move || async {
6381 let op = self.send().await?;
6382 Ok(Operation::new(op))
6383 };
6384
6385 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6386 }
6387
6388 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6392 self.0.request.parent = v.into();
6393 self
6394 }
6395
6396 pub fn set_data_taxonomy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6400 self.0.request.data_taxonomy_id = v.into();
6401 self
6402 }
6403
6404 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
6408 where
6409 T: std::convert::Into<crate::model::DataTaxonomy>,
6410 {
6411 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
6412 self
6413 }
6414
6415 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
6419 where
6420 T: std::convert::Into<crate::model::DataTaxonomy>,
6421 {
6422 self.0.request.data_taxonomy = v.map(|x| x.into());
6423 self
6424 }
6425
6426 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
6428 self.0.request.validate_only = v.into();
6429 self
6430 }
6431 }
6432
6433 #[doc(hidden)]
6434 impl gax::options::internal::RequestBuilder for CreateDataTaxonomy {
6435 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6436 &mut self.0.options
6437 }
6438 }
6439
6440 #[derive(Clone, Debug)]
6459 pub struct UpdateDataTaxonomy(RequestBuilder<crate::model::UpdateDataTaxonomyRequest>);
6460
6461 impl UpdateDataTaxonomy {
6462 pub(crate) fn new(
6463 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
6464 ) -> Self {
6465 Self(RequestBuilder::new(stub))
6466 }
6467
6468 pub fn with_request<V: Into<crate::model::UpdateDataTaxonomyRequest>>(
6470 mut self,
6471 v: V,
6472 ) -> Self {
6473 self.0.request = v.into();
6474 self
6475 }
6476
6477 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6479 self.0.options = v.into();
6480 self
6481 }
6482
6483 pub async fn send(self) -> Result<longrunning::model::Operation> {
6490 (*self.0.stub)
6491 .update_data_taxonomy(self.0.request, self.0.options)
6492 .await
6493 .map(gax::response::Response::into_body)
6494 }
6495
6496 pub fn poller(
6498 self,
6499 ) -> impl lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata> {
6500 type Operation = lro::internal::Operation<
6501 crate::model::DataTaxonomy,
6502 crate::model::OperationMetadata,
6503 >;
6504 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6505 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6506
6507 let stub = self.0.stub.clone();
6508 let mut options = self.0.options.clone();
6509 options.set_retry_policy(gax::retry_policy::NeverRetry);
6510 let query = move |name| {
6511 let stub = stub.clone();
6512 let options = options.clone();
6513 async {
6514 let op = GetOperation::new(stub)
6515 .set_name(name)
6516 .with_options(options)
6517 .send()
6518 .await?;
6519 Ok(Operation::new(op))
6520 }
6521 };
6522
6523 let start = move || async {
6524 let op = self.send().await?;
6525 Ok(Operation::new(op))
6526 };
6527
6528 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6529 }
6530
6531 pub fn set_update_mask<T>(mut self, v: T) -> Self
6535 where
6536 T: std::convert::Into<wkt::FieldMask>,
6537 {
6538 self.0.request.update_mask = std::option::Option::Some(v.into());
6539 self
6540 }
6541
6542 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6546 where
6547 T: std::convert::Into<wkt::FieldMask>,
6548 {
6549 self.0.request.update_mask = v.map(|x| x.into());
6550 self
6551 }
6552
6553 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
6557 where
6558 T: std::convert::Into<crate::model::DataTaxonomy>,
6559 {
6560 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
6561 self
6562 }
6563
6564 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
6568 where
6569 T: std::convert::Into<crate::model::DataTaxonomy>,
6570 {
6571 self.0.request.data_taxonomy = v.map(|x| x.into());
6572 self
6573 }
6574
6575 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
6577 self.0.request.validate_only = v.into();
6578 self
6579 }
6580 }
6581
6582 #[doc(hidden)]
6583 impl gax::options::internal::RequestBuilder for UpdateDataTaxonomy {
6584 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6585 &mut self.0.options
6586 }
6587 }
6588
6589 #[derive(Clone, Debug)]
6608 pub struct DeleteDataTaxonomy(RequestBuilder<crate::model::DeleteDataTaxonomyRequest>);
6609
6610 impl DeleteDataTaxonomy {
6611 pub(crate) fn new(
6612 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
6613 ) -> Self {
6614 Self(RequestBuilder::new(stub))
6615 }
6616
6617 pub fn with_request<V: Into<crate::model::DeleteDataTaxonomyRequest>>(
6619 mut self,
6620 v: V,
6621 ) -> Self {
6622 self.0.request = v.into();
6623 self
6624 }
6625
6626 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6628 self.0.options = v.into();
6629 self
6630 }
6631
6632 pub async fn send(self) -> Result<longrunning::model::Operation> {
6639 (*self.0.stub)
6640 .delete_data_taxonomy(self.0.request, self.0.options)
6641 .await
6642 .map(gax::response::Response::into_body)
6643 }
6644
6645 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
6647 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6648 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6649 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6650
6651 let stub = self.0.stub.clone();
6652 let mut options = self.0.options.clone();
6653 options.set_retry_policy(gax::retry_policy::NeverRetry);
6654 let query = move |name| {
6655 let stub = stub.clone();
6656 let options = options.clone();
6657 async {
6658 let op = GetOperation::new(stub)
6659 .set_name(name)
6660 .with_options(options)
6661 .send()
6662 .await?;
6663 Ok(Operation::new(op))
6664 }
6665 };
6666
6667 let start = move || async {
6668 let op = self.send().await?;
6669 Ok(Operation::new(op))
6670 };
6671
6672 lro::internal::new_unit_response_poller(
6673 polling_error_policy,
6674 polling_backoff_policy,
6675 start,
6676 query,
6677 )
6678 }
6679
6680 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6684 self.0.request.name = v.into();
6685 self
6686 }
6687
6688 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
6690 self.0.request.etag = v.into();
6691 self
6692 }
6693 }
6694
6695 #[doc(hidden)]
6696 impl gax::options::internal::RequestBuilder for DeleteDataTaxonomy {
6697 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6698 &mut self.0.options
6699 }
6700 }
6701
6702 #[derive(Clone, Debug)]
6724 pub struct ListDataTaxonomies(RequestBuilder<crate::model::ListDataTaxonomiesRequest>);
6725
6726 impl ListDataTaxonomies {
6727 pub(crate) fn new(
6728 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
6729 ) -> Self {
6730 Self(RequestBuilder::new(stub))
6731 }
6732
6733 pub fn with_request<V: Into<crate::model::ListDataTaxonomiesRequest>>(
6735 mut self,
6736 v: V,
6737 ) -> Self {
6738 self.0.request = v.into();
6739 self
6740 }
6741
6742 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6744 self.0.options = v.into();
6745 self
6746 }
6747
6748 pub async fn send(self) -> Result<crate::model::ListDataTaxonomiesResponse> {
6750 (*self.0.stub)
6751 .list_data_taxonomies(self.0.request, self.0.options)
6752 .await
6753 .map(gax::response::Response::into_body)
6754 }
6755
6756 pub fn by_page(
6758 self,
6759 ) -> impl gax::paginator::Paginator<crate::model::ListDataTaxonomiesResponse, gax::error::Error>
6760 {
6761 use std::clone::Clone;
6762 let token = self.0.request.page_token.clone();
6763 let execute = move |token: String| {
6764 let mut builder = self.clone();
6765 builder.0.request = builder.0.request.set_page_token(token);
6766 builder.send()
6767 };
6768 gax::paginator::internal::new_paginator(token, execute)
6769 }
6770
6771 pub fn by_item(
6773 self,
6774 ) -> impl gax::paginator::ItemPaginator<
6775 crate::model::ListDataTaxonomiesResponse,
6776 gax::error::Error,
6777 > {
6778 use gax::paginator::Paginator;
6779 self.by_page().items()
6780 }
6781
6782 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6786 self.0.request.parent = v.into();
6787 self
6788 }
6789
6790 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6792 self.0.request.page_size = v.into();
6793 self
6794 }
6795
6796 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6798 self.0.request.page_token = v.into();
6799 self
6800 }
6801
6802 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6804 self.0.request.filter = v.into();
6805 self
6806 }
6807
6808 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6810 self.0.request.order_by = v.into();
6811 self
6812 }
6813 }
6814
6815 #[doc(hidden)]
6816 impl gax::options::internal::RequestBuilder for ListDataTaxonomies {
6817 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6818 &mut self.0.options
6819 }
6820 }
6821
6822 #[derive(Clone, Debug)]
6840 pub struct GetDataTaxonomy(RequestBuilder<crate::model::GetDataTaxonomyRequest>);
6841
6842 impl GetDataTaxonomy {
6843 pub(crate) fn new(
6844 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
6845 ) -> Self {
6846 Self(RequestBuilder::new(stub))
6847 }
6848
6849 pub fn with_request<V: Into<crate::model::GetDataTaxonomyRequest>>(mut self, v: V) -> Self {
6851 self.0.request = v.into();
6852 self
6853 }
6854
6855 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6857 self.0.options = v.into();
6858 self
6859 }
6860
6861 pub async fn send(self) -> Result<crate::model::DataTaxonomy> {
6863 (*self.0.stub)
6864 .get_data_taxonomy(self.0.request, self.0.options)
6865 .await
6866 .map(gax::response::Response::into_body)
6867 }
6868
6869 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6873 self.0.request.name = v.into();
6874 self
6875 }
6876 }
6877
6878 #[doc(hidden)]
6879 impl gax::options::internal::RequestBuilder for GetDataTaxonomy {
6880 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6881 &mut self.0.options
6882 }
6883 }
6884
6885 #[derive(Clone, Debug)]
6904 pub struct CreateDataAttributeBinding(
6905 RequestBuilder<crate::model::CreateDataAttributeBindingRequest>,
6906 );
6907
6908 impl CreateDataAttributeBinding {
6909 pub(crate) fn new(
6910 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
6911 ) -> Self {
6912 Self(RequestBuilder::new(stub))
6913 }
6914
6915 pub fn with_request<V: Into<crate::model::CreateDataAttributeBindingRequest>>(
6917 mut self,
6918 v: V,
6919 ) -> Self {
6920 self.0.request = v.into();
6921 self
6922 }
6923
6924 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6926 self.0.options = v.into();
6927 self
6928 }
6929
6930 pub async fn send(self) -> Result<longrunning::model::Operation> {
6937 (*self.0.stub)
6938 .create_data_attribute_binding(self.0.request, self.0.options)
6939 .await
6940 .map(gax::response::Response::into_body)
6941 }
6942
6943 pub fn poller(
6945 self,
6946 ) -> impl lro::Poller<crate::model::DataAttributeBinding, crate::model::OperationMetadata>
6947 {
6948 type Operation = lro::internal::Operation<
6949 crate::model::DataAttributeBinding,
6950 crate::model::OperationMetadata,
6951 >;
6952 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6953 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6954
6955 let stub = self.0.stub.clone();
6956 let mut options = self.0.options.clone();
6957 options.set_retry_policy(gax::retry_policy::NeverRetry);
6958 let query = move |name| {
6959 let stub = stub.clone();
6960 let options = options.clone();
6961 async {
6962 let op = GetOperation::new(stub)
6963 .set_name(name)
6964 .with_options(options)
6965 .send()
6966 .await?;
6967 Ok(Operation::new(op))
6968 }
6969 };
6970
6971 let start = move || async {
6972 let op = self.send().await?;
6973 Ok(Operation::new(op))
6974 };
6975
6976 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6977 }
6978
6979 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6983 self.0.request.parent = v.into();
6984 self
6985 }
6986
6987 pub fn set_data_attribute_binding_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6991 self.0.request.data_attribute_binding_id = v.into();
6992 self
6993 }
6994
6995 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
6999 where
7000 T: std::convert::Into<crate::model::DataAttributeBinding>,
7001 {
7002 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
7003 self
7004 }
7005
7006 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
7010 where
7011 T: std::convert::Into<crate::model::DataAttributeBinding>,
7012 {
7013 self.0.request.data_attribute_binding = v.map(|x| x.into());
7014 self
7015 }
7016
7017 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
7019 self.0.request.validate_only = v.into();
7020 self
7021 }
7022 }
7023
7024 #[doc(hidden)]
7025 impl gax::options::internal::RequestBuilder for CreateDataAttributeBinding {
7026 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7027 &mut self.0.options
7028 }
7029 }
7030
7031 #[derive(Clone, Debug)]
7050 pub struct UpdateDataAttributeBinding(
7051 RequestBuilder<crate::model::UpdateDataAttributeBindingRequest>,
7052 );
7053
7054 impl UpdateDataAttributeBinding {
7055 pub(crate) fn new(
7056 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
7057 ) -> Self {
7058 Self(RequestBuilder::new(stub))
7059 }
7060
7061 pub fn with_request<V: Into<crate::model::UpdateDataAttributeBindingRequest>>(
7063 mut self,
7064 v: V,
7065 ) -> Self {
7066 self.0.request = v.into();
7067 self
7068 }
7069
7070 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7072 self.0.options = v.into();
7073 self
7074 }
7075
7076 pub async fn send(self) -> Result<longrunning::model::Operation> {
7083 (*self.0.stub)
7084 .update_data_attribute_binding(self.0.request, self.0.options)
7085 .await
7086 .map(gax::response::Response::into_body)
7087 }
7088
7089 pub fn poller(
7091 self,
7092 ) -> impl lro::Poller<crate::model::DataAttributeBinding, crate::model::OperationMetadata>
7093 {
7094 type Operation = lro::internal::Operation<
7095 crate::model::DataAttributeBinding,
7096 crate::model::OperationMetadata,
7097 >;
7098 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7099 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7100
7101 let stub = self.0.stub.clone();
7102 let mut options = self.0.options.clone();
7103 options.set_retry_policy(gax::retry_policy::NeverRetry);
7104 let query = move |name| {
7105 let stub = stub.clone();
7106 let options = options.clone();
7107 async {
7108 let op = GetOperation::new(stub)
7109 .set_name(name)
7110 .with_options(options)
7111 .send()
7112 .await?;
7113 Ok(Operation::new(op))
7114 }
7115 };
7116
7117 let start = move || async {
7118 let op = self.send().await?;
7119 Ok(Operation::new(op))
7120 };
7121
7122 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7123 }
7124
7125 pub fn set_update_mask<T>(mut self, v: T) -> Self
7129 where
7130 T: std::convert::Into<wkt::FieldMask>,
7131 {
7132 self.0.request.update_mask = std::option::Option::Some(v.into());
7133 self
7134 }
7135
7136 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7140 where
7141 T: std::convert::Into<wkt::FieldMask>,
7142 {
7143 self.0.request.update_mask = v.map(|x| x.into());
7144 self
7145 }
7146
7147 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
7151 where
7152 T: std::convert::Into<crate::model::DataAttributeBinding>,
7153 {
7154 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
7155 self
7156 }
7157
7158 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
7162 where
7163 T: std::convert::Into<crate::model::DataAttributeBinding>,
7164 {
7165 self.0.request.data_attribute_binding = v.map(|x| x.into());
7166 self
7167 }
7168
7169 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
7171 self.0.request.validate_only = v.into();
7172 self
7173 }
7174 }
7175
7176 #[doc(hidden)]
7177 impl gax::options::internal::RequestBuilder for UpdateDataAttributeBinding {
7178 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7179 &mut self.0.options
7180 }
7181 }
7182
7183 #[derive(Clone, Debug)]
7202 pub struct DeleteDataAttributeBinding(
7203 RequestBuilder<crate::model::DeleteDataAttributeBindingRequest>,
7204 );
7205
7206 impl DeleteDataAttributeBinding {
7207 pub(crate) fn new(
7208 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
7209 ) -> Self {
7210 Self(RequestBuilder::new(stub))
7211 }
7212
7213 pub fn with_request<V: Into<crate::model::DeleteDataAttributeBindingRequest>>(
7215 mut self,
7216 v: V,
7217 ) -> Self {
7218 self.0.request = v.into();
7219 self
7220 }
7221
7222 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7224 self.0.options = v.into();
7225 self
7226 }
7227
7228 pub async fn send(self) -> Result<longrunning::model::Operation> {
7235 (*self.0.stub)
7236 .delete_data_attribute_binding(self.0.request, self.0.options)
7237 .await
7238 .map(gax::response::Response::into_body)
7239 }
7240
7241 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
7243 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7244 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7245 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7246
7247 let stub = self.0.stub.clone();
7248 let mut options = self.0.options.clone();
7249 options.set_retry_policy(gax::retry_policy::NeverRetry);
7250 let query = move |name| {
7251 let stub = stub.clone();
7252 let options = options.clone();
7253 async {
7254 let op = GetOperation::new(stub)
7255 .set_name(name)
7256 .with_options(options)
7257 .send()
7258 .await?;
7259 Ok(Operation::new(op))
7260 }
7261 };
7262
7263 let start = move || async {
7264 let op = self.send().await?;
7265 Ok(Operation::new(op))
7266 };
7267
7268 lro::internal::new_unit_response_poller(
7269 polling_error_policy,
7270 polling_backoff_policy,
7271 start,
7272 query,
7273 )
7274 }
7275
7276 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7280 self.0.request.name = v.into();
7281 self
7282 }
7283
7284 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7288 self.0.request.etag = v.into();
7289 self
7290 }
7291 }
7292
7293 #[doc(hidden)]
7294 impl gax::options::internal::RequestBuilder for DeleteDataAttributeBinding {
7295 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7296 &mut self.0.options
7297 }
7298 }
7299
7300 #[derive(Clone, Debug)]
7322 pub struct ListDataAttributeBindings(
7323 RequestBuilder<crate::model::ListDataAttributeBindingsRequest>,
7324 );
7325
7326 impl ListDataAttributeBindings {
7327 pub(crate) fn new(
7328 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
7329 ) -> Self {
7330 Self(RequestBuilder::new(stub))
7331 }
7332
7333 pub fn with_request<V: Into<crate::model::ListDataAttributeBindingsRequest>>(
7335 mut self,
7336 v: V,
7337 ) -> Self {
7338 self.0.request = v.into();
7339 self
7340 }
7341
7342 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7344 self.0.options = v.into();
7345 self
7346 }
7347
7348 pub async fn send(self) -> Result<crate::model::ListDataAttributeBindingsResponse> {
7350 (*self.0.stub)
7351 .list_data_attribute_bindings(self.0.request, self.0.options)
7352 .await
7353 .map(gax::response::Response::into_body)
7354 }
7355
7356 pub fn by_page(
7358 self,
7359 ) -> impl gax::paginator::Paginator<
7360 crate::model::ListDataAttributeBindingsResponse,
7361 gax::error::Error,
7362 > {
7363 use std::clone::Clone;
7364 let token = self.0.request.page_token.clone();
7365 let execute = move |token: String| {
7366 let mut builder = self.clone();
7367 builder.0.request = builder.0.request.set_page_token(token);
7368 builder.send()
7369 };
7370 gax::paginator::internal::new_paginator(token, execute)
7371 }
7372
7373 pub fn by_item(
7375 self,
7376 ) -> impl gax::paginator::ItemPaginator<
7377 crate::model::ListDataAttributeBindingsResponse,
7378 gax::error::Error,
7379 > {
7380 use gax::paginator::Paginator;
7381 self.by_page().items()
7382 }
7383
7384 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7388 self.0.request.parent = v.into();
7389 self
7390 }
7391
7392 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7394 self.0.request.page_size = v.into();
7395 self
7396 }
7397
7398 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7400 self.0.request.page_token = v.into();
7401 self
7402 }
7403
7404 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7406 self.0.request.filter = v.into();
7407 self
7408 }
7409
7410 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7412 self.0.request.order_by = v.into();
7413 self
7414 }
7415 }
7416
7417 #[doc(hidden)]
7418 impl gax::options::internal::RequestBuilder for ListDataAttributeBindings {
7419 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7420 &mut self.0.options
7421 }
7422 }
7423
7424 #[derive(Clone, Debug)]
7442 pub struct GetDataAttributeBinding(
7443 RequestBuilder<crate::model::GetDataAttributeBindingRequest>,
7444 );
7445
7446 impl GetDataAttributeBinding {
7447 pub(crate) fn new(
7448 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
7449 ) -> Self {
7450 Self(RequestBuilder::new(stub))
7451 }
7452
7453 pub fn with_request<V: Into<crate::model::GetDataAttributeBindingRequest>>(
7455 mut self,
7456 v: V,
7457 ) -> Self {
7458 self.0.request = v.into();
7459 self
7460 }
7461
7462 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7464 self.0.options = v.into();
7465 self
7466 }
7467
7468 pub async fn send(self) -> Result<crate::model::DataAttributeBinding> {
7470 (*self.0.stub)
7471 .get_data_attribute_binding(self.0.request, self.0.options)
7472 .await
7473 .map(gax::response::Response::into_body)
7474 }
7475
7476 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7480 self.0.request.name = v.into();
7481 self
7482 }
7483 }
7484
7485 #[doc(hidden)]
7486 impl gax::options::internal::RequestBuilder for GetDataAttributeBinding {
7487 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7488 &mut self.0.options
7489 }
7490 }
7491
7492 #[derive(Clone, Debug)]
7511 pub struct CreateDataAttribute(RequestBuilder<crate::model::CreateDataAttributeRequest>);
7512
7513 impl CreateDataAttribute {
7514 pub(crate) fn new(
7515 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
7516 ) -> Self {
7517 Self(RequestBuilder::new(stub))
7518 }
7519
7520 pub fn with_request<V: Into<crate::model::CreateDataAttributeRequest>>(
7522 mut self,
7523 v: V,
7524 ) -> Self {
7525 self.0.request = v.into();
7526 self
7527 }
7528
7529 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7531 self.0.options = v.into();
7532 self
7533 }
7534
7535 pub async fn send(self) -> Result<longrunning::model::Operation> {
7542 (*self.0.stub)
7543 .create_data_attribute(self.0.request, self.0.options)
7544 .await
7545 .map(gax::response::Response::into_body)
7546 }
7547
7548 pub fn poller(
7550 self,
7551 ) -> impl lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
7552 {
7553 type Operation = lro::internal::Operation<
7554 crate::model::DataAttribute,
7555 crate::model::OperationMetadata,
7556 >;
7557 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7558 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7559
7560 let stub = self.0.stub.clone();
7561 let mut options = self.0.options.clone();
7562 options.set_retry_policy(gax::retry_policy::NeverRetry);
7563 let query = move |name| {
7564 let stub = stub.clone();
7565 let options = options.clone();
7566 async {
7567 let op = GetOperation::new(stub)
7568 .set_name(name)
7569 .with_options(options)
7570 .send()
7571 .await?;
7572 Ok(Operation::new(op))
7573 }
7574 };
7575
7576 let start = move || async {
7577 let op = self.send().await?;
7578 Ok(Operation::new(op))
7579 };
7580
7581 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7582 }
7583
7584 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7588 self.0.request.parent = v.into();
7589 self
7590 }
7591
7592 pub fn set_data_attribute_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7596 self.0.request.data_attribute_id = v.into();
7597 self
7598 }
7599
7600 pub fn set_data_attribute<T>(mut self, v: T) -> Self
7604 where
7605 T: std::convert::Into<crate::model::DataAttribute>,
7606 {
7607 self.0.request.data_attribute = std::option::Option::Some(v.into());
7608 self
7609 }
7610
7611 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
7615 where
7616 T: std::convert::Into<crate::model::DataAttribute>,
7617 {
7618 self.0.request.data_attribute = v.map(|x| x.into());
7619 self
7620 }
7621
7622 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
7624 self.0.request.validate_only = v.into();
7625 self
7626 }
7627 }
7628
7629 #[doc(hidden)]
7630 impl gax::options::internal::RequestBuilder for CreateDataAttribute {
7631 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7632 &mut self.0.options
7633 }
7634 }
7635
7636 #[derive(Clone, Debug)]
7655 pub struct UpdateDataAttribute(RequestBuilder<crate::model::UpdateDataAttributeRequest>);
7656
7657 impl UpdateDataAttribute {
7658 pub(crate) fn new(
7659 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
7660 ) -> Self {
7661 Self(RequestBuilder::new(stub))
7662 }
7663
7664 pub fn with_request<V: Into<crate::model::UpdateDataAttributeRequest>>(
7666 mut self,
7667 v: V,
7668 ) -> Self {
7669 self.0.request = v.into();
7670 self
7671 }
7672
7673 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7675 self.0.options = v.into();
7676 self
7677 }
7678
7679 pub async fn send(self) -> Result<longrunning::model::Operation> {
7686 (*self.0.stub)
7687 .update_data_attribute(self.0.request, self.0.options)
7688 .await
7689 .map(gax::response::Response::into_body)
7690 }
7691
7692 pub fn poller(
7694 self,
7695 ) -> impl lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
7696 {
7697 type Operation = lro::internal::Operation<
7698 crate::model::DataAttribute,
7699 crate::model::OperationMetadata,
7700 >;
7701 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7702 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7703
7704 let stub = self.0.stub.clone();
7705 let mut options = self.0.options.clone();
7706 options.set_retry_policy(gax::retry_policy::NeverRetry);
7707 let query = move |name| {
7708 let stub = stub.clone();
7709 let options = options.clone();
7710 async {
7711 let op = GetOperation::new(stub)
7712 .set_name(name)
7713 .with_options(options)
7714 .send()
7715 .await?;
7716 Ok(Operation::new(op))
7717 }
7718 };
7719
7720 let start = move || async {
7721 let op = self.send().await?;
7722 Ok(Operation::new(op))
7723 };
7724
7725 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7726 }
7727
7728 pub fn set_update_mask<T>(mut self, v: T) -> Self
7732 where
7733 T: std::convert::Into<wkt::FieldMask>,
7734 {
7735 self.0.request.update_mask = std::option::Option::Some(v.into());
7736 self
7737 }
7738
7739 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7743 where
7744 T: std::convert::Into<wkt::FieldMask>,
7745 {
7746 self.0.request.update_mask = v.map(|x| x.into());
7747 self
7748 }
7749
7750 pub fn set_data_attribute<T>(mut self, v: T) -> Self
7754 where
7755 T: std::convert::Into<crate::model::DataAttribute>,
7756 {
7757 self.0.request.data_attribute = std::option::Option::Some(v.into());
7758 self
7759 }
7760
7761 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
7765 where
7766 T: std::convert::Into<crate::model::DataAttribute>,
7767 {
7768 self.0.request.data_attribute = v.map(|x| x.into());
7769 self
7770 }
7771
7772 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
7774 self.0.request.validate_only = v.into();
7775 self
7776 }
7777 }
7778
7779 #[doc(hidden)]
7780 impl gax::options::internal::RequestBuilder for UpdateDataAttribute {
7781 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7782 &mut self.0.options
7783 }
7784 }
7785
7786 #[derive(Clone, Debug)]
7805 pub struct DeleteDataAttribute(RequestBuilder<crate::model::DeleteDataAttributeRequest>);
7806
7807 impl DeleteDataAttribute {
7808 pub(crate) fn new(
7809 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
7810 ) -> Self {
7811 Self(RequestBuilder::new(stub))
7812 }
7813
7814 pub fn with_request<V: Into<crate::model::DeleteDataAttributeRequest>>(
7816 mut self,
7817 v: V,
7818 ) -> Self {
7819 self.0.request = v.into();
7820 self
7821 }
7822
7823 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7825 self.0.options = v.into();
7826 self
7827 }
7828
7829 pub async fn send(self) -> Result<longrunning::model::Operation> {
7836 (*self.0.stub)
7837 .delete_data_attribute(self.0.request, self.0.options)
7838 .await
7839 .map(gax::response::Response::into_body)
7840 }
7841
7842 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
7844 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7845 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7846 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7847
7848 let stub = self.0.stub.clone();
7849 let mut options = self.0.options.clone();
7850 options.set_retry_policy(gax::retry_policy::NeverRetry);
7851 let query = move |name| {
7852 let stub = stub.clone();
7853 let options = options.clone();
7854 async {
7855 let op = GetOperation::new(stub)
7856 .set_name(name)
7857 .with_options(options)
7858 .send()
7859 .await?;
7860 Ok(Operation::new(op))
7861 }
7862 };
7863
7864 let start = move || async {
7865 let op = self.send().await?;
7866 Ok(Operation::new(op))
7867 };
7868
7869 lro::internal::new_unit_response_poller(
7870 polling_error_policy,
7871 polling_backoff_policy,
7872 start,
7873 query,
7874 )
7875 }
7876
7877 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7881 self.0.request.name = v.into();
7882 self
7883 }
7884
7885 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7887 self.0.request.etag = v.into();
7888 self
7889 }
7890 }
7891
7892 #[doc(hidden)]
7893 impl gax::options::internal::RequestBuilder for DeleteDataAttribute {
7894 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7895 &mut self.0.options
7896 }
7897 }
7898
7899 #[derive(Clone, Debug)]
7921 pub struct ListDataAttributes(RequestBuilder<crate::model::ListDataAttributesRequest>);
7922
7923 impl ListDataAttributes {
7924 pub(crate) fn new(
7925 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
7926 ) -> Self {
7927 Self(RequestBuilder::new(stub))
7928 }
7929
7930 pub fn with_request<V: Into<crate::model::ListDataAttributesRequest>>(
7932 mut self,
7933 v: V,
7934 ) -> Self {
7935 self.0.request = v.into();
7936 self
7937 }
7938
7939 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7941 self.0.options = v.into();
7942 self
7943 }
7944
7945 pub async fn send(self) -> Result<crate::model::ListDataAttributesResponse> {
7947 (*self.0.stub)
7948 .list_data_attributes(self.0.request, self.0.options)
7949 .await
7950 .map(gax::response::Response::into_body)
7951 }
7952
7953 pub fn by_page(
7955 self,
7956 ) -> impl gax::paginator::Paginator<crate::model::ListDataAttributesResponse, gax::error::Error>
7957 {
7958 use std::clone::Clone;
7959 let token = self.0.request.page_token.clone();
7960 let execute = move |token: String| {
7961 let mut builder = self.clone();
7962 builder.0.request = builder.0.request.set_page_token(token);
7963 builder.send()
7964 };
7965 gax::paginator::internal::new_paginator(token, execute)
7966 }
7967
7968 pub fn by_item(
7970 self,
7971 ) -> impl gax::paginator::ItemPaginator<
7972 crate::model::ListDataAttributesResponse,
7973 gax::error::Error,
7974 > {
7975 use gax::paginator::Paginator;
7976 self.by_page().items()
7977 }
7978
7979 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7983 self.0.request.parent = v.into();
7984 self
7985 }
7986
7987 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7989 self.0.request.page_size = v.into();
7990 self
7991 }
7992
7993 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7995 self.0.request.page_token = v.into();
7996 self
7997 }
7998
7999 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8001 self.0.request.filter = v.into();
8002 self
8003 }
8004
8005 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8007 self.0.request.order_by = v.into();
8008 self
8009 }
8010 }
8011
8012 #[doc(hidden)]
8013 impl gax::options::internal::RequestBuilder for ListDataAttributes {
8014 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8015 &mut self.0.options
8016 }
8017 }
8018
8019 #[derive(Clone, Debug)]
8037 pub struct GetDataAttribute(RequestBuilder<crate::model::GetDataAttributeRequest>);
8038
8039 impl GetDataAttribute {
8040 pub(crate) fn new(
8041 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8042 ) -> Self {
8043 Self(RequestBuilder::new(stub))
8044 }
8045
8046 pub fn with_request<V: Into<crate::model::GetDataAttributeRequest>>(
8048 mut self,
8049 v: V,
8050 ) -> Self {
8051 self.0.request = v.into();
8052 self
8053 }
8054
8055 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8057 self.0.options = v.into();
8058 self
8059 }
8060
8061 pub async fn send(self) -> Result<crate::model::DataAttribute> {
8063 (*self.0.stub)
8064 .get_data_attribute(self.0.request, self.0.options)
8065 .await
8066 .map(gax::response::Response::into_body)
8067 }
8068
8069 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8073 self.0.request.name = v.into();
8074 self
8075 }
8076 }
8077
8078 #[doc(hidden)]
8079 impl gax::options::internal::RequestBuilder for GetDataAttribute {
8080 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8081 &mut self.0.options
8082 }
8083 }
8084
8085 #[derive(Clone, Debug)]
8107 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
8108
8109 impl ListLocations {
8110 pub(crate) fn new(
8111 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8112 ) -> Self {
8113 Self(RequestBuilder::new(stub))
8114 }
8115
8116 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
8118 mut self,
8119 v: V,
8120 ) -> Self {
8121 self.0.request = v.into();
8122 self
8123 }
8124
8125 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8127 self.0.options = v.into();
8128 self
8129 }
8130
8131 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
8133 (*self.0.stub)
8134 .list_locations(self.0.request, self.0.options)
8135 .await
8136 .map(gax::response::Response::into_body)
8137 }
8138
8139 pub fn by_page(
8141 self,
8142 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
8143 {
8144 use std::clone::Clone;
8145 let token = self.0.request.page_token.clone();
8146 let execute = move |token: String| {
8147 let mut builder = self.clone();
8148 builder.0.request = builder.0.request.set_page_token(token);
8149 builder.send()
8150 };
8151 gax::paginator::internal::new_paginator(token, execute)
8152 }
8153
8154 pub fn by_item(
8156 self,
8157 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
8158 {
8159 use gax::paginator::Paginator;
8160 self.by_page().items()
8161 }
8162
8163 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8165 self.0.request.name = v.into();
8166 self
8167 }
8168
8169 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8171 self.0.request.filter = v.into();
8172 self
8173 }
8174
8175 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8177 self.0.request.page_size = v.into();
8178 self
8179 }
8180
8181 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8183 self.0.request.page_token = v.into();
8184 self
8185 }
8186 }
8187
8188 #[doc(hidden)]
8189 impl gax::options::internal::RequestBuilder for ListLocations {
8190 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8191 &mut self.0.options
8192 }
8193 }
8194
8195 #[derive(Clone, Debug)]
8213 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
8214
8215 impl GetLocation {
8216 pub(crate) fn new(
8217 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8218 ) -> Self {
8219 Self(RequestBuilder::new(stub))
8220 }
8221
8222 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
8224 self.0.request = v.into();
8225 self
8226 }
8227
8228 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8230 self.0.options = v.into();
8231 self
8232 }
8233
8234 pub async fn send(self) -> Result<location::model::Location> {
8236 (*self.0.stub)
8237 .get_location(self.0.request, self.0.options)
8238 .await
8239 .map(gax::response::Response::into_body)
8240 }
8241
8242 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8244 self.0.request.name = v.into();
8245 self
8246 }
8247 }
8248
8249 #[doc(hidden)]
8250 impl gax::options::internal::RequestBuilder for GetLocation {
8251 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8252 &mut self.0.options
8253 }
8254 }
8255
8256 #[derive(Clone, Debug)]
8274 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
8275
8276 impl SetIamPolicy {
8277 pub(crate) fn new(
8278 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8279 ) -> Self {
8280 Self(RequestBuilder::new(stub))
8281 }
8282
8283 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
8285 self.0.request = v.into();
8286 self
8287 }
8288
8289 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8291 self.0.options = v.into();
8292 self
8293 }
8294
8295 pub async fn send(self) -> Result<iam_v1::model::Policy> {
8297 (*self.0.stub)
8298 .set_iam_policy(self.0.request, self.0.options)
8299 .await
8300 .map(gax::response::Response::into_body)
8301 }
8302
8303 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8307 self.0.request.resource = v.into();
8308 self
8309 }
8310
8311 pub fn set_policy<T>(mut self, v: T) -> Self
8315 where
8316 T: std::convert::Into<iam_v1::model::Policy>,
8317 {
8318 self.0.request.policy = std::option::Option::Some(v.into());
8319 self
8320 }
8321
8322 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8326 where
8327 T: std::convert::Into<iam_v1::model::Policy>,
8328 {
8329 self.0.request.policy = v.map(|x| x.into());
8330 self
8331 }
8332
8333 pub fn set_update_mask<T>(mut self, v: T) -> Self
8335 where
8336 T: std::convert::Into<wkt::FieldMask>,
8337 {
8338 self.0.request.update_mask = std::option::Option::Some(v.into());
8339 self
8340 }
8341
8342 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8344 where
8345 T: std::convert::Into<wkt::FieldMask>,
8346 {
8347 self.0.request.update_mask = v.map(|x| x.into());
8348 self
8349 }
8350 }
8351
8352 #[doc(hidden)]
8353 impl gax::options::internal::RequestBuilder for SetIamPolicy {
8354 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8355 &mut self.0.options
8356 }
8357 }
8358
8359 #[derive(Clone, Debug)]
8377 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
8378
8379 impl GetIamPolicy {
8380 pub(crate) fn new(
8381 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8382 ) -> Self {
8383 Self(RequestBuilder::new(stub))
8384 }
8385
8386 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
8388 self.0.request = v.into();
8389 self
8390 }
8391
8392 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8394 self.0.options = v.into();
8395 self
8396 }
8397
8398 pub async fn send(self) -> Result<iam_v1::model::Policy> {
8400 (*self.0.stub)
8401 .get_iam_policy(self.0.request, self.0.options)
8402 .await
8403 .map(gax::response::Response::into_body)
8404 }
8405
8406 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8410 self.0.request.resource = v.into();
8411 self
8412 }
8413
8414 pub fn set_options<T>(mut self, v: T) -> Self
8416 where
8417 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8418 {
8419 self.0.request.options = std::option::Option::Some(v.into());
8420 self
8421 }
8422
8423 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8425 where
8426 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8427 {
8428 self.0.request.options = v.map(|x| x.into());
8429 self
8430 }
8431 }
8432
8433 #[doc(hidden)]
8434 impl gax::options::internal::RequestBuilder for GetIamPolicy {
8435 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8436 &mut self.0.options
8437 }
8438 }
8439
8440 #[derive(Clone, Debug)]
8458 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
8459
8460 impl TestIamPermissions {
8461 pub(crate) fn new(
8462 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8463 ) -> Self {
8464 Self(RequestBuilder::new(stub))
8465 }
8466
8467 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
8469 mut self,
8470 v: V,
8471 ) -> Self {
8472 self.0.request = v.into();
8473 self
8474 }
8475
8476 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8478 self.0.options = v.into();
8479 self
8480 }
8481
8482 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
8484 (*self.0.stub)
8485 .test_iam_permissions(self.0.request, self.0.options)
8486 .await
8487 .map(gax::response::Response::into_body)
8488 }
8489
8490 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8494 self.0.request.resource = v.into();
8495 self
8496 }
8497
8498 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8502 where
8503 T: std::iter::IntoIterator<Item = V>,
8504 V: std::convert::Into<std::string::String>,
8505 {
8506 use std::iter::Iterator;
8507 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8508 self
8509 }
8510 }
8511
8512 #[doc(hidden)]
8513 impl gax::options::internal::RequestBuilder for TestIamPermissions {
8514 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8515 &mut self.0.options
8516 }
8517 }
8518
8519 #[derive(Clone, Debug)]
8541 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8542
8543 impl ListOperations {
8544 pub(crate) fn new(
8545 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8546 ) -> Self {
8547 Self(RequestBuilder::new(stub))
8548 }
8549
8550 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8552 mut self,
8553 v: V,
8554 ) -> Self {
8555 self.0.request = v.into();
8556 self
8557 }
8558
8559 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8561 self.0.options = v.into();
8562 self
8563 }
8564
8565 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8567 (*self.0.stub)
8568 .list_operations(self.0.request, self.0.options)
8569 .await
8570 .map(gax::response::Response::into_body)
8571 }
8572
8573 pub fn by_page(
8575 self,
8576 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8577 {
8578 use std::clone::Clone;
8579 let token = self.0.request.page_token.clone();
8580 let execute = move |token: String| {
8581 let mut builder = self.clone();
8582 builder.0.request = builder.0.request.set_page_token(token);
8583 builder.send()
8584 };
8585 gax::paginator::internal::new_paginator(token, execute)
8586 }
8587
8588 pub fn by_item(
8590 self,
8591 ) -> impl gax::paginator::ItemPaginator<
8592 longrunning::model::ListOperationsResponse,
8593 gax::error::Error,
8594 > {
8595 use gax::paginator::Paginator;
8596 self.by_page().items()
8597 }
8598
8599 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8601 self.0.request.name = v.into();
8602 self
8603 }
8604
8605 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8607 self.0.request.filter = v.into();
8608 self
8609 }
8610
8611 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8613 self.0.request.page_size = v.into();
8614 self
8615 }
8616
8617 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8619 self.0.request.page_token = v.into();
8620 self
8621 }
8622 }
8623
8624 #[doc(hidden)]
8625 impl gax::options::internal::RequestBuilder for ListOperations {
8626 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8627 &mut self.0.options
8628 }
8629 }
8630
8631 #[derive(Clone, Debug)]
8649 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8650
8651 impl GetOperation {
8652 pub(crate) fn new(
8653 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8654 ) -> Self {
8655 Self(RequestBuilder::new(stub))
8656 }
8657
8658 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8660 mut self,
8661 v: V,
8662 ) -> Self {
8663 self.0.request = v.into();
8664 self
8665 }
8666
8667 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8669 self.0.options = v.into();
8670 self
8671 }
8672
8673 pub async fn send(self) -> Result<longrunning::model::Operation> {
8675 (*self.0.stub)
8676 .get_operation(self.0.request, self.0.options)
8677 .await
8678 .map(gax::response::Response::into_body)
8679 }
8680
8681 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8683 self.0.request.name = v.into();
8684 self
8685 }
8686 }
8687
8688 #[doc(hidden)]
8689 impl gax::options::internal::RequestBuilder for GetOperation {
8690 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8691 &mut self.0.options
8692 }
8693 }
8694
8695 #[derive(Clone, Debug)]
8713 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
8714
8715 impl DeleteOperation {
8716 pub(crate) fn new(
8717 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8718 ) -> Self {
8719 Self(RequestBuilder::new(stub))
8720 }
8721
8722 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
8724 mut self,
8725 v: V,
8726 ) -> Self {
8727 self.0.request = v.into();
8728 self
8729 }
8730
8731 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8733 self.0.options = v.into();
8734 self
8735 }
8736
8737 pub async fn send(self) -> Result<()> {
8739 (*self.0.stub)
8740 .delete_operation(self.0.request, self.0.options)
8741 .await
8742 .map(gax::response::Response::into_body)
8743 }
8744
8745 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8747 self.0.request.name = v.into();
8748 self
8749 }
8750 }
8751
8752 #[doc(hidden)]
8753 impl gax::options::internal::RequestBuilder for DeleteOperation {
8754 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8755 &mut self.0.options
8756 }
8757 }
8758
8759 #[derive(Clone, Debug)]
8777 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8778
8779 impl CancelOperation {
8780 pub(crate) fn new(
8781 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8782 ) -> Self {
8783 Self(RequestBuilder::new(stub))
8784 }
8785
8786 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8788 mut self,
8789 v: V,
8790 ) -> Self {
8791 self.0.request = v.into();
8792 self
8793 }
8794
8795 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8797 self.0.options = v.into();
8798 self
8799 }
8800
8801 pub async fn send(self) -> Result<()> {
8803 (*self.0.stub)
8804 .cancel_operation(self.0.request, self.0.options)
8805 .await
8806 .map(gax::response::Response::into_body)
8807 }
8808
8809 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8811 self.0.request.name = v.into();
8812 self
8813 }
8814 }
8815
8816 #[doc(hidden)]
8817 impl gax::options::internal::RequestBuilder for CancelOperation {
8818 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8819 &mut self.0.options
8820 }
8821 }
8822}
8823
8824pub mod data_scan_service {
8825 use crate::Result;
8826
8827 pub type ClientBuilder =
8841 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8842
8843 pub(crate) mod client {
8844 use super::super::super::client::DataScanService;
8845 pub struct Factory;
8846 impl gax::client_builder::internal::ClientFactory for Factory {
8847 type Client = DataScanService;
8848 type Credentials = gaxi::options::Credentials;
8849 async fn build(
8850 self,
8851 config: gaxi::options::ClientConfig,
8852 ) -> gax::client_builder::Result<Self::Client> {
8853 Self::Client::new(config).await
8854 }
8855 }
8856 }
8857
8858 #[derive(Clone, Debug)]
8860 pub(crate) struct RequestBuilder<R: std::default::Default> {
8861 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
8862 request: R,
8863 options: gax::options::RequestOptions,
8864 }
8865
8866 impl<R> RequestBuilder<R>
8867 where
8868 R: std::default::Default,
8869 {
8870 pub(crate) fn new(
8871 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
8872 ) -> Self {
8873 Self {
8874 stub,
8875 request: R::default(),
8876 options: gax::options::RequestOptions::default(),
8877 }
8878 }
8879 }
8880
8881 #[derive(Clone, Debug)]
8900 pub struct CreateDataScan(RequestBuilder<crate::model::CreateDataScanRequest>);
8901
8902 impl CreateDataScan {
8903 pub(crate) fn new(
8904 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
8905 ) -> Self {
8906 Self(RequestBuilder::new(stub))
8907 }
8908
8909 pub fn with_request<V: Into<crate::model::CreateDataScanRequest>>(mut self, v: V) -> Self {
8911 self.0.request = v.into();
8912 self
8913 }
8914
8915 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8917 self.0.options = v.into();
8918 self
8919 }
8920
8921 pub async fn send(self) -> Result<longrunning::model::Operation> {
8928 (*self.0.stub)
8929 .create_data_scan(self.0.request, self.0.options)
8930 .await
8931 .map(gax::response::Response::into_body)
8932 }
8933
8934 pub fn poller(
8936 self,
8937 ) -> impl lro::Poller<crate::model::DataScan, crate::model::OperationMetadata> {
8938 type Operation =
8939 lro::internal::Operation<crate::model::DataScan, crate::model::OperationMetadata>;
8940 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8941 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8942
8943 let stub = self.0.stub.clone();
8944 let mut options = self.0.options.clone();
8945 options.set_retry_policy(gax::retry_policy::NeverRetry);
8946 let query = move |name| {
8947 let stub = stub.clone();
8948 let options = options.clone();
8949 async {
8950 let op = GetOperation::new(stub)
8951 .set_name(name)
8952 .with_options(options)
8953 .send()
8954 .await?;
8955 Ok(Operation::new(op))
8956 }
8957 };
8958
8959 let start = move || async {
8960 let op = self.send().await?;
8961 Ok(Operation::new(op))
8962 };
8963
8964 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8965 }
8966
8967 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8971 self.0.request.parent = v.into();
8972 self
8973 }
8974
8975 pub fn set_data_scan<T>(mut self, v: T) -> Self
8979 where
8980 T: std::convert::Into<crate::model::DataScan>,
8981 {
8982 self.0.request.data_scan = std::option::Option::Some(v.into());
8983 self
8984 }
8985
8986 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
8990 where
8991 T: std::convert::Into<crate::model::DataScan>,
8992 {
8993 self.0.request.data_scan = v.map(|x| x.into());
8994 self
8995 }
8996
8997 pub fn set_data_scan_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9001 self.0.request.data_scan_id = v.into();
9002 self
9003 }
9004
9005 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9007 self.0.request.validate_only = v.into();
9008 self
9009 }
9010 }
9011
9012 #[doc(hidden)]
9013 impl gax::options::internal::RequestBuilder for CreateDataScan {
9014 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9015 &mut self.0.options
9016 }
9017 }
9018
9019 #[derive(Clone, Debug)]
9038 pub struct UpdateDataScan(RequestBuilder<crate::model::UpdateDataScanRequest>);
9039
9040 impl UpdateDataScan {
9041 pub(crate) fn new(
9042 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
9043 ) -> Self {
9044 Self(RequestBuilder::new(stub))
9045 }
9046
9047 pub fn with_request<V: Into<crate::model::UpdateDataScanRequest>>(mut self, v: V) -> Self {
9049 self.0.request = v.into();
9050 self
9051 }
9052
9053 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9055 self.0.options = v.into();
9056 self
9057 }
9058
9059 pub async fn send(self) -> Result<longrunning::model::Operation> {
9066 (*self.0.stub)
9067 .update_data_scan(self.0.request, self.0.options)
9068 .await
9069 .map(gax::response::Response::into_body)
9070 }
9071
9072 pub fn poller(
9074 self,
9075 ) -> impl lro::Poller<crate::model::DataScan, crate::model::OperationMetadata> {
9076 type Operation =
9077 lro::internal::Operation<crate::model::DataScan, crate::model::OperationMetadata>;
9078 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9079 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9080
9081 let stub = self.0.stub.clone();
9082 let mut options = self.0.options.clone();
9083 options.set_retry_policy(gax::retry_policy::NeverRetry);
9084 let query = move |name| {
9085 let stub = stub.clone();
9086 let options = options.clone();
9087 async {
9088 let op = GetOperation::new(stub)
9089 .set_name(name)
9090 .with_options(options)
9091 .send()
9092 .await?;
9093 Ok(Operation::new(op))
9094 }
9095 };
9096
9097 let start = move || async {
9098 let op = self.send().await?;
9099 Ok(Operation::new(op))
9100 };
9101
9102 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9103 }
9104
9105 pub fn set_data_scan<T>(mut self, v: T) -> Self
9109 where
9110 T: std::convert::Into<crate::model::DataScan>,
9111 {
9112 self.0.request.data_scan = std::option::Option::Some(v.into());
9113 self
9114 }
9115
9116 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
9120 where
9121 T: std::convert::Into<crate::model::DataScan>,
9122 {
9123 self.0.request.data_scan = v.map(|x| x.into());
9124 self
9125 }
9126
9127 pub fn set_update_mask<T>(mut self, v: T) -> Self
9129 where
9130 T: std::convert::Into<wkt::FieldMask>,
9131 {
9132 self.0.request.update_mask = std::option::Option::Some(v.into());
9133 self
9134 }
9135
9136 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9138 where
9139 T: std::convert::Into<wkt::FieldMask>,
9140 {
9141 self.0.request.update_mask = v.map(|x| x.into());
9142 self
9143 }
9144
9145 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9147 self.0.request.validate_only = v.into();
9148 self
9149 }
9150 }
9151
9152 #[doc(hidden)]
9153 impl gax::options::internal::RequestBuilder for UpdateDataScan {
9154 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9155 &mut self.0.options
9156 }
9157 }
9158
9159 #[derive(Clone, Debug)]
9178 pub struct DeleteDataScan(RequestBuilder<crate::model::DeleteDataScanRequest>);
9179
9180 impl DeleteDataScan {
9181 pub(crate) fn new(
9182 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
9183 ) -> Self {
9184 Self(RequestBuilder::new(stub))
9185 }
9186
9187 pub fn with_request<V: Into<crate::model::DeleteDataScanRequest>>(mut self, v: V) -> Self {
9189 self.0.request = v.into();
9190 self
9191 }
9192
9193 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9195 self.0.options = v.into();
9196 self
9197 }
9198
9199 pub async fn send(self) -> Result<longrunning::model::Operation> {
9206 (*self.0.stub)
9207 .delete_data_scan(self.0.request, self.0.options)
9208 .await
9209 .map(gax::response::Response::into_body)
9210 }
9211
9212 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9214 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9215 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9216 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9217
9218 let stub = self.0.stub.clone();
9219 let mut options = self.0.options.clone();
9220 options.set_retry_policy(gax::retry_policy::NeverRetry);
9221 let query = move |name| {
9222 let stub = stub.clone();
9223 let options = options.clone();
9224 async {
9225 let op = GetOperation::new(stub)
9226 .set_name(name)
9227 .with_options(options)
9228 .send()
9229 .await?;
9230 Ok(Operation::new(op))
9231 }
9232 };
9233
9234 let start = move || async {
9235 let op = self.send().await?;
9236 Ok(Operation::new(op))
9237 };
9238
9239 lro::internal::new_unit_response_poller(
9240 polling_error_policy,
9241 polling_backoff_policy,
9242 start,
9243 query,
9244 )
9245 }
9246
9247 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9251 self.0.request.name = v.into();
9252 self
9253 }
9254
9255 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
9257 self.0.request.force = v.into();
9258 self
9259 }
9260 }
9261
9262 #[doc(hidden)]
9263 impl gax::options::internal::RequestBuilder for DeleteDataScan {
9264 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9265 &mut self.0.options
9266 }
9267 }
9268
9269 #[derive(Clone, Debug)]
9287 pub struct GetDataScan(RequestBuilder<crate::model::GetDataScanRequest>);
9288
9289 impl GetDataScan {
9290 pub(crate) fn new(
9291 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
9292 ) -> Self {
9293 Self(RequestBuilder::new(stub))
9294 }
9295
9296 pub fn with_request<V: Into<crate::model::GetDataScanRequest>>(mut self, v: V) -> Self {
9298 self.0.request = v.into();
9299 self
9300 }
9301
9302 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9304 self.0.options = v.into();
9305 self
9306 }
9307
9308 pub async fn send(self) -> Result<crate::model::DataScan> {
9310 (*self.0.stub)
9311 .get_data_scan(self.0.request, self.0.options)
9312 .await
9313 .map(gax::response::Response::into_body)
9314 }
9315
9316 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9320 self.0.request.name = v.into();
9321 self
9322 }
9323
9324 pub fn set_view<T: Into<crate::model::get_data_scan_request::DataScanView>>(
9326 mut self,
9327 v: T,
9328 ) -> Self {
9329 self.0.request.view = v.into();
9330 self
9331 }
9332 }
9333
9334 #[doc(hidden)]
9335 impl gax::options::internal::RequestBuilder for GetDataScan {
9336 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9337 &mut self.0.options
9338 }
9339 }
9340
9341 #[derive(Clone, Debug)]
9363 pub struct ListDataScans(RequestBuilder<crate::model::ListDataScansRequest>);
9364
9365 impl ListDataScans {
9366 pub(crate) fn new(
9367 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
9368 ) -> Self {
9369 Self(RequestBuilder::new(stub))
9370 }
9371
9372 pub fn with_request<V: Into<crate::model::ListDataScansRequest>>(mut self, v: V) -> Self {
9374 self.0.request = v.into();
9375 self
9376 }
9377
9378 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9380 self.0.options = v.into();
9381 self
9382 }
9383
9384 pub async fn send(self) -> Result<crate::model::ListDataScansResponse> {
9386 (*self.0.stub)
9387 .list_data_scans(self.0.request, self.0.options)
9388 .await
9389 .map(gax::response::Response::into_body)
9390 }
9391
9392 pub fn by_page(
9394 self,
9395 ) -> impl gax::paginator::Paginator<crate::model::ListDataScansResponse, gax::error::Error>
9396 {
9397 use std::clone::Clone;
9398 let token = self.0.request.page_token.clone();
9399 let execute = move |token: String| {
9400 let mut builder = self.clone();
9401 builder.0.request = builder.0.request.set_page_token(token);
9402 builder.send()
9403 };
9404 gax::paginator::internal::new_paginator(token, execute)
9405 }
9406
9407 pub fn by_item(
9409 self,
9410 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDataScansResponse, gax::error::Error>
9411 {
9412 use gax::paginator::Paginator;
9413 self.by_page().items()
9414 }
9415
9416 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9420 self.0.request.parent = v.into();
9421 self
9422 }
9423
9424 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9426 self.0.request.page_size = v.into();
9427 self
9428 }
9429
9430 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9432 self.0.request.page_token = v.into();
9433 self
9434 }
9435
9436 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9438 self.0.request.filter = v.into();
9439 self
9440 }
9441
9442 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9444 self.0.request.order_by = v.into();
9445 self
9446 }
9447 }
9448
9449 #[doc(hidden)]
9450 impl gax::options::internal::RequestBuilder for ListDataScans {
9451 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9452 &mut self.0.options
9453 }
9454 }
9455
9456 #[derive(Clone, Debug)]
9474 pub struct RunDataScan(RequestBuilder<crate::model::RunDataScanRequest>);
9475
9476 impl RunDataScan {
9477 pub(crate) fn new(
9478 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
9479 ) -> Self {
9480 Self(RequestBuilder::new(stub))
9481 }
9482
9483 pub fn with_request<V: Into<crate::model::RunDataScanRequest>>(mut self, v: V) -> Self {
9485 self.0.request = v.into();
9486 self
9487 }
9488
9489 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9491 self.0.options = v.into();
9492 self
9493 }
9494
9495 pub async fn send(self) -> Result<crate::model::RunDataScanResponse> {
9497 (*self.0.stub)
9498 .run_data_scan(self.0.request, self.0.options)
9499 .await
9500 .map(gax::response::Response::into_body)
9501 }
9502
9503 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9507 self.0.request.name = v.into();
9508 self
9509 }
9510 }
9511
9512 #[doc(hidden)]
9513 impl gax::options::internal::RequestBuilder for RunDataScan {
9514 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9515 &mut self.0.options
9516 }
9517 }
9518
9519 #[derive(Clone, Debug)]
9537 pub struct GetDataScanJob(RequestBuilder<crate::model::GetDataScanJobRequest>);
9538
9539 impl GetDataScanJob {
9540 pub(crate) fn new(
9541 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
9542 ) -> Self {
9543 Self(RequestBuilder::new(stub))
9544 }
9545
9546 pub fn with_request<V: Into<crate::model::GetDataScanJobRequest>>(mut self, v: V) -> Self {
9548 self.0.request = v.into();
9549 self
9550 }
9551
9552 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9554 self.0.options = v.into();
9555 self
9556 }
9557
9558 pub async fn send(self) -> Result<crate::model::DataScanJob> {
9560 (*self.0.stub)
9561 .get_data_scan_job(self.0.request, self.0.options)
9562 .await
9563 .map(gax::response::Response::into_body)
9564 }
9565
9566 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9570 self.0.request.name = v.into();
9571 self
9572 }
9573
9574 pub fn set_view<T: Into<crate::model::get_data_scan_job_request::DataScanJobView>>(
9576 mut self,
9577 v: T,
9578 ) -> Self {
9579 self.0.request.view = v.into();
9580 self
9581 }
9582 }
9583
9584 #[doc(hidden)]
9585 impl gax::options::internal::RequestBuilder for GetDataScanJob {
9586 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9587 &mut self.0.options
9588 }
9589 }
9590
9591 #[derive(Clone, Debug)]
9613 pub struct ListDataScanJobs(RequestBuilder<crate::model::ListDataScanJobsRequest>);
9614
9615 impl ListDataScanJobs {
9616 pub(crate) fn new(
9617 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
9618 ) -> Self {
9619 Self(RequestBuilder::new(stub))
9620 }
9621
9622 pub fn with_request<V: Into<crate::model::ListDataScanJobsRequest>>(
9624 mut self,
9625 v: V,
9626 ) -> Self {
9627 self.0.request = v.into();
9628 self
9629 }
9630
9631 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9633 self.0.options = v.into();
9634 self
9635 }
9636
9637 pub async fn send(self) -> Result<crate::model::ListDataScanJobsResponse> {
9639 (*self.0.stub)
9640 .list_data_scan_jobs(self.0.request, self.0.options)
9641 .await
9642 .map(gax::response::Response::into_body)
9643 }
9644
9645 pub fn by_page(
9647 self,
9648 ) -> impl gax::paginator::Paginator<crate::model::ListDataScanJobsResponse, gax::error::Error>
9649 {
9650 use std::clone::Clone;
9651 let token = self.0.request.page_token.clone();
9652 let execute = move |token: String| {
9653 let mut builder = self.clone();
9654 builder.0.request = builder.0.request.set_page_token(token);
9655 builder.send()
9656 };
9657 gax::paginator::internal::new_paginator(token, execute)
9658 }
9659
9660 pub fn by_item(
9662 self,
9663 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDataScanJobsResponse, gax::error::Error>
9664 {
9665 use gax::paginator::Paginator;
9666 self.by_page().items()
9667 }
9668
9669 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9673 self.0.request.parent = v.into();
9674 self
9675 }
9676
9677 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9679 self.0.request.page_size = v.into();
9680 self
9681 }
9682
9683 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9685 self.0.request.page_token = v.into();
9686 self
9687 }
9688
9689 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9691 self.0.request.filter = v.into();
9692 self
9693 }
9694 }
9695
9696 #[doc(hidden)]
9697 impl gax::options::internal::RequestBuilder for ListDataScanJobs {
9698 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9699 &mut self.0.options
9700 }
9701 }
9702
9703 #[derive(Clone, Debug)]
9721 pub struct GenerateDataQualityRules(
9722 RequestBuilder<crate::model::GenerateDataQualityRulesRequest>,
9723 );
9724
9725 impl GenerateDataQualityRules {
9726 pub(crate) fn new(
9727 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
9728 ) -> Self {
9729 Self(RequestBuilder::new(stub))
9730 }
9731
9732 pub fn with_request<V: Into<crate::model::GenerateDataQualityRulesRequest>>(
9734 mut self,
9735 v: V,
9736 ) -> Self {
9737 self.0.request = v.into();
9738 self
9739 }
9740
9741 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9743 self.0.options = v.into();
9744 self
9745 }
9746
9747 pub async fn send(self) -> Result<crate::model::GenerateDataQualityRulesResponse> {
9749 (*self.0.stub)
9750 .generate_data_quality_rules(self.0.request, self.0.options)
9751 .await
9752 .map(gax::response::Response::into_body)
9753 }
9754
9755 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9759 self.0.request.name = v.into();
9760 self
9761 }
9762 }
9763
9764 #[doc(hidden)]
9765 impl gax::options::internal::RequestBuilder for GenerateDataQualityRules {
9766 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9767 &mut self.0.options
9768 }
9769 }
9770
9771 #[derive(Clone, Debug)]
9793 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
9794
9795 impl ListLocations {
9796 pub(crate) fn new(
9797 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
9798 ) -> Self {
9799 Self(RequestBuilder::new(stub))
9800 }
9801
9802 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
9804 mut self,
9805 v: V,
9806 ) -> Self {
9807 self.0.request = v.into();
9808 self
9809 }
9810
9811 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9813 self.0.options = v.into();
9814 self
9815 }
9816
9817 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
9819 (*self.0.stub)
9820 .list_locations(self.0.request, self.0.options)
9821 .await
9822 .map(gax::response::Response::into_body)
9823 }
9824
9825 pub fn by_page(
9827 self,
9828 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
9829 {
9830 use std::clone::Clone;
9831 let token = self.0.request.page_token.clone();
9832 let execute = move |token: String| {
9833 let mut builder = self.clone();
9834 builder.0.request = builder.0.request.set_page_token(token);
9835 builder.send()
9836 };
9837 gax::paginator::internal::new_paginator(token, execute)
9838 }
9839
9840 pub fn by_item(
9842 self,
9843 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
9844 {
9845 use gax::paginator::Paginator;
9846 self.by_page().items()
9847 }
9848
9849 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9851 self.0.request.name = v.into();
9852 self
9853 }
9854
9855 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9857 self.0.request.filter = v.into();
9858 self
9859 }
9860
9861 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9863 self.0.request.page_size = v.into();
9864 self
9865 }
9866
9867 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9869 self.0.request.page_token = v.into();
9870 self
9871 }
9872 }
9873
9874 #[doc(hidden)]
9875 impl gax::options::internal::RequestBuilder for ListLocations {
9876 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9877 &mut self.0.options
9878 }
9879 }
9880
9881 #[derive(Clone, Debug)]
9899 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
9900
9901 impl GetLocation {
9902 pub(crate) fn new(
9903 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
9904 ) -> Self {
9905 Self(RequestBuilder::new(stub))
9906 }
9907
9908 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
9910 self.0.request = v.into();
9911 self
9912 }
9913
9914 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9916 self.0.options = v.into();
9917 self
9918 }
9919
9920 pub async fn send(self) -> Result<location::model::Location> {
9922 (*self.0.stub)
9923 .get_location(self.0.request, self.0.options)
9924 .await
9925 .map(gax::response::Response::into_body)
9926 }
9927
9928 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9930 self.0.request.name = v.into();
9931 self
9932 }
9933 }
9934
9935 #[doc(hidden)]
9936 impl gax::options::internal::RequestBuilder for GetLocation {
9937 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9938 &mut self.0.options
9939 }
9940 }
9941
9942 #[derive(Clone, Debug)]
9960 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
9961
9962 impl SetIamPolicy {
9963 pub(crate) fn new(
9964 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
9965 ) -> Self {
9966 Self(RequestBuilder::new(stub))
9967 }
9968
9969 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
9971 self.0.request = v.into();
9972 self
9973 }
9974
9975 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9977 self.0.options = v.into();
9978 self
9979 }
9980
9981 pub async fn send(self) -> Result<iam_v1::model::Policy> {
9983 (*self.0.stub)
9984 .set_iam_policy(self.0.request, self.0.options)
9985 .await
9986 .map(gax::response::Response::into_body)
9987 }
9988
9989 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9993 self.0.request.resource = v.into();
9994 self
9995 }
9996
9997 pub fn set_policy<T>(mut self, v: T) -> Self
10001 where
10002 T: std::convert::Into<iam_v1::model::Policy>,
10003 {
10004 self.0.request.policy = std::option::Option::Some(v.into());
10005 self
10006 }
10007
10008 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10012 where
10013 T: std::convert::Into<iam_v1::model::Policy>,
10014 {
10015 self.0.request.policy = v.map(|x| x.into());
10016 self
10017 }
10018
10019 pub fn set_update_mask<T>(mut self, v: T) -> Self
10021 where
10022 T: std::convert::Into<wkt::FieldMask>,
10023 {
10024 self.0.request.update_mask = std::option::Option::Some(v.into());
10025 self
10026 }
10027
10028 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10030 where
10031 T: std::convert::Into<wkt::FieldMask>,
10032 {
10033 self.0.request.update_mask = v.map(|x| x.into());
10034 self
10035 }
10036 }
10037
10038 #[doc(hidden)]
10039 impl gax::options::internal::RequestBuilder for SetIamPolicy {
10040 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10041 &mut self.0.options
10042 }
10043 }
10044
10045 #[derive(Clone, Debug)]
10063 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
10064
10065 impl GetIamPolicy {
10066 pub(crate) fn new(
10067 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
10068 ) -> Self {
10069 Self(RequestBuilder::new(stub))
10070 }
10071
10072 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
10074 self.0.request = v.into();
10075 self
10076 }
10077
10078 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10080 self.0.options = v.into();
10081 self
10082 }
10083
10084 pub async fn send(self) -> Result<iam_v1::model::Policy> {
10086 (*self.0.stub)
10087 .get_iam_policy(self.0.request, self.0.options)
10088 .await
10089 .map(gax::response::Response::into_body)
10090 }
10091
10092 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10096 self.0.request.resource = v.into();
10097 self
10098 }
10099
10100 pub fn set_options<T>(mut self, v: T) -> Self
10102 where
10103 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10104 {
10105 self.0.request.options = std::option::Option::Some(v.into());
10106 self
10107 }
10108
10109 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10111 where
10112 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10113 {
10114 self.0.request.options = v.map(|x| x.into());
10115 self
10116 }
10117 }
10118
10119 #[doc(hidden)]
10120 impl gax::options::internal::RequestBuilder for GetIamPolicy {
10121 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10122 &mut self.0.options
10123 }
10124 }
10125
10126 #[derive(Clone, Debug)]
10144 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
10145
10146 impl TestIamPermissions {
10147 pub(crate) fn new(
10148 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
10149 ) -> Self {
10150 Self(RequestBuilder::new(stub))
10151 }
10152
10153 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
10155 mut self,
10156 v: V,
10157 ) -> Self {
10158 self.0.request = v.into();
10159 self
10160 }
10161
10162 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10164 self.0.options = v.into();
10165 self
10166 }
10167
10168 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
10170 (*self.0.stub)
10171 .test_iam_permissions(self.0.request, self.0.options)
10172 .await
10173 .map(gax::response::Response::into_body)
10174 }
10175
10176 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10180 self.0.request.resource = v.into();
10181 self
10182 }
10183
10184 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10188 where
10189 T: std::iter::IntoIterator<Item = V>,
10190 V: std::convert::Into<std::string::String>,
10191 {
10192 use std::iter::Iterator;
10193 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10194 self
10195 }
10196 }
10197
10198 #[doc(hidden)]
10199 impl gax::options::internal::RequestBuilder for TestIamPermissions {
10200 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10201 &mut self.0.options
10202 }
10203 }
10204
10205 #[derive(Clone, Debug)]
10227 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
10228
10229 impl ListOperations {
10230 pub(crate) fn new(
10231 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
10232 ) -> Self {
10233 Self(RequestBuilder::new(stub))
10234 }
10235
10236 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
10238 mut self,
10239 v: V,
10240 ) -> Self {
10241 self.0.request = v.into();
10242 self
10243 }
10244
10245 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10247 self.0.options = v.into();
10248 self
10249 }
10250
10251 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
10253 (*self.0.stub)
10254 .list_operations(self.0.request, self.0.options)
10255 .await
10256 .map(gax::response::Response::into_body)
10257 }
10258
10259 pub fn by_page(
10261 self,
10262 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
10263 {
10264 use std::clone::Clone;
10265 let token = self.0.request.page_token.clone();
10266 let execute = move |token: String| {
10267 let mut builder = self.clone();
10268 builder.0.request = builder.0.request.set_page_token(token);
10269 builder.send()
10270 };
10271 gax::paginator::internal::new_paginator(token, execute)
10272 }
10273
10274 pub fn by_item(
10276 self,
10277 ) -> impl gax::paginator::ItemPaginator<
10278 longrunning::model::ListOperationsResponse,
10279 gax::error::Error,
10280 > {
10281 use gax::paginator::Paginator;
10282 self.by_page().items()
10283 }
10284
10285 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10287 self.0.request.name = v.into();
10288 self
10289 }
10290
10291 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10293 self.0.request.filter = v.into();
10294 self
10295 }
10296
10297 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10299 self.0.request.page_size = v.into();
10300 self
10301 }
10302
10303 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10305 self.0.request.page_token = v.into();
10306 self
10307 }
10308 }
10309
10310 #[doc(hidden)]
10311 impl gax::options::internal::RequestBuilder for ListOperations {
10312 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10313 &mut self.0.options
10314 }
10315 }
10316
10317 #[derive(Clone, Debug)]
10335 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
10336
10337 impl GetOperation {
10338 pub(crate) fn new(
10339 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
10340 ) -> Self {
10341 Self(RequestBuilder::new(stub))
10342 }
10343
10344 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
10346 mut self,
10347 v: V,
10348 ) -> Self {
10349 self.0.request = v.into();
10350 self
10351 }
10352
10353 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10355 self.0.options = v.into();
10356 self
10357 }
10358
10359 pub async fn send(self) -> Result<longrunning::model::Operation> {
10361 (*self.0.stub)
10362 .get_operation(self.0.request, self.0.options)
10363 .await
10364 .map(gax::response::Response::into_body)
10365 }
10366
10367 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10369 self.0.request.name = v.into();
10370 self
10371 }
10372 }
10373
10374 #[doc(hidden)]
10375 impl gax::options::internal::RequestBuilder for GetOperation {
10376 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10377 &mut self.0.options
10378 }
10379 }
10380
10381 #[derive(Clone, Debug)]
10399 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
10400
10401 impl DeleteOperation {
10402 pub(crate) fn new(
10403 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
10404 ) -> Self {
10405 Self(RequestBuilder::new(stub))
10406 }
10407
10408 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
10410 mut self,
10411 v: V,
10412 ) -> Self {
10413 self.0.request = v.into();
10414 self
10415 }
10416
10417 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10419 self.0.options = v.into();
10420 self
10421 }
10422
10423 pub async fn send(self) -> Result<()> {
10425 (*self.0.stub)
10426 .delete_operation(self.0.request, self.0.options)
10427 .await
10428 .map(gax::response::Response::into_body)
10429 }
10430
10431 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10433 self.0.request.name = v.into();
10434 self
10435 }
10436 }
10437
10438 #[doc(hidden)]
10439 impl gax::options::internal::RequestBuilder for DeleteOperation {
10440 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10441 &mut self.0.options
10442 }
10443 }
10444
10445 #[derive(Clone, Debug)]
10463 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
10464
10465 impl CancelOperation {
10466 pub(crate) fn new(
10467 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
10468 ) -> Self {
10469 Self(RequestBuilder::new(stub))
10470 }
10471
10472 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
10474 mut self,
10475 v: V,
10476 ) -> Self {
10477 self.0.request = v.into();
10478 self
10479 }
10480
10481 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10483 self.0.options = v.into();
10484 self
10485 }
10486
10487 pub async fn send(self) -> Result<()> {
10489 (*self.0.stub)
10490 .cancel_operation(self.0.request, self.0.options)
10491 .await
10492 .map(gax::response::Response::into_body)
10493 }
10494
10495 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10497 self.0.request.name = v.into();
10498 self
10499 }
10500 }
10501
10502 #[doc(hidden)]
10503 impl gax::options::internal::RequestBuilder for CancelOperation {
10504 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10505 &mut self.0.options
10506 }
10507 }
10508}
10509
10510pub mod metadata_service {
10511 use crate::Result;
10512
10513 pub type ClientBuilder =
10527 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10528
10529 pub(crate) mod client {
10530 use super::super::super::client::MetadataService;
10531 pub struct Factory;
10532 impl gax::client_builder::internal::ClientFactory for Factory {
10533 type Client = MetadataService;
10534 type Credentials = gaxi::options::Credentials;
10535 async fn build(
10536 self,
10537 config: gaxi::options::ClientConfig,
10538 ) -> gax::client_builder::Result<Self::Client> {
10539 Self::Client::new(config).await
10540 }
10541 }
10542 }
10543
10544 #[derive(Clone, Debug)]
10546 pub(crate) struct RequestBuilder<R: std::default::Default> {
10547 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
10548 request: R,
10549 options: gax::options::RequestOptions,
10550 }
10551
10552 impl<R> RequestBuilder<R>
10553 where
10554 R: std::default::Default,
10555 {
10556 pub(crate) fn new(
10557 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
10558 ) -> Self {
10559 Self {
10560 stub,
10561 request: R::default(),
10562 options: gax::options::RequestOptions::default(),
10563 }
10564 }
10565 }
10566
10567 #[derive(Clone, Debug)]
10585 pub struct CreateEntity(RequestBuilder<crate::model::CreateEntityRequest>);
10586
10587 impl CreateEntity {
10588 pub(crate) fn new(
10589 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
10590 ) -> Self {
10591 Self(RequestBuilder::new(stub))
10592 }
10593
10594 pub fn with_request<V: Into<crate::model::CreateEntityRequest>>(mut self, v: V) -> Self {
10596 self.0.request = v.into();
10597 self
10598 }
10599
10600 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10602 self.0.options = v.into();
10603 self
10604 }
10605
10606 pub async fn send(self) -> Result<crate::model::Entity> {
10608 (*self.0.stub)
10609 .create_entity(self.0.request, self.0.options)
10610 .await
10611 .map(gax::response::Response::into_body)
10612 }
10613
10614 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10618 self.0.request.parent = v.into();
10619 self
10620 }
10621
10622 pub fn set_entity<T>(mut self, v: T) -> Self
10626 where
10627 T: std::convert::Into<crate::model::Entity>,
10628 {
10629 self.0.request.entity = std::option::Option::Some(v.into());
10630 self
10631 }
10632
10633 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
10637 where
10638 T: std::convert::Into<crate::model::Entity>,
10639 {
10640 self.0.request.entity = v.map(|x| x.into());
10641 self
10642 }
10643
10644 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10646 self.0.request.validate_only = v.into();
10647 self
10648 }
10649 }
10650
10651 #[doc(hidden)]
10652 impl gax::options::internal::RequestBuilder for CreateEntity {
10653 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10654 &mut self.0.options
10655 }
10656 }
10657
10658 #[derive(Clone, Debug)]
10676 pub struct UpdateEntity(RequestBuilder<crate::model::UpdateEntityRequest>);
10677
10678 impl UpdateEntity {
10679 pub(crate) fn new(
10680 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
10681 ) -> Self {
10682 Self(RequestBuilder::new(stub))
10683 }
10684
10685 pub fn with_request<V: Into<crate::model::UpdateEntityRequest>>(mut self, v: V) -> Self {
10687 self.0.request = v.into();
10688 self
10689 }
10690
10691 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10693 self.0.options = v.into();
10694 self
10695 }
10696
10697 pub async fn send(self) -> Result<crate::model::Entity> {
10699 (*self.0.stub)
10700 .update_entity(self.0.request, self.0.options)
10701 .await
10702 .map(gax::response::Response::into_body)
10703 }
10704
10705 pub fn set_entity<T>(mut self, v: T) -> Self
10709 where
10710 T: std::convert::Into<crate::model::Entity>,
10711 {
10712 self.0.request.entity = std::option::Option::Some(v.into());
10713 self
10714 }
10715
10716 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
10720 where
10721 T: std::convert::Into<crate::model::Entity>,
10722 {
10723 self.0.request.entity = v.map(|x| x.into());
10724 self
10725 }
10726
10727 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10729 self.0.request.validate_only = v.into();
10730 self
10731 }
10732 }
10733
10734 #[doc(hidden)]
10735 impl gax::options::internal::RequestBuilder for UpdateEntity {
10736 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10737 &mut self.0.options
10738 }
10739 }
10740
10741 #[derive(Clone, Debug)]
10759 pub struct DeleteEntity(RequestBuilder<crate::model::DeleteEntityRequest>);
10760
10761 impl DeleteEntity {
10762 pub(crate) fn new(
10763 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
10764 ) -> Self {
10765 Self(RequestBuilder::new(stub))
10766 }
10767
10768 pub fn with_request<V: Into<crate::model::DeleteEntityRequest>>(mut self, v: V) -> Self {
10770 self.0.request = v.into();
10771 self
10772 }
10773
10774 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10776 self.0.options = v.into();
10777 self
10778 }
10779
10780 pub async fn send(self) -> Result<()> {
10782 (*self.0.stub)
10783 .delete_entity(self.0.request, self.0.options)
10784 .await
10785 .map(gax::response::Response::into_body)
10786 }
10787
10788 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10792 self.0.request.name = v.into();
10793 self
10794 }
10795
10796 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
10800 self.0.request.etag = v.into();
10801 self
10802 }
10803 }
10804
10805 #[doc(hidden)]
10806 impl gax::options::internal::RequestBuilder for DeleteEntity {
10807 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10808 &mut self.0.options
10809 }
10810 }
10811
10812 #[derive(Clone, Debug)]
10830 pub struct GetEntity(RequestBuilder<crate::model::GetEntityRequest>);
10831
10832 impl GetEntity {
10833 pub(crate) fn new(
10834 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
10835 ) -> Self {
10836 Self(RequestBuilder::new(stub))
10837 }
10838
10839 pub fn with_request<V: Into<crate::model::GetEntityRequest>>(mut self, v: V) -> Self {
10841 self.0.request = v.into();
10842 self
10843 }
10844
10845 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10847 self.0.options = v.into();
10848 self
10849 }
10850
10851 pub async fn send(self) -> Result<crate::model::Entity> {
10853 (*self.0.stub)
10854 .get_entity(self.0.request, self.0.options)
10855 .await
10856 .map(gax::response::Response::into_body)
10857 }
10858
10859 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10863 self.0.request.name = v.into();
10864 self
10865 }
10866
10867 pub fn set_view<T: Into<crate::model::get_entity_request::EntityView>>(
10869 mut self,
10870 v: T,
10871 ) -> Self {
10872 self.0.request.view = v.into();
10873 self
10874 }
10875 }
10876
10877 #[doc(hidden)]
10878 impl gax::options::internal::RequestBuilder for GetEntity {
10879 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10880 &mut self.0.options
10881 }
10882 }
10883
10884 #[derive(Clone, Debug)]
10906 pub struct ListEntities(RequestBuilder<crate::model::ListEntitiesRequest>);
10907
10908 impl ListEntities {
10909 pub(crate) fn new(
10910 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
10911 ) -> Self {
10912 Self(RequestBuilder::new(stub))
10913 }
10914
10915 pub fn with_request<V: Into<crate::model::ListEntitiesRequest>>(mut self, v: V) -> Self {
10917 self.0.request = v.into();
10918 self
10919 }
10920
10921 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10923 self.0.options = v.into();
10924 self
10925 }
10926
10927 pub async fn send(self) -> Result<crate::model::ListEntitiesResponse> {
10929 (*self.0.stub)
10930 .list_entities(self.0.request, self.0.options)
10931 .await
10932 .map(gax::response::Response::into_body)
10933 }
10934
10935 pub fn by_page(
10937 self,
10938 ) -> impl gax::paginator::Paginator<crate::model::ListEntitiesResponse, gax::error::Error>
10939 {
10940 use std::clone::Clone;
10941 let token = self.0.request.page_token.clone();
10942 let execute = move |token: String| {
10943 let mut builder = self.clone();
10944 builder.0.request = builder.0.request.set_page_token(token);
10945 builder.send()
10946 };
10947 gax::paginator::internal::new_paginator(token, execute)
10948 }
10949
10950 pub fn by_item(
10952 self,
10953 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntitiesResponse, gax::error::Error>
10954 {
10955 use gax::paginator::Paginator;
10956 self.by_page().items()
10957 }
10958
10959 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10963 self.0.request.parent = v.into();
10964 self
10965 }
10966
10967 pub fn set_view<T: Into<crate::model::list_entities_request::EntityView>>(
10971 mut self,
10972 v: T,
10973 ) -> Self {
10974 self.0.request.view = v.into();
10975 self
10976 }
10977
10978 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10980 self.0.request.page_size = v.into();
10981 self
10982 }
10983
10984 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10986 self.0.request.page_token = v.into();
10987 self
10988 }
10989
10990 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10992 self.0.request.filter = v.into();
10993 self
10994 }
10995 }
10996
10997 #[doc(hidden)]
10998 impl gax::options::internal::RequestBuilder for ListEntities {
10999 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11000 &mut self.0.options
11001 }
11002 }
11003
11004 #[derive(Clone, Debug)]
11022 pub struct CreatePartition(RequestBuilder<crate::model::CreatePartitionRequest>);
11023
11024 impl CreatePartition {
11025 pub(crate) fn new(
11026 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11027 ) -> Self {
11028 Self(RequestBuilder::new(stub))
11029 }
11030
11031 pub fn with_request<V: Into<crate::model::CreatePartitionRequest>>(mut self, v: V) -> Self {
11033 self.0.request = v.into();
11034 self
11035 }
11036
11037 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11039 self.0.options = v.into();
11040 self
11041 }
11042
11043 pub async fn send(self) -> Result<crate::model::Partition> {
11045 (*self.0.stub)
11046 .create_partition(self.0.request, self.0.options)
11047 .await
11048 .map(gax::response::Response::into_body)
11049 }
11050
11051 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11055 self.0.request.parent = v.into();
11056 self
11057 }
11058
11059 pub fn set_partition<T>(mut self, v: T) -> Self
11063 where
11064 T: std::convert::Into<crate::model::Partition>,
11065 {
11066 self.0.request.partition = std::option::Option::Some(v.into());
11067 self
11068 }
11069
11070 pub fn set_or_clear_partition<T>(mut self, v: std::option::Option<T>) -> Self
11074 where
11075 T: std::convert::Into<crate::model::Partition>,
11076 {
11077 self.0.request.partition = v.map(|x| x.into());
11078 self
11079 }
11080
11081 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11083 self.0.request.validate_only = v.into();
11084 self
11085 }
11086 }
11087
11088 #[doc(hidden)]
11089 impl gax::options::internal::RequestBuilder for CreatePartition {
11090 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11091 &mut self.0.options
11092 }
11093 }
11094
11095 #[derive(Clone, Debug)]
11113 pub struct DeletePartition(RequestBuilder<crate::model::DeletePartitionRequest>);
11114
11115 impl DeletePartition {
11116 pub(crate) fn new(
11117 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11118 ) -> Self {
11119 Self(RequestBuilder::new(stub))
11120 }
11121
11122 pub fn with_request<V: Into<crate::model::DeletePartitionRequest>>(mut self, v: V) -> Self {
11124 self.0.request = v.into();
11125 self
11126 }
11127
11128 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11130 self.0.options = v.into();
11131 self
11132 }
11133
11134 pub async fn send(self) -> Result<()> {
11136 (*self.0.stub)
11137 .delete_partition(self.0.request, self.0.options)
11138 .await
11139 .map(gax::response::Response::into_body)
11140 }
11141
11142 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11146 self.0.request.name = v.into();
11147 self
11148 }
11149
11150 #[deprecated]
11152 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
11153 self.0.request.etag = v.into();
11154 self
11155 }
11156 }
11157
11158 #[doc(hidden)]
11159 impl gax::options::internal::RequestBuilder for DeletePartition {
11160 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11161 &mut self.0.options
11162 }
11163 }
11164
11165 #[derive(Clone, Debug)]
11183 pub struct GetPartition(RequestBuilder<crate::model::GetPartitionRequest>);
11184
11185 impl GetPartition {
11186 pub(crate) fn new(
11187 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11188 ) -> Self {
11189 Self(RequestBuilder::new(stub))
11190 }
11191
11192 pub fn with_request<V: Into<crate::model::GetPartitionRequest>>(mut self, v: V) -> Self {
11194 self.0.request = v.into();
11195 self
11196 }
11197
11198 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11200 self.0.options = v.into();
11201 self
11202 }
11203
11204 pub async fn send(self) -> Result<crate::model::Partition> {
11206 (*self.0.stub)
11207 .get_partition(self.0.request, self.0.options)
11208 .await
11209 .map(gax::response::Response::into_body)
11210 }
11211
11212 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11216 self.0.request.name = v.into();
11217 self
11218 }
11219 }
11220
11221 #[doc(hidden)]
11222 impl gax::options::internal::RequestBuilder for GetPartition {
11223 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11224 &mut self.0.options
11225 }
11226 }
11227
11228 #[derive(Clone, Debug)]
11250 pub struct ListPartitions(RequestBuilder<crate::model::ListPartitionsRequest>);
11251
11252 impl ListPartitions {
11253 pub(crate) fn new(
11254 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11255 ) -> Self {
11256 Self(RequestBuilder::new(stub))
11257 }
11258
11259 pub fn with_request<V: Into<crate::model::ListPartitionsRequest>>(mut self, v: V) -> Self {
11261 self.0.request = v.into();
11262 self
11263 }
11264
11265 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11267 self.0.options = v.into();
11268 self
11269 }
11270
11271 pub async fn send(self) -> Result<crate::model::ListPartitionsResponse> {
11273 (*self.0.stub)
11274 .list_partitions(self.0.request, self.0.options)
11275 .await
11276 .map(gax::response::Response::into_body)
11277 }
11278
11279 pub fn by_page(
11281 self,
11282 ) -> impl gax::paginator::Paginator<crate::model::ListPartitionsResponse, gax::error::Error>
11283 {
11284 use std::clone::Clone;
11285 let token = self.0.request.page_token.clone();
11286 let execute = move |token: String| {
11287 let mut builder = self.clone();
11288 builder.0.request = builder.0.request.set_page_token(token);
11289 builder.send()
11290 };
11291 gax::paginator::internal::new_paginator(token, execute)
11292 }
11293
11294 pub fn by_item(
11296 self,
11297 ) -> impl gax::paginator::ItemPaginator<crate::model::ListPartitionsResponse, gax::error::Error>
11298 {
11299 use gax::paginator::Paginator;
11300 self.by_page().items()
11301 }
11302
11303 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11307 self.0.request.parent = v.into();
11308 self
11309 }
11310
11311 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11313 self.0.request.page_size = v.into();
11314 self
11315 }
11316
11317 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11319 self.0.request.page_token = v.into();
11320 self
11321 }
11322
11323 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11325 self.0.request.filter = v.into();
11326 self
11327 }
11328 }
11329
11330 #[doc(hidden)]
11331 impl gax::options::internal::RequestBuilder for ListPartitions {
11332 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11333 &mut self.0.options
11334 }
11335 }
11336
11337 #[derive(Clone, Debug)]
11359 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
11360
11361 impl ListLocations {
11362 pub(crate) fn new(
11363 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11364 ) -> Self {
11365 Self(RequestBuilder::new(stub))
11366 }
11367
11368 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
11370 mut self,
11371 v: V,
11372 ) -> Self {
11373 self.0.request = v.into();
11374 self
11375 }
11376
11377 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11379 self.0.options = v.into();
11380 self
11381 }
11382
11383 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
11385 (*self.0.stub)
11386 .list_locations(self.0.request, self.0.options)
11387 .await
11388 .map(gax::response::Response::into_body)
11389 }
11390
11391 pub fn by_page(
11393 self,
11394 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
11395 {
11396 use std::clone::Clone;
11397 let token = self.0.request.page_token.clone();
11398 let execute = move |token: String| {
11399 let mut builder = self.clone();
11400 builder.0.request = builder.0.request.set_page_token(token);
11401 builder.send()
11402 };
11403 gax::paginator::internal::new_paginator(token, execute)
11404 }
11405
11406 pub fn by_item(
11408 self,
11409 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
11410 {
11411 use gax::paginator::Paginator;
11412 self.by_page().items()
11413 }
11414
11415 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11417 self.0.request.name = v.into();
11418 self
11419 }
11420
11421 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11423 self.0.request.filter = v.into();
11424 self
11425 }
11426
11427 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11429 self.0.request.page_size = v.into();
11430 self
11431 }
11432
11433 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11435 self.0.request.page_token = v.into();
11436 self
11437 }
11438 }
11439
11440 #[doc(hidden)]
11441 impl gax::options::internal::RequestBuilder for ListLocations {
11442 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11443 &mut self.0.options
11444 }
11445 }
11446
11447 #[derive(Clone, Debug)]
11465 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
11466
11467 impl GetLocation {
11468 pub(crate) fn new(
11469 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11470 ) -> Self {
11471 Self(RequestBuilder::new(stub))
11472 }
11473
11474 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
11476 self.0.request = v.into();
11477 self
11478 }
11479
11480 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11482 self.0.options = v.into();
11483 self
11484 }
11485
11486 pub async fn send(self) -> Result<location::model::Location> {
11488 (*self.0.stub)
11489 .get_location(self.0.request, self.0.options)
11490 .await
11491 .map(gax::response::Response::into_body)
11492 }
11493
11494 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11496 self.0.request.name = v.into();
11497 self
11498 }
11499 }
11500
11501 #[doc(hidden)]
11502 impl gax::options::internal::RequestBuilder for GetLocation {
11503 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11504 &mut self.0.options
11505 }
11506 }
11507
11508 #[derive(Clone, Debug)]
11526 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
11527
11528 impl SetIamPolicy {
11529 pub(crate) fn new(
11530 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11531 ) -> Self {
11532 Self(RequestBuilder::new(stub))
11533 }
11534
11535 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
11537 self.0.request = v.into();
11538 self
11539 }
11540
11541 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11543 self.0.options = v.into();
11544 self
11545 }
11546
11547 pub async fn send(self) -> Result<iam_v1::model::Policy> {
11549 (*self.0.stub)
11550 .set_iam_policy(self.0.request, self.0.options)
11551 .await
11552 .map(gax::response::Response::into_body)
11553 }
11554
11555 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11559 self.0.request.resource = v.into();
11560 self
11561 }
11562
11563 pub fn set_policy<T>(mut self, v: T) -> Self
11567 where
11568 T: std::convert::Into<iam_v1::model::Policy>,
11569 {
11570 self.0.request.policy = std::option::Option::Some(v.into());
11571 self
11572 }
11573
11574 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
11578 where
11579 T: std::convert::Into<iam_v1::model::Policy>,
11580 {
11581 self.0.request.policy = v.map(|x| x.into());
11582 self
11583 }
11584
11585 pub fn set_update_mask<T>(mut self, v: T) -> Self
11587 where
11588 T: std::convert::Into<wkt::FieldMask>,
11589 {
11590 self.0.request.update_mask = std::option::Option::Some(v.into());
11591 self
11592 }
11593
11594 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11596 where
11597 T: std::convert::Into<wkt::FieldMask>,
11598 {
11599 self.0.request.update_mask = v.map(|x| x.into());
11600 self
11601 }
11602 }
11603
11604 #[doc(hidden)]
11605 impl gax::options::internal::RequestBuilder for SetIamPolicy {
11606 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11607 &mut self.0.options
11608 }
11609 }
11610
11611 #[derive(Clone, Debug)]
11629 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
11630
11631 impl GetIamPolicy {
11632 pub(crate) fn new(
11633 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11634 ) -> Self {
11635 Self(RequestBuilder::new(stub))
11636 }
11637
11638 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
11640 self.0.request = v.into();
11641 self
11642 }
11643
11644 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11646 self.0.options = v.into();
11647 self
11648 }
11649
11650 pub async fn send(self) -> Result<iam_v1::model::Policy> {
11652 (*self.0.stub)
11653 .get_iam_policy(self.0.request, self.0.options)
11654 .await
11655 .map(gax::response::Response::into_body)
11656 }
11657
11658 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11662 self.0.request.resource = v.into();
11663 self
11664 }
11665
11666 pub fn set_options<T>(mut self, v: T) -> Self
11668 where
11669 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
11670 {
11671 self.0.request.options = std::option::Option::Some(v.into());
11672 self
11673 }
11674
11675 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
11677 where
11678 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
11679 {
11680 self.0.request.options = v.map(|x| x.into());
11681 self
11682 }
11683 }
11684
11685 #[doc(hidden)]
11686 impl gax::options::internal::RequestBuilder for GetIamPolicy {
11687 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11688 &mut self.0.options
11689 }
11690 }
11691
11692 #[derive(Clone, Debug)]
11710 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
11711
11712 impl TestIamPermissions {
11713 pub(crate) fn new(
11714 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11715 ) -> Self {
11716 Self(RequestBuilder::new(stub))
11717 }
11718
11719 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
11721 mut self,
11722 v: V,
11723 ) -> Self {
11724 self.0.request = v.into();
11725 self
11726 }
11727
11728 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11730 self.0.options = v.into();
11731 self
11732 }
11733
11734 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
11736 (*self.0.stub)
11737 .test_iam_permissions(self.0.request, self.0.options)
11738 .await
11739 .map(gax::response::Response::into_body)
11740 }
11741
11742 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11746 self.0.request.resource = v.into();
11747 self
11748 }
11749
11750 pub fn set_permissions<T, V>(mut self, v: T) -> Self
11754 where
11755 T: std::iter::IntoIterator<Item = V>,
11756 V: std::convert::Into<std::string::String>,
11757 {
11758 use std::iter::Iterator;
11759 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
11760 self
11761 }
11762 }
11763
11764 #[doc(hidden)]
11765 impl gax::options::internal::RequestBuilder for TestIamPermissions {
11766 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11767 &mut self.0.options
11768 }
11769 }
11770
11771 #[derive(Clone, Debug)]
11793 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
11794
11795 impl ListOperations {
11796 pub(crate) fn new(
11797 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11798 ) -> Self {
11799 Self(RequestBuilder::new(stub))
11800 }
11801
11802 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
11804 mut self,
11805 v: V,
11806 ) -> Self {
11807 self.0.request = v.into();
11808 self
11809 }
11810
11811 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11813 self.0.options = v.into();
11814 self
11815 }
11816
11817 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
11819 (*self.0.stub)
11820 .list_operations(self.0.request, self.0.options)
11821 .await
11822 .map(gax::response::Response::into_body)
11823 }
11824
11825 pub fn by_page(
11827 self,
11828 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
11829 {
11830 use std::clone::Clone;
11831 let token = self.0.request.page_token.clone();
11832 let execute = move |token: String| {
11833 let mut builder = self.clone();
11834 builder.0.request = builder.0.request.set_page_token(token);
11835 builder.send()
11836 };
11837 gax::paginator::internal::new_paginator(token, execute)
11838 }
11839
11840 pub fn by_item(
11842 self,
11843 ) -> impl gax::paginator::ItemPaginator<
11844 longrunning::model::ListOperationsResponse,
11845 gax::error::Error,
11846 > {
11847 use gax::paginator::Paginator;
11848 self.by_page().items()
11849 }
11850
11851 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11853 self.0.request.name = v.into();
11854 self
11855 }
11856
11857 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11859 self.0.request.filter = v.into();
11860 self
11861 }
11862
11863 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11865 self.0.request.page_size = v.into();
11866 self
11867 }
11868
11869 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11871 self.0.request.page_token = v.into();
11872 self
11873 }
11874 }
11875
11876 #[doc(hidden)]
11877 impl gax::options::internal::RequestBuilder for ListOperations {
11878 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11879 &mut self.0.options
11880 }
11881 }
11882
11883 #[derive(Clone, Debug)]
11901 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
11902
11903 impl GetOperation {
11904 pub(crate) fn new(
11905 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11906 ) -> Self {
11907 Self(RequestBuilder::new(stub))
11908 }
11909
11910 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
11912 mut self,
11913 v: V,
11914 ) -> Self {
11915 self.0.request = v.into();
11916 self
11917 }
11918
11919 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11921 self.0.options = v.into();
11922 self
11923 }
11924
11925 pub async fn send(self) -> Result<longrunning::model::Operation> {
11927 (*self.0.stub)
11928 .get_operation(self.0.request, self.0.options)
11929 .await
11930 .map(gax::response::Response::into_body)
11931 }
11932
11933 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11935 self.0.request.name = v.into();
11936 self
11937 }
11938 }
11939
11940 #[doc(hidden)]
11941 impl gax::options::internal::RequestBuilder for GetOperation {
11942 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11943 &mut self.0.options
11944 }
11945 }
11946
11947 #[derive(Clone, Debug)]
11965 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
11966
11967 impl DeleteOperation {
11968 pub(crate) fn new(
11969 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
11970 ) -> Self {
11971 Self(RequestBuilder::new(stub))
11972 }
11973
11974 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
11976 mut self,
11977 v: V,
11978 ) -> Self {
11979 self.0.request = v.into();
11980 self
11981 }
11982
11983 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11985 self.0.options = v.into();
11986 self
11987 }
11988
11989 pub async fn send(self) -> Result<()> {
11991 (*self.0.stub)
11992 .delete_operation(self.0.request, self.0.options)
11993 .await
11994 .map(gax::response::Response::into_body)
11995 }
11996
11997 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11999 self.0.request.name = v.into();
12000 self
12001 }
12002 }
12003
12004 #[doc(hidden)]
12005 impl gax::options::internal::RequestBuilder for DeleteOperation {
12006 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12007 &mut self.0.options
12008 }
12009 }
12010
12011 #[derive(Clone, Debug)]
12029 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
12030
12031 impl CancelOperation {
12032 pub(crate) fn new(
12033 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
12034 ) -> Self {
12035 Self(RequestBuilder::new(stub))
12036 }
12037
12038 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
12040 mut self,
12041 v: V,
12042 ) -> Self {
12043 self.0.request = v.into();
12044 self
12045 }
12046
12047 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12049 self.0.options = v.into();
12050 self
12051 }
12052
12053 pub async fn send(self) -> Result<()> {
12055 (*self.0.stub)
12056 .cancel_operation(self.0.request, self.0.options)
12057 .await
12058 .map(gax::response::Response::into_body)
12059 }
12060
12061 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12063 self.0.request.name = v.into();
12064 self
12065 }
12066 }
12067
12068 #[doc(hidden)]
12069 impl gax::options::internal::RequestBuilder for CancelOperation {
12070 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12071 &mut self.0.options
12072 }
12073 }
12074}
12075
12076pub mod dataplex_service {
12077 use crate::Result;
12078
12079 pub type ClientBuilder =
12093 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12094
12095 pub(crate) mod client {
12096 use super::super::super::client::DataplexService;
12097 pub struct Factory;
12098 impl gax::client_builder::internal::ClientFactory for Factory {
12099 type Client = DataplexService;
12100 type Credentials = gaxi::options::Credentials;
12101 async fn build(
12102 self,
12103 config: gaxi::options::ClientConfig,
12104 ) -> gax::client_builder::Result<Self::Client> {
12105 Self::Client::new(config).await
12106 }
12107 }
12108 }
12109
12110 #[derive(Clone, Debug)]
12112 pub(crate) struct RequestBuilder<R: std::default::Default> {
12113 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
12114 request: R,
12115 options: gax::options::RequestOptions,
12116 }
12117
12118 impl<R> RequestBuilder<R>
12119 where
12120 R: std::default::Default,
12121 {
12122 pub(crate) fn new(
12123 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
12124 ) -> Self {
12125 Self {
12126 stub,
12127 request: R::default(),
12128 options: gax::options::RequestOptions::default(),
12129 }
12130 }
12131 }
12132
12133 #[derive(Clone, Debug)]
12152 pub struct CreateLake(RequestBuilder<crate::model::CreateLakeRequest>);
12153
12154 impl CreateLake {
12155 pub(crate) fn new(
12156 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
12157 ) -> Self {
12158 Self(RequestBuilder::new(stub))
12159 }
12160
12161 pub fn with_request<V: Into<crate::model::CreateLakeRequest>>(mut self, v: V) -> Self {
12163 self.0.request = v.into();
12164 self
12165 }
12166
12167 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12169 self.0.options = v.into();
12170 self
12171 }
12172
12173 pub async fn send(self) -> Result<longrunning::model::Operation> {
12180 (*self.0.stub)
12181 .create_lake(self.0.request, self.0.options)
12182 .await
12183 .map(gax::response::Response::into_body)
12184 }
12185
12186 pub fn poller(
12188 self,
12189 ) -> impl lro::Poller<crate::model::Lake, crate::model::OperationMetadata> {
12190 type Operation =
12191 lro::internal::Operation<crate::model::Lake, crate::model::OperationMetadata>;
12192 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12193 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12194
12195 let stub = self.0.stub.clone();
12196 let mut options = self.0.options.clone();
12197 options.set_retry_policy(gax::retry_policy::NeverRetry);
12198 let query = move |name| {
12199 let stub = stub.clone();
12200 let options = options.clone();
12201 async {
12202 let op = GetOperation::new(stub)
12203 .set_name(name)
12204 .with_options(options)
12205 .send()
12206 .await?;
12207 Ok(Operation::new(op))
12208 }
12209 };
12210
12211 let start = move || async {
12212 let op = self.send().await?;
12213 Ok(Operation::new(op))
12214 };
12215
12216 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
12217 }
12218
12219 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12223 self.0.request.parent = v.into();
12224 self
12225 }
12226
12227 pub fn set_lake_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12231 self.0.request.lake_id = v.into();
12232 self
12233 }
12234
12235 pub fn set_lake<T>(mut self, v: T) -> Self
12239 where
12240 T: std::convert::Into<crate::model::Lake>,
12241 {
12242 self.0.request.lake = std::option::Option::Some(v.into());
12243 self
12244 }
12245
12246 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
12250 where
12251 T: std::convert::Into<crate::model::Lake>,
12252 {
12253 self.0.request.lake = v.map(|x| x.into());
12254 self
12255 }
12256
12257 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12259 self.0.request.validate_only = v.into();
12260 self
12261 }
12262 }
12263
12264 #[doc(hidden)]
12265 impl gax::options::internal::RequestBuilder for CreateLake {
12266 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12267 &mut self.0.options
12268 }
12269 }
12270
12271 #[derive(Clone, Debug)]
12290 pub struct UpdateLake(RequestBuilder<crate::model::UpdateLakeRequest>);
12291
12292 impl UpdateLake {
12293 pub(crate) fn new(
12294 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
12295 ) -> Self {
12296 Self(RequestBuilder::new(stub))
12297 }
12298
12299 pub fn with_request<V: Into<crate::model::UpdateLakeRequest>>(mut self, v: V) -> Self {
12301 self.0.request = v.into();
12302 self
12303 }
12304
12305 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12307 self.0.options = v.into();
12308 self
12309 }
12310
12311 pub async fn send(self) -> Result<longrunning::model::Operation> {
12318 (*self.0.stub)
12319 .update_lake(self.0.request, self.0.options)
12320 .await
12321 .map(gax::response::Response::into_body)
12322 }
12323
12324 pub fn poller(
12326 self,
12327 ) -> impl lro::Poller<crate::model::Lake, crate::model::OperationMetadata> {
12328 type Operation =
12329 lro::internal::Operation<crate::model::Lake, crate::model::OperationMetadata>;
12330 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12331 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12332
12333 let stub = self.0.stub.clone();
12334 let mut options = self.0.options.clone();
12335 options.set_retry_policy(gax::retry_policy::NeverRetry);
12336 let query = move |name| {
12337 let stub = stub.clone();
12338 let options = options.clone();
12339 async {
12340 let op = GetOperation::new(stub)
12341 .set_name(name)
12342 .with_options(options)
12343 .send()
12344 .await?;
12345 Ok(Operation::new(op))
12346 }
12347 };
12348
12349 let start = move || async {
12350 let op = self.send().await?;
12351 Ok(Operation::new(op))
12352 };
12353
12354 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
12355 }
12356
12357 pub fn set_update_mask<T>(mut self, v: T) -> Self
12361 where
12362 T: std::convert::Into<wkt::FieldMask>,
12363 {
12364 self.0.request.update_mask = std::option::Option::Some(v.into());
12365 self
12366 }
12367
12368 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12372 where
12373 T: std::convert::Into<wkt::FieldMask>,
12374 {
12375 self.0.request.update_mask = v.map(|x| x.into());
12376 self
12377 }
12378
12379 pub fn set_lake<T>(mut self, v: T) -> Self
12383 where
12384 T: std::convert::Into<crate::model::Lake>,
12385 {
12386 self.0.request.lake = std::option::Option::Some(v.into());
12387 self
12388 }
12389
12390 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
12394 where
12395 T: std::convert::Into<crate::model::Lake>,
12396 {
12397 self.0.request.lake = v.map(|x| x.into());
12398 self
12399 }
12400
12401 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12403 self.0.request.validate_only = v.into();
12404 self
12405 }
12406 }
12407
12408 #[doc(hidden)]
12409 impl gax::options::internal::RequestBuilder for UpdateLake {
12410 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12411 &mut self.0.options
12412 }
12413 }
12414
12415 #[derive(Clone, Debug)]
12434 pub struct DeleteLake(RequestBuilder<crate::model::DeleteLakeRequest>);
12435
12436 impl DeleteLake {
12437 pub(crate) fn new(
12438 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
12439 ) -> Self {
12440 Self(RequestBuilder::new(stub))
12441 }
12442
12443 pub fn with_request<V: Into<crate::model::DeleteLakeRequest>>(mut self, v: V) -> Self {
12445 self.0.request = v.into();
12446 self
12447 }
12448
12449 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12451 self.0.options = v.into();
12452 self
12453 }
12454
12455 pub async fn send(self) -> Result<longrunning::model::Operation> {
12462 (*self.0.stub)
12463 .delete_lake(self.0.request, self.0.options)
12464 .await
12465 .map(gax::response::Response::into_body)
12466 }
12467
12468 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
12470 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
12471 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12472 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12473
12474 let stub = self.0.stub.clone();
12475 let mut options = self.0.options.clone();
12476 options.set_retry_policy(gax::retry_policy::NeverRetry);
12477 let query = move |name| {
12478 let stub = stub.clone();
12479 let options = options.clone();
12480 async {
12481 let op = GetOperation::new(stub)
12482 .set_name(name)
12483 .with_options(options)
12484 .send()
12485 .await?;
12486 Ok(Operation::new(op))
12487 }
12488 };
12489
12490 let start = move || async {
12491 let op = self.send().await?;
12492 Ok(Operation::new(op))
12493 };
12494
12495 lro::internal::new_unit_response_poller(
12496 polling_error_policy,
12497 polling_backoff_policy,
12498 start,
12499 query,
12500 )
12501 }
12502
12503 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12507 self.0.request.name = v.into();
12508 self
12509 }
12510 }
12511
12512 #[doc(hidden)]
12513 impl gax::options::internal::RequestBuilder for DeleteLake {
12514 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12515 &mut self.0.options
12516 }
12517 }
12518
12519 #[derive(Clone, Debug)]
12541 pub struct ListLakes(RequestBuilder<crate::model::ListLakesRequest>);
12542
12543 impl ListLakes {
12544 pub(crate) fn new(
12545 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
12546 ) -> Self {
12547 Self(RequestBuilder::new(stub))
12548 }
12549
12550 pub fn with_request<V: Into<crate::model::ListLakesRequest>>(mut self, v: V) -> Self {
12552 self.0.request = v.into();
12553 self
12554 }
12555
12556 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12558 self.0.options = v.into();
12559 self
12560 }
12561
12562 pub async fn send(self) -> Result<crate::model::ListLakesResponse> {
12564 (*self.0.stub)
12565 .list_lakes(self.0.request, self.0.options)
12566 .await
12567 .map(gax::response::Response::into_body)
12568 }
12569
12570 pub fn by_page(
12572 self,
12573 ) -> impl gax::paginator::Paginator<crate::model::ListLakesResponse, gax::error::Error>
12574 {
12575 use std::clone::Clone;
12576 let token = self.0.request.page_token.clone();
12577 let execute = move |token: String| {
12578 let mut builder = self.clone();
12579 builder.0.request = builder.0.request.set_page_token(token);
12580 builder.send()
12581 };
12582 gax::paginator::internal::new_paginator(token, execute)
12583 }
12584
12585 pub fn by_item(
12587 self,
12588 ) -> impl gax::paginator::ItemPaginator<crate::model::ListLakesResponse, gax::error::Error>
12589 {
12590 use gax::paginator::Paginator;
12591 self.by_page().items()
12592 }
12593
12594 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12598 self.0.request.parent = v.into();
12599 self
12600 }
12601
12602 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12604 self.0.request.page_size = v.into();
12605 self
12606 }
12607
12608 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12610 self.0.request.page_token = v.into();
12611 self
12612 }
12613
12614 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12616 self.0.request.filter = v.into();
12617 self
12618 }
12619
12620 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
12622 self.0.request.order_by = v.into();
12623 self
12624 }
12625 }
12626
12627 #[doc(hidden)]
12628 impl gax::options::internal::RequestBuilder for ListLakes {
12629 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12630 &mut self.0.options
12631 }
12632 }
12633
12634 #[derive(Clone, Debug)]
12652 pub struct GetLake(RequestBuilder<crate::model::GetLakeRequest>);
12653
12654 impl GetLake {
12655 pub(crate) fn new(
12656 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
12657 ) -> Self {
12658 Self(RequestBuilder::new(stub))
12659 }
12660
12661 pub fn with_request<V: Into<crate::model::GetLakeRequest>>(mut self, v: V) -> Self {
12663 self.0.request = v.into();
12664 self
12665 }
12666
12667 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12669 self.0.options = v.into();
12670 self
12671 }
12672
12673 pub async fn send(self) -> Result<crate::model::Lake> {
12675 (*self.0.stub)
12676 .get_lake(self.0.request, self.0.options)
12677 .await
12678 .map(gax::response::Response::into_body)
12679 }
12680
12681 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12685 self.0.request.name = v.into();
12686 self
12687 }
12688 }
12689
12690 #[doc(hidden)]
12691 impl gax::options::internal::RequestBuilder for GetLake {
12692 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12693 &mut self.0.options
12694 }
12695 }
12696
12697 #[derive(Clone, Debug)]
12719 pub struct ListLakeActions(RequestBuilder<crate::model::ListLakeActionsRequest>);
12720
12721 impl ListLakeActions {
12722 pub(crate) fn new(
12723 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
12724 ) -> Self {
12725 Self(RequestBuilder::new(stub))
12726 }
12727
12728 pub fn with_request<V: Into<crate::model::ListLakeActionsRequest>>(mut self, v: V) -> Self {
12730 self.0.request = v.into();
12731 self
12732 }
12733
12734 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12736 self.0.options = v.into();
12737 self
12738 }
12739
12740 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
12742 (*self.0.stub)
12743 .list_lake_actions(self.0.request, self.0.options)
12744 .await
12745 .map(gax::response::Response::into_body)
12746 }
12747
12748 pub fn by_page(
12750 self,
12751 ) -> impl gax::paginator::Paginator<crate::model::ListActionsResponse, gax::error::Error>
12752 {
12753 use std::clone::Clone;
12754 let token = self.0.request.page_token.clone();
12755 let execute = move |token: String| {
12756 let mut builder = self.clone();
12757 builder.0.request = builder.0.request.set_page_token(token);
12758 builder.send()
12759 };
12760 gax::paginator::internal::new_paginator(token, execute)
12761 }
12762
12763 pub fn by_item(
12765 self,
12766 ) -> impl gax::paginator::ItemPaginator<crate::model::ListActionsResponse, gax::error::Error>
12767 {
12768 use gax::paginator::Paginator;
12769 self.by_page().items()
12770 }
12771
12772 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12776 self.0.request.parent = v.into();
12777 self
12778 }
12779
12780 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12782 self.0.request.page_size = v.into();
12783 self
12784 }
12785
12786 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12788 self.0.request.page_token = v.into();
12789 self
12790 }
12791 }
12792
12793 #[doc(hidden)]
12794 impl gax::options::internal::RequestBuilder for ListLakeActions {
12795 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12796 &mut self.0.options
12797 }
12798 }
12799
12800 #[derive(Clone, Debug)]
12819 pub struct CreateZone(RequestBuilder<crate::model::CreateZoneRequest>);
12820
12821 impl CreateZone {
12822 pub(crate) fn new(
12823 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
12824 ) -> Self {
12825 Self(RequestBuilder::new(stub))
12826 }
12827
12828 pub fn with_request<V: Into<crate::model::CreateZoneRequest>>(mut self, v: V) -> Self {
12830 self.0.request = v.into();
12831 self
12832 }
12833
12834 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12836 self.0.options = v.into();
12837 self
12838 }
12839
12840 pub async fn send(self) -> Result<longrunning::model::Operation> {
12847 (*self.0.stub)
12848 .create_zone(self.0.request, self.0.options)
12849 .await
12850 .map(gax::response::Response::into_body)
12851 }
12852
12853 pub fn poller(
12855 self,
12856 ) -> impl lro::Poller<crate::model::Zone, crate::model::OperationMetadata> {
12857 type Operation =
12858 lro::internal::Operation<crate::model::Zone, crate::model::OperationMetadata>;
12859 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12860 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12861
12862 let stub = self.0.stub.clone();
12863 let mut options = self.0.options.clone();
12864 options.set_retry_policy(gax::retry_policy::NeverRetry);
12865 let query = move |name| {
12866 let stub = stub.clone();
12867 let options = options.clone();
12868 async {
12869 let op = GetOperation::new(stub)
12870 .set_name(name)
12871 .with_options(options)
12872 .send()
12873 .await?;
12874 Ok(Operation::new(op))
12875 }
12876 };
12877
12878 let start = move || async {
12879 let op = self.send().await?;
12880 Ok(Operation::new(op))
12881 };
12882
12883 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
12884 }
12885
12886 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12890 self.0.request.parent = v.into();
12891 self
12892 }
12893
12894 pub fn set_zone_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12898 self.0.request.zone_id = v.into();
12899 self
12900 }
12901
12902 pub fn set_zone<T>(mut self, v: T) -> Self
12906 where
12907 T: std::convert::Into<crate::model::Zone>,
12908 {
12909 self.0.request.zone = std::option::Option::Some(v.into());
12910 self
12911 }
12912
12913 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
12917 where
12918 T: std::convert::Into<crate::model::Zone>,
12919 {
12920 self.0.request.zone = v.map(|x| x.into());
12921 self
12922 }
12923
12924 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
12926 self.0.request.validate_only = v.into();
12927 self
12928 }
12929 }
12930
12931 #[doc(hidden)]
12932 impl gax::options::internal::RequestBuilder for CreateZone {
12933 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12934 &mut self.0.options
12935 }
12936 }
12937
12938 #[derive(Clone, Debug)]
12957 pub struct UpdateZone(RequestBuilder<crate::model::UpdateZoneRequest>);
12958
12959 impl UpdateZone {
12960 pub(crate) fn new(
12961 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
12962 ) -> Self {
12963 Self(RequestBuilder::new(stub))
12964 }
12965
12966 pub fn with_request<V: Into<crate::model::UpdateZoneRequest>>(mut self, v: V) -> Self {
12968 self.0.request = v.into();
12969 self
12970 }
12971
12972 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12974 self.0.options = v.into();
12975 self
12976 }
12977
12978 pub async fn send(self) -> Result<longrunning::model::Operation> {
12985 (*self.0.stub)
12986 .update_zone(self.0.request, self.0.options)
12987 .await
12988 .map(gax::response::Response::into_body)
12989 }
12990
12991 pub fn poller(
12993 self,
12994 ) -> impl lro::Poller<crate::model::Zone, crate::model::OperationMetadata> {
12995 type Operation =
12996 lro::internal::Operation<crate::model::Zone, crate::model::OperationMetadata>;
12997 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12998 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12999
13000 let stub = self.0.stub.clone();
13001 let mut options = self.0.options.clone();
13002 options.set_retry_policy(gax::retry_policy::NeverRetry);
13003 let query = move |name| {
13004 let stub = stub.clone();
13005 let options = options.clone();
13006 async {
13007 let op = GetOperation::new(stub)
13008 .set_name(name)
13009 .with_options(options)
13010 .send()
13011 .await?;
13012 Ok(Operation::new(op))
13013 }
13014 };
13015
13016 let start = move || async {
13017 let op = self.send().await?;
13018 Ok(Operation::new(op))
13019 };
13020
13021 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
13022 }
13023
13024 pub fn set_update_mask<T>(mut self, v: T) -> Self
13028 where
13029 T: std::convert::Into<wkt::FieldMask>,
13030 {
13031 self.0.request.update_mask = std::option::Option::Some(v.into());
13032 self
13033 }
13034
13035 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13039 where
13040 T: std::convert::Into<wkt::FieldMask>,
13041 {
13042 self.0.request.update_mask = v.map(|x| x.into());
13043 self
13044 }
13045
13046 pub fn set_zone<T>(mut self, v: T) -> Self
13050 where
13051 T: std::convert::Into<crate::model::Zone>,
13052 {
13053 self.0.request.zone = std::option::Option::Some(v.into());
13054 self
13055 }
13056
13057 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
13061 where
13062 T: std::convert::Into<crate::model::Zone>,
13063 {
13064 self.0.request.zone = v.map(|x| x.into());
13065 self
13066 }
13067
13068 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13070 self.0.request.validate_only = v.into();
13071 self
13072 }
13073 }
13074
13075 #[doc(hidden)]
13076 impl gax::options::internal::RequestBuilder for UpdateZone {
13077 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13078 &mut self.0.options
13079 }
13080 }
13081
13082 #[derive(Clone, Debug)]
13101 pub struct DeleteZone(RequestBuilder<crate::model::DeleteZoneRequest>);
13102
13103 impl DeleteZone {
13104 pub(crate) fn new(
13105 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
13106 ) -> Self {
13107 Self(RequestBuilder::new(stub))
13108 }
13109
13110 pub fn with_request<V: Into<crate::model::DeleteZoneRequest>>(mut self, v: V) -> Self {
13112 self.0.request = v.into();
13113 self
13114 }
13115
13116 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13118 self.0.options = v.into();
13119 self
13120 }
13121
13122 pub async fn send(self) -> Result<longrunning::model::Operation> {
13129 (*self.0.stub)
13130 .delete_zone(self.0.request, self.0.options)
13131 .await
13132 .map(gax::response::Response::into_body)
13133 }
13134
13135 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
13137 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
13138 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13139 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13140
13141 let stub = self.0.stub.clone();
13142 let mut options = self.0.options.clone();
13143 options.set_retry_policy(gax::retry_policy::NeverRetry);
13144 let query = move |name| {
13145 let stub = stub.clone();
13146 let options = options.clone();
13147 async {
13148 let op = GetOperation::new(stub)
13149 .set_name(name)
13150 .with_options(options)
13151 .send()
13152 .await?;
13153 Ok(Operation::new(op))
13154 }
13155 };
13156
13157 let start = move || async {
13158 let op = self.send().await?;
13159 Ok(Operation::new(op))
13160 };
13161
13162 lro::internal::new_unit_response_poller(
13163 polling_error_policy,
13164 polling_backoff_policy,
13165 start,
13166 query,
13167 )
13168 }
13169
13170 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13174 self.0.request.name = v.into();
13175 self
13176 }
13177 }
13178
13179 #[doc(hidden)]
13180 impl gax::options::internal::RequestBuilder for DeleteZone {
13181 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13182 &mut self.0.options
13183 }
13184 }
13185
13186 #[derive(Clone, Debug)]
13208 pub struct ListZones(RequestBuilder<crate::model::ListZonesRequest>);
13209
13210 impl ListZones {
13211 pub(crate) fn new(
13212 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
13213 ) -> Self {
13214 Self(RequestBuilder::new(stub))
13215 }
13216
13217 pub fn with_request<V: Into<crate::model::ListZonesRequest>>(mut self, v: V) -> Self {
13219 self.0.request = v.into();
13220 self
13221 }
13222
13223 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13225 self.0.options = v.into();
13226 self
13227 }
13228
13229 pub async fn send(self) -> Result<crate::model::ListZonesResponse> {
13231 (*self.0.stub)
13232 .list_zones(self.0.request, self.0.options)
13233 .await
13234 .map(gax::response::Response::into_body)
13235 }
13236
13237 pub fn by_page(
13239 self,
13240 ) -> impl gax::paginator::Paginator<crate::model::ListZonesResponse, gax::error::Error>
13241 {
13242 use std::clone::Clone;
13243 let token = self.0.request.page_token.clone();
13244 let execute = move |token: String| {
13245 let mut builder = self.clone();
13246 builder.0.request = builder.0.request.set_page_token(token);
13247 builder.send()
13248 };
13249 gax::paginator::internal::new_paginator(token, execute)
13250 }
13251
13252 pub fn by_item(
13254 self,
13255 ) -> impl gax::paginator::ItemPaginator<crate::model::ListZonesResponse, gax::error::Error>
13256 {
13257 use gax::paginator::Paginator;
13258 self.by_page().items()
13259 }
13260
13261 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13265 self.0.request.parent = v.into();
13266 self
13267 }
13268
13269 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13271 self.0.request.page_size = v.into();
13272 self
13273 }
13274
13275 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13277 self.0.request.page_token = v.into();
13278 self
13279 }
13280
13281 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13283 self.0.request.filter = v.into();
13284 self
13285 }
13286
13287 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
13289 self.0.request.order_by = v.into();
13290 self
13291 }
13292 }
13293
13294 #[doc(hidden)]
13295 impl gax::options::internal::RequestBuilder for ListZones {
13296 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13297 &mut self.0.options
13298 }
13299 }
13300
13301 #[derive(Clone, Debug)]
13319 pub struct GetZone(RequestBuilder<crate::model::GetZoneRequest>);
13320
13321 impl GetZone {
13322 pub(crate) fn new(
13323 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
13324 ) -> Self {
13325 Self(RequestBuilder::new(stub))
13326 }
13327
13328 pub fn with_request<V: Into<crate::model::GetZoneRequest>>(mut self, v: V) -> Self {
13330 self.0.request = v.into();
13331 self
13332 }
13333
13334 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13336 self.0.options = v.into();
13337 self
13338 }
13339
13340 pub async fn send(self) -> Result<crate::model::Zone> {
13342 (*self.0.stub)
13343 .get_zone(self.0.request, self.0.options)
13344 .await
13345 .map(gax::response::Response::into_body)
13346 }
13347
13348 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13352 self.0.request.name = v.into();
13353 self
13354 }
13355 }
13356
13357 #[doc(hidden)]
13358 impl gax::options::internal::RequestBuilder for GetZone {
13359 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13360 &mut self.0.options
13361 }
13362 }
13363
13364 #[derive(Clone, Debug)]
13386 pub struct ListZoneActions(RequestBuilder<crate::model::ListZoneActionsRequest>);
13387
13388 impl ListZoneActions {
13389 pub(crate) fn new(
13390 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
13391 ) -> Self {
13392 Self(RequestBuilder::new(stub))
13393 }
13394
13395 pub fn with_request<V: Into<crate::model::ListZoneActionsRequest>>(mut self, v: V) -> Self {
13397 self.0.request = v.into();
13398 self
13399 }
13400
13401 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13403 self.0.options = v.into();
13404 self
13405 }
13406
13407 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
13409 (*self.0.stub)
13410 .list_zone_actions(self.0.request, self.0.options)
13411 .await
13412 .map(gax::response::Response::into_body)
13413 }
13414
13415 pub fn by_page(
13417 self,
13418 ) -> impl gax::paginator::Paginator<crate::model::ListActionsResponse, gax::error::Error>
13419 {
13420 use std::clone::Clone;
13421 let token = self.0.request.page_token.clone();
13422 let execute = move |token: String| {
13423 let mut builder = self.clone();
13424 builder.0.request = builder.0.request.set_page_token(token);
13425 builder.send()
13426 };
13427 gax::paginator::internal::new_paginator(token, execute)
13428 }
13429
13430 pub fn by_item(
13432 self,
13433 ) -> impl gax::paginator::ItemPaginator<crate::model::ListActionsResponse, gax::error::Error>
13434 {
13435 use gax::paginator::Paginator;
13436 self.by_page().items()
13437 }
13438
13439 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13443 self.0.request.parent = v.into();
13444 self
13445 }
13446
13447 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13449 self.0.request.page_size = v.into();
13450 self
13451 }
13452
13453 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13455 self.0.request.page_token = v.into();
13456 self
13457 }
13458 }
13459
13460 #[doc(hidden)]
13461 impl gax::options::internal::RequestBuilder for ListZoneActions {
13462 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13463 &mut self.0.options
13464 }
13465 }
13466
13467 #[derive(Clone, Debug)]
13486 pub struct CreateAsset(RequestBuilder<crate::model::CreateAssetRequest>);
13487
13488 impl CreateAsset {
13489 pub(crate) fn new(
13490 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
13491 ) -> Self {
13492 Self(RequestBuilder::new(stub))
13493 }
13494
13495 pub fn with_request<V: Into<crate::model::CreateAssetRequest>>(mut self, v: V) -> Self {
13497 self.0.request = v.into();
13498 self
13499 }
13500
13501 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13503 self.0.options = v.into();
13504 self
13505 }
13506
13507 pub async fn send(self) -> Result<longrunning::model::Operation> {
13514 (*self.0.stub)
13515 .create_asset(self.0.request, self.0.options)
13516 .await
13517 .map(gax::response::Response::into_body)
13518 }
13519
13520 pub fn poller(
13522 self,
13523 ) -> impl lro::Poller<crate::model::Asset, crate::model::OperationMetadata> {
13524 type Operation =
13525 lro::internal::Operation<crate::model::Asset, crate::model::OperationMetadata>;
13526 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13527 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13528
13529 let stub = self.0.stub.clone();
13530 let mut options = self.0.options.clone();
13531 options.set_retry_policy(gax::retry_policy::NeverRetry);
13532 let query = move |name| {
13533 let stub = stub.clone();
13534 let options = options.clone();
13535 async {
13536 let op = GetOperation::new(stub)
13537 .set_name(name)
13538 .with_options(options)
13539 .send()
13540 .await?;
13541 Ok(Operation::new(op))
13542 }
13543 };
13544
13545 let start = move || async {
13546 let op = self.send().await?;
13547 Ok(Operation::new(op))
13548 };
13549
13550 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
13551 }
13552
13553 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13557 self.0.request.parent = v.into();
13558 self
13559 }
13560
13561 pub fn set_asset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
13565 self.0.request.asset_id = v.into();
13566 self
13567 }
13568
13569 pub fn set_asset<T>(mut self, v: T) -> Self
13573 where
13574 T: std::convert::Into<crate::model::Asset>,
13575 {
13576 self.0.request.asset = std::option::Option::Some(v.into());
13577 self
13578 }
13579
13580 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
13584 where
13585 T: std::convert::Into<crate::model::Asset>,
13586 {
13587 self.0.request.asset = v.map(|x| x.into());
13588 self
13589 }
13590
13591 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13593 self.0.request.validate_only = v.into();
13594 self
13595 }
13596 }
13597
13598 #[doc(hidden)]
13599 impl gax::options::internal::RequestBuilder for CreateAsset {
13600 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13601 &mut self.0.options
13602 }
13603 }
13604
13605 #[derive(Clone, Debug)]
13624 pub struct UpdateAsset(RequestBuilder<crate::model::UpdateAssetRequest>);
13625
13626 impl UpdateAsset {
13627 pub(crate) fn new(
13628 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
13629 ) -> Self {
13630 Self(RequestBuilder::new(stub))
13631 }
13632
13633 pub fn with_request<V: Into<crate::model::UpdateAssetRequest>>(mut self, v: V) -> Self {
13635 self.0.request = v.into();
13636 self
13637 }
13638
13639 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13641 self.0.options = v.into();
13642 self
13643 }
13644
13645 pub async fn send(self) -> Result<longrunning::model::Operation> {
13652 (*self.0.stub)
13653 .update_asset(self.0.request, self.0.options)
13654 .await
13655 .map(gax::response::Response::into_body)
13656 }
13657
13658 pub fn poller(
13660 self,
13661 ) -> impl lro::Poller<crate::model::Asset, crate::model::OperationMetadata> {
13662 type Operation =
13663 lro::internal::Operation<crate::model::Asset, crate::model::OperationMetadata>;
13664 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13665 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13666
13667 let stub = self.0.stub.clone();
13668 let mut options = self.0.options.clone();
13669 options.set_retry_policy(gax::retry_policy::NeverRetry);
13670 let query = move |name| {
13671 let stub = stub.clone();
13672 let options = options.clone();
13673 async {
13674 let op = GetOperation::new(stub)
13675 .set_name(name)
13676 .with_options(options)
13677 .send()
13678 .await?;
13679 Ok(Operation::new(op))
13680 }
13681 };
13682
13683 let start = move || async {
13684 let op = self.send().await?;
13685 Ok(Operation::new(op))
13686 };
13687
13688 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
13689 }
13690
13691 pub fn set_update_mask<T>(mut self, v: T) -> Self
13695 where
13696 T: std::convert::Into<wkt::FieldMask>,
13697 {
13698 self.0.request.update_mask = std::option::Option::Some(v.into());
13699 self
13700 }
13701
13702 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13706 where
13707 T: std::convert::Into<wkt::FieldMask>,
13708 {
13709 self.0.request.update_mask = v.map(|x| x.into());
13710 self
13711 }
13712
13713 pub fn set_asset<T>(mut self, v: T) -> Self
13717 where
13718 T: std::convert::Into<crate::model::Asset>,
13719 {
13720 self.0.request.asset = std::option::Option::Some(v.into());
13721 self
13722 }
13723
13724 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
13728 where
13729 T: std::convert::Into<crate::model::Asset>,
13730 {
13731 self.0.request.asset = v.map(|x| x.into());
13732 self
13733 }
13734
13735 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13737 self.0.request.validate_only = v.into();
13738 self
13739 }
13740 }
13741
13742 #[doc(hidden)]
13743 impl gax::options::internal::RequestBuilder for UpdateAsset {
13744 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13745 &mut self.0.options
13746 }
13747 }
13748
13749 #[derive(Clone, Debug)]
13768 pub struct DeleteAsset(RequestBuilder<crate::model::DeleteAssetRequest>);
13769
13770 impl DeleteAsset {
13771 pub(crate) fn new(
13772 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
13773 ) -> Self {
13774 Self(RequestBuilder::new(stub))
13775 }
13776
13777 pub fn with_request<V: Into<crate::model::DeleteAssetRequest>>(mut self, v: V) -> Self {
13779 self.0.request = v.into();
13780 self
13781 }
13782
13783 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13785 self.0.options = v.into();
13786 self
13787 }
13788
13789 pub async fn send(self) -> Result<longrunning::model::Operation> {
13796 (*self.0.stub)
13797 .delete_asset(self.0.request, self.0.options)
13798 .await
13799 .map(gax::response::Response::into_body)
13800 }
13801
13802 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
13804 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
13805 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
13806 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
13807
13808 let stub = self.0.stub.clone();
13809 let mut options = self.0.options.clone();
13810 options.set_retry_policy(gax::retry_policy::NeverRetry);
13811 let query = move |name| {
13812 let stub = stub.clone();
13813 let options = options.clone();
13814 async {
13815 let op = GetOperation::new(stub)
13816 .set_name(name)
13817 .with_options(options)
13818 .send()
13819 .await?;
13820 Ok(Operation::new(op))
13821 }
13822 };
13823
13824 let start = move || async {
13825 let op = self.send().await?;
13826 Ok(Operation::new(op))
13827 };
13828
13829 lro::internal::new_unit_response_poller(
13830 polling_error_policy,
13831 polling_backoff_policy,
13832 start,
13833 query,
13834 )
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
13846 #[doc(hidden)]
13847 impl gax::options::internal::RequestBuilder for DeleteAsset {
13848 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13849 &mut self.0.options
13850 }
13851 }
13852
13853 #[derive(Clone, Debug)]
13875 pub struct ListAssets(RequestBuilder<crate::model::ListAssetsRequest>);
13876
13877 impl ListAssets {
13878 pub(crate) fn new(
13879 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
13880 ) -> Self {
13881 Self(RequestBuilder::new(stub))
13882 }
13883
13884 pub fn with_request<V: Into<crate::model::ListAssetsRequest>>(mut self, v: V) -> Self {
13886 self.0.request = v.into();
13887 self
13888 }
13889
13890 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13892 self.0.options = v.into();
13893 self
13894 }
13895
13896 pub async fn send(self) -> Result<crate::model::ListAssetsResponse> {
13898 (*self.0.stub)
13899 .list_assets(self.0.request, self.0.options)
13900 .await
13901 .map(gax::response::Response::into_body)
13902 }
13903
13904 pub fn by_page(
13906 self,
13907 ) -> impl gax::paginator::Paginator<crate::model::ListAssetsResponse, gax::error::Error>
13908 {
13909 use std::clone::Clone;
13910 let token = self.0.request.page_token.clone();
13911 let execute = move |token: String| {
13912 let mut builder = self.clone();
13913 builder.0.request = builder.0.request.set_page_token(token);
13914 builder.send()
13915 };
13916 gax::paginator::internal::new_paginator(token, execute)
13917 }
13918
13919 pub fn by_item(
13921 self,
13922 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAssetsResponse, gax::error::Error>
13923 {
13924 use gax::paginator::Paginator;
13925 self.by_page().items()
13926 }
13927
13928 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13932 self.0.request.parent = v.into();
13933 self
13934 }
13935
13936 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13938 self.0.request.page_size = v.into();
13939 self
13940 }
13941
13942 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13944 self.0.request.page_token = v.into();
13945 self
13946 }
13947
13948 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13950 self.0.request.filter = v.into();
13951 self
13952 }
13953
13954 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
13956 self.0.request.order_by = v.into();
13957 self
13958 }
13959 }
13960
13961 #[doc(hidden)]
13962 impl gax::options::internal::RequestBuilder for ListAssets {
13963 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13964 &mut self.0.options
13965 }
13966 }
13967
13968 #[derive(Clone, Debug)]
13986 pub struct GetAsset(RequestBuilder<crate::model::GetAssetRequest>);
13987
13988 impl GetAsset {
13989 pub(crate) fn new(
13990 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
13991 ) -> Self {
13992 Self(RequestBuilder::new(stub))
13993 }
13994
13995 pub fn with_request<V: Into<crate::model::GetAssetRequest>>(mut self, v: V) -> Self {
13997 self.0.request = v.into();
13998 self
13999 }
14000
14001 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14003 self.0.options = v.into();
14004 self
14005 }
14006
14007 pub async fn send(self) -> Result<crate::model::Asset> {
14009 (*self.0.stub)
14010 .get_asset(self.0.request, self.0.options)
14011 .await
14012 .map(gax::response::Response::into_body)
14013 }
14014
14015 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14019 self.0.request.name = v.into();
14020 self
14021 }
14022 }
14023
14024 #[doc(hidden)]
14025 impl gax::options::internal::RequestBuilder for GetAsset {
14026 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14027 &mut self.0.options
14028 }
14029 }
14030
14031 #[derive(Clone, Debug)]
14053 pub struct ListAssetActions(RequestBuilder<crate::model::ListAssetActionsRequest>);
14054
14055 impl ListAssetActions {
14056 pub(crate) fn new(
14057 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14058 ) -> Self {
14059 Self(RequestBuilder::new(stub))
14060 }
14061
14062 pub fn with_request<V: Into<crate::model::ListAssetActionsRequest>>(
14064 mut self,
14065 v: V,
14066 ) -> Self {
14067 self.0.request = v.into();
14068 self
14069 }
14070
14071 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14073 self.0.options = v.into();
14074 self
14075 }
14076
14077 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
14079 (*self.0.stub)
14080 .list_asset_actions(self.0.request, self.0.options)
14081 .await
14082 .map(gax::response::Response::into_body)
14083 }
14084
14085 pub fn by_page(
14087 self,
14088 ) -> impl gax::paginator::Paginator<crate::model::ListActionsResponse, gax::error::Error>
14089 {
14090 use std::clone::Clone;
14091 let token = self.0.request.page_token.clone();
14092 let execute = move |token: String| {
14093 let mut builder = self.clone();
14094 builder.0.request = builder.0.request.set_page_token(token);
14095 builder.send()
14096 };
14097 gax::paginator::internal::new_paginator(token, execute)
14098 }
14099
14100 pub fn by_item(
14102 self,
14103 ) -> impl gax::paginator::ItemPaginator<crate::model::ListActionsResponse, gax::error::Error>
14104 {
14105 use gax::paginator::Paginator;
14106 self.by_page().items()
14107 }
14108
14109 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14113 self.0.request.parent = v.into();
14114 self
14115 }
14116
14117 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14119 self.0.request.page_size = v.into();
14120 self
14121 }
14122
14123 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14125 self.0.request.page_token = v.into();
14126 self
14127 }
14128 }
14129
14130 #[doc(hidden)]
14131 impl gax::options::internal::RequestBuilder for ListAssetActions {
14132 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14133 &mut self.0.options
14134 }
14135 }
14136
14137 #[derive(Clone, Debug)]
14156 pub struct CreateTask(RequestBuilder<crate::model::CreateTaskRequest>);
14157
14158 impl CreateTask {
14159 pub(crate) fn new(
14160 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14161 ) -> Self {
14162 Self(RequestBuilder::new(stub))
14163 }
14164
14165 pub fn with_request<V: Into<crate::model::CreateTaskRequest>>(mut self, v: V) -> Self {
14167 self.0.request = v.into();
14168 self
14169 }
14170
14171 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14173 self.0.options = v.into();
14174 self
14175 }
14176
14177 pub async fn send(self) -> Result<longrunning::model::Operation> {
14184 (*self.0.stub)
14185 .create_task(self.0.request, self.0.options)
14186 .await
14187 .map(gax::response::Response::into_body)
14188 }
14189
14190 pub fn poller(
14192 self,
14193 ) -> impl lro::Poller<crate::model::Task, crate::model::OperationMetadata> {
14194 type Operation =
14195 lro::internal::Operation<crate::model::Task, crate::model::OperationMetadata>;
14196 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14197 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14198
14199 let stub = self.0.stub.clone();
14200 let mut options = self.0.options.clone();
14201 options.set_retry_policy(gax::retry_policy::NeverRetry);
14202 let query = move |name| {
14203 let stub = stub.clone();
14204 let options = options.clone();
14205 async {
14206 let op = GetOperation::new(stub)
14207 .set_name(name)
14208 .with_options(options)
14209 .send()
14210 .await?;
14211 Ok(Operation::new(op))
14212 }
14213 };
14214
14215 let start = move || async {
14216 let op = self.send().await?;
14217 Ok(Operation::new(op))
14218 };
14219
14220 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
14221 }
14222
14223 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14227 self.0.request.parent = v.into();
14228 self
14229 }
14230
14231 pub fn set_task_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14235 self.0.request.task_id = v.into();
14236 self
14237 }
14238
14239 pub fn set_task<T>(mut self, v: T) -> Self
14243 where
14244 T: std::convert::Into<crate::model::Task>,
14245 {
14246 self.0.request.task = std::option::Option::Some(v.into());
14247 self
14248 }
14249
14250 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
14254 where
14255 T: std::convert::Into<crate::model::Task>,
14256 {
14257 self.0.request.task = v.map(|x| x.into());
14258 self
14259 }
14260
14261 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14263 self.0.request.validate_only = v.into();
14264 self
14265 }
14266 }
14267
14268 #[doc(hidden)]
14269 impl gax::options::internal::RequestBuilder for CreateTask {
14270 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14271 &mut self.0.options
14272 }
14273 }
14274
14275 #[derive(Clone, Debug)]
14294 pub struct UpdateTask(RequestBuilder<crate::model::UpdateTaskRequest>);
14295
14296 impl UpdateTask {
14297 pub(crate) fn new(
14298 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14299 ) -> Self {
14300 Self(RequestBuilder::new(stub))
14301 }
14302
14303 pub fn with_request<V: Into<crate::model::UpdateTaskRequest>>(mut self, v: V) -> Self {
14305 self.0.request = v.into();
14306 self
14307 }
14308
14309 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14311 self.0.options = v.into();
14312 self
14313 }
14314
14315 pub async fn send(self) -> Result<longrunning::model::Operation> {
14322 (*self.0.stub)
14323 .update_task(self.0.request, self.0.options)
14324 .await
14325 .map(gax::response::Response::into_body)
14326 }
14327
14328 pub fn poller(
14330 self,
14331 ) -> impl lro::Poller<crate::model::Task, crate::model::OperationMetadata> {
14332 type Operation =
14333 lro::internal::Operation<crate::model::Task, crate::model::OperationMetadata>;
14334 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14335 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14336
14337 let stub = self.0.stub.clone();
14338 let mut options = self.0.options.clone();
14339 options.set_retry_policy(gax::retry_policy::NeverRetry);
14340 let query = move |name| {
14341 let stub = stub.clone();
14342 let options = options.clone();
14343 async {
14344 let op = GetOperation::new(stub)
14345 .set_name(name)
14346 .with_options(options)
14347 .send()
14348 .await?;
14349 Ok(Operation::new(op))
14350 }
14351 };
14352
14353 let start = move || async {
14354 let op = self.send().await?;
14355 Ok(Operation::new(op))
14356 };
14357
14358 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
14359 }
14360
14361 pub fn set_update_mask<T>(mut self, v: T) -> Self
14365 where
14366 T: std::convert::Into<wkt::FieldMask>,
14367 {
14368 self.0.request.update_mask = std::option::Option::Some(v.into());
14369 self
14370 }
14371
14372 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14376 where
14377 T: std::convert::Into<wkt::FieldMask>,
14378 {
14379 self.0.request.update_mask = v.map(|x| x.into());
14380 self
14381 }
14382
14383 pub fn set_task<T>(mut self, v: T) -> Self
14387 where
14388 T: std::convert::Into<crate::model::Task>,
14389 {
14390 self.0.request.task = std::option::Option::Some(v.into());
14391 self
14392 }
14393
14394 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
14398 where
14399 T: std::convert::Into<crate::model::Task>,
14400 {
14401 self.0.request.task = v.map(|x| x.into());
14402 self
14403 }
14404
14405 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14407 self.0.request.validate_only = v.into();
14408 self
14409 }
14410 }
14411
14412 #[doc(hidden)]
14413 impl gax::options::internal::RequestBuilder for UpdateTask {
14414 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14415 &mut self.0.options
14416 }
14417 }
14418
14419 #[derive(Clone, Debug)]
14438 pub struct DeleteTask(RequestBuilder<crate::model::DeleteTaskRequest>);
14439
14440 impl DeleteTask {
14441 pub(crate) fn new(
14442 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14443 ) -> Self {
14444 Self(RequestBuilder::new(stub))
14445 }
14446
14447 pub fn with_request<V: Into<crate::model::DeleteTaskRequest>>(mut self, v: V) -> Self {
14449 self.0.request = v.into();
14450 self
14451 }
14452
14453 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14455 self.0.options = v.into();
14456 self
14457 }
14458
14459 pub async fn send(self) -> Result<longrunning::model::Operation> {
14466 (*self.0.stub)
14467 .delete_task(self.0.request, self.0.options)
14468 .await
14469 .map(gax::response::Response::into_body)
14470 }
14471
14472 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
14474 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14475 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14476 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14477
14478 let stub = self.0.stub.clone();
14479 let mut options = self.0.options.clone();
14480 options.set_retry_policy(gax::retry_policy::NeverRetry);
14481 let query = move |name| {
14482 let stub = stub.clone();
14483 let options = options.clone();
14484 async {
14485 let op = GetOperation::new(stub)
14486 .set_name(name)
14487 .with_options(options)
14488 .send()
14489 .await?;
14490 Ok(Operation::new(op))
14491 }
14492 };
14493
14494 let start = move || async {
14495 let op = self.send().await?;
14496 Ok(Operation::new(op))
14497 };
14498
14499 lro::internal::new_unit_response_poller(
14500 polling_error_policy,
14501 polling_backoff_policy,
14502 start,
14503 query,
14504 )
14505 }
14506
14507 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14511 self.0.request.name = v.into();
14512 self
14513 }
14514 }
14515
14516 #[doc(hidden)]
14517 impl gax::options::internal::RequestBuilder for DeleteTask {
14518 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14519 &mut self.0.options
14520 }
14521 }
14522
14523 #[derive(Clone, Debug)]
14545 pub struct ListTasks(RequestBuilder<crate::model::ListTasksRequest>);
14546
14547 impl ListTasks {
14548 pub(crate) fn new(
14549 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14550 ) -> Self {
14551 Self(RequestBuilder::new(stub))
14552 }
14553
14554 pub fn with_request<V: Into<crate::model::ListTasksRequest>>(mut self, v: V) -> Self {
14556 self.0.request = v.into();
14557 self
14558 }
14559
14560 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14562 self.0.options = v.into();
14563 self
14564 }
14565
14566 pub async fn send(self) -> Result<crate::model::ListTasksResponse> {
14568 (*self.0.stub)
14569 .list_tasks(self.0.request, self.0.options)
14570 .await
14571 .map(gax::response::Response::into_body)
14572 }
14573
14574 pub fn by_page(
14576 self,
14577 ) -> impl gax::paginator::Paginator<crate::model::ListTasksResponse, gax::error::Error>
14578 {
14579 use std::clone::Clone;
14580 let token = self.0.request.page_token.clone();
14581 let execute = move |token: String| {
14582 let mut builder = self.clone();
14583 builder.0.request = builder.0.request.set_page_token(token);
14584 builder.send()
14585 };
14586 gax::paginator::internal::new_paginator(token, execute)
14587 }
14588
14589 pub fn by_item(
14591 self,
14592 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTasksResponse, gax::error::Error>
14593 {
14594 use gax::paginator::Paginator;
14595 self.by_page().items()
14596 }
14597
14598 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14602 self.0.request.parent = v.into();
14603 self
14604 }
14605
14606 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14608 self.0.request.page_size = v.into();
14609 self
14610 }
14611
14612 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14614 self.0.request.page_token = v.into();
14615 self
14616 }
14617
14618 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14620 self.0.request.filter = v.into();
14621 self
14622 }
14623
14624 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
14626 self.0.request.order_by = v.into();
14627 self
14628 }
14629 }
14630
14631 #[doc(hidden)]
14632 impl gax::options::internal::RequestBuilder for ListTasks {
14633 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14634 &mut self.0.options
14635 }
14636 }
14637
14638 #[derive(Clone, Debug)]
14656 pub struct GetTask(RequestBuilder<crate::model::GetTaskRequest>);
14657
14658 impl GetTask {
14659 pub(crate) fn new(
14660 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14661 ) -> Self {
14662 Self(RequestBuilder::new(stub))
14663 }
14664
14665 pub fn with_request<V: Into<crate::model::GetTaskRequest>>(mut self, v: V) -> Self {
14667 self.0.request = v.into();
14668 self
14669 }
14670
14671 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14673 self.0.options = v.into();
14674 self
14675 }
14676
14677 pub async fn send(self) -> Result<crate::model::Task> {
14679 (*self.0.stub)
14680 .get_task(self.0.request, self.0.options)
14681 .await
14682 .map(gax::response::Response::into_body)
14683 }
14684
14685 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14689 self.0.request.name = v.into();
14690 self
14691 }
14692 }
14693
14694 #[doc(hidden)]
14695 impl gax::options::internal::RequestBuilder for GetTask {
14696 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14697 &mut self.0.options
14698 }
14699 }
14700
14701 #[derive(Clone, Debug)]
14723 pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
14724
14725 impl ListJobs {
14726 pub(crate) fn new(
14727 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14728 ) -> Self {
14729 Self(RequestBuilder::new(stub))
14730 }
14731
14732 pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
14734 self.0.request = v.into();
14735 self
14736 }
14737
14738 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14740 self.0.options = v.into();
14741 self
14742 }
14743
14744 pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
14746 (*self.0.stub)
14747 .list_jobs(self.0.request, self.0.options)
14748 .await
14749 .map(gax::response::Response::into_body)
14750 }
14751
14752 pub fn by_page(
14754 self,
14755 ) -> impl gax::paginator::Paginator<crate::model::ListJobsResponse, gax::error::Error>
14756 {
14757 use std::clone::Clone;
14758 let token = self.0.request.page_token.clone();
14759 let execute = move |token: String| {
14760 let mut builder = self.clone();
14761 builder.0.request = builder.0.request.set_page_token(token);
14762 builder.send()
14763 };
14764 gax::paginator::internal::new_paginator(token, execute)
14765 }
14766
14767 pub fn by_item(
14769 self,
14770 ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobsResponse, gax::error::Error>
14771 {
14772 use gax::paginator::Paginator;
14773 self.by_page().items()
14774 }
14775
14776 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14780 self.0.request.parent = v.into();
14781 self
14782 }
14783
14784 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14786 self.0.request.page_size = v.into();
14787 self
14788 }
14789
14790 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14792 self.0.request.page_token = v.into();
14793 self
14794 }
14795 }
14796
14797 #[doc(hidden)]
14798 impl gax::options::internal::RequestBuilder for ListJobs {
14799 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14800 &mut self.0.options
14801 }
14802 }
14803
14804 #[derive(Clone, Debug)]
14822 pub struct RunTask(RequestBuilder<crate::model::RunTaskRequest>);
14823
14824 impl RunTask {
14825 pub(crate) fn new(
14826 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14827 ) -> Self {
14828 Self(RequestBuilder::new(stub))
14829 }
14830
14831 pub fn with_request<V: Into<crate::model::RunTaskRequest>>(mut self, v: V) -> Self {
14833 self.0.request = v.into();
14834 self
14835 }
14836
14837 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14839 self.0.options = v.into();
14840 self
14841 }
14842
14843 pub async fn send(self) -> Result<crate::model::RunTaskResponse> {
14845 (*self.0.stub)
14846 .run_task(self.0.request, self.0.options)
14847 .await
14848 .map(gax::response::Response::into_body)
14849 }
14850
14851 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14855 self.0.request.name = v.into();
14856 self
14857 }
14858
14859 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14861 where
14862 T: std::iter::IntoIterator<Item = (K, V)>,
14863 K: std::convert::Into<std::string::String>,
14864 V: std::convert::Into<std::string::String>,
14865 {
14866 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14867 self
14868 }
14869
14870 pub fn set_args<T, K, V>(mut self, v: T) -> Self
14872 where
14873 T: std::iter::IntoIterator<Item = (K, V)>,
14874 K: std::convert::Into<std::string::String>,
14875 V: std::convert::Into<std::string::String>,
14876 {
14877 self.0.request.args = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14878 self
14879 }
14880 }
14881
14882 #[doc(hidden)]
14883 impl gax::options::internal::RequestBuilder for RunTask {
14884 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14885 &mut self.0.options
14886 }
14887 }
14888
14889 #[derive(Clone, Debug)]
14907 pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
14908
14909 impl GetJob {
14910 pub(crate) fn new(
14911 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14912 ) -> Self {
14913 Self(RequestBuilder::new(stub))
14914 }
14915
14916 pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
14918 self.0.request = v.into();
14919 self
14920 }
14921
14922 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14924 self.0.options = v.into();
14925 self
14926 }
14927
14928 pub async fn send(self) -> Result<crate::model::Job> {
14930 (*self.0.stub)
14931 .get_job(self.0.request, self.0.options)
14932 .await
14933 .map(gax::response::Response::into_body)
14934 }
14935
14936 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14940 self.0.request.name = v.into();
14941 self
14942 }
14943 }
14944
14945 #[doc(hidden)]
14946 impl gax::options::internal::RequestBuilder for GetJob {
14947 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14948 &mut self.0.options
14949 }
14950 }
14951
14952 #[derive(Clone, Debug)]
14970 pub struct CancelJob(RequestBuilder<crate::model::CancelJobRequest>);
14971
14972 impl CancelJob {
14973 pub(crate) fn new(
14974 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14975 ) -> Self {
14976 Self(RequestBuilder::new(stub))
14977 }
14978
14979 pub fn with_request<V: Into<crate::model::CancelJobRequest>>(mut self, v: V) -> Self {
14981 self.0.request = v.into();
14982 self
14983 }
14984
14985 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14987 self.0.options = v.into();
14988 self
14989 }
14990
14991 pub async fn send(self) -> Result<()> {
14993 (*self.0.stub)
14994 .cancel_job(self.0.request, self.0.options)
14995 .await
14996 .map(gax::response::Response::into_body)
14997 }
14998
14999 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15003 self.0.request.name = v.into();
15004 self
15005 }
15006 }
15007
15008 #[doc(hidden)]
15009 impl gax::options::internal::RequestBuilder for CancelJob {
15010 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15011 &mut self.0.options
15012 }
15013 }
15014
15015 #[derive(Clone, Debug)]
15034 pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
15035
15036 impl CreateEnvironment {
15037 pub(crate) fn new(
15038 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15039 ) -> Self {
15040 Self(RequestBuilder::new(stub))
15041 }
15042
15043 pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
15045 mut self,
15046 v: V,
15047 ) -> Self {
15048 self.0.request = v.into();
15049 self
15050 }
15051
15052 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15054 self.0.options = v.into();
15055 self
15056 }
15057
15058 pub async fn send(self) -> Result<longrunning::model::Operation> {
15065 (*self.0.stub)
15066 .create_environment(self.0.request, self.0.options)
15067 .await
15068 .map(gax::response::Response::into_body)
15069 }
15070
15071 pub fn poller(
15073 self,
15074 ) -> impl lro::Poller<crate::model::Environment, crate::model::OperationMetadata> {
15075 type Operation = lro::internal::Operation<
15076 crate::model::Environment,
15077 crate::model::OperationMetadata,
15078 >;
15079 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15080 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15081
15082 let stub = self.0.stub.clone();
15083 let mut options = self.0.options.clone();
15084 options.set_retry_policy(gax::retry_policy::NeverRetry);
15085 let query = move |name| {
15086 let stub = stub.clone();
15087 let options = options.clone();
15088 async {
15089 let op = GetOperation::new(stub)
15090 .set_name(name)
15091 .with_options(options)
15092 .send()
15093 .await?;
15094 Ok(Operation::new(op))
15095 }
15096 };
15097
15098 let start = move || async {
15099 let op = self.send().await?;
15100 Ok(Operation::new(op))
15101 };
15102
15103 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
15104 }
15105
15106 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15110 self.0.request.parent = v.into();
15111 self
15112 }
15113
15114 pub fn set_environment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15118 self.0.request.environment_id = v.into();
15119 self
15120 }
15121
15122 pub fn set_environment<T>(mut self, v: T) -> Self
15126 where
15127 T: std::convert::Into<crate::model::Environment>,
15128 {
15129 self.0.request.environment = std::option::Option::Some(v.into());
15130 self
15131 }
15132
15133 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
15137 where
15138 T: std::convert::Into<crate::model::Environment>,
15139 {
15140 self.0.request.environment = v.map(|x| x.into());
15141 self
15142 }
15143
15144 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15146 self.0.request.validate_only = v.into();
15147 self
15148 }
15149 }
15150
15151 #[doc(hidden)]
15152 impl gax::options::internal::RequestBuilder for CreateEnvironment {
15153 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15154 &mut self.0.options
15155 }
15156 }
15157
15158 #[derive(Clone, Debug)]
15177 pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
15178
15179 impl UpdateEnvironment {
15180 pub(crate) fn new(
15181 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15182 ) -> Self {
15183 Self(RequestBuilder::new(stub))
15184 }
15185
15186 pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
15188 mut self,
15189 v: V,
15190 ) -> Self {
15191 self.0.request = v.into();
15192 self
15193 }
15194
15195 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15197 self.0.options = v.into();
15198 self
15199 }
15200
15201 pub async fn send(self) -> Result<longrunning::model::Operation> {
15208 (*self.0.stub)
15209 .update_environment(self.0.request, self.0.options)
15210 .await
15211 .map(gax::response::Response::into_body)
15212 }
15213
15214 pub fn poller(
15216 self,
15217 ) -> impl lro::Poller<crate::model::Environment, crate::model::OperationMetadata> {
15218 type Operation = lro::internal::Operation<
15219 crate::model::Environment,
15220 crate::model::OperationMetadata,
15221 >;
15222 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15223 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15224
15225 let stub = self.0.stub.clone();
15226 let mut options = self.0.options.clone();
15227 options.set_retry_policy(gax::retry_policy::NeverRetry);
15228 let query = move |name| {
15229 let stub = stub.clone();
15230 let options = options.clone();
15231 async {
15232 let op = GetOperation::new(stub)
15233 .set_name(name)
15234 .with_options(options)
15235 .send()
15236 .await?;
15237 Ok(Operation::new(op))
15238 }
15239 };
15240
15241 let start = move || async {
15242 let op = self.send().await?;
15243 Ok(Operation::new(op))
15244 };
15245
15246 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
15247 }
15248
15249 pub fn set_update_mask<T>(mut self, v: T) -> Self
15253 where
15254 T: std::convert::Into<wkt::FieldMask>,
15255 {
15256 self.0.request.update_mask = std::option::Option::Some(v.into());
15257 self
15258 }
15259
15260 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15264 where
15265 T: std::convert::Into<wkt::FieldMask>,
15266 {
15267 self.0.request.update_mask = v.map(|x| x.into());
15268 self
15269 }
15270
15271 pub fn set_environment<T>(mut self, v: T) -> Self
15275 where
15276 T: std::convert::Into<crate::model::Environment>,
15277 {
15278 self.0.request.environment = std::option::Option::Some(v.into());
15279 self
15280 }
15281
15282 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
15286 where
15287 T: std::convert::Into<crate::model::Environment>,
15288 {
15289 self.0.request.environment = v.map(|x| x.into());
15290 self
15291 }
15292
15293 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15295 self.0.request.validate_only = v.into();
15296 self
15297 }
15298 }
15299
15300 #[doc(hidden)]
15301 impl gax::options::internal::RequestBuilder for UpdateEnvironment {
15302 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15303 &mut self.0.options
15304 }
15305 }
15306
15307 #[derive(Clone, Debug)]
15326 pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
15327
15328 impl DeleteEnvironment {
15329 pub(crate) fn new(
15330 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15331 ) -> Self {
15332 Self(RequestBuilder::new(stub))
15333 }
15334
15335 pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
15337 mut self,
15338 v: V,
15339 ) -> Self {
15340 self.0.request = v.into();
15341 self
15342 }
15343
15344 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15346 self.0.options = v.into();
15347 self
15348 }
15349
15350 pub async fn send(self) -> Result<longrunning::model::Operation> {
15357 (*self.0.stub)
15358 .delete_environment(self.0.request, self.0.options)
15359 .await
15360 .map(gax::response::Response::into_body)
15361 }
15362
15363 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
15365 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15366 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15367 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15368
15369 let stub = self.0.stub.clone();
15370 let mut options = self.0.options.clone();
15371 options.set_retry_policy(gax::retry_policy::NeverRetry);
15372 let query = move |name| {
15373 let stub = stub.clone();
15374 let options = options.clone();
15375 async {
15376 let op = GetOperation::new(stub)
15377 .set_name(name)
15378 .with_options(options)
15379 .send()
15380 .await?;
15381 Ok(Operation::new(op))
15382 }
15383 };
15384
15385 let start = move || async {
15386 let op = self.send().await?;
15387 Ok(Operation::new(op))
15388 };
15389
15390 lro::internal::new_unit_response_poller(
15391 polling_error_policy,
15392 polling_backoff_policy,
15393 start,
15394 query,
15395 )
15396 }
15397
15398 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15402 self.0.request.name = v.into();
15403 self
15404 }
15405 }
15406
15407 #[doc(hidden)]
15408 impl gax::options::internal::RequestBuilder for DeleteEnvironment {
15409 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15410 &mut self.0.options
15411 }
15412 }
15413
15414 #[derive(Clone, Debug)]
15436 pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
15437
15438 impl ListEnvironments {
15439 pub(crate) fn new(
15440 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15441 ) -> Self {
15442 Self(RequestBuilder::new(stub))
15443 }
15444
15445 pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
15447 mut self,
15448 v: V,
15449 ) -> Self {
15450 self.0.request = v.into();
15451 self
15452 }
15453
15454 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15456 self.0.options = v.into();
15457 self
15458 }
15459
15460 pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
15462 (*self.0.stub)
15463 .list_environments(self.0.request, self.0.options)
15464 .await
15465 .map(gax::response::Response::into_body)
15466 }
15467
15468 pub fn by_page(
15470 self,
15471 ) -> impl gax::paginator::Paginator<crate::model::ListEnvironmentsResponse, gax::error::Error>
15472 {
15473 use std::clone::Clone;
15474 let token = self.0.request.page_token.clone();
15475 let execute = move |token: String| {
15476 let mut builder = self.clone();
15477 builder.0.request = builder.0.request.set_page_token(token);
15478 builder.send()
15479 };
15480 gax::paginator::internal::new_paginator(token, execute)
15481 }
15482
15483 pub fn by_item(
15485 self,
15486 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEnvironmentsResponse, gax::error::Error>
15487 {
15488 use gax::paginator::Paginator;
15489 self.by_page().items()
15490 }
15491
15492 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15496 self.0.request.parent = v.into();
15497 self
15498 }
15499
15500 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15502 self.0.request.page_size = v.into();
15503 self
15504 }
15505
15506 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15508 self.0.request.page_token = v.into();
15509 self
15510 }
15511
15512 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15514 self.0.request.filter = v.into();
15515 self
15516 }
15517
15518 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
15520 self.0.request.order_by = v.into();
15521 self
15522 }
15523 }
15524
15525 #[doc(hidden)]
15526 impl gax::options::internal::RequestBuilder for ListEnvironments {
15527 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15528 &mut self.0.options
15529 }
15530 }
15531
15532 #[derive(Clone, Debug)]
15550 pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
15551
15552 impl GetEnvironment {
15553 pub(crate) fn new(
15554 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15555 ) -> Self {
15556 Self(RequestBuilder::new(stub))
15557 }
15558
15559 pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
15561 self.0.request = v.into();
15562 self
15563 }
15564
15565 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15567 self.0.options = v.into();
15568 self
15569 }
15570
15571 pub async fn send(self) -> Result<crate::model::Environment> {
15573 (*self.0.stub)
15574 .get_environment(self.0.request, self.0.options)
15575 .await
15576 .map(gax::response::Response::into_body)
15577 }
15578
15579 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15583 self.0.request.name = v.into();
15584 self
15585 }
15586 }
15587
15588 #[doc(hidden)]
15589 impl gax::options::internal::RequestBuilder for GetEnvironment {
15590 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15591 &mut self.0.options
15592 }
15593 }
15594
15595 #[derive(Clone, Debug)]
15617 pub struct ListSessions(RequestBuilder<crate::model::ListSessionsRequest>);
15618
15619 impl ListSessions {
15620 pub(crate) fn new(
15621 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15622 ) -> Self {
15623 Self(RequestBuilder::new(stub))
15624 }
15625
15626 pub fn with_request<V: Into<crate::model::ListSessionsRequest>>(mut self, v: V) -> Self {
15628 self.0.request = v.into();
15629 self
15630 }
15631
15632 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15634 self.0.options = v.into();
15635 self
15636 }
15637
15638 pub async fn send(self) -> Result<crate::model::ListSessionsResponse> {
15640 (*self.0.stub)
15641 .list_sessions(self.0.request, self.0.options)
15642 .await
15643 .map(gax::response::Response::into_body)
15644 }
15645
15646 pub fn by_page(
15648 self,
15649 ) -> impl gax::paginator::Paginator<crate::model::ListSessionsResponse, gax::error::Error>
15650 {
15651 use std::clone::Clone;
15652 let token = self.0.request.page_token.clone();
15653 let execute = move |token: String| {
15654 let mut builder = self.clone();
15655 builder.0.request = builder.0.request.set_page_token(token);
15656 builder.send()
15657 };
15658 gax::paginator::internal::new_paginator(token, execute)
15659 }
15660
15661 pub fn by_item(
15663 self,
15664 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSessionsResponse, gax::error::Error>
15665 {
15666 use gax::paginator::Paginator;
15667 self.by_page().items()
15668 }
15669
15670 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15674 self.0.request.parent = v.into();
15675 self
15676 }
15677
15678 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15680 self.0.request.page_size = v.into();
15681 self
15682 }
15683
15684 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15686 self.0.request.page_token = v.into();
15687 self
15688 }
15689
15690 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15692 self.0.request.filter = v.into();
15693 self
15694 }
15695 }
15696
15697 #[doc(hidden)]
15698 impl gax::options::internal::RequestBuilder for ListSessions {
15699 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15700 &mut self.0.options
15701 }
15702 }
15703
15704 #[derive(Clone, Debug)]
15726 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
15727
15728 impl ListLocations {
15729 pub(crate) fn new(
15730 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15731 ) -> Self {
15732 Self(RequestBuilder::new(stub))
15733 }
15734
15735 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
15737 mut self,
15738 v: V,
15739 ) -> Self {
15740 self.0.request = v.into();
15741 self
15742 }
15743
15744 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15746 self.0.options = v.into();
15747 self
15748 }
15749
15750 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
15752 (*self.0.stub)
15753 .list_locations(self.0.request, self.0.options)
15754 .await
15755 .map(gax::response::Response::into_body)
15756 }
15757
15758 pub fn by_page(
15760 self,
15761 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
15762 {
15763 use std::clone::Clone;
15764 let token = self.0.request.page_token.clone();
15765 let execute = move |token: String| {
15766 let mut builder = self.clone();
15767 builder.0.request = builder.0.request.set_page_token(token);
15768 builder.send()
15769 };
15770 gax::paginator::internal::new_paginator(token, execute)
15771 }
15772
15773 pub fn by_item(
15775 self,
15776 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
15777 {
15778 use gax::paginator::Paginator;
15779 self.by_page().items()
15780 }
15781
15782 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15784 self.0.request.name = v.into();
15785 self
15786 }
15787
15788 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15790 self.0.request.filter = v.into();
15791 self
15792 }
15793
15794 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15796 self.0.request.page_size = v.into();
15797 self
15798 }
15799
15800 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15802 self.0.request.page_token = v.into();
15803 self
15804 }
15805 }
15806
15807 #[doc(hidden)]
15808 impl gax::options::internal::RequestBuilder for ListLocations {
15809 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15810 &mut self.0.options
15811 }
15812 }
15813
15814 #[derive(Clone, Debug)]
15832 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
15833
15834 impl GetLocation {
15835 pub(crate) fn new(
15836 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15837 ) -> Self {
15838 Self(RequestBuilder::new(stub))
15839 }
15840
15841 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
15843 self.0.request = v.into();
15844 self
15845 }
15846
15847 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15849 self.0.options = v.into();
15850 self
15851 }
15852
15853 pub async fn send(self) -> Result<location::model::Location> {
15855 (*self.0.stub)
15856 .get_location(self.0.request, self.0.options)
15857 .await
15858 .map(gax::response::Response::into_body)
15859 }
15860
15861 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15863 self.0.request.name = v.into();
15864 self
15865 }
15866 }
15867
15868 #[doc(hidden)]
15869 impl gax::options::internal::RequestBuilder for GetLocation {
15870 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15871 &mut self.0.options
15872 }
15873 }
15874
15875 #[derive(Clone, Debug)]
15893 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
15894
15895 impl SetIamPolicy {
15896 pub(crate) fn new(
15897 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15898 ) -> Self {
15899 Self(RequestBuilder::new(stub))
15900 }
15901
15902 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
15904 self.0.request = v.into();
15905 self
15906 }
15907
15908 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15910 self.0.options = v.into();
15911 self
15912 }
15913
15914 pub async fn send(self) -> Result<iam_v1::model::Policy> {
15916 (*self.0.stub)
15917 .set_iam_policy(self.0.request, self.0.options)
15918 .await
15919 .map(gax::response::Response::into_body)
15920 }
15921
15922 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
15926 self.0.request.resource = v.into();
15927 self
15928 }
15929
15930 pub fn set_policy<T>(mut self, v: T) -> Self
15934 where
15935 T: std::convert::Into<iam_v1::model::Policy>,
15936 {
15937 self.0.request.policy = std::option::Option::Some(v.into());
15938 self
15939 }
15940
15941 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
15945 where
15946 T: std::convert::Into<iam_v1::model::Policy>,
15947 {
15948 self.0.request.policy = v.map(|x| x.into());
15949 self
15950 }
15951
15952 pub fn set_update_mask<T>(mut self, v: T) -> Self
15954 where
15955 T: std::convert::Into<wkt::FieldMask>,
15956 {
15957 self.0.request.update_mask = std::option::Option::Some(v.into());
15958 self
15959 }
15960
15961 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15963 where
15964 T: std::convert::Into<wkt::FieldMask>,
15965 {
15966 self.0.request.update_mask = v.map(|x| x.into());
15967 self
15968 }
15969 }
15970
15971 #[doc(hidden)]
15972 impl gax::options::internal::RequestBuilder for SetIamPolicy {
15973 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15974 &mut self.0.options
15975 }
15976 }
15977
15978 #[derive(Clone, Debug)]
15996 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
15997
15998 impl GetIamPolicy {
15999 pub(crate) fn new(
16000 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16001 ) -> Self {
16002 Self(RequestBuilder::new(stub))
16003 }
16004
16005 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
16007 self.0.request = v.into();
16008 self
16009 }
16010
16011 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16013 self.0.options = v.into();
16014 self
16015 }
16016
16017 pub async fn send(self) -> Result<iam_v1::model::Policy> {
16019 (*self.0.stub)
16020 .get_iam_policy(self.0.request, self.0.options)
16021 .await
16022 .map(gax::response::Response::into_body)
16023 }
16024
16025 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
16029 self.0.request.resource = v.into();
16030 self
16031 }
16032
16033 pub fn set_options<T>(mut self, v: T) -> Self
16035 where
16036 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
16037 {
16038 self.0.request.options = std::option::Option::Some(v.into());
16039 self
16040 }
16041
16042 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
16044 where
16045 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
16046 {
16047 self.0.request.options = v.map(|x| x.into());
16048 self
16049 }
16050 }
16051
16052 #[doc(hidden)]
16053 impl gax::options::internal::RequestBuilder for GetIamPolicy {
16054 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16055 &mut self.0.options
16056 }
16057 }
16058
16059 #[derive(Clone, Debug)]
16077 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
16078
16079 impl TestIamPermissions {
16080 pub(crate) fn new(
16081 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16082 ) -> Self {
16083 Self(RequestBuilder::new(stub))
16084 }
16085
16086 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
16088 mut self,
16089 v: V,
16090 ) -> Self {
16091 self.0.request = v.into();
16092 self
16093 }
16094
16095 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16097 self.0.options = v.into();
16098 self
16099 }
16100
16101 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
16103 (*self.0.stub)
16104 .test_iam_permissions(self.0.request, self.0.options)
16105 .await
16106 .map(gax::response::Response::into_body)
16107 }
16108
16109 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
16113 self.0.request.resource = v.into();
16114 self
16115 }
16116
16117 pub fn set_permissions<T, V>(mut self, v: T) -> Self
16121 where
16122 T: std::iter::IntoIterator<Item = V>,
16123 V: std::convert::Into<std::string::String>,
16124 {
16125 use std::iter::Iterator;
16126 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
16127 self
16128 }
16129 }
16130
16131 #[doc(hidden)]
16132 impl gax::options::internal::RequestBuilder for TestIamPermissions {
16133 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16134 &mut self.0.options
16135 }
16136 }
16137
16138 #[derive(Clone, Debug)]
16160 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
16161
16162 impl ListOperations {
16163 pub(crate) fn new(
16164 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16165 ) -> Self {
16166 Self(RequestBuilder::new(stub))
16167 }
16168
16169 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
16171 mut self,
16172 v: V,
16173 ) -> Self {
16174 self.0.request = v.into();
16175 self
16176 }
16177
16178 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16180 self.0.options = v.into();
16181 self
16182 }
16183
16184 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
16186 (*self.0.stub)
16187 .list_operations(self.0.request, self.0.options)
16188 .await
16189 .map(gax::response::Response::into_body)
16190 }
16191
16192 pub fn by_page(
16194 self,
16195 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
16196 {
16197 use std::clone::Clone;
16198 let token = self.0.request.page_token.clone();
16199 let execute = move |token: String| {
16200 let mut builder = self.clone();
16201 builder.0.request = builder.0.request.set_page_token(token);
16202 builder.send()
16203 };
16204 gax::paginator::internal::new_paginator(token, execute)
16205 }
16206
16207 pub fn by_item(
16209 self,
16210 ) -> impl gax::paginator::ItemPaginator<
16211 longrunning::model::ListOperationsResponse,
16212 gax::error::Error,
16213 > {
16214 use gax::paginator::Paginator;
16215 self.by_page().items()
16216 }
16217
16218 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16220 self.0.request.name = v.into();
16221 self
16222 }
16223
16224 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16226 self.0.request.filter = v.into();
16227 self
16228 }
16229
16230 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16232 self.0.request.page_size = v.into();
16233 self
16234 }
16235
16236 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16238 self.0.request.page_token = v.into();
16239 self
16240 }
16241 }
16242
16243 #[doc(hidden)]
16244 impl gax::options::internal::RequestBuilder for ListOperations {
16245 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16246 &mut self.0.options
16247 }
16248 }
16249
16250 #[derive(Clone, Debug)]
16268 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
16269
16270 impl GetOperation {
16271 pub(crate) fn new(
16272 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16273 ) -> Self {
16274 Self(RequestBuilder::new(stub))
16275 }
16276
16277 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
16279 mut self,
16280 v: V,
16281 ) -> Self {
16282 self.0.request = v.into();
16283 self
16284 }
16285
16286 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16288 self.0.options = v.into();
16289 self
16290 }
16291
16292 pub async fn send(self) -> Result<longrunning::model::Operation> {
16294 (*self.0.stub)
16295 .get_operation(self.0.request, self.0.options)
16296 .await
16297 .map(gax::response::Response::into_body)
16298 }
16299
16300 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16302 self.0.request.name = v.into();
16303 self
16304 }
16305 }
16306
16307 #[doc(hidden)]
16308 impl gax::options::internal::RequestBuilder for GetOperation {
16309 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16310 &mut self.0.options
16311 }
16312 }
16313
16314 #[derive(Clone, Debug)]
16332 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
16333
16334 impl DeleteOperation {
16335 pub(crate) fn new(
16336 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16337 ) -> Self {
16338 Self(RequestBuilder::new(stub))
16339 }
16340
16341 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
16343 mut self,
16344 v: V,
16345 ) -> Self {
16346 self.0.request = v.into();
16347 self
16348 }
16349
16350 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16352 self.0.options = v.into();
16353 self
16354 }
16355
16356 pub async fn send(self) -> Result<()> {
16358 (*self.0.stub)
16359 .delete_operation(self.0.request, self.0.options)
16360 .await
16361 .map(gax::response::Response::into_body)
16362 }
16363
16364 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16366 self.0.request.name = v.into();
16367 self
16368 }
16369 }
16370
16371 #[doc(hidden)]
16372 impl gax::options::internal::RequestBuilder for DeleteOperation {
16373 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16374 &mut self.0.options
16375 }
16376 }
16377
16378 #[derive(Clone, Debug)]
16396 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
16397
16398 impl CancelOperation {
16399 pub(crate) fn new(
16400 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16401 ) -> Self {
16402 Self(RequestBuilder::new(stub))
16403 }
16404
16405 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
16407 mut self,
16408 v: V,
16409 ) -> Self {
16410 self.0.request = v.into();
16411 self
16412 }
16413
16414 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16416 self.0.options = v.into();
16417 self
16418 }
16419
16420 pub async fn send(self) -> Result<()> {
16422 (*self.0.stub)
16423 .cancel_operation(self.0.request, self.0.options)
16424 .await
16425 .map(gax::response::Response::into_body)
16426 }
16427
16428 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16430 self.0.request.name = v.into();
16431 self
16432 }
16433 }
16434
16435 #[doc(hidden)]
16436 impl gax::options::internal::RequestBuilder for CancelOperation {
16437 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16438 &mut self.0.options
16439 }
16440 }
16441}