1pub mod folders {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Folders;
38 pub struct Factory;
39 impl crate::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 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: crate::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<crate::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(crate::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 crate::RequestBuilder for GetFolder {
127 fn request_options(&mut self) -> &mut crate::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<crate::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(crate::Response::into_body)
178 }
179
180 pub fn by_page(
182 self,
183 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListFoldersResponse, crate::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 google_cloud_gax::paginator::internal::new_paginator(token, execute)
193 }
194
195 pub fn by_item(
197 self,
198 ) -> impl google_cloud_gax::paginator::ItemPaginator<
199 crate::model::ListFoldersResponse,
200 crate::Error,
201 > {
202 use google_cloud_gax::paginator::Paginator;
203 self.by_page().items()
204 }
205
206 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
210 self.0.request.parent = v.into();
211 self
212 }
213
214 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
216 self.0.request.page_size = v.into();
217 self
218 }
219
220 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
222 self.0.request.page_token = v.into();
223 self
224 }
225
226 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
228 self.0.request.show_deleted = v.into();
229 self
230 }
231 }
232
233 #[doc(hidden)]
234 impl crate::RequestBuilder for ListFolders {
235 fn request_options(&mut self) -> &mut crate::RequestOptions {
236 &mut self.0.options
237 }
238 }
239
240 #[derive(Clone, Debug)]
261 pub struct SearchFolders(RequestBuilder<crate::model::SearchFoldersRequest>);
262
263 impl SearchFolders {
264 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
265 Self(RequestBuilder::new(stub))
266 }
267
268 pub fn with_request<V: Into<crate::model::SearchFoldersRequest>>(mut self, v: V) -> Self {
270 self.0.request = v.into();
271 self
272 }
273
274 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
276 self.0.options = v.into();
277 self
278 }
279
280 pub async fn send(self) -> Result<crate::model::SearchFoldersResponse> {
282 (*self.0.stub)
283 .search_folders(self.0.request, self.0.options)
284 .await
285 .map(crate::Response::into_body)
286 }
287
288 pub fn by_page(
290 self,
291 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchFoldersResponse, crate::Error>
292 {
293 use std::clone::Clone;
294 let token = self.0.request.page_token.clone();
295 let execute = move |token: String| {
296 let mut builder = self.clone();
297 builder.0.request = builder.0.request.set_page_token(token);
298 builder.send()
299 };
300 google_cloud_gax::paginator::internal::new_paginator(token, execute)
301 }
302
303 pub fn by_item(
305 self,
306 ) -> impl google_cloud_gax::paginator::ItemPaginator<
307 crate::model::SearchFoldersResponse,
308 crate::Error,
309 > {
310 use google_cloud_gax::paginator::Paginator;
311 self.by_page().items()
312 }
313
314 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
316 self.0.request.page_size = v.into();
317 self
318 }
319
320 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
322 self.0.request.page_token = v.into();
323 self
324 }
325
326 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
328 self.0.request.query = v.into();
329 self
330 }
331 }
332
333 #[doc(hidden)]
334 impl crate::RequestBuilder for SearchFolders {
335 fn request_options(&mut self) -> &mut crate::RequestOptions {
336 &mut self.0.options
337 }
338 }
339
340 #[derive(Clone, Debug)]
358 pub struct CreateFolder(RequestBuilder<crate::model::CreateFolderRequest>);
359
360 impl CreateFolder {
361 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
362 Self(RequestBuilder::new(stub))
363 }
364
365 pub fn with_request<V: Into<crate::model::CreateFolderRequest>>(mut self, v: V) -> Self {
367 self.0.request = v.into();
368 self
369 }
370
371 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
373 self.0.options = v.into();
374 self
375 }
376
377 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
384 (*self.0.stub)
385 .create_folder(self.0.request, self.0.options)
386 .await
387 .map(crate::Response::into_body)
388 }
389
390 pub fn poller(
392 self,
393 ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::CreateFolderMetadata>
394 {
395 type Operation = google_cloud_lro::internal::Operation<
396 crate::model::Folder,
397 crate::model::CreateFolderMetadata,
398 >;
399 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
400 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
401 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
402 if let Some(ref mut details) = poller_options.tracing {
403 details.method_name =
404 "google_cloud_resourcemanager_v3::client::Folders::create_folder::until_done";
405 }
406
407 let stub = self.0.stub.clone();
408 let mut options = self.0.options.clone();
409 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
410 let query = move |name| {
411 let stub = stub.clone();
412 let options = options.clone();
413 async {
414 let op = GetOperation::new(stub)
415 .set_name(name)
416 .with_options(options)
417 .send()
418 .await?;
419 Ok(Operation::new(op))
420 }
421 };
422
423 let start = move || async {
424 let op = self.send().await?;
425 Ok(Operation::new(op))
426 };
427
428 use google_cloud_lro::internal::PollerExt;
429 {
430 google_cloud_lro::internal::new_poller(
431 polling_error_policy,
432 polling_backoff_policy,
433 start,
434 query,
435 )
436 }
437 .with_options(poller_options)
438 }
439
440 pub fn set_folder<T>(mut self, v: T) -> Self
444 where
445 T: std::convert::Into<crate::model::Folder>,
446 {
447 self.0.request.folder = std::option::Option::Some(v.into());
448 self
449 }
450
451 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
455 where
456 T: std::convert::Into<crate::model::Folder>,
457 {
458 self.0.request.folder = v.map(|x| x.into());
459 self
460 }
461 }
462
463 #[doc(hidden)]
464 impl crate::RequestBuilder for CreateFolder {
465 fn request_options(&mut self) -> &mut crate::RequestOptions {
466 &mut self.0.options
467 }
468 }
469
470 #[derive(Clone, Debug)]
488 pub struct UpdateFolder(RequestBuilder<crate::model::UpdateFolderRequest>);
489
490 impl UpdateFolder {
491 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
492 Self(RequestBuilder::new(stub))
493 }
494
495 pub fn with_request<V: Into<crate::model::UpdateFolderRequest>>(mut self, v: V) -> Self {
497 self.0.request = v.into();
498 self
499 }
500
501 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
503 self.0.options = v.into();
504 self
505 }
506
507 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
514 (*self.0.stub)
515 .update_folder(self.0.request, self.0.options)
516 .await
517 .map(crate::Response::into_body)
518 }
519
520 pub fn poller(
522 self,
523 ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::UpdateFolderMetadata>
524 {
525 type Operation = google_cloud_lro::internal::Operation<
526 crate::model::Folder,
527 crate::model::UpdateFolderMetadata,
528 >;
529 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
530 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
531 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
532 if let Some(ref mut details) = poller_options.tracing {
533 details.method_name =
534 "google_cloud_resourcemanager_v3::client::Folders::update_folder::until_done";
535 }
536
537 let stub = self.0.stub.clone();
538 let mut options = self.0.options.clone();
539 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
540 let query = move |name| {
541 let stub = stub.clone();
542 let options = options.clone();
543 async {
544 let op = GetOperation::new(stub)
545 .set_name(name)
546 .with_options(options)
547 .send()
548 .await?;
549 Ok(Operation::new(op))
550 }
551 };
552
553 let start = move || async {
554 let op = self.send().await?;
555 Ok(Operation::new(op))
556 };
557
558 use google_cloud_lro::internal::PollerExt;
559 {
560 google_cloud_lro::internal::new_poller(
561 polling_error_policy,
562 polling_backoff_policy,
563 start,
564 query,
565 )
566 }
567 .with_options(poller_options)
568 }
569
570 pub fn set_folder<T>(mut self, v: T) -> Self
574 where
575 T: std::convert::Into<crate::model::Folder>,
576 {
577 self.0.request.folder = std::option::Option::Some(v.into());
578 self
579 }
580
581 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
585 where
586 T: std::convert::Into<crate::model::Folder>,
587 {
588 self.0.request.folder = v.map(|x| x.into());
589 self
590 }
591
592 pub fn set_update_mask<T>(mut self, v: T) -> Self
596 where
597 T: std::convert::Into<wkt::FieldMask>,
598 {
599 self.0.request.update_mask = std::option::Option::Some(v.into());
600 self
601 }
602
603 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
607 where
608 T: std::convert::Into<wkt::FieldMask>,
609 {
610 self.0.request.update_mask = v.map(|x| x.into());
611 self
612 }
613 }
614
615 #[doc(hidden)]
616 impl crate::RequestBuilder for UpdateFolder {
617 fn request_options(&mut self) -> &mut crate::RequestOptions {
618 &mut self.0.options
619 }
620 }
621
622 #[derive(Clone, Debug)]
640 pub struct MoveFolder(RequestBuilder<crate::model::MoveFolderRequest>);
641
642 impl MoveFolder {
643 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
644 Self(RequestBuilder::new(stub))
645 }
646
647 pub fn with_request<V: Into<crate::model::MoveFolderRequest>>(mut self, v: V) -> Self {
649 self.0.request = v.into();
650 self
651 }
652
653 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
655 self.0.options = v.into();
656 self
657 }
658
659 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
666 (*self.0.stub)
667 .move_folder(self.0.request, self.0.options)
668 .await
669 .map(crate::Response::into_body)
670 }
671
672 pub fn poller(
674 self,
675 ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::MoveFolderMetadata>
676 {
677 type Operation = google_cloud_lro::internal::Operation<
678 crate::model::Folder,
679 crate::model::MoveFolderMetadata,
680 >;
681 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
682 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
683 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
684 if let Some(ref mut details) = poller_options.tracing {
685 details.method_name =
686 "google_cloud_resourcemanager_v3::client::Folders::move_folder::until_done";
687 }
688
689 let stub = self.0.stub.clone();
690 let mut options = self.0.options.clone();
691 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
692 let query = move |name| {
693 let stub = stub.clone();
694 let options = options.clone();
695 async {
696 let op = GetOperation::new(stub)
697 .set_name(name)
698 .with_options(options)
699 .send()
700 .await?;
701 Ok(Operation::new(op))
702 }
703 };
704
705 let start = move || async {
706 let op = self.send().await?;
707 Ok(Operation::new(op))
708 };
709
710 use google_cloud_lro::internal::PollerExt;
711 {
712 google_cloud_lro::internal::new_poller(
713 polling_error_policy,
714 polling_backoff_policy,
715 start,
716 query,
717 )
718 }
719 .with_options(poller_options)
720 }
721
722 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
726 self.0.request.name = v.into();
727 self
728 }
729
730 pub fn set_destination_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
734 self.0.request.destination_parent = v.into();
735 self
736 }
737 }
738
739 #[doc(hidden)]
740 impl crate::RequestBuilder for MoveFolder {
741 fn request_options(&mut self) -> &mut crate::RequestOptions {
742 &mut self.0.options
743 }
744 }
745
746 #[derive(Clone, Debug)]
764 pub struct DeleteFolder(RequestBuilder<crate::model::DeleteFolderRequest>);
765
766 impl DeleteFolder {
767 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
768 Self(RequestBuilder::new(stub))
769 }
770
771 pub fn with_request<V: Into<crate::model::DeleteFolderRequest>>(mut self, v: V) -> Self {
773 self.0.request = v.into();
774 self
775 }
776
777 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
779 self.0.options = v.into();
780 self
781 }
782
783 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
790 (*self.0.stub)
791 .delete_folder(self.0.request, self.0.options)
792 .await
793 .map(crate::Response::into_body)
794 }
795
796 pub fn poller(
798 self,
799 ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::DeleteFolderMetadata>
800 {
801 type Operation = google_cloud_lro::internal::Operation<
802 crate::model::Folder,
803 crate::model::DeleteFolderMetadata,
804 >;
805 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
806 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
807 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
808 if let Some(ref mut details) = poller_options.tracing {
809 details.method_name =
810 "google_cloud_resourcemanager_v3::client::Folders::delete_folder::until_done";
811 }
812
813 let stub = self.0.stub.clone();
814 let mut options = self.0.options.clone();
815 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
816 let query = move |name| {
817 let stub = stub.clone();
818 let options = options.clone();
819 async {
820 let op = GetOperation::new(stub)
821 .set_name(name)
822 .with_options(options)
823 .send()
824 .await?;
825 Ok(Operation::new(op))
826 }
827 };
828
829 let start = move || async {
830 let op = self.send().await?;
831 Ok(Operation::new(op))
832 };
833
834 use google_cloud_lro::internal::PollerExt;
835 {
836 google_cloud_lro::internal::new_poller(
837 polling_error_policy,
838 polling_backoff_policy,
839 start,
840 query,
841 )
842 }
843 .with_options(poller_options)
844 }
845
846 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
850 self.0.request.name = v.into();
851 self
852 }
853 }
854
855 #[doc(hidden)]
856 impl crate::RequestBuilder for DeleteFolder {
857 fn request_options(&mut self) -> &mut crate::RequestOptions {
858 &mut self.0.options
859 }
860 }
861
862 #[derive(Clone, Debug)]
880 pub struct UndeleteFolder(RequestBuilder<crate::model::UndeleteFolderRequest>);
881
882 impl UndeleteFolder {
883 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
884 Self(RequestBuilder::new(stub))
885 }
886
887 pub fn with_request<V: Into<crate::model::UndeleteFolderRequest>>(mut self, v: V) -> Self {
889 self.0.request = v.into();
890 self
891 }
892
893 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
895 self.0.options = v.into();
896 self
897 }
898
899 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
906 (*self.0.stub)
907 .undelete_folder(self.0.request, self.0.options)
908 .await
909 .map(crate::Response::into_body)
910 }
911
912 pub fn poller(
914 self,
915 ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::UndeleteFolderMetadata>
916 {
917 type Operation = google_cloud_lro::internal::Operation<
918 crate::model::Folder,
919 crate::model::UndeleteFolderMetadata,
920 >;
921 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
922 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
923 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
924 if let Some(ref mut details) = poller_options.tracing {
925 details.method_name =
926 "google_cloud_resourcemanager_v3::client::Folders::undelete_folder::until_done";
927 }
928
929 let stub = self.0.stub.clone();
930 let mut options = self.0.options.clone();
931 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
932 let query = move |name| {
933 let stub = stub.clone();
934 let options = options.clone();
935 async {
936 let op = GetOperation::new(stub)
937 .set_name(name)
938 .with_options(options)
939 .send()
940 .await?;
941 Ok(Operation::new(op))
942 }
943 };
944
945 let start = move || async {
946 let op = self.send().await?;
947 Ok(Operation::new(op))
948 };
949
950 use google_cloud_lro::internal::PollerExt;
951 {
952 google_cloud_lro::internal::new_poller(
953 polling_error_policy,
954 polling_backoff_policy,
955 start,
956 query,
957 )
958 }
959 .with_options(poller_options)
960 }
961
962 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
966 self.0.request.name = v.into();
967 self
968 }
969 }
970
971 #[doc(hidden)]
972 impl crate::RequestBuilder for UndeleteFolder {
973 fn request_options(&mut self) -> &mut crate::RequestOptions {
974 &mut self.0.options
975 }
976 }
977
978 #[derive(Clone, Debug)]
995 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
996
997 impl GetIamPolicy {
998 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
999 Self(RequestBuilder::new(stub))
1000 }
1001
1002 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1004 mut self,
1005 v: V,
1006 ) -> Self {
1007 self.0.request = v.into();
1008 self
1009 }
1010
1011 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1013 self.0.options = v.into();
1014 self
1015 }
1016
1017 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1019 (*self.0.stub)
1020 .get_iam_policy(self.0.request, self.0.options)
1021 .await
1022 .map(crate::Response::into_body)
1023 }
1024
1025 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1029 self.0.request.resource = v.into();
1030 self
1031 }
1032
1033 pub fn set_options<T>(mut self, v: T) -> Self
1035 where
1036 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1037 {
1038 self.0.request.options = std::option::Option::Some(v.into());
1039 self
1040 }
1041
1042 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1044 where
1045 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1046 {
1047 self.0.request.options = v.map(|x| x.into());
1048 self
1049 }
1050 }
1051
1052 #[doc(hidden)]
1053 impl crate::RequestBuilder for GetIamPolicy {
1054 fn request_options(&mut self) -> &mut crate::RequestOptions {
1055 &mut self.0.options
1056 }
1057 }
1058
1059 #[derive(Clone, Debug)]
1076 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1077
1078 impl SetIamPolicy {
1079 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
1080 Self(RequestBuilder::new(stub))
1081 }
1082
1083 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1085 mut self,
1086 v: V,
1087 ) -> Self {
1088 self.0.request = v.into();
1089 self
1090 }
1091
1092 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1094 self.0.options = v.into();
1095 self
1096 }
1097
1098 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1100 (*self.0.stub)
1101 .set_iam_policy(self.0.request, self.0.options)
1102 .await
1103 .map(crate::Response::into_body)
1104 }
1105
1106 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1110 self.0.request.resource = v.into();
1111 self
1112 }
1113
1114 pub fn set_policy<T>(mut self, v: T) -> Self
1118 where
1119 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1120 {
1121 self.0.request.policy = std::option::Option::Some(v.into());
1122 self
1123 }
1124
1125 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1129 where
1130 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1131 {
1132 self.0.request.policy = v.map(|x| x.into());
1133 self
1134 }
1135
1136 pub fn set_update_mask<T>(mut self, v: T) -> Self
1138 where
1139 T: std::convert::Into<wkt::FieldMask>,
1140 {
1141 self.0.request.update_mask = std::option::Option::Some(v.into());
1142 self
1143 }
1144
1145 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1147 where
1148 T: std::convert::Into<wkt::FieldMask>,
1149 {
1150 self.0.request.update_mask = v.map(|x| x.into());
1151 self
1152 }
1153 }
1154
1155 #[doc(hidden)]
1156 impl crate::RequestBuilder for SetIamPolicy {
1157 fn request_options(&mut self) -> &mut crate::RequestOptions {
1158 &mut self.0.options
1159 }
1160 }
1161
1162 #[derive(Clone, Debug)]
1179 pub struct TestIamPermissions(
1180 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1181 );
1182
1183 impl TestIamPermissions {
1184 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
1185 Self(RequestBuilder::new(stub))
1186 }
1187
1188 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1190 mut self,
1191 v: V,
1192 ) -> Self {
1193 self.0.request = v.into();
1194 self
1195 }
1196
1197 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1199 self.0.options = v.into();
1200 self
1201 }
1202
1203 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1205 (*self.0.stub)
1206 .test_iam_permissions(self.0.request, self.0.options)
1207 .await
1208 .map(crate::Response::into_body)
1209 }
1210
1211 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1215 self.0.request.resource = v.into();
1216 self
1217 }
1218
1219 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1223 where
1224 T: std::iter::IntoIterator<Item = V>,
1225 V: std::convert::Into<std::string::String>,
1226 {
1227 use std::iter::Iterator;
1228 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1229 self
1230 }
1231 }
1232
1233 #[doc(hidden)]
1234 impl crate::RequestBuilder for TestIamPermissions {
1235 fn request_options(&mut self) -> &mut crate::RequestOptions {
1236 &mut self.0.options
1237 }
1238 }
1239
1240 #[derive(Clone, Debug)]
1257 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1258
1259 impl GetOperation {
1260 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
1261 Self(RequestBuilder::new(stub))
1262 }
1263
1264 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1266 mut self,
1267 v: V,
1268 ) -> Self {
1269 self.0.request = v.into();
1270 self
1271 }
1272
1273 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1275 self.0.options = v.into();
1276 self
1277 }
1278
1279 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1281 (*self.0.stub)
1282 .get_operation(self.0.request, self.0.options)
1283 .await
1284 .map(crate::Response::into_body)
1285 }
1286
1287 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1289 self.0.request.name = v.into();
1290 self
1291 }
1292 }
1293
1294 #[doc(hidden)]
1295 impl crate::RequestBuilder for GetOperation {
1296 fn request_options(&mut self) -> &mut crate::RequestOptions {
1297 &mut self.0.options
1298 }
1299 }
1300}
1301
1302pub mod organizations {
1304 use crate::Result;
1305
1306 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1320
1321 pub(crate) mod client {
1322 use super::super::super::client::Organizations;
1323 pub struct Factory;
1324 impl crate::ClientFactory for Factory {
1325 type Client = Organizations;
1326 type Credentials = gaxi::options::Credentials;
1327 async fn build(
1328 self,
1329 config: gaxi::options::ClientConfig,
1330 ) -> crate::ClientBuilderResult<Self::Client> {
1331 Self::Client::new(config).await
1332 }
1333 }
1334 }
1335
1336 #[derive(Clone, Debug)]
1338 pub(crate) struct RequestBuilder<R: std::default::Default> {
1339 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1340 request: R,
1341 options: crate::RequestOptions,
1342 }
1343
1344 impl<R> RequestBuilder<R>
1345 where
1346 R: std::default::Default,
1347 {
1348 pub(crate) fn new(
1349 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1350 ) -> Self {
1351 Self {
1352 stub,
1353 request: R::default(),
1354 options: crate::RequestOptions::default(),
1355 }
1356 }
1357 }
1358
1359 #[derive(Clone, Debug)]
1376 pub struct GetOrganization(RequestBuilder<crate::model::GetOrganizationRequest>);
1377
1378 impl GetOrganization {
1379 pub(crate) fn new(
1380 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1381 ) -> Self {
1382 Self(RequestBuilder::new(stub))
1383 }
1384
1385 pub fn with_request<V: Into<crate::model::GetOrganizationRequest>>(mut self, v: V) -> Self {
1387 self.0.request = v.into();
1388 self
1389 }
1390
1391 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1393 self.0.options = v.into();
1394 self
1395 }
1396
1397 pub async fn send(self) -> Result<crate::model::Organization> {
1399 (*self.0.stub)
1400 .get_organization(self.0.request, self.0.options)
1401 .await
1402 .map(crate::Response::into_body)
1403 }
1404
1405 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1409 self.0.request.name = v.into();
1410 self
1411 }
1412 }
1413
1414 #[doc(hidden)]
1415 impl crate::RequestBuilder for GetOrganization {
1416 fn request_options(&mut self) -> &mut crate::RequestOptions {
1417 &mut self.0.options
1418 }
1419 }
1420
1421 #[derive(Clone, Debug)]
1442 pub struct SearchOrganizations(RequestBuilder<crate::model::SearchOrganizationsRequest>);
1443
1444 impl SearchOrganizations {
1445 pub(crate) fn new(
1446 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1447 ) -> Self {
1448 Self(RequestBuilder::new(stub))
1449 }
1450
1451 pub fn with_request<V: Into<crate::model::SearchOrganizationsRequest>>(
1453 mut self,
1454 v: V,
1455 ) -> Self {
1456 self.0.request = v.into();
1457 self
1458 }
1459
1460 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1462 self.0.options = v.into();
1463 self
1464 }
1465
1466 pub async fn send(self) -> Result<crate::model::SearchOrganizationsResponse> {
1468 (*self.0.stub)
1469 .search_organizations(self.0.request, self.0.options)
1470 .await
1471 .map(crate::Response::into_body)
1472 }
1473
1474 pub fn by_page(
1476 self,
1477 ) -> impl google_cloud_gax::paginator::Paginator<
1478 crate::model::SearchOrganizationsResponse,
1479 crate::Error,
1480 > {
1481 use std::clone::Clone;
1482 let token = self.0.request.page_token.clone();
1483 let execute = move |token: String| {
1484 let mut builder = self.clone();
1485 builder.0.request = builder.0.request.set_page_token(token);
1486 builder.send()
1487 };
1488 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1489 }
1490
1491 pub fn by_item(
1493 self,
1494 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1495 crate::model::SearchOrganizationsResponse,
1496 crate::Error,
1497 > {
1498 use google_cloud_gax::paginator::Paginator;
1499 self.by_page().items()
1500 }
1501
1502 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1504 self.0.request.page_size = v.into();
1505 self
1506 }
1507
1508 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1510 self.0.request.page_token = v.into();
1511 self
1512 }
1513
1514 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1516 self.0.request.query = v.into();
1517 self
1518 }
1519 }
1520
1521 #[doc(hidden)]
1522 impl crate::RequestBuilder for SearchOrganizations {
1523 fn request_options(&mut self) -> &mut crate::RequestOptions {
1524 &mut self.0.options
1525 }
1526 }
1527
1528 #[derive(Clone, Debug)]
1545 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1546
1547 impl GetIamPolicy {
1548 pub(crate) fn new(
1549 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1550 ) -> Self {
1551 Self(RequestBuilder::new(stub))
1552 }
1553
1554 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1556 mut self,
1557 v: V,
1558 ) -> Self {
1559 self.0.request = v.into();
1560 self
1561 }
1562
1563 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1565 self.0.options = v.into();
1566 self
1567 }
1568
1569 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1571 (*self.0.stub)
1572 .get_iam_policy(self.0.request, self.0.options)
1573 .await
1574 .map(crate::Response::into_body)
1575 }
1576
1577 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1581 self.0.request.resource = v.into();
1582 self
1583 }
1584
1585 pub fn set_options<T>(mut self, v: T) -> Self
1587 where
1588 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1589 {
1590 self.0.request.options = std::option::Option::Some(v.into());
1591 self
1592 }
1593
1594 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1596 where
1597 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1598 {
1599 self.0.request.options = v.map(|x| x.into());
1600 self
1601 }
1602 }
1603
1604 #[doc(hidden)]
1605 impl crate::RequestBuilder for GetIamPolicy {
1606 fn request_options(&mut self) -> &mut crate::RequestOptions {
1607 &mut self.0.options
1608 }
1609 }
1610
1611 #[derive(Clone, Debug)]
1628 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1629
1630 impl SetIamPolicy {
1631 pub(crate) fn new(
1632 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1633 ) -> Self {
1634 Self(RequestBuilder::new(stub))
1635 }
1636
1637 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1639 mut self,
1640 v: V,
1641 ) -> Self {
1642 self.0.request = v.into();
1643 self
1644 }
1645
1646 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1648 self.0.options = v.into();
1649 self
1650 }
1651
1652 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1654 (*self.0.stub)
1655 .set_iam_policy(self.0.request, self.0.options)
1656 .await
1657 .map(crate::Response::into_body)
1658 }
1659
1660 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1664 self.0.request.resource = v.into();
1665 self
1666 }
1667
1668 pub fn set_policy<T>(mut self, v: T) -> Self
1672 where
1673 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1674 {
1675 self.0.request.policy = std::option::Option::Some(v.into());
1676 self
1677 }
1678
1679 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1683 where
1684 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1685 {
1686 self.0.request.policy = v.map(|x| x.into());
1687 self
1688 }
1689
1690 pub fn set_update_mask<T>(mut self, v: T) -> Self
1692 where
1693 T: std::convert::Into<wkt::FieldMask>,
1694 {
1695 self.0.request.update_mask = std::option::Option::Some(v.into());
1696 self
1697 }
1698
1699 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1701 where
1702 T: std::convert::Into<wkt::FieldMask>,
1703 {
1704 self.0.request.update_mask = v.map(|x| x.into());
1705 self
1706 }
1707 }
1708
1709 #[doc(hidden)]
1710 impl crate::RequestBuilder for SetIamPolicy {
1711 fn request_options(&mut self) -> &mut crate::RequestOptions {
1712 &mut self.0.options
1713 }
1714 }
1715
1716 #[derive(Clone, Debug)]
1733 pub struct TestIamPermissions(
1734 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1735 );
1736
1737 impl TestIamPermissions {
1738 pub(crate) fn new(
1739 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1740 ) -> Self {
1741 Self(RequestBuilder::new(stub))
1742 }
1743
1744 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1746 mut self,
1747 v: V,
1748 ) -> Self {
1749 self.0.request = v.into();
1750 self
1751 }
1752
1753 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1755 self.0.options = v.into();
1756 self
1757 }
1758
1759 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1761 (*self.0.stub)
1762 .test_iam_permissions(self.0.request, self.0.options)
1763 .await
1764 .map(crate::Response::into_body)
1765 }
1766
1767 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1771 self.0.request.resource = v.into();
1772 self
1773 }
1774
1775 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1779 where
1780 T: std::iter::IntoIterator<Item = V>,
1781 V: std::convert::Into<std::string::String>,
1782 {
1783 use std::iter::Iterator;
1784 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1785 self
1786 }
1787 }
1788
1789 #[doc(hidden)]
1790 impl crate::RequestBuilder for TestIamPermissions {
1791 fn request_options(&mut self) -> &mut crate::RequestOptions {
1792 &mut self.0.options
1793 }
1794 }
1795
1796 #[derive(Clone, Debug)]
1813 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1814
1815 impl GetOperation {
1816 pub(crate) fn new(
1817 stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1818 ) -> Self {
1819 Self(RequestBuilder::new(stub))
1820 }
1821
1822 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1824 mut self,
1825 v: V,
1826 ) -> Self {
1827 self.0.request = v.into();
1828 self
1829 }
1830
1831 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1833 self.0.options = v.into();
1834 self
1835 }
1836
1837 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1839 (*self.0.stub)
1840 .get_operation(self.0.request, self.0.options)
1841 .await
1842 .map(crate::Response::into_body)
1843 }
1844
1845 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1847 self.0.request.name = v.into();
1848 self
1849 }
1850 }
1851
1852 #[doc(hidden)]
1853 impl crate::RequestBuilder for GetOperation {
1854 fn request_options(&mut self) -> &mut crate::RequestOptions {
1855 &mut self.0.options
1856 }
1857 }
1858}
1859
1860pub mod projects {
1862 use crate::Result;
1863
1864 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1878
1879 pub(crate) mod client {
1880 use super::super::super::client::Projects;
1881 pub struct Factory;
1882 impl crate::ClientFactory for Factory {
1883 type Client = Projects;
1884 type Credentials = gaxi::options::Credentials;
1885 async fn build(
1886 self,
1887 config: gaxi::options::ClientConfig,
1888 ) -> crate::ClientBuilderResult<Self::Client> {
1889 Self::Client::new(config).await
1890 }
1891 }
1892 }
1893
1894 #[derive(Clone, Debug)]
1896 pub(crate) struct RequestBuilder<R: std::default::Default> {
1897 stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>,
1898 request: R,
1899 options: crate::RequestOptions,
1900 }
1901
1902 impl<R> RequestBuilder<R>
1903 where
1904 R: std::default::Default,
1905 {
1906 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
1907 Self {
1908 stub,
1909 request: R::default(),
1910 options: crate::RequestOptions::default(),
1911 }
1912 }
1913 }
1914
1915 #[derive(Clone, Debug)]
1932 pub struct GetProject(RequestBuilder<crate::model::GetProjectRequest>);
1933
1934 impl GetProject {
1935 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
1936 Self(RequestBuilder::new(stub))
1937 }
1938
1939 pub fn with_request<V: Into<crate::model::GetProjectRequest>>(mut self, v: V) -> Self {
1941 self.0.request = v.into();
1942 self
1943 }
1944
1945 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1947 self.0.options = v.into();
1948 self
1949 }
1950
1951 pub async fn send(self) -> Result<crate::model::Project> {
1953 (*self.0.stub)
1954 .get_project(self.0.request, self.0.options)
1955 .await
1956 .map(crate::Response::into_body)
1957 }
1958
1959 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1963 self.0.request.name = v.into();
1964 self
1965 }
1966 }
1967
1968 #[doc(hidden)]
1969 impl crate::RequestBuilder for GetProject {
1970 fn request_options(&mut self) -> &mut crate::RequestOptions {
1971 &mut self.0.options
1972 }
1973 }
1974
1975 #[derive(Clone, Debug)]
1996 pub struct ListProjects(RequestBuilder<crate::model::ListProjectsRequest>);
1997
1998 impl ListProjects {
1999 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2000 Self(RequestBuilder::new(stub))
2001 }
2002
2003 pub fn with_request<V: Into<crate::model::ListProjectsRequest>>(mut self, v: V) -> Self {
2005 self.0.request = v.into();
2006 self
2007 }
2008
2009 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2011 self.0.options = v.into();
2012 self
2013 }
2014
2015 pub async fn send(self) -> Result<crate::model::ListProjectsResponse> {
2017 (*self.0.stub)
2018 .list_projects(self.0.request, self.0.options)
2019 .await
2020 .map(crate::Response::into_body)
2021 }
2022
2023 pub fn by_page(
2025 self,
2026 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListProjectsResponse, crate::Error>
2027 {
2028 use std::clone::Clone;
2029 let token = self.0.request.page_token.clone();
2030 let execute = move |token: String| {
2031 let mut builder = self.clone();
2032 builder.0.request = builder.0.request.set_page_token(token);
2033 builder.send()
2034 };
2035 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2036 }
2037
2038 pub fn by_item(
2040 self,
2041 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2042 crate::model::ListProjectsResponse,
2043 crate::Error,
2044 > {
2045 use google_cloud_gax::paginator::Paginator;
2046 self.by_page().items()
2047 }
2048
2049 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2053 self.0.request.parent = v.into();
2054 self
2055 }
2056
2057 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2059 self.0.request.page_token = v.into();
2060 self
2061 }
2062
2063 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2065 self.0.request.page_size = v.into();
2066 self
2067 }
2068
2069 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
2071 self.0.request.show_deleted = v.into();
2072 self
2073 }
2074 }
2075
2076 #[doc(hidden)]
2077 impl crate::RequestBuilder for ListProjects {
2078 fn request_options(&mut self) -> &mut crate::RequestOptions {
2079 &mut self.0.options
2080 }
2081 }
2082
2083 #[derive(Clone, Debug)]
2104 pub struct SearchProjects(RequestBuilder<crate::model::SearchProjectsRequest>);
2105
2106 impl SearchProjects {
2107 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2108 Self(RequestBuilder::new(stub))
2109 }
2110
2111 pub fn with_request<V: Into<crate::model::SearchProjectsRequest>>(mut self, v: V) -> Self {
2113 self.0.request = v.into();
2114 self
2115 }
2116
2117 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2119 self.0.options = v.into();
2120 self
2121 }
2122
2123 pub async fn send(self) -> Result<crate::model::SearchProjectsResponse> {
2125 (*self.0.stub)
2126 .search_projects(self.0.request, self.0.options)
2127 .await
2128 .map(crate::Response::into_body)
2129 }
2130
2131 pub fn by_page(
2133 self,
2134 ) -> impl google_cloud_gax::paginator::Paginator<
2135 crate::model::SearchProjectsResponse,
2136 crate::Error,
2137 > {
2138 use std::clone::Clone;
2139 let token = self.0.request.page_token.clone();
2140 let execute = move |token: String| {
2141 let mut builder = self.clone();
2142 builder.0.request = builder.0.request.set_page_token(token);
2143 builder.send()
2144 };
2145 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2146 }
2147
2148 pub fn by_item(
2150 self,
2151 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2152 crate::model::SearchProjectsResponse,
2153 crate::Error,
2154 > {
2155 use google_cloud_gax::paginator::Paginator;
2156 self.by_page().items()
2157 }
2158
2159 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
2161 self.0.request.query = v.into();
2162 self
2163 }
2164
2165 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2167 self.0.request.page_token = v.into();
2168 self
2169 }
2170
2171 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2173 self.0.request.page_size = v.into();
2174 self
2175 }
2176 }
2177
2178 #[doc(hidden)]
2179 impl crate::RequestBuilder for SearchProjects {
2180 fn request_options(&mut self) -> &mut crate::RequestOptions {
2181 &mut self.0.options
2182 }
2183 }
2184
2185 #[derive(Clone, Debug)]
2203 pub struct CreateProject(RequestBuilder<crate::model::CreateProjectRequest>);
2204
2205 impl CreateProject {
2206 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2207 Self(RequestBuilder::new(stub))
2208 }
2209
2210 pub fn with_request<V: Into<crate::model::CreateProjectRequest>>(mut self, v: V) -> Self {
2212 self.0.request = v.into();
2213 self
2214 }
2215
2216 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2218 self.0.options = v.into();
2219 self
2220 }
2221
2222 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2229 (*self.0.stub)
2230 .create_project(self.0.request, self.0.options)
2231 .await
2232 .map(crate::Response::into_body)
2233 }
2234
2235 pub fn poller(
2237 self,
2238 ) -> impl google_cloud_lro::Poller<crate::model::Project, crate::model::CreateProjectMetadata>
2239 {
2240 type Operation = google_cloud_lro::internal::Operation<
2241 crate::model::Project,
2242 crate::model::CreateProjectMetadata,
2243 >;
2244 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2245 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2246 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2247 if let Some(ref mut details) = poller_options.tracing {
2248 details.method_name =
2249 "google_cloud_resourcemanager_v3::client::Projects::create_project::until_done";
2250 }
2251
2252 let stub = self.0.stub.clone();
2253 let mut options = self.0.options.clone();
2254 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2255 let query = move |name| {
2256 let stub = stub.clone();
2257 let options = options.clone();
2258 async {
2259 let op = GetOperation::new(stub)
2260 .set_name(name)
2261 .with_options(options)
2262 .send()
2263 .await?;
2264 Ok(Operation::new(op))
2265 }
2266 };
2267
2268 let start = move || async {
2269 let op = self.send().await?;
2270 Ok(Operation::new(op))
2271 };
2272
2273 use google_cloud_lro::internal::PollerExt;
2274 {
2275 google_cloud_lro::internal::new_poller(
2276 polling_error_policy,
2277 polling_backoff_policy,
2278 start,
2279 query,
2280 )
2281 }
2282 .with_options(poller_options)
2283 }
2284
2285 pub fn set_project<T>(mut self, v: T) -> Self
2289 where
2290 T: std::convert::Into<crate::model::Project>,
2291 {
2292 self.0.request.project = std::option::Option::Some(v.into());
2293 self
2294 }
2295
2296 pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
2300 where
2301 T: std::convert::Into<crate::model::Project>,
2302 {
2303 self.0.request.project = v.map(|x| x.into());
2304 self
2305 }
2306 }
2307
2308 #[doc(hidden)]
2309 impl crate::RequestBuilder for CreateProject {
2310 fn request_options(&mut self) -> &mut crate::RequestOptions {
2311 &mut self.0.options
2312 }
2313 }
2314
2315 #[derive(Clone, Debug)]
2333 pub struct UpdateProject(RequestBuilder<crate::model::UpdateProjectRequest>);
2334
2335 impl UpdateProject {
2336 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2337 Self(RequestBuilder::new(stub))
2338 }
2339
2340 pub fn with_request<V: Into<crate::model::UpdateProjectRequest>>(mut self, v: V) -> Self {
2342 self.0.request = v.into();
2343 self
2344 }
2345
2346 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2348 self.0.options = v.into();
2349 self
2350 }
2351
2352 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2359 (*self.0.stub)
2360 .update_project(self.0.request, self.0.options)
2361 .await
2362 .map(crate::Response::into_body)
2363 }
2364
2365 pub fn poller(
2367 self,
2368 ) -> impl google_cloud_lro::Poller<crate::model::Project, crate::model::UpdateProjectMetadata>
2369 {
2370 type Operation = google_cloud_lro::internal::Operation<
2371 crate::model::Project,
2372 crate::model::UpdateProjectMetadata,
2373 >;
2374 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2375 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2376 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2377 if let Some(ref mut details) = poller_options.tracing {
2378 details.method_name =
2379 "google_cloud_resourcemanager_v3::client::Projects::update_project::until_done";
2380 }
2381
2382 let stub = self.0.stub.clone();
2383 let mut options = self.0.options.clone();
2384 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2385 let query = move |name| {
2386 let stub = stub.clone();
2387 let options = options.clone();
2388 async {
2389 let op = GetOperation::new(stub)
2390 .set_name(name)
2391 .with_options(options)
2392 .send()
2393 .await?;
2394 Ok(Operation::new(op))
2395 }
2396 };
2397
2398 let start = move || async {
2399 let op = self.send().await?;
2400 Ok(Operation::new(op))
2401 };
2402
2403 use google_cloud_lro::internal::PollerExt;
2404 {
2405 google_cloud_lro::internal::new_poller(
2406 polling_error_policy,
2407 polling_backoff_policy,
2408 start,
2409 query,
2410 )
2411 }
2412 .with_options(poller_options)
2413 }
2414
2415 pub fn set_project<T>(mut self, v: T) -> Self
2419 where
2420 T: std::convert::Into<crate::model::Project>,
2421 {
2422 self.0.request.project = std::option::Option::Some(v.into());
2423 self
2424 }
2425
2426 pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
2430 where
2431 T: std::convert::Into<crate::model::Project>,
2432 {
2433 self.0.request.project = v.map(|x| x.into());
2434 self
2435 }
2436
2437 pub fn set_update_mask<T>(mut self, v: T) -> Self
2439 where
2440 T: std::convert::Into<wkt::FieldMask>,
2441 {
2442 self.0.request.update_mask = std::option::Option::Some(v.into());
2443 self
2444 }
2445
2446 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2448 where
2449 T: std::convert::Into<wkt::FieldMask>,
2450 {
2451 self.0.request.update_mask = v.map(|x| x.into());
2452 self
2453 }
2454 }
2455
2456 #[doc(hidden)]
2457 impl crate::RequestBuilder for UpdateProject {
2458 fn request_options(&mut self) -> &mut crate::RequestOptions {
2459 &mut self.0.options
2460 }
2461 }
2462
2463 #[derive(Clone, Debug)]
2481 pub struct MoveProject(RequestBuilder<crate::model::MoveProjectRequest>);
2482
2483 impl MoveProject {
2484 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2485 Self(RequestBuilder::new(stub))
2486 }
2487
2488 pub fn with_request<V: Into<crate::model::MoveProjectRequest>>(mut self, v: V) -> Self {
2490 self.0.request = v.into();
2491 self
2492 }
2493
2494 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2496 self.0.options = v.into();
2497 self
2498 }
2499
2500 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2507 (*self.0.stub)
2508 .move_project(self.0.request, self.0.options)
2509 .await
2510 .map(crate::Response::into_body)
2511 }
2512
2513 pub fn poller(
2515 self,
2516 ) -> impl google_cloud_lro::Poller<crate::model::Project, crate::model::MoveProjectMetadata>
2517 {
2518 type Operation = google_cloud_lro::internal::Operation<
2519 crate::model::Project,
2520 crate::model::MoveProjectMetadata,
2521 >;
2522 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2523 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2524 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2525 if let Some(ref mut details) = poller_options.tracing {
2526 details.method_name =
2527 "google_cloud_resourcemanager_v3::client::Projects::move_project::until_done";
2528 }
2529
2530 let stub = self.0.stub.clone();
2531 let mut options = self.0.options.clone();
2532 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2533 let query = move |name| {
2534 let stub = stub.clone();
2535 let options = options.clone();
2536 async {
2537 let op = GetOperation::new(stub)
2538 .set_name(name)
2539 .with_options(options)
2540 .send()
2541 .await?;
2542 Ok(Operation::new(op))
2543 }
2544 };
2545
2546 let start = move || async {
2547 let op = self.send().await?;
2548 Ok(Operation::new(op))
2549 };
2550
2551 use google_cloud_lro::internal::PollerExt;
2552 {
2553 google_cloud_lro::internal::new_poller(
2554 polling_error_policy,
2555 polling_backoff_policy,
2556 start,
2557 query,
2558 )
2559 }
2560 .with_options(poller_options)
2561 }
2562
2563 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2567 self.0.request.name = v.into();
2568 self
2569 }
2570
2571 pub fn set_destination_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2575 self.0.request.destination_parent = v.into();
2576 self
2577 }
2578 }
2579
2580 #[doc(hidden)]
2581 impl crate::RequestBuilder for MoveProject {
2582 fn request_options(&mut self) -> &mut crate::RequestOptions {
2583 &mut self.0.options
2584 }
2585 }
2586
2587 #[derive(Clone, Debug)]
2605 pub struct DeleteProject(RequestBuilder<crate::model::DeleteProjectRequest>);
2606
2607 impl DeleteProject {
2608 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2609 Self(RequestBuilder::new(stub))
2610 }
2611
2612 pub fn with_request<V: Into<crate::model::DeleteProjectRequest>>(mut self, v: V) -> Self {
2614 self.0.request = v.into();
2615 self
2616 }
2617
2618 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2620 self.0.options = v.into();
2621 self
2622 }
2623
2624 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2631 (*self.0.stub)
2632 .delete_project(self.0.request, self.0.options)
2633 .await
2634 .map(crate::Response::into_body)
2635 }
2636
2637 pub fn poller(
2639 self,
2640 ) -> impl google_cloud_lro::Poller<crate::model::Project, crate::model::DeleteProjectMetadata>
2641 {
2642 type Operation = google_cloud_lro::internal::Operation<
2643 crate::model::Project,
2644 crate::model::DeleteProjectMetadata,
2645 >;
2646 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2647 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2648 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2649 if let Some(ref mut details) = poller_options.tracing {
2650 details.method_name =
2651 "google_cloud_resourcemanager_v3::client::Projects::delete_project::until_done";
2652 }
2653
2654 let stub = self.0.stub.clone();
2655 let mut options = self.0.options.clone();
2656 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2657 let query = move |name| {
2658 let stub = stub.clone();
2659 let options = options.clone();
2660 async {
2661 let op = GetOperation::new(stub)
2662 .set_name(name)
2663 .with_options(options)
2664 .send()
2665 .await?;
2666 Ok(Operation::new(op))
2667 }
2668 };
2669
2670 let start = move || async {
2671 let op = self.send().await?;
2672 Ok(Operation::new(op))
2673 };
2674
2675 use google_cloud_lro::internal::PollerExt;
2676 {
2677 google_cloud_lro::internal::new_poller(
2678 polling_error_policy,
2679 polling_backoff_policy,
2680 start,
2681 query,
2682 )
2683 }
2684 .with_options(poller_options)
2685 }
2686
2687 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2691 self.0.request.name = v.into();
2692 self
2693 }
2694 }
2695
2696 #[doc(hidden)]
2697 impl crate::RequestBuilder for DeleteProject {
2698 fn request_options(&mut self) -> &mut crate::RequestOptions {
2699 &mut self.0.options
2700 }
2701 }
2702
2703 #[derive(Clone, Debug)]
2721 pub struct UndeleteProject(RequestBuilder<crate::model::UndeleteProjectRequest>);
2722
2723 impl UndeleteProject {
2724 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2725 Self(RequestBuilder::new(stub))
2726 }
2727
2728 pub fn with_request<V: Into<crate::model::UndeleteProjectRequest>>(mut self, v: V) -> Self {
2730 self.0.request = v.into();
2731 self
2732 }
2733
2734 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2736 self.0.options = v.into();
2737 self
2738 }
2739
2740 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2747 (*self.0.stub)
2748 .undelete_project(self.0.request, self.0.options)
2749 .await
2750 .map(crate::Response::into_body)
2751 }
2752
2753 pub fn poller(
2755 self,
2756 ) -> impl google_cloud_lro::Poller<crate::model::Project, crate::model::UndeleteProjectMetadata>
2757 {
2758 type Operation = google_cloud_lro::internal::Operation<
2759 crate::model::Project,
2760 crate::model::UndeleteProjectMetadata,
2761 >;
2762 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2763 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2764 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2765 if let Some(ref mut details) = poller_options.tracing {
2766 details.method_name = "google_cloud_resourcemanager_v3::client::Projects::undelete_project::until_done";
2767 }
2768
2769 let stub = self.0.stub.clone();
2770 let mut options = self.0.options.clone();
2771 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2772 let query = move |name| {
2773 let stub = stub.clone();
2774 let options = options.clone();
2775 async {
2776 let op = GetOperation::new(stub)
2777 .set_name(name)
2778 .with_options(options)
2779 .send()
2780 .await?;
2781 Ok(Operation::new(op))
2782 }
2783 };
2784
2785 let start = move || async {
2786 let op = self.send().await?;
2787 Ok(Operation::new(op))
2788 };
2789
2790 use google_cloud_lro::internal::PollerExt;
2791 {
2792 google_cloud_lro::internal::new_poller(
2793 polling_error_policy,
2794 polling_backoff_policy,
2795 start,
2796 query,
2797 )
2798 }
2799 .with_options(poller_options)
2800 }
2801
2802 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2806 self.0.request.name = v.into();
2807 self
2808 }
2809 }
2810
2811 #[doc(hidden)]
2812 impl crate::RequestBuilder for UndeleteProject {
2813 fn request_options(&mut self) -> &mut crate::RequestOptions {
2814 &mut self.0.options
2815 }
2816 }
2817
2818 #[derive(Clone, Debug)]
2835 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2836
2837 impl GetIamPolicy {
2838 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2839 Self(RequestBuilder::new(stub))
2840 }
2841
2842 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2844 mut self,
2845 v: V,
2846 ) -> Self {
2847 self.0.request = v.into();
2848 self
2849 }
2850
2851 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2853 self.0.options = v.into();
2854 self
2855 }
2856
2857 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2859 (*self.0.stub)
2860 .get_iam_policy(self.0.request, self.0.options)
2861 .await
2862 .map(crate::Response::into_body)
2863 }
2864
2865 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2869 self.0.request.resource = v.into();
2870 self
2871 }
2872
2873 pub fn set_options<T>(mut self, v: T) -> Self
2875 where
2876 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2877 {
2878 self.0.request.options = std::option::Option::Some(v.into());
2879 self
2880 }
2881
2882 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2884 where
2885 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2886 {
2887 self.0.request.options = v.map(|x| x.into());
2888 self
2889 }
2890 }
2891
2892 #[doc(hidden)]
2893 impl crate::RequestBuilder for GetIamPolicy {
2894 fn request_options(&mut self) -> &mut crate::RequestOptions {
2895 &mut self.0.options
2896 }
2897 }
2898
2899 #[derive(Clone, Debug)]
2916 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2917
2918 impl SetIamPolicy {
2919 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2920 Self(RequestBuilder::new(stub))
2921 }
2922
2923 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2925 mut self,
2926 v: V,
2927 ) -> Self {
2928 self.0.request = v.into();
2929 self
2930 }
2931
2932 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2934 self.0.options = v.into();
2935 self
2936 }
2937
2938 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2940 (*self.0.stub)
2941 .set_iam_policy(self.0.request, self.0.options)
2942 .await
2943 .map(crate::Response::into_body)
2944 }
2945
2946 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2950 self.0.request.resource = v.into();
2951 self
2952 }
2953
2954 pub fn set_policy<T>(mut self, v: T) -> Self
2958 where
2959 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2960 {
2961 self.0.request.policy = std::option::Option::Some(v.into());
2962 self
2963 }
2964
2965 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2969 where
2970 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2971 {
2972 self.0.request.policy = v.map(|x| x.into());
2973 self
2974 }
2975
2976 pub fn set_update_mask<T>(mut self, v: T) -> Self
2978 where
2979 T: std::convert::Into<wkt::FieldMask>,
2980 {
2981 self.0.request.update_mask = std::option::Option::Some(v.into());
2982 self
2983 }
2984
2985 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2987 where
2988 T: std::convert::Into<wkt::FieldMask>,
2989 {
2990 self.0.request.update_mask = v.map(|x| x.into());
2991 self
2992 }
2993 }
2994
2995 #[doc(hidden)]
2996 impl crate::RequestBuilder for SetIamPolicy {
2997 fn request_options(&mut self) -> &mut crate::RequestOptions {
2998 &mut self.0.options
2999 }
3000 }
3001
3002 #[derive(Clone, Debug)]
3019 pub struct TestIamPermissions(
3020 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3021 );
3022
3023 impl TestIamPermissions {
3024 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
3025 Self(RequestBuilder::new(stub))
3026 }
3027
3028 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3030 mut self,
3031 v: V,
3032 ) -> Self {
3033 self.0.request = v.into();
3034 self
3035 }
3036
3037 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3039 self.0.options = v.into();
3040 self
3041 }
3042
3043 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3045 (*self.0.stub)
3046 .test_iam_permissions(self.0.request, self.0.options)
3047 .await
3048 .map(crate::Response::into_body)
3049 }
3050
3051 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3055 self.0.request.resource = v.into();
3056 self
3057 }
3058
3059 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3063 where
3064 T: std::iter::IntoIterator<Item = V>,
3065 V: std::convert::Into<std::string::String>,
3066 {
3067 use std::iter::Iterator;
3068 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3069 self
3070 }
3071 }
3072
3073 #[doc(hidden)]
3074 impl crate::RequestBuilder for TestIamPermissions {
3075 fn request_options(&mut self) -> &mut crate::RequestOptions {
3076 &mut self.0.options
3077 }
3078 }
3079
3080 #[derive(Clone, Debug)]
3097 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3098
3099 impl GetOperation {
3100 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
3101 Self(RequestBuilder::new(stub))
3102 }
3103
3104 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3106 mut self,
3107 v: V,
3108 ) -> Self {
3109 self.0.request = v.into();
3110 self
3111 }
3112
3113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3115 self.0.options = v.into();
3116 self
3117 }
3118
3119 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3121 (*self.0.stub)
3122 .get_operation(self.0.request, self.0.options)
3123 .await
3124 .map(crate::Response::into_body)
3125 }
3126
3127 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3129 self.0.request.name = v.into();
3130 self
3131 }
3132 }
3133
3134 #[doc(hidden)]
3135 impl crate::RequestBuilder for GetOperation {
3136 fn request_options(&mut self) -> &mut crate::RequestOptions {
3137 &mut self.0.options
3138 }
3139 }
3140}
3141
3142pub mod tag_bindings {
3144 use crate::Result;
3145
3146 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3160
3161 pub(crate) mod client {
3162 use super::super::super::client::TagBindings;
3163 pub struct Factory;
3164 impl crate::ClientFactory for Factory {
3165 type Client = TagBindings;
3166 type Credentials = gaxi::options::Credentials;
3167 async fn build(
3168 self,
3169 config: gaxi::options::ClientConfig,
3170 ) -> crate::ClientBuilderResult<Self::Client> {
3171 Self::Client::new(config).await
3172 }
3173 }
3174 }
3175
3176 #[derive(Clone, Debug)]
3178 pub(crate) struct RequestBuilder<R: std::default::Default> {
3179 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3180 request: R,
3181 options: crate::RequestOptions,
3182 }
3183
3184 impl<R> RequestBuilder<R>
3185 where
3186 R: std::default::Default,
3187 {
3188 pub(crate) fn new(
3189 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3190 ) -> Self {
3191 Self {
3192 stub,
3193 request: R::default(),
3194 options: crate::RequestOptions::default(),
3195 }
3196 }
3197 }
3198
3199 #[derive(Clone, Debug)]
3220 pub struct ListTagBindings(RequestBuilder<crate::model::ListTagBindingsRequest>);
3221
3222 impl ListTagBindings {
3223 pub(crate) fn new(
3224 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3225 ) -> Self {
3226 Self(RequestBuilder::new(stub))
3227 }
3228
3229 pub fn with_request<V: Into<crate::model::ListTagBindingsRequest>>(mut self, v: V) -> Self {
3231 self.0.request = v.into();
3232 self
3233 }
3234
3235 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3237 self.0.options = v.into();
3238 self
3239 }
3240
3241 pub async fn send(self) -> Result<crate::model::ListTagBindingsResponse> {
3243 (*self.0.stub)
3244 .list_tag_bindings(self.0.request, self.0.options)
3245 .await
3246 .map(crate::Response::into_body)
3247 }
3248
3249 pub fn by_page(
3251 self,
3252 ) -> impl google_cloud_gax::paginator::Paginator<
3253 crate::model::ListTagBindingsResponse,
3254 crate::Error,
3255 > {
3256 use std::clone::Clone;
3257 let token = self.0.request.page_token.clone();
3258 let execute = move |token: String| {
3259 let mut builder = self.clone();
3260 builder.0.request = builder.0.request.set_page_token(token);
3261 builder.send()
3262 };
3263 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3264 }
3265
3266 pub fn by_item(
3268 self,
3269 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3270 crate::model::ListTagBindingsResponse,
3271 crate::Error,
3272 > {
3273 use google_cloud_gax::paginator::Paginator;
3274 self.by_page().items()
3275 }
3276
3277 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3281 self.0.request.parent = v.into();
3282 self
3283 }
3284
3285 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3287 self.0.request.page_size = v.into();
3288 self
3289 }
3290
3291 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3293 self.0.request.page_token = v.into();
3294 self
3295 }
3296 }
3297
3298 #[doc(hidden)]
3299 impl crate::RequestBuilder for ListTagBindings {
3300 fn request_options(&mut self) -> &mut crate::RequestOptions {
3301 &mut self.0.options
3302 }
3303 }
3304
3305 #[derive(Clone, Debug)]
3323 pub struct CreateTagBinding(RequestBuilder<crate::model::CreateTagBindingRequest>);
3324
3325 impl CreateTagBinding {
3326 pub(crate) fn new(
3327 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3328 ) -> Self {
3329 Self(RequestBuilder::new(stub))
3330 }
3331
3332 pub fn with_request<V: Into<crate::model::CreateTagBindingRequest>>(
3334 mut self,
3335 v: V,
3336 ) -> Self {
3337 self.0.request = v.into();
3338 self
3339 }
3340
3341 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3343 self.0.options = v.into();
3344 self
3345 }
3346
3347 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3354 (*self.0.stub)
3355 .create_tag_binding(self.0.request, self.0.options)
3356 .await
3357 .map(crate::Response::into_body)
3358 }
3359
3360 pub fn poller(
3362 self,
3363 ) -> impl google_cloud_lro::Poller<
3364 crate::model::TagBinding,
3365 crate::model::CreateTagBindingMetadata,
3366 > {
3367 type Operation = google_cloud_lro::internal::Operation<
3368 crate::model::TagBinding,
3369 crate::model::CreateTagBindingMetadata,
3370 >;
3371 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3372 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3373 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3374 if let Some(ref mut details) = poller_options.tracing {
3375 details.method_name = "google_cloud_resourcemanager_v3::client::TagBindings::create_tag_binding::until_done";
3376 }
3377
3378 let stub = self.0.stub.clone();
3379 let mut options = self.0.options.clone();
3380 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3381 let query = move |name| {
3382 let stub = stub.clone();
3383 let options = options.clone();
3384 async {
3385 let op = GetOperation::new(stub)
3386 .set_name(name)
3387 .with_options(options)
3388 .send()
3389 .await?;
3390 Ok(Operation::new(op))
3391 }
3392 };
3393
3394 let start = move || async {
3395 let op = self.send().await?;
3396 Ok(Operation::new(op))
3397 };
3398
3399 use google_cloud_lro::internal::PollerExt;
3400 {
3401 google_cloud_lro::internal::new_poller(
3402 polling_error_policy,
3403 polling_backoff_policy,
3404 start,
3405 query,
3406 )
3407 }
3408 .with_options(poller_options)
3409 }
3410
3411 pub fn set_tag_binding<T>(mut self, v: T) -> Self
3415 where
3416 T: std::convert::Into<crate::model::TagBinding>,
3417 {
3418 self.0.request.tag_binding = std::option::Option::Some(v.into());
3419 self
3420 }
3421
3422 pub fn set_or_clear_tag_binding<T>(mut self, v: std::option::Option<T>) -> Self
3426 where
3427 T: std::convert::Into<crate::model::TagBinding>,
3428 {
3429 self.0.request.tag_binding = v.map(|x| x.into());
3430 self
3431 }
3432
3433 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3435 self.0.request.validate_only = v.into();
3436 self
3437 }
3438 }
3439
3440 #[doc(hidden)]
3441 impl crate::RequestBuilder for CreateTagBinding {
3442 fn request_options(&mut self) -> &mut crate::RequestOptions {
3443 &mut self.0.options
3444 }
3445 }
3446
3447 #[derive(Clone, Debug)]
3465 pub struct DeleteTagBinding(RequestBuilder<crate::model::DeleteTagBindingRequest>);
3466
3467 impl DeleteTagBinding {
3468 pub(crate) fn new(
3469 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3470 ) -> Self {
3471 Self(RequestBuilder::new(stub))
3472 }
3473
3474 pub fn with_request<V: Into<crate::model::DeleteTagBindingRequest>>(
3476 mut self,
3477 v: V,
3478 ) -> Self {
3479 self.0.request = v.into();
3480 self
3481 }
3482
3483 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3485 self.0.options = v.into();
3486 self
3487 }
3488
3489 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3496 (*self.0.stub)
3497 .delete_tag_binding(self.0.request, self.0.options)
3498 .await
3499 .map(crate::Response::into_body)
3500 }
3501
3502 pub fn poller(
3504 self,
3505 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteTagBindingMetadata> {
3506 type Operation = google_cloud_lro::internal::Operation<
3507 wkt::Empty,
3508 crate::model::DeleteTagBindingMetadata,
3509 >;
3510 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3511 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3512 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3513 if let Some(ref mut details) = poller_options.tracing {
3514 details.method_name = "google_cloud_resourcemanager_v3::client::TagBindings::delete_tag_binding::until_done";
3515 }
3516
3517 let stub = self.0.stub.clone();
3518 let mut options = self.0.options.clone();
3519 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3520 let query = move |name| {
3521 let stub = stub.clone();
3522 let options = options.clone();
3523 async {
3524 let op = GetOperation::new(stub)
3525 .set_name(name)
3526 .with_options(options)
3527 .send()
3528 .await?;
3529 Ok(Operation::new(op))
3530 }
3531 };
3532
3533 let start = move || async {
3534 let op = self.send().await?;
3535 Ok(Operation::new(op))
3536 };
3537
3538 use google_cloud_lro::internal::PollerExt;
3539 {
3540 google_cloud_lro::internal::new_unit_response_poller(
3541 polling_error_policy,
3542 polling_backoff_policy,
3543 start,
3544 query,
3545 )
3546 }
3547 .with_options(poller_options)
3548 }
3549
3550 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3554 self.0.request.name = v.into();
3555 self
3556 }
3557 }
3558
3559 #[doc(hidden)]
3560 impl crate::RequestBuilder for DeleteTagBinding {
3561 fn request_options(&mut self) -> &mut crate::RequestOptions {
3562 &mut self.0.options
3563 }
3564 }
3565
3566 #[derive(Clone, Debug)]
3587 pub struct ListEffectiveTags(RequestBuilder<crate::model::ListEffectiveTagsRequest>);
3588
3589 impl ListEffectiveTags {
3590 pub(crate) fn new(
3591 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3592 ) -> Self {
3593 Self(RequestBuilder::new(stub))
3594 }
3595
3596 pub fn with_request<V: Into<crate::model::ListEffectiveTagsRequest>>(
3598 mut self,
3599 v: V,
3600 ) -> Self {
3601 self.0.request = v.into();
3602 self
3603 }
3604
3605 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3607 self.0.options = v.into();
3608 self
3609 }
3610
3611 pub async fn send(self) -> Result<crate::model::ListEffectiveTagsResponse> {
3613 (*self.0.stub)
3614 .list_effective_tags(self.0.request, self.0.options)
3615 .await
3616 .map(crate::Response::into_body)
3617 }
3618
3619 pub fn by_page(
3621 self,
3622 ) -> impl google_cloud_gax::paginator::Paginator<
3623 crate::model::ListEffectiveTagsResponse,
3624 crate::Error,
3625 > {
3626 use std::clone::Clone;
3627 let token = self.0.request.page_token.clone();
3628 let execute = move |token: String| {
3629 let mut builder = self.clone();
3630 builder.0.request = builder.0.request.set_page_token(token);
3631 builder.send()
3632 };
3633 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3634 }
3635
3636 pub fn by_item(
3638 self,
3639 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3640 crate::model::ListEffectiveTagsResponse,
3641 crate::Error,
3642 > {
3643 use google_cloud_gax::paginator::Paginator;
3644 self.by_page().items()
3645 }
3646
3647 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3651 self.0.request.parent = v.into();
3652 self
3653 }
3654
3655 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3657 self.0.request.page_size = v.into();
3658 self
3659 }
3660
3661 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3663 self.0.request.page_token = v.into();
3664 self
3665 }
3666 }
3667
3668 #[doc(hidden)]
3669 impl crate::RequestBuilder for ListEffectiveTags {
3670 fn request_options(&mut self) -> &mut crate::RequestOptions {
3671 &mut self.0.options
3672 }
3673 }
3674
3675 #[derive(Clone, Debug)]
3692 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3693
3694 impl GetOperation {
3695 pub(crate) fn new(
3696 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3697 ) -> Self {
3698 Self(RequestBuilder::new(stub))
3699 }
3700
3701 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3703 mut self,
3704 v: V,
3705 ) -> Self {
3706 self.0.request = v.into();
3707 self
3708 }
3709
3710 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3712 self.0.options = v.into();
3713 self
3714 }
3715
3716 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3718 (*self.0.stub)
3719 .get_operation(self.0.request, self.0.options)
3720 .await
3721 .map(crate::Response::into_body)
3722 }
3723
3724 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3726 self.0.request.name = v.into();
3727 self
3728 }
3729 }
3730
3731 #[doc(hidden)]
3732 impl crate::RequestBuilder for GetOperation {
3733 fn request_options(&mut self) -> &mut crate::RequestOptions {
3734 &mut self.0.options
3735 }
3736 }
3737}
3738
3739pub mod tag_holds {
3741 use crate::Result;
3742
3743 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3757
3758 pub(crate) mod client {
3759 use super::super::super::client::TagHolds;
3760 pub struct Factory;
3761 impl crate::ClientFactory for Factory {
3762 type Client = TagHolds;
3763 type Credentials = gaxi::options::Credentials;
3764 async fn build(
3765 self,
3766 config: gaxi::options::ClientConfig,
3767 ) -> crate::ClientBuilderResult<Self::Client> {
3768 Self::Client::new(config).await
3769 }
3770 }
3771 }
3772
3773 #[derive(Clone, Debug)]
3775 pub(crate) struct RequestBuilder<R: std::default::Default> {
3776 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>,
3777 request: R,
3778 options: crate::RequestOptions,
3779 }
3780
3781 impl<R> RequestBuilder<R>
3782 where
3783 R: std::default::Default,
3784 {
3785 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3786 Self {
3787 stub,
3788 request: R::default(),
3789 options: crate::RequestOptions::default(),
3790 }
3791 }
3792 }
3793
3794 #[derive(Clone, Debug)]
3812 pub struct CreateTagHold(RequestBuilder<crate::model::CreateTagHoldRequest>);
3813
3814 impl CreateTagHold {
3815 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3816 Self(RequestBuilder::new(stub))
3817 }
3818
3819 pub fn with_request<V: Into<crate::model::CreateTagHoldRequest>>(mut self, v: V) -> Self {
3821 self.0.request = v.into();
3822 self
3823 }
3824
3825 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3827 self.0.options = v.into();
3828 self
3829 }
3830
3831 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3838 (*self.0.stub)
3839 .create_tag_hold(self.0.request, self.0.options)
3840 .await
3841 .map(crate::Response::into_body)
3842 }
3843
3844 pub fn poller(
3846 self,
3847 ) -> impl google_cloud_lro::Poller<crate::model::TagHold, crate::model::CreateTagHoldMetadata>
3848 {
3849 type Operation = google_cloud_lro::internal::Operation<
3850 crate::model::TagHold,
3851 crate::model::CreateTagHoldMetadata,
3852 >;
3853 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3854 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3855 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3856 if let Some(ref mut details) = poller_options.tracing {
3857 details.method_name = "google_cloud_resourcemanager_v3::client::TagHolds::create_tag_hold::until_done";
3858 }
3859
3860 let stub = self.0.stub.clone();
3861 let mut options = self.0.options.clone();
3862 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3863 let query = move |name| {
3864 let stub = stub.clone();
3865 let options = options.clone();
3866 async {
3867 let op = GetOperation::new(stub)
3868 .set_name(name)
3869 .with_options(options)
3870 .send()
3871 .await?;
3872 Ok(Operation::new(op))
3873 }
3874 };
3875
3876 let start = move || async {
3877 let op = self.send().await?;
3878 Ok(Operation::new(op))
3879 };
3880
3881 use google_cloud_lro::internal::PollerExt;
3882 {
3883 google_cloud_lro::internal::new_poller(
3884 polling_error_policy,
3885 polling_backoff_policy,
3886 start,
3887 query,
3888 )
3889 }
3890 .with_options(poller_options)
3891 }
3892
3893 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3897 self.0.request.parent = v.into();
3898 self
3899 }
3900
3901 pub fn set_tag_hold<T>(mut self, v: T) -> Self
3905 where
3906 T: std::convert::Into<crate::model::TagHold>,
3907 {
3908 self.0.request.tag_hold = std::option::Option::Some(v.into());
3909 self
3910 }
3911
3912 pub fn set_or_clear_tag_hold<T>(mut self, v: std::option::Option<T>) -> Self
3916 where
3917 T: std::convert::Into<crate::model::TagHold>,
3918 {
3919 self.0.request.tag_hold = v.map(|x| x.into());
3920 self
3921 }
3922
3923 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3925 self.0.request.validate_only = v.into();
3926 self
3927 }
3928 }
3929
3930 #[doc(hidden)]
3931 impl crate::RequestBuilder for CreateTagHold {
3932 fn request_options(&mut self) -> &mut crate::RequestOptions {
3933 &mut self.0.options
3934 }
3935 }
3936
3937 #[derive(Clone, Debug)]
3955 pub struct DeleteTagHold(RequestBuilder<crate::model::DeleteTagHoldRequest>);
3956
3957 impl DeleteTagHold {
3958 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3959 Self(RequestBuilder::new(stub))
3960 }
3961
3962 pub fn with_request<V: Into<crate::model::DeleteTagHoldRequest>>(mut self, v: V) -> Self {
3964 self.0.request = v.into();
3965 self
3966 }
3967
3968 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3970 self.0.options = v.into();
3971 self
3972 }
3973
3974 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3981 (*self.0.stub)
3982 .delete_tag_hold(self.0.request, self.0.options)
3983 .await
3984 .map(crate::Response::into_body)
3985 }
3986
3987 pub fn poller(
3989 self,
3990 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteTagHoldMetadata> {
3991 type Operation = google_cloud_lro::internal::Operation<
3992 wkt::Empty,
3993 crate::model::DeleteTagHoldMetadata,
3994 >;
3995 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3996 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3997 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3998 if let Some(ref mut details) = poller_options.tracing {
3999 details.method_name = "google_cloud_resourcemanager_v3::client::TagHolds::delete_tag_hold::until_done";
4000 }
4001
4002 let stub = self.0.stub.clone();
4003 let mut options = self.0.options.clone();
4004 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4005 let query = move |name| {
4006 let stub = stub.clone();
4007 let options = options.clone();
4008 async {
4009 let op = GetOperation::new(stub)
4010 .set_name(name)
4011 .with_options(options)
4012 .send()
4013 .await?;
4014 Ok(Operation::new(op))
4015 }
4016 };
4017
4018 let start = move || async {
4019 let op = self.send().await?;
4020 Ok(Operation::new(op))
4021 };
4022
4023 use google_cloud_lro::internal::PollerExt;
4024 {
4025 google_cloud_lro::internal::new_unit_response_poller(
4026 polling_error_policy,
4027 polling_backoff_policy,
4028 start,
4029 query,
4030 )
4031 }
4032 .with_options(poller_options)
4033 }
4034
4035 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4039 self.0.request.name = v.into();
4040 self
4041 }
4042
4043 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4045 self.0.request.validate_only = v.into();
4046 self
4047 }
4048 }
4049
4050 #[doc(hidden)]
4051 impl crate::RequestBuilder for DeleteTagHold {
4052 fn request_options(&mut self) -> &mut crate::RequestOptions {
4053 &mut self.0.options
4054 }
4055 }
4056
4057 #[derive(Clone, Debug)]
4078 pub struct ListTagHolds(RequestBuilder<crate::model::ListTagHoldsRequest>);
4079
4080 impl ListTagHolds {
4081 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
4082 Self(RequestBuilder::new(stub))
4083 }
4084
4085 pub fn with_request<V: Into<crate::model::ListTagHoldsRequest>>(mut self, v: V) -> Self {
4087 self.0.request = v.into();
4088 self
4089 }
4090
4091 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4093 self.0.options = v.into();
4094 self
4095 }
4096
4097 pub async fn send(self) -> Result<crate::model::ListTagHoldsResponse> {
4099 (*self.0.stub)
4100 .list_tag_holds(self.0.request, self.0.options)
4101 .await
4102 .map(crate::Response::into_body)
4103 }
4104
4105 pub fn by_page(
4107 self,
4108 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTagHoldsResponse, crate::Error>
4109 {
4110 use std::clone::Clone;
4111 let token = self.0.request.page_token.clone();
4112 let execute = move |token: String| {
4113 let mut builder = self.clone();
4114 builder.0.request = builder.0.request.set_page_token(token);
4115 builder.send()
4116 };
4117 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4118 }
4119
4120 pub fn by_item(
4122 self,
4123 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4124 crate::model::ListTagHoldsResponse,
4125 crate::Error,
4126 > {
4127 use google_cloud_gax::paginator::Paginator;
4128 self.by_page().items()
4129 }
4130
4131 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4135 self.0.request.parent = v.into();
4136 self
4137 }
4138
4139 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4141 self.0.request.page_size = v.into();
4142 self
4143 }
4144
4145 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4147 self.0.request.page_token = v.into();
4148 self
4149 }
4150
4151 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4153 self.0.request.filter = v.into();
4154 self
4155 }
4156 }
4157
4158 #[doc(hidden)]
4159 impl crate::RequestBuilder for ListTagHolds {
4160 fn request_options(&mut self) -> &mut crate::RequestOptions {
4161 &mut self.0.options
4162 }
4163 }
4164
4165 #[derive(Clone, Debug)]
4182 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4183
4184 impl GetOperation {
4185 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
4186 Self(RequestBuilder::new(stub))
4187 }
4188
4189 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4191 mut self,
4192 v: V,
4193 ) -> Self {
4194 self.0.request = v.into();
4195 self
4196 }
4197
4198 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4200 self.0.options = v.into();
4201 self
4202 }
4203
4204 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4206 (*self.0.stub)
4207 .get_operation(self.0.request, self.0.options)
4208 .await
4209 .map(crate::Response::into_body)
4210 }
4211
4212 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4214 self.0.request.name = v.into();
4215 self
4216 }
4217 }
4218
4219 #[doc(hidden)]
4220 impl crate::RequestBuilder for GetOperation {
4221 fn request_options(&mut self) -> &mut crate::RequestOptions {
4222 &mut self.0.options
4223 }
4224 }
4225}
4226
4227pub mod tag_keys {
4229 use crate::Result;
4230
4231 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4245
4246 pub(crate) mod client {
4247 use super::super::super::client::TagKeys;
4248 pub struct Factory;
4249 impl crate::ClientFactory for Factory {
4250 type Client = TagKeys;
4251 type Credentials = gaxi::options::Credentials;
4252 async fn build(
4253 self,
4254 config: gaxi::options::ClientConfig,
4255 ) -> crate::ClientBuilderResult<Self::Client> {
4256 Self::Client::new(config).await
4257 }
4258 }
4259 }
4260
4261 #[derive(Clone, Debug)]
4263 pub(crate) struct RequestBuilder<R: std::default::Default> {
4264 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>,
4265 request: R,
4266 options: crate::RequestOptions,
4267 }
4268
4269 impl<R> RequestBuilder<R>
4270 where
4271 R: std::default::Default,
4272 {
4273 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4274 Self {
4275 stub,
4276 request: R::default(),
4277 options: crate::RequestOptions::default(),
4278 }
4279 }
4280 }
4281
4282 #[derive(Clone, Debug)]
4303 pub struct ListTagKeys(RequestBuilder<crate::model::ListTagKeysRequest>);
4304
4305 impl ListTagKeys {
4306 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4307 Self(RequestBuilder::new(stub))
4308 }
4309
4310 pub fn with_request<V: Into<crate::model::ListTagKeysRequest>>(mut self, v: V) -> Self {
4312 self.0.request = v.into();
4313 self
4314 }
4315
4316 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4318 self.0.options = v.into();
4319 self
4320 }
4321
4322 pub async fn send(self) -> Result<crate::model::ListTagKeysResponse> {
4324 (*self.0.stub)
4325 .list_tag_keys(self.0.request, self.0.options)
4326 .await
4327 .map(crate::Response::into_body)
4328 }
4329
4330 pub fn by_page(
4332 self,
4333 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTagKeysResponse, crate::Error>
4334 {
4335 use std::clone::Clone;
4336 let token = self.0.request.page_token.clone();
4337 let execute = move |token: String| {
4338 let mut builder = self.clone();
4339 builder.0.request = builder.0.request.set_page_token(token);
4340 builder.send()
4341 };
4342 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4343 }
4344
4345 pub fn by_item(
4347 self,
4348 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4349 crate::model::ListTagKeysResponse,
4350 crate::Error,
4351 > {
4352 use google_cloud_gax::paginator::Paginator;
4353 self.by_page().items()
4354 }
4355
4356 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4360 self.0.request.parent = v.into();
4361 self
4362 }
4363
4364 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4366 self.0.request.page_size = v.into();
4367 self
4368 }
4369
4370 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4372 self.0.request.page_token = v.into();
4373 self
4374 }
4375 }
4376
4377 #[doc(hidden)]
4378 impl crate::RequestBuilder for ListTagKeys {
4379 fn request_options(&mut self) -> &mut crate::RequestOptions {
4380 &mut self.0.options
4381 }
4382 }
4383
4384 #[derive(Clone, Debug)]
4401 pub struct GetTagKey(RequestBuilder<crate::model::GetTagKeyRequest>);
4402
4403 impl GetTagKey {
4404 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4405 Self(RequestBuilder::new(stub))
4406 }
4407
4408 pub fn with_request<V: Into<crate::model::GetTagKeyRequest>>(mut self, v: V) -> Self {
4410 self.0.request = v.into();
4411 self
4412 }
4413
4414 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4416 self.0.options = v.into();
4417 self
4418 }
4419
4420 pub async fn send(self) -> Result<crate::model::TagKey> {
4422 (*self.0.stub)
4423 .get_tag_key(self.0.request, self.0.options)
4424 .await
4425 .map(crate::Response::into_body)
4426 }
4427
4428 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4432 self.0.request.name = v.into();
4433 self
4434 }
4435 }
4436
4437 #[doc(hidden)]
4438 impl crate::RequestBuilder for GetTagKey {
4439 fn request_options(&mut self) -> &mut crate::RequestOptions {
4440 &mut self.0.options
4441 }
4442 }
4443
4444 #[derive(Clone, Debug)]
4461 pub struct GetNamespacedTagKey(RequestBuilder<crate::model::GetNamespacedTagKeyRequest>);
4462
4463 impl GetNamespacedTagKey {
4464 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4465 Self(RequestBuilder::new(stub))
4466 }
4467
4468 pub fn with_request<V: Into<crate::model::GetNamespacedTagKeyRequest>>(
4470 mut self,
4471 v: V,
4472 ) -> Self {
4473 self.0.request = v.into();
4474 self
4475 }
4476
4477 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4479 self.0.options = v.into();
4480 self
4481 }
4482
4483 pub async fn send(self) -> Result<crate::model::TagKey> {
4485 (*self.0.stub)
4486 .get_namespaced_tag_key(self.0.request, self.0.options)
4487 .await
4488 .map(crate::Response::into_body)
4489 }
4490
4491 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4495 self.0.request.name = v.into();
4496 self
4497 }
4498 }
4499
4500 #[doc(hidden)]
4501 impl crate::RequestBuilder for GetNamespacedTagKey {
4502 fn request_options(&mut self) -> &mut crate::RequestOptions {
4503 &mut self.0.options
4504 }
4505 }
4506
4507 #[derive(Clone, Debug)]
4525 pub struct CreateTagKey(RequestBuilder<crate::model::CreateTagKeyRequest>);
4526
4527 impl CreateTagKey {
4528 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4529 Self(RequestBuilder::new(stub))
4530 }
4531
4532 pub fn with_request<V: Into<crate::model::CreateTagKeyRequest>>(mut self, v: V) -> Self {
4534 self.0.request = v.into();
4535 self
4536 }
4537
4538 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4540 self.0.options = v.into();
4541 self
4542 }
4543
4544 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4551 (*self.0.stub)
4552 .create_tag_key(self.0.request, self.0.options)
4553 .await
4554 .map(crate::Response::into_body)
4555 }
4556
4557 pub fn poller(
4559 self,
4560 ) -> impl google_cloud_lro::Poller<crate::model::TagKey, crate::model::CreateTagKeyMetadata>
4561 {
4562 type Operation = google_cloud_lro::internal::Operation<
4563 crate::model::TagKey,
4564 crate::model::CreateTagKeyMetadata,
4565 >;
4566 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4567 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4568 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4569 if let Some(ref mut details) = poller_options.tracing {
4570 details.method_name =
4571 "google_cloud_resourcemanager_v3::client::TagKeys::create_tag_key::until_done";
4572 }
4573
4574 let stub = self.0.stub.clone();
4575 let mut options = self.0.options.clone();
4576 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4577 let query = move |name| {
4578 let stub = stub.clone();
4579 let options = options.clone();
4580 async {
4581 let op = GetOperation::new(stub)
4582 .set_name(name)
4583 .with_options(options)
4584 .send()
4585 .await?;
4586 Ok(Operation::new(op))
4587 }
4588 };
4589
4590 let start = move || async {
4591 let op = self.send().await?;
4592 Ok(Operation::new(op))
4593 };
4594
4595 use google_cloud_lro::internal::PollerExt;
4596 {
4597 google_cloud_lro::internal::new_poller(
4598 polling_error_policy,
4599 polling_backoff_policy,
4600 start,
4601 query,
4602 )
4603 }
4604 .with_options(poller_options)
4605 }
4606
4607 pub fn set_tag_key<T>(mut self, v: T) -> Self
4611 where
4612 T: std::convert::Into<crate::model::TagKey>,
4613 {
4614 self.0.request.tag_key = std::option::Option::Some(v.into());
4615 self
4616 }
4617
4618 pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
4622 where
4623 T: std::convert::Into<crate::model::TagKey>,
4624 {
4625 self.0.request.tag_key = v.map(|x| x.into());
4626 self
4627 }
4628
4629 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4631 self.0.request.validate_only = v.into();
4632 self
4633 }
4634 }
4635
4636 #[doc(hidden)]
4637 impl crate::RequestBuilder for CreateTagKey {
4638 fn request_options(&mut self) -> &mut crate::RequestOptions {
4639 &mut self.0.options
4640 }
4641 }
4642
4643 #[derive(Clone, Debug)]
4661 pub struct UpdateTagKey(RequestBuilder<crate::model::UpdateTagKeyRequest>);
4662
4663 impl UpdateTagKey {
4664 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4665 Self(RequestBuilder::new(stub))
4666 }
4667
4668 pub fn with_request<V: Into<crate::model::UpdateTagKeyRequest>>(mut self, v: V) -> Self {
4670 self.0.request = v.into();
4671 self
4672 }
4673
4674 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4676 self.0.options = v.into();
4677 self
4678 }
4679
4680 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4687 (*self.0.stub)
4688 .update_tag_key(self.0.request, self.0.options)
4689 .await
4690 .map(crate::Response::into_body)
4691 }
4692
4693 pub fn poller(
4695 self,
4696 ) -> impl google_cloud_lro::Poller<crate::model::TagKey, crate::model::UpdateTagKeyMetadata>
4697 {
4698 type Operation = google_cloud_lro::internal::Operation<
4699 crate::model::TagKey,
4700 crate::model::UpdateTagKeyMetadata,
4701 >;
4702 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4703 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4704 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4705 if let Some(ref mut details) = poller_options.tracing {
4706 details.method_name =
4707 "google_cloud_resourcemanager_v3::client::TagKeys::update_tag_key::until_done";
4708 }
4709
4710 let stub = self.0.stub.clone();
4711 let mut options = self.0.options.clone();
4712 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4713 let query = move |name| {
4714 let stub = stub.clone();
4715 let options = options.clone();
4716 async {
4717 let op = GetOperation::new(stub)
4718 .set_name(name)
4719 .with_options(options)
4720 .send()
4721 .await?;
4722 Ok(Operation::new(op))
4723 }
4724 };
4725
4726 let start = move || async {
4727 let op = self.send().await?;
4728 Ok(Operation::new(op))
4729 };
4730
4731 use google_cloud_lro::internal::PollerExt;
4732 {
4733 google_cloud_lro::internal::new_poller(
4734 polling_error_policy,
4735 polling_backoff_policy,
4736 start,
4737 query,
4738 )
4739 }
4740 .with_options(poller_options)
4741 }
4742
4743 pub fn set_tag_key<T>(mut self, v: T) -> Self
4747 where
4748 T: std::convert::Into<crate::model::TagKey>,
4749 {
4750 self.0.request.tag_key = std::option::Option::Some(v.into());
4751 self
4752 }
4753
4754 pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
4758 where
4759 T: std::convert::Into<crate::model::TagKey>,
4760 {
4761 self.0.request.tag_key = v.map(|x| x.into());
4762 self
4763 }
4764
4765 pub fn set_update_mask<T>(mut self, v: T) -> Self
4767 where
4768 T: std::convert::Into<wkt::FieldMask>,
4769 {
4770 self.0.request.update_mask = std::option::Option::Some(v.into());
4771 self
4772 }
4773
4774 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4776 where
4777 T: std::convert::Into<wkt::FieldMask>,
4778 {
4779 self.0.request.update_mask = v.map(|x| x.into());
4780 self
4781 }
4782
4783 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4785 self.0.request.validate_only = v.into();
4786 self
4787 }
4788 }
4789
4790 #[doc(hidden)]
4791 impl crate::RequestBuilder for UpdateTagKey {
4792 fn request_options(&mut self) -> &mut crate::RequestOptions {
4793 &mut self.0.options
4794 }
4795 }
4796
4797 #[derive(Clone, Debug)]
4815 pub struct DeleteTagKey(RequestBuilder<crate::model::DeleteTagKeyRequest>);
4816
4817 impl DeleteTagKey {
4818 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4819 Self(RequestBuilder::new(stub))
4820 }
4821
4822 pub fn with_request<V: Into<crate::model::DeleteTagKeyRequest>>(mut self, v: V) -> Self {
4824 self.0.request = v.into();
4825 self
4826 }
4827
4828 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4830 self.0.options = v.into();
4831 self
4832 }
4833
4834 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4841 (*self.0.stub)
4842 .delete_tag_key(self.0.request, self.0.options)
4843 .await
4844 .map(crate::Response::into_body)
4845 }
4846
4847 pub fn poller(
4849 self,
4850 ) -> impl google_cloud_lro::Poller<crate::model::TagKey, crate::model::DeleteTagKeyMetadata>
4851 {
4852 type Operation = google_cloud_lro::internal::Operation<
4853 crate::model::TagKey,
4854 crate::model::DeleteTagKeyMetadata,
4855 >;
4856 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4857 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4858 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4859 if let Some(ref mut details) = poller_options.tracing {
4860 details.method_name =
4861 "google_cloud_resourcemanager_v3::client::TagKeys::delete_tag_key::until_done";
4862 }
4863
4864 let stub = self.0.stub.clone();
4865 let mut options = self.0.options.clone();
4866 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4867 let query = move |name| {
4868 let stub = stub.clone();
4869 let options = options.clone();
4870 async {
4871 let op = GetOperation::new(stub)
4872 .set_name(name)
4873 .with_options(options)
4874 .send()
4875 .await?;
4876 Ok(Operation::new(op))
4877 }
4878 };
4879
4880 let start = move || async {
4881 let op = self.send().await?;
4882 Ok(Operation::new(op))
4883 };
4884
4885 use google_cloud_lro::internal::PollerExt;
4886 {
4887 google_cloud_lro::internal::new_poller(
4888 polling_error_policy,
4889 polling_backoff_policy,
4890 start,
4891 query,
4892 )
4893 }
4894 .with_options(poller_options)
4895 }
4896
4897 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4901 self.0.request.name = v.into();
4902 self
4903 }
4904
4905 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4907 self.0.request.validate_only = v.into();
4908 self
4909 }
4910
4911 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4913 self.0.request.etag = v.into();
4914 self
4915 }
4916 }
4917
4918 #[doc(hidden)]
4919 impl crate::RequestBuilder for DeleteTagKey {
4920 fn request_options(&mut self) -> &mut crate::RequestOptions {
4921 &mut self.0.options
4922 }
4923 }
4924
4925 #[derive(Clone, Debug)]
4942 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4943
4944 impl GetIamPolicy {
4945 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4946 Self(RequestBuilder::new(stub))
4947 }
4948
4949 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4951 mut self,
4952 v: V,
4953 ) -> Self {
4954 self.0.request = v.into();
4955 self
4956 }
4957
4958 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4960 self.0.options = v.into();
4961 self
4962 }
4963
4964 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4966 (*self.0.stub)
4967 .get_iam_policy(self.0.request, self.0.options)
4968 .await
4969 .map(crate::Response::into_body)
4970 }
4971
4972 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4976 self.0.request.resource = v.into();
4977 self
4978 }
4979
4980 pub fn set_options<T>(mut self, v: T) -> Self
4982 where
4983 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4984 {
4985 self.0.request.options = std::option::Option::Some(v.into());
4986 self
4987 }
4988
4989 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4991 where
4992 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4993 {
4994 self.0.request.options = v.map(|x| x.into());
4995 self
4996 }
4997 }
4998
4999 #[doc(hidden)]
5000 impl crate::RequestBuilder for GetIamPolicy {
5001 fn request_options(&mut self) -> &mut crate::RequestOptions {
5002 &mut self.0.options
5003 }
5004 }
5005
5006 #[derive(Clone, Debug)]
5023 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
5024
5025 impl SetIamPolicy {
5026 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
5027 Self(RequestBuilder::new(stub))
5028 }
5029
5030 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
5032 mut self,
5033 v: V,
5034 ) -> Self {
5035 self.0.request = v.into();
5036 self
5037 }
5038
5039 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5041 self.0.options = v.into();
5042 self
5043 }
5044
5045 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5047 (*self.0.stub)
5048 .set_iam_policy(self.0.request, self.0.options)
5049 .await
5050 .map(crate::Response::into_body)
5051 }
5052
5053 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5057 self.0.request.resource = v.into();
5058 self
5059 }
5060
5061 pub fn set_policy<T>(mut self, v: T) -> Self
5065 where
5066 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5067 {
5068 self.0.request.policy = std::option::Option::Some(v.into());
5069 self
5070 }
5071
5072 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5076 where
5077 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5078 {
5079 self.0.request.policy = v.map(|x| x.into());
5080 self
5081 }
5082
5083 pub fn set_update_mask<T>(mut self, v: T) -> Self
5085 where
5086 T: std::convert::Into<wkt::FieldMask>,
5087 {
5088 self.0.request.update_mask = std::option::Option::Some(v.into());
5089 self
5090 }
5091
5092 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5094 where
5095 T: std::convert::Into<wkt::FieldMask>,
5096 {
5097 self.0.request.update_mask = v.map(|x| x.into());
5098 self
5099 }
5100 }
5101
5102 #[doc(hidden)]
5103 impl crate::RequestBuilder for SetIamPolicy {
5104 fn request_options(&mut self) -> &mut crate::RequestOptions {
5105 &mut self.0.options
5106 }
5107 }
5108
5109 #[derive(Clone, Debug)]
5126 pub struct TestIamPermissions(
5127 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
5128 );
5129
5130 impl TestIamPermissions {
5131 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
5132 Self(RequestBuilder::new(stub))
5133 }
5134
5135 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
5137 mut self,
5138 v: V,
5139 ) -> Self {
5140 self.0.request = v.into();
5141 self
5142 }
5143
5144 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5146 self.0.options = v.into();
5147 self
5148 }
5149
5150 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
5152 (*self.0.stub)
5153 .test_iam_permissions(self.0.request, self.0.options)
5154 .await
5155 .map(crate::Response::into_body)
5156 }
5157
5158 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5162 self.0.request.resource = v.into();
5163 self
5164 }
5165
5166 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5170 where
5171 T: std::iter::IntoIterator<Item = V>,
5172 V: std::convert::Into<std::string::String>,
5173 {
5174 use std::iter::Iterator;
5175 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5176 self
5177 }
5178 }
5179
5180 #[doc(hidden)]
5181 impl crate::RequestBuilder for TestIamPermissions {
5182 fn request_options(&mut self) -> &mut crate::RequestOptions {
5183 &mut self.0.options
5184 }
5185 }
5186
5187 #[derive(Clone, Debug)]
5204 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5205
5206 impl GetOperation {
5207 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
5208 Self(RequestBuilder::new(stub))
5209 }
5210
5211 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5213 mut self,
5214 v: V,
5215 ) -> Self {
5216 self.0.request = v.into();
5217 self
5218 }
5219
5220 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5222 self.0.options = v.into();
5223 self
5224 }
5225
5226 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5228 (*self.0.stub)
5229 .get_operation(self.0.request, self.0.options)
5230 .await
5231 .map(crate::Response::into_body)
5232 }
5233
5234 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5236 self.0.request.name = v.into();
5237 self
5238 }
5239 }
5240
5241 #[doc(hidden)]
5242 impl crate::RequestBuilder for GetOperation {
5243 fn request_options(&mut self) -> &mut crate::RequestOptions {
5244 &mut self.0.options
5245 }
5246 }
5247}
5248
5249pub mod tag_values {
5251 use crate::Result;
5252
5253 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5267
5268 pub(crate) mod client {
5269 use super::super::super::client::TagValues;
5270 pub struct Factory;
5271 impl crate::ClientFactory for Factory {
5272 type Client = TagValues;
5273 type Credentials = gaxi::options::Credentials;
5274 async fn build(
5275 self,
5276 config: gaxi::options::ClientConfig,
5277 ) -> crate::ClientBuilderResult<Self::Client> {
5278 Self::Client::new(config).await
5279 }
5280 }
5281 }
5282
5283 #[derive(Clone, Debug)]
5285 pub(crate) struct RequestBuilder<R: std::default::Default> {
5286 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5287 request: R,
5288 options: crate::RequestOptions,
5289 }
5290
5291 impl<R> RequestBuilder<R>
5292 where
5293 R: std::default::Default,
5294 {
5295 pub(crate) fn new(
5296 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5297 ) -> Self {
5298 Self {
5299 stub,
5300 request: R::default(),
5301 options: crate::RequestOptions::default(),
5302 }
5303 }
5304 }
5305
5306 #[derive(Clone, Debug)]
5327 pub struct ListTagValues(RequestBuilder<crate::model::ListTagValuesRequest>);
5328
5329 impl ListTagValues {
5330 pub(crate) fn new(
5331 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5332 ) -> Self {
5333 Self(RequestBuilder::new(stub))
5334 }
5335
5336 pub fn with_request<V: Into<crate::model::ListTagValuesRequest>>(mut self, v: V) -> Self {
5338 self.0.request = v.into();
5339 self
5340 }
5341
5342 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5344 self.0.options = v.into();
5345 self
5346 }
5347
5348 pub async fn send(self) -> Result<crate::model::ListTagValuesResponse> {
5350 (*self.0.stub)
5351 .list_tag_values(self.0.request, self.0.options)
5352 .await
5353 .map(crate::Response::into_body)
5354 }
5355
5356 pub fn by_page(
5358 self,
5359 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTagValuesResponse, crate::Error>
5360 {
5361 use std::clone::Clone;
5362 let token = self.0.request.page_token.clone();
5363 let execute = move |token: String| {
5364 let mut builder = self.clone();
5365 builder.0.request = builder.0.request.set_page_token(token);
5366 builder.send()
5367 };
5368 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5369 }
5370
5371 pub fn by_item(
5373 self,
5374 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5375 crate::model::ListTagValuesResponse,
5376 crate::Error,
5377 > {
5378 use google_cloud_gax::paginator::Paginator;
5379 self.by_page().items()
5380 }
5381
5382 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5386 self.0.request.parent = v.into();
5387 self
5388 }
5389
5390 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5392 self.0.request.page_size = v.into();
5393 self
5394 }
5395
5396 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5398 self.0.request.page_token = v.into();
5399 self
5400 }
5401 }
5402
5403 #[doc(hidden)]
5404 impl crate::RequestBuilder for ListTagValues {
5405 fn request_options(&mut self) -> &mut crate::RequestOptions {
5406 &mut self.0.options
5407 }
5408 }
5409
5410 #[derive(Clone, Debug)]
5427 pub struct GetTagValue(RequestBuilder<crate::model::GetTagValueRequest>);
5428
5429 impl GetTagValue {
5430 pub(crate) fn new(
5431 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5432 ) -> Self {
5433 Self(RequestBuilder::new(stub))
5434 }
5435
5436 pub fn with_request<V: Into<crate::model::GetTagValueRequest>>(mut self, v: V) -> Self {
5438 self.0.request = v.into();
5439 self
5440 }
5441
5442 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5444 self.0.options = v.into();
5445 self
5446 }
5447
5448 pub async fn send(self) -> Result<crate::model::TagValue> {
5450 (*self.0.stub)
5451 .get_tag_value(self.0.request, self.0.options)
5452 .await
5453 .map(crate::Response::into_body)
5454 }
5455
5456 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5460 self.0.request.name = v.into();
5461 self
5462 }
5463 }
5464
5465 #[doc(hidden)]
5466 impl crate::RequestBuilder for GetTagValue {
5467 fn request_options(&mut self) -> &mut crate::RequestOptions {
5468 &mut self.0.options
5469 }
5470 }
5471
5472 #[derive(Clone, Debug)]
5489 pub struct GetNamespacedTagValue(RequestBuilder<crate::model::GetNamespacedTagValueRequest>);
5490
5491 impl GetNamespacedTagValue {
5492 pub(crate) fn new(
5493 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5494 ) -> Self {
5495 Self(RequestBuilder::new(stub))
5496 }
5497
5498 pub fn with_request<V: Into<crate::model::GetNamespacedTagValueRequest>>(
5500 mut self,
5501 v: V,
5502 ) -> Self {
5503 self.0.request = v.into();
5504 self
5505 }
5506
5507 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5509 self.0.options = v.into();
5510 self
5511 }
5512
5513 pub async fn send(self) -> Result<crate::model::TagValue> {
5515 (*self.0.stub)
5516 .get_namespaced_tag_value(self.0.request, self.0.options)
5517 .await
5518 .map(crate::Response::into_body)
5519 }
5520
5521 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5525 self.0.request.name = v.into();
5526 self
5527 }
5528 }
5529
5530 #[doc(hidden)]
5531 impl crate::RequestBuilder for GetNamespacedTagValue {
5532 fn request_options(&mut self) -> &mut crate::RequestOptions {
5533 &mut self.0.options
5534 }
5535 }
5536
5537 #[derive(Clone, Debug)]
5555 pub struct CreateTagValue(RequestBuilder<crate::model::CreateTagValueRequest>);
5556
5557 impl CreateTagValue {
5558 pub(crate) fn new(
5559 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5560 ) -> Self {
5561 Self(RequestBuilder::new(stub))
5562 }
5563
5564 pub fn with_request<V: Into<crate::model::CreateTagValueRequest>>(mut self, v: V) -> Self {
5566 self.0.request = v.into();
5567 self
5568 }
5569
5570 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5572 self.0.options = v.into();
5573 self
5574 }
5575
5576 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5583 (*self.0.stub)
5584 .create_tag_value(self.0.request, self.0.options)
5585 .await
5586 .map(crate::Response::into_body)
5587 }
5588
5589 pub fn poller(
5591 self,
5592 ) -> impl google_cloud_lro::Poller<crate::model::TagValue, crate::model::CreateTagValueMetadata>
5593 {
5594 type Operation = google_cloud_lro::internal::Operation<
5595 crate::model::TagValue,
5596 crate::model::CreateTagValueMetadata,
5597 >;
5598 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5599 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5600 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5601 if let Some(ref mut details) = poller_options.tracing {
5602 details.method_name = "google_cloud_resourcemanager_v3::client::TagValues::create_tag_value::until_done";
5603 }
5604
5605 let stub = self.0.stub.clone();
5606 let mut options = self.0.options.clone();
5607 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5608 let query = move |name| {
5609 let stub = stub.clone();
5610 let options = options.clone();
5611 async {
5612 let op = GetOperation::new(stub)
5613 .set_name(name)
5614 .with_options(options)
5615 .send()
5616 .await?;
5617 Ok(Operation::new(op))
5618 }
5619 };
5620
5621 let start = move || async {
5622 let op = self.send().await?;
5623 Ok(Operation::new(op))
5624 };
5625
5626 use google_cloud_lro::internal::PollerExt;
5627 {
5628 google_cloud_lro::internal::new_poller(
5629 polling_error_policy,
5630 polling_backoff_policy,
5631 start,
5632 query,
5633 )
5634 }
5635 .with_options(poller_options)
5636 }
5637
5638 pub fn set_tag_value<T>(mut self, v: T) -> Self
5642 where
5643 T: std::convert::Into<crate::model::TagValue>,
5644 {
5645 self.0.request.tag_value = std::option::Option::Some(v.into());
5646 self
5647 }
5648
5649 pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
5653 where
5654 T: std::convert::Into<crate::model::TagValue>,
5655 {
5656 self.0.request.tag_value = v.map(|x| x.into());
5657 self
5658 }
5659
5660 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5662 self.0.request.validate_only = v.into();
5663 self
5664 }
5665 }
5666
5667 #[doc(hidden)]
5668 impl crate::RequestBuilder for CreateTagValue {
5669 fn request_options(&mut self) -> &mut crate::RequestOptions {
5670 &mut self.0.options
5671 }
5672 }
5673
5674 #[derive(Clone, Debug)]
5692 pub struct UpdateTagValue(RequestBuilder<crate::model::UpdateTagValueRequest>);
5693
5694 impl UpdateTagValue {
5695 pub(crate) fn new(
5696 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5697 ) -> Self {
5698 Self(RequestBuilder::new(stub))
5699 }
5700
5701 pub fn with_request<V: Into<crate::model::UpdateTagValueRequest>>(mut self, v: V) -> Self {
5703 self.0.request = v.into();
5704 self
5705 }
5706
5707 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5709 self.0.options = v.into();
5710 self
5711 }
5712
5713 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5720 (*self.0.stub)
5721 .update_tag_value(self.0.request, self.0.options)
5722 .await
5723 .map(crate::Response::into_body)
5724 }
5725
5726 pub fn poller(
5728 self,
5729 ) -> impl google_cloud_lro::Poller<crate::model::TagValue, crate::model::UpdateTagValueMetadata>
5730 {
5731 type Operation = google_cloud_lro::internal::Operation<
5732 crate::model::TagValue,
5733 crate::model::UpdateTagValueMetadata,
5734 >;
5735 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5736 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5737 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5738 if let Some(ref mut details) = poller_options.tracing {
5739 details.method_name = "google_cloud_resourcemanager_v3::client::TagValues::update_tag_value::until_done";
5740 }
5741
5742 let stub = self.0.stub.clone();
5743 let mut options = self.0.options.clone();
5744 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5745 let query = move |name| {
5746 let stub = stub.clone();
5747 let options = options.clone();
5748 async {
5749 let op = GetOperation::new(stub)
5750 .set_name(name)
5751 .with_options(options)
5752 .send()
5753 .await?;
5754 Ok(Operation::new(op))
5755 }
5756 };
5757
5758 let start = move || async {
5759 let op = self.send().await?;
5760 Ok(Operation::new(op))
5761 };
5762
5763 use google_cloud_lro::internal::PollerExt;
5764 {
5765 google_cloud_lro::internal::new_poller(
5766 polling_error_policy,
5767 polling_backoff_policy,
5768 start,
5769 query,
5770 )
5771 }
5772 .with_options(poller_options)
5773 }
5774
5775 pub fn set_tag_value<T>(mut self, v: T) -> Self
5779 where
5780 T: std::convert::Into<crate::model::TagValue>,
5781 {
5782 self.0.request.tag_value = std::option::Option::Some(v.into());
5783 self
5784 }
5785
5786 pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
5790 where
5791 T: std::convert::Into<crate::model::TagValue>,
5792 {
5793 self.0.request.tag_value = v.map(|x| x.into());
5794 self
5795 }
5796
5797 pub fn set_update_mask<T>(mut self, v: T) -> Self
5799 where
5800 T: std::convert::Into<wkt::FieldMask>,
5801 {
5802 self.0.request.update_mask = std::option::Option::Some(v.into());
5803 self
5804 }
5805
5806 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5808 where
5809 T: std::convert::Into<wkt::FieldMask>,
5810 {
5811 self.0.request.update_mask = v.map(|x| x.into());
5812 self
5813 }
5814
5815 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5817 self.0.request.validate_only = v.into();
5818 self
5819 }
5820 }
5821
5822 #[doc(hidden)]
5823 impl crate::RequestBuilder for UpdateTagValue {
5824 fn request_options(&mut self) -> &mut crate::RequestOptions {
5825 &mut self.0.options
5826 }
5827 }
5828
5829 #[derive(Clone, Debug)]
5847 pub struct DeleteTagValue(RequestBuilder<crate::model::DeleteTagValueRequest>);
5848
5849 impl DeleteTagValue {
5850 pub(crate) fn new(
5851 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5852 ) -> Self {
5853 Self(RequestBuilder::new(stub))
5854 }
5855
5856 pub fn with_request<V: Into<crate::model::DeleteTagValueRequest>>(mut self, v: V) -> Self {
5858 self.0.request = v.into();
5859 self
5860 }
5861
5862 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5864 self.0.options = v.into();
5865 self
5866 }
5867
5868 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5875 (*self.0.stub)
5876 .delete_tag_value(self.0.request, self.0.options)
5877 .await
5878 .map(crate::Response::into_body)
5879 }
5880
5881 pub fn poller(
5883 self,
5884 ) -> impl google_cloud_lro::Poller<crate::model::TagValue, crate::model::DeleteTagValueMetadata>
5885 {
5886 type Operation = google_cloud_lro::internal::Operation<
5887 crate::model::TagValue,
5888 crate::model::DeleteTagValueMetadata,
5889 >;
5890 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5891 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5892 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5893 if let Some(ref mut details) = poller_options.tracing {
5894 details.method_name = "google_cloud_resourcemanager_v3::client::TagValues::delete_tag_value::until_done";
5895 }
5896
5897 let stub = self.0.stub.clone();
5898 let mut options = self.0.options.clone();
5899 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5900 let query = move |name| {
5901 let stub = stub.clone();
5902 let options = options.clone();
5903 async {
5904 let op = GetOperation::new(stub)
5905 .set_name(name)
5906 .with_options(options)
5907 .send()
5908 .await?;
5909 Ok(Operation::new(op))
5910 }
5911 };
5912
5913 let start = move || async {
5914 let op = self.send().await?;
5915 Ok(Operation::new(op))
5916 };
5917
5918 use google_cloud_lro::internal::PollerExt;
5919 {
5920 google_cloud_lro::internal::new_poller(
5921 polling_error_policy,
5922 polling_backoff_policy,
5923 start,
5924 query,
5925 )
5926 }
5927 .with_options(poller_options)
5928 }
5929
5930 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5934 self.0.request.name = v.into();
5935 self
5936 }
5937
5938 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5940 self.0.request.validate_only = v.into();
5941 self
5942 }
5943
5944 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
5946 self.0.request.etag = v.into();
5947 self
5948 }
5949 }
5950
5951 #[doc(hidden)]
5952 impl crate::RequestBuilder for DeleteTagValue {
5953 fn request_options(&mut self) -> &mut crate::RequestOptions {
5954 &mut self.0.options
5955 }
5956 }
5957
5958 #[derive(Clone, Debug)]
5975 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
5976
5977 impl GetIamPolicy {
5978 pub(crate) fn new(
5979 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5980 ) -> Self {
5981 Self(RequestBuilder::new(stub))
5982 }
5983
5984 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
5986 mut self,
5987 v: V,
5988 ) -> Self {
5989 self.0.request = v.into();
5990 self
5991 }
5992
5993 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5995 self.0.options = v.into();
5996 self
5997 }
5998
5999 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6001 (*self.0.stub)
6002 .get_iam_policy(self.0.request, self.0.options)
6003 .await
6004 .map(crate::Response::into_body)
6005 }
6006
6007 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6011 self.0.request.resource = v.into();
6012 self
6013 }
6014
6015 pub fn set_options<T>(mut self, v: T) -> Self
6017 where
6018 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6019 {
6020 self.0.request.options = std::option::Option::Some(v.into());
6021 self
6022 }
6023
6024 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6026 where
6027 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6028 {
6029 self.0.request.options = v.map(|x| x.into());
6030 self
6031 }
6032 }
6033
6034 #[doc(hidden)]
6035 impl crate::RequestBuilder for GetIamPolicy {
6036 fn request_options(&mut self) -> &mut crate::RequestOptions {
6037 &mut self.0.options
6038 }
6039 }
6040
6041 #[derive(Clone, Debug)]
6058 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6059
6060 impl SetIamPolicy {
6061 pub(crate) fn new(
6062 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
6063 ) -> Self {
6064 Self(RequestBuilder::new(stub))
6065 }
6066
6067 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6069 mut self,
6070 v: V,
6071 ) -> Self {
6072 self.0.request = v.into();
6073 self
6074 }
6075
6076 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6078 self.0.options = v.into();
6079 self
6080 }
6081
6082 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6084 (*self.0.stub)
6085 .set_iam_policy(self.0.request, self.0.options)
6086 .await
6087 .map(crate::Response::into_body)
6088 }
6089
6090 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6094 self.0.request.resource = v.into();
6095 self
6096 }
6097
6098 pub fn set_policy<T>(mut self, v: T) -> Self
6102 where
6103 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6104 {
6105 self.0.request.policy = std::option::Option::Some(v.into());
6106 self
6107 }
6108
6109 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6113 where
6114 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6115 {
6116 self.0.request.policy = v.map(|x| x.into());
6117 self
6118 }
6119
6120 pub fn set_update_mask<T>(mut self, v: T) -> Self
6122 where
6123 T: std::convert::Into<wkt::FieldMask>,
6124 {
6125 self.0.request.update_mask = std::option::Option::Some(v.into());
6126 self
6127 }
6128
6129 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6131 where
6132 T: std::convert::Into<wkt::FieldMask>,
6133 {
6134 self.0.request.update_mask = v.map(|x| x.into());
6135 self
6136 }
6137 }
6138
6139 #[doc(hidden)]
6140 impl crate::RequestBuilder for SetIamPolicy {
6141 fn request_options(&mut self) -> &mut crate::RequestOptions {
6142 &mut self.0.options
6143 }
6144 }
6145
6146 #[derive(Clone, Debug)]
6163 pub struct TestIamPermissions(
6164 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6165 );
6166
6167 impl TestIamPermissions {
6168 pub(crate) fn new(
6169 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
6170 ) -> Self {
6171 Self(RequestBuilder::new(stub))
6172 }
6173
6174 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6176 mut self,
6177 v: V,
6178 ) -> Self {
6179 self.0.request = v.into();
6180 self
6181 }
6182
6183 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6185 self.0.options = v.into();
6186 self
6187 }
6188
6189 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6191 (*self.0.stub)
6192 .test_iam_permissions(self.0.request, self.0.options)
6193 .await
6194 .map(crate::Response::into_body)
6195 }
6196
6197 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6201 self.0.request.resource = v.into();
6202 self
6203 }
6204
6205 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6209 where
6210 T: std::iter::IntoIterator<Item = V>,
6211 V: std::convert::Into<std::string::String>,
6212 {
6213 use std::iter::Iterator;
6214 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6215 self
6216 }
6217 }
6218
6219 #[doc(hidden)]
6220 impl crate::RequestBuilder for TestIamPermissions {
6221 fn request_options(&mut self) -> &mut crate::RequestOptions {
6222 &mut self.0.options
6223 }
6224 }
6225
6226 #[derive(Clone, Debug)]
6243 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6244
6245 impl GetOperation {
6246 pub(crate) fn new(
6247 stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
6248 ) -> Self {
6249 Self(RequestBuilder::new(stub))
6250 }
6251
6252 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6254 mut self,
6255 v: V,
6256 ) -> Self {
6257 self.0.request = v.into();
6258 self
6259 }
6260
6261 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6263 self.0.options = v.into();
6264 self
6265 }
6266
6267 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6269 (*self.0.stub)
6270 .get_operation(self.0.request, self.0.options)
6271 .await
6272 .map(crate::Response::into_body)
6273 }
6274
6275 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6277 self.0.request.name = v.into();
6278 self
6279 }
6280 }
6281
6282 #[doc(hidden)]
6283 impl crate::RequestBuilder for GetOperation {
6284 fn request_options(&mut self) -> &mut crate::RequestOptions {
6285 &mut self.0.options
6286 }
6287 }
6288}