1pub mod function_service {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::FunctionService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = FunctionService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
92 pub struct GetFunction(RequestBuilder<crate::model::GetFunctionRequest>);
93
94 impl GetFunction {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::GetFunctionRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<crate::model::Function> {
115 (*self.0.stub)
116 .get_function(self.0.request, self.0.options)
117 .await
118 .map(gax::response::Response::into_body)
119 }
120
121 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
125 self.0.request.name = v.into();
126 self
127 }
128
129 pub fn set_revision<T: Into<std::string::String>>(mut self, v: T) -> Self {
131 self.0.request.revision = v.into();
132 self
133 }
134 }
135
136 #[doc(hidden)]
137 impl gax::options::internal::RequestBuilder for GetFunction {
138 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
139 &mut self.0.options
140 }
141 }
142
143 #[derive(Clone, Debug)]
165 pub struct ListFunctions(RequestBuilder<crate::model::ListFunctionsRequest>);
166
167 impl ListFunctions {
168 pub(crate) fn new(
169 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
170 ) -> Self {
171 Self(RequestBuilder::new(stub))
172 }
173
174 pub fn with_request<V: Into<crate::model::ListFunctionsRequest>>(mut self, v: V) -> Self {
176 self.0.request = v.into();
177 self
178 }
179
180 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
182 self.0.options = v.into();
183 self
184 }
185
186 pub async fn send(self) -> Result<crate::model::ListFunctionsResponse> {
188 (*self.0.stub)
189 .list_functions(self.0.request, self.0.options)
190 .await
191 .map(gax::response::Response::into_body)
192 }
193
194 pub fn by_page(
196 self,
197 ) -> impl gax::paginator::Paginator<crate::model::ListFunctionsResponse, gax::error::Error>
198 {
199 use std::clone::Clone;
200 let token = self.0.request.page_token.clone();
201 let execute = move |token: String| {
202 let mut builder = self.clone();
203 builder.0.request = builder.0.request.set_page_token(token);
204 builder.send()
205 };
206 gax::paginator::internal::new_paginator(token, execute)
207 }
208
209 pub fn by_item(
211 self,
212 ) -> impl gax::paginator::ItemPaginator<crate::model::ListFunctionsResponse, gax::error::Error>
213 {
214 use gax::paginator::Paginator;
215 self.by_page().items()
216 }
217
218 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
222 self.0.request.parent = v.into();
223 self
224 }
225
226 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
228 self.0.request.page_size = v.into();
229 self
230 }
231
232 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
234 self.0.request.page_token = v.into();
235 self
236 }
237
238 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
240 self.0.request.filter = v.into();
241 self
242 }
243
244 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
246 self.0.request.order_by = v.into();
247 self
248 }
249 }
250
251 #[doc(hidden)]
252 impl gax::options::internal::RequestBuilder for ListFunctions {
253 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
254 &mut self.0.options
255 }
256 }
257
258 #[derive(Clone, Debug)]
277 pub struct CreateFunction(RequestBuilder<crate::model::CreateFunctionRequest>);
278
279 impl CreateFunction {
280 pub(crate) fn new(
281 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
282 ) -> Self {
283 Self(RequestBuilder::new(stub))
284 }
285
286 pub fn with_request<V: Into<crate::model::CreateFunctionRequest>>(mut self, v: V) -> Self {
288 self.0.request = v.into();
289 self
290 }
291
292 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
294 self.0.options = v.into();
295 self
296 }
297
298 pub async fn send(self) -> Result<longrunning::model::Operation> {
305 (*self.0.stub)
306 .create_function(self.0.request, self.0.options)
307 .await
308 .map(gax::response::Response::into_body)
309 }
310
311 pub fn poller(
313 self,
314 ) -> impl lro::Poller<crate::model::Function, crate::model::OperationMetadata> {
315 type Operation =
316 lro::internal::Operation<crate::model::Function, crate::model::OperationMetadata>;
317 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
318 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
319
320 let stub = self.0.stub.clone();
321 let mut options = self.0.options.clone();
322 options.set_retry_policy(gax::retry_policy::NeverRetry);
323 let query = move |name| {
324 let stub = stub.clone();
325 let options = options.clone();
326 async {
327 let op = GetOperation::new(stub)
328 .set_name(name)
329 .with_options(options)
330 .send()
331 .await?;
332 Ok(Operation::new(op))
333 }
334 };
335
336 let start = move || async {
337 let op = self.send().await?;
338 Ok(Operation::new(op))
339 };
340
341 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
342 }
343
344 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
348 self.0.request.parent = v.into();
349 self
350 }
351
352 pub fn set_function<T>(mut self, v: T) -> Self
356 where
357 T: std::convert::Into<crate::model::Function>,
358 {
359 self.0.request.function = std::option::Option::Some(v.into());
360 self
361 }
362
363 pub fn set_or_clear_function<T>(mut self, v: std::option::Option<T>) -> Self
367 where
368 T: std::convert::Into<crate::model::Function>,
369 {
370 self.0.request.function = v.map(|x| x.into());
371 self
372 }
373
374 pub fn set_function_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
376 self.0.request.function_id = v.into();
377 self
378 }
379 }
380
381 #[doc(hidden)]
382 impl gax::options::internal::RequestBuilder for CreateFunction {
383 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
384 &mut self.0.options
385 }
386 }
387
388 #[derive(Clone, Debug)]
407 pub struct UpdateFunction(RequestBuilder<crate::model::UpdateFunctionRequest>);
408
409 impl UpdateFunction {
410 pub(crate) fn new(
411 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
412 ) -> Self {
413 Self(RequestBuilder::new(stub))
414 }
415
416 pub fn with_request<V: Into<crate::model::UpdateFunctionRequest>>(mut self, v: V) -> Self {
418 self.0.request = v.into();
419 self
420 }
421
422 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
424 self.0.options = v.into();
425 self
426 }
427
428 pub async fn send(self) -> Result<longrunning::model::Operation> {
435 (*self.0.stub)
436 .update_function(self.0.request, self.0.options)
437 .await
438 .map(gax::response::Response::into_body)
439 }
440
441 pub fn poller(
443 self,
444 ) -> impl lro::Poller<crate::model::Function, crate::model::OperationMetadata> {
445 type Operation =
446 lro::internal::Operation<crate::model::Function, crate::model::OperationMetadata>;
447 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
448 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
449
450 let stub = self.0.stub.clone();
451 let mut options = self.0.options.clone();
452 options.set_retry_policy(gax::retry_policy::NeverRetry);
453 let query = move |name| {
454 let stub = stub.clone();
455 let options = options.clone();
456 async {
457 let op = GetOperation::new(stub)
458 .set_name(name)
459 .with_options(options)
460 .send()
461 .await?;
462 Ok(Operation::new(op))
463 }
464 };
465
466 let start = move || async {
467 let op = self.send().await?;
468 Ok(Operation::new(op))
469 };
470
471 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
472 }
473
474 pub fn set_function<T>(mut self, v: T) -> Self
478 where
479 T: std::convert::Into<crate::model::Function>,
480 {
481 self.0.request.function = std::option::Option::Some(v.into());
482 self
483 }
484
485 pub fn set_or_clear_function<T>(mut self, v: std::option::Option<T>) -> Self
489 where
490 T: std::convert::Into<crate::model::Function>,
491 {
492 self.0.request.function = v.map(|x| x.into());
493 self
494 }
495
496 pub fn set_update_mask<T>(mut self, v: T) -> Self
498 where
499 T: std::convert::Into<wkt::FieldMask>,
500 {
501 self.0.request.update_mask = std::option::Option::Some(v.into());
502 self
503 }
504
505 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
507 where
508 T: std::convert::Into<wkt::FieldMask>,
509 {
510 self.0.request.update_mask = v.map(|x| x.into());
511 self
512 }
513 }
514
515 #[doc(hidden)]
516 impl gax::options::internal::RequestBuilder for UpdateFunction {
517 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
518 &mut self.0.options
519 }
520 }
521
522 #[derive(Clone, Debug)]
541 pub struct DeleteFunction(RequestBuilder<crate::model::DeleteFunctionRequest>);
542
543 impl DeleteFunction {
544 pub(crate) fn new(
545 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
546 ) -> Self {
547 Self(RequestBuilder::new(stub))
548 }
549
550 pub fn with_request<V: Into<crate::model::DeleteFunctionRequest>>(mut self, v: V) -> Self {
552 self.0.request = v.into();
553 self
554 }
555
556 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
558 self.0.options = v.into();
559 self
560 }
561
562 pub async fn send(self) -> Result<longrunning::model::Operation> {
569 (*self.0.stub)
570 .delete_function(self.0.request, self.0.options)
571 .await
572 .map(gax::response::Response::into_body)
573 }
574
575 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
577 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
578 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
579 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
580
581 let stub = self.0.stub.clone();
582 let mut options = self.0.options.clone();
583 options.set_retry_policy(gax::retry_policy::NeverRetry);
584 let query = move |name| {
585 let stub = stub.clone();
586 let options = options.clone();
587 async {
588 let op = GetOperation::new(stub)
589 .set_name(name)
590 .with_options(options)
591 .send()
592 .await?;
593 Ok(Operation::new(op))
594 }
595 };
596
597 let start = move || async {
598 let op = self.send().await?;
599 Ok(Operation::new(op))
600 };
601
602 lro::internal::new_unit_response_poller(
603 polling_error_policy,
604 polling_backoff_policy,
605 start,
606 query,
607 )
608 }
609
610 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
614 self.0.request.name = v.into();
615 self
616 }
617 }
618
619 #[doc(hidden)]
620 impl gax::options::internal::RequestBuilder for DeleteFunction {
621 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
622 &mut self.0.options
623 }
624 }
625
626 #[derive(Clone, Debug)]
644 pub struct GenerateUploadUrl(RequestBuilder<crate::model::GenerateUploadUrlRequest>);
645
646 impl GenerateUploadUrl {
647 pub(crate) fn new(
648 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
649 ) -> Self {
650 Self(RequestBuilder::new(stub))
651 }
652
653 pub fn with_request<V: Into<crate::model::GenerateUploadUrlRequest>>(
655 mut self,
656 v: V,
657 ) -> Self {
658 self.0.request = v.into();
659 self
660 }
661
662 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
664 self.0.options = v.into();
665 self
666 }
667
668 pub async fn send(self) -> Result<crate::model::GenerateUploadUrlResponse> {
670 (*self.0.stub)
671 .generate_upload_url(self.0.request, self.0.options)
672 .await
673 .map(gax::response::Response::into_body)
674 }
675
676 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
680 self.0.request.parent = v.into();
681 self
682 }
683
684 pub fn set_kms_key_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
686 self.0.request.kms_key_name = v.into();
687 self
688 }
689
690 pub fn set_environment<T: Into<crate::model::Environment>>(mut self, v: T) -> Self {
692 self.0.request.environment = v.into();
693 self
694 }
695 }
696
697 #[doc(hidden)]
698 impl gax::options::internal::RequestBuilder for GenerateUploadUrl {
699 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
700 &mut self.0.options
701 }
702 }
703
704 #[derive(Clone, Debug)]
722 pub struct GenerateDownloadUrl(RequestBuilder<crate::model::GenerateDownloadUrlRequest>);
723
724 impl GenerateDownloadUrl {
725 pub(crate) fn new(
726 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
727 ) -> Self {
728 Self(RequestBuilder::new(stub))
729 }
730
731 pub fn with_request<V: Into<crate::model::GenerateDownloadUrlRequest>>(
733 mut self,
734 v: V,
735 ) -> Self {
736 self.0.request = v.into();
737 self
738 }
739
740 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
742 self.0.options = v.into();
743 self
744 }
745
746 pub async fn send(self) -> Result<crate::model::GenerateDownloadUrlResponse> {
748 (*self.0.stub)
749 .generate_download_url(self.0.request, self.0.options)
750 .await
751 .map(gax::response::Response::into_body)
752 }
753
754 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
758 self.0.request.name = v.into();
759 self
760 }
761 }
762
763 #[doc(hidden)]
764 impl gax::options::internal::RequestBuilder for GenerateDownloadUrl {
765 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
766 &mut self.0.options
767 }
768 }
769
770 #[derive(Clone, Debug)]
788 pub struct ListRuntimes(RequestBuilder<crate::model::ListRuntimesRequest>);
789
790 impl ListRuntimes {
791 pub(crate) fn new(
792 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
793 ) -> Self {
794 Self(RequestBuilder::new(stub))
795 }
796
797 pub fn with_request<V: Into<crate::model::ListRuntimesRequest>>(mut self, v: V) -> Self {
799 self.0.request = v.into();
800 self
801 }
802
803 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
805 self.0.options = v.into();
806 self
807 }
808
809 pub async fn send(self) -> Result<crate::model::ListRuntimesResponse> {
811 (*self.0.stub)
812 .list_runtimes(self.0.request, self.0.options)
813 .await
814 .map(gax::response::Response::into_body)
815 }
816
817 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
821 self.0.request.parent = v.into();
822 self
823 }
824
825 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
827 self.0.request.filter = v.into();
828 self
829 }
830 }
831
832 #[doc(hidden)]
833 impl gax::options::internal::RequestBuilder for ListRuntimes {
834 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
835 &mut self.0.options
836 }
837 }
838
839 #[derive(Clone, Debug)]
861 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
862
863 impl ListLocations {
864 pub(crate) fn new(
865 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
866 ) -> Self {
867 Self(RequestBuilder::new(stub))
868 }
869
870 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
872 mut self,
873 v: V,
874 ) -> Self {
875 self.0.request = v.into();
876 self
877 }
878
879 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
881 self.0.options = v.into();
882 self
883 }
884
885 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
887 (*self.0.stub)
888 .list_locations(self.0.request, self.0.options)
889 .await
890 .map(gax::response::Response::into_body)
891 }
892
893 pub fn by_page(
895 self,
896 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
897 {
898 use std::clone::Clone;
899 let token = self.0.request.page_token.clone();
900 let execute = move |token: String| {
901 let mut builder = self.clone();
902 builder.0.request = builder.0.request.set_page_token(token);
903 builder.send()
904 };
905 gax::paginator::internal::new_paginator(token, execute)
906 }
907
908 pub fn by_item(
910 self,
911 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
912 {
913 use gax::paginator::Paginator;
914 self.by_page().items()
915 }
916
917 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
919 self.0.request.name = v.into();
920 self
921 }
922
923 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
925 self.0.request.filter = v.into();
926 self
927 }
928
929 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
931 self.0.request.page_size = v.into();
932 self
933 }
934
935 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
937 self.0.request.page_token = v.into();
938 self
939 }
940 }
941
942 #[doc(hidden)]
943 impl gax::options::internal::RequestBuilder for ListLocations {
944 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
945 &mut self.0.options
946 }
947 }
948
949 #[derive(Clone, Debug)]
967 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
968
969 impl SetIamPolicy {
970 pub(crate) fn new(
971 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
972 ) -> Self {
973 Self(RequestBuilder::new(stub))
974 }
975
976 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
978 self.0.request = v.into();
979 self
980 }
981
982 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
984 self.0.options = v.into();
985 self
986 }
987
988 pub async fn send(self) -> Result<iam_v1::model::Policy> {
990 (*self.0.stub)
991 .set_iam_policy(self.0.request, self.0.options)
992 .await
993 .map(gax::response::Response::into_body)
994 }
995
996 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1000 self.0.request.resource = v.into();
1001 self
1002 }
1003
1004 pub fn set_policy<T>(mut self, v: T) -> Self
1008 where
1009 T: std::convert::Into<iam_v1::model::Policy>,
1010 {
1011 self.0.request.policy = std::option::Option::Some(v.into());
1012 self
1013 }
1014
1015 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1019 where
1020 T: std::convert::Into<iam_v1::model::Policy>,
1021 {
1022 self.0.request.policy = v.map(|x| x.into());
1023 self
1024 }
1025
1026 pub fn set_update_mask<T>(mut self, v: T) -> Self
1028 where
1029 T: std::convert::Into<wkt::FieldMask>,
1030 {
1031 self.0.request.update_mask = std::option::Option::Some(v.into());
1032 self
1033 }
1034
1035 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1037 where
1038 T: std::convert::Into<wkt::FieldMask>,
1039 {
1040 self.0.request.update_mask = v.map(|x| x.into());
1041 self
1042 }
1043 }
1044
1045 #[doc(hidden)]
1046 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1047 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1048 &mut self.0.options
1049 }
1050 }
1051
1052 #[derive(Clone, Debug)]
1070 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1071
1072 impl GetIamPolicy {
1073 pub(crate) fn new(
1074 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1075 ) -> Self {
1076 Self(RequestBuilder::new(stub))
1077 }
1078
1079 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1081 self.0.request = v.into();
1082 self
1083 }
1084
1085 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1087 self.0.options = v.into();
1088 self
1089 }
1090
1091 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1093 (*self.0.stub)
1094 .get_iam_policy(self.0.request, self.0.options)
1095 .await
1096 .map(gax::response::Response::into_body)
1097 }
1098
1099 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1103 self.0.request.resource = v.into();
1104 self
1105 }
1106
1107 pub fn set_options<T>(mut self, v: T) -> Self
1109 where
1110 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1111 {
1112 self.0.request.options = std::option::Option::Some(v.into());
1113 self
1114 }
1115
1116 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1118 where
1119 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1120 {
1121 self.0.request.options = v.map(|x| x.into());
1122 self
1123 }
1124 }
1125
1126 #[doc(hidden)]
1127 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1128 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1129 &mut self.0.options
1130 }
1131 }
1132
1133 #[derive(Clone, Debug)]
1151 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1152
1153 impl TestIamPermissions {
1154 pub(crate) fn new(
1155 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1156 ) -> Self {
1157 Self(RequestBuilder::new(stub))
1158 }
1159
1160 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1162 mut self,
1163 v: V,
1164 ) -> Self {
1165 self.0.request = v.into();
1166 self
1167 }
1168
1169 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1171 self.0.options = v.into();
1172 self
1173 }
1174
1175 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1177 (*self.0.stub)
1178 .test_iam_permissions(self.0.request, self.0.options)
1179 .await
1180 .map(gax::response::Response::into_body)
1181 }
1182
1183 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1187 self.0.request.resource = v.into();
1188 self
1189 }
1190
1191 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1195 where
1196 T: std::iter::IntoIterator<Item = V>,
1197 V: std::convert::Into<std::string::String>,
1198 {
1199 use std::iter::Iterator;
1200 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1201 self
1202 }
1203 }
1204
1205 #[doc(hidden)]
1206 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1207 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1208 &mut self.0.options
1209 }
1210 }
1211
1212 #[derive(Clone, Debug)]
1234 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1235
1236 impl ListOperations {
1237 pub(crate) fn new(
1238 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1239 ) -> Self {
1240 Self(RequestBuilder::new(stub))
1241 }
1242
1243 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1245 mut self,
1246 v: V,
1247 ) -> Self {
1248 self.0.request = v.into();
1249 self
1250 }
1251
1252 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1254 self.0.options = v.into();
1255 self
1256 }
1257
1258 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1260 (*self.0.stub)
1261 .list_operations(self.0.request, self.0.options)
1262 .await
1263 .map(gax::response::Response::into_body)
1264 }
1265
1266 pub fn by_page(
1268 self,
1269 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1270 {
1271 use std::clone::Clone;
1272 let token = self.0.request.page_token.clone();
1273 let execute = move |token: String| {
1274 let mut builder = self.clone();
1275 builder.0.request = builder.0.request.set_page_token(token);
1276 builder.send()
1277 };
1278 gax::paginator::internal::new_paginator(token, execute)
1279 }
1280
1281 pub fn by_item(
1283 self,
1284 ) -> impl gax::paginator::ItemPaginator<
1285 longrunning::model::ListOperationsResponse,
1286 gax::error::Error,
1287 > {
1288 use gax::paginator::Paginator;
1289 self.by_page().items()
1290 }
1291
1292 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1294 self.0.request.name = v.into();
1295 self
1296 }
1297
1298 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1300 self.0.request.filter = v.into();
1301 self
1302 }
1303
1304 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1306 self.0.request.page_size = v.into();
1307 self
1308 }
1309
1310 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1312 self.0.request.page_token = v.into();
1313 self
1314 }
1315 }
1316
1317 #[doc(hidden)]
1318 impl gax::options::internal::RequestBuilder for ListOperations {
1319 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1320 &mut self.0.options
1321 }
1322 }
1323
1324 #[derive(Clone, Debug)]
1342 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1343
1344 impl GetOperation {
1345 pub(crate) fn new(
1346 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1347 ) -> Self {
1348 Self(RequestBuilder::new(stub))
1349 }
1350
1351 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1353 mut self,
1354 v: V,
1355 ) -> Self {
1356 self.0.request = v.into();
1357 self
1358 }
1359
1360 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1362 self.0.options = v.into();
1363 self
1364 }
1365
1366 pub async fn send(self) -> Result<longrunning::model::Operation> {
1368 (*self.0.stub)
1369 .get_operation(self.0.request, self.0.options)
1370 .await
1371 .map(gax::response::Response::into_body)
1372 }
1373
1374 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1376 self.0.request.name = v.into();
1377 self
1378 }
1379 }
1380
1381 #[doc(hidden)]
1382 impl gax::options::internal::RequestBuilder for GetOperation {
1383 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1384 &mut self.0.options
1385 }
1386 }
1387}