1pub mod folders {
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::Folders;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = Folders;
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::Folders>,
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(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: gax::options::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
90 pub struct GetFolder(RequestBuilder<crate::model::GetFolderRequest>);
91
92 impl GetFolder {
93 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
94 Self(RequestBuilder::new(stub))
95 }
96
97 pub fn with_request<V: Into<crate::model::GetFolderRequest>>(mut self, v: V) -> Self {
99 self.0.request = v.into();
100 self
101 }
102
103 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
105 self.0.options = v.into();
106 self
107 }
108
109 pub async fn send(self) -> Result<crate::model::Folder> {
111 (*self.0.stub)
112 .get_folder(self.0.request, self.0.options)
113 .await
114 .map(gax::response::Response::into_body)
115 }
116
117 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
121 self.0.request.name = v.into();
122 self
123 }
124 }
125
126 #[doc(hidden)]
127 impl gax::options::internal::RequestBuilder for GetFolder {
128 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
129 &mut self.0.options
130 }
131 }
132
133 #[derive(Clone, Debug)]
155 pub struct ListFolders(RequestBuilder<crate::model::ListFoldersRequest>);
156
157 impl ListFolders {
158 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
159 Self(RequestBuilder::new(stub))
160 }
161
162 pub fn with_request<V: Into<crate::model::ListFoldersRequest>>(mut self, v: V) -> Self {
164 self.0.request = v.into();
165 self
166 }
167
168 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
170 self.0.options = v.into();
171 self
172 }
173
174 pub async fn send(self) -> Result<crate::model::ListFoldersResponse> {
176 (*self.0.stub)
177 .list_folders(self.0.request, self.0.options)
178 .await
179 .map(gax::response::Response::into_body)
180 }
181
182 pub fn by_page(
184 self,
185 ) -> impl gax::paginator::Paginator<crate::model::ListFoldersResponse, gax::error::Error>
186 {
187 use std::clone::Clone;
188 let token = self.0.request.page_token.clone();
189 let execute = move |token: String| {
190 let mut builder = self.clone();
191 builder.0.request = builder.0.request.set_page_token(token);
192 builder.send()
193 };
194 gax::paginator::internal::new_paginator(token, execute)
195 }
196
197 pub fn by_item(
199 self,
200 ) -> impl gax::paginator::ItemPaginator<crate::model::ListFoldersResponse, gax::error::Error>
201 {
202 use gax::paginator::Paginator;
203 self.by_page().items()
204 }
205
206 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
210 self.0.request.parent = v.into();
211 self
212 }
213
214 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
216 self.0.request.page_size = v.into();
217 self
218 }
219
220 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
222 self.0.request.page_token = v.into();
223 self
224 }
225
226 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
228 self.0.request.show_deleted = v.into();
229 self
230 }
231 }
232
233 #[doc(hidden)]
234 impl gax::options::internal::RequestBuilder for ListFolders {
235 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
236 &mut self.0.options
237 }
238 }
239
240 #[derive(Clone, Debug)]
262 pub struct SearchFolders(RequestBuilder<crate::model::SearchFoldersRequest>);
263
264 impl SearchFolders {
265 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
266 Self(RequestBuilder::new(stub))
267 }
268
269 pub fn with_request<V: Into<crate::model::SearchFoldersRequest>>(mut self, v: V) -> Self {
271 self.0.request = v.into();
272 self
273 }
274
275 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
277 self.0.options = v.into();
278 self
279 }
280
281 pub async fn send(self) -> Result<crate::model::SearchFoldersResponse> {
283 (*self.0.stub)
284 .search_folders(self.0.request, self.0.options)
285 .await
286 .map(gax::response::Response::into_body)
287 }
288
289 pub fn by_page(
291 self,
292 ) -> impl gax::paginator::Paginator<crate::model::SearchFoldersResponse, gax::error::Error>
293 {
294 use std::clone::Clone;
295 let token = self.0.request.page_token.clone();
296 let execute = move |token: String| {
297 let mut builder = self.clone();
298 builder.0.request = builder.0.request.set_page_token(token);
299 builder.send()
300 };
301 gax::paginator::internal::new_paginator(token, execute)
302 }
303
304 pub fn by_item(
306 self,
307 ) -> impl gax::paginator::ItemPaginator<crate::model::SearchFoldersResponse, gax::error::Error>
308 {
309 use gax::paginator::Paginator;
310 self.by_page().items()
311 }
312
313 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
315 self.0.request.page_size = v.into();
316 self
317 }
318
319 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
321 self.0.request.page_token = v.into();
322 self
323 }
324
325 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
327 self.0.request.query = v.into();
328 self
329 }
330 }
331
332 #[doc(hidden)]
333 impl gax::options::internal::RequestBuilder for SearchFolders {
334 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
335 &mut self.0.options
336 }
337 }
338
339 #[derive(Clone, Debug)]
358 pub struct CreateFolder(RequestBuilder<crate::model::CreateFolderRequest>);
359
360 impl CreateFolder {
361 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
362 Self(RequestBuilder::new(stub))
363 }
364
365 pub fn with_request<V: Into<crate::model::CreateFolderRequest>>(mut self, v: V) -> Self {
367 self.0.request = v.into();
368 self
369 }
370
371 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
373 self.0.options = v.into();
374 self
375 }
376
377 pub async fn send(self) -> Result<longrunning::model::Operation> {
384 (*self.0.stub)
385 .create_folder(self.0.request, self.0.options)
386 .await
387 .map(gax::response::Response::into_body)
388 }
389
390 pub fn poller(
392 self,
393 ) -> impl lro::Poller<crate::model::Folder, crate::model::CreateFolderMetadata> {
394 type Operation =
395 lro::internal::Operation<crate::model::Folder, crate::model::CreateFolderMetadata>;
396 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
397 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
398
399 let stub = self.0.stub.clone();
400 let mut options = self.0.options.clone();
401 options.set_retry_policy(gax::retry_policy::NeverRetry);
402 let query = move |name| {
403 let stub = stub.clone();
404 let options = options.clone();
405 async {
406 let op = GetOperation::new(stub)
407 .set_name(name)
408 .with_options(options)
409 .send()
410 .await?;
411 Ok(Operation::new(op))
412 }
413 };
414
415 let start = move || async {
416 let op = self.send().await?;
417 Ok(Operation::new(op))
418 };
419
420 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
421 }
422
423 pub fn set_folder<T>(mut self, v: T) -> Self
427 where
428 T: std::convert::Into<crate::model::Folder>,
429 {
430 self.0.request.folder = std::option::Option::Some(v.into());
431 self
432 }
433
434 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
438 where
439 T: std::convert::Into<crate::model::Folder>,
440 {
441 self.0.request.folder = v.map(|x| x.into());
442 self
443 }
444 }
445
446 #[doc(hidden)]
447 impl gax::options::internal::RequestBuilder for CreateFolder {
448 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
449 &mut self.0.options
450 }
451 }
452
453 #[derive(Clone, Debug)]
472 pub struct UpdateFolder(RequestBuilder<crate::model::UpdateFolderRequest>);
473
474 impl UpdateFolder {
475 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
476 Self(RequestBuilder::new(stub))
477 }
478
479 pub fn with_request<V: Into<crate::model::UpdateFolderRequest>>(mut self, v: V) -> Self {
481 self.0.request = v.into();
482 self
483 }
484
485 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
487 self.0.options = v.into();
488 self
489 }
490
491 pub async fn send(self) -> Result<longrunning::model::Operation> {
498 (*self.0.stub)
499 .update_folder(self.0.request, self.0.options)
500 .await
501 .map(gax::response::Response::into_body)
502 }
503
504 pub fn poller(
506 self,
507 ) -> impl lro::Poller<crate::model::Folder, crate::model::UpdateFolderMetadata> {
508 type Operation =
509 lro::internal::Operation<crate::model::Folder, crate::model::UpdateFolderMetadata>;
510 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
511 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
512
513 let stub = self.0.stub.clone();
514 let mut options = self.0.options.clone();
515 options.set_retry_policy(gax::retry_policy::NeverRetry);
516 let query = move |name| {
517 let stub = stub.clone();
518 let options = options.clone();
519 async {
520 let op = GetOperation::new(stub)
521 .set_name(name)
522 .with_options(options)
523 .send()
524 .await?;
525 Ok(Operation::new(op))
526 }
527 };
528
529 let start = move || async {
530 let op = self.send().await?;
531 Ok(Operation::new(op))
532 };
533
534 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
535 }
536
537 pub fn set_folder<T>(mut self, v: T) -> Self
541 where
542 T: std::convert::Into<crate::model::Folder>,
543 {
544 self.0.request.folder = std::option::Option::Some(v.into());
545 self
546 }
547
548 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
552 where
553 T: std::convert::Into<crate::model::Folder>,
554 {
555 self.0.request.folder = v.map(|x| x.into());
556 self
557 }
558
559 pub fn set_update_mask<T>(mut self, v: T) -> Self
563 where
564 T: std::convert::Into<wkt::FieldMask>,
565 {
566 self.0.request.update_mask = std::option::Option::Some(v.into());
567 self
568 }
569
570 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
574 where
575 T: std::convert::Into<wkt::FieldMask>,
576 {
577 self.0.request.update_mask = v.map(|x| x.into());
578 self
579 }
580 }
581
582 #[doc(hidden)]
583 impl gax::options::internal::RequestBuilder for UpdateFolder {
584 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
585 &mut self.0.options
586 }
587 }
588
589 #[derive(Clone, Debug)]
608 pub struct MoveFolder(RequestBuilder<crate::model::MoveFolderRequest>);
609
610 impl MoveFolder {
611 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
612 Self(RequestBuilder::new(stub))
613 }
614
615 pub fn with_request<V: Into<crate::model::MoveFolderRequest>>(mut self, v: V) -> Self {
617 self.0.request = v.into();
618 self
619 }
620
621 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
623 self.0.options = v.into();
624 self
625 }
626
627 pub async fn send(self) -> Result<longrunning::model::Operation> {
634 (*self.0.stub)
635 .move_folder(self.0.request, self.0.options)
636 .await
637 .map(gax::response::Response::into_body)
638 }
639
640 pub fn poller(
642 self,
643 ) -> impl lro::Poller<crate::model::Folder, crate::model::MoveFolderMetadata> {
644 type Operation =
645 lro::internal::Operation<crate::model::Folder, crate::model::MoveFolderMetadata>;
646 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
647 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
648
649 let stub = self.0.stub.clone();
650 let mut options = self.0.options.clone();
651 options.set_retry_policy(gax::retry_policy::NeverRetry);
652 let query = move |name| {
653 let stub = stub.clone();
654 let options = options.clone();
655 async {
656 let op = GetOperation::new(stub)
657 .set_name(name)
658 .with_options(options)
659 .send()
660 .await?;
661 Ok(Operation::new(op))
662 }
663 };
664
665 let start = move || async {
666 let op = self.send().await?;
667 Ok(Operation::new(op))
668 };
669
670 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
671 }
672
673 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
677 self.0.request.name = v.into();
678 self
679 }
680
681 pub fn set_destination_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
685 self.0.request.destination_parent = v.into();
686 self
687 }
688 }
689
690 #[doc(hidden)]
691 impl gax::options::internal::RequestBuilder for MoveFolder {
692 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
693 &mut self.0.options
694 }
695 }
696
697 #[derive(Clone, Debug)]
716 pub struct DeleteFolder(RequestBuilder<crate::model::DeleteFolderRequest>);
717
718 impl DeleteFolder {
719 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
720 Self(RequestBuilder::new(stub))
721 }
722
723 pub fn with_request<V: Into<crate::model::DeleteFolderRequest>>(mut self, v: V) -> Self {
725 self.0.request = v.into();
726 self
727 }
728
729 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
731 self.0.options = v.into();
732 self
733 }
734
735 pub async fn send(self) -> Result<longrunning::model::Operation> {
742 (*self.0.stub)
743 .delete_folder(self.0.request, self.0.options)
744 .await
745 .map(gax::response::Response::into_body)
746 }
747
748 pub fn poller(
750 self,
751 ) -> impl lro::Poller<crate::model::Folder, crate::model::DeleteFolderMetadata> {
752 type Operation =
753 lro::internal::Operation<crate::model::Folder, crate::model::DeleteFolderMetadata>;
754 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
755 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
756
757 let stub = self.0.stub.clone();
758 let mut options = self.0.options.clone();
759 options.set_retry_policy(gax::retry_policy::NeverRetry);
760 let query = move |name| {
761 let stub = stub.clone();
762 let options = options.clone();
763 async {
764 let op = GetOperation::new(stub)
765 .set_name(name)
766 .with_options(options)
767 .send()
768 .await?;
769 Ok(Operation::new(op))
770 }
771 };
772
773 let start = move || async {
774 let op = self.send().await?;
775 Ok(Operation::new(op))
776 };
777
778 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
779 }
780
781 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
785 self.0.request.name = v.into();
786 self
787 }
788 }
789
790 #[doc(hidden)]
791 impl gax::options::internal::RequestBuilder for DeleteFolder {
792 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
793 &mut self.0.options
794 }
795 }
796
797 #[derive(Clone, Debug)]
816 pub struct UndeleteFolder(RequestBuilder<crate::model::UndeleteFolderRequest>);
817
818 impl UndeleteFolder {
819 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
820 Self(RequestBuilder::new(stub))
821 }
822
823 pub fn with_request<V: Into<crate::model::UndeleteFolderRequest>>(mut self, v: V) -> Self {
825 self.0.request = v.into();
826 self
827 }
828
829 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
831 self.0.options = v.into();
832 self
833 }
834
835 pub async fn send(self) -> Result<longrunning::model::Operation> {
842 (*self.0.stub)
843 .undelete_folder(self.0.request, self.0.options)
844 .await
845 .map(gax::response::Response::into_body)
846 }
847
848 pub fn poller(
850 self,
851 ) -> impl lro::Poller<crate::model::Folder, crate::model::UndeleteFolderMetadata> {
852 type Operation = lro::internal::Operation<
853 crate::model::Folder,
854 crate::model::UndeleteFolderMetadata,
855 >;
856 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
857 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
858
859 let stub = self.0.stub.clone();
860 let mut options = self.0.options.clone();
861 options.set_retry_policy(gax::retry_policy::NeverRetry);
862 let query = move |name| {
863 let stub = stub.clone();
864 let options = options.clone();
865 async {
866 let op = GetOperation::new(stub)
867 .set_name(name)
868 .with_options(options)
869 .send()
870 .await?;
871 Ok(Operation::new(op))
872 }
873 };
874
875 let start = move || async {
876 let op = self.send().await?;
877 Ok(Operation::new(op))
878 };
879
880 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
881 }
882
883 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
887 self.0.request.name = v.into();
888 self
889 }
890 }
891
892 #[doc(hidden)]
893 impl gax::options::internal::RequestBuilder for UndeleteFolder {
894 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
895 &mut self.0.options
896 }
897 }
898
899 #[derive(Clone, Debug)]
917 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
918
919 impl GetIamPolicy {
920 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
921 Self(RequestBuilder::new(stub))
922 }
923
924 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
926 self.0.request = v.into();
927 self
928 }
929
930 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
932 self.0.options = v.into();
933 self
934 }
935
936 pub async fn send(self) -> Result<iam_v1::model::Policy> {
938 (*self.0.stub)
939 .get_iam_policy(self.0.request, self.0.options)
940 .await
941 .map(gax::response::Response::into_body)
942 }
943
944 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
948 self.0.request.resource = v.into();
949 self
950 }
951
952 pub fn set_options<T>(mut self, v: T) -> Self
954 where
955 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
956 {
957 self.0.request.options = std::option::Option::Some(v.into());
958 self
959 }
960
961 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
963 where
964 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
965 {
966 self.0.request.options = v.map(|x| x.into());
967 self
968 }
969 }
970
971 #[doc(hidden)]
972 impl gax::options::internal::RequestBuilder for GetIamPolicy {
973 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
974 &mut self.0.options
975 }
976 }
977
978 #[derive(Clone, Debug)]
996 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
997
998 impl SetIamPolicy {
999 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
1000 Self(RequestBuilder::new(stub))
1001 }
1002
1003 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1005 self.0.request = v.into();
1006 self
1007 }
1008
1009 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1011 self.0.options = v.into();
1012 self
1013 }
1014
1015 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1017 (*self.0.stub)
1018 .set_iam_policy(self.0.request, self.0.options)
1019 .await
1020 .map(gax::response::Response::into_body)
1021 }
1022
1023 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1027 self.0.request.resource = v.into();
1028 self
1029 }
1030
1031 pub fn set_policy<T>(mut self, v: T) -> Self
1035 where
1036 T: std::convert::Into<iam_v1::model::Policy>,
1037 {
1038 self.0.request.policy = std::option::Option::Some(v.into());
1039 self
1040 }
1041
1042 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1046 where
1047 T: std::convert::Into<iam_v1::model::Policy>,
1048 {
1049 self.0.request.policy = v.map(|x| x.into());
1050 self
1051 }
1052
1053 pub fn set_update_mask<T>(mut self, v: T) -> Self
1055 where
1056 T: std::convert::Into<wkt::FieldMask>,
1057 {
1058 self.0.request.update_mask = std::option::Option::Some(v.into());
1059 self
1060 }
1061
1062 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1064 where
1065 T: std::convert::Into<wkt::FieldMask>,
1066 {
1067 self.0.request.update_mask = v.map(|x| x.into());
1068 self
1069 }
1070 }
1071
1072 #[doc(hidden)]
1073 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1074 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1075 &mut self.0.options
1076 }
1077 }
1078
1079 #[derive(Clone, Debug)]
1097 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1098
1099 impl TestIamPermissions {
1100 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
1101 Self(RequestBuilder::new(stub))
1102 }
1103
1104 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1106 mut self,
1107 v: V,
1108 ) -> Self {
1109 self.0.request = v.into();
1110 self
1111 }
1112
1113 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1115 self.0.options = v.into();
1116 self
1117 }
1118
1119 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1121 (*self.0.stub)
1122 .test_iam_permissions(self.0.request, self.0.options)
1123 .await
1124 .map(gax::response::Response::into_body)
1125 }
1126
1127 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1131 self.0.request.resource = v.into();
1132 self
1133 }
1134
1135 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1139 where
1140 T: std::iter::IntoIterator<Item = V>,
1141 V: std::convert::Into<std::string::String>,
1142 {
1143 use std::iter::Iterator;
1144 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1145 self
1146 }
1147 }
1148
1149 #[doc(hidden)]
1150 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1151 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1152 &mut self.0.options
1153 }
1154 }
1155
1156 #[derive(Clone, Debug)]
1174 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1175
1176 impl GetOperation {
1177 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
1178 Self(RequestBuilder::new(stub))
1179 }
1180
1181 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1183 mut self,
1184 v: V,
1185 ) -> Self {
1186 self.0.request = v.into();
1187 self
1188 }
1189
1190 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1192 self.0.options = v.into();
1193 self
1194 }
1195
1196 pub async fn send(self) -> Result<longrunning::model::Operation> {
1198 (*self.0.stub)
1199 .get_operation(self.0.request, self.0.options)
1200 .await
1201 .map(gax::response::Response::into_body)
1202 }
1203
1204 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1206 self.0.request.name = v.into();
1207 self
1208 }
1209 }
1210
1211 #[doc(hidden)]
1212 impl gax::options::internal::RequestBuilder for GetOperation {
1213 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1214 &mut self.0.options
1215 }
1216 }
1217}
1218
1219pub mod organizations {
1220 use crate::Result;
1221
1222 pub type ClientBuilder =
1236 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1237
1238 pub(crate) mod client {
1239 use super::super::super::client::Organizations;
1240 pub struct Factory;
1241 impl gax::client_builder::internal::ClientFactory for Factory {
1242 type Client = Organizations;
1243 type Credentials = gaxi::options::Credentials;
1244 async fn build(
1245 self,
1246 config: gaxi::options::ClientConfig,
1247 ) -> gax::client_builder::Result<Self::Client> {
1248 Self::Client::new(config).await
1249 }
1250 }
1251 }
1252
1253 #[derive(Clone, Debug)]
1255 pub(crate) struct RequestBuilder<R: std::default::Default> {
1256 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1257 request: R,
1258 options: gax::options::RequestOptions,
1259 }
1260
1261 impl<R> RequestBuilder<R>
1262 where
1263 R: std::default::Default,
1264 {
1265 pub(crate) fn new(
1266 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1267 ) -> Self {
1268 Self {
1269 stub,
1270 request: R::default(),
1271 options: gax::options::RequestOptions::default(),
1272 }
1273 }
1274 }
1275
1276 #[derive(Clone, Debug)]
1294 pub struct GetOrganization(RequestBuilder<crate::model::GetOrganizationRequest>);
1295
1296 impl GetOrganization {
1297 pub(crate) fn new(
1298 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1299 ) -> Self {
1300 Self(RequestBuilder::new(stub))
1301 }
1302
1303 pub fn with_request<V: Into<crate::model::GetOrganizationRequest>>(mut self, v: V) -> Self {
1305 self.0.request = v.into();
1306 self
1307 }
1308
1309 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1311 self.0.options = v.into();
1312 self
1313 }
1314
1315 pub async fn send(self) -> Result<crate::model::Organization> {
1317 (*self.0.stub)
1318 .get_organization(self.0.request, self.0.options)
1319 .await
1320 .map(gax::response::Response::into_body)
1321 }
1322
1323 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1327 self.0.request.name = v.into();
1328 self
1329 }
1330 }
1331
1332 #[doc(hidden)]
1333 impl gax::options::internal::RequestBuilder for GetOrganization {
1334 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1335 &mut self.0.options
1336 }
1337 }
1338
1339 #[derive(Clone, Debug)]
1361 pub struct SearchOrganizations(RequestBuilder<crate::model::SearchOrganizationsRequest>);
1362
1363 impl SearchOrganizations {
1364 pub(crate) fn new(
1365 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1366 ) -> Self {
1367 Self(RequestBuilder::new(stub))
1368 }
1369
1370 pub fn with_request<V: Into<crate::model::SearchOrganizationsRequest>>(
1372 mut self,
1373 v: V,
1374 ) -> Self {
1375 self.0.request = v.into();
1376 self
1377 }
1378
1379 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1381 self.0.options = v.into();
1382 self
1383 }
1384
1385 pub async fn send(self) -> Result<crate::model::SearchOrganizationsResponse> {
1387 (*self.0.stub)
1388 .search_organizations(self.0.request, self.0.options)
1389 .await
1390 .map(gax::response::Response::into_body)
1391 }
1392
1393 pub fn by_page(
1395 self,
1396 ) -> impl gax::paginator::Paginator<crate::model::SearchOrganizationsResponse, gax::error::Error>
1397 {
1398 use std::clone::Clone;
1399 let token = self.0.request.page_token.clone();
1400 let execute = move |token: String| {
1401 let mut builder = self.clone();
1402 builder.0.request = builder.0.request.set_page_token(token);
1403 builder.send()
1404 };
1405 gax::paginator::internal::new_paginator(token, execute)
1406 }
1407
1408 pub fn by_item(
1410 self,
1411 ) -> impl gax::paginator::ItemPaginator<
1412 crate::model::SearchOrganizationsResponse,
1413 gax::error::Error,
1414 > {
1415 use gax::paginator::Paginator;
1416 self.by_page().items()
1417 }
1418
1419 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1421 self.0.request.page_size = v.into();
1422 self
1423 }
1424
1425 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1427 self.0.request.page_token = v.into();
1428 self
1429 }
1430
1431 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433 self.0.request.query = v.into();
1434 self
1435 }
1436 }
1437
1438 #[doc(hidden)]
1439 impl gax::options::internal::RequestBuilder for SearchOrganizations {
1440 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1441 &mut self.0.options
1442 }
1443 }
1444
1445 #[derive(Clone, Debug)]
1463 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1464
1465 impl GetIamPolicy {
1466 pub(crate) fn new(
1467 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1468 ) -> Self {
1469 Self(RequestBuilder::new(stub))
1470 }
1471
1472 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1474 self.0.request = v.into();
1475 self
1476 }
1477
1478 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1480 self.0.options = v.into();
1481 self
1482 }
1483
1484 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1486 (*self.0.stub)
1487 .get_iam_policy(self.0.request, self.0.options)
1488 .await
1489 .map(gax::response::Response::into_body)
1490 }
1491
1492 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1496 self.0.request.resource = v.into();
1497 self
1498 }
1499
1500 pub fn set_options<T>(mut self, v: T) -> Self
1502 where
1503 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1504 {
1505 self.0.request.options = std::option::Option::Some(v.into());
1506 self
1507 }
1508
1509 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1511 where
1512 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1513 {
1514 self.0.request.options = v.map(|x| x.into());
1515 self
1516 }
1517 }
1518
1519 #[doc(hidden)]
1520 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1521 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1522 &mut self.0.options
1523 }
1524 }
1525
1526 #[derive(Clone, Debug)]
1544 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1545
1546 impl SetIamPolicy {
1547 pub(crate) fn new(
1548 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1549 ) -> Self {
1550 Self(RequestBuilder::new(stub))
1551 }
1552
1553 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1555 self.0.request = v.into();
1556 self
1557 }
1558
1559 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1561 self.0.options = v.into();
1562 self
1563 }
1564
1565 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1567 (*self.0.stub)
1568 .set_iam_policy(self.0.request, self.0.options)
1569 .await
1570 .map(gax::response::Response::into_body)
1571 }
1572
1573 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1577 self.0.request.resource = v.into();
1578 self
1579 }
1580
1581 pub fn set_policy<T>(mut self, v: T) -> Self
1585 where
1586 T: std::convert::Into<iam_v1::model::Policy>,
1587 {
1588 self.0.request.policy = std::option::Option::Some(v.into());
1589 self
1590 }
1591
1592 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1596 where
1597 T: std::convert::Into<iam_v1::model::Policy>,
1598 {
1599 self.0.request.policy = v.map(|x| x.into());
1600 self
1601 }
1602
1603 pub fn set_update_mask<T>(mut self, v: T) -> Self
1605 where
1606 T: std::convert::Into<wkt::FieldMask>,
1607 {
1608 self.0.request.update_mask = std::option::Option::Some(v.into());
1609 self
1610 }
1611
1612 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1614 where
1615 T: std::convert::Into<wkt::FieldMask>,
1616 {
1617 self.0.request.update_mask = v.map(|x| x.into());
1618 self
1619 }
1620 }
1621
1622 #[doc(hidden)]
1623 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1624 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1625 &mut self.0.options
1626 }
1627 }
1628
1629 #[derive(Clone, Debug)]
1647 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1648
1649 impl TestIamPermissions {
1650 pub(crate) fn new(
1651 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1652 ) -> Self {
1653 Self(RequestBuilder::new(stub))
1654 }
1655
1656 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1658 mut self,
1659 v: V,
1660 ) -> Self {
1661 self.0.request = v.into();
1662 self
1663 }
1664
1665 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1667 self.0.options = v.into();
1668 self
1669 }
1670
1671 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1673 (*self.0.stub)
1674 .test_iam_permissions(self.0.request, self.0.options)
1675 .await
1676 .map(gax::response::Response::into_body)
1677 }
1678
1679 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1683 self.0.request.resource = v.into();
1684 self
1685 }
1686
1687 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1691 where
1692 T: std::iter::IntoIterator<Item = V>,
1693 V: std::convert::Into<std::string::String>,
1694 {
1695 use std::iter::Iterator;
1696 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1697 self
1698 }
1699 }
1700
1701 #[doc(hidden)]
1702 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1703 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1704 &mut self.0.options
1705 }
1706 }
1707
1708 #[derive(Clone, Debug)]
1726 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1727
1728 impl GetOperation {
1729 pub(crate) fn new(
1730 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1731 ) -> Self {
1732 Self(RequestBuilder::new(stub))
1733 }
1734
1735 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1737 mut self,
1738 v: V,
1739 ) -> Self {
1740 self.0.request = v.into();
1741 self
1742 }
1743
1744 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1746 self.0.options = v.into();
1747 self
1748 }
1749
1750 pub async fn send(self) -> Result<longrunning::model::Operation> {
1752 (*self.0.stub)
1753 .get_operation(self.0.request, self.0.options)
1754 .await
1755 .map(gax::response::Response::into_body)
1756 }
1757
1758 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1760 self.0.request.name = v.into();
1761 self
1762 }
1763 }
1764
1765 #[doc(hidden)]
1766 impl gax::options::internal::RequestBuilder for GetOperation {
1767 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1768 &mut self.0.options
1769 }
1770 }
1771}
1772
1773pub mod projects {
1774 use crate::Result;
1775
1776 pub type ClientBuilder =
1790 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1791
1792 pub(crate) mod client {
1793 use super::super::super::client::Projects;
1794 pub struct Factory;
1795 impl gax::client_builder::internal::ClientFactory for Factory {
1796 type Client = Projects;
1797 type Credentials = gaxi::options::Credentials;
1798 async fn build(
1799 self,
1800 config: gaxi::options::ClientConfig,
1801 ) -> gax::client_builder::Result<Self::Client> {
1802 Self::Client::new(config).await
1803 }
1804 }
1805 }
1806
1807 #[derive(Clone, Debug)]
1809 pub(crate) struct RequestBuilder<R: std::default::Default> {
1810 stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>,
1811 request: R,
1812 options: gax::options::RequestOptions,
1813 }
1814
1815 impl<R> RequestBuilder<R>
1816 where
1817 R: std::default::Default,
1818 {
1819 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
1820 Self {
1821 stub,
1822 request: R::default(),
1823 options: gax::options::RequestOptions::default(),
1824 }
1825 }
1826 }
1827
1828 #[derive(Clone, Debug)]
1846 pub struct GetProject(RequestBuilder<crate::model::GetProjectRequest>);
1847
1848 impl GetProject {
1849 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
1850 Self(RequestBuilder::new(stub))
1851 }
1852
1853 pub fn with_request<V: Into<crate::model::GetProjectRequest>>(mut self, v: V) -> Self {
1855 self.0.request = v.into();
1856 self
1857 }
1858
1859 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1861 self.0.options = v.into();
1862 self
1863 }
1864
1865 pub async fn send(self) -> Result<crate::model::Project> {
1867 (*self.0.stub)
1868 .get_project(self.0.request, self.0.options)
1869 .await
1870 .map(gax::response::Response::into_body)
1871 }
1872
1873 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1877 self.0.request.name = v.into();
1878 self
1879 }
1880 }
1881
1882 #[doc(hidden)]
1883 impl gax::options::internal::RequestBuilder for GetProject {
1884 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1885 &mut self.0.options
1886 }
1887 }
1888
1889 #[derive(Clone, Debug)]
1911 pub struct ListProjects(RequestBuilder<crate::model::ListProjectsRequest>);
1912
1913 impl ListProjects {
1914 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
1915 Self(RequestBuilder::new(stub))
1916 }
1917
1918 pub fn with_request<V: Into<crate::model::ListProjectsRequest>>(mut self, v: V) -> Self {
1920 self.0.request = v.into();
1921 self
1922 }
1923
1924 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1926 self.0.options = v.into();
1927 self
1928 }
1929
1930 pub async fn send(self) -> Result<crate::model::ListProjectsResponse> {
1932 (*self.0.stub)
1933 .list_projects(self.0.request, self.0.options)
1934 .await
1935 .map(gax::response::Response::into_body)
1936 }
1937
1938 pub fn by_page(
1940 self,
1941 ) -> impl gax::paginator::Paginator<crate::model::ListProjectsResponse, gax::error::Error>
1942 {
1943 use std::clone::Clone;
1944 let token = self.0.request.page_token.clone();
1945 let execute = move |token: String| {
1946 let mut builder = self.clone();
1947 builder.0.request = builder.0.request.set_page_token(token);
1948 builder.send()
1949 };
1950 gax::paginator::internal::new_paginator(token, execute)
1951 }
1952
1953 pub fn by_item(
1955 self,
1956 ) -> impl gax::paginator::ItemPaginator<crate::model::ListProjectsResponse, gax::error::Error>
1957 {
1958 use gax::paginator::Paginator;
1959 self.by_page().items()
1960 }
1961
1962 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1966 self.0.request.parent = v.into();
1967 self
1968 }
1969
1970 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1972 self.0.request.page_token = v.into();
1973 self
1974 }
1975
1976 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1978 self.0.request.page_size = v.into();
1979 self
1980 }
1981
1982 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1984 self.0.request.show_deleted = v.into();
1985 self
1986 }
1987 }
1988
1989 #[doc(hidden)]
1990 impl gax::options::internal::RequestBuilder for ListProjects {
1991 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1992 &mut self.0.options
1993 }
1994 }
1995
1996 #[derive(Clone, Debug)]
2018 pub struct SearchProjects(RequestBuilder<crate::model::SearchProjectsRequest>);
2019
2020 impl SearchProjects {
2021 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2022 Self(RequestBuilder::new(stub))
2023 }
2024
2025 pub fn with_request<V: Into<crate::model::SearchProjectsRequest>>(mut self, v: V) -> Self {
2027 self.0.request = v.into();
2028 self
2029 }
2030
2031 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2033 self.0.options = v.into();
2034 self
2035 }
2036
2037 pub async fn send(self) -> Result<crate::model::SearchProjectsResponse> {
2039 (*self.0.stub)
2040 .search_projects(self.0.request, self.0.options)
2041 .await
2042 .map(gax::response::Response::into_body)
2043 }
2044
2045 pub fn by_page(
2047 self,
2048 ) -> impl gax::paginator::Paginator<crate::model::SearchProjectsResponse, gax::error::Error>
2049 {
2050 use std::clone::Clone;
2051 let token = self.0.request.page_token.clone();
2052 let execute = move |token: String| {
2053 let mut builder = self.clone();
2054 builder.0.request = builder.0.request.set_page_token(token);
2055 builder.send()
2056 };
2057 gax::paginator::internal::new_paginator(token, execute)
2058 }
2059
2060 pub fn by_item(
2062 self,
2063 ) -> impl gax::paginator::ItemPaginator<crate::model::SearchProjectsResponse, gax::error::Error>
2064 {
2065 use gax::paginator::Paginator;
2066 self.by_page().items()
2067 }
2068
2069 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
2071 self.0.request.query = v.into();
2072 self
2073 }
2074
2075 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2077 self.0.request.page_token = v.into();
2078 self
2079 }
2080
2081 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2083 self.0.request.page_size = v.into();
2084 self
2085 }
2086 }
2087
2088 #[doc(hidden)]
2089 impl gax::options::internal::RequestBuilder for SearchProjects {
2090 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2091 &mut self.0.options
2092 }
2093 }
2094
2095 #[derive(Clone, Debug)]
2114 pub struct CreateProject(RequestBuilder<crate::model::CreateProjectRequest>);
2115
2116 impl CreateProject {
2117 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2118 Self(RequestBuilder::new(stub))
2119 }
2120
2121 pub fn with_request<V: Into<crate::model::CreateProjectRequest>>(mut self, v: V) -> Self {
2123 self.0.request = v.into();
2124 self
2125 }
2126
2127 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2129 self.0.options = v.into();
2130 self
2131 }
2132
2133 pub async fn send(self) -> Result<longrunning::model::Operation> {
2140 (*self.0.stub)
2141 .create_project(self.0.request, self.0.options)
2142 .await
2143 .map(gax::response::Response::into_body)
2144 }
2145
2146 pub fn poller(
2148 self,
2149 ) -> impl lro::Poller<crate::model::Project, crate::model::CreateProjectMetadata> {
2150 type Operation = lro::internal::Operation<
2151 crate::model::Project,
2152 crate::model::CreateProjectMetadata,
2153 >;
2154 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2155 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2156
2157 let stub = self.0.stub.clone();
2158 let mut options = self.0.options.clone();
2159 options.set_retry_policy(gax::retry_policy::NeverRetry);
2160 let query = move |name| {
2161 let stub = stub.clone();
2162 let options = options.clone();
2163 async {
2164 let op = GetOperation::new(stub)
2165 .set_name(name)
2166 .with_options(options)
2167 .send()
2168 .await?;
2169 Ok(Operation::new(op))
2170 }
2171 };
2172
2173 let start = move || async {
2174 let op = self.send().await?;
2175 Ok(Operation::new(op))
2176 };
2177
2178 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2179 }
2180
2181 pub fn set_project<T>(mut self, v: T) -> Self
2185 where
2186 T: std::convert::Into<crate::model::Project>,
2187 {
2188 self.0.request.project = std::option::Option::Some(v.into());
2189 self
2190 }
2191
2192 pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
2196 where
2197 T: std::convert::Into<crate::model::Project>,
2198 {
2199 self.0.request.project = v.map(|x| x.into());
2200 self
2201 }
2202 }
2203
2204 #[doc(hidden)]
2205 impl gax::options::internal::RequestBuilder for CreateProject {
2206 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2207 &mut self.0.options
2208 }
2209 }
2210
2211 #[derive(Clone, Debug)]
2230 pub struct UpdateProject(RequestBuilder<crate::model::UpdateProjectRequest>);
2231
2232 impl UpdateProject {
2233 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2234 Self(RequestBuilder::new(stub))
2235 }
2236
2237 pub fn with_request<V: Into<crate::model::UpdateProjectRequest>>(mut self, v: V) -> Self {
2239 self.0.request = v.into();
2240 self
2241 }
2242
2243 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2245 self.0.options = v.into();
2246 self
2247 }
2248
2249 pub async fn send(self) -> Result<longrunning::model::Operation> {
2256 (*self.0.stub)
2257 .update_project(self.0.request, self.0.options)
2258 .await
2259 .map(gax::response::Response::into_body)
2260 }
2261
2262 pub fn poller(
2264 self,
2265 ) -> impl lro::Poller<crate::model::Project, crate::model::UpdateProjectMetadata> {
2266 type Operation = lro::internal::Operation<
2267 crate::model::Project,
2268 crate::model::UpdateProjectMetadata,
2269 >;
2270 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2271 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2272
2273 let stub = self.0.stub.clone();
2274 let mut options = self.0.options.clone();
2275 options.set_retry_policy(gax::retry_policy::NeverRetry);
2276 let query = move |name| {
2277 let stub = stub.clone();
2278 let options = options.clone();
2279 async {
2280 let op = GetOperation::new(stub)
2281 .set_name(name)
2282 .with_options(options)
2283 .send()
2284 .await?;
2285 Ok(Operation::new(op))
2286 }
2287 };
2288
2289 let start = move || async {
2290 let op = self.send().await?;
2291 Ok(Operation::new(op))
2292 };
2293
2294 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2295 }
2296
2297 pub fn set_project<T>(mut self, v: T) -> Self
2301 where
2302 T: std::convert::Into<crate::model::Project>,
2303 {
2304 self.0.request.project = std::option::Option::Some(v.into());
2305 self
2306 }
2307
2308 pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
2312 where
2313 T: std::convert::Into<crate::model::Project>,
2314 {
2315 self.0.request.project = v.map(|x| x.into());
2316 self
2317 }
2318
2319 pub fn set_update_mask<T>(mut self, v: T) -> Self
2321 where
2322 T: std::convert::Into<wkt::FieldMask>,
2323 {
2324 self.0.request.update_mask = std::option::Option::Some(v.into());
2325 self
2326 }
2327
2328 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2330 where
2331 T: std::convert::Into<wkt::FieldMask>,
2332 {
2333 self.0.request.update_mask = v.map(|x| x.into());
2334 self
2335 }
2336 }
2337
2338 #[doc(hidden)]
2339 impl gax::options::internal::RequestBuilder for UpdateProject {
2340 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2341 &mut self.0.options
2342 }
2343 }
2344
2345 #[derive(Clone, Debug)]
2364 pub struct MoveProject(RequestBuilder<crate::model::MoveProjectRequest>);
2365
2366 impl MoveProject {
2367 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2368 Self(RequestBuilder::new(stub))
2369 }
2370
2371 pub fn with_request<V: Into<crate::model::MoveProjectRequest>>(mut self, v: V) -> Self {
2373 self.0.request = v.into();
2374 self
2375 }
2376
2377 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2379 self.0.options = v.into();
2380 self
2381 }
2382
2383 pub async fn send(self) -> Result<longrunning::model::Operation> {
2390 (*self.0.stub)
2391 .move_project(self.0.request, self.0.options)
2392 .await
2393 .map(gax::response::Response::into_body)
2394 }
2395
2396 pub fn poller(
2398 self,
2399 ) -> impl lro::Poller<crate::model::Project, crate::model::MoveProjectMetadata> {
2400 type Operation =
2401 lro::internal::Operation<crate::model::Project, crate::model::MoveProjectMetadata>;
2402 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2403 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2404
2405 let stub = self.0.stub.clone();
2406 let mut options = self.0.options.clone();
2407 options.set_retry_policy(gax::retry_policy::NeverRetry);
2408 let query = move |name| {
2409 let stub = stub.clone();
2410 let options = options.clone();
2411 async {
2412 let op = GetOperation::new(stub)
2413 .set_name(name)
2414 .with_options(options)
2415 .send()
2416 .await?;
2417 Ok(Operation::new(op))
2418 }
2419 };
2420
2421 let start = move || async {
2422 let op = self.send().await?;
2423 Ok(Operation::new(op))
2424 };
2425
2426 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2427 }
2428
2429 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2433 self.0.request.name = v.into();
2434 self
2435 }
2436
2437 pub fn set_destination_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2441 self.0.request.destination_parent = v.into();
2442 self
2443 }
2444 }
2445
2446 #[doc(hidden)]
2447 impl gax::options::internal::RequestBuilder for MoveProject {
2448 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2449 &mut self.0.options
2450 }
2451 }
2452
2453 #[derive(Clone, Debug)]
2472 pub struct DeleteProject(RequestBuilder<crate::model::DeleteProjectRequest>);
2473
2474 impl DeleteProject {
2475 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2476 Self(RequestBuilder::new(stub))
2477 }
2478
2479 pub fn with_request<V: Into<crate::model::DeleteProjectRequest>>(mut self, v: V) -> Self {
2481 self.0.request = v.into();
2482 self
2483 }
2484
2485 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2487 self.0.options = v.into();
2488 self
2489 }
2490
2491 pub async fn send(self) -> Result<longrunning::model::Operation> {
2498 (*self.0.stub)
2499 .delete_project(self.0.request, self.0.options)
2500 .await
2501 .map(gax::response::Response::into_body)
2502 }
2503
2504 pub fn poller(
2506 self,
2507 ) -> impl lro::Poller<crate::model::Project, crate::model::DeleteProjectMetadata> {
2508 type Operation = lro::internal::Operation<
2509 crate::model::Project,
2510 crate::model::DeleteProjectMetadata,
2511 >;
2512 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2513 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2514
2515 let stub = self.0.stub.clone();
2516 let mut options = self.0.options.clone();
2517 options.set_retry_policy(gax::retry_policy::NeverRetry);
2518 let query = move |name| {
2519 let stub = stub.clone();
2520 let options = options.clone();
2521 async {
2522 let op = GetOperation::new(stub)
2523 .set_name(name)
2524 .with_options(options)
2525 .send()
2526 .await?;
2527 Ok(Operation::new(op))
2528 }
2529 };
2530
2531 let start = move || async {
2532 let op = self.send().await?;
2533 Ok(Operation::new(op))
2534 };
2535
2536 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2537 }
2538
2539 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2543 self.0.request.name = v.into();
2544 self
2545 }
2546 }
2547
2548 #[doc(hidden)]
2549 impl gax::options::internal::RequestBuilder for DeleteProject {
2550 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2551 &mut self.0.options
2552 }
2553 }
2554
2555 #[derive(Clone, Debug)]
2574 pub struct UndeleteProject(RequestBuilder<crate::model::UndeleteProjectRequest>);
2575
2576 impl UndeleteProject {
2577 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2578 Self(RequestBuilder::new(stub))
2579 }
2580
2581 pub fn with_request<V: Into<crate::model::UndeleteProjectRequest>>(mut self, v: V) -> Self {
2583 self.0.request = v.into();
2584 self
2585 }
2586
2587 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2589 self.0.options = v.into();
2590 self
2591 }
2592
2593 pub async fn send(self) -> Result<longrunning::model::Operation> {
2600 (*self.0.stub)
2601 .undelete_project(self.0.request, self.0.options)
2602 .await
2603 .map(gax::response::Response::into_body)
2604 }
2605
2606 pub fn poller(
2608 self,
2609 ) -> impl lro::Poller<crate::model::Project, crate::model::UndeleteProjectMetadata>
2610 {
2611 type Operation = lro::internal::Operation<
2612 crate::model::Project,
2613 crate::model::UndeleteProjectMetadata,
2614 >;
2615 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2616 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2617
2618 let stub = self.0.stub.clone();
2619 let mut options = self.0.options.clone();
2620 options.set_retry_policy(gax::retry_policy::NeverRetry);
2621 let query = move |name| {
2622 let stub = stub.clone();
2623 let options = options.clone();
2624 async {
2625 let op = GetOperation::new(stub)
2626 .set_name(name)
2627 .with_options(options)
2628 .send()
2629 .await?;
2630 Ok(Operation::new(op))
2631 }
2632 };
2633
2634 let start = move || async {
2635 let op = self.send().await?;
2636 Ok(Operation::new(op))
2637 };
2638
2639 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2640 }
2641
2642 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2646 self.0.request.name = v.into();
2647 self
2648 }
2649 }
2650
2651 #[doc(hidden)]
2652 impl gax::options::internal::RequestBuilder for UndeleteProject {
2653 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2654 &mut self.0.options
2655 }
2656 }
2657
2658 #[derive(Clone, Debug)]
2676 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2677
2678 impl GetIamPolicy {
2679 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2680 Self(RequestBuilder::new(stub))
2681 }
2682
2683 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2685 self.0.request = v.into();
2686 self
2687 }
2688
2689 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2691 self.0.options = v.into();
2692 self
2693 }
2694
2695 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2697 (*self.0.stub)
2698 .get_iam_policy(self.0.request, self.0.options)
2699 .await
2700 .map(gax::response::Response::into_body)
2701 }
2702
2703 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2707 self.0.request.resource = v.into();
2708 self
2709 }
2710
2711 pub fn set_options<T>(mut self, v: T) -> Self
2713 where
2714 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2715 {
2716 self.0.request.options = std::option::Option::Some(v.into());
2717 self
2718 }
2719
2720 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2722 where
2723 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2724 {
2725 self.0.request.options = v.map(|x| x.into());
2726 self
2727 }
2728 }
2729
2730 #[doc(hidden)]
2731 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2732 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2733 &mut self.0.options
2734 }
2735 }
2736
2737 #[derive(Clone, Debug)]
2755 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2756
2757 impl SetIamPolicy {
2758 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2759 Self(RequestBuilder::new(stub))
2760 }
2761
2762 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2764 self.0.request = v.into();
2765 self
2766 }
2767
2768 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2770 self.0.options = v.into();
2771 self
2772 }
2773
2774 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2776 (*self.0.stub)
2777 .set_iam_policy(self.0.request, self.0.options)
2778 .await
2779 .map(gax::response::Response::into_body)
2780 }
2781
2782 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2786 self.0.request.resource = v.into();
2787 self
2788 }
2789
2790 pub fn set_policy<T>(mut self, v: T) -> Self
2794 where
2795 T: std::convert::Into<iam_v1::model::Policy>,
2796 {
2797 self.0.request.policy = std::option::Option::Some(v.into());
2798 self
2799 }
2800
2801 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2805 where
2806 T: std::convert::Into<iam_v1::model::Policy>,
2807 {
2808 self.0.request.policy = v.map(|x| x.into());
2809 self
2810 }
2811
2812 pub fn set_update_mask<T>(mut self, v: T) -> Self
2814 where
2815 T: std::convert::Into<wkt::FieldMask>,
2816 {
2817 self.0.request.update_mask = std::option::Option::Some(v.into());
2818 self
2819 }
2820
2821 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2823 where
2824 T: std::convert::Into<wkt::FieldMask>,
2825 {
2826 self.0.request.update_mask = v.map(|x| x.into());
2827 self
2828 }
2829 }
2830
2831 #[doc(hidden)]
2832 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2833 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2834 &mut self.0.options
2835 }
2836 }
2837
2838 #[derive(Clone, Debug)]
2856 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2857
2858 impl TestIamPermissions {
2859 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2860 Self(RequestBuilder::new(stub))
2861 }
2862
2863 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2865 mut self,
2866 v: V,
2867 ) -> Self {
2868 self.0.request = v.into();
2869 self
2870 }
2871
2872 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2874 self.0.options = v.into();
2875 self
2876 }
2877
2878 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2880 (*self.0.stub)
2881 .test_iam_permissions(self.0.request, self.0.options)
2882 .await
2883 .map(gax::response::Response::into_body)
2884 }
2885
2886 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2890 self.0.request.resource = v.into();
2891 self
2892 }
2893
2894 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2898 where
2899 T: std::iter::IntoIterator<Item = V>,
2900 V: std::convert::Into<std::string::String>,
2901 {
2902 use std::iter::Iterator;
2903 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2904 self
2905 }
2906 }
2907
2908 #[doc(hidden)]
2909 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2910 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2911 &mut self.0.options
2912 }
2913 }
2914
2915 #[derive(Clone, Debug)]
2933 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2934
2935 impl GetOperation {
2936 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2937 Self(RequestBuilder::new(stub))
2938 }
2939
2940 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2942 mut self,
2943 v: V,
2944 ) -> Self {
2945 self.0.request = v.into();
2946 self
2947 }
2948
2949 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2951 self.0.options = v.into();
2952 self
2953 }
2954
2955 pub async fn send(self) -> Result<longrunning::model::Operation> {
2957 (*self.0.stub)
2958 .get_operation(self.0.request, self.0.options)
2959 .await
2960 .map(gax::response::Response::into_body)
2961 }
2962
2963 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2965 self.0.request.name = v.into();
2966 self
2967 }
2968 }
2969
2970 #[doc(hidden)]
2971 impl gax::options::internal::RequestBuilder for GetOperation {
2972 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2973 &mut self.0.options
2974 }
2975 }
2976}
2977
2978pub mod tag_bindings {
2979 use crate::Result;
2980
2981 pub type ClientBuilder =
2995 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2996
2997 pub(crate) mod client {
2998 use super::super::super::client::TagBindings;
2999 pub struct Factory;
3000 impl gax::client_builder::internal::ClientFactory for Factory {
3001 type Client = TagBindings;
3002 type Credentials = gaxi::options::Credentials;
3003 async fn build(
3004 self,
3005 config: gaxi::options::ClientConfig,
3006 ) -> gax::client_builder::Result<Self::Client> {
3007 Self::Client::new(config).await
3008 }
3009 }
3010 }
3011
3012 #[derive(Clone, Debug)]
3014 pub(crate) struct RequestBuilder<R: std::default::Default> {
3015 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3016 request: R,
3017 options: gax::options::RequestOptions,
3018 }
3019
3020 impl<R> RequestBuilder<R>
3021 where
3022 R: std::default::Default,
3023 {
3024 pub(crate) fn new(
3025 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3026 ) -> Self {
3027 Self {
3028 stub,
3029 request: R::default(),
3030 options: gax::options::RequestOptions::default(),
3031 }
3032 }
3033 }
3034
3035 #[derive(Clone, Debug)]
3057 pub struct ListTagBindings(RequestBuilder<crate::model::ListTagBindingsRequest>);
3058
3059 impl ListTagBindings {
3060 pub(crate) fn new(
3061 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3062 ) -> Self {
3063 Self(RequestBuilder::new(stub))
3064 }
3065
3066 pub fn with_request<V: Into<crate::model::ListTagBindingsRequest>>(mut self, v: V) -> Self {
3068 self.0.request = v.into();
3069 self
3070 }
3071
3072 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3074 self.0.options = v.into();
3075 self
3076 }
3077
3078 pub async fn send(self) -> Result<crate::model::ListTagBindingsResponse> {
3080 (*self.0.stub)
3081 .list_tag_bindings(self.0.request, self.0.options)
3082 .await
3083 .map(gax::response::Response::into_body)
3084 }
3085
3086 pub fn by_page(
3088 self,
3089 ) -> impl gax::paginator::Paginator<crate::model::ListTagBindingsResponse, gax::error::Error>
3090 {
3091 use std::clone::Clone;
3092 let token = self.0.request.page_token.clone();
3093 let execute = move |token: String| {
3094 let mut builder = self.clone();
3095 builder.0.request = builder.0.request.set_page_token(token);
3096 builder.send()
3097 };
3098 gax::paginator::internal::new_paginator(token, execute)
3099 }
3100
3101 pub fn by_item(
3103 self,
3104 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTagBindingsResponse, gax::error::Error>
3105 {
3106 use gax::paginator::Paginator;
3107 self.by_page().items()
3108 }
3109
3110 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3114 self.0.request.parent = v.into();
3115 self
3116 }
3117
3118 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3120 self.0.request.page_size = v.into();
3121 self
3122 }
3123
3124 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3126 self.0.request.page_token = v.into();
3127 self
3128 }
3129 }
3130
3131 #[doc(hidden)]
3132 impl gax::options::internal::RequestBuilder for ListTagBindings {
3133 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3134 &mut self.0.options
3135 }
3136 }
3137
3138 #[derive(Clone, Debug)]
3157 pub struct CreateTagBinding(RequestBuilder<crate::model::CreateTagBindingRequest>);
3158
3159 impl CreateTagBinding {
3160 pub(crate) fn new(
3161 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3162 ) -> Self {
3163 Self(RequestBuilder::new(stub))
3164 }
3165
3166 pub fn with_request<V: Into<crate::model::CreateTagBindingRequest>>(
3168 mut self,
3169 v: V,
3170 ) -> Self {
3171 self.0.request = v.into();
3172 self
3173 }
3174
3175 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3177 self.0.options = v.into();
3178 self
3179 }
3180
3181 pub async fn send(self) -> Result<longrunning::model::Operation> {
3188 (*self.0.stub)
3189 .create_tag_binding(self.0.request, self.0.options)
3190 .await
3191 .map(gax::response::Response::into_body)
3192 }
3193
3194 pub fn poller(
3196 self,
3197 ) -> impl lro::Poller<crate::model::TagBinding, crate::model::CreateTagBindingMetadata>
3198 {
3199 type Operation = lro::internal::Operation<
3200 crate::model::TagBinding,
3201 crate::model::CreateTagBindingMetadata,
3202 >;
3203 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3204 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3205
3206 let stub = self.0.stub.clone();
3207 let mut options = self.0.options.clone();
3208 options.set_retry_policy(gax::retry_policy::NeverRetry);
3209 let query = move |name| {
3210 let stub = stub.clone();
3211 let options = options.clone();
3212 async {
3213 let op = GetOperation::new(stub)
3214 .set_name(name)
3215 .with_options(options)
3216 .send()
3217 .await?;
3218 Ok(Operation::new(op))
3219 }
3220 };
3221
3222 let start = move || async {
3223 let op = self.send().await?;
3224 Ok(Operation::new(op))
3225 };
3226
3227 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3228 }
3229
3230 pub fn set_tag_binding<T>(mut self, v: T) -> Self
3234 where
3235 T: std::convert::Into<crate::model::TagBinding>,
3236 {
3237 self.0.request.tag_binding = std::option::Option::Some(v.into());
3238 self
3239 }
3240
3241 pub fn set_or_clear_tag_binding<T>(mut self, v: std::option::Option<T>) -> Self
3245 where
3246 T: std::convert::Into<crate::model::TagBinding>,
3247 {
3248 self.0.request.tag_binding = v.map(|x| x.into());
3249 self
3250 }
3251
3252 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3254 self.0.request.validate_only = v.into();
3255 self
3256 }
3257 }
3258
3259 #[doc(hidden)]
3260 impl gax::options::internal::RequestBuilder for CreateTagBinding {
3261 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3262 &mut self.0.options
3263 }
3264 }
3265
3266 #[derive(Clone, Debug)]
3285 pub struct DeleteTagBinding(RequestBuilder<crate::model::DeleteTagBindingRequest>);
3286
3287 impl DeleteTagBinding {
3288 pub(crate) fn new(
3289 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3290 ) -> Self {
3291 Self(RequestBuilder::new(stub))
3292 }
3293
3294 pub fn with_request<V: Into<crate::model::DeleteTagBindingRequest>>(
3296 mut self,
3297 v: V,
3298 ) -> Self {
3299 self.0.request = v.into();
3300 self
3301 }
3302
3303 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3305 self.0.options = v.into();
3306 self
3307 }
3308
3309 pub async fn send(self) -> Result<longrunning::model::Operation> {
3316 (*self.0.stub)
3317 .delete_tag_binding(self.0.request, self.0.options)
3318 .await
3319 .map(gax::response::Response::into_body)
3320 }
3321
3322 pub fn poller(self) -> impl lro::Poller<(), crate::model::DeleteTagBindingMetadata> {
3324 type Operation =
3325 lro::internal::Operation<wkt::Empty, crate::model::DeleteTagBindingMetadata>;
3326 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3327 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3328
3329 let stub = self.0.stub.clone();
3330 let mut options = self.0.options.clone();
3331 options.set_retry_policy(gax::retry_policy::NeverRetry);
3332 let query = move |name| {
3333 let stub = stub.clone();
3334 let options = options.clone();
3335 async {
3336 let op = GetOperation::new(stub)
3337 .set_name(name)
3338 .with_options(options)
3339 .send()
3340 .await?;
3341 Ok(Operation::new(op))
3342 }
3343 };
3344
3345 let start = move || async {
3346 let op = self.send().await?;
3347 Ok(Operation::new(op))
3348 };
3349
3350 lro::internal::new_unit_response_poller(
3351 polling_error_policy,
3352 polling_backoff_policy,
3353 start,
3354 query,
3355 )
3356 }
3357
3358 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3362 self.0.request.name = v.into();
3363 self
3364 }
3365 }
3366
3367 #[doc(hidden)]
3368 impl gax::options::internal::RequestBuilder for DeleteTagBinding {
3369 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3370 &mut self.0.options
3371 }
3372 }
3373
3374 #[derive(Clone, Debug)]
3396 pub struct ListEffectiveTags(RequestBuilder<crate::model::ListEffectiveTagsRequest>);
3397
3398 impl ListEffectiveTags {
3399 pub(crate) fn new(
3400 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3401 ) -> Self {
3402 Self(RequestBuilder::new(stub))
3403 }
3404
3405 pub fn with_request<V: Into<crate::model::ListEffectiveTagsRequest>>(
3407 mut self,
3408 v: V,
3409 ) -> Self {
3410 self.0.request = v.into();
3411 self
3412 }
3413
3414 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3416 self.0.options = v.into();
3417 self
3418 }
3419
3420 pub async fn send(self) -> Result<crate::model::ListEffectiveTagsResponse> {
3422 (*self.0.stub)
3423 .list_effective_tags(self.0.request, self.0.options)
3424 .await
3425 .map(gax::response::Response::into_body)
3426 }
3427
3428 pub fn by_page(
3430 self,
3431 ) -> impl gax::paginator::Paginator<crate::model::ListEffectiveTagsResponse, gax::error::Error>
3432 {
3433 use std::clone::Clone;
3434 let token = self.0.request.page_token.clone();
3435 let execute = move |token: String| {
3436 let mut builder = self.clone();
3437 builder.0.request = builder.0.request.set_page_token(token);
3438 builder.send()
3439 };
3440 gax::paginator::internal::new_paginator(token, execute)
3441 }
3442
3443 pub fn by_item(
3445 self,
3446 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEffectiveTagsResponse, gax::error::Error>
3447 {
3448 use gax::paginator::Paginator;
3449 self.by_page().items()
3450 }
3451
3452 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3456 self.0.request.parent = v.into();
3457 self
3458 }
3459
3460 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3462 self.0.request.page_size = v.into();
3463 self
3464 }
3465
3466 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3468 self.0.request.page_token = v.into();
3469 self
3470 }
3471 }
3472
3473 #[doc(hidden)]
3474 impl gax::options::internal::RequestBuilder for ListEffectiveTags {
3475 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3476 &mut self.0.options
3477 }
3478 }
3479
3480 #[derive(Clone, Debug)]
3498 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3499
3500 impl GetOperation {
3501 pub(crate) fn new(
3502 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3503 ) -> Self {
3504 Self(RequestBuilder::new(stub))
3505 }
3506
3507 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3509 mut self,
3510 v: V,
3511 ) -> Self {
3512 self.0.request = v.into();
3513 self
3514 }
3515
3516 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3518 self.0.options = v.into();
3519 self
3520 }
3521
3522 pub async fn send(self) -> Result<longrunning::model::Operation> {
3524 (*self.0.stub)
3525 .get_operation(self.0.request, self.0.options)
3526 .await
3527 .map(gax::response::Response::into_body)
3528 }
3529
3530 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3532 self.0.request.name = v.into();
3533 self
3534 }
3535 }
3536
3537 #[doc(hidden)]
3538 impl gax::options::internal::RequestBuilder for GetOperation {
3539 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3540 &mut self.0.options
3541 }
3542 }
3543}
3544
3545pub mod tag_holds {
3546 use crate::Result;
3547
3548 pub type ClientBuilder =
3562 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3563
3564 pub(crate) mod client {
3565 use super::super::super::client::TagHolds;
3566 pub struct Factory;
3567 impl gax::client_builder::internal::ClientFactory for Factory {
3568 type Client = TagHolds;
3569 type Credentials = gaxi::options::Credentials;
3570 async fn build(
3571 self,
3572 config: gaxi::options::ClientConfig,
3573 ) -> gax::client_builder::Result<Self::Client> {
3574 Self::Client::new(config).await
3575 }
3576 }
3577 }
3578
3579 #[derive(Clone, Debug)]
3581 pub(crate) struct RequestBuilder<R: std::default::Default> {
3582 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>,
3583 request: R,
3584 options: gax::options::RequestOptions,
3585 }
3586
3587 impl<R> RequestBuilder<R>
3588 where
3589 R: std::default::Default,
3590 {
3591 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3592 Self {
3593 stub,
3594 request: R::default(),
3595 options: gax::options::RequestOptions::default(),
3596 }
3597 }
3598 }
3599
3600 #[derive(Clone, Debug)]
3619 pub struct CreateTagHold(RequestBuilder<crate::model::CreateTagHoldRequest>);
3620
3621 impl CreateTagHold {
3622 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3623 Self(RequestBuilder::new(stub))
3624 }
3625
3626 pub fn with_request<V: Into<crate::model::CreateTagHoldRequest>>(mut self, v: V) -> Self {
3628 self.0.request = v.into();
3629 self
3630 }
3631
3632 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3634 self.0.options = v.into();
3635 self
3636 }
3637
3638 pub async fn send(self) -> Result<longrunning::model::Operation> {
3645 (*self.0.stub)
3646 .create_tag_hold(self.0.request, self.0.options)
3647 .await
3648 .map(gax::response::Response::into_body)
3649 }
3650
3651 pub fn poller(
3653 self,
3654 ) -> impl lro::Poller<crate::model::TagHold, crate::model::CreateTagHoldMetadata> {
3655 type Operation = lro::internal::Operation<
3656 crate::model::TagHold,
3657 crate::model::CreateTagHoldMetadata,
3658 >;
3659 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3660 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3661
3662 let stub = self.0.stub.clone();
3663 let mut options = self.0.options.clone();
3664 options.set_retry_policy(gax::retry_policy::NeverRetry);
3665 let query = move |name| {
3666 let stub = stub.clone();
3667 let options = options.clone();
3668 async {
3669 let op = GetOperation::new(stub)
3670 .set_name(name)
3671 .with_options(options)
3672 .send()
3673 .await?;
3674 Ok(Operation::new(op))
3675 }
3676 };
3677
3678 let start = move || async {
3679 let op = self.send().await?;
3680 Ok(Operation::new(op))
3681 };
3682
3683 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3684 }
3685
3686 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3690 self.0.request.parent = v.into();
3691 self
3692 }
3693
3694 pub fn set_tag_hold<T>(mut self, v: T) -> Self
3698 where
3699 T: std::convert::Into<crate::model::TagHold>,
3700 {
3701 self.0.request.tag_hold = std::option::Option::Some(v.into());
3702 self
3703 }
3704
3705 pub fn set_or_clear_tag_hold<T>(mut self, v: std::option::Option<T>) -> Self
3709 where
3710 T: std::convert::Into<crate::model::TagHold>,
3711 {
3712 self.0.request.tag_hold = v.map(|x| x.into());
3713 self
3714 }
3715
3716 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3718 self.0.request.validate_only = v.into();
3719 self
3720 }
3721 }
3722
3723 #[doc(hidden)]
3724 impl gax::options::internal::RequestBuilder for CreateTagHold {
3725 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3726 &mut self.0.options
3727 }
3728 }
3729
3730 #[derive(Clone, Debug)]
3749 pub struct DeleteTagHold(RequestBuilder<crate::model::DeleteTagHoldRequest>);
3750
3751 impl DeleteTagHold {
3752 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3753 Self(RequestBuilder::new(stub))
3754 }
3755
3756 pub fn with_request<V: Into<crate::model::DeleteTagHoldRequest>>(mut self, v: V) -> Self {
3758 self.0.request = v.into();
3759 self
3760 }
3761
3762 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3764 self.0.options = v.into();
3765 self
3766 }
3767
3768 pub async fn send(self) -> Result<longrunning::model::Operation> {
3775 (*self.0.stub)
3776 .delete_tag_hold(self.0.request, self.0.options)
3777 .await
3778 .map(gax::response::Response::into_body)
3779 }
3780
3781 pub fn poller(self) -> impl lro::Poller<(), crate::model::DeleteTagHoldMetadata> {
3783 type Operation =
3784 lro::internal::Operation<wkt::Empty, crate::model::DeleteTagHoldMetadata>;
3785 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3786 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3787
3788 let stub = self.0.stub.clone();
3789 let mut options = self.0.options.clone();
3790 options.set_retry_policy(gax::retry_policy::NeverRetry);
3791 let query = move |name| {
3792 let stub = stub.clone();
3793 let options = options.clone();
3794 async {
3795 let op = GetOperation::new(stub)
3796 .set_name(name)
3797 .with_options(options)
3798 .send()
3799 .await?;
3800 Ok(Operation::new(op))
3801 }
3802 };
3803
3804 let start = move || async {
3805 let op = self.send().await?;
3806 Ok(Operation::new(op))
3807 };
3808
3809 lro::internal::new_unit_response_poller(
3810 polling_error_policy,
3811 polling_backoff_policy,
3812 start,
3813 query,
3814 )
3815 }
3816
3817 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3821 self.0.request.name = v.into();
3822 self
3823 }
3824
3825 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3827 self.0.request.validate_only = v.into();
3828 self
3829 }
3830 }
3831
3832 #[doc(hidden)]
3833 impl gax::options::internal::RequestBuilder for DeleteTagHold {
3834 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3835 &mut self.0.options
3836 }
3837 }
3838
3839 #[derive(Clone, Debug)]
3861 pub struct ListTagHolds(RequestBuilder<crate::model::ListTagHoldsRequest>);
3862
3863 impl ListTagHolds {
3864 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3865 Self(RequestBuilder::new(stub))
3866 }
3867
3868 pub fn with_request<V: Into<crate::model::ListTagHoldsRequest>>(mut self, v: V) -> Self {
3870 self.0.request = v.into();
3871 self
3872 }
3873
3874 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3876 self.0.options = v.into();
3877 self
3878 }
3879
3880 pub async fn send(self) -> Result<crate::model::ListTagHoldsResponse> {
3882 (*self.0.stub)
3883 .list_tag_holds(self.0.request, self.0.options)
3884 .await
3885 .map(gax::response::Response::into_body)
3886 }
3887
3888 pub fn by_page(
3890 self,
3891 ) -> impl gax::paginator::Paginator<crate::model::ListTagHoldsResponse, gax::error::Error>
3892 {
3893 use std::clone::Clone;
3894 let token = self.0.request.page_token.clone();
3895 let execute = move |token: String| {
3896 let mut builder = self.clone();
3897 builder.0.request = builder.0.request.set_page_token(token);
3898 builder.send()
3899 };
3900 gax::paginator::internal::new_paginator(token, execute)
3901 }
3902
3903 pub fn by_item(
3905 self,
3906 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTagHoldsResponse, gax::error::Error>
3907 {
3908 use gax::paginator::Paginator;
3909 self.by_page().items()
3910 }
3911
3912 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3916 self.0.request.parent = v.into();
3917 self
3918 }
3919
3920 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3922 self.0.request.page_size = v.into();
3923 self
3924 }
3925
3926 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3928 self.0.request.page_token = v.into();
3929 self
3930 }
3931
3932 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3934 self.0.request.filter = v.into();
3935 self
3936 }
3937 }
3938
3939 #[doc(hidden)]
3940 impl gax::options::internal::RequestBuilder for ListTagHolds {
3941 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3942 &mut self.0.options
3943 }
3944 }
3945
3946 #[derive(Clone, Debug)]
3964 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3965
3966 impl GetOperation {
3967 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3968 Self(RequestBuilder::new(stub))
3969 }
3970
3971 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3973 mut self,
3974 v: V,
3975 ) -> Self {
3976 self.0.request = v.into();
3977 self
3978 }
3979
3980 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3982 self.0.options = v.into();
3983 self
3984 }
3985
3986 pub async fn send(self) -> Result<longrunning::model::Operation> {
3988 (*self.0.stub)
3989 .get_operation(self.0.request, self.0.options)
3990 .await
3991 .map(gax::response::Response::into_body)
3992 }
3993
3994 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3996 self.0.request.name = v.into();
3997 self
3998 }
3999 }
4000
4001 #[doc(hidden)]
4002 impl gax::options::internal::RequestBuilder for GetOperation {
4003 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4004 &mut self.0.options
4005 }
4006 }
4007}
4008
4009pub mod tag_keys {
4010 use crate::Result;
4011
4012 pub type ClientBuilder =
4026 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4027
4028 pub(crate) mod client {
4029 use super::super::super::client::TagKeys;
4030 pub struct Factory;
4031 impl gax::client_builder::internal::ClientFactory for Factory {
4032 type Client = TagKeys;
4033 type Credentials = gaxi::options::Credentials;
4034 async fn build(
4035 self,
4036 config: gaxi::options::ClientConfig,
4037 ) -> gax::client_builder::Result<Self::Client> {
4038 Self::Client::new(config).await
4039 }
4040 }
4041 }
4042
4043 #[derive(Clone, Debug)]
4045 pub(crate) struct RequestBuilder<R: std::default::Default> {
4046 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>,
4047 request: R,
4048 options: gax::options::RequestOptions,
4049 }
4050
4051 impl<R> RequestBuilder<R>
4052 where
4053 R: std::default::Default,
4054 {
4055 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4056 Self {
4057 stub,
4058 request: R::default(),
4059 options: gax::options::RequestOptions::default(),
4060 }
4061 }
4062 }
4063
4064 #[derive(Clone, Debug)]
4086 pub struct ListTagKeys(RequestBuilder<crate::model::ListTagKeysRequest>);
4087
4088 impl ListTagKeys {
4089 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4090 Self(RequestBuilder::new(stub))
4091 }
4092
4093 pub fn with_request<V: Into<crate::model::ListTagKeysRequest>>(mut self, v: V) -> Self {
4095 self.0.request = v.into();
4096 self
4097 }
4098
4099 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4101 self.0.options = v.into();
4102 self
4103 }
4104
4105 pub async fn send(self) -> Result<crate::model::ListTagKeysResponse> {
4107 (*self.0.stub)
4108 .list_tag_keys(self.0.request, self.0.options)
4109 .await
4110 .map(gax::response::Response::into_body)
4111 }
4112
4113 pub fn by_page(
4115 self,
4116 ) -> impl gax::paginator::Paginator<crate::model::ListTagKeysResponse, gax::error::Error>
4117 {
4118 use std::clone::Clone;
4119 let token = self.0.request.page_token.clone();
4120 let execute = move |token: String| {
4121 let mut builder = self.clone();
4122 builder.0.request = builder.0.request.set_page_token(token);
4123 builder.send()
4124 };
4125 gax::paginator::internal::new_paginator(token, execute)
4126 }
4127
4128 pub fn by_item(
4130 self,
4131 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTagKeysResponse, gax::error::Error>
4132 {
4133 use gax::paginator::Paginator;
4134 self.by_page().items()
4135 }
4136
4137 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4141 self.0.request.parent = v.into();
4142 self
4143 }
4144
4145 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4147 self.0.request.page_size = v.into();
4148 self
4149 }
4150
4151 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4153 self.0.request.page_token = v.into();
4154 self
4155 }
4156 }
4157
4158 #[doc(hidden)]
4159 impl gax::options::internal::RequestBuilder for ListTagKeys {
4160 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4161 &mut self.0.options
4162 }
4163 }
4164
4165 #[derive(Clone, Debug)]
4183 pub struct GetTagKey(RequestBuilder<crate::model::GetTagKeyRequest>);
4184
4185 impl GetTagKey {
4186 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4187 Self(RequestBuilder::new(stub))
4188 }
4189
4190 pub fn with_request<V: Into<crate::model::GetTagKeyRequest>>(mut self, v: V) -> Self {
4192 self.0.request = v.into();
4193 self
4194 }
4195
4196 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4198 self.0.options = v.into();
4199 self
4200 }
4201
4202 pub async fn send(self) -> Result<crate::model::TagKey> {
4204 (*self.0.stub)
4205 .get_tag_key(self.0.request, self.0.options)
4206 .await
4207 .map(gax::response::Response::into_body)
4208 }
4209
4210 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4214 self.0.request.name = v.into();
4215 self
4216 }
4217 }
4218
4219 #[doc(hidden)]
4220 impl gax::options::internal::RequestBuilder for GetTagKey {
4221 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4222 &mut self.0.options
4223 }
4224 }
4225
4226 #[derive(Clone, Debug)]
4244 pub struct GetNamespacedTagKey(RequestBuilder<crate::model::GetNamespacedTagKeyRequest>);
4245
4246 impl GetNamespacedTagKey {
4247 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4248 Self(RequestBuilder::new(stub))
4249 }
4250
4251 pub fn with_request<V: Into<crate::model::GetNamespacedTagKeyRequest>>(
4253 mut self,
4254 v: V,
4255 ) -> Self {
4256 self.0.request = v.into();
4257 self
4258 }
4259
4260 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4262 self.0.options = v.into();
4263 self
4264 }
4265
4266 pub async fn send(self) -> Result<crate::model::TagKey> {
4268 (*self.0.stub)
4269 .get_namespaced_tag_key(self.0.request, self.0.options)
4270 .await
4271 .map(gax::response::Response::into_body)
4272 }
4273
4274 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4278 self.0.request.name = v.into();
4279 self
4280 }
4281 }
4282
4283 #[doc(hidden)]
4284 impl gax::options::internal::RequestBuilder for GetNamespacedTagKey {
4285 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4286 &mut self.0.options
4287 }
4288 }
4289
4290 #[derive(Clone, Debug)]
4309 pub struct CreateTagKey(RequestBuilder<crate::model::CreateTagKeyRequest>);
4310
4311 impl CreateTagKey {
4312 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4313 Self(RequestBuilder::new(stub))
4314 }
4315
4316 pub fn with_request<V: Into<crate::model::CreateTagKeyRequest>>(mut self, v: V) -> Self {
4318 self.0.request = v.into();
4319 self
4320 }
4321
4322 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4324 self.0.options = v.into();
4325 self
4326 }
4327
4328 pub async fn send(self) -> Result<longrunning::model::Operation> {
4335 (*self.0.stub)
4336 .create_tag_key(self.0.request, self.0.options)
4337 .await
4338 .map(gax::response::Response::into_body)
4339 }
4340
4341 pub fn poller(
4343 self,
4344 ) -> impl lro::Poller<crate::model::TagKey, crate::model::CreateTagKeyMetadata> {
4345 type Operation =
4346 lro::internal::Operation<crate::model::TagKey, crate::model::CreateTagKeyMetadata>;
4347 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4348 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4349
4350 let stub = self.0.stub.clone();
4351 let mut options = self.0.options.clone();
4352 options.set_retry_policy(gax::retry_policy::NeverRetry);
4353 let query = move |name| {
4354 let stub = stub.clone();
4355 let options = options.clone();
4356 async {
4357 let op = GetOperation::new(stub)
4358 .set_name(name)
4359 .with_options(options)
4360 .send()
4361 .await?;
4362 Ok(Operation::new(op))
4363 }
4364 };
4365
4366 let start = move || async {
4367 let op = self.send().await?;
4368 Ok(Operation::new(op))
4369 };
4370
4371 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4372 }
4373
4374 pub fn set_tag_key<T>(mut self, v: T) -> Self
4378 where
4379 T: std::convert::Into<crate::model::TagKey>,
4380 {
4381 self.0.request.tag_key = std::option::Option::Some(v.into());
4382 self
4383 }
4384
4385 pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
4389 where
4390 T: std::convert::Into<crate::model::TagKey>,
4391 {
4392 self.0.request.tag_key = v.map(|x| x.into());
4393 self
4394 }
4395
4396 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4398 self.0.request.validate_only = v.into();
4399 self
4400 }
4401 }
4402
4403 #[doc(hidden)]
4404 impl gax::options::internal::RequestBuilder for CreateTagKey {
4405 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4406 &mut self.0.options
4407 }
4408 }
4409
4410 #[derive(Clone, Debug)]
4429 pub struct UpdateTagKey(RequestBuilder<crate::model::UpdateTagKeyRequest>);
4430
4431 impl UpdateTagKey {
4432 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4433 Self(RequestBuilder::new(stub))
4434 }
4435
4436 pub fn with_request<V: Into<crate::model::UpdateTagKeyRequest>>(mut self, v: V) -> Self {
4438 self.0.request = v.into();
4439 self
4440 }
4441
4442 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4444 self.0.options = v.into();
4445 self
4446 }
4447
4448 pub async fn send(self) -> Result<longrunning::model::Operation> {
4455 (*self.0.stub)
4456 .update_tag_key(self.0.request, self.0.options)
4457 .await
4458 .map(gax::response::Response::into_body)
4459 }
4460
4461 pub fn poller(
4463 self,
4464 ) -> impl lro::Poller<crate::model::TagKey, crate::model::UpdateTagKeyMetadata> {
4465 type Operation =
4466 lro::internal::Operation<crate::model::TagKey, crate::model::UpdateTagKeyMetadata>;
4467 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4468 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4469
4470 let stub = self.0.stub.clone();
4471 let mut options = self.0.options.clone();
4472 options.set_retry_policy(gax::retry_policy::NeverRetry);
4473 let query = move |name| {
4474 let stub = stub.clone();
4475 let options = options.clone();
4476 async {
4477 let op = GetOperation::new(stub)
4478 .set_name(name)
4479 .with_options(options)
4480 .send()
4481 .await?;
4482 Ok(Operation::new(op))
4483 }
4484 };
4485
4486 let start = move || async {
4487 let op = self.send().await?;
4488 Ok(Operation::new(op))
4489 };
4490
4491 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4492 }
4493
4494 pub fn set_tag_key<T>(mut self, v: T) -> Self
4498 where
4499 T: std::convert::Into<crate::model::TagKey>,
4500 {
4501 self.0.request.tag_key = std::option::Option::Some(v.into());
4502 self
4503 }
4504
4505 pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
4509 where
4510 T: std::convert::Into<crate::model::TagKey>,
4511 {
4512 self.0.request.tag_key = v.map(|x| x.into());
4513 self
4514 }
4515
4516 pub fn set_update_mask<T>(mut self, v: T) -> Self
4518 where
4519 T: std::convert::Into<wkt::FieldMask>,
4520 {
4521 self.0.request.update_mask = std::option::Option::Some(v.into());
4522 self
4523 }
4524
4525 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4527 where
4528 T: std::convert::Into<wkt::FieldMask>,
4529 {
4530 self.0.request.update_mask = v.map(|x| x.into());
4531 self
4532 }
4533
4534 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4536 self.0.request.validate_only = v.into();
4537 self
4538 }
4539 }
4540
4541 #[doc(hidden)]
4542 impl gax::options::internal::RequestBuilder for UpdateTagKey {
4543 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4544 &mut self.0.options
4545 }
4546 }
4547
4548 #[derive(Clone, Debug)]
4567 pub struct DeleteTagKey(RequestBuilder<crate::model::DeleteTagKeyRequest>);
4568
4569 impl DeleteTagKey {
4570 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4571 Self(RequestBuilder::new(stub))
4572 }
4573
4574 pub fn with_request<V: Into<crate::model::DeleteTagKeyRequest>>(mut self, v: V) -> Self {
4576 self.0.request = v.into();
4577 self
4578 }
4579
4580 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4582 self.0.options = v.into();
4583 self
4584 }
4585
4586 pub async fn send(self) -> Result<longrunning::model::Operation> {
4593 (*self.0.stub)
4594 .delete_tag_key(self.0.request, self.0.options)
4595 .await
4596 .map(gax::response::Response::into_body)
4597 }
4598
4599 pub fn poller(
4601 self,
4602 ) -> impl lro::Poller<crate::model::TagKey, crate::model::DeleteTagKeyMetadata> {
4603 type Operation =
4604 lro::internal::Operation<crate::model::TagKey, crate::model::DeleteTagKeyMetadata>;
4605 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4606 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4607
4608 let stub = self.0.stub.clone();
4609 let mut options = self.0.options.clone();
4610 options.set_retry_policy(gax::retry_policy::NeverRetry);
4611 let query = move |name| {
4612 let stub = stub.clone();
4613 let options = options.clone();
4614 async {
4615 let op = GetOperation::new(stub)
4616 .set_name(name)
4617 .with_options(options)
4618 .send()
4619 .await?;
4620 Ok(Operation::new(op))
4621 }
4622 };
4623
4624 let start = move || async {
4625 let op = self.send().await?;
4626 Ok(Operation::new(op))
4627 };
4628
4629 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4630 }
4631
4632 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4636 self.0.request.name = v.into();
4637 self
4638 }
4639
4640 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4642 self.0.request.validate_only = v.into();
4643 self
4644 }
4645
4646 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4648 self.0.request.etag = v.into();
4649 self
4650 }
4651 }
4652
4653 #[doc(hidden)]
4654 impl gax::options::internal::RequestBuilder for DeleteTagKey {
4655 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4656 &mut self.0.options
4657 }
4658 }
4659
4660 #[derive(Clone, Debug)]
4678 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4679
4680 impl GetIamPolicy {
4681 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4682 Self(RequestBuilder::new(stub))
4683 }
4684
4685 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4687 self.0.request = v.into();
4688 self
4689 }
4690
4691 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4693 self.0.options = v.into();
4694 self
4695 }
4696
4697 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4699 (*self.0.stub)
4700 .get_iam_policy(self.0.request, self.0.options)
4701 .await
4702 .map(gax::response::Response::into_body)
4703 }
4704
4705 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4709 self.0.request.resource = v.into();
4710 self
4711 }
4712
4713 pub fn set_options<T>(mut self, v: T) -> Self
4715 where
4716 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4717 {
4718 self.0.request.options = std::option::Option::Some(v.into());
4719 self
4720 }
4721
4722 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4724 where
4725 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4726 {
4727 self.0.request.options = v.map(|x| x.into());
4728 self
4729 }
4730 }
4731
4732 #[doc(hidden)]
4733 impl gax::options::internal::RequestBuilder for GetIamPolicy {
4734 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4735 &mut self.0.options
4736 }
4737 }
4738
4739 #[derive(Clone, Debug)]
4757 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4758
4759 impl SetIamPolicy {
4760 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4761 Self(RequestBuilder::new(stub))
4762 }
4763
4764 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4766 self.0.request = v.into();
4767 self
4768 }
4769
4770 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4772 self.0.options = v.into();
4773 self
4774 }
4775
4776 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4778 (*self.0.stub)
4779 .set_iam_policy(self.0.request, self.0.options)
4780 .await
4781 .map(gax::response::Response::into_body)
4782 }
4783
4784 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4788 self.0.request.resource = v.into();
4789 self
4790 }
4791
4792 pub fn set_policy<T>(mut self, v: T) -> Self
4796 where
4797 T: std::convert::Into<iam_v1::model::Policy>,
4798 {
4799 self.0.request.policy = std::option::Option::Some(v.into());
4800 self
4801 }
4802
4803 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4807 where
4808 T: std::convert::Into<iam_v1::model::Policy>,
4809 {
4810 self.0.request.policy = v.map(|x| x.into());
4811 self
4812 }
4813
4814 pub fn set_update_mask<T>(mut self, v: T) -> Self
4816 where
4817 T: std::convert::Into<wkt::FieldMask>,
4818 {
4819 self.0.request.update_mask = std::option::Option::Some(v.into());
4820 self
4821 }
4822
4823 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4825 where
4826 T: std::convert::Into<wkt::FieldMask>,
4827 {
4828 self.0.request.update_mask = v.map(|x| x.into());
4829 self
4830 }
4831 }
4832
4833 #[doc(hidden)]
4834 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4835 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4836 &mut self.0.options
4837 }
4838 }
4839
4840 #[derive(Clone, Debug)]
4858 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4859
4860 impl TestIamPermissions {
4861 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4862 Self(RequestBuilder::new(stub))
4863 }
4864
4865 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4867 mut self,
4868 v: V,
4869 ) -> Self {
4870 self.0.request = v.into();
4871 self
4872 }
4873
4874 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4876 self.0.options = v.into();
4877 self
4878 }
4879
4880 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4882 (*self.0.stub)
4883 .test_iam_permissions(self.0.request, self.0.options)
4884 .await
4885 .map(gax::response::Response::into_body)
4886 }
4887
4888 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4892 self.0.request.resource = v.into();
4893 self
4894 }
4895
4896 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4900 where
4901 T: std::iter::IntoIterator<Item = V>,
4902 V: std::convert::Into<std::string::String>,
4903 {
4904 use std::iter::Iterator;
4905 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4906 self
4907 }
4908 }
4909
4910 #[doc(hidden)]
4911 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4912 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4913 &mut self.0.options
4914 }
4915 }
4916
4917 #[derive(Clone, Debug)]
4935 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4936
4937 impl GetOperation {
4938 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4939 Self(RequestBuilder::new(stub))
4940 }
4941
4942 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4944 mut self,
4945 v: V,
4946 ) -> Self {
4947 self.0.request = v.into();
4948 self
4949 }
4950
4951 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4953 self.0.options = v.into();
4954 self
4955 }
4956
4957 pub async fn send(self) -> Result<longrunning::model::Operation> {
4959 (*self.0.stub)
4960 .get_operation(self.0.request, self.0.options)
4961 .await
4962 .map(gax::response::Response::into_body)
4963 }
4964
4965 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4967 self.0.request.name = v.into();
4968 self
4969 }
4970 }
4971
4972 #[doc(hidden)]
4973 impl gax::options::internal::RequestBuilder for GetOperation {
4974 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4975 &mut self.0.options
4976 }
4977 }
4978}
4979
4980pub mod tag_values {
4981 use crate::Result;
4982
4983 pub type ClientBuilder =
4997 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4998
4999 pub(crate) mod client {
5000 use super::super::super::client::TagValues;
5001 pub struct Factory;
5002 impl gax::client_builder::internal::ClientFactory for Factory {
5003 type Client = TagValues;
5004 type Credentials = gaxi::options::Credentials;
5005 async fn build(
5006 self,
5007 config: gaxi::options::ClientConfig,
5008 ) -> gax::client_builder::Result<Self::Client> {
5009 Self::Client::new(config).await
5010 }
5011 }
5012 }
5013
5014 #[derive(Clone, Debug)]
5016 pub(crate) struct RequestBuilder<R: std::default::Default> {
5017 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5018 request: R,
5019 options: gax::options::RequestOptions,
5020 }
5021
5022 impl<R> RequestBuilder<R>
5023 where
5024 R: std::default::Default,
5025 {
5026 pub(crate) fn new(
5027 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5028 ) -> Self {
5029 Self {
5030 stub,
5031 request: R::default(),
5032 options: gax::options::RequestOptions::default(),
5033 }
5034 }
5035 }
5036
5037 #[derive(Clone, Debug)]
5059 pub struct ListTagValues(RequestBuilder<crate::model::ListTagValuesRequest>);
5060
5061 impl ListTagValues {
5062 pub(crate) fn new(
5063 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5064 ) -> Self {
5065 Self(RequestBuilder::new(stub))
5066 }
5067
5068 pub fn with_request<V: Into<crate::model::ListTagValuesRequest>>(mut self, v: V) -> Self {
5070 self.0.request = v.into();
5071 self
5072 }
5073
5074 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5076 self.0.options = v.into();
5077 self
5078 }
5079
5080 pub async fn send(self) -> Result<crate::model::ListTagValuesResponse> {
5082 (*self.0.stub)
5083 .list_tag_values(self.0.request, self.0.options)
5084 .await
5085 .map(gax::response::Response::into_body)
5086 }
5087
5088 pub fn by_page(
5090 self,
5091 ) -> impl gax::paginator::Paginator<crate::model::ListTagValuesResponse, gax::error::Error>
5092 {
5093 use std::clone::Clone;
5094 let token = self.0.request.page_token.clone();
5095 let execute = move |token: String| {
5096 let mut builder = self.clone();
5097 builder.0.request = builder.0.request.set_page_token(token);
5098 builder.send()
5099 };
5100 gax::paginator::internal::new_paginator(token, execute)
5101 }
5102
5103 pub fn by_item(
5105 self,
5106 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTagValuesResponse, gax::error::Error>
5107 {
5108 use gax::paginator::Paginator;
5109 self.by_page().items()
5110 }
5111
5112 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5116 self.0.request.parent = v.into();
5117 self
5118 }
5119
5120 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5122 self.0.request.page_size = v.into();
5123 self
5124 }
5125
5126 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5128 self.0.request.page_token = v.into();
5129 self
5130 }
5131 }
5132
5133 #[doc(hidden)]
5134 impl gax::options::internal::RequestBuilder for ListTagValues {
5135 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5136 &mut self.0.options
5137 }
5138 }
5139
5140 #[derive(Clone, Debug)]
5158 pub struct GetTagValue(RequestBuilder<crate::model::GetTagValueRequest>);
5159
5160 impl GetTagValue {
5161 pub(crate) fn new(
5162 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5163 ) -> Self {
5164 Self(RequestBuilder::new(stub))
5165 }
5166
5167 pub fn with_request<V: Into<crate::model::GetTagValueRequest>>(mut self, v: V) -> Self {
5169 self.0.request = v.into();
5170 self
5171 }
5172
5173 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5175 self.0.options = v.into();
5176 self
5177 }
5178
5179 pub async fn send(self) -> Result<crate::model::TagValue> {
5181 (*self.0.stub)
5182 .get_tag_value(self.0.request, self.0.options)
5183 .await
5184 .map(gax::response::Response::into_body)
5185 }
5186
5187 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5191 self.0.request.name = v.into();
5192 self
5193 }
5194 }
5195
5196 #[doc(hidden)]
5197 impl gax::options::internal::RequestBuilder for GetTagValue {
5198 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5199 &mut self.0.options
5200 }
5201 }
5202
5203 #[derive(Clone, Debug)]
5221 pub struct GetNamespacedTagValue(RequestBuilder<crate::model::GetNamespacedTagValueRequest>);
5222
5223 impl GetNamespacedTagValue {
5224 pub(crate) fn new(
5225 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5226 ) -> Self {
5227 Self(RequestBuilder::new(stub))
5228 }
5229
5230 pub fn with_request<V: Into<crate::model::GetNamespacedTagValueRequest>>(
5232 mut self,
5233 v: V,
5234 ) -> Self {
5235 self.0.request = v.into();
5236 self
5237 }
5238
5239 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5241 self.0.options = v.into();
5242 self
5243 }
5244
5245 pub async fn send(self) -> Result<crate::model::TagValue> {
5247 (*self.0.stub)
5248 .get_namespaced_tag_value(self.0.request, self.0.options)
5249 .await
5250 .map(gax::response::Response::into_body)
5251 }
5252
5253 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5257 self.0.request.name = v.into();
5258 self
5259 }
5260 }
5261
5262 #[doc(hidden)]
5263 impl gax::options::internal::RequestBuilder for GetNamespacedTagValue {
5264 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5265 &mut self.0.options
5266 }
5267 }
5268
5269 #[derive(Clone, Debug)]
5288 pub struct CreateTagValue(RequestBuilder<crate::model::CreateTagValueRequest>);
5289
5290 impl CreateTagValue {
5291 pub(crate) fn new(
5292 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5293 ) -> Self {
5294 Self(RequestBuilder::new(stub))
5295 }
5296
5297 pub fn with_request<V: Into<crate::model::CreateTagValueRequest>>(mut self, v: V) -> Self {
5299 self.0.request = v.into();
5300 self
5301 }
5302
5303 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5305 self.0.options = v.into();
5306 self
5307 }
5308
5309 pub async fn send(self) -> Result<longrunning::model::Operation> {
5316 (*self.0.stub)
5317 .create_tag_value(self.0.request, self.0.options)
5318 .await
5319 .map(gax::response::Response::into_body)
5320 }
5321
5322 pub fn poller(
5324 self,
5325 ) -> impl lro::Poller<crate::model::TagValue, crate::model::CreateTagValueMetadata>
5326 {
5327 type Operation = lro::internal::Operation<
5328 crate::model::TagValue,
5329 crate::model::CreateTagValueMetadata,
5330 >;
5331 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5332 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5333
5334 let stub = self.0.stub.clone();
5335 let mut options = self.0.options.clone();
5336 options.set_retry_policy(gax::retry_policy::NeverRetry);
5337 let query = move |name| {
5338 let stub = stub.clone();
5339 let options = options.clone();
5340 async {
5341 let op = GetOperation::new(stub)
5342 .set_name(name)
5343 .with_options(options)
5344 .send()
5345 .await?;
5346 Ok(Operation::new(op))
5347 }
5348 };
5349
5350 let start = move || async {
5351 let op = self.send().await?;
5352 Ok(Operation::new(op))
5353 };
5354
5355 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5356 }
5357
5358 pub fn set_tag_value<T>(mut self, v: T) -> Self
5362 where
5363 T: std::convert::Into<crate::model::TagValue>,
5364 {
5365 self.0.request.tag_value = std::option::Option::Some(v.into());
5366 self
5367 }
5368
5369 pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
5373 where
5374 T: std::convert::Into<crate::model::TagValue>,
5375 {
5376 self.0.request.tag_value = v.map(|x| x.into());
5377 self
5378 }
5379
5380 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5382 self.0.request.validate_only = v.into();
5383 self
5384 }
5385 }
5386
5387 #[doc(hidden)]
5388 impl gax::options::internal::RequestBuilder for CreateTagValue {
5389 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5390 &mut self.0.options
5391 }
5392 }
5393
5394 #[derive(Clone, Debug)]
5413 pub struct UpdateTagValue(RequestBuilder<crate::model::UpdateTagValueRequest>);
5414
5415 impl UpdateTagValue {
5416 pub(crate) fn new(
5417 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5418 ) -> Self {
5419 Self(RequestBuilder::new(stub))
5420 }
5421
5422 pub fn with_request<V: Into<crate::model::UpdateTagValueRequest>>(mut self, v: V) -> Self {
5424 self.0.request = v.into();
5425 self
5426 }
5427
5428 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5430 self.0.options = v.into();
5431 self
5432 }
5433
5434 pub async fn send(self) -> Result<longrunning::model::Operation> {
5441 (*self.0.stub)
5442 .update_tag_value(self.0.request, self.0.options)
5443 .await
5444 .map(gax::response::Response::into_body)
5445 }
5446
5447 pub fn poller(
5449 self,
5450 ) -> impl lro::Poller<crate::model::TagValue, crate::model::UpdateTagValueMetadata>
5451 {
5452 type Operation = lro::internal::Operation<
5453 crate::model::TagValue,
5454 crate::model::UpdateTagValueMetadata,
5455 >;
5456 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5457 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5458
5459 let stub = self.0.stub.clone();
5460 let mut options = self.0.options.clone();
5461 options.set_retry_policy(gax::retry_policy::NeverRetry);
5462 let query = move |name| {
5463 let stub = stub.clone();
5464 let options = options.clone();
5465 async {
5466 let op = GetOperation::new(stub)
5467 .set_name(name)
5468 .with_options(options)
5469 .send()
5470 .await?;
5471 Ok(Operation::new(op))
5472 }
5473 };
5474
5475 let start = move || async {
5476 let op = self.send().await?;
5477 Ok(Operation::new(op))
5478 };
5479
5480 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5481 }
5482
5483 pub fn set_tag_value<T>(mut self, v: T) -> Self
5487 where
5488 T: std::convert::Into<crate::model::TagValue>,
5489 {
5490 self.0.request.tag_value = std::option::Option::Some(v.into());
5491 self
5492 }
5493
5494 pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
5498 where
5499 T: std::convert::Into<crate::model::TagValue>,
5500 {
5501 self.0.request.tag_value = v.map(|x| x.into());
5502 self
5503 }
5504
5505 pub fn set_update_mask<T>(mut self, v: T) -> Self
5507 where
5508 T: std::convert::Into<wkt::FieldMask>,
5509 {
5510 self.0.request.update_mask = std::option::Option::Some(v.into());
5511 self
5512 }
5513
5514 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5516 where
5517 T: std::convert::Into<wkt::FieldMask>,
5518 {
5519 self.0.request.update_mask = v.map(|x| x.into());
5520 self
5521 }
5522
5523 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5525 self.0.request.validate_only = v.into();
5526 self
5527 }
5528 }
5529
5530 #[doc(hidden)]
5531 impl gax::options::internal::RequestBuilder for UpdateTagValue {
5532 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5533 &mut self.0.options
5534 }
5535 }
5536
5537 #[derive(Clone, Debug)]
5556 pub struct DeleteTagValue(RequestBuilder<crate::model::DeleteTagValueRequest>);
5557
5558 impl DeleteTagValue {
5559 pub(crate) fn new(
5560 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5561 ) -> Self {
5562 Self(RequestBuilder::new(stub))
5563 }
5564
5565 pub fn with_request<V: Into<crate::model::DeleteTagValueRequest>>(mut self, v: V) -> Self {
5567 self.0.request = v.into();
5568 self
5569 }
5570
5571 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5573 self.0.options = v.into();
5574 self
5575 }
5576
5577 pub async fn send(self) -> Result<longrunning::model::Operation> {
5584 (*self.0.stub)
5585 .delete_tag_value(self.0.request, self.0.options)
5586 .await
5587 .map(gax::response::Response::into_body)
5588 }
5589
5590 pub fn poller(
5592 self,
5593 ) -> impl lro::Poller<crate::model::TagValue, crate::model::DeleteTagValueMetadata>
5594 {
5595 type Operation = lro::internal::Operation<
5596 crate::model::TagValue,
5597 crate::model::DeleteTagValueMetadata,
5598 >;
5599 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5600 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5601
5602 let stub = self.0.stub.clone();
5603 let mut options = self.0.options.clone();
5604 options.set_retry_policy(gax::retry_policy::NeverRetry);
5605 let query = move |name| {
5606 let stub = stub.clone();
5607 let options = options.clone();
5608 async {
5609 let op = GetOperation::new(stub)
5610 .set_name(name)
5611 .with_options(options)
5612 .send()
5613 .await?;
5614 Ok(Operation::new(op))
5615 }
5616 };
5617
5618 let start = move || async {
5619 let op = self.send().await?;
5620 Ok(Operation::new(op))
5621 };
5622
5623 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5624 }
5625
5626 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5630 self.0.request.name = v.into();
5631 self
5632 }
5633
5634 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5636 self.0.request.validate_only = v.into();
5637 self
5638 }
5639
5640 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
5642 self.0.request.etag = v.into();
5643 self
5644 }
5645 }
5646
5647 #[doc(hidden)]
5648 impl gax::options::internal::RequestBuilder for DeleteTagValue {
5649 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5650 &mut self.0.options
5651 }
5652 }
5653
5654 #[derive(Clone, Debug)]
5672 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5673
5674 impl GetIamPolicy {
5675 pub(crate) fn new(
5676 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5677 ) -> Self {
5678 Self(RequestBuilder::new(stub))
5679 }
5680
5681 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5683 self.0.request = v.into();
5684 self
5685 }
5686
5687 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5689 self.0.options = v.into();
5690 self
5691 }
5692
5693 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5695 (*self.0.stub)
5696 .get_iam_policy(self.0.request, self.0.options)
5697 .await
5698 .map(gax::response::Response::into_body)
5699 }
5700
5701 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5705 self.0.request.resource = v.into();
5706 self
5707 }
5708
5709 pub fn set_options<T>(mut self, v: T) -> Self
5711 where
5712 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5713 {
5714 self.0.request.options = std::option::Option::Some(v.into());
5715 self
5716 }
5717
5718 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5720 where
5721 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5722 {
5723 self.0.request.options = v.map(|x| x.into());
5724 self
5725 }
5726 }
5727
5728 #[doc(hidden)]
5729 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5730 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5731 &mut self.0.options
5732 }
5733 }
5734
5735 #[derive(Clone, Debug)]
5753 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5754
5755 impl SetIamPolicy {
5756 pub(crate) fn new(
5757 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5758 ) -> Self {
5759 Self(RequestBuilder::new(stub))
5760 }
5761
5762 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5764 self.0.request = v.into();
5765 self
5766 }
5767
5768 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5770 self.0.options = v.into();
5771 self
5772 }
5773
5774 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5776 (*self.0.stub)
5777 .set_iam_policy(self.0.request, self.0.options)
5778 .await
5779 .map(gax::response::Response::into_body)
5780 }
5781
5782 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5786 self.0.request.resource = v.into();
5787 self
5788 }
5789
5790 pub fn set_policy<T>(mut self, v: T) -> Self
5794 where
5795 T: std::convert::Into<iam_v1::model::Policy>,
5796 {
5797 self.0.request.policy = std::option::Option::Some(v.into());
5798 self
5799 }
5800
5801 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5805 where
5806 T: std::convert::Into<iam_v1::model::Policy>,
5807 {
5808 self.0.request.policy = v.map(|x| x.into());
5809 self
5810 }
5811
5812 pub fn set_update_mask<T>(mut self, v: T) -> Self
5814 where
5815 T: std::convert::Into<wkt::FieldMask>,
5816 {
5817 self.0.request.update_mask = std::option::Option::Some(v.into());
5818 self
5819 }
5820
5821 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5823 where
5824 T: std::convert::Into<wkt::FieldMask>,
5825 {
5826 self.0.request.update_mask = v.map(|x| x.into());
5827 self
5828 }
5829 }
5830
5831 #[doc(hidden)]
5832 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5833 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5834 &mut self.0.options
5835 }
5836 }
5837
5838 #[derive(Clone, Debug)]
5856 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5857
5858 impl TestIamPermissions {
5859 pub(crate) fn new(
5860 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5861 ) -> Self {
5862 Self(RequestBuilder::new(stub))
5863 }
5864
5865 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5867 mut self,
5868 v: V,
5869 ) -> Self {
5870 self.0.request = v.into();
5871 self
5872 }
5873
5874 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5876 self.0.options = v.into();
5877 self
5878 }
5879
5880 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5882 (*self.0.stub)
5883 .test_iam_permissions(self.0.request, self.0.options)
5884 .await
5885 .map(gax::response::Response::into_body)
5886 }
5887
5888 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5892 self.0.request.resource = v.into();
5893 self
5894 }
5895
5896 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5900 where
5901 T: std::iter::IntoIterator<Item = V>,
5902 V: std::convert::Into<std::string::String>,
5903 {
5904 use std::iter::Iterator;
5905 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5906 self
5907 }
5908 }
5909
5910 #[doc(hidden)]
5911 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5912 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5913 &mut self.0.options
5914 }
5915 }
5916
5917 #[derive(Clone, Debug)]
5935 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5936
5937 impl GetOperation {
5938 pub(crate) fn new(
5939 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5940 ) -> Self {
5941 Self(RequestBuilder::new(stub))
5942 }
5943
5944 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5946 mut self,
5947 v: V,
5948 ) -> Self {
5949 self.0.request = v.into();
5950 self
5951 }
5952
5953 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5955 self.0.options = v.into();
5956 self
5957 }
5958
5959 pub async fn send(self) -> Result<longrunning::model::Operation> {
5961 (*self.0.stub)
5962 .get_operation(self.0.request, self.0.options)
5963 .await
5964 .map(gax::response::Response::into_body)
5965 }
5966
5967 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5969 self.0.request.name = v.into();
5970 self
5971 }
5972 }
5973
5974 #[doc(hidden)]
5975 impl gax::options::internal::RequestBuilder for GetOperation {
5976 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5977 &mut self.0.options
5978 }
5979 }
5980}