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)]
89 pub struct GetFolder(RequestBuilder<crate::model::GetFolderRequest>);
90
91 impl GetFolder {
92 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
93 Self(RequestBuilder::new(stub))
94 }
95
96 pub fn with_request<V: Into<crate::model::GetFolderRequest>>(mut self, v: V) -> Self {
98 self.0.request = v.into();
99 self
100 }
101
102 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
104 self.0.options = v.into();
105 self
106 }
107
108 pub async fn send(self) -> Result<crate::model::Folder> {
110 (*self.0.stub)
111 .get_folder(self.0.request, self.0.options)
112 .await
113 .map(gax::response::Response::into_body)
114 }
115
116 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
120 self.0.request.name = v.into();
121 self
122 }
123 }
124
125 #[doc(hidden)]
126 impl gax::options::internal::RequestBuilder for GetFolder {
127 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
128 &mut self.0.options
129 }
130 }
131
132 #[derive(Clone, Debug)]
153 pub struct ListFolders(RequestBuilder<crate::model::ListFoldersRequest>);
154
155 impl ListFolders {
156 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
157 Self(RequestBuilder::new(stub))
158 }
159
160 pub fn with_request<V: Into<crate::model::ListFoldersRequest>>(mut self, v: V) -> Self {
162 self.0.request = v.into();
163 self
164 }
165
166 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
168 self.0.options = v.into();
169 self
170 }
171
172 pub async fn send(self) -> Result<crate::model::ListFoldersResponse> {
174 (*self.0.stub)
175 .list_folders(self.0.request, self.0.options)
176 .await
177 .map(gax::response::Response::into_body)
178 }
179
180 pub fn by_page(
182 self,
183 ) -> impl gax::paginator::Paginator<crate::model::ListFoldersResponse, gax::error::Error>
184 {
185 use std::clone::Clone;
186 let token = self.0.request.page_token.clone();
187 let execute = move |token: String| {
188 let mut builder = self.clone();
189 builder.0.request = builder.0.request.set_page_token(token);
190 builder.send()
191 };
192 gax::paginator::internal::new_paginator(token, execute)
193 }
194
195 pub fn by_item(
197 self,
198 ) -> impl gax::paginator::ItemPaginator<crate::model::ListFoldersResponse, gax::error::Error>
199 {
200 use gax::paginator::Paginator;
201 self.by_page().items()
202 }
203
204 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
208 self.0.request.parent = v.into();
209 self
210 }
211
212 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
214 self.0.request.page_size = v.into();
215 self
216 }
217
218 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
220 self.0.request.page_token = v.into();
221 self
222 }
223
224 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
226 self.0.request.show_deleted = v.into();
227 self
228 }
229 }
230
231 #[doc(hidden)]
232 impl gax::options::internal::RequestBuilder for ListFolders {
233 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
234 &mut self.0.options
235 }
236 }
237
238 #[derive(Clone, Debug)]
259 pub struct SearchFolders(RequestBuilder<crate::model::SearchFoldersRequest>);
260
261 impl SearchFolders {
262 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
263 Self(RequestBuilder::new(stub))
264 }
265
266 pub fn with_request<V: Into<crate::model::SearchFoldersRequest>>(mut self, v: V) -> Self {
268 self.0.request = v.into();
269 self
270 }
271
272 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
274 self.0.options = v.into();
275 self
276 }
277
278 pub async fn send(self) -> Result<crate::model::SearchFoldersResponse> {
280 (*self.0.stub)
281 .search_folders(self.0.request, self.0.options)
282 .await
283 .map(gax::response::Response::into_body)
284 }
285
286 pub fn by_page(
288 self,
289 ) -> impl gax::paginator::Paginator<crate::model::SearchFoldersResponse, gax::error::Error>
290 {
291 use std::clone::Clone;
292 let token = self.0.request.page_token.clone();
293 let execute = move |token: String| {
294 let mut builder = self.clone();
295 builder.0.request = builder.0.request.set_page_token(token);
296 builder.send()
297 };
298 gax::paginator::internal::new_paginator(token, execute)
299 }
300
301 pub fn by_item(
303 self,
304 ) -> impl gax::paginator::ItemPaginator<crate::model::SearchFoldersResponse, gax::error::Error>
305 {
306 use gax::paginator::Paginator;
307 self.by_page().items()
308 }
309
310 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
312 self.0.request.page_size = v.into();
313 self
314 }
315
316 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
318 self.0.request.page_token = v.into();
319 self
320 }
321
322 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
324 self.0.request.query = v.into();
325 self
326 }
327 }
328
329 #[doc(hidden)]
330 impl gax::options::internal::RequestBuilder for SearchFolders {
331 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
332 &mut self.0.options
333 }
334 }
335
336 #[derive(Clone, Debug)]
354 pub struct CreateFolder(RequestBuilder<crate::model::CreateFolderRequest>);
355
356 impl CreateFolder {
357 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
358 Self(RequestBuilder::new(stub))
359 }
360
361 pub fn with_request<V: Into<crate::model::CreateFolderRequest>>(mut self, v: V) -> Self {
363 self.0.request = v.into();
364 self
365 }
366
367 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
369 self.0.options = v.into();
370 self
371 }
372
373 pub async fn send(self) -> Result<longrunning::model::Operation> {
380 (*self.0.stub)
381 .create_folder(self.0.request, self.0.options)
382 .await
383 .map(gax::response::Response::into_body)
384 }
385
386 pub fn poller(
388 self,
389 ) -> impl lro::Poller<crate::model::Folder, crate::model::CreateFolderMetadata> {
390 type Operation =
391 lro::internal::Operation<crate::model::Folder, crate::model::CreateFolderMetadata>;
392 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
393 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
394
395 let stub = self.0.stub.clone();
396 let mut options = self.0.options.clone();
397 options.set_retry_policy(gax::retry_policy::NeverRetry);
398 let query = move |name| {
399 let stub = stub.clone();
400 let options = options.clone();
401 async {
402 let op = GetOperation::new(stub)
403 .set_name(name)
404 .with_options(options)
405 .send()
406 .await?;
407 Ok(Operation::new(op))
408 }
409 };
410
411 let start = move || async {
412 let op = self.send().await?;
413 Ok(Operation::new(op))
414 };
415
416 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
417 }
418
419 pub fn set_folder<T>(mut self, v: T) -> Self
423 where
424 T: std::convert::Into<crate::model::Folder>,
425 {
426 self.0.request.folder = std::option::Option::Some(v.into());
427 self
428 }
429
430 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
434 where
435 T: std::convert::Into<crate::model::Folder>,
436 {
437 self.0.request.folder = v.map(|x| x.into());
438 self
439 }
440 }
441
442 #[doc(hidden)]
443 impl gax::options::internal::RequestBuilder for CreateFolder {
444 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
445 &mut self.0.options
446 }
447 }
448
449 #[derive(Clone, Debug)]
467 pub struct UpdateFolder(RequestBuilder<crate::model::UpdateFolderRequest>);
468
469 impl UpdateFolder {
470 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
471 Self(RequestBuilder::new(stub))
472 }
473
474 pub fn with_request<V: Into<crate::model::UpdateFolderRequest>>(mut self, v: V) -> Self {
476 self.0.request = v.into();
477 self
478 }
479
480 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
482 self.0.options = v.into();
483 self
484 }
485
486 pub async fn send(self) -> Result<longrunning::model::Operation> {
493 (*self.0.stub)
494 .update_folder(self.0.request, self.0.options)
495 .await
496 .map(gax::response::Response::into_body)
497 }
498
499 pub fn poller(
501 self,
502 ) -> impl lro::Poller<crate::model::Folder, crate::model::UpdateFolderMetadata> {
503 type Operation =
504 lro::internal::Operation<crate::model::Folder, crate::model::UpdateFolderMetadata>;
505 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
506 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
507
508 let stub = self.0.stub.clone();
509 let mut options = self.0.options.clone();
510 options.set_retry_policy(gax::retry_policy::NeverRetry);
511 let query = move |name| {
512 let stub = stub.clone();
513 let options = options.clone();
514 async {
515 let op = GetOperation::new(stub)
516 .set_name(name)
517 .with_options(options)
518 .send()
519 .await?;
520 Ok(Operation::new(op))
521 }
522 };
523
524 let start = move || async {
525 let op = self.send().await?;
526 Ok(Operation::new(op))
527 };
528
529 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
530 }
531
532 pub fn set_folder<T>(mut self, v: T) -> Self
536 where
537 T: std::convert::Into<crate::model::Folder>,
538 {
539 self.0.request.folder = std::option::Option::Some(v.into());
540 self
541 }
542
543 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
547 where
548 T: std::convert::Into<crate::model::Folder>,
549 {
550 self.0.request.folder = v.map(|x| x.into());
551 self
552 }
553
554 pub fn set_update_mask<T>(mut self, v: T) -> Self
558 where
559 T: std::convert::Into<wkt::FieldMask>,
560 {
561 self.0.request.update_mask = std::option::Option::Some(v.into());
562 self
563 }
564
565 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
569 where
570 T: std::convert::Into<wkt::FieldMask>,
571 {
572 self.0.request.update_mask = v.map(|x| x.into());
573 self
574 }
575 }
576
577 #[doc(hidden)]
578 impl gax::options::internal::RequestBuilder for UpdateFolder {
579 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
580 &mut self.0.options
581 }
582 }
583
584 #[derive(Clone, Debug)]
602 pub struct MoveFolder(RequestBuilder<crate::model::MoveFolderRequest>);
603
604 impl MoveFolder {
605 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
606 Self(RequestBuilder::new(stub))
607 }
608
609 pub fn with_request<V: Into<crate::model::MoveFolderRequest>>(mut self, v: V) -> Self {
611 self.0.request = v.into();
612 self
613 }
614
615 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
617 self.0.options = v.into();
618 self
619 }
620
621 pub async fn send(self) -> Result<longrunning::model::Operation> {
628 (*self.0.stub)
629 .move_folder(self.0.request, self.0.options)
630 .await
631 .map(gax::response::Response::into_body)
632 }
633
634 pub fn poller(
636 self,
637 ) -> impl lro::Poller<crate::model::Folder, crate::model::MoveFolderMetadata> {
638 type Operation =
639 lro::internal::Operation<crate::model::Folder, crate::model::MoveFolderMetadata>;
640 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
641 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
642
643 let stub = self.0.stub.clone();
644 let mut options = self.0.options.clone();
645 options.set_retry_policy(gax::retry_policy::NeverRetry);
646 let query = move |name| {
647 let stub = stub.clone();
648 let options = options.clone();
649 async {
650 let op = GetOperation::new(stub)
651 .set_name(name)
652 .with_options(options)
653 .send()
654 .await?;
655 Ok(Operation::new(op))
656 }
657 };
658
659 let start = move || async {
660 let op = self.send().await?;
661 Ok(Operation::new(op))
662 };
663
664 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
665 }
666
667 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
671 self.0.request.name = v.into();
672 self
673 }
674
675 pub fn set_destination_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
679 self.0.request.destination_parent = v.into();
680 self
681 }
682 }
683
684 #[doc(hidden)]
685 impl gax::options::internal::RequestBuilder for MoveFolder {
686 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
687 &mut self.0.options
688 }
689 }
690
691 #[derive(Clone, Debug)]
709 pub struct DeleteFolder(RequestBuilder<crate::model::DeleteFolderRequest>);
710
711 impl DeleteFolder {
712 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
713 Self(RequestBuilder::new(stub))
714 }
715
716 pub fn with_request<V: Into<crate::model::DeleteFolderRequest>>(mut self, v: V) -> Self {
718 self.0.request = v.into();
719 self
720 }
721
722 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
724 self.0.options = v.into();
725 self
726 }
727
728 pub async fn send(self) -> Result<longrunning::model::Operation> {
735 (*self.0.stub)
736 .delete_folder(self.0.request, self.0.options)
737 .await
738 .map(gax::response::Response::into_body)
739 }
740
741 pub fn poller(
743 self,
744 ) -> impl lro::Poller<crate::model::Folder, crate::model::DeleteFolderMetadata> {
745 type Operation =
746 lro::internal::Operation<crate::model::Folder, crate::model::DeleteFolderMetadata>;
747 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
748 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
749
750 let stub = self.0.stub.clone();
751 let mut options = self.0.options.clone();
752 options.set_retry_policy(gax::retry_policy::NeverRetry);
753 let query = move |name| {
754 let stub = stub.clone();
755 let options = options.clone();
756 async {
757 let op = GetOperation::new(stub)
758 .set_name(name)
759 .with_options(options)
760 .send()
761 .await?;
762 Ok(Operation::new(op))
763 }
764 };
765
766 let start = move || async {
767 let op = self.send().await?;
768 Ok(Operation::new(op))
769 };
770
771 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
772 }
773
774 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
778 self.0.request.name = v.into();
779 self
780 }
781 }
782
783 #[doc(hidden)]
784 impl gax::options::internal::RequestBuilder for DeleteFolder {
785 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
786 &mut self.0.options
787 }
788 }
789
790 #[derive(Clone, Debug)]
808 pub struct UndeleteFolder(RequestBuilder<crate::model::UndeleteFolderRequest>);
809
810 impl UndeleteFolder {
811 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
812 Self(RequestBuilder::new(stub))
813 }
814
815 pub fn with_request<V: Into<crate::model::UndeleteFolderRequest>>(mut self, v: V) -> Self {
817 self.0.request = v.into();
818 self
819 }
820
821 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
823 self.0.options = v.into();
824 self
825 }
826
827 pub async fn send(self) -> Result<longrunning::model::Operation> {
834 (*self.0.stub)
835 .undelete_folder(self.0.request, self.0.options)
836 .await
837 .map(gax::response::Response::into_body)
838 }
839
840 pub fn poller(
842 self,
843 ) -> impl lro::Poller<crate::model::Folder, crate::model::UndeleteFolderMetadata> {
844 type Operation = lro::internal::Operation<
845 crate::model::Folder,
846 crate::model::UndeleteFolderMetadata,
847 >;
848 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
849 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
850
851 let stub = self.0.stub.clone();
852 let mut options = self.0.options.clone();
853 options.set_retry_policy(gax::retry_policy::NeverRetry);
854 let query = move |name| {
855 let stub = stub.clone();
856 let options = options.clone();
857 async {
858 let op = GetOperation::new(stub)
859 .set_name(name)
860 .with_options(options)
861 .send()
862 .await?;
863 Ok(Operation::new(op))
864 }
865 };
866
867 let start = move || async {
868 let op = self.send().await?;
869 Ok(Operation::new(op))
870 };
871
872 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
873 }
874
875 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
879 self.0.request.name = v.into();
880 self
881 }
882 }
883
884 #[doc(hidden)]
885 impl gax::options::internal::RequestBuilder for UndeleteFolder {
886 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
887 &mut self.0.options
888 }
889 }
890
891 #[derive(Clone, Debug)]
908 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
909
910 impl GetIamPolicy {
911 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
912 Self(RequestBuilder::new(stub))
913 }
914
915 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
917 self.0.request = v.into();
918 self
919 }
920
921 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
923 self.0.options = v.into();
924 self
925 }
926
927 pub async fn send(self) -> Result<iam_v1::model::Policy> {
929 (*self.0.stub)
930 .get_iam_policy(self.0.request, self.0.options)
931 .await
932 .map(gax::response::Response::into_body)
933 }
934
935 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
939 self.0.request.resource = v.into();
940 self
941 }
942
943 pub fn set_options<T>(mut self, v: T) -> Self
945 where
946 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
947 {
948 self.0.request.options = std::option::Option::Some(v.into());
949 self
950 }
951
952 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
954 where
955 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
956 {
957 self.0.request.options = v.map(|x| x.into());
958 self
959 }
960 }
961
962 #[doc(hidden)]
963 impl gax::options::internal::RequestBuilder for GetIamPolicy {
964 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
965 &mut self.0.options
966 }
967 }
968
969 #[derive(Clone, Debug)]
986 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
987
988 impl SetIamPolicy {
989 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
990 Self(RequestBuilder::new(stub))
991 }
992
993 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
995 self.0.request = v.into();
996 self
997 }
998
999 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1001 self.0.options = v.into();
1002 self
1003 }
1004
1005 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1007 (*self.0.stub)
1008 .set_iam_policy(self.0.request, self.0.options)
1009 .await
1010 .map(gax::response::Response::into_body)
1011 }
1012
1013 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1017 self.0.request.resource = v.into();
1018 self
1019 }
1020
1021 pub fn set_policy<T>(mut self, v: T) -> Self
1025 where
1026 T: std::convert::Into<iam_v1::model::Policy>,
1027 {
1028 self.0.request.policy = std::option::Option::Some(v.into());
1029 self
1030 }
1031
1032 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1036 where
1037 T: std::convert::Into<iam_v1::model::Policy>,
1038 {
1039 self.0.request.policy = v.map(|x| x.into());
1040 self
1041 }
1042
1043 pub fn set_update_mask<T>(mut self, v: T) -> Self
1045 where
1046 T: std::convert::Into<wkt::FieldMask>,
1047 {
1048 self.0.request.update_mask = std::option::Option::Some(v.into());
1049 self
1050 }
1051
1052 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1054 where
1055 T: std::convert::Into<wkt::FieldMask>,
1056 {
1057 self.0.request.update_mask = v.map(|x| x.into());
1058 self
1059 }
1060 }
1061
1062 #[doc(hidden)]
1063 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1064 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1065 &mut self.0.options
1066 }
1067 }
1068
1069 #[derive(Clone, Debug)]
1086 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1087
1088 impl TestIamPermissions {
1089 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
1090 Self(RequestBuilder::new(stub))
1091 }
1092
1093 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1095 mut self,
1096 v: V,
1097 ) -> Self {
1098 self.0.request = v.into();
1099 self
1100 }
1101
1102 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1104 self.0.options = v.into();
1105 self
1106 }
1107
1108 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1110 (*self.0.stub)
1111 .test_iam_permissions(self.0.request, self.0.options)
1112 .await
1113 .map(gax::response::Response::into_body)
1114 }
1115
1116 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1120 self.0.request.resource = v.into();
1121 self
1122 }
1123
1124 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1128 where
1129 T: std::iter::IntoIterator<Item = V>,
1130 V: std::convert::Into<std::string::String>,
1131 {
1132 use std::iter::Iterator;
1133 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1134 self
1135 }
1136 }
1137
1138 #[doc(hidden)]
1139 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1140 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1141 &mut self.0.options
1142 }
1143 }
1144
1145 #[derive(Clone, Debug)]
1162 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1163
1164 impl GetOperation {
1165 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
1166 Self(RequestBuilder::new(stub))
1167 }
1168
1169 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1171 mut self,
1172 v: V,
1173 ) -> Self {
1174 self.0.request = v.into();
1175 self
1176 }
1177
1178 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1180 self.0.options = v.into();
1181 self
1182 }
1183
1184 pub async fn send(self) -> Result<longrunning::model::Operation> {
1186 (*self.0.stub)
1187 .get_operation(self.0.request, self.0.options)
1188 .await
1189 .map(gax::response::Response::into_body)
1190 }
1191
1192 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1194 self.0.request.name = v.into();
1195 self
1196 }
1197 }
1198
1199 #[doc(hidden)]
1200 impl gax::options::internal::RequestBuilder for GetOperation {
1201 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1202 &mut self.0.options
1203 }
1204 }
1205}
1206
1207pub mod organizations {
1208 use crate::Result;
1209
1210 pub type ClientBuilder =
1224 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1225
1226 pub(crate) mod client {
1227 use super::super::super::client::Organizations;
1228 pub struct Factory;
1229 impl gax::client_builder::internal::ClientFactory for Factory {
1230 type Client = Organizations;
1231 type Credentials = gaxi::options::Credentials;
1232 async fn build(
1233 self,
1234 config: gaxi::options::ClientConfig,
1235 ) -> gax::client_builder::Result<Self::Client> {
1236 Self::Client::new(config).await
1237 }
1238 }
1239 }
1240
1241 #[derive(Clone, Debug)]
1243 pub(crate) struct RequestBuilder<R: std::default::Default> {
1244 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1245 request: R,
1246 options: gax::options::RequestOptions,
1247 }
1248
1249 impl<R> RequestBuilder<R>
1250 where
1251 R: std::default::Default,
1252 {
1253 pub(crate) fn new(
1254 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1255 ) -> Self {
1256 Self {
1257 stub,
1258 request: R::default(),
1259 options: gax::options::RequestOptions::default(),
1260 }
1261 }
1262 }
1263
1264 #[derive(Clone, Debug)]
1281 pub struct GetOrganization(RequestBuilder<crate::model::GetOrganizationRequest>);
1282
1283 impl GetOrganization {
1284 pub(crate) fn new(
1285 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1286 ) -> Self {
1287 Self(RequestBuilder::new(stub))
1288 }
1289
1290 pub fn with_request<V: Into<crate::model::GetOrganizationRequest>>(mut self, v: V) -> Self {
1292 self.0.request = v.into();
1293 self
1294 }
1295
1296 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1298 self.0.options = v.into();
1299 self
1300 }
1301
1302 pub async fn send(self) -> Result<crate::model::Organization> {
1304 (*self.0.stub)
1305 .get_organization(self.0.request, self.0.options)
1306 .await
1307 .map(gax::response::Response::into_body)
1308 }
1309
1310 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1314 self.0.request.name = v.into();
1315 self
1316 }
1317 }
1318
1319 #[doc(hidden)]
1320 impl gax::options::internal::RequestBuilder for GetOrganization {
1321 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1322 &mut self.0.options
1323 }
1324 }
1325
1326 #[derive(Clone, Debug)]
1347 pub struct SearchOrganizations(RequestBuilder<crate::model::SearchOrganizationsRequest>);
1348
1349 impl SearchOrganizations {
1350 pub(crate) fn new(
1351 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1352 ) -> Self {
1353 Self(RequestBuilder::new(stub))
1354 }
1355
1356 pub fn with_request<V: Into<crate::model::SearchOrganizationsRequest>>(
1358 mut self,
1359 v: V,
1360 ) -> Self {
1361 self.0.request = v.into();
1362 self
1363 }
1364
1365 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1367 self.0.options = v.into();
1368 self
1369 }
1370
1371 pub async fn send(self) -> Result<crate::model::SearchOrganizationsResponse> {
1373 (*self.0.stub)
1374 .search_organizations(self.0.request, self.0.options)
1375 .await
1376 .map(gax::response::Response::into_body)
1377 }
1378
1379 pub fn by_page(
1381 self,
1382 ) -> impl gax::paginator::Paginator<crate::model::SearchOrganizationsResponse, gax::error::Error>
1383 {
1384 use std::clone::Clone;
1385 let token = self.0.request.page_token.clone();
1386 let execute = move |token: String| {
1387 let mut builder = self.clone();
1388 builder.0.request = builder.0.request.set_page_token(token);
1389 builder.send()
1390 };
1391 gax::paginator::internal::new_paginator(token, execute)
1392 }
1393
1394 pub fn by_item(
1396 self,
1397 ) -> impl gax::paginator::ItemPaginator<
1398 crate::model::SearchOrganizationsResponse,
1399 gax::error::Error,
1400 > {
1401 use gax::paginator::Paginator;
1402 self.by_page().items()
1403 }
1404
1405 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1407 self.0.request.page_size = v.into();
1408 self
1409 }
1410
1411 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1413 self.0.request.page_token = v.into();
1414 self
1415 }
1416
1417 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1419 self.0.request.query = v.into();
1420 self
1421 }
1422 }
1423
1424 #[doc(hidden)]
1425 impl gax::options::internal::RequestBuilder for SearchOrganizations {
1426 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1427 &mut self.0.options
1428 }
1429 }
1430
1431 #[derive(Clone, Debug)]
1448 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1449
1450 impl GetIamPolicy {
1451 pub(crate) fn new(
1452 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1453 ) -> Self {
1454 Self(RequestBuilder::new(stub))
1455 }
1456
1457 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1459 self.0.request = v.into();
1460 self
1461 }
1462
1463 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1465 self.0.options = v.into();
1466 self
1467 }
1468
1469 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1471 (*self.0.stub)
1472 .get_iam_policy(self.0.request, self.0.options)
1473 .await
1474 .map(gax::response::Response::into_body)
1475 }
1476
1477 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1481 self.0.request.resource = v.into();
1482 self
1483 }
1484
1485 pub fn set_options<T>(mut self, v: T) -> Self
1487 where
1488 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1489 {
1490 self.0.request.options = std::option::Option::Some(v.into());
1491 self
1492 }
1493
1494 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1496 where
1497 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1498 {
1499 self.0.request.options = v.map(|x| x.into());
1500 self
1501 }
1502 }
1503
1504 #[doc(hidden)]
1505 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1506 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1507 &mut self.0.options
1508 }
1509 }
1510
1511 #[derive(Clone, Debug)]
1528 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1529
1530 impl SetIamPolicy {
1531 pub(crate) fn new(
1532 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1533 ) -> Self {
1534 Self(RequestBuilder::new(stub))
1535 }
1536
1537 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1539 self.0.request = v.into();
1540 self
1541 }
1542
1543 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1545 self.0.options = v.into();
1546 self
1547 }
1548
1549 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1551 (*self.0.stub)
1552 .set_iam_policy(self.0.request, self.0.options)
1553 .await
1554 .map(gax::response::Response::into_body)
1555 }
1556
1557 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1561 self.0.request.resource = v.into();
1562 self
1563 }
1564
1565 pub fn set_policy<T>(mut self, v: T) -> Self
1569 where
1570 T: std::convert::Into<iam_v1::model::Policy>,
1571 {
1572 self.0.request.policy = std::option::Option::Some(v.into());
1573 self
1574 }
1575
1576 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1580 where
1581 T: std::convert::Into<iam_v1::model::Policy>,
1582 {
1583 self.0.request.policy = v.map(|x| x.into());
1584 self
1585 }
1586
1587 pub fn set_update_mask<T>(mut self, v: T) -> Self
1589 where
1590 T: std::convert::Into<wkt::FieldMask>,
1591 {
1592 self.0.request.update_mask = std::option::Option::Some(v.into());
1593 self
1594 }
1595
1596 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1598 where
1599 T: std::convert::Into<wkt::FieldMask>,
1600 {
1601 self.0.request.update_mask = v.map(|x| x.into());
1602 self
1603 }
1604 }
1605
1606 #[doc(hidden)]
1607 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1608 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1609 &mut self.0.options
1610 }
1611 }
1612
1613 #[derive(Clone, Debug)]
1630 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1631
1632 impl TestIamPermissions {
1633 pub(crate) fn new(
1634 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1635 ) -> Self {
1636 Self(RequestBuilder::new(stub))
1637 }
1638
1639 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1641 mut self,
1642 v: V,
1643 ) -> Self {
1644 self.0.request = v.into();
1645 self
1646 }
1647
1648 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1650 self.0.options = v.into();
1651 self
1652 }
1653
1654 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1656 (*self.0.stub)
1657 .test_iam_permissions(self.0.request, self.0.options)
1658 .await
1659 .map(gax::response::Response::into_body)
1660 }
1661
1662 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1666 self.0.request.resource = v.into();
1667 self
1668 }
1669
1670 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1674 where
1675 T: std::iter::IntoIterator<Item = V>,
1676 V: std::convert::Into<std::string::String>,
1677 {
1678 use std::iter::Iterator;
1679 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1680 self
1681 }
1682 }
1683
1684 #[doc(hidden)]
1685 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1686 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1687 &mut self.0.options
1688 }
1689 }
1690
1691 #[derive(Clone, Debug)]
1708 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1709
1710 impl GetOperation {
1711 pub(crate) fn new(
1712 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1713 ) -> Self {
1714 Self(RequestBuilder::new(stub))
1715 }
1716
1717 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1719 mut self,
1720 v: V,
1721 ) -> Self {
1722 self.0.request = v.into();
1723 self
1724 }
1725
1726 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1728 self.0.options = v.into();
1729 self
1730 }
1731
1732 pub async fn send(self) -> Result<longrunning::model::Operation> {
1734 (*self.0.stub)
1735 .get_operation(self.0.request, self.0.options)
1736 .await
1737 .map(gax::response::Response::into_body)
1738 }
1739
1740 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1742 self.0.request.name = v.into();
1743 self
1744 }
1745 }
1746
1747 #[doc(hidden)]
1748 impl gax::options::internal::RequestBuilder for GetOperation {
1749 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1750 &mut self.0.options
1751 }
1752 }
1753}
1754
1755pub mod projects {
1756 use crate::Result;
1757
1758 pub type ClientBuilder =
1772 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1773
1774 pub(crate) mod client {
1775 use super::super::super::client::Projects;
1776 pub struct Factory;
1777 impl gax::client_builder::internal::ClientFactory for Factory {
1778 type Client = Projects;
1779 type Credentials = gaxi::options::Credentials;
1780 async fn build(
1781 self,
1782 config: gaxi::options::ClientConfig,
1783 ) -> gax::client_builder::Result<Self::Client> {
1784 Self::Client::new(config).await
1785 }
1786 }
1787 }
1788
1789 #[derive(Clone, Debug)]
1791 pub(crate) struct RequestBuilder<R: std::default::Default> {
1792 stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>,
1793 request: R,
1794 options: gax::options::RequestOptions,
1795 }
1796
1797 impl<R> RequestBuilder<R>
1798 where
1799 R: std::default::Default,
1800 {
1801 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
1802 Self {
1803 stub,
1804 request: R::default(),
1805 options: gax::options::RequestOptions::default(),
1806 }
1807 }
1808 }
1809
1810 #[derive(Clone, Debug)]
1827 pub struct GetProject(RequestBuilder<crate::model::GetProjectRequest>);
1828
1829 impl GetProject {
1830 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
1831 Self(RequestBuilder::new(stub))
1832 }
1833
1834 pub fn with_request<V: Into<crate::model::GetProjectRequest>>(mut self, v: V) -> Self {
1836 self.0.request = v.into();
1837 self
1838 }
1839
1840 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1842 self.0.options = v.into();
1843 self
1844 }
1845
1846 pub async fn send(self) -> Result<crate::model::Project> {
1848 (*self.0.stub)
1849 .get_project(self.0.request, self.0.options)
1850 .await
1851 .map(gax::response::Response::into_body)
1852 }
1853
1854 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1858 self.0.request.name = v.into();
1859 self
1860 }
1861 }
1862
1863 #[doc(hidden)]
1864 impl gax::options::internal::RequestBuilder for GetProject {
1865 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1866 &mut self.0.options
1867 }
1868 }
1869
1870 #[derive(Clone, Debug)]
1891 pub struct ListProjects(RequestBuilder<crate::model::ListProjectsRequest>);
1892
1893 impl ListProjects {
1894 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
1895 Self(RequestBuilder::new(stub))
1896 }
1897
1898 pub fn with_request<V: Into<crate::model::ListProjectsRequest>>(mut self, v: V) -> Self {
1900 self.0.request = v.into();
1901 self
1902 }
1903
1904 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1906 self.0.options = v.into();
1907 self
1908 }
1909
1910 pub async fn send(self) -> Result<crate::model::ListProjectsResponse> {
1912 (*self.0.stub)
1913 .list_projects(self.0.request, self.0.options)
1914 .await
1915 .map(gax::response::Response::into_body)
1916 }
1917
1918 pub fn by_page(
1920 self,
1921 ) -> impl gax::paginator::Paginator<crate::model::ListProjectsResponse, gax::error::Error>
1922 {
1923 use std::clone::Clone;
1924 let token = self.0.request.page_token.clone();
1925 let execute = move |token: String| {
1926 let mut builder = self.clone();
1927 builder.0.request = builder.0.request.set_page_token(token);
1928 builder.send()
1929 };
1930 gax::paginator::internal::new_paginator(token, execute)
1931 }
1932
1933 pub fn by_item(
1935 self,
1936 ) -> impl gax::paginator::ItemPaginator<crate::model::ListProjectsResponse, gax::error::Error>
1937 {
1938 use gax::paginator::Paginator;
1939 self.by_page().items()
1940 }
1941
1942 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1946 self.0.request.parent = v.into();
1947 self
1948 }
1949
1950 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1952 self.0.request.page_token = v.into();
1953 self
1954 }
1955
1956 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1958 self.0.request.page_size = v.into();
1959 self
1960 }
1961
1962 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1964 self.0.request.show_deleted = v.into();
1965 self
1966 }
1967 }
1968
1969 #[doc(hidden)]
1970 impl gax::options::internal::RequestBuilder for ListProjects {
1971 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1972 &mut self.0.options
1973 }
1974 }
1975
1976 #[derive(Clone, Debug)]
1997 pub struct SearchProjects(RequestBuilder<crate::model::SearchProjectsRequest>);
1998
1999 impl SearchProjects {
2000 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2001 Self(RequestBuilder::new(stub))
2002 }
2003
2004 pub fn with_request<V: Into<crate::model::SearchProjectsRequest>>(mut self, v: V) -> Self {
2006 self.0.request = v.into();
2007 self
2008 }
2009
2010 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2012 self.0.options = v.into();
2013 self
2014 }
2015
2016 pub async fn send(self) -> Result<crate::model::SearchProjectsResponse> {
2018 (*self.0.stub)
2019 .search_projects(self.0.request, self.0.options)
2020 .await
2021 .map(gax::response::Response::into_body)
2022 }
2023
2024 pub fn by_page(
2026 self,
2027 ) -> impl gax::paginator::Paginator<crate::model::SearchProjectsResponse, gax::error::Error>
2028 {
2029 use std::clone::Clone;
2030 let token = self.0.request.page_token.clone();
2031 let execute = move |token: String| {
2032 let mut builder = self.clone();
2033 builder.0.request = builder.0.request.set_page_token(token);
2034 builder.send()
2035 };
2036 gax::paginator::internal::new_paginator(token, execute)
2037 }
2038
2039 pub fn by_item(
2041 self,
2042 ) -> impl gax::paginator::ItemPaginator<crate::model::SearchProjectsResponse, gax::error::Error>
2043 {
2044 use gax::paginator::Paginator;
2045 self.by_page().items()
2046 }
2047
2048 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
2050 self.0.request.query = v.into();
2051 self
2052 }
2053
2054 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2056 self.0.request.page_token = v.into();
2057 self
2058 }
2059
2060 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2062 self.0.request.page_size = v.into();
2063 self
2064 }
2065 }
2066
2067 #[doc(hidden)]
2068 impl gax::options::internal::RequestBuilder for SearchProjects {
2069 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2070 &mut self.0.options
2071 }
2072 }
2073
2074 #[derive(Clone, Debug)]
2092 pub struct CreateProject(RequestBuilder<crate::model::CreateProjectRequest>);
2093
2094 impl CreateProject {
2095 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2096 Self(RequestBuilder::new(stub))
2097 }
2098
2099 pub fn with_request<V: Into<crate::model::CreateProjectRequest>>(mut self, v: V) -> Self {
2101 self.0.request = v.into();
2102 self
2103 }
2104
2105 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2107 self.0.options = v.into();
2108 self
2109 }
2110
2111 pub async fn send(self) -> Result<longrunning::model::Operation> {
2118 (*self.0.stub)
2119 .create_project(self.0.request, self.0.options)
2120 .await
2121 .map(gax::response::Response::into_body)
2122 }
2123
2124 pub fn poller(
2126 self,
2127 ) -> impl lro::Poller<crate::model::Project, crate::model::CreateProjectMetadata> {
2128 type Operation = lro::internal::Operation<
2129 crate::model::Project,
2130 crate::model::CreateProjectMetadata,
2131 >;
2132 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2133 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2134
2135 let stub = self.0.stub.clone();
2136 let mut options = self.0.options.clone();
2137 options.set_retry_policy(gax::retry_policy::NeverRetry);
2138 let query = move |name| {
2139 let stub = stub.clone();
2140 let options = options.clone();
2141 async {
2142 let op = GetOperation::new(stub)
2143 .set_name(name)
2144 .with_options(options)
2145 .send()
2146 .await?;
2147 Ok(Operation::new(op))
2148 }
2149 };
2150
2151 let start = move || async {
2152 let op = self.send().await?;
2153 Ok(Operation::new(op))
2154 };
2155
2156 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2157 }
2158
2159 pub fn set_project<T>(mut self, v: T) -> Self
2163 where
2164 T: std::convert::Into<crate::model::Project>,
2165 {
2166 self.0.request.project = std::option::Option::Some(v.into());
2167 self
2168 }
2169
2170 pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
2174 where
2175 T: std::convert::Into<crate::model::Project>,
2176 {
2177 self.0.request.project = v.map(|x| x.into());
2178 self
2179 }
2180 }
2181
2182 #[doc(hidden)]
2183 impl gax::options::internal::RequestBuilder for CreateProject {
2184 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2185 &mut self.0.options
2186 }
2187 }
2188
2189 #[derive(Clone, Debug)]
2207 pub struct UpdateProject(RequestBuilder<crate::model::UpdateProjectRequest>);
2208
2209 impl UpdateProject {
2210 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2211 Self(RequestBuilder::new(stub))
2212 }
2213
2214 pub fn with_request<V: Into<crate::model::UpdateProjectRequest>>(mut self, v: V) -> Self {
2216 self.0.request = v.into();
2217 self
2218 }
2219
2220 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2222 self.0.options = v.into();
2223 self
2224 }
2225
2226 pub async fn send(self) -> Result<longrunning::model::Operation> {
2233 (*self.0.stub)
2234 .update_project(self.0.request, self.0.options)
2235 .await
2236 .map(gax::response::Response::into_body)
2237 }
2238
2239 pub fn poller(
2241 self,
2242 ) -> impl lro::Poller<crate::model::Project, crate::model::UpdateProjectMetadata> {
2243 type Operation = lro::internal::Operation<
2244 crate::model::Project,
2245 crate::model::UpdateProjectMetadata,
2246 >;
2247 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2248 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2249
2250 let stub = self.0.stub.clone();
2251 let mut options = self.0.options.clone();
2252 options.set_retry_policy(gax::retry_policy::NeverRetry);
2253 let query = move |name| {
2254 let stub = stub.clone();
2255 let options = options.clone();
2256 async {
2257 let op = GetOperation::new(stub)
2258 .set_name(name)
2259 .with_options(options)
2260 .send()
2261 .await?;
2262 Ok(Operation::new(op))
2263 }
2264 };
2265
2266 let start = move || async {
2267 let op = self.send().await?;
2268 Ok(Operation::new(op))
2269 };
2270
2271 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2272 }
2273
2274 pub fn set_project<T>(mut self, v: T) -> Self
2278 where
2279 T: std::convert::Into<crate::model::Project>,
2280 {
2281 self.0.request.project = std::option::Option::Some(v.into());
2282 self
2283 }
2284
2285 pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
2289 where
2290 T: std::convert::Into<crate::model::Project>,
2291 {
2292 self.0.request.project = v.map(|x| x.into());
2293 self
2294 }
2295
2296 pub fn set_update_mask<T>(mut self, v: T) -> Self
2298 where
2299 T: std::convert::Into<wkt::FieldMask>,
2300 {
2301 self.0.request.update_mask = std::option::Option::Some(v.into());
2302 self
2303 }
2304
2305 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2307 where
2308 T: std::convert::Into<wkt::FieldMask>,
2309 {
2310 self.0.request.update_mask = v.map(|x| x.into());
2311 self
2312 }
2313 }
2314
2315 #[doc(hidden)]
2316 impl gax::options::internal::RequestBuilder for UpdateProject {
2317 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2318 &mut self.0.options
2319 }
2320 }
2321
2322 #[derive(Clone, Debug)]
2340 pub struct MoveProject(RequestBuilder<crate::model::MoveProjectRequest>);
2341
2342 impl MoveProject {
2343 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2344 Self(RequestBuilder::new(stub))
2345 }
2346
2347 pub fn with_request<V: Into<crate::model::MoveProjectRequest>>(mut self, v: V) -> Self {
2349 self.0.request = v.into();
2350 self
2351 }
2352
2353 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2355 self.0.options = v.into();
2356 self
2357 }
2358
2359 pub async fn send(self) -> Result<longrunning::model::Operation> {
2366 (*self.0.stub)
2367 .move_project(self.0.request, self.0.options)
2368 .await
2369 .map(gax::response::Response::into_body)
2370 }
2371
2372 pub fn poller(
2374 self,
2375 ) -> impl lro::Poller<crate::model::Project, crate::model::MoveProjectMetadata> {
2376 type Operation =
2377 lro::internal::Operation<crate::model::Project, crate::model::MoveProjectMetadata>;
2378 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2379 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2380
2381 let stub = self.0.stub.clone();
2382 let mut options = self.0.options.clone();
2383 options.set_retry_policy(gax::retry_policy::NeverRetry);
2384 let query = move |name| {
2385 let stub = stub.clone();
2386 let options = options.clone();
2387 async {
2388 let op = GetOperation::new(stub)
2389 .set_name(name)
2390 .with_options(options)
2391 .send()
2392 .await?;
2393 Ok(Operation::new(op))
2394 }
2395 };
2396
2397 let start = move || async {
2398 let op = self.send().await?;
2399 Ok(Operation::new(op))
2400 };
2401
2402 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2403 }
2404
2405 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2409 self.0.request.name = v.into();
2410 self
2411 }
2412
2413 pub fn set_destination_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2417 self.0.request.destination_parent = v.into();
2418 self
2419 }
2420 }
2421
2422 #[doc(hidden)]
2423 impl gax::options::internal::RequestBuilder for MoveProject {
2424 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2425 &mut self.0.options
2426 }
2427 }
2428
2429 #[derive(Clone, Debug)]
2447 pub struct DeleteProject(RequestBuilder<crate::model::DeleteProjectRequest>);
2448
2449 impl DeleteProject {
2450 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2451 Self(RequestBuilder::new(stub))
2452 }
2453
2454 pub fn with_request<V: Into<crate::model::DeleteProjectRequest>>(mut self, v: V) -> Self {
2456 self.0.request = v.into();
2457 self
2458 }
2459
2460 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2462 self.0.options = v.into();
2463 self
2464 }
2465
2466 pub async fn send(self) -> Result<longrunning::model::Operation> {
2473 (*self.0.stub)
2474 .delete_project(self.0.request, self.0.options)
2475 .await
2476 .map(gax::response::Response::into_body)
2477 }
2478
2479 pub fn poller(
2481 self,
2482 ) -> impl lro::Poller<crate::model::Project, crate::model::DeleteProjectMetadata> {
2483 type Operation = lro::internal::Operation<
2484 crate::model::Project,
2485 crate::model::DeleteProjectMetadata,
2486 >;
2487 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2488 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2489
2490 let stub = self.0.stub.clone();
2491 let mut options = self.0.options.clone();
2492 options.set_retry_policy(gax::retry_policy::NeverRetry);
2493 let query = move |name| {
2494 let stub = stub.clone();
2495 let options = options.clone();
2496 async {
2497 let op = GetOperation::new(stub)
2498 .set_name(name)
2499 .with_options(options)
2500 .send()
2501 .await?;
2502 Ok(Operation::new(op))
2503 }
2504 };
2505
2506 let start = move || async {
2507 let op = self.send().await?;
2508 Ok(Operation::new(op))
2509 };
2510
2511 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2512 }
2513
2514 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2518 self.0.request.name = v.into();
2519 self
2520 }
2521 }
2522
2523 #[doc(hidden)]
2524 impl gax::options::internal::RequestBuilder for DeleteProject {
2525 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2526 &mut self.0.options
2527 }
2528 }
2529
2530 #[derive(Clone, Debug)]
2548 pub struct UndeleteProject(RequestBuilder<crate::model::UndeleteProjectRequest>);
2549
2550 impl UndeleteProject {
2551 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2552 Self(RequestBuilder::new(stub))
2553 }
2554
2555 pub fn with_request<V: Into<crate::model::UndeleteProjectRequest>>(mut self, v: V) -> Self {
2557 self.0.request = v.into();
2558 self
2559 }
2560
2561 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2563 self.0.options = v.into();
2564 self
2565 }
2566
2567 pub async fn send(self) -> Result<longrunning::model::Operation> {
2574 (*self.0.stub)
2575 .undelete_project(self.0.request, self.0.options)
2576 .await
2577 .map(gax::response::Response::into_body)
2578 }
2579
2580 pub fn poller(
2582 self,
2583 ) -> impl lro::Poller<crate::model::Project, crate::model::UndeleteProjectMetadata>
2584 {
2585 type Operation = lro::internal::Operation<
2586 crate::model::Project,
2587 crate::model::UndeleteProjectMetadata,
2588 >;
2589 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2590 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2591
2592 let stub = self.0.stub.clone();
2593 let mut options = self.0.options.clone();
2594 options.set_retry_policy(gax::retry_policy::NeverRetry);
2595 let query = move |name| {
2596 let stub = stub.clone();
2597 let options = options.clone();
2598 async {
2599 let op = GetOperation::new(stub)
2600 .set_name(name)
2601 .with_options(options)
2602 .send()
2603 .await?;
2604 Ok(Operation::new(op))
2605 }
2606 };
2607
2608 let start = move || async {
2609 let op = self.send().await?;
2610 Ok(Operation::new(op))
2611 };
2612
2613 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2614 }
2615
2616 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2620 self.0.request.name = v.into();
2621 self
2622 }
2623 }
2624
2625 #[doc(hidden)]
2626 impl gax::options::internal::RequestBuilder for UndeleteProject {
2627 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2628 &mut self.0.options
2629 }
2630 }
2631
2632 #[derive(Clone, Debug)]
2649 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2650
2651 impl GetIamPolicy {
2652 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2653 Self(RequestBuilder::new(stub))
2654 }
2655
2656 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2658 self.0.request = v.into();
2659 self
2660 }
2661
2662 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2664 self.0.options = v.into();
2665 self
2666 }
2667
2668 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2670 (*self.0.stub)
2671 .get_iam_policy(self.0.request, self.0.options)
2672 .await
2673 .map(gax::response::Response::into_body)
2674 }
2675
2676 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2680 self.0.request.resource = v.into();
2681 self
2682 }
2683
2684 pub fn set_options<T>(mut self, v: T) -> Self
2686 where
2687 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2688 {
2689 self.0.request.options = std::option::Option::Some(v.into());
2690 self
2691 }
2692
2693 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2695 where
2696 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2697 {
2698 self.0.request.options = v.map(|x| x.into());
2699 self
2700 }
2701 }
2702
2703 #[doc(hidden)]
2704 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2705 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2706 &mut self.0.options
2707 }
2708 }
2709
2710 #[derive(Clone, Debug)]
2727 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2728
2729 impl SetIamPolicy {
2730 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2731 Self(RequestBuilder::new(stub))
2732 }
2733
2734 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2736 self.0.request = v.into();
2737 self
2738 }
2739
2740 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2742 self.0.options = v.into();
2743 self
2744 }
2745
2746 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2748 (*self.0.stub)
2749 .set_iam_policy(self.0.request, self.0.options)
2750 .await
2751 .map(gax::response::Response::into_body)
2752 }
2753
2754 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2758 self.0.request.resource = v.into();
2759 self
2760 }
2761
2762 pub fn set_policy<T>(mut self, v: T) -> Self
2766 where
2767 T: std::convert::Into<iam_v1::model::Policy>,
2768 {
2769 self.0.request.policy = std::option::Option::Some(v.into());
2770 self
2771 }
2772
2773 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2777 where
2778 T: std::convert::Into<iam_v1::model::Policy>,
2779 {
2780 self.0.request.policy = v.map(|x| x.into());
2781 self
2782 }
2783
2784 pub fn set_update_mask<T>(mut self, v: T) -> Self
2786 where
2787 T: std::convert::Into<wkt::FieldMask>,
2788 {
2789 self.0.request.update_mask = std::option::Option::Some(v.into());
2790 self
2791 }
2792
2793 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2795 where
2796 T: std::convert::Into<wkt::FieldMask>,
2797 {
2798 self.0.request.update_mask = v.map(|x| x.into());
2799 self
2800 }
2801 }
2802
2803 #[doc(hidden)]
2804 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2805 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2806 &mut self.0.options
2807 }
2808 }
2809
2810 #[derive(Clone, Debug)]
2827 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2828
2829 impl TestIamPermissions {
2830 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2831 Self(RequestBuilder::new(stub))
2832 }
2833
2834 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2836 mut self,
2837 v: V,
2838 ) -> Self {
2839 self.0.request = v.into();
2840 self
2841 }
2842
2843 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2845 self.0.options = v.into();
2846 self
2847 }
2848
2849 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2851 (*self.0.stub)
2852 .test_iam_permissions(self.0.request, self.0.options)
2853 .await
2854 .map(gax::response::Response::into_body)
2855 }
2856
2857 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2861 self.0.request.resource = v.into();
2862 self
2863 }
2864
2865 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2869 where
2870 T: std::iter::IntoIterator<Item = V>,
2871 V: std::convert::Into<std::string::String>,
2872 {
2873 use std::iter::Iterator;
2874 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2875 self
2876 }
2877 }
2878
2879 #[doc(hidden)]
2880 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2881 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2882 &mut self.0.options
2883 }
2884 }
2885
2886 #[derive(Clone, Debug)]
2903 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2904
2905 impl GetOperation {
2906 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2907 Self(RequestBuilder::new(stub))
2908 }
2909
2910 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2912 mut self,
2913 v: V,
2914 ) -> Self {
2915 self.0.request = v.into();
2916 self
2917 }
2918
2919 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2921 self.0.options = v.into();
2922 self
2923 }
2924
2925 pub async fn send(self) -> Result<longrunning::model::Operation> {
2927 (*self.0.stub)
2928 .get_operation(self.0.request, self.0.options)
2929 .await
2930 .map(gax::response::Response::into_body)
2931 }
2932
2933 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2935 self.0.request.name = v.into();
2936 self
2937 }
2938 }
2939
2940 #[doc(hidden)]
2941 impl gax::options::internal::RequestBuilder for GetOperation {
2942 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2943 &mut self.0.options
2944 }
2945 }
2946}
2947
2948pub mod tag_bindings {
2949 use crate::Result;
2950
2951 pub type ClientBuilder =
2965 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2966
2967 pub(crate) mod client {
2968 use super::super::super::client::TagBindings;
2969 pub struct Factory;
2970 impl gax::client_builder::internal::ClientFactory for Factory {
2971 type Client = TagBindings;
2972 type Credentials = gaxi::options::Credentials;
2973 async fn build(
2974 self,
2975 config: gaxi::options::ClientConfig,
2976 ) -> gax::client_builder::Result<Self::Client> {
2977 Self::Client::new(config).await
2978 }
2979 }
2980 }
2981
2982 #[derive(Clone, Debug)]
2984 pub(crate) struct RequestBuilder<R: std::default::Default> {
2985 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
2986 request: R,
2987 options: gax::options::RequestOptions,
2988 }
2989
2990 impl<R> RequestBuilder<R>
2991 where
2992 R: std::default::Default,
2993 {
2994 pub(crate) fn new(
2995 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
2996 ) -> Self {
2997 Self {
2998 stub,
2999 request: R::default(),
3000 options: gax::options::RequestOptions::default(),
3001 }
3002 }
3003 }
3004
3005 #[derive(Clone, Debug)]
3026 pub struct ListTagBindings(RequestBuilder<crate::model::ListTagBindingsRequest>);
3027
3028 impl ListTagBindings {
3029 pub(crate) fn new(
3030 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3031 ) -> Self {
3032 Self(RequestBuilder::new(stub))
3033 }
3034
3035 pub fn with_request<V: Into<crate::model::ListTagBindingsRequest>>(mut self, v: V) -> Self {
3037 self.0.request = v.into();
3038 self
3039 }
3040
3041 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3043 self.0.options = v.into();
3044 self
3045 }
3046
3047 pub async fn send(self) -> Result<crate::model::ListTagBindingsResponse> {
3049 (*self.0.stub)
3050 .list_tag_bindings(self.0.request, self.0.options)
3051 .await
3052 .map(gax::response::Response::into_body)
3053 }
3054
3055 pub fn by_page(
3057 self,
3058 ) -> impl gax::paginator::Paginator<crate::model::ListTagBindingsResponse, gax::error::Error>
3059 {
3060 use std::clone::Clone;
3061 let token = self.0.request.page_token.clone();
3062 let execute = move |token: String| {
3063 let mut builder = self.clone();
3064 builder.0.request = builder.0.request.set_page_token(token);
3065 builder.send()
3066 };
3067 gax::paginator::internal::new_paginator(token, execute)
3068 }
3069
3070 pub fn by_item(
3072 self,
3073 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTagBindingsResponse, gax::error::Error>
3074 {
3075 use gax::paginator::Paginator;
3076 self.by_page().items()
3077 }
3078
3079 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3083 self.0.request.parent = v.into();
3084 self
3085 }
3086
3087 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3089 self.0.request.page_size = v.into();
3090 self
3091 }
3092
3093 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3095 self.0.request.page_token = v.into();
3096 self
3097 }
3098 }
3099
3100 #[doc(hidden)]
3101 impl gax::options::internal::RequestBuilder for ListTagBindings {
3102 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3103 &mut self.0.options
3104 }
3105 }
3106
3107 #[derive(Clone, Debug)]
3125 pub struct CreateTagBinding(RequestBuilder<crate::model::CreateTagBindingRequest>);
3126
3127 impl CreateTagBinding {
3128 pub(crate) fn new(
3129 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3130 ) -> Self {
3131 Self(RequestBuilder::new(stub))
3132 }
3133
3134 pub fn with_request<V: Into<crate::model::CreateTagBindingRequest>>(
3136 mut self,
3137 v: V,
3138 ) -> Self {
3139 self.0.request = v.into();
3140 self
3141 }
3142
3143 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3145 self.0.options = v.into();
3146 self
3147 }
3148
3149 pub async fn send(self) -> Result<longrunning::model::Operation> {
3156 (*self.0.stub)
3157 .create_tag_binding(self.0.request, self.0.options)
3158 .await
3159 .map(gax::response::Response::into_body)
3160 }
3161
3162 pub fn poller(
3164 self,
3165 ) -> impl lro::Poller<crate::model::TagBinding, crate::model::CreateTagBindingMetadata>
3166 {
3167 type Operation = lro::internal::Operation<
3168 crate::model::TagBinding,
3169 crate::model::CreateTagBindingMetadata,
3170 >;
3171 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3172 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3173
3174 let stub = self.0.stub.clone();
3175 let mut options = self.0.options.clone();
3176 options.set_retry_policy(gax::retry_policy::NeverRetry);
3177 let query = move |name| {
3178 let stub = stub.clone();
3179 let options = options.clone();
3180 async {
3181 let op = GetOperation::new(stub)
3182 .set_name(name)
3183 .with_options(options)
3184 .send()
3185 .await?;
3186 Ok(Operation::new(op))
3187 }
3188 };
3189
3190 let start = move || async {
3191 let op = self.send().await?;
3192 Ok(Operation::new(op))
3193 };
3194
3195 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3196 }
3197
3198 pub fn set_tag_binding<T>(mut self, v: T) -> Self
3202 where
3203 T: std::convert::Into<crate::model::TagBinding>,
3204 {
3205 self.0.request.tag_binding = std::option::Option::Some(v.into());
3206 self
3207 }
3208
3209 pub fn set_or_clear_tag_binding<T>(mut self, v: std::option::Option<T>) -> Self
3213 where
3214 T: std::convert::Into<crate::model::TagBinding>,
3215 {
3216 self.0.request.tag_binding = v.map(|x| x.into());
3217 self
3218 }
3219
3220 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3222 self.0.request.validate_only = v.into();
3223 self
3224 }
3225 }
3226
3227 #[doc(hidden)]
3228 impl gax::options::internal::RequestBuilder for CreateTagBinding {
3229 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3230 &mut self.0.options
3231 }
3232 }
3233
3234 #[derive(Clone, Debug)]
3252 pub struct DeleteTagBinding(RequestBuilder<crate::model::DeleteTagBindingRequest>);
3253
3254 impl DeleteTagBinding {
3255 pub(crate) fn new(
3256 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3257 ) -> Self {
3258 Self(RequestBuilder::new(stub))
3259 }
3260
3261 pub fn with_request<V: Into<crate::model::DeleteTagBindingRequest>>(
3263 mut self,
3264 v: V,
3265 ) -> Self {
3266 self.0.request = v.into();
3267 self
3268 }
3269
3270 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3272 self.0.options = v.into();
3273 self
3274 }
3275
3276 pub async fn send(self) -> Result<longrunning::model::Operation> {
3283 (*self.0.stub)
3284 .delete_tag_binding(self.0.request, self.0.options)
3285 .await
3286 .map(gax::response::Response::into_body)
3287 }
3288
3289 pub fn poller(self) -> impl lro::Poller<(), crate::model::DeleteTagBindingMetadata> {
3291 type Operation =
3292 lro::internal::Operation<wkt::Empty, crate::model::DeleteTagBindingMetadata>;
3293 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3294 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3295
3296 let stub = self.0.stub.clone();
3297 let mut options = self.0.options.clone();
3298 options.set_retry_policy(gax::retry_policy::NeverRetry);
3299 let query = move |name| {
3300 let stub = stub.clone();
3301 let options = options.clone();
3302 async {
3303 let op = GetOperation::new(stub)
3304 .set_name(name)
3305 .with_options(options)
3306 .send()
3307 .await?;
3308 Ok(Operation::new(op))
3309 }
3310 };
3311
3312 let start = move || async {
3313 let op = self.send().await?;
3314 Ok(Operation::new(op))
3315 };
3316
3317 lro::internal::new_unit_response_poller(
3318 polling_error_policy,
3319 polling_backoff_policy,
3320 start,
3321 query,
3322 )
3323 }
3324
3325 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3329 self.0.request.name = v.into();
3330 self
3331 }
3332 }
3333
3334 #[doc(hidden)]
3335 impl gax::options::internal::RequestBuilder for DeleteTagBinding {
3336 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3337 &mut self.0.options
3338 }
3339 }
3340
3341 #[derive(Clone, Debug)]
3362 pub struct ListEffectiveTags(RequestBuilder<crate::model::ListEffectiveTagsRequest>);
3363
3364 impl ListEffectiveTags {
3365 pub(crate) fn new(
3366 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3367 ) -> Self {
3368 Self(RequestBuilder::new(stub))
3369 }
3370
3371 pub fn with_request<V: Into<crate::model::ListEffectiveTagsRequest>>(
3373 mut self,
3374 v: V,
3375 ) -> Self {
3376 self.0.request = v.into();
3377 self
3378 }
3379
3380 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3382 self.0.options = v.into();
3383 self
3384 }
3385
3386 pub async fn send(self) -> Result<crate::model::ListEffectiveTagsResponse> {
3388 (*self.0.stub)
3389 .list_effective_tags(self.0.request, self.0.options)
3390 .await
3391 .map(gax::response::Response::into_body)
3392 }
3393
3394 pub fn by_page(
3396 self,
3397 ) -> impl gax::paginator::Paginator<crate::model::ListEffectiveTagsResponse, gax::error::Error>
3398 {
3399 use std::clone::Clone;
3400 let token = self.0.request.page_token.clone();
3401 let execute = move |token: String| {
3402 let mut builder = self.clone();
3403 builder.0.request = builder.0.request.set_page_token(token);
3404 builder.send()
3405 };
3406 gax::paginator::internal::new_paginator(token, execute)
3407 }
3408
3409 pub fn by_item(
3411 self,
3412 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEffectiveTagsResponse, gax::error::Error>
3413 {
3414 use gax::paginator::Paginator;
3415 self.by_page().items()
3416 }
3417
3418 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3422 self.0.request.parent = v.into();
3423 self
3424 }
3425
3426 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3428 self.0.request.page_size = v.into();
3429 self
3430 }
3431
3432 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3434 self.0.request.page_token = v.into();
3435 self
3436 }
3437 }
3438
3439 #[doc(hidden)]
3440 impl gax::options::internal::RequestBuilder for ListEffectiveTags {
3441 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3442 &mut self.0.options
3443 }
3444 }
3445
3446 #[derive(Clone, Debug)]
3463 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3464
3465 impl GetOperation {
3466 pub(crate) fn new(
3467 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3468 ) -> Self {
3469 Self(RequestBuilder::new(stub))
3470 }
3471
3472 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3474 mut self,
3475 v: V,
3476 ) -> Self {
3477 self.0.request = v.into();
3478 self
3479 }
3480
3481 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3483 self.0.options = v.into();
3484 self
3485 }
3486
3487 pub async fn send(self) -> Result<longrunning::model::Operation> {
3489 (*self.0.stub)
3490 .get_operation(self.0.request, self.0.options)
3491 .await
3492 .map(gax::response::Response::into_body)
3493 }
3494
3495 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3497 self.0.request.name = v.into();
3498 self
3499 }
3500 }
3501
3502 #[doc(hidden)]
3503 impl gax::options::internal::RequestBuilder for GetOperation {
3504 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3505 &mut self.0.options
3506 }
3507 }
3508}
3509
3510pub mod tag_holds {
3511 use crate::Result;
3512
3513 pub type ClientBuilder =
3527 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3528
3529 pub(crate) mod client {
3530 use super::super::super::client::TagHolds;
3531 pub struct Factory;
3532 impl gax::client_builder::internal::ClientFactory for Factory {
3533 type Client = TagHolds;
3534 type Credentials = gaxi::options::Credentials;
3535 async fn build(
3536 self,
3537 config: gaxi::options::ClientConfig,
3538 ) -> gax::client_builder::Result<Self::Client> {
3539 Self::Client::new(config).await
3540 }
3541 }
3542 }
3543
3544 #[derive(Clone, Debug)]
3546 pub(crate) struct RequestBuilder<R: std::default::Default> {
3547 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>,
3548 request: R,
3549 options: gax::options::RequestOptions,
3550 }
3551
3552 impl<R> RequestBuilder<R>
3553 where
3554 R: std::default::Default,
3555 {
3556 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3557 Self {
3558 stub,
3559 request: R::default(),
3560 options: gax::options::RequestOptions::default(),
3561 }
3562 }
3563 }
3564
3565 #[derive(Clone, Debug)]
3583 pub struct CreateTagHold(RequestBuilder<crate::model::CreateTagHoldRequest>);
3584
3585 impl CreateTagHold {
3586 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3587 Self(RequestBuilder::new(stub))
3588 }
3589
3590 pub fn with_request<V: Into<crate::model::CreateTagHoldRequest>>(mut self, v: V) -> Self {
3592 self.0.request = v.into();
3593 self
3594 }
3595
3596 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3598 self.0.options = v.into();
3599 self
3600 }
3601
3602 pub async fn send(self) -> Result<longrunning::model::Operation> {
3609 (*self.0.stub)
3610 .create_tag_hold(self.0.request, self.0.options)
3611 .await
3612 .map(gax::response::Response::into_body)
3613 }
3614
3615 pub fn poller(
3617 self,
3618 ) -> impl lro::Poller<crate::model::TagHold, crate::model::CreateTagHoldMetadata> {
3619 type Operation = lro::internal::Operation<
3620 crate::model::TagHold,
3621 crate::model::CreateTagHoldMetadata,
3622 >;
3623 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3624 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3625
3626 let stub = self.0.stub.clone();
3627 let mut options = self.0.options.clone();
3628 options.set_retry_policy(gax::retry_policy::NeverRetry);
3629 let query = move |name| {
3630 let stub = stub.clone();
3631 let options = options.clone();
3632 async {
3633 let op = GetOperation::new(stub)
3634 .set_name(name)
3635 .with_options(options)
3636 .send()
3637 .await?;
3638 Ok(Operation::new(op))
3639 }
3640 };
3641
3642 let start = move || async {
3643 let op = self.send().await?;
3644 Ok(Operation::new(op))
3645 };
3646
3647 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3648 }
3649
3650 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3654 self.0.request.parent = v.into();
3655 self
3656 }
3657
3658 pub fn set_tag_hold<T>(mut self, v: T) -> Self
3662 where
3663 T: std::convert::Into<crate::model::TagHold>,
3664 {
3665 self.0.request.tag_hold = std::option::Option::Some(v.into());
3666 self
3667 }
3668
3669 pub fn set_or_clear_tag_hold<T>(mut self, v: std::option::Option<T>) -> Self
3673 where
3674 T: std::convert::Into<crate::model::TagHold>,
3675 {
3676 self.0.request.tag_hold = v.map(|x| x.into());
3677 self
3678 }
3679
3680 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3682 self.0.request.validate_only = v.into();
3683 self
3684 }
3685 }
3686
3687 #[doc(hidden)]
3688 impl gax::options::internal::RequestBuilder for CreateTagHold {
3689 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3690 &mut self.0.options
3691 }
3692 }
3693
3694 #[derive(Clone, Debug)]
3712 pub struct DeleteTagHold(RequestBuilder<crate::model::DeleteTagHoldRequest>);
3713
3714 impl DeleteTagHold {
3715 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3716 Self(RequestBuilder::new(stub))
3717 }
3718
3719 pub fn with_request<V: Into<crate::model::DeleteTagHoldRequest>>(mut self, v: V) -> Self {
3721 self.0.request = v.into();
3722 self
3723 }
3724
3725 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3727 self.0.options = v.into();
3728 self
3729 }
3730
3731 pub async fn send(self) -> Result<longrunning::model::Operation> {
3738 (*self.0.stub)
3739 .delete_tag_hold(self.0.request, self.0.options)
3740 .await
3741 .map(gax::response::Response::into_body)
3742 }
3743
3744 pub fn poller(self) -> impl lro::Poller<(), crate::model::DeleteTagHoldMetadata> {
3746 type Operation =
3747 lro::internal::Operation<wkt::Empty, crate::model::DeleteTagHoldMetadata>;
3748 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3749 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3750
3751 let stub = self.0.stub.clone();
3752 let mut options = self.0.options.clone();
3753 options.set_retry_policy(gax::retry_policy::NeverRetry);
3754 let query = move |name| {
3755 let stub = stub.clone();
3756 let options = options.clone();
3757 async {
3758 let op = GetOperation::new(stub)
3759 .set_name(name)
3760 .with_options(options)
3761 .send()
3762 .await?;
3763 Ok(Operation::new(op))
3764 }
3765 };
3766
3767 let start = move || async {
3768 let op = self.send().await?;
3769 Ok(Operation::new(op))
3770 };
3771
3772 lro::internal::new_unit_response_poller(
3773 polling_error_policy,
3774 polling_backoff_policy,
3775 start,
3776 query,
3777 )
3778 }
3779
3780 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3784 self.0.request.name = v.into();
3785 self
3786 }
3787
3788 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3790 self.0.request.validate_only = v.into();
3791 self
3792 }
3793 }
3794
3795 #[doc(hidden)]
3796 impl gax::options::internal::RequestBuilder for DeleteTagHold {
3797 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3798 &mut self.0.options
3799 }
3800 }
3801
3802 #[derive(Clone, Debug)]
3823 pub struct ListTagHolds(RequestBuilder<crate::model::ListTagHoldsRequest>);
3824
3825 impl ListTagHolds {
3826 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3827 Self(RequestBuilder::new(stub))
3828 }
3829
3830 pub fn with_request<V: Into<crate::model::ListTagHoldsRequest>>(mut self, v: V) -> Self {
3832 self.0.request = v.into();
3833 self
3834 }
3835
3836 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3838 self.0.options = v.into();
3839 self
3840 }
3841
3842 pub async fn send(self) -> Result<crate::model::ListTagHoldsResponse> {
3844 (*self.0.stub)
3845 .list_tag_holds(self.0.request, self.0.options)
3846 .await
3847 .map(gax::response::Response::into_body)
3848 }
3849
3850 pub fn by_page(
3852 self,
3853 ) -> impl gax::paginator::Paginator<crate::model::ListTagHoldsResponse, gax::error::Error>
3854 {
3855 use std::clone::Clone;
3856 let token = self.0.request.page_token.clone();
3857 let execute = move |token: String| {
3858 let mut builder = self.clone();
3859 builder.0.request = builder.0.request.set_page_token(token);
3860 builder.send()
3861 };
3862 gax::paginator::internal::new_paginator(token, execute)
3863 }
3864
3865 pub fn by_item(
3867 self,
3868 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTagHoldsResponse, gax::error::Error>
3869 {
3870 use gax::paginator::Paginator;
3871 self.by_page().items()
3872 }
3873
3874 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3878 self.0.request.parent = v.into();
3879 self
3880 }
3881
3882 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3884 self.0.request.page_size = v.into();
3885 self
3886 }
3887
3888 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3890 self.0.request.page_token = v.into();
3891 self
3892 }
3893
3894 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3896 self.0.request.filter = v.into();
3897 self
3898 }
3899 }
3900
3901 #[doc(hidden)]
3902 impl gax::options::internal::RequestBuilder for ListTagHolds {
3903 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3904 &mut self.0.options
3905 }
3906 }
3907
3908 #[derive(Clone, Debug)]
3925 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3926
3927 impl GetOperation {
3928 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3929 Self(RequestBuilder::new(stub))
3930 }
3931
3932 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3934 mut self,
3935 v: V,
3936 ) -> Self {
3937 self.0.request = v.into();
3938 self
3939 }
3940
3941 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3943 self.0.options = v.into();
3944 self
3945 }
3946
3947 pub async fn send(self) -> Result<longrunning::model::Operation> {
3949 (*self.0.stub)
3950 .get_operation(self.0.request, self.0.options)
3951 .await
3952 .map(gax::response::Response::into_body)
3953 }
3954
3955 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3957 self.0.request.name = v.into();
3958 self
3959 }
3960 }
3961
3962 #[doc(hidden)]
3963 impl gax::options::internal::RequestBuilder for GetOperation {
3964 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3965 &mut self.0.options
3966 }
3967 }
3968}
3969
3970pub mod tag_keys {
3971 use crate::Result;
3972
3973 pub type ClientBuilder =
3987 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3988
3989 pub(crate) mod client {
3990 use super::super::super::client::TagKeys;
3991 pub struct Factory;
3992 impl gax::client_builder::internal::ClientFactory for Factory {
3993 type Client = TagKeys;
3994 type Credentials = gaxi::options::Credentials;
3995 async fn build(
3996 self,
3997 config: gaxi::options::ClientConfig,
3998 ) -> gax::client_builder::Result<Self::Client> {
3999 Self::Client::new(config).await
4000 }
4001 }
4002 }
4003
4004 #[derive(Clone, Debug)]
4006 pub(crate) struct RequestBuilder<R: std::default::Default> {
4007 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>,
4008 request: R,
4009 options: gax::options::RequestOptions,
4010 }
4011
4012 impl<R> RequestBuilder<R>
4013 where
4014 R: std::default::Default,
4015 {
4016 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4017 Self {
4018 stub,
4019 request: R::default(),
4020 options: gax::options::RequestOptions::default(),
4021 }
4022 }
4023 }
4024
4025 #[derive(Clone, Debug)]
4046 pub struct ListTagKeys(RequestBuilder<crate::model::ListTagKeysRequest>);
4047
4048 impl ListTagKeys {
4049 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4050 Self(RequestBuilder::new(stub))
4051 }
4052
4053 pub fn with_request<V: Into<crate::model::ListTagKeysRequest>>(mut self, v: V) -> Self {
4055 self.0.request = v.into();
4056 self
4057 }
4058
4059 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4061 self.0.options = v.into();
4062 self
4063 }
4064
4065 pub async fn send(self) -> Result<crate::model::ListTagKeysResponse> {
4067 (*self.0.stub)
4068 .list_tag_keys(self.0.request, self.0.options)
4069 .await
4070 .map(gax::response::Response::into_body)
4071 }
4072
4073 pub fn by_page(
4075 self,
4076 ) -> impl gax::paginator::Paginator<crate::model::ListTagKeysResponse, gax::error::Error>
4077 {
4078 use std::clone::Clone;
4079 let token = self.0.request.page_token.clone();
4080 let execute = move |token: String| {
4081 let mut builder = self.clone();
4082 builder.0.request = builder.0.request.set_page_token(token);
4083 builder.send()
4084 };
4085 gax::paginator::internal::new_paginator(token, execute)
4086 }
4087
4088 pub fn by_item(
4090 self,
4091 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTagKeysResponse, gax::error::Error>
4092 {
4093 use gax::paginator::Paginator;
4094 self.by_page().items()
4095 }
4096
4097 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4101 self.0.request.parent = v.into();
4102 self
4103 }
4104
4105 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4107 self.0.request.page_size = v.into();
4108 self
4109 }
4110
4111 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4113 self.0.request.page_token = v.into();
4114 self
4115 }
4116 }
4117
4118 #[doc(hidden)]
4119 impl gax::options::internal::RequestBuilder for ListTagKeys {
4120 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4121 &mut self.0.options
4122 }
4123 }
4124
4125 #[derive(Clone, Debug)]
4142 pub struct GetTagKey(RequestBuilder<crate::model::GetTagKeyRequest>);
4143
4144 impl GetTagKey {
4145 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4146 Self(RequestBuilder::new(stub))
4147 }
4148
4149 pub fn with_request<V: Into<crate::model::GetTagKeyRequest>>(mut self, v: V) -> Self {
4151 self.0.request = v.into();
4152 self
4153 }
4154
4155 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4157 self.0.options = v.into();
4158 self
4159 }
4160
4161 pub async fn send(self) -> Result<crate::model::TagKey> {
4163 (*self.0.stub)
4164 .get_tag_key(self.0.request, self.0.options)
4165 .await
4166 .map(gax::response::Response::into_body)
4167 }
4168
4169 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4173 self.0.request.name = v.into();
4174 self
4175 }
4176 }
4177
4178 #[doc(hidden)]
4179 impl gax::options::internal::RequestBuilder for GetTagKey {
4180 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4181 &mut self.0.options
4182 }
4183 }
4184
4185 #[derive(Clone, Debug)]
4202 pub struct GetNamespacedTagKey(RequestBuilder<crate::model::GetNamespacedTagKeyRequest>);
4203
4204 impl GetNamespacedTagKey {
4205 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4206 Self(RequestBuilder::new(stub))
4207 }
4208
4209 pub fn with_request<V: Into<crate::model::GetNamespacedTagKeyRequest>>(
4211 mut self,
4212 v: V,
4213 ) -> Self {
4214 self.0.request = v.into();
4215 self
4216 }
4217
4218 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4220 self.0.options = v.into();
4221 self
4222 }
4223
4224 pub async fn send(self) -> Result<crate::model::TagKey> {
4226 (*self.0.stub)
4227 .get_namespaced_tag_key(self.0.request, self.0.options)
4228 .await
4229 .map(gax::response::Response::into_body)
4230 }
4231
4232 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4236 self.0.request.name = v.into();
4237 self
4238 }
4239 }
4240
4241 #[doc(hidden)]
4242 impl gax::options::internal::RequestBuilder for GetNamespacedTagKey {
4243 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4244 &mut self.0.options
4245 }
4246 }
4247
4248 #[derive(Clone, Debug)]
4266 pub struct CreateTagKey(RequestBuilder<crate::model::CreateTagKeyRequest>);
4267
4268 impl CreateTagKey {
4269 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4270 Self(RequestBuilder::new(stub))
4271 }
4272
4273 pub fn with_request<V: Into<crate::model::CreateTagKeyRequest>>(mut self, v: V) -> Self {
4275 self.0.request = v.into();
4276 self
4277 }
4278
4279 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4281 self.0.options = v.into();
4282 self
4283 }
4284
4285 pub async fn send(self) -> Result<longrunning::model::Operation> {
4292 (*self.0.stub)
4293 .create_tag_key(self.0.request, self.0.options)
4294 .await
4295 .map(gax::response::Response::into_body)
4296 }
4297
4298 pub fn poller(
4300 self,
4301 ) -> impl lro::Poller<crate::model::TagKey, crate::model::CreateTagKeyMetadata> {
4302 type Operation =
4303 lro::internal::Operation<crate::model::TagKey, crate::model::CreateTagKeyMetadata>;
4304 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4305 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4306
4307 let stub = self.0.stub.clone();
4308 let mut options = self.0.options.clone();
4309 options.set_retry_policy(gax::retry_policy::NeverRetry);
4310 let query = move |name| {
4311 let stub = stub.clone();
4312 let options = options.clone();
4313 async {
4314 let op = GetOperation::new(stub)
4315 .set_name(name)
4316 .with_options(options)
4317 .send()
4318 .await?;
4319 Ok(Operation::new(op))
4320 }
4321 };
4322
4323 let start = move || async {
4324 let op = self.send().await?;
4325 Ok(Operation::new(op))
4326 };
4327
4328 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4329 }
4330
4331 pub fn set_tag_key<T>(mut self, v: T) -> Self
4335 where
4336 T: std::convert::Into<crate::model::TagKey>,
4337 {
4338 self.0.request.tag_key = std::option::Option::Some(v.into());
4339 self
4340 }
4341
4342 pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
4346 where
4347 T: std::convert::Into<crate::model::TagKey>,
4348 {
4349 self.0.request.tag_key = v.map(|x| x.into());
4350 self
4351 }
4352
4353 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4355 self.0.request.validate_only = v.into();
4356 self
4357 }
4358 }
4359
4360 #[doc(hidden)]
4361 impl gax::options::internal::RequestBuilder for CreateTagKey {
4362 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4363 &mut self.0.options
4364 }
4365 }
4366
4367 #[derive(Clone, Debug)]
4385 pub struct UpdateTagKey(RequestBuilder<crate::model::UpdateTagKeyRequest>);
4386
4387 impl UpdateTagKey {
4388 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4389 Self(RequestBuilder::new(stub))
4390 }
4391
4392 pub fn with_request<V: Into<crate::model::UpdateTagKeyRequest>>(mut self, v: V) -> Self {
4394 self.0.request = v.into();
4395 self
4396 }
4397
4398 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4400 self.0.options = v.into();
4401 self
4402 }
4403
4404 pub async fn send(self) -> Result<longrunning::model::Operation> {
4411 (*self.0.stub)
4412 .update_tag_key(self.0.request, self.0.options)
4413 .await
4414 .map(gax::response::Response::into_body)
4415 }
4416
4417 pub fn poller(
4419 self,
4420 ) -> impl lro::Poller<crate::model::TagKey, crate::model::UpdateTagKeyMetadata> {
4421 type Operation =
4422 lro::internal::Operation<crate::model::TagKey, crate::model::UpdateTagKeyMetadata>;
4423 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4424 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4425
4426 let stub = self.0.stub.clone();
4427 let mut options = self.0.options.clone();
4428 options.set_retry_policy(gax::retry_policy::NeverRetry);
4429 let query = move |name| {
4430 let stub = stub.clone();
4431 let options = options.clone();
4432 async {
4433 let op = GetOperation::new(stub)
4434 .set_name(name)
4435 .with_options(options)
4436 .send()
4437 .await?;
4438 Ok(Operation::new(op))
4439 }
4440 };
4441
4442 let start = move || async {
4443 let op = self.send().await?;
4444 Ok(Operation::new(op))
4445 };
4446
4447 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4448 }
4449
4450 pub fn set_tag_key<T>(mut self, v: T) -> Self
4454 where
4455 T: std::convert::Into<crate::model::TagKey>,
4456 {
4457 self.0.request.tag_key = std::option::Option::Some(v.into());
4458 self
4459 }
4460
4461 pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
4465 where
4466 T: std::convert::Into<crate::model::TagKey>,
4467 {
4468 self.0.request.tag_key = v.map(|x| x.into());
4469 self
4470 }
4471
4472 pub fn set_update_mask<T>(mut self, v: T) -> Self
4474 where
4475 T: std::convert::Into<wkt::FieldMask>,
4476 {
4477 self.0.request.update_mask = std::option::Option::Some(v.into());
4478 self
4479 }
4480
4481 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4483 where
4484 T: std::convert::Into<wkt::FieldMask>,
4485 {
4486 self.0.request.update_mask = v.map(|x| x.into());
4487 self
4488 }
4489
4490 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4492 self.0.request.validate_only = v.into();
4493 self
4494 }
4495 }
4496
4497 #[doc(hidden)]
4498 impl gax::options::internal::RequestBuilder for UpdateTagKey {
4499 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4500 &mut self.0.options
4501 }
4502 }
4503
4504 #[derive(Clone, Debug)]
4522 pub struct DeleteTagKey(RequestBuilder<crate::model::DeleteTagKeyRequest>);
4523
4524 impl DeleteTagKey {
4525 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4526 Self(RequestBuilder::new(stub))
4527 }
4528
4529 pub fn with_request<V: Into<crate::model::DeleteTagKeyRequest>>(mut self, v: V) -> Self {
4531 self.0.request = v.into();
4532 self
4533 }
4534
4535 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4537 self.0.options = v.into();
4538 self
4539 }
4540
4541 pub async fn send(self) -> Result<longrunning::model::Operation> {
4548 (*self.0.stub)
4549 .delete_tag_key(self.0.request, self.0.options)
4550 .await
4551 .map(gax::response::Response::into_body)
4552 }
4553
4554 pub fn poller(
4556 self,
4557 ) -> impl lro::Poller<crate::model::TagKey, crate::model::DeleteTagKeyMetadata> {
4558 type Operation =
4559 lro::internal::Operation<crate::model::TagKey, crate::model::DeleteTagKeyMetadata>;
4560 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4561 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4562
4563 let stub = self.0.stub.clone();
4564 let mut options = self.0.options.clone();
4565 options.set_retry_policy(gax::retry_policy::NeverRetry);
4566 let query = move |name| {
4567 let stub = stub.clone();
4568 let options = options.clone();
4569 async {
4570 let op = GetOperation::new(stub)
4571 .set_name(name)
4572 .with_options(options)
4573 .send()
4574 .await?;
4575 Ok(Operation::new(op))
4576 }
4577 };
4578
4579 let start = move || async {
4580 let op = self.send().await?;
4581 Ok(Operation::new(op))
4582 };
4583
4584 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4585 }
4586
4587 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4591 self.0.request.name = v.into();
4592 self
4593 }
4594
4595 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4597 self.0.request.validate_only = v.into();
4598 self
4599 }
4600
4601 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4603 self.0.request.etag = v.into();
4604 self
4605 }
4606 }
4607
4608 #[doc(hidden)]
4609 impl gax::options::internal::RequestBuilder for DeleteTagKey {
4610 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4611 &mut self.0.options
4612 }
4613 }
4614
4615 #[derive(Clone, Debug)]
4632 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4633
4634 impl GetIamPolicy {
4635 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4636 Self(RequestBuilder::new(stub))
4637 }
4638
4639 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4641 self.0.request = v.into();
4642 self
4643 }
4644
4645 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4647 self.0.options = v.into();
4648 self
4649 }
4650
4651 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4653 (*self.0.stub)
4654 .get_iam_policy(self.0.request, self.0.options)
4655 .await
4656 .map(gax::response::Response::into_body)
4657 }
4658
4659 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4663 self.0.request.resource = v.into();
4664 self
4665 }
4666
4667 pub fn set_options<T>(mut self, v: T) -> Self
4669 where
4670 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4671 {
4672 self.0.request.options = std::option::Option::Some(v.into());
4673 self
4674 }
4675
4676 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4678 where
4679 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4680 {
4681 self.0.request.options = v.map(|x| x.into());
4682 self
4683 }
4684 }
4685
4686 #[doc(hidden)]
4687 impl gax::options::internal::RequestBuilder for GetIamPolicy {
4688 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4689 &mut self.0.options
4690 }
4691 }
4692
4693 #[derive(Clone, Debug)]
4710 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4711
4712 impl SetIamPolicy {
4713 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4714 Self(RequestBuilder::new(stub))
4715 }
4716
4717 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4719 self.0.request = v.into();
4720 self
4721 }
4722
4723 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4725 self.0.options = v.into();
4726 self
4727 }
4728
4729 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4731 (*self.0.stub)
4732 .set_iam_policy(self.0.request, self.0.options)
4733 .await
4734 .map(gax::response::Response::into_body)
4735 }
4736
4737 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4741 self.0.request.resource = v.into();
4742 self
4743 }
4744
4745 pub fn set_policy<T>(mut self, v: T) -> Self
4749 where
4750 T: std::convert::Into<iam_v1::model::Policy>,
4751 {
4752 self.0.request.policy = std::option::Option::Some(v.into());
4753 self
4754 }
4755
4756 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4760 where
4761 T: std::convert::Into<iam_v1::model::Policy>,
4762 {
4763 self.0.request.policy = v.map(|x| x.into());
4764 self
4765 }
4766
4767 pub fn set_update_mask<T>(mut self, v: T) -> Self
4769 where
4770 T: std::convert::Into<wkt::FieldMask>,
4771 {
4772 self.0.request.update_mask = std::option::Option::Some(v.into());
4773 self
4774 }
4775
4776 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4778 where
4779 T: std::convert::Into<wkt::FieldMask>,
4780 {
4781 self.0.request.update_mask = v.map(|x| x.into());
4782 self
4783 }
4784 }
4785
4786 #[doc(hidden)]
4787 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4788 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4789 &mut self.0.options
4790 }
4791 }
4792
4793 #[derive(Clone, Debug)]
4810 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4811
4812 impl TestIamPermissions {
4813 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4814 Self(RequestBuilder::new(stub))
4815 }
4816
4817 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4819 mut self,
4820 v: V,
4821 ) -> Self {
4822 self.0.request = v.into();
4823 self
4824 }
4825
4826 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4828 self.0.options = v.into();
4829 self
4830 }
4831
4832 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4834 (*self.0.stub)
4835 .test_iam_permissions(self.0.request, self.0.options)
4836 .await
4837 .map(gax::response::Response::into_body)
4838 }
4839
4840 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4844 self.0.request.resource = v.into();
4845 self
4846 }
4847
4848 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4852 where
4853 T: std::iter::IntoIterator<Item = V>,
4854 V: std::convert::Into<std::string::String>,
4855 {
4856 use std::iter::Iterator;
4857 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4858 self
4859 }
4860 }
4861
4862 #[doc(hidden)]
4863 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4864 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4865 &mut self.0.options
4866 }
4867 }
4868
4869 #[derive(Clone, Debug)]
4886 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4887
4888 impl GetOperation {
4889 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4890 Self(RequestBuilder::new(stub))
4891 }
4892
4893 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4895 mut self,
4896 v: V,
4897 ) -> Self {
4898 self.0.request = v.into();
4899 self
4900 }
4901
4902 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4904 self.0.options = v.into();
4905 self
4906 }
4907
4908 pub async fn send(self) -> Result<longrunning::model::Operation> {
4910 (*self.0.stub)
4911 .get_operation(self.0.request, self.0.options)
4912 .await
4913 .map(gax::response::Response::into_body)
4914 }
4915
4916 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4918 self.0.request.name = v.into();
4919 self
4920 }
4921 }
4922
4923 #[doc(hidden)]
4924 impl gax::options::internal::RequestBuilder for GetOperation {
4925 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4926 &mut self.0.options
4927 }
4928 }
4929}
4930
4931pub mod tag_values {
4932 use crate::Result;
4933
4934 pub type ClientBuilder =
4948 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4949
4950 pub(crate) mod client {
4951 use super::super::super::client::TagValues;
4952 pub struct Factory;
4953 impl gax::client_builder::internal::ClientFactory for Factory {
4954 type Client = TagValues;
4955 type Credentials = gaxi::options::Credentials;
4956 async fn build(
4957 self,
4958 config: gaxi::options::ClientConfig,
4959 ) -> gax::client_builder::Result<Self::Client> {
4960 Self::Client::new(config).await
4961 }
4962 }
4963 }
4964
4965 #[derive(Clone, Debug)]
4967 pub(crate) struct RequestBuilder<R: std::default::Default> {
4968 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
4969 request: R,
4970 options: gax::options::RequestOptions,
4971 }
4972
4973 impl<R> RequestBuilder<R>
4974 where
4975 R: std::default::Default,
4976 {
4977 pub(crate) fn new(
4978 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
4979 ) -> Self {
4980 Self {
4981 stub,
4982 request: R::default(),
4983 options: gax::options::RequestOptions::default(),
4984 }
4985 }
4986 }
4987
4988 #[derive(Clone, Debug)]
5009 pub struct ListTagValues(RequestBuilder<crate::model::ListTagValuesRequest>);
5010
5011 impl ListTagValues {
5012 pub(crate) fn new(
5013 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5014 ) -> Self {
5015 Self(RequestBuilder::new(stub))
5016 }
5017
5018 pub fn with_request<V: Into<crate::model::ListTagValuesRequest>>(mut self, v: V) -> Self {
5020 self.0.request = v.into();
5021 self
5022 }
5023
5024 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5026 self.0.options = v.into();
5027 self
5028 }
5029
5030 pub async fn send(self) -> Result<crate::model::ListTagValuesResponse> {
5032 (*self.0.stub)
5033 .list_tag_values(self.0.request, self.0.options)
5034 .await
5035 .map(gax::response::Response::into_body)
5036 }
5037
5038 pub fn by_page(
5040 self,
5041 ) -> impl gax::paginator::Paginator<crate::model::ListTagValuesResponse, gax::error::Error>
5042 {
5043 use std::clone::Clone;
5044 let token = self.0.request.page_token.clone();
5045 let execute = move |token: String| {
5046 let mut builder = self.clone();
5047 builder.0.request = builder.0.request.set_page_token(token);
5048 builder.send()
5049 };
5050 gax::paginator::internal::new_paginator(token, execute)
5051 }
5052
5053 pub fn by_item(
5055 self,
5056 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTagValuesResponse, gax::error::Error>
5057 {
5058 use gax::paginator::Paginator;
5059 self.by_page().items()
5060 }
5061
5062 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5066 self.0.request.parent = v.into();
5067 self
5068 }
5069
5070 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5072 self.0.request.page_size = v.into();
5073 self
5074 }
5075
5076 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5078 self.0.request.page_token = v.into();
5079 self
5080 }
5081 }
5082
5083 #[doc(hidden)]
5084 impl gax::options::internal::RequestBuilder for ListTagValues {
5085 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5086 &mut self.0.options
5087 }
5088 }
5089
5090 #[derive(Clone, Debug)]
5107 pub struct GetTagValue(RequestBuilder<crate::model::GetTagValueRequest>);
5108
5109 impl GetTagValue {
5110 pub(crate) fn new(
5111 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5112 ) -> Self {
5113 Self(RequestBuilder::new(stub))
5114 }
5115
5116 pub fn with_request<V: Into<crate::model::GetTagValueRequest>>(mut self, v: V) -> Self {
5118 self.0.request = v.into();
5119 self
5120 }
5121
5122 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5124 self.0.options = v.into();
5125 self
5126 }
5127
5128 pub async fn send(self) -> Result<crate::model::TagValue> {
5130 (*self.0.stub)
5131 .get_tag_value(self.0.request, self.0.options)
5132 .await
5133 .map(gax::response::Response::into_body)
5134 }
5135
5136 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5140 self.0.request.name = v.into();
5141 self
5142 }
5143 }
5144
5145 #[doc(hidden)]
5146 impl gax::options::internal::RequestBuilder for GetTagValue {
5147 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5148 &mut self.0.options
5149 }
5150 }
5151
5152 #[derive(Clone, Debug)]
5169 pub struct GetNamespacedTagValue(RequestBuilder<crate::model::GetNamespacedTagValueRequest>);
5170
5171 impl GetNamespacedTagValue {
5172 pub(crate) fn new(
5173 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5174 ) -> Self {
5175 Self(RequestBuilder::new(stub))
5176 }
5177
5178 pub fn with_request<V: Into<crate::model::GetNamespacedTagValueRequest>>(
5180 mut self,
5181 v: V,
5182 ) -> Self {
5183 self.0.request = v.into();
5184 self
5185 }
5186
5187 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5189 self.0.options = v.into();
5190 self
5191 }
5192
5193 pub async fn send(self) -> Result<crate::model::TagValue> {
5195 (*self.0.stub)
5196 .get_namespaced_tag_value(self.0.request, self.0.options)
5197 .await
5198 .map(gax::response::Response::into_body)
5199 }
5200
5201 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5205 self.0.request.name = v.into();
5206 self
5207 }
5208 }
5209
5210 #[doc(hidden)]
5211 impl gax::options::internal::RequestBuilder for GetNamespacedTagValue {
5212 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5213 &mut self.0.options
5214 }
5215 }
5216
5217 #[derive(Clone, Debug)]
5235 pub struct CreateTagValue(RequestBuilder<crate::model::CreateTagValueRequest>);
5236
5237 impl CreateTagValue {
5238 pub(crate) fn new(
5239 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5240 ) -> Self {
5241 Self(RequestBuilder::new(stub))
5242 }
5243
5244 pub fn with_request<V: Into<crate::model::CreateTagValueRequest>>(mut self, v: V) -> Self {
5246 self.0.request = v.into();
5247 self
5248 }
5249
5250 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5252 self.0.options = v.into();
5253 self
5254 }
5255
5256 pub async fn send(self) -> Result<longrunning::model::Operation> {
5263 (*self.0.stub)
5264 .create_tag_value(self.0.request, self.0.options)
5265 .await
5266 .map(gax::response::Response::into_body)
5267 }
5268
5269 pub fn poller(
5271 self,
5272 ) -> impl lro::Poller<crate::model::TagValue, crate::model::CreateTagValueMetadata>
5273 {
5274 type Operation = lro::internal::Operation<
5275 crate::model::TagValue,
5276 crate::model::CreateTagValueMetadata,
5277 >;
5278 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5279 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5280
5281 let stub = self.0.stub.clone();
5282 let mut options = self.0.options.clone();
5283 options.set_retry_policy(gax::retry_policy::NeverRetry);
5284 let query = move |name| {
5285 let stub = stub.clone();
5286 let options = options.clone();
5287 async {
5288 let op = GetOperation::new(stub)
5289 .set_name(name)
5290 .with_options(options)
5291 .send()
5292 .await?;
5293 Ok(Operation::new(op))
5294 }
5295 };
5296
5297 let start = move || async {
5298 let op = self.send().await?;
5299 Ok(Operation::new(op))
5300 };
5301
5302 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5303 }
5304
5305 pub fn set_tag_value<T>(mut self, v: T) -> Self
5309 where
5310 T: std::convert::Into<crate::model::TagValue>,
5311 {
5312 self.0.request.tag_value = std::option::Option::Some(v.into());
5313 self
5314 }
5315
5316 pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
5320 where
5321 T: std::convert::Into<crate::model::TagValue>,
5322 {
5323 self.0.request.tag_value = v.map(|x| x.into());
5324 self
5325 }
5326
5327 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5329 self.0.request.validate_only = v.into();
5330 self
5331 }
5332 }
5333
5334 #[doc(hidden)]
5335 impl gax::options::internal::RequestBuilder for CreateTagValue {
5336 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5337 &mut self.0.options
5338 }
5339 }
5340
5341 #[derive(Clone, Debug)]
5359 pub struct UpdateTagValue(RequestBuilder<crate::model::UpdateTagValueRequest>);
5360
5361 impl UpdateTagValue {
5362 pub(crate) fn new(
5363 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5364 ) -> Self {
5365 Self(RequestBuilder::new(stub))
5366 }
5367
5368 pub fn with_request<V: Into<crate::model::UpdateTagValueRequest>>(mut self, v: V) -> Self {
5370 self.0.request = v.into();
5371 self
5372 }
5373
5374 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5376 self.0.options = v.into();
5377 self
5378 }
5379
5380 pub async fn send(self) -> Result<longrunning::model::Operation> {
5387 (*self.0.stub)
5388 .update_tag_value(self.0.request, self.0.options)
5389 .await
5390 .map(gax::response::Response::into_body)
5391 }
5392
5393 pub fn poller(
5395 self,
5396 ) -> impl lro::Poller<crate::model::TagValue, crate::model::UpdateTagValueMetadata>
5397 {
5398 type Operation = lro::internal::Operation<
5399 crate::model::TagValue,
5400 crate::model::UpdateTagValueMetadata,
5401 >;
5402 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5403 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5404
5405 let stub = self.0.stub.clone();
5406 let mut options = self.0.options.clone();
5407 options.set_retry_policy(gax::retry_policy::NeverRetry);
5408 let query = move |name| {
5409 let stub = stub.clone();
5410 let options = options.clone();
5411 async {
5412 let op = GetOperation::new(stub)
5413 .set_name(name)
5414 .with_options(options)
5415 .send()
5416 .await?;
5417 Ok(Operation::new(op))
5418 }
5419 };
5420
5421 let start = move || async {
5422 let op = self.send().await?;
5423 Ok(Operation::new(op))
5424 };
5425
5426 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5427 }
5428
5429 pub fn set_tag_value<T>(mut self, v: T) -> Self
5433 where
5434 T: std::convert::Into<crate::model::TagValue>,
5435 {
5436 self.0.request.tag_value = std::option::Option::Some(v.into());
5437 self
5438 }
5439
5440 pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
5444 where
5445 T: std::convert::Into<crate::model::TagValue>,
5446 {
5447 self.0.request.tag_value = v.map(|x| x.into());
5448 self
5449 }
5450
5451 pub fn set_update_mask<T>(mut self, v: T) -> Self
5453 where
5454 T: std::convert::Into<wkt::FieldMask>,
5455 {
5456 self.0.request.update_mask = std::option::Option::Some(v.into());
5457 self
5458 }
5459
5460 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5462 where
5463 T: std::convert::Into<wkt::FieldMask>,
5464 {
5465 self.0.request.update_mask = v.map(|x| x.into());
5466 self
5467 }
5468
5469 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5471 self.0.request.validate_only = v.into();
5472 self
5473 }
5474 }
5475
5476 #[doc(hidden)]
5477 impl gax::options::internal::RequestBuilder for UpdateTagValue {
5478 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5479 &mut self.0.options
5480 }
5481 }
5482
5483 #[derive(Clone, Debug)]
5501 pub struct DeleteTagValue(RequestBuilder<crate::model::DeleteTagValueRequest>);
5502
5503 impl DeleteTagValue {
5504 pub(crate) fn new(
5505 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5506 ) -> Self {
5507 Self(RequestBuilder::new(stub))
5508 }
5509
5510 pub fn with_request<V: Into<crate::model::DeleteTagValueRequest>>(mut self, v: V) -> Self {
5512 self.0.request = v.into();
5513 self
5514 }
5515
5516 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5518 self.0.options = v.into();
5519 self
5520 }
5521
5522 pub async fn send(self) -> Result<longrunning::model::Operation> {
5529 (*self.0.stub)
5530 .delete_tag_value(self.0.request, self.0.options)
5531 .await
5532 .map(gax::response::Response::into_body)
5533 }
5534
5535 pub fn poller(
5537 self,
5538 ) -> impl lro::Poller<crate::model::TagValue, crate::model::DeleteTagValueMetadata>
5539 {
5540 type Operation = lro::internal::Operation<
5541 crate::model::TagValue,
5542 crate::model::DeleteTagValueMetadata,
5543 >;
5544 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5545 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5546
5547 let stub = self.0.stub.clone();
5548 let mut options = self.0.options.clone();
5549 options.set_retry_policy(gax::retry_policy::NeverRetry);
5550 let query = move |name| {
5551 let stub = stub.clone();
5552 let options = options.clone();
5553 async {
5554 let op = GetOperation::new(stub)
5555 .set_name(name)
5556 .with_options(options)
5557 .send()
5558 .await?;
5559 Ok(Operation::new(op))
5560 }
5561 };
5562
5563 let start = move || async {
5564 let op = self.send().await?;
5565 Ok(Operation::new(op))
5566 };
5567
5568 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5569 }
5570
5571 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5575 self.0.request.name = v.into();
5576 self
5577 }
5578
5579 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5581 self.0.request.validate_only = v.into();
5582 self
5583 }
5584
5585 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
5587 self.0.request.etag = v.into();
5588 self
5589 }
5590 }
5591
5592 #[doc(hidden)]
5593 impl gax::options::internal::RequestBuilder for DeleteTagValue {
5594 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5595 &mut self.0.options
5596 }
5597 }
5598
5599 #[derive(Clone, Debug)]
5616 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5617
5618 impl GetIamPolicy {
5619 pub(crate) fn new(
5620 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5621 ) -> Self {
5622 Self(RequestBuilder::new(stub))
5623 }
5624
5625 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5627 self.0.request = v.into();
5628 self
5629 }
5630
5631 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5633 self.0.options = v.into();
5634 self
5635 }
5636
5637 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5639 (*self.0.stub)
5640 .get_iam_policy(self.0.request, self.0.options)
5641 .await
5642 .map(gax::response::Response::into_body)
5643 }
5644
5645 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5649 self.0.request.resource = v.into();
5650 self
5651 }
5652
5653 pub fn set_options<T>(mut self, v: T) -> Self
5655 where
5656 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5657 {
5658 self.0.request.options = std::option::Option::Some(v.into());
5659 self
5660 }
5661
5662 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5664 where
5665 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5666 {
5667 self.0.request.options = v.map(|x| x.into());
5668 self
5669 }
5670 }
5671
5672 #[doc(hidden)]
5673 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5674 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5675 &mut self.0.options
5676 }
5677 }
5678
5679 #[derive(Clone, Debug)]
5696 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5697
5698 impl SetIamPolicy {
5699 pub(crate) fn new(
5700 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5701 ) -> Self {
5702 Self(RequestBuilder::new(stub))
5703 }
5704
5705 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5707 self.0.request = v.into();
5708 self
5709 }
5710
5711 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5713 self.0.options = v.into();
5714 self
5715 }
5716
5717 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5719 (*self.0.stub)
5720 .set_iam_policy(self.0.request, self.0.options)
5721 .await
5722 .map(gax::response::Response::into_body)
5723 }
5724
5725 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5729 self.0.request.resource = v.into();
5730 self
5731 }
5732
5733 pub fn set_policy<T>(mut self, v: T) -> Self
5737 where
5738 T: std::convert::Into<iam_v1::model::Policy>,
5739 {
5740 self.0.request.policy = std::option::Option::Some(v.into());
5741 self
5742 }
5743
5744 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5748 where
5749 T: std::convert::Into<iam_v1::model::Policy>,
5750 {
5751 self.0.request.policy = v.map(|x| x.into());
5752 self
5753 }
5754
5755 pub fn set_update_mask<T>(mut self, v: T) -> Self
5757 where
5758 T: std::convert::Into<wkt::FieldMask>,
5759 {
5760 self.0.request.update_mask = std::option::Option::Some(v.into());
5761 self
5762 }
5763
5764 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5766 where
5767 T: std::convert::Into<wkt::FieldMask>,
5768 {
5769 self.0.request.update_mask = v.map(|x| x.into());
5770 self
5771 }
5772 }
5773
5774 #[doc(hidden)]
5775 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5776 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5777 &mut self.0.options
5778 }
5779 }
5780
5781 #[derive(Clone, Debug)]
5798 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5799
5800 impl TestIamPermissions {
5801 pub(crate) fn new(
5802 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5803 ) -> Self {
5804 Self(RequestBuilder::new(stub))
5805 }
5806
5807 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5809 mut self,
5810 v: V,
5811 ) -> Self {
5812 self.0.request = v.into();
5813 self
5814 }
5815
5816 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5818 self.0.options = v.into();
5819 self
5820 }
5821
5822 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5824 (*self.0.stub)
5825 .test_iam_permissions(self.0.request, self.0.options)
5826 .await
5827 .map(gax::response::Response::into_body)
5828 }
5829
5830 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5834 self.0.request.resource = v.into();
5835 self
5836 }
5837
5838 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5842 where
5843 T: std::iter::IntoIterator<Item = V>,
5844 V: std::convert::Into<std::string::String>,
5845 {
5846 use std::iter::Iterator;
5847 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5848 self
5849 }
5850 }
5851
5852 #[doc(hidden)]
5853 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5854 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5855 &mut self.0.options
5856 }
5857 }
5858
5859 #[derive(Clone, Debug)]
5876 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5877
5878 impl GetOperation {
5879 pub(crate) fn new(
5880 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5881 ) -> Self {
5882 Self(RequestBuilder::new(stub))
5883 }
5884
5885 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5887 mut self,
5888 v: V,
5889 ) -> Self {
5890 self.0.request = v.into();
5891 self
5892 }
5893
5894 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5896 self.0.options = v.into();
5897 self
5898 }
5899
5900 pub async fn send(self) -> Result<longrunning::model::Operation> {
5902 (*self.0.stub)
5903 .get_operation(self.0.request, self.0.options)
5904 .await
5905 .map(gax::response::Response::into_body)
5906 }
5907
5908 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5910 self.0.request.name = v.into();
5911 self
5912 }
5913 }
5914
5915 #[doc(hidden)]
5916 impl gax::options::internal::RequestBuilder for GetOperation {
5917 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5918 &mut self.0.options
5919 }
5920 }
5921}