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)]
91 pub struct GetFunction(RequestBuilder<crate::model::GetFunctionRequest>);
92
93 impl GetFunction {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::GetFunctionRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<crate::model::Function> {
114 (*self.0.stub)
115 .get_function(self.0.request, self.0.options)
116 .await
117 .map(gax::response::Response::into_body)
118 }
119
120 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
124 self.0.request.name = v.into();
125 self
126 }
127
128 pub fn set_revision<T: Into<std::string::String>>(mut self, v: T) -> Self {
130 self.0.request.revision = v.into();
131 self
132 }
133 }
134
135 #[doc(hidden)]
136 impl gax::options::internal::RequestBuilder for GetFunction {
137 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
138 &mut self.0.options
139 }
140 }
141
142 #[derive(Clone, Debug)]
163 pub struct ListFunctions(RequestBuilder<crate::model::ListFunctionsRequest>);
164
165 impl ListFunctions {
166 pub(crate) fn new(
167 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
168 ) -> Self {
169 Self(RequestBuilder::new(stub))
170 }
171
172 pub fn with_request<V: Into<crate::model::ListFunctionsRequest>>(mut self, v: V) -> Self {
174 self.0.request = v.into();
175 self
176 }
177
178 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
180 self.0.options = v.into();
181 self
182 }
183
184 pub async fn send(self) -> Result<crate::model::ListFunctionsResponse> {
186 (*self.0.stub)
187 .list_functions(self.0.request, self.0.options)
188 .await
189 .map(gax::response::Response::into_body)
190 }
191
192 pub fn by_page(
194 self,
195 ) -> impl gax::paginator::Paginator<crate::model::ListFunctionsResponse, gax::error::Error>
196 {
197 use std::clone::Clone;
198 let token = self.0.request.page_token.clone();
199 let execute = move |token: String| {
200 let mut builder = self.clone();
201 builder.0.request = builder.0.request.set_page_token(token);
202 builder.send()
203 };
204 gax::paginator::internal::new_paginator(token, execute)
205 }
206
207 pub fn by_item(
209 self,
210 ) -> impl gax::paginator::ItemPaginator<crate::model::ListFunctionsResponse, gax::error::Error>
211 {
212 use gax::paginator::Paginator;
213 self.by_page().items()
214 }
215
216 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
220 self.0.request.parent = v.into();
221 self
222 }
223
224 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
226 self.0.request.page_size = v.into();
227 self
228 }
229
230 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
232 self.0.request.page_token = v.into();
233 self
234 }
235
236 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
238 self.0.request.filter = v.into();
239 self
240 }
241
242 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
244 self.0.request.order_by = v.into();
245 self
246 }
247 }
248
249 #[doc(hidden)]
250 impl gax::options::internal::RequestBuilder for ListFunctions {
251 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
252 &mut self.0.options
253 }
254 }
255
256 #[derive(Clone, Debug)]
274 pub struct CreateFunction(RequestBuilder<crate::model::CreateFunctionRequest>);
275
276 impl CreateFunction {
277 pub(crate) fn new(
278 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
279 ) -> Self {
280 Self(RequestBuilder::new(stub))
281 }
282
283 pub fn with_request<V: Into<crate::model::CreateFunctionRequest>>(mut self, v: V) -> Self {
285 self.0.request = v.into();
286 self
287 }
288
289 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
291 self.0.options = v.into();
292 self
293 }
294
295 pub async fn send(self) -> Result<longrunning::model::Operation> {
302 (*self.0.stub)
303 .create_function(self.0.request, self.0.options)
304 .await
305 .map(gax::response::Response::into_body)
306 }
307
308 pub fn poller(
310 self,
311 ) -> impl lro::Poller<crate::model::Function, crate::model::OperationMetadata> {
312 type Operation =
313 lro::internal::Operation<crate::model::Function, crate::model::OperationMetadata>;
314 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
315 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
316
317 let stub = self.0.stub.clone();
318 let mut options = self.0.options.clone();
319 options.set_retry_policy(gax::retry_policy::NeverRetry);
320 let query = move |name| {
321 let stub = stub.clone();
322 let options = options.clone();
323 async {
324 let op = GetOperation::new(stub)
325 .set_name(name)
326 .with_options(options)
327 .send()
328 .await?;
329 Ok(Operation::new(op))
330 }
331 };
332
333 let start = move || async {
334 let op = self.send().await?;
335 Ok(Operation::new(op))
336 };
337
338 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
339 }
340
341 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
345 self.0.request.parent = v.into();
346 self
347 }
348
349 pub fn set_function<T>(mut self, v: T) -> Self
353 where
354 T: std::convert::Into<crate::model::Function>,
355 {
356 self.0.request.function = std::option::Option::Some(v.into());
357 self
358 }
359
360 pub fn set_or_clear_function<T>(mut self, v: std::option::Option<T>) -> Self
364 where
365 T: std::convert::Into<crate::model::Function>,
366 {
367 self.0.request.function = v.map(|x| x.into());
368 self
369 }
370
371 pub fn set_function_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
373 self.0.request.function_id = v.into();
374 self
375 }
376 }
377
378 #[doc(hidden)]
379 impl gax::options::internal::RequestBuilder for CreateFunction {
380 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
381 &mut self.0.options
382 }
383 }
384
385 #[derive(Clone, Debug)]
403 pub struct UpdateFunction(RequestBuilder<crate::model::UpdateFunctionRequest>);
404
405 impl UpdateFunction {
406 pub(crate) fn new(
407 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
408 ) -> Self {
409 Self(RequestBuilder::new(stub))
410 }
411
412 pub fn with_request<V: Into<crate::model::UpdateFunctionRequest>>(mut self, v: V) -> Self {
414 self.0.request = v.into();
415 self
416 }
417
418 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
420 self.0.options = v.into();
421 self
422 }
423
424 pub async fn send(self) -> Result<longrunning::model::Operation> {
431 (*self.0.stub)
432 .update_function(self.0.request, self.0.options)
433 .await
434 .map(gax::response::Response::into_body)
435 }
436
437 pub fn poller(
439 self,
440 ) -> impl lro::Poller<crate::model::Function, crate::model::OperationMetadata> {
441 type Operation =
442 lro::internal::Operation<crate::model::Function, crate::model::OperationMetadata>;
443 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
444 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
445
446 let stub = self.0.stub.clone();
447 let mut options = self.0.options.clone();
448 options.set_retry_policy(gax::retry_policy::NeverRetry);
449 let query = move |name| {
450 let stub = stub.clone();
451 let options = options.clone();
452 async {
453 let op = GetOperation::new(stub)
454 .set_name(name)
455 .with_options(options)
456 .send()
457 .await?;
458 Ok(Operation::new(op))
459 }
460 };
461
462 let start = move || async {
463 let op = self.send().await?;
464 Ok(Operation::new(op))
465 };
466
467 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
468 }
469
470 pub fn set_function<T>(mut self, v: T) -> Self
474 where
475 T: std::convert::Into<crate::model::Function>,
476 {
477 self.0.request.function = std::option::Option::Some(v.into());
478 self
479 }
480
481 pub fn set_or_clear_function<T>(mut self, v: std::option::Option<T>) -> Self
485 where
486 T: std::convert::Into<crate::model::Function>,
487 {
488 self.0.request.function = v.map(|x| x.into());
489 self
490 }
491
492 pub fn set_update_mask<T>(mut self, v: T) -> Self
494 where
495 T: std::convert::Into<wkt::FieldMask>,
496 {
497 self.0.request.update_mask = std::option::Option::Some(v.into());
498 self
499 }
500
501 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
503 where
504 T: std::convert::Into<wkt::FieldMask>,
505 {
506 self.0.request.update_mask = v.map(|x| x.into());
507 self
508 }
509 }
510
511 #[doc(hidden)]
512 impl gax::options::internal::RequestBuilder for UpdateFunction {
513 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
514 &mut self.0.options
515 }
516 }
517
518 #[derive(Clone, Debug)]
536 pub struct DeleteFunction(RequestBuilder<crate::model::DeleteFunctionRequest>);
537
538 impl DeleteFunction {
539 pub(crate) fn new(
540 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
541 ) -> Self {
542 Self(RequestBuilder::new(stub))
543 }
544
545 pub fn with_request<V: Into<crate::model::DeleteFunctionRequest>>(mut self, v: V) -> Self {
547 self.0.request = v.into();
548 self
549 }
550
551 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
553 self.0.options = v.into();
554 self
555 }
556
557 pub async fn send(self) -> Result<longrunning::model::Operation> {
564 (*self.0.stub)
565 .delete_function(self.0.request, self.0.options)
566 .await
567 .map(gax::response::Response::into_body)
568 }
569
570 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
572 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
573 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
574 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
575
576 let stub = self.0.stub.clone();
577 let mut options = self.0.options.clone();
578 options.set_retry_policy(gax::retry_policy::NeverRetry);
579 let query = move |name| {
580 let stub = stub.clone();
581 let options = options.clone();
582 async {
583 let op = GetOperation::new(stub)
584 .set_name(name)
585 .with_options(options)
586 .send()
587 .await?;
588 Ok(Operation::new(op))
589 }
590 };
591
592 let start = move || async {
593 let op = self.send().await?;
594 Ok(Operation::new(op))
595 };
596
597 lro::internal::new_unit_response_poller(
598 polling_error_policy,
599 polling_backoff_policy,
600 start,
601 query,
602 )
603 }
604
605 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
609 self.0.request.name = v.into();
610 self
611 }
612 }
613
614 #[doc(hidden)]
615 impl gax::options::internal::RequestBuilder for DeleteFunction {
616 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
617 &mut self.0.options
618 }
619 }
620
621 #[derive(Clone, Debug)]
638 pub struct GenerateUploadUrl(RequestBuilder<crate::model::GenerateUploadUrlRequest>);
639
640 impl GenerateUploadUrl {
641 pub(crate) fn new(
642 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
643 ) -> Self {
644 Self(RequestBuilder::new(stub))
645 }
646
647 pub fn with_request<V: Into<crate::model::GenerateUploadUrlRequest>>(
649 mut self,
650 v: V,
651 ) -> Self {
652 self.0.request = v.into();
653 self
654 }
655
656 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
658 self.0.options = v.into();
659 self
660 }
661
662 pub async fn send(self) -> Result<crate::model::GenerateUploadUrlResponse> {
664 (*self.0.stub)
665 .generate_upload_url(self.0.request, self.0.options)
666 .await
667 .map(gax::response::Response::into_body)
668 }
669
670 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
674 self.0.request.parent = v.into();
675 self
676 }
677
678 pub fn set_kms_key_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
680 self.0.request.kms_key_name = v.into();
681 self
682 }
683
684 pub fn set_environment<T: Into<crate::model::Environment>>(mut self, v: T) -> Self {
686 self.0.request.environment = v.into();
687 self
688 }
689 }
690
691 #[doc(hidden)]
692 impl gax::options::internal::RequestBuilder for GenerateUploadUrl {
693 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
694 &mut self.0.options
695 }
696 }
697
698 #[derive(Clone, Debug)]
715 pub struct GenerateDownloadUrl(RequestBuilder<crate::model::GenerateDownloadUrlRequest>);
716
717 impl GenerateDownloadUrl {
718 pub(crate) fn new(
719 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
720 ) -> Self {
721 Self(RequestBuilder::new(stub))
722 }
723
724 pub fn with_request<V: Into<crate::model::GenerateDownloadUrlRequest>>(
726 mut self,
727 v: V,
728 ) -> Self {
729 self.0.request = v.into();
730 self
731 }
732
733 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
735 self.0.options = v.into();
736 self
737 }
738
739 pub async fn send(self) -> Result<crate::model::GenerateDownloadUrlResponse> {
741 (*self.0.stub)
742 .generate_download_url(self.0.request, self.0.options)
743 .await
744 .map(gax::response::Response::into_body)
745 }
746
747 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
751 self.0.request.name = v.into();
752 self
753 }
754 }
755
756 #[doc(hidden)]
757 impl gax::options::internal::RequestBuilder for GenerateDownloadUrl {
758 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
759 &mut self.0.options
760 }
761 }
762
763 #[derive(Clone, Debug)]
780 pub struct ListRuntimes(RequestBuilder<crate::model::ListRuntimesRequest>);
781
782 impl ListRuntimes {
783 pub(crate) fn new(
784 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
785 ) -> Self {
786 Self(RequestBuilder::new(stub))
787 }
788
789 pub fn with_request<V: Into<crate::model::ListRuntimesRequest>>(mut self, v: V) -> Self {
791 self.0.request = v.into();
792 self
793 }
794
795 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
797 self.0.options = v.into();
798 self
799 }
800
801 pub async fn send(self) -> Result<crate::model::ListRuntimesResponse> {
803 (*self.0.stub)
804 .list_runtimes(self.0.request, self.0.options)
805 .await
806 .map(gax::response::Response::into_body)
807 }
808
809 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
813 self.0.request.parent = v.into();
814 self
815 }
816
817 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
819 self.0.request.filter = v.into();
820 self
821 }
822 }
823
824 #[doc(hidden)]
825 impl gax::options::internal::RequestBuilder for ListRuntimes {
826 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
827 &mut self.0.options
828 }
829 }
830
831 #[derive(Clone, Debug)]
852 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
853
854 impl ListLocations {
855 pub(crate) fn new(
856 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
857 ) -> Self {
858 Self(RequestBuilder::new(stub))
859 }
860
861 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
863 mut self,
864 v: V,
865 ) -> Self {
866 self.0.request = v.into();
867 self
868 }
869
870 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
872 self.0.options = v.into();
873 self
874 }
875
876 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
878 (*self.0.stub)
879 .list_locations(self.0.request, self.0.options)
880 .await
881 .map(gax::response::Response::into_body)
882 }
883
884 pub fn by_page(
886 self,
887 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
888 {
889 use std::clone::Clone;
890 let token = self.0.request.page_token.clone();
891 let execute = move |token: String| {
892 let mut builder = self.clone();
893 builder.0.request = builder.0.request.set_page_token(token);
894 builder.send()
895 };
896 gax::paginator::internal::new_paginator(token, execute)
897 }
898
899 pub fn by_item(
901 self,
902 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
903 {
904 use gax::paginator::Paginator;
905 self.by_page().items()
906 }
907
908 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
910 self.0.request.name = v.into();
911 self
912 }
913
914 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
916 self.0.request.filter = v.into();
917 self
918 }
919
920 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
922 self.0.request.page_size = v.into();
923 self
924 }
925
926 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
928 self.0.request.page_token = v.into();
929 self
930 }
931 }
932
933 #[doc(hidden)]
934 impl gax::options::internal::RequestBuilder for ListLocations {
935 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
936 &mut self.0.options
937 }
938 }
939
940 #[derive(Clone, Debug)]
957 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
958
959 impl SetIamPolicy {
960 pub(crate) fn new(
961 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
962 ) -> Self {
963 Self(RequestBuilder::new(stub))
964 }
965
966 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
968 self.0.request = v.into();
969 self
970 }
971
972 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
974 self.0.options = v.into();
975 self
976 }
977
978 pub async fn send(self) -> Result<iam_v1::model::Policy> {
980 (*self.0.stub)
981 .set_iam_policy(self.0.request, self.0.options)
982 .await
983 .map(gax::response::Response::into_body)
984 }
985
986 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
990 self.0.request.resource = v.into();
991 self
992 }
993
994 pub fn set_policy<T>(mut self, v: T) -> Self
998 where
999 T: std::convert::Into<iam_v1::model::Policy>,
1000 {
1001 self.0.request.policy = std::option::Option::Some(v.into());
1002 self
1003 }
1004
1005 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1009 where
1010 T: std::convert::Into<iam_v1::model::Policy>,
1011 {
1012 self.0.request.policy = v.map(|x| x.into());
1013 self
1014 }
1015
1016 pub fn set_update_mask<T>(mut self, v: T) -> Self
1018 where
1019 T: std::convert::Into<wkt::FieldMask>,
1020 {
1021 self.0.request.update_mask = std::option::Option::Some(v.into());
1022 self
1023 }
1024
1025 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1027 where
1028 T: std::convert::Into<wkt::FieldMask>,
1029 {
1030 self.0.request.update_mask = v.map(|x| x.into());
1031 self
1032 }
1033 }
1034
1035 #[doc(hidden)]
1036 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1037 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1038 &mut self.0.options
1039 }
1040 }
1041
1042 #[derive(Clone, Debug)]
1059 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1060
1061 impl GetIamPolicy {
1062 pub(crate) fn new(
1063 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1064 ) -> Self {
1065 Self(RequestBuilder::new(stub))
1066 }
1067
1068 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1070 self.0.request = v.into();
1071 self
1072 }
1073
1074 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1076 self.0.options = v.into();
1077 self
1078 }
1079
1080 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1082 (*self.0.stub)
1083 .get_iam_policy(self.0.request, self.0.options)
1084 .await
1085 .map(gax::response::Response::into_body)
1086 }
1087
1088 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1092 self.0.request.resource = v.into();
1093 self
1094 }
1095
1096 pub fn set_options<T>(mut self, v: T) -> Self
1098 where
1099 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1100 {
1101 self.0.request.options = std::option::Option::Some(v.into());
1102 self
1103 }
1104
1105 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1107 where
1108 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1109 {
1110 self.0.request.options = v.map(|x| x.into());
1111 self
1112 }
1113 }
1114
1115 #[doc(hidden)]
1116 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1117 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1118 &mut self.0.options
1119 }
1120 }
1121
1122 #[derive(Clone, Debug)]
1139 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1140
1141 impl TestIamPermissions {
1142 pub(crate) fn new(
1143 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1144 ) -> Self {
1145 Self(RequestBuilder::new(stub))
1146 }
1147
1148 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1150 mut self,
1151 v: V,
1152 ) -> Self {
1153 self.0.request = v.into();
1154 self
1155 }
1156
1157 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1159 self.0.options = v.into();
1160 self
1161 }
1162
1163 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1165 (*self.0.stub)
1166 .test_iam_permissions(self.0.request, self.0.options)
1167 .await
1168 .map(gax::response::Response::into_body)
1169 }
1170
1171 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1175 self.0.request.resource = v.into();
1176 self
1177 }
1178
1179 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1183 where
1184 T: std::iter::IntoIterator<Item = V>,
1185 V: std::convert::Into<std::string::String>,
1186 {
1187 use std::iter::Iterator;
1188 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1189 self
1190 }
1191 }
1192
1193 #[doc(hidden)]
1194 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1195 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1196 &mut self.0.options
1197 }
1198 }
1199
1200 #[derive(Clone, Debug)]
1221 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1222
1223 impl ListOperations {
1224 pub(crate) fn new(
1225 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1226 ) -> Self {
1227 Self(RequestBuilder::new(stub))
1228 }
1229
1230 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1232 mut self,
1233 v: V,
1234 ) -> Self {
1235 self.0.request = v.into();
1236 self
1237 }
1238
1239 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1241 self.0.options = v.into();
1242 self
1243 }
1244
1245 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1247 (*self.0.stub)
1248 .list_operations(self.0.request, self.0.options)
1249 .await
1250 .map(gax::response::Response::into_body)
1251 }
1252
1253 pub fn by_page(
1255 self,
1256 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1257 {
1258 use std::clone::Clone;
1259 let token = self.0.request.page_token.clone();
1260 let execute = move |token: String| {
1261 let mut builder = self.clone();
1262 builder.0.request = builder.0.request.set_page_token(token);
1263 builder.send()
1264 };
1265 gax::paginator::internal::new_paginator(token, execute)
1266 }
1267
1268 pub fn by_item(
1270 self,
1271 ) -> impl gax::paginator::ItemPaginator<
1272 longrunning::model::ListOperationsResponse,
1273 gax::error::Error,
1274 > {
1275 use gax::paginator::Paginator;
1276 self.by_page().items()
1277 }
1278
1279 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1281 self.0.request.name = v.into();
1282 self
1283 }
1284
1285 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1287 self.0.request.filter = v.into();
1288 self
1289 }
1290
1291 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1293 self.0.request.page_size = v.into();
1294 self
1295 }
1296
1297 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1299 self.0.request.page_token = v.into();
1300 self
1301 }
1302
1303 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1305 self.0.request.return_partial_success = v.into();
1306 self
1307 }
1308 }
1309
1310 #[doc(hidden)]
1311 impl gax::options::internal::RequestBuilder for ListOperations {
1312 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1313 &mut self.0.options
1314 }
1315 }
1316
1317 #[derive(Clone, Debug)]
1334 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1335
1336 impl GetOperation {
1337 pub(crate) fn new(
1338 stub: std::sync::Arc<dyn super::super::stub::dynamic::FunctionService>,
1339 ) -> Self {
1340 Self(RequestBuilder::new(stub))
1341 }
1342
1343 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1345 mut self,
1346 v: V,
1347 ) -> Self {
1348 self.0.request = v.into();
1349 self
1350 }
1351
1352 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1354 self.0.options = v.into();
1355 self
1356 }
1357
1358 pub async fn send(self) -> Result<longrunning::model::Operation> {
1360 (*self.0.stub)
1361 .get_operation(self.0.request, self.0.options)
1362 .await
1363 .map(gax::response::Response::into_body)
1364 }
1365
1366 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1368 self.0.request.name = v.into();
1369 self
1370 }
1371 }
1372
1373 #[doc(hidden)]
1374 impl gax::options::internal::RequestBuilder for GetOperation {
1375 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1376 &mut self.0.options
1377 }
1378 }
1379}