1pub mod secure_source_manager {
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::SecureSourceManager;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = SecureSourceManager;
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::SecureSourceManager>,
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::SecureSourceManager>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
96 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
97
98 impl ListInstances {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
107 self.0.request = v.into();
108 self
109 }
110
111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113 self.0.options = v.into();
114 self
115 }
116
117 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
119 (*self.0.stub)
120 .list_instances(self.0.request, self.0.options)
121 .await
122 .map(gax::response::Response::into_body)
123 }
124
125 pub fn by_page(
127 self,
128 ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::Error>
129 {
130 use std::clone::Clone;
131 let token = self.0.request.page_token.clone();
132 let execute = move |token: String| {
133 let mut builder = self.clone();
134 builder.0.request = builder.0.request.set_page_token(token);
135 builder.send()
136 };
137 gax::paginator::internal::new_paginator(token, execute)
138 }
139
140 pub fn by_item(
142 self,
143 ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
144 {
145 use gax::paginator::Paginator;
146 self.by_page().items()
147 }
148
149 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153 self.0.request.parent = v.into();
154 self
155 }
156
157 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159 self.0.request.page_size = v.into();
160 self
161 }
162
163 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165 self.0.request.page_token = v.into();
166 self
167 }
168
169 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.filter = v.into();
172 self
173 }
174
175 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
177 self.0.request.order_by = v.into();
178 self
179 }
180 }
181
182 #[doc(hidden)]
183 impl gax::options::internal::RequestBuilder for ListInstances {
184 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[derive(Clone, Debug)]
207 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
208
209 impl GetInstance {
210 pub(crate) fn new(
211 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
212 ) -> Self {
213 Self(RequestBuilder::new(stub))
214 }
215
216 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
218 self.0.request = v.into();
219 self
220 }
221
222 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
224 self.0.options = v.into();
225 self
226 }
227
228 pub async fn send(self) -> Result<crate::model::Instance> {
230 (*self.0.stub)
231 .get_instance(self.0.request, self.0.options)
232 .await
233 .map(gax::response::Response::into_body)
234 }
235
236 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240 self.0.request.name = v.into();
241 self
242 }
243 }
244
245 #[doc(hidden)]
246 impl gax::options::internal::RequestBuilder for GetInstance {
247 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
248 &mut self.0.options
249 }
250 }
251
252 #[derive(Clone, Debug)]
271 pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
272
273 impl CreateInstance {
274 pub(crate) fn new(
275 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
276 ) -> Self {
277 Self(RequestBuilder::new(stub))
278 }
279
280 pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
282 self.0.request = v.into();
283 self
284 }
285
286 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
288 self.0.options = v.into();
289 self
290 }
291
292 pub async fn send(self) -> Result<longrunning::model::Operation> {
299 (*self.0.stub)
300 .create_instance(self.0.request, self.0.options)
301 .await
302 .map(gax::response::Response::into_body)
303 }
304
305 pub fn poller(
307 self,
308 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
309 type Operation =
310 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
311 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
312 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
313
314 let stub = self.0.stub.clone();
315 let mut options = self.0.options.clone();
316 options.set_retry_policy(gax::retry_policy::NeverRetry);
317 let query = move |name| {
318 let stub = stub.clone();
319 let options = options.clone();
320 async {
321 let op = GetOperation::new(stub)
322 .set_name(name)
323 .with_options(options)
324 .send()
325 .await?;
326 Ok(Operation::new(op))
327 }
328 };
329
330 let start = move || async {
331 let op = self.send().await?;
332 Ok(Operation::new(op))
333 };
334
335 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
336 }
337
338 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
342 self.0.request.parent = v.into();
343 self
344 }
345
346 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
350 self.0.request.instance_id = v.into();
351 self
352 }
353
354 pub fn set_instance<T>(mut self, v: T) -> Self
358 where
359 T: std::convert::Into<crate::model::Instance>,
360 {
361 self.0.request.instance = std::option::Option::Some(v.into());
362 self
363 }
364
365 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
369 where
370 T: std::convert::Into<crate::model::Instance>,
371 {
372 self.0.request.instance = v.map(|x| x.into());
373 self
374 }
375
376 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
378 self.0.request.request_id = v.into();
379 self
380 }
381 }
382
383 #[doc(hidden)]
384 impl gax::options::internal::RequestBuilder for CreateInstance {
385 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
386 &mut self.0.options
387 }
388 }
389
390 #[derive(Clone, Debug)]
409 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
410
411 impl DeleteInstance {
412 pub(crate) fn new(
413 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
414 ) -> Self {
415 Self(RequestBuilder::new(stub))
416 }
417
418 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
420 self.0.request = v.into();
421 self
422 }
423
424 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
426 self.0.options = v.into();
427 self
428 }
429
430 pub async fn send(self) -> Result<longrunning::model::Operation> {
437 (*self.0.stub)
438 .delete_instance(self.0.request, self.0.options)
439 .await
440 .map(gax::response::Response::into_body)
441 }
442
443 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
445 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
446 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
447 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
448
449 let stub = self.0.stub.clone();
450 let mut options = self.0.options.clone();
451 options.set_retry_policy(gax::retry_policy::NeverRetry);
452 let query = move |name| {
453 let stub = stub.clone();
454 let options = options.clone();
455 async {
456 let op = GetOperation::new(stub)
457 .set_name(name)
458 .with_options(options)
459 .send()
460 .await?;
461 Ok(Operation::new(op))
462 }
463 };
464
465 let start = move || async {
466 let op = self.send().await?;
467 Ok(Operation::new(op))
468 };
469
470 lro::internal::new_unit_response_poller(
471 polling_error_policy,
472 polling_backoff_policy,
473 start,
474 query,
475 )
476 }
477
478 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
482 self.0.request.name = v.into();
483 self
484 }
485
486 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
488 self.0.request.request_id = v.into();
489 self
490 }
491 }
492
493 #[doc(hidden)]
494 impl gax::options::internal::RequestBuilder for DeleteInstance {
495 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
496 &mut self.0.options
497 }
498 }
499
500 #[derive(Clone, Debug)]
522 pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
523
524 impl ListRepositories {
525 pub(crate) fn new(
526 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
527 ) -> Self {
528 Self(RequestBuilder::new(stub))
529 }
530
531 pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
533 mut self,
534 v: V,
535 ) -> Self {
536 self.0.request = v.into();
537 self
538 }
539
540 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
542 self.0.options = v.into();
543 self
544 }
545
546 pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
548 (*self.0.stub)
549 .list_repositories(self.0.request, self.0.options)
550 .await
551 .map(gax::response::Response::into_body)
552 }
553
554 pub fn by_page(
556 self,
557 ) -> impl gax::paginator::Paginator<crate::model::ListRepositoriesResponse, gax::error::Error>
558 {
559 use std::clone::Clone;
560 let token = self.0.request.page_token.clone();
561 let execute = move |token: String| {
562 let mut builder = self.clone();
563 builder.0.request = builder.0.request.set_page_token(token);
564 builder.send()
565 };
566 gax::paginator::internal::new_paginator(token, execute)
567 }
568
569 pub fn by_item(
571 self,
572 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRepositoriesResponse, gax::error::Error>
573 {
574 use gax::paginator::Paginator;
575 self.by_page().items()
576 }
577
578 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
582 self.0.request.parent = v.into();
583 self
584 }
585
586 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
588 self.0.request.page_size = v.into();
589 self
590 }
591
592 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
594 self.0.request.page_token = v.into();
595 self
596 }
597
598 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
600 self.0.request.filter = v.into();
601 self
602 }
603
604 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
606 self.0.request.instance = v.into();
607 self
608 }
609 }
610
611 #[doc(hidden)]
612 impl gax::options::internal::RequestBuilder for ListRepositories {
613 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
614 &mut self.0.options
615 }
616 }
617
618 #[derive(Clone, Debug)]
636 pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
637
638 impl GetRepository {
639 pub(crate) fn new(
640 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
641 ) -> Self {
642 Self(RequestBuilder::new(stub))
643 }
644
645 pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
647 self.0.request = v.into();
648 self
649 }
650
651 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
653 self.0.options = v.into();
654 self
655 }
656
657 pub async fn send(self) -> Result<crate::model::Repository> {
659 (*self.0.stub)
660 .get_repository(self.0.request, self.0.options)
661 .await
662 .map(gax::response::Response::into_body)
663 }
664
665 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
669 self.0.request.name = v.into();
670 self
671 }
672 }
673
674 #[doc(hidden)]
675 impl gax::options::internal::RequestBuilder for GetRepository {
676 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
677 &mut self.0.options
678 }
679 }
680
681 #[derive(Clone, Debug)]
700 pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
701
702 impl CreateRepository {
703 pub(crate) fn new(
704 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
705 ) -> Self {
706 Self(RequestBuilder::new(stub))
707 }
708
709 pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
711 mut self,
712 v: V,
713 ) -> Self {
714 self.0.request = v.into();
715 self
716 }
717
718 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
720 self.0.options = v.into();
721 self
722 }
723
724 pub async fn send(self) -> Result<longrunning::model::Operation> {
731 (*self.0.stub)
732 .create_repository(self.0.request, self.0.options)
733 .await
734 .map(gax::response::Response::into_body)
735 }
736
737 pub fn poller(
739 self,
740 ) -> impl lro::Poller<crate::model::Repository, crate::model::OperationMetadata> {
741 type Operation =
742 lro::internal::Operation<crate::model::Repository, crate::model::OperationMetadata>;
743 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
744 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
745
746 let stub = self.0.stub.clone();
747 let mut options = self.0.options.clone();
748 options.set_retry_policy(gax::retry_policy::NeverRetry);
749 let query = move |name| {
750 let stub = stub.clone();
751 let options = options.clone();
752 async {
753 let op = GetOperation::new(stub)
754 .set_name(name)
755 .with_options(options)
756 .send()
757 .await?;
758 Ok(Operation::new(op))
759 }
760 };
761
762 let start = move || async {
763 let op = self.send().await?;
764 Ok(Operation::new(op))
765 };
766
767 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
768 }
769
770 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
774 self.0.request.parent = v.into();
775 self
776 }
777
778 pub fn set_repository<T>(mut self, v: T) -> Self
782 where
783 T: std::convert::Into<crate::model::Repository>,
784 {
785 self.0.request.repository = std::option::Option::Some(v.into());
786 self
787 }
788
789 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
793 where
794 T: std::convert::Into<crate::model::Repository>,
795 {
796 self.0.request.repository = v.map(|x| x.into());
797 self
798 }
799
800 pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
804 self.0.request.repository_id = v.into();
805 self
806 }
807 }
808
809 #[doc(hidden)]
810 impl gax::options::internal::RequestBuilder for CreateRepository {
811 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
812 &mut self.0.options
813 }
814 }
815
816 #[derive(Clone, Debug)]
835 pub struct UpdateRepository(RequestBuilder<crate::model::UpdateRepositoryRequest>);
836
837 impl UpdateRepository {
838 pub(crate) fn new(
839 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
840 ) -> Self {
841 Self(RequestBuilder::new(stub))
842 }
843
844 pub fn with_request<V: Into<crate::model::UpdateRepositoryRequest>>(
846 mut self,
847 v: V,
848 ) -> Self {
849 self.0.request = v.into();
850 self
851 }
852
853 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
855 self.0.options = v.into();
856 self
857 }
858
859 pub async fn send(self) -> Result<longrunning::model::Operation> {
866 (*self.0.stub)
867 .update_repository(self.0.request, self.0.options)
868 .await
869 .map(gax::response::Response::into_body)
870 }
871
872 pub fn poller(
874 self,
875 ) -> impl lro::Poller<crate::model::Repository, crate::model::OperationMetadata> {
876 type Operation =
877 lro::internal::Operation<crate::model::Repository, crate::model::OperationMetadata>;
878 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
879 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
880
881 let stub = self.0.stub.clone();
882 let mut options = self.0.options.clone();
883 options.set_retry_policy(gax::retry_policy::NeverRetry);
884 let query = move |name| {
885 let stub = stub.clone();
886 let options = options.clone();
887 async {
888 let op = GetOperation::new(stub)
889 .set_name(name)
890 .with_options(options)
891 .send()
892 .await?;
893 Ok(Operation::new(op))
894 }
895 };
896
897 let start = move || async {
898 let op = self.send().await?;
899 Ok(Operation::new(op))
900 };
901
902 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
903 }
904
905 pub fn set_update_mask<T>(mut self, v: T) -> Self
907 where
908 T: std::convert::Into<wkt::FieldMask>,
909 {
910 self.0.request.update_mask = std::option::Option::Some(v.into());
911 self
912 }
913
914 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
916 where
917 T: std::convert::Into<wkt::FieldMask>,
918 {
919 self.0.request.update_mask = v.map(|x| x.into());
920 self
921 }
922
923 pub fn set_repository<T>(mut self, v: T) -> Self
927 where
928 T: std::convert::Into<crate::model::Repository>,
929 {
930 self.0.request.repository = std::option::Option::Some(v.into());
931 self
932 }
933
934 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
938 where
939 T: std::convert::Into<crate::model::Repository>,
940 {
941 self.0.request.repository = v.map(|x| x.into());
942 self
943 }
944
945 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
947 self.0.request.validate_only = v.into();
948 self
949 }
950 }
951
952 #[doc(hidden)]
953 impl gax::options::internal::RequestBuilder for UpdateRepository {
954 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
955 &mut self.0.options
956 }
957 }
958
959 #[derive(Clone, Debug)]
978 pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
979
980 impl DeleteRepository {
981 pub(crate) fn new(
982 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
983 ) -> Self {
984 Self(RequestBuilder::new(stub))
985 }
986
987 pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
989 mut self,
990 v: V,
991 ) -> Self {
992 self.0.request = v.into();
993 self
994 }
995
996 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
998 self.0.options = v.into();
999 self
1000 }
1001
1002 pub async fn send(self) -> Result<longrunning::model::Operation> {
1009 (*self.0.stub)
1010 .delete_repository(self.0.request, self.0.options)
1011 .await
1012 .map(gax::response::Response::into_body)
1013 }
1014
1015 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1017 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1018 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1019 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1020
1021 let stub = self.0.stub.clone();
1022 let mut options = self.0.options.clone();
1023 options.set_retry_policy(gax::retry_policy::NeverRetry);
1024 let query = move |name| {
1025 let stub = stub.clone();
1026 let options = options.clone();
1027 async {
1028 let op = GetOperation::new(stub)
1029 .set_name(name)
1030 .with_options(options)
1031 .send()
1032 .await?;
1033 Ok(Operation::new(op))
1034 }
1035 };
1036
1037 let start = move || async {
1038 let op = self.send().await?;
1039 Ok(Operation::new(op))
1040 };
1041
1042 lro::internal::new_unit_response_poller(
1043 polling_error_policy,
1044 polling_backoff_policy,
1045 start,
1046 query,
1047 )
1048 }
1049
1050 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1054 self.0.request.name = v.into();
1055 self
1056 }
1057
1058 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1060 self.0.request.allow_missing = v.into();
1061 self
1062 }
1063 }
1064
1065 #[doc(hidden)]
1066 impl gax::options::internal::RequestBuilder for DeleteRepository {
1067 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1068 &mut self.0.options
1069 }
1070 }
1071
1072 #[derive(Clone, Debug)]
1094 pub struct ListHooks(RequestBuilder<crate::model::ListHooksRequest>);
1095
1096 impl ListHooks {
1097 pub(crate) fn new(
1098 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1099 ) -> Self {
1100 Self(RequestBuilder::new(stub))
1101 }
1102
1103 pub fn with_request<V: Into<crate::model::ListHooksRequest>>(mut self, v: V) -> Self {
1105 self.0.request = v.into();
1106 self
1107 }
1108
1109 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1111 self.0.options = v.into();
1112 self
1113 }
1114
1115 pub async fn send(self) -> Result<crate::model::ListHooksResponse> {
1117 (*self.0.stub)
1118 .list_hooks(self.0.request, self.0.options)
1119 .await
1120 .map(gax::response::Response::into_body)
1121 }
1122
1123 pub fn by_page(
1125 self,
1126 ) -> impl gax::paginator::Paginator<crate::model::ListHooksResponse, gax::error::Error>
1127 {
1128 use std::clone::Clone;
1129 let token = self.0.request.page_token.clone();
1130 let execute = move |token: String| {
1131 let mut builder = self.clone();
1132 builder.0.request = builder.0.request.set_page_token(token);
1133 builder.send()
1134 };
1135 gax::paginator::internal::new_paginator(token, execute)
1136 }
1137
1138 pub fn by_item(
1140 self,
1141 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHooksResponse, gax::error::Error>
1142 {
1143 use gax::paginator::Paginator;
1144 self.by_page().items()
1145 }
1146
1147 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1151 self.0.request.parent = v.into();
1152 self
1153 }
1154
1155 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1157 self.0.request.page_size = v.into();
1158 self
1159 }
1160
1161 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1163 self.0.request.page_token = v.into();
1164 self
1165 }
1166 }
1167
1168 #[doc(hidden)]
1169 impl gax::options::internal::RequestBuilder for ListHooks {
1170 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1171 &mut self.0.options
1172 }
1173 }
1174
1175 #[derive(Clone, Debug)]
1193 pub struct GetHook(RequestBuilder<crate::model::GetHookRequest>);
1194
1195 impl GetHook {
1196 pub(crate) fn new(
1197 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1198 ) -> Self {
1199 Self(RequestBuilder::new(stub))
1200 }
1201
1202 pub fn with_request<V: Into<crate::model::GetHookRequest>>(mut self, v: V) -> Self {
1204 self.0.request = v.into();
1205 self
1206 }
1207
1208 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1210 self.0.options = v.into();
1211 self
1212 }
1213
1214 pub async fn send(self) -> Result<crate::model::Hook> {
1216 (*self.0.stub)
1217 .get_hook(self.0.request, self.0.options)
1218 .await
1219 .map(gax::response::Response::into_body)
1220 }
1221
1222 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1226 self.0.request.name = v.into();
1227 self
1228 }
1229 }
1230
1231 #[doc(hidden)]
1232 impl gax::options::internal::RequestBuilder for GetHook {
1233 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1234 &mut self.0.options
1235 }
1236 }
1237
1238 #[derive(Clone, Debug)]
1257 pub struct CreateHook(RequestBuilder<crate::model::CreateHookRequest>);
1258
1259 impl CreateHook {
1260 pub(crate) fn new(
1261 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1262 ) -> Self {
1263 Self(RequestBuilder::new(stub))
1264 }
1265
1266 pub fn with_request<V: Into<crate::model::CreateHookRequest>>(mut self, v: V) -> Self {
1268 self.0.request = v.into();
1269 self
1270 }
1271
1272 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1274 self.0.options = v.into();
1275 self
1276 }
1277
1278 pub async fn send(self) -> Result<longrunning::model::Operation> {
1285 (*self.0.stub)
1286 .create_hook(self.0.request, self.0.options)
1287 .await
1288 .map(gax::response::Response::into_body)
1289 }
1290
1291 pub fn poller(
1293 self,
1294 ) -> impl lro::Poller<crate::model::Hook, crate::model::OperationMetadata> {
1295 type Operation =
1296 lro::internal::Operation<crate::model::Hook, crate::model::OperationMetadata>;
1297 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1298 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1299
1300 let stub = self.0.stub.clone();
1301 let mut options = self.0.options.clone();
1302 options.set_retry_policy(gax::retry_policy::NeverRetry);
1303 let query = move |name| {
1304 let stub = stub.clone();
1305 let options = options.clone();
1306 async {
1307 let op = GetOperation::new(stub)
1308 .set_name(name)
1309 .with_options(options)
1310 .send()
1311 .await?;
1312 Ok(Operation::new(op))
1313 }
1314 };
1315
1316 let start = move || async {
1317 let op = self.send().await?;
1318 Ok(Operation::new(op))
1319 };
1320
1321 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1322 }
1323
1324 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1328 self.0.request.parent = v.into();
1329 self
1330 }
1331
1332 pub fn set_hook<T>(mut self, v: T) -> Self
1336 where
1337 T: std::convert::Into<crate::model::Hook>,
1338 {
1339 self.0.request.hook = std::option::Option::Some(v.into());
1340 self
1341 }
1342
1343 pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
1347 where
1348 T: std::convert::Into<crate::model::Hook>,
1349 {
1350 self.0.request.hook = v.map(|x| x.into());
1351 self
1352 }
1353
1354 pub fn set_hook_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1358 self.0.request.hook_id = v.into();
1359 self
1360 }
1361 }
1362
1363 #[doc(hidden)]
1364 impl gax::options::internal::RequestBuilder for CreateHook {
1365 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1366 &mut self.0.options
1367 }
1368 }
1369
1370 #[derive(Clone, Debug)]
1389 pub struct UpdateHook(RequestBuilder<crate::model::UpdateHookRequest>);
1390
1391 impl UpdateHook {
1392 pub(crate) fn new(
1393 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1394 ) -> Self {
1395 Self(RequestBuilder::new(stub))
1396 }
1397
1398 pub fn with_request<V: Into<crate::model::UpdateHookRequest>>(mut self, v: V) -> Self {
1400 self.0.request = v.into();
1401 self
1402 }
1403
1404 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1406 self.0.options = v.into();
1407 self
1408 }
1409
1410 pub async fn send(self) -> Result<longrunning::model::Operation> {
1417 (*self.0.stub)
1418 .update_hook(self.0.request, self.0.options)
1419 .await
1420 .map(gax::response::Response::into_body)
1421 }
1422
1423 pub fn poller(
1425 self,
1426 ) -> impl lro::Poller<crate::model::Hook, crate::model::OperationMetadata> {
1427 type Operation =
1428 lro::internal::Operation<crate::model::Hook, crate::model::OperationMetadata>;
1429 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1430 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1431
1432 let stub = self.0.stub.clone();
1433 let mut options = self.0.options.clone();
1434 options.set_retry_policy(gax::retry_policy::NeverRetry);
1435 let query = move |name| {
1436 let stub = stub.clone();
1437 let options = options.clone();
1438 async {
1439 let op = GetOperation::new(stub)
1440 .set_name(name)
1441 .with_options(options)
1442 .send()
1443 .await?;
1444 Ok(Operation::new(op))
1445 }
1446 };
1447
1448 let start = move || async {
1449 let op = self.send().await?;
1450 Ok(Operation::new(op))
1451 };
1452
1453 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1454 }
1455
1456 pub fn set_update_mask<T>(mut self, v: T) -> Self
1460 where
1461 T: std::convert::Into<wkt::FieldMask>,
1462 {
1463 self.0.request.update_mask = std::option::Option::Some(v.into());
1464 self
1465 }
1466
1467 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1471 where
1472 T: std::convert::Into<wkt::FieldMask>,
1473 {
1474 self.0.request.update_mask = v.map(|x| x.into());
1475 self
1476 }
1477
1478 pub fn set_hook<T>(mut self, v: T) -> Self
1482 where
1483 T: std::convert::Into<crate::model::Hook>,
1484 {
1485 self.0.request.hook = std::option::Option::Some(v.into());
1486 self
1487 }
1488
1489 pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
1493 where
1494 T: std::convert::Into<crate::model::Hook>,
1495 {
1496 self.0.request.hook = v.map(|x| x.into());
1497 self
1498 }
1499 }
1500
1501 #[doc(hidden)]
1502 impl gax::options::internal::RequestBuilder for UpdateHook {
1503 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1504 &mut self.0.options
1505 }
1506 }
1507
1508 #[derive(Clone, Debug)]
1527 pub struct DeleteHook(RequestBuilder<crate::model::DeleteHookRequest>);
1528
1529 impl DeleteHook {
1530 pub(crate) fn new(
1531 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1532 ) -> Self {
1533 Self(RequestBuilder::new(stub))
1534 }
1535
1536 pub fn with_request<V: Into<crate::model::DeleteHookRequest>>(mut self, v: V) -> Self {
1538 self.0.request = v.into();
1539 self
1540 }
1541
1542 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1544 self.0.options = v.into();
1545 self
1546 }
1547
1548 pub async fn send(self) -> Result<longrunning::model::Operation> {
1555 (*self.0.stub)
1556 .delete_hook(self.0.request, self.0.options)
1557 .await
1558 .map(gax::response::Response::into_body)
1559 }
1560
1561 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1563 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1564 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1565 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1566
1567 let stub = self.0.stub.clone();
1568 let mut options = self.0.options.clone();
1569 options.set_retry_policy(gax::retry_policy::NeverRetry);
1570 let query = move |name| {
1571 let stub = stub.clone();
1572 let options = options.clone();
1573 async {
1574 let op = GetOperation::new(stub)
1575 .set_name(name)
1576 .with_options(options)
1577 .send()
1578 .await?;
1579 Ok(Operation::new(op))
1580 }
1581 };
1582
1583 let start = move || async {
1584 let op = self.send().await?;
1585 Ok(Operation::new(op))
1586 };
1587
1588 lro::internal::new_unit_response_poller(
1589 polling_error_policy,
1590 polling_backoff_policy,
1591 start,
1592 query,
1593 )
1594 }
1595
1596 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1600 self.0.request.name = v.into();
1601 self
1602 }
1603 }
1604
1605 #[doc(hidden)]
1606 impl gax::options::internal::RequestBuilder for DeleteHook {
1607 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1608 &mut self.0.options
1609 }
1610 }
1611
1612 #[derive(Clone, Debug)]
1630 pub struct GetIamPolicyRepo(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1631
1632 impl GetIamPolicyRepo {
1633 pub(crate) fn new(
1634 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1635 ) -> Self {
1636 Self(RequestBuilder::new(stub))
1637 }
1638
1639 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1641 self.0.request = v.into();
1642 self
1643 }
1644
1645 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1647 self.0.options = v.into();
1648 self
1649 }
1650
1651 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1653 (*self.0.stub)
1654 .get_iam_policy_repo(self.0.request, self.0.options)
1655 .await
1656 .map(gax::response::Response::into_body)
1657 }
1658
1659 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1663 self.0.request.resource = v.into();
1664 self
1665 }
1666
1667 pub fn set_options<T>(mut self, v: T) -> Self
1669 where
1670 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1671 {
1672 self.0.request.options = std::option::Option::Some(v.into());
1673 self
1674 }
1675
1676 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1678 where
1679 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1680 {
1681 self.0.request.options = v.map(|x| x.into());
1682 self
1683 }
1684 }
1685
1686 #[doc(hidden)]
1687 impl gax::options::internal::RequestBuilder for GetIamPolicyRepo {
1688 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1689 &mut self.0.options
1690 }
1691 }
1692
1693 #[derive(Clone, Debug)]
1711 pub struct SetIamPolicyRepo(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1712
1713 impl SetIamPolicyRepo {
1714 pub(crate) fn new(
1715 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1716 ) -> Self {
1717 Self(RequestBuilder::new(stub))
1718 }
1719
1720 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1722 self.0.request = v.into();
1723 self
1724 }
1725
1726 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1728 self.0.options = v.into();
1729 self
1730 }
1731
1732 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1734 (*self.0.stub)
1735 .set_iam_policy_repo(self.0.request, self.0.options)
1736 .await
1737 .map(gax::response::Response::into_body)
1738 }
1739
1740 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1744 self.0.request.resource = v.into();
1745 self
1746 }
1747
1748 pub fn set_policy<T>(mut self, v: T) -> Self
1752 where
1753 T: std::convert::Into<iam_v1::model::Policy>,
1754 {
1755 self.0.request.policy = std::option::Option::Some(v.into());
1756 self
1757 }
1758
1759 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1763 where
1764 T: std::convert::Into<iam_v1::model::Policy>,
1765 {
1766 self.0.request.policy = v.map(|x| x.into());
1767 self
1768 }
1769
1770 pub fn set_update_mask<T>(mut self, v: T) -> Self
1772 where
1773 T: std::convert::Into<wkt::FieldMask>,
1774 {
1775 self.0.request.update_mask = std::option::Option::Some(v.into());
1776 self
1777 }
1778
1779 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1781 where
1782 T: std::convert::Into<wkt::FieldMask>,
1783 {
1784 self.0.request.update_mask = v.map(|x| x.into());
1785 self
1786 }
1787 }
1788
1789 #[doc(hidden)]
1790 impl gax::options::internal::RequestBuilder for SetIamPolicyRepo {
1791 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1792 &mut self.0.options
1793 }
1794 }
1795
1796 #[derive(Clone, Debug)]
1814 pub struct TestIamPermissionsRepo(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1815
1816 impl TestIamPermissionsRepo {
1817 pub(crate) fn new(
1818 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1819 ) -> Self {
1820 Self(RequestBuilder::new(stub))
1821 }
1822
1823 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1825 mut self,
1826 v: V,
1827 ) -> Self {
1828 self.0.request = v.into();
1829 self
1830 }
1831
1832 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1834 self.0.options = v.into();
1835 self
1836 }
1837
1838 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1840 (*self.0.stub)
1841 .test_iam_permissions_repo(self.0.request, self.0.options)
1842 .await
1843 .map(gax::response::Response::into_body)
1844 }
1845
1846 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1850 self.0.request.resource = v.into();
1851 self
1852 }
1853
1854 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1858 where
1859 T: std::iter::IntoIterator<Item = V>,
1860 V: std::convert::Into<std::string::String>,
1861 {
1862 use std::iter::Iterator;
1863 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1864 self
1865 }
1866 }
1867
1868 #[doc(hidden)]
1869 impl gax::options::internal::RequestBuilder for TestIamPermissionsRepo {
1870 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1871 &mut self.0.options
1872 }
1873 }
1874
1875 #[derive(Clone, Debug)]
1894 pub struct CreateBranchRule(RequestBuilder<crate::model::CreateBranchRuleRequest>);
1895
1896 impl CreateBranchRule {
1897 pub(crate) fn new(
1898 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1899 ) -> Self {
1900 Self(RequestBuilder::new(stub))
1901 }
1902
1903 pub fn with_request<V: Into<crate::model::CreateBranchRuleRequest>>(
1905 mut self,
1906 v: V,
1907 ) -> Self {
1908 self.0.request = v.into();
1909 self
1910 }
1911
1912 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1914 self.0.options = v.into();
1915 self
1916 }
1917
1918 pub async fn send(self) -> Result<longrunning::model::Operation> {
1925 (*self.0.stub)
1926 .create_branch_rule(self.0.request, self.0.options)
1927 .await
1928 .map(gax::response::Response::into_body)
1929 }
1930
1931 pub fn poller(
1933 self,
1934 ) -> impl lro::Poller<crate::model::BranchRule, crate::model::OperationMetadata> {
1935 type Operation =
1936 lro::internal::Operation<crate::model::BranchRule, crate::model::OperationMetadata>;
1937 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1938 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1939
1940 let stub = self.0.stub.clone();
1941 let mut options = self.0.options.clone();
1942 options.set_retry_policy(gax::retry_policy::NeverRetry);
1943 let query = move |name| {
1944 let stub = stub.clone();
1945 let options = options.clone();
1946 async {
1947 let op = GetOperation::new(stub)
1948 .set_name(name)
1949 .with_options(options)
1950 .send()
1951 .await?;
1952 Ok(Operation::new(op))
1953 }
1954 };
1955
1956 let start = move || async {
1957 let op = self.send().await?;
1958 Ok(Operation::new(op))
1959 };
1960
1961 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1962 }
1963
1964 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1968 self.0.request.parent = v.into();
1969 self
1970 }
1971
1972 pub fn set_branch_rule<T>(mut self, v: T) -> Self
1976 where
1977 T: std::convert::Into<crate::model::BranchRule>,
1978 {
1979 self.0.request.branch_rule = std::option::Option::Some(v.into());
1980 self
1981 }
1982
1983 pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
1987 where
1988 T: std::convert::Into<crate::model::BranchRule>,
1989 {
1990 self.0.request.branch_rule = v.map(|x| x.into());
1991 self
1992 }
1993
1994 pub fn set_branch_rule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1998 self.0.request.branch_rule_id = v.into();
1999 self
2000 }
2001 }
2002
2003 #[doc(hidden)]
2004 impl gax::options::internal::RequestBuilder for CreateBranchRule {
2005 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2006 &mut self.0.options
2007 }
2008 }
2009
2010 #[derive(Clone, Debug)]
2032 pub struct ListBranchRules(RequestBuilder<crate::model::ListBranchRulesRequest>);
2033
2034 impl ListBranchRules {
2035 pub(crate) fn new(
2036 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2037 ) -> Self {
2038 Self(RequestBuilder::new(stub))
2039 }
2040
2041 pub fn with_request<V: Into<crate::model::ListBranchRulesRequest>>(mut self, v: V) -> Self {
2043 self.0.request = v.into();
2044 self
2045 }
2046
2047 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2049 self.0.options = v.into();
2050 self
2051 }
2052
2053 pub async fn send(self) -> Result<crate::model::ListBranchRulesResponse> {
2055 (*self.0.stub)
2056 .list_branch_rules(self.0.request, self.0.options)
2057 .await
2058 .map(gax::response::Response::into_body)
2059 }
2060
2061 pub fn by_page(
2063 self,
2064 ) -> impl gax::paginator::Paginator<crate::model::ListBranchRulesResponse, gax::error::Error>
2065 {
2066 use std::clone::Clone;
2067 let token = self.0.request.page_token.clone();
2068 let execute = move |token: String| {
2069 let mut builder = self.clone();
2070 builder.0.request = builder.0.request.set_page_token(token);
2071 builder.send()
2072 };
2073 gax::paginator::internal::new_paginator(token, execute)
2074 }
2075
2076 pub fn by_item(
2078 self,
2079 ) -> impl gax::paginator::ItemPaginator<crate::model::ListBranchRulesResponse, gax::error::Error>
2080 {
2081 use gax::paginator::Paginator;
2082 self.by_page().items()
2083 }
2084
2085 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2089 self.0.request.parent = v.into();
2090 self
2091 }
2092
2093 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2095 self.0.request.page_size = v.into();
2096 self
2097 }
2098
2099 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2101 self.0.request.page_token = v.into();
2102 self
2103 }
2104 }
2105
2106 #[doc(hidden)]
2107 impl gax::options::internal::RequestBuilder for ListBranchRules {
2108 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2109 &mut self.0.options
2110 }
2111 }
2112
2113 #[derive(Clone, Debug)]
2131 pub struct GetBranchRule(RequestBuilder<crate::model::GetBranchRuleRequest>);
2132
2133 impl GetBranchRule {
2134 pub(crate) fn new(
2135 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2136 ) -> Self {
2137 Self(RequestBuilder::new(stub))
2138 }
2139
2140 pub fn with_request<V: Into<crate::model::GetBranchRuleRequest>>(mut self, v: V) -> Self {
2142 self.0.request = v.into();
2143 self
2144 }
2145
2146 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2148 self.0.options = v.into();
2149 self
2150 }
2151
2152 pub async fn send(self) -> Result<crate::model::BranchRule> {
2154 (*self.0.stub)
2155 .get_branch_rule(self.0.request, self.0.options)
2156 .await
2157 .map(gax::response::Response::into_body)
2158 }
2159
2160 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2164 self.0.request.name = v.into();
2165 self
2166 }
2167 }
2168
2169 #[doc(hidden)]
2170 impl gax::options::internal::RequestBuilder for GetBranchRule {
2171 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2172 &mut self.0.options
2173 }
2174 }
2175
2176 #[derive(Clone, Debug)]
2195 pub struct UpdateBranchRule(RequestBuilder<crate::model::UpdateBranchRuleRequest>);
2196
2197 impl UpdateBranchRule {
2198 pub(crate) fn new(
2199 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2200 ) -> Self {
2201 Self(RequestBuilder::new(stub))
2202 }
2203
2204 pub fn with_request<V: Into<crate::model::UpdateBranchRuleRequest>>(
2206 mut self,
2207 v: V,
2208 ) -> Self {
2209 self.0.request = v.into();
2210 self
2211 }
2212
2213 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2215 self.0.options = v.into();
2216 self
2217 }
2218
2219 pub async fn send(self) -> Result<longrunning::model::Operation> {
2226 (*self.0.stub)
2227 .update_branch_rule(self.0.request, self.0.options)
2228 .await
2229 .map(gax::response::Response::into_body)
2230 }
2231
2232 pub fn poller(
2234 self,
2235 ) -> impl lro::Poller<crate::model::BranchRule, crate::model::OperationMetadata> {
2236 type Operation =
2237 lro::internal::Operation<crate::model::BranchRule, crate::model::OperationMetadata>;
2238 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2239 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2240
2241 let stub = self.0.stub.clone();
2242 let mut options = self.0.options.clone();
2243 options.set_retry_policy(gax::retry_policy::NeverRetry);
2244 let query = move |name| {
2245 let stub = stub.clone();
2246 let options = options.clone();
2247 async {
2248 let op = GetOperation::new(stub)
2249 .set_name(name)
2250 .with_options(options)
2251 .send()
2252 .await?;
2253 Ok(Operation::new(op))
2254 }
2255 };
2256
2257 let start = move || async {
2258 let op = self.send().await?;
2259 Ok(Operation::new(op))
2260 };
2261
2262 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2263 }
2264
2265 pub fn set_branch_rule<T>(mut self, v: T) -> Self
2269 where
2270 T: std::convert::Into<crate::model::BranchRule>,
2271 {
2272 self.0.request.branch_rule = std::option::Option::Some(v.into());
2273 self
2274 }
2275
2276 pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
2280 where
2281 T: std::convert::Into<crate::model::BranchRule>,
2282 {
2283 self.0.request.branch_rule = v.map(|x| x.into());
2284 self
2285 }
2286
2287 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2289 self.0.request.validate_only = v.into();
2290 self
2291 }
2292
2293 pub fn set_update_mask<T>(mut self, v: T) -> Self
2297 where
2298 T: std::convert::Into<wkt::FieldMask>,
2299 {
2300 self.0.request.update_mask = std::option::Option::Some(v.into());
2301 self
2302 }
2303
2304 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2308 where
2309 T: std::convert::Into<wkt::FieldMask>,
2310 {
2311 self.0.request.update_mask = v.map(|x| x.into());
2312 self
2313 }
2314 }
2315
2316 #[doc(hidden)]
2317 impl gax::options::internal::RequestBuilder for UpdateBranchRule {
2318 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2319 &mut self.0.options
2320 }
2321 }
2322
2323 #[derive(Clone, Debug)]
2342 pub struct DeleteBranchRule(RequestBuilder<crate::model::DeleteBranchRuleRequest>);
2343
2344 impl DeleteBranchRule {
2345 pub(crate) fn new(
2346 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2347 ) -> Self {
2348 Self(RequestBuilder::new(stub))
2349 }
2350
2351 pub fn with_request<V: Into<crate::model::DeleteBranchRuleRequest>>(
2353 mut self,
2354 v: V,
2355 ) -> Self {
2356 self.0.request = v.into();
2357 self
2358 }
2359
2360 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2362 self.0.options = v.into();
2363 self
2364 }
2365
2366 pub async fn send(self) -> Result<longrunning::model::Operation> {
2373 (*self.0.stub)
2374 .delete_branch_rule(self.0.request, self.0.options)
2375 .await
2376 .map(gax::response::Response::into_body)
2377 }
2378
2379 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2381 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2382 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2383 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2384
2385 let stub = self.0.stub.clone();
2386 let mut options = self.0.options.clone();
2387 options.set_retry_policy(gax::retry_policy::NeverRetry);
2388 let query = move |name| {
2389 let stub = stub.clone();
2390 let options = options.clone();
2391 async {
2392 let op = GetOperation::new(stub)
2393 .set_name(name)
2394 .with_options(options)
2395 .send()
2396 .await?;
2397 Ok(Operation::new(op))
2398 }
2399 };
2400
2401 let start = move || async {
2402 let op = self.send().await?;
2403 Ok(Operation::new(op))
2404 };
2405
2406 lro::internal::new_unit_response_poller(
2407 polling_error_policy,
2408 polling_backoff_policy,
2409 start,
2410 query,
2411 )
2412 }
2413
2414 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2418 self.0.request.name = v.into();
2419 self
2420 }
2421
2422 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2424 self.0.request.allow_missing = v.into();
2425 self
2426 }
2427 }
2428
2429 #[doc(hidden)]
2430 impl gax::options::internal::RequestBuilder for DeleteBranchRule {
2431 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2432 &mut self.0.options
2433 }
2434 }
2435
2436 #[derive(Clone, Debug)]
2455 pub struct CreatePullRequest(RequestBuilder<crate::model::CreatePullRequestRequest>);
2456
2457 impl CreatePullRequest {
2458 pub(crate) fn new(
2459 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2460 ) -> Self {
2461 Self(RequestBuilder::new(stub))
2462 }
2463
2464 pub fn with_request<V: Into<crate::model::CreatePullRequestRequest>>(
2466 mut self,
2467 v: V,
2468 ) -> Self {
2469 self.0.request = v.into();
2470 self
2471 }
2472
2473 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2475 self.0.options = v.into();
2476 self
2477 }
2478
2479 pub async fn send(self) -> Result<longrunning::model::Operation> {
2486 (*self.0.stub)
2487 .create_pull_request(self.0.request, self.0.options)
2488 .await
2489 .map(gax::response::Response::into_body)
2490 }
2491
2492 pub fn poller(
2494 self,
2495 ) -> impl lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata> {
2496 type Operation = lro::internal::Operation<
2497 crate::model::PullRequest,
2498 crate::model::OperationMetadata,
2499 >;
2500 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2501 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2502
2503 let stub = self.0.stub.clone();
2504 let mut options = self.0.options.clone();
2505 options.set_retry_policy(gax::retry_policy::NeverRetry);
2506 let query = move |name| {
2507 let stub = stub.clone();
2508 let options = options.clone();
2509 async {
2510 let op = GetOperation::new(stub)
2511 .set_name(name)
2512 .with_options(options)
2513 .send()
2514 .await?;
2515 Ok(Operation::new(op))
2516 }
2517 };
2518
2519 let start = move || async {
2520 let op = self.send().await?;
2521 Ok(Operation::new(op))
2522 };
2523
2524 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2525 }
2526
2527 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2531 self.0.request.parent = v.into();
2532 self
2533 }
2534
2535 pub fn set_pull_request<T>(mut self, v: T) -> Self
2539 where
2540 T: std::convert::Into<crate::model::PullRequest>,
2541 {
2542 self.0.request.pull_request = std::option::Option::Some(v.into());
2543 self
2544 }
2545
2546 pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
2550 where
2551 T: std::convert::Into<crate::model::PullRequest>,
2552 {
2553 self.0.request.pull_request = v.map(|x| x.into());
2554 self
2555 }
2556 }
2557
2558 #[doc(hidden)]
2559 impl gax::options::internal::RequestBuilder for CreatePullRequest {
2560 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2561 &mut self.0.options
2562 }
2563 }
2564
2565 #[derive(Clone, Debug)]
2583 pub struct GetPullRequest(RequestBuilder<crate::model::GetPullRequestRequest>);
2584
2585 impl GetPullRequest {
2586 pub(crate) fn new(
2587 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2588 ) -> Self {
2589 Self(RequestBuilder::new(stub))
2590 }
2591
2592 pub fn with_request<V: Into<crate::model::GetPullRequestRequest>>(mut self, v: V) -> Self {
2594 self.0.request = v.into();
2595 self
2596 }
2597
2598 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2600 self.0.options = v.into();
2601 self
2602 }
2603
2604 pub async fn send(self) -> Result<crate::model::PullRequest> {
2606 (*self.0.stub)
2607 .get_pull_request(self.0.request, self.0.options)
2608 .await
2609 .map(gax::response::Response::into_body)
2610 }
2611
2612 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2616 self.0.request.name = v.into();
2617 self
2618 }
2619 }
2620
2621 #[doc(hidden)]
2622 impl gax::options::internal::RequestBuilder for GetPullRequest {
2623 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2624 &mut self.0.options
2625 }
2626 }
2627
2628 #[derive(Clone, Debug)]
2650 pub struct ListPullRequests(RequestBuilder<crate::model::ListPullRequestsRequest>);
2651
2652 impl ListPullRequests {
2653 pub(crate) fn new(
2654 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2655 ) -> Self {
2656 Self(RequestBuilder::new(stub))
2657 }
2658
2659 pub fn with_request<V: Into<crate::model::ListPullRequestsRequest>>(
2661 mut self,
2662 v: V,
2663 ) -> Self {
2664 self.0.request = v.into();
2665 self
2666 }
2667
2668 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2670 self.0.options = v.into();
2671 self
2672 }
2673
2674 pub async fn send(self) -> Result<crate::model::ListPullRequestsResponse> {
2676 (*self.0.stub)
2677 .list_pull_requests(self.0.request, self.0.options)
2678 .await
2679 .map(gax::response::Response::into_body)
2680 }
2681
2682 pub fn by_page(
2684 self,
2685 ) -> impl gax::paginator::Paginator<crate::model::ListPullRequestsResponse, gax::error::Error>
2686 {
2687 use std::clone::Clone;
2688 let token = self.0.request.page_token.clone();
2689 let execute = move |token: String| {
2690 let mut builder = self.clone();
2691 builder.0.request = builder.0.request.set_page_token(token);
2692 builder.send()
2693 };
2694 gax::paginator::internal::new_paginator(token, execute)
2695 }
2696
2697 pub fn by_item(
2699 self,
2700 ) -> impl gax::paginator::ItemPaginator<crate::model::ListPullRequestsResponse, gax::error::Error>
2701 {
2702 use gax::paginator::Paginator;
2703 self.by_page().items()
2704 }
2705
2706 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2710 self.0.request.parent = v.into();
2711 self
2712 }
2713
2714 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2716 self.0.request.page_size = v.into();
2717 self
2718 }
2719
2720 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2722 self.0.request.page_token = v.into();
2723 self
2724 }
2725 }
2726
2727 #[doc(hidden)]
2728 impl gax::options::internal::RequestBuilder for ListPullRequests {
2729 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2730 &mut self.0.options
2731 }
2732 }
2733
2734 #[derive(Clone, Debug)]
2753 pub struct UpdatePullRequest(RequestBuilder<crate::model::UpdatePullRequestRequest>);
2754
2755 impl UpdatePullRequest {
2756 pub(crate) fn new(
2757 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2758 ) -> Self {
2759 Self(RequestBuilder::new(stub))
2760 }
2761
2762 pub fn with_request<V: Into<crate::model::UpdatePullRequestRequest>>(
2764 mut self,
2765 v: V,
2766 ) -> Self {
2767 self.0.request = v.into();
2768 self
2769 }
2770
2771 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2773 self.0.options = v.into();
2774 self
2775 }
2776
2777 pub async fn send(self) -> Result<longrunning::model::Operation> {
2784 (*self.0.stub)
2785 .update_pull_request(self.0.request, self.0.options)
2786 .await
2787 .map(gax::response::Response::into_body)
2788 }
2789
2790 pub fn poller(
2792 self,
2793 ) -> impl lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata> {
2794 type Operation = lro::internal::Operation<
2795 crate::model::PullRequest,
2796 crate::model::OperationMetadata,
2797 >;
2798 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2799 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2800
2801 let stub = self.0.stub.clone();
2802 let mut options = self.0.options.clone();
2803 options.set_retry_policy(gax::retry_policy::NeverRetry);
2804 let query = move |name| {
2805 let stub = stub.clone();
2806 let options = options.clone();
2807 async {
2808 let op = GetOperation::new(stub)
2809 .set_name(name)
2810 .with_options(options)
2811 .send()
2812 .await?;
2813 Ok(Operation::new(op))
2814 }
2815 };
2816
2817 let start = move || async {
2818 let op = self.send().await?;
2819 Ok(Operation::new(op))
2820 };
2821
2822 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2823 }
2824
2825 pub fn set_pull_request<T>(mut self, v: T) -> Self
2829 where
2830 T: std::convert::Into<crate::model::PullRequest>,
2831 {
2832 self.0.request.pull_request = std::option::Option::Some(v.into());
2833 self
2834 }
2835
2836 pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
2840 where
2841 T: std::convert::Into<crate::model::PullRequest>,
2842 {
2843 self.0.request.pull_request = v.map(|x| x.into());
2844 self
2845 }
2846
2847 pub fn set_update_mask<T>(mut self, v: T) -> Self
2849 where
2850 T: std::convert::Into<wkt::FieldMask>,
2851 {
2852 self.0.request.update_mask = std::option::Option::Some(v.into());
2853 self
2854 }
2855
2856 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2858 where
2859 T: std::convert::Into<wkt::FieldMask>,
2860 {
2861 self.0.request.update_mask = v.map(|x| x.into());
2862 self
2863 }
2864 }
2865
2866 #[doc(hidden)]
2867 impl gax::options::internal::RequestBuilder for UpdatePullRequest {
2868 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2869 &mut self.0.options
2870 }
2871 }
2872
2873 #[derive(Clone, Debug)]
2892 pub struct MergePullRequest(RequestBuilder<crate::model::MergePullRequestRequest>);
2893
2894 impl MergePullRequest {
2895 pub(crate) fn new(
2896 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2897 ) -> Self {
2898 Self(RequestBuilder::new(stub))
2899 }
2900
2901 pub fn with_request<V: Into<crate::model::MergePullRequestRequest>>(
2903 mut self,
2904 v: V,
2905 ) -> Self {
2906 self.0.request = v.into();
2907 self
2908 }
2909
2910 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2912 self.0.options = v.into();
2913 self
2914 }
2915
2916 pub async fn send(self) -> Result<longrunning::model::Operation> {
2923 (*self.0.stub)
2924 .merge_pull_request(self.0.request, self.0.options)
2925 .await
2926 .map(gax::response::Response::into_body)
2927 }
2928
2929 pub fn poller(
2931 self,
2932 ) -> impl lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata> {
2933 type Operation = lro::internal::Operation<
2934 crate::model::PullRequest,
2935 crate::model::OperationMetadata,
2936 >;
2937 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2938 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2939
2940 let stub = self.0.stub.clone();
2941 let mut options = self.0.options.clone();
2942 options.set_retry_policy(gax::retry_policy::NeverRetry);
2943 let query = move |name| {
2944 let stub = stub.clone();
2945 let options = options.clone();
2946 async {
2947 let op = GetOperation::new(stub)
2948 .set_name(name)
2949 .with_options(options)
2950 .send()
2951 .await?;
2952 Ok(Operation::new(op))
2953 }
2954 };
2955
2956 let start = move || async {
2957 let op = self.send().await?;
2958 Ok(Operation::new(op))
2959 };
2960
2961 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2962 }
2963
2964 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2968 self.0.request.name = v.into();
2969 self
2970 }
2971 }
2972
2973 #[doc(hidden)]
2974 impl gax::options::internal::RequestBuilder for MergePullRequest {
2975 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2976 &mut self.0.options
2977 }
2978 }
2979
2980 #[derive(Clone, Debug)]
2999 pub struct OpenPullRequest(RequestBuilder<crate::model::OpenPullRequestRequest>);
3000
3001 impl OpenPullRequest {
3002 pub(crate) fn new(
3003 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3004 ) -> Self {
3005 Self(RequestBuilder::new(stub))
3006 }
3007
3008 pub fn with_request<V: Into<crate::model::OpenPullRequestRequest>>(mut self, v: V) -> Self {
3010 self.0.request = v.into();
3011 self
3012 }
3013
3014 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3016 self.0.options = v.into();
3017 self
3018 }
3019
3020 pub async fn send(self) -> Result<longrunning::model::Operation> {
3027 (*self.0.stub)
3028 .open_pull_request(self.0.request, self.0.options)
3029 .await
3030 .map(gax::response::Response::into_body)
3031 }
3032
3033 pub fn poller(
3035 self,
3036 ) -> impl lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata> {
3037 type Operation = lro::internal::Operation<
3038 crate::model::PullRequest,
3039 crate::model::OperationMetadata,
3040 >;
3041 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3042 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3043
3044 let stub = self.0.stub.clone();
3045 let mut options = self.0.options.clone();
3046 options.set_retry_policy(gax::retry_policy::NeverRetry);
3047 let query = move |name| {
3048 let stub = stub.clone();
3049 let options = options.clone();
3050 async {
3051 let op = GetOperation::new(stub)
3052 .set_name(name)
3053 .with_options(options)
3054 .send()
3055 .await?;
3056 Ok(Operation::new(op))
3057 }
3058 };
3059
3060 let start = move || async {
3061 let op = self.send().await?;
3062 Ok(Operation::new(op))
3063 };
3064
3065 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3066 }
3067
3068 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3072 self.0.request.name = v.into();
3073 self
3074 }
3075 }
3076
3077 #[doc(hidden)]
3078 impl gax::options::internal::RequestBuilder for OpenPullRequest {
3079 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3080 &mut self.0.options
3081 }
3082 }
3083
3084 #[derive(Clone, Debug)]
3103 pub struct ClosePullRequest(RequestBuilder<crate::model::ClosePullRequestRequest>);
3104
3105 impl ClosePullRequest {
3106 pub(crate) fn new(
3107 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3108 ) -> Self {
3109 Self(RequestBuilder::new(stub))
3110 }
3111
3112 pub fn with_request<V: Into<crate::model::ClosePullRequestRequest>>(
3114 mut self,
3115 v: V,
3116 ) -> Self {
3117 self.0.request = v.into();
3118 self
3119 }
3120
3121 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3123 self.0.options = v.into();
3124 self
3125 }
3126
3127 pub async fn send(self) -> Result<longrunning::model::Operation> {
3134 (*self.0.stub)
3135 .close_pull_request(self.0.request, self.0.options)
3136 .await
3137 .map(gax::response::Response::into_body)
3138 }
3139
3140 pub fn poller(
3142 self,
3143 ) -> impl lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata> {
3144 type Operation = lro::internal::Operation<
3145 crate::model::PullRequest,
3146 crate::model::OperationMetadata,
3147 >;
3148 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3149 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3150
3151 let stub = self.0.stub.clone();
3152 let mut options = self.0.options.clone();
3153 options.set_retry_policy(gax::retry_policy::NeverRetry);
3154 let query = move |name| {
3155 let stub = stub.clone();
3156 let options = options.clone();
3157 async {
3158 let op = GetOperation::new(stub)
3159 .set_name(name)
3160 .with_options(options)
3161 .send()
3162 .await?;
3163 Ok(Operation::new(op))
3164 }
3165 };
3166
3167 let start = move || async {
3168 let op = self.send().await?;
3169 Ok(Operation::new(op))
3170 };
3171
3172 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3173 }
3174
3175 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3179 self.0.request.name = v.into();
3180 self
3181 }
3182 }
3183
3184 #[doc(hidden)]
3185 impl gax::options::internal::RequestBuilder for ClosePullRequest {
3186 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3187 &mut self.0.options
3188 }
3189 }
3190
3191 #[derive(Clone, Debug)]
3213 pub struct ListPullRequestFileDiffs(
3214 RequestBuilder<crate::model::ListPullRequestFileDiffsRequest>,
3215 );
3216
3217 impl ListPullRequestFileDiffs {
3218 pub(crate) fn new(
3219 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3220 ) -> Self {
3221 Self(RequestBuilder::new(stub))
3222 }
3223
3224 pub fn with_request<V: Into<crate::model::ListPullRequestFileDiffsRequest>>(
3226 mut self,
3227 v: V,
3228 ) -> Self {
3229 self.0.request = v.into();
3230 self
3231 }
3232
3233 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3235 self.0.options = v.into();
3236 self
3237 }
3238
3239 pub async fn send(self) -> Result<crate::model::ListPullRequestFileDiffsResponse> {
3241 (*self.0.stub)
3242 .list_pull_request_file_diffs(self.0.request, self.0.options)
3243 .await
3244 .map(gax::response::Response::into_body)
3245 }
3246
3247 pub fn by_page(
3249 self,
3250 ) -> impl gax::paginator::Paginator<
3251 crate::model::ListPullRequestFileDiffsResponse,
3252 gax::error::Error,
3253 > {
3254 use std::clone::Clone;
3255 let token = self.0.request.page_token.clone();
3256 let execute = move |token: String| {
3257 let mut builder = self.clone();
3258 builder.0.request = builder.0.request.set_page_token(token);
3259 builder.send()
3260 };
3261 gax::paginator::internal::new_paginator(token, execute)
3262 }
3263
3264 pub fn by_item(
3266 self,
3267 ) -> impl gax::paginator::ItemPaginator<
3268 crate::model::ListPullRequestFileDiffsResponse,
3269 gax::error::Error,
3270 > {
3271 use gax::paginator::Paginator;
3272 self.by_page().items()
3273 }
3274
3275 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3279 self.0.request.name = v.into();
3280 self
3281 }
3282
3283 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3285 self.0.request.page_size = v.into();
3286 self
3287 }
3288
3289 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3291 self.0.request.page_token = v.into();
3292 self
3293 }
3294 }
3295
3296 #[doc(hidden)]
3297 impl gax::options::internal::RequestBuilder for ListPullRequestFileDiffs {
3298 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3299 &mut self.0.options
3300 }
3301 }
3302
3303 #[derive(Clone, Debug)]
3325 pub struct FetchTree(RequestBuilder<crate::model::FetchTreeRequest>);
3326
3327 impl FetchTree {
3328 pub(crate) fn new(
3329 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3330 ) -> Self {
3331 Self(RequestBuilder::new(stub))
3332 }
3333
3334 pub fn with_request<V: Into<crate::model::FetchTreeRequest>>(mut self, v: V) -> Self {
3336 self.0.request = v.into();
3337 self
3338 }
3339
3340 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3342 self.0.options = v.into();
3343 self
3344 }
3345
3346 pub async fn send(self) -> Result<crate::model::FetchTreeResponse> {
3348 (*self.0.stub)
3349 .fetch_tree(self.0.request, self.0.options)
3350 .await
3351 .map(gax::response::Response::into_body)
3352 }
3353
3354 pub fn by_page(
3356 self,
3357 ) -> impl gax::paginator::Paginator<crate::model::FetchTreeResponse, gax::error::Error>
3358 {
3359 use std::clone::Clone;
3360 let token = self.0.request.page_token.clone();
3361 let execute = move |token: String| {
3362 let mut builder = self.clone();
3363 builder.0.request = builder.0.request.set_page_token(token);
3364 builder.send()
3365 };
3366 gax::paginator::internal::new_paginator(token, execute)
3367 }
3368
3369 pub fn by_item(
3371 self,
3372 ) -> impl gax::paginator::ItemPaginator<crate::model::FetchTreeResponse, gax::error::Error>
3373 {
3374 use gax::paginator::Paginator;
3375 self.by_page().items()
3376 }
3377
3378 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
3382 self.0.request.repository = v.into();
3383 self
3384 }
3385
3386 pub fn set_ref<T: Into<std::string::String>>(mut self, v: T) -> Self {
3388 self.0.request.r#ref = v.into();
3389 self
3390 }
3391
3392 pub fn set_recursive<T: Into<bool>>(mut self, v: T) -> Self {
3394 self.0.request.recursive = v.into();
3395 self
3396 }
3397
3398 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3400 self.0.request.page_size = v.into();
3401 self
3402 }
3403
3404 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3406 self.0.request.page_token = v.into();
3407 self
3408 }
3409 }
3410
3411 #[doc(hidden)]
3412 impl gax::options::internal::RequestBuilder for FetchTree {
3413 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3414 &mut self.0.options
3415 }
3416 }
3417
3418 #[derive(Clone, Debug)]
3436 pub struct FetchBlob(RequestBuilder<crate::model::FetchBlobRequest>);
3437
3438 impl FetchBlob {
3439 pub(crate) fn new(
3440 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3441 ) -> Self {
3442 Self(RequestBuilder::new(stub))
3443 }
3444
3445 pub fn with_request<V: Into<crate::model::FetchBlobRequest>>(mut self, v: V) -> Self {
3447 self.0.request = v.into();
3448 self
3449 }
3450
3451 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3453 self.0.options = v.into();
3454 self
3455 }
3456
3457 pub async fn send(self) -> Result<crate::model::FetchBlobResponse> {
3459 (*self.0.stub)
3460 .fetch_blob(self.0.request, self.0.options)
3461 .await
3462 .map(gax::response::Response::into_body)
3463 }
3464
3465 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
3469 self.0.request.repository = v.into();
3470 self
3471 }
3472
3473 pub fn set_sha<T: Into<std::string::String>>(mut self, v: T) -> Self {
3477 self.0.request.sha = v.into();
3478 self
3479 }
3480 }
3481
3482 #[doc(hidden)]
3483 impl gax::options::internal::RequestBuilder for FetchBlob {
3484 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3485 &mut self.0.options
3486 }
3487 }
3488
3489 #[derive(Clone, Debug)]
3508 pub struct CreateIssue(RequestBuilder<crate::model::CreateIssueRequest>);
3509
3510 impl CreateIssue {
3511 pub(crate) fn new(
3512 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3513 ) -> Self {
3514 Self(RequestBuilder::new(stub))
3515 }
3516
3517 pub fn with_request<V: Into<crate::model::CreateIssueRequest>>(mut self, v: V) -> Self {
3519 self.0.request = v.into();
3520 self
3521 }
3522
3523 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3525 self.0.options = v.into();
3526 self
3527 }
3528
3529 pub async fn send(self) -> Result<longrunning::model::Operation> {
3536 (*self.0.stub)
3537 .create_issue(self.0.request, self.0.options)
3538 .await
3539 .map(gax::response::Response::into_body)
3540 }
3541
3542 pub fn poller(
3544 self,
3545 ) -> impl lro::Poller<crate::model::Issue, crate::model::OperationMetadata> {
3546 type Operation =
3547 lro::internal::Operation<crate::model::Issue, crate::model::OperationMetadata>;
3548 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3549 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3550
3551 let stub = self.0.stub.clone();
3552 let mut options = self.0.options.clone();
3553 options.set_retry_policy(gax::retry_policy::NeverRetry);
3554 let query = move |name| {
3555 let stub = stub.clone();
3556 let options = options.clone();
3557 async {
3558 let op = GetOperation::new(stub)
3559 .set_name(name)
3560 .with_options(options)
3561 .send()
3562 .await?;
3563 Ok(Operation::new(op))
3564 }
3565 };
3566
3567 let start = move || async {
3568 let op = self.send().await?;
3569 Ok(Operation::new(op))
3570 };
3571
3572 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3573 }
3574
3575 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3579 self.0.request.parent = v.into();
3580 self
3581 }
3582
3583 pub fn set_issue<T>(mut self, v: T) -> Self
3587 where
3588 T: std::convert::Into<crate::model::Issue>,
3589 {
3590 self.0.request.issue = std::option::Option::Some(v.into());
3591 self
3592 }
3593
3594 pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
3598 where
3599 T: std::convert::Into<crate::model::Issue>,
3600 {
3601 self.0.request.issue = v.map(|x| x.into());
3602 self
3603 }
3604 }
3605
3606 #[doc(hidden)]
3607 impl gax::options::internal::RequestBuilder for CreateIssue {
3608 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3609 &mut self.0.options
3610 }
3611 }
3612
3613 #[derive(Clone, Debug)]
3631 pub struct GetIssue(RequestBuilder<crate::model::GetIssueRequest>);
3632
3633 impl GetIssue {
3634 pub(crate) fn new(
3635 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3636 ) -> Self {
3637 Self(RequestBuilder::new(stub))
3638 }
3639
3640 pub fn with_request<V: Into<crate::model::GetIssueRequest>>(mut self, v: V) -> Self {
3642 self.0.request = v.into();
3643 self
3644 }
3645
3646 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3648 self.0.options = v.into();
3649 self
3650 }
3651
3652 pub async fn send(self) -> Result<crate::model::Issue> {
3654 (*self.0.stub)
3655 .get_issue(self.0.request, self.0.options)
3656 .await
3657 .map(gax::response::Response::into_body)
3658 }
3659
3660 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3664 self.0.request.name = v.into();
3665 self
3666 }
3667 }
3668
3669 #[doc(hidden)]
3670 impl gax::options::internal::RequestBuilder for GetIssue {
3671 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3672 &mut self.0.options
3673 }
3674 }
3675
3676 #[derive(Clone, Debug)]
3698 pub struct ListIssues(RequestBuilder<crate::model::ListIssuesRequest>);
3699
3700 impl ListIssues {
3701 pub(crate) fn new(
3702 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3703 ) -> Self {
3704 Self(RequestBuilder::new(stub))
3705 }
3706
3707 pub fn with_request<V: Into<crate::model::ListIssuesRequest>>(mut self, v: V) -> Self {
3709 self.0.request = v.into();
3710 self
3711 }
3712
3713 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3715 self.0.options = v.into();
3716 self
3717 }
3718
3719 pub async fn send(self) -> Result<crate::model::ListIssuesResponse> {
3721 (*self.0.stub)
3722 .list_issues(self.0.request, self.0.options)
3723 .await
3724 .map(gax::response::Response::into_body)
3725 }
3726
3727 pub fn by_page(
3729 self,
3730 ) -> impl gax::paginator::Paginator<crate::model::ListIssuesResponse, gax::error::Error>
3731 {
3732 use std::clone::Clone;
3733 let token = self.0.request.page_token.clone();
3734 let execute = move |token: String| {
3735 let mut builder = self.clone();
3736 builder.0.request = builder.0.request.set_page_token(token);
3737 builder.send()
3738 };
3739 gax::paginator::internal::new_paginator(token, execute)
3740 }
3741
3742 pub fn by_item(
3744 self,
3745 ) -> impl gax::paginator::ItemPaginator<crate::model::ListIssuesResponse, gax::error::Error>
3746 {
3747 use gax::paginator::Paginator;
3748 self.by_page().items()
3749 }
3750
3751 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3755 self.0.request.parent = v.into();
3756 self
3757 }
3758
3759 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3761 self.0.request.page_size = v.into();
3762 self
3763 }
3764
3765 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3767 self.0.request.page_token = v.into();
3768 self
3769 }
3770
3771 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3773 self.0.request.filter = v.into();
3774 self
3775 }
3776 }
3777
3778 #[doc(hidden)]
3779 impl gax::options::internal::RequestBuilder for ListIssues {
3780 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3781 &mut self.0.options
3782 }
3783 }
3784
3785 #[derive(Clone, Debug)]
3804 pub struct UpdateIssue(RequestBuilder<crate::model::UpdateIssueRequest>);
3805
3806 impl UpdateIssue {
3807 pub(crate) fn new(
3808 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3809 ) -> Self {
3810 Self(RequestBuilder::new(stub))
3811 }
3812
3813 pub fn with_request<V: Into<crate::model::UpdateIssueRequest>>(mut self, v: V) -> Self {
3815 self.0.request = v.into();
3816 self
3817 }
3818
3819 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3821 self.0.options = v.into();
3822 self
3823 }
3824
3825 pub async fn send(self) -> Result<longrunning::model::Operation> {
3832 (*self.0.stub)
3833 .update_issue(self.0.request, self.0.options)
3834 .await
3835 .map(gax::response::Response::into_body)
3836 }
3837
3838 pub fn poller(
3840 self,
3841 ) -> impl lro::Poller<crate::model::Issue, crate::model::OperationMetadata> {
3842 type Operation =
3843 lro::internal::Operation<crate::model::Issue, crate::model::OperationMetadata>;
3844 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3845 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3846
3847 let stub = self.0.stub.clone();
3848 let mut options = self.0.options.clone();
3849 options.set_retry_policy(gax::retry_policy::NeverRetry);
3850 let query = move |name| {
3851 let stub = stub.clone();
3852 let options = options.clone();
3853 async {
3854 let op = GetOperation::new(stub)
3855 .set_name(name)
3856 .with_options(options)
3857 .send()
3858 .await?;
3859 Ok(Operation::new(op))
3860 }
3861 };
3862
3863 let start = move || async {
3864 let op = self.send().await?;
3865 Ok(Operation::new(op))
3866 };
3867
3868 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3869 }
3870
3871 pub fn set_issue<T>(mut self, v: T) -> Self
3875 where
3876 T: std::convert::Into<crate::model::Issue>,
3877 {
3878 self.0.request.issue = std::option::Option::Some(v.into());
3879 self
3880 }
3881
3882 pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
3886 where
3887 T: std::convert::Into<crate::model::Issue>,
3888 {
3889 self.0.request.issue = v.map(|x| x.into());
3890 self
3891 }
3892
3893 pub fn set_update_mask<T>(mut self, v: T) -> Self
3895 where
3896 T: std::convert::Into<wkt::FieldMask>,
3897 {
3898 self.0.request.update_mask = std::option::Option::Some(v.into());
3899 self
3900 }
3901
3902 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3904 where
3905 T: std::convert::Into<wkt::FieldMask>,
3906 {
3907 self.0.request.update_mask = v.map(|x| x.into());
3908 self
3909 }
3910 }
3911
3912 #[doc(hidden)]
3913 impl gax::options::internal::RequestBuilder for UpdateIssue {
3914 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3915 &mut self.0.options
3916 }
3917 }
3918
3919 #[derive(Clone, Debug)]
3938 pub struct DeleteIssue(RequestBuilder<crate::model::DeleteIssueRequest>);
3939
3940 impl DeleteIssue {
3941 pub(crate) fn new(
3942 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3943 ) -> Self {
3944 Self(RequestBuilder::new(stub))
3945 }
3946
3947 pub fn with_request<V: Into<crate::model::DeleteIssueRequest>>(mut self, v: V) -> Self {
3949 self.0.request = v.into();
3950 self
3951 }
3952
3953 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3955 self.0.options = v.into();
3956 self
3957 }
3958
3959 pub async fn send(self) -> Result<longrunning::model::Operation> {
3966 (*self.0.stub)
3967 .delete_issue(self.0.request, self.0.options)
3968 .await
3969 .map(gax::response::Response::into_body)
3970 }
3971
3972 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3974 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3975 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3976 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3977
3978 let stub = self.0.stub.clone();
3979 let mut options = self.0.options.clone();
3980 options.set_retry_policy(gax::retry_policy::NeverRetry);
3981 let query = move |name| {
3982 let stub = stub.clone();
3983 let options = options.clone();
3984 async {
3985 let op = GetOperation::new(stub)
3986 .set_name(name)
3987 .with_options(options)
3988 .send()
3989 .await?;
3990 Ok(Operation::new(op))
3991 }
3992 };
3993
3994 let start = move || async {
3995 let op = self.send().await?;
3996 Ok(Operation::new(op))
3997 };
3998
3999 lro::internal::new_unit_response_poller(
4000 polling_error_policy,
4001 polling_backoff_policy,
4002 start,
4003 query,
4004 )
4005 }
4006
4007 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4011 self.0.request.name = v.into();
4012 self
4013 }
4014
4015 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4017 self.0.request.etag = v.into();
4018 self
4019 }
4020 }
4021
4022 #[doc(hidden)]
4023 impl gax::options::internal::RequestBuilder for DeleteIssue {
4024 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4025 &mut self.0.options
4026 }
4027 }
4028
4029 #[derive(Clone, Debug)]
4048 pub struct OpenIssue(RequestBuilder<crate::model::OpenIssueRequest>);
4049
4050 impl OpenIssue {
4051 pub(crate) fn new(
4052 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4053 ) -> Self {
4054 Self(RequestBuilder::new(stub))
4055 }
4056
4057 pub fn with_request<V: Into<crate::model::OpenIssueRequest>>(mut self, v: V) -> Self {
4059 self.0.request = v.into();
4060 self
4061 }
4062
4063 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4065 self.0.options = v.into();
4066 self
4067 }
4068
4069 pub async fn send(self) -> Result<longrunning::model::Operation> {
4076 (*self.0.stub)
4077 .open_issue(self.0.request, self.0.options)
4078 .await
4079 .map(gax::response::Response::into_body)
4080 }
4081
4082 pub fn poller(
4084 self,
4085 ) -> impl lro::Poller<crate::model::Issue, crate::model::OperationMetadata> {
4086 type Operation =
4087 lro::internal::Operation<crate::model::Issue, crate::model::OperationMetadata>;
4088 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4089 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4090
4091 let stub = self.0.stub.clone();
4092 let mut options = self.0.options.clone();
4093 options.set_retry_policy(gax::retry_policy::NeverRetry);
4094 let query = move |name| {
4095 let stub = stub.clone();
4096 let options = options.clone();
4097 async {
4098 let op = GetOperation::new(stub)
4099 .set_name(name)
4100 .with_options(options)
4101 .send()
4102 .await?;
4103 Ok(Operation::new(op))
4104 }
4105 };
4106
4107 let start = move || async {
4108 let op = self.send().await?;
4109 Ok(Operation::new(op))
4110 };
4111
4112 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4113 }
4114
4115 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4119 self.0.request.name = v.into();
4120 self
4121 }
4122
4123 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4125 self.0.request.etag = v.into();
4126 self
4127 }
4128 }
4129
4130 #[doc(hidden)]
4131 impl gax::options::internal::RequestBuilder for OpenIssue {
4132 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4133 &mut self.0.options
4134 }
4135 }
4136
4137 #[derive(Clone, Debug)]
4156 pub struct CloseIssue(RequestBuilder<crate::model::CloseIssueRequest>);
4157
4158 impl CloseIssue {
4159 pub(crate) fn new(
4160 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4161 ) -> Self {
4162 Self(RequestBuilder::new(stub))
4163 }
4164
4165 pub fn with_request<V: Into<crate::model::CloseIssueRequest>>(mut self, v: V) -> Self {
4167 self.0.request = v.into();
4168 self
4169 }
4170
4171 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4173 self.0.options = v.into();
4174 self
4175 }
4176
4177 pub async fn send(self) -> Result<longrunning::model::Operation> {
4184 (*self.0.stub)
4185 .close_issue(self.0.request, self.0.options)
4186 .await
4187 .map(gax::response::Response::into_body)
4188 }
4189
4190 pub fn poller(
4192 self,
4193 ) -> impl lro::Poller<crate::model::Issue, crate::model::OperationMetadata> {
4194 type Operation =
4195 lro::internal::Operation<crate::model::Issue, crate::model::OperationMetadata>;
4196 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4197 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4198
4199 let stub = self.0.stub.clone();
4200 let mut options = self.0.options.clone();
4201 options.set_retry_policy(gax::retry_policy::NeverRetry);
4202 let query = move |name| {
4203 let stub = stub.clone();
4204 let options = options.clone();
4205 async {
4206 let op = GetOperation::new(stub)
4207 .set_name(name)
4208 .with_options(options)
4209 .send()
4210 .await?;
4211 Ok(Operation::new(op))
4212 }
4213 };
4214
4215 let start = move || async {
4216 let op = self.send().await?;
4217 Ok(Operation::new(op))
4218 };
4219
4220 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4221 }
4222
4223 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4227 self.0.request.name = v.into();
4228 self
4229 }
4230
4231 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4233 self.0.request.etag = v.into();
4234 self
4235 }
4236 }
4237
4238 #[doc(hidden)]
4239 impl gax::options::internal::RequestBuilder for CloseIssue {
4240 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4241 &mut self.0.options
4242 }
4243 }
4244
4245 #[derive(Clone, Debug)]
4263 pub struct GetPullRequestComment(RequestBuilder<crate::model::GetPullRequestCommentRequest>);
4264
4265 impl GetPullRequestComment {
4266 pub(crate) fn new(
4267 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4268 ) -> Self {
4269 Self(RequestBuilder::new(stub))
4270 }
4271
4272 pub fn with_request<V: Into<crate::model::GetPullRequestCommentRequest>>(
4274 mut self,
4275 v: V,
4276 ) -> Self {
4277 self.0.request = v.into();
4278 self
4279 }
4280
4281 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4283 self.0.options = v.into();
4284 self
4285 }
4286
4287 pub async fn send(self) -> Result<crate::model::PullRequestComment> {
4289 (*self.0.stub)
4290 .get_pull_request_comment(self.0.request, self.0.options)
4291 .await
4292 .map(gax::response::Response::into_body)
4293 }
4294
4295 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4299 self.0.request.name = v.into();
4300 self
4301 }
4302 }
4303
4304 #[doc(hidden)]
4305 impl gax::options::internal::RequestBuilder for GetPullRequestComment {
4306 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4307 &mut self.0.options
4308 }
4309 }
4310
4311 #[derive(Clone, Debug)]
4333 pub struct ListPullRequestComments(
4334 RequestBuilder<crate::model::ListPullRequestCommentsRequest>,
4335 );
4336
4337 impl ListPullRequestComments {
4338 pub(crate) fn new(
4339 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4340 ) -> Self {
4341 Self(RequestBuilder::new(stub))
4342 }
4343
4344 pub fn with_request<V: Into<crate::model::ListPullRequestCommentsRequest>>(
4346 mut self,
4347 v: V,
4348 ) -> Self {
4349 self.0.request = v.into();
4350 self
4351 }
4352
4353 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4355 self.0.options = v.into();
4356 self
4357 }
4358
4359 pub async fn send(self) -> Result<crate::model::ListPullRequestCommentsResponse> {
4361 (*self.0.stub)
4362 .list_pull_request_comments(self.0.request, self.0.options)
4363 .await
4364 .map(gax::response::Response::into_body)
4365 }
4366
4367 pub fn by_page(
4369 self,
4370 ) -> impl gax::paginator::Paginator<
4371 crate::model::ListPullRequestCommentsResponse,
4372 gax::error::Error,
4373 > {
4374 use std::clone::Clone;
4375 let token = self.0.request.page_token.clone();
4376 let execute = move |token: String| {
4377 let mut builder = self.clone();
4378 builder.0.request = builder.0.request.set_page_token(token);
4379 builder.send()
4380 };
4381 gax::paginator::internal::new_paginator(token, execute)
4382 }
4383
4384 pub fn by_item(
4386 self,
4387 ) -> impl gax::paginator::ItemPaginator<
4388 crate::model::ListPullRequestCommentsResponse,
4389 gax::error::Error,
4390 > {
4391 use gax::paginator::Paginator;
4392 self.by_page().items()
4393 }
4394
4395 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4399 self.0.request.parent = v.into();
4400 self
4401 }
4402
4403 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4405 self.0.request.page_size = v.into();
4406 self
4407 }
4408
4409 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4411 self.0.request.page_token = v.into();
4412 self
4413 }
4414 }
4415
4416 #[doc(hidden)]
4417 impl gax::options::internal::RequestBuilder for ListPullRequestComments {
4418 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4419 &mut self.0.options
4420 }
4421 }
4422
4423 #[derive(Clone, Debug)]
4442 pub struct CreatePullRequestComment(
4443 RequestBuilder<crate::model::CreatePullRequestCommentRequest>,
4444 );
4445
4446 impl CreatePullRequestComment {
4447 pub(crate) fn new(
4448 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4449 ) -> Self {
4450 Self(RequestBuilder::new(stub))
4451 }
4452
4453 pub fn with_request<V: Into<crate::model::CreatePullRequestCommentRequest>>(
4455 mut self,
4456 v: V,
4457 ) -> Self {
4458 self.0.request = v.into();
4459 self
4460 }
4461
4462 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4464 self.0.options = v.into();
4465 self
4466 }
4467
4468 pub async fn send(self) -> Result<longrunning::model::Operation> {
4475 (*self.0.stub)
4476 .create_pull_request_comment(self.0.request, self.0.options)
4477 .await
4478 .map(gax::response::Response::into_body)
4479 }
4480
4481 pub fn poller(
4483 self,
4484 ) -> impl lro::Poller<crate::model::PullRequestComment, crate::model::OperationMetadata>
4485 {
4486 type Operation = lro::internal::Operation<
4487 crate::model::PullRequestComment,
4488 crate::model::OperationMetadata,
4489 >;
4490 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4491 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4492
4493 let stub = self.0.stub.clone();
4494 let mut options = self.0.options.clone();
4495 options.set_retry_policy(gax::retry_policy::NeverRetry);
4496 let query = move |name| {
4497 let stub = stub.clone();
4498 let options = options.clone();
4499 async {
4500 let op = GetOperation::new(stub)
4501 .set_name(name)
4502 .with_options(options)
4503 .send()
4504 .await?;
4505 Ok(Operation::new(op))
4506 }
4507 };
4508
4509 let start = move || async {
4510 let op = self.send().await?;
4511 Ok(Operation::new(op))
4512 };
4513
4514 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4515 }
4516
4517 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4521 self.0.request.parent = v.into();
4522 self
4523 }
4524
4525 pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
4529 where
4530 T: std::convert::Into<crate::model::PullRequestComment>,
4531 {
4532 self.0.request.pull_request_comment = std::option::Option::Some(v.into());
4533 self
4534 }
4535
4536 pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
4540 where
4541 T: std::convert::Into<crate::model::PullRequestComment>,
4542 {
4543 self.0.request.pull_request_comment = v.map(|x| x.into());
4544 self
4545 }
4546 }
4547
4548 #[doc(hidden)]
4549 impl gax::options::internal::RequestBuilder for CreatePullRequestComment {
4550 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4551 &mut self.0.options
4552 }
4553 }
4554
4555 #[derive(Clone, Debug)]
4574 pub struct UpdatePullRequestComment(
4575 RequestBuilder<crate::model::UpdatePullRequestCommentRequest>,
4576 );
4577
4578 impl UpdatePullRequestComment {
4579 pub(crate) fn new(
4580 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4581 ) -> Self {
4582 Self(RequestBuilder::new(stub))
4583 }
4584
4585 pub fn with_request<V: Into<crate::model::UpdatePullRequestCommentRequest>>(
4587 mut self,
4588 v: V,
4589 ) -> Self {
4590 self.0.request = v.into();
4591 self
4592 }
4593
4594 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4596 self.0.options = v.into();
4597 self
4598 }
4599
4600 pub async fn send(self) -> Result<longrunning::model::Operation> {
4607 (*self.0.stub)
4608 .update_pull_request_comment(self.0.request, self.0.options)
4609 .await
4610 .map(gax::response::Response::into_body)
4611 }
4612
4613 pub fn poller(
4615 self,
4616 ) -> impl lro::Poller<crate::model::PullRequestComment, crate::model::OperationMetadata>
4617 {
4618 type Operation = lro::internal::Operation<
4619 crate::model::PullRequestComment,
4620 crate::model::OperationMetadata,
4621 >;
4622 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4623 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4624
4625 let stub = self.0.stub.clone();
4626 let mut options = self.0.options.clone();
4627 options.set_retry_policy(gax::retry_policy::NeverRetry);
4628 let query = move |name| {
4629 let stub = stub.clone();
4630 let options = options.clone();
4631 async {
4632 let op = GetOperation::new(stub)
4633 .set_name(name)
4634 .with_options(options)
4635 .send()
4636 .await?;
4637 Ok(Operation::new(op))
4638 }
4639 };
4640
4641 let start = move || async {
4642 let op = self.send().await?;
4643 Ok(Operation::new(op))
4644 };
4645
4646 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4647 }
4648
4649 pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
4653 where
4654 T: std::convert::Into<crate::model::PullRequestComment>,
4655 {
4656 self.0.request.pull_request_comment = std::option::Option::Some(v.into());
4657 self
4658 }
4659
4660 pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
4664 where
4665 T: std::convert::Into<crate::model::PullRequestComment>,
4666 {
4667 self.0.request.pull_request_comment = v.map(|x| x.into());
4668 self
4669 }
4670
4671 pub fn set_update_mask<T>(mut self, v: T) -> Self
4673 where
4674 T: std::convert::Into<wkt::FieldMask>,
4675 {
4676 self.0.request.update_mask = std::option::Option::Some(v.into());
4677 self
4678 }
4679
4680 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4682 where
4683 T: std::convert::Into<wkt::FieldMask>,
4684 {
4685 self.0.request.update_mask = v.map(|x| x.into());
4686 self
4687 }
4688 }
4689
4690 #[doc(hidden)]
4691 impl gax::options::internal::RequestBuilder for UpdatePullRequestComment {
4692 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4693 &mut self.0.options
4694 }
4695 }
4696
4697 #[derive(Clone, Debug)]
4716 pub struct DeletePullRequestComment(
4717 RequestBuilder<crate::model::DeletePullRequestCommentRequest>,
4718 );
4719
4720 impl DeletePullRequestComment {
4721 pub(crate) fn new(
4722 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4723 ) -> Self {
4724 Self(RequestBuilder::new(stub))
4725 }
4726
4727 pub fn with_request<V: Into<crate::model::DeletePullRequestCommentRequest>>(
4729 mut self,
4730 v: V,
4731 ) -> Self {
4732 self.0.request = v.into();
4733 self
4734 }
4735
4736 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4738 self.0.options = v.into();
4739 self
4740 }
4741
4742 pub async fn send(self) -> Result<longrunning::model::Operation> {
4749 (*self.0.stub)
4750 .delete_pull_request_comment(self.0.request, self.0.options)
4751 .await
4752 .map(gax::response::Response::into_body)
4753 }
4754
4755 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4757 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4758 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4759 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4760
4761 let stub = self.0.stub.clone();
4762 let mut options = self.0.options.clone();
4763 options.set_retry_policy(gax::retry_policy::NeverRetry);
4764 let query = move |name| {
4765 let stub = stub.clone();
4766 let options = options.clone();
4767 async {
4768 let op = GetOperation::new(stub)
4769 .set_name(name)
4770 .with_options(options)
4771 .send()
4772 .await?;
4773 Ok(Operation::new(op))
4774 }
4775 };
4776
4777 let start = move || async {
4778 let op = self.send().await?;
4779 Ok(Operation::new(op))
4780 };
4781
4782 lro::internal::new_unit_response_poller(
4783 polling_error_policy,
4784 polling_backoff_policy,
4785 start,
4786 query,
4787 )
4788 }
4789
4790 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4794 self.0.request.name = v.into();
4795 self
4796 }
4797 }
4798
4799 #[doc(hidden)]
4800 impl gax::options::internal::RequestBuilder for DeletePullRequestComment {
4801 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4802 &mut self.0.options
4803 }
4804 }
4805
4806 #[derive(Clone, Debug)]
4825 pub struct BatchCreatePullRequestComments(
4826 RequestBuilder<crate::model::BatchCreatePullRequestCommentsRequest>,
4827 );
4828
4829 impl BatchCreatePullRequestComments {
4830 pub(crate) fn new(
4831 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4832 ) -> Self {
4833 Self(RequestBuilder::new(stub))
4834 }
4835
4836 pub fn with_request<V: Into<crate::model::BatchCreatePullRequestCommentsRequest>>(
4838 mut self,
4839 v: V,
4840 ) -> Self {
4841 self.0.request = v.into();
4842 self
4843 }
4844
4845 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4847 self.0.options = v.into();
4848 self
4849 }
4850
4851 pub async fn send(self) -> Result<longrunning::model::Operation> {
4858 (*self.0.stub)
4859 .batch_create_pull_request_comments(self.0.request, self.0.options)
4860 .await
4861 .map(gax::response::Response::into_body)
4862 }
4863
4864 pub fn poller(
4866 self,
4867 ) -> impl lro::Poller<
4868 crate::model::BatchCreatePullRequestCommentsResponse,
4869 crate::model::OperationMetadata,
4870 > {
4871 type Operation = lro::internal::Operation<
4872 crate::model::BatchCreatePullRequestCommentsResponse,
4873 crate::model::OperationMetadata,
4874 >;
4875 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4876 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4877
4878 let stub = self.0.stub.clone();
4879 let mut options = self.0.options.clone();
4880 options.set_retry_policy(gax::retry_policy::NeverRetry);
4881 let query = move |name| {
4882 let stub = stub.clone();
4883 let options = options.clone();
4884 async {
4885 let op = GetOperation::new(stub)
4886 .set_name(name)
4887 .with_options(options)
4888 .send()
4889 .await?;
4890 Ok(Operation::new(op))
4891 }
4892 };
4893
4894 let start = move || async {
4895 let op = self.send().await?;
4896 Ok(Operation::new(op))
4897 };
4898
4899 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4900 }
4901
4902 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4906 self.0.request.parent = v.into();
4907 self
4908 }
4909
4910 pub fn set_requests<T, V>(mut self, v: T) -> Self
4914 where
4915 T: std::iter::IntoIterator<Item = V>,
4916 V: std::convert::Into<crate::model::CreatePullRequestCommentRequest>,
4917 {
4918 use std::iter::Iterator;
4919 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
4920 self
4921 }
4922 }
4923
4924 #[doc(hidden)]
4925 impl gax::options::internal::RequestBuilder for BatchCreatePullRequestComments {
4926 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4927 &mut self.0.options
4928 }
4929 }
4930
4931 #[derive(Clone, Debug)]
4950 pub struct ResolvePullRequestComments(
4951 RequestBuilder<crate::model::ResolvePullRequestCommentsRequest>,
4952 );
4953
4954 impl ResolvePullRequestComments {
4955 pub(crate) fn new(
4956 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4957 ) -> Self {
4958 Self(RequestBuilder::new(stub))
4959 }
4960
4961 pub fn with_request<V: Into<crate::model::ResolvePullRequestCommentsRequest>>(
4963 mut self,
4964 v: V,
4965 ) -> Self {
4966 self.0.request = v.into();
4967 self
4968 }
4969
4970 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4972 self.0.options = v.into();
4973 self
4974 }
4975
4976 pub async fn send(self) -> Result<longrunning::model::Operation> {
4983 (*self.0.stub)
4984 .resolve_pull_request_comments(self.0.request, self.0.options)
4985 .await
4986 .map(gax::response::Response::into_body)
4987 }
4988
4989 pub fn poller(
4991 self,
4992 ) -> impl lro::Poller<
4993 crate::model::ResolvePullRequestCommentsResponse,
4994 crate::model::OperationMetadata,
4995 > {
4996 type Operation = lro::internal::Operation<
4997 crate::model::ResolvePullRequestCommentsResponse,
4998 crate::model::OperationMetadata,
4999 >;
5000 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5001 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5002
5003 let stub = self.0.stub.clone();
5004 let mut options = self.0.options.clone();
5005 options.set_retry_policy(gax::retry_policy::NeverRetry);
5006 let query = move |name| {
5007 let stub = stub.clone();
5008 let options = options.clone();
5009 async {
5010 let op = GetOperation::new(stub)
5011 .set_name(name)
5012 .with_options(options)
5013 .send()
5014 .await?;
5015 Ok(Operation::new(op))
5016 }
5017 };
5018
5019 let start = move || async {
5020 let op = self.send().await?;
5021 Ok(Operation::new(op))
5022 };
5023
5024 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5025 }
5026
5027 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5031 self.0.request.parent = v.into();
5032 self
5033 }
5034
5035 pub fn set_names<T, V>(mut self, v: T) -> Self
5039 where
5040 T: std::iter::IntoIterator<Item = V>,
5041 V: std::convert::Into<std::string::String>,
5042 {
5043 use std::iter::Iterator;
5044 self.0.request.names = v.into_iter().map(|i| i.into()).collect();
5045 self
5046 }
5047
5048 pub fn set_auto_fill<T: Into<bool>>(mut self, v: T) -> Self {
5050 self.0.request.auto_fill = v.into();
5051 self
5052 }
5053 }
5054
5055 #[doc(hidden)]
5056 impl gax::options::internal::RequestBuilder for ResolvePullRequestComments {
5057 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5058 &mut self.0.options
5059 }
5060 }
5061
5062 #[derive(Clone, Debug)]
5081 pub struct UnresolvePullRequestComments(
5082 RequestBuilder<crate::model::UnresolvePullRequestCommentsRequest>,
5083 );
5084
5085 impl UnresolvePullRequestComments {
5086 pub(crate) fn new(
5087 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5088 ) -> Self {
5089 Self(RequestBuilder::new(stub))
5090 }
5091
5092 pub fn with_request<V: Into<crate::model::UnresolvePullRequestCommentsRequest>>(
5094 mut self,
5095 v: V,
5096 ) -> Self {
5097 self.0.request = v.into();
5098 self
5099 }
5100
5101 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5103 self.0.options = v.into();
5104 self
5105 }
5106
5107 pub async fn send(self) -> Result<longrunning::model::Operation> {
5114 (*self.0.stub)
5115 .unresolve_pull_request_comments(self.0.request, self.0.options)
5116 .await
5117 .map(gax::response::Response::into_body)
5118 }
5119
5120 pub fn poller(
5122 self,
5123 ) -> impl lro::Poller<
5124 crate::model::UnresolvePullRequestCommentsResponse,
5125 crate::model::OperationMetadata,
5126 > {
5127 type Operation = lro::internal::Operation<
5128 crate::model::UnresolvePullRequestCommentsResponse,
5129 crate::model::OperationMetadata,
5130 >;
5131 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5132 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5133
5134 let stub = self.0.stub.clone();
5135 let mut options = self.0.options.clone();
5136 options.set_retry_policy(gax::retry_policy::NeverRetry);
5137 let query = move |name| {
5138 let stub = stub.clone();
5139 let options = options.clone();
5140 async {
5141 let op = GetOperation::new(stub)
5142 .set_name(name)
5143 .with_options(options)
5144 .send()
5145 .await?;
5146 Ok(Operation::new(op))
5147 }
5148 };
5149
5150 let start = move || async {
5151 let op = self.send().await?;
5152 Ok(Operation::new(op))
5153 };
5154
5155 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5156 }
5157
5158 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5162 self.0.request.parent = v.into();
5163 self
5164 }
5165
5166 pub fn set_names<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.names = v.into_iter().map(|i| i.into()).collect();
5176 self
5177 }
5178
5179 pub fn set_auto_fill<T: Into<bool>>(mut self, v: T) -> Self {
5181 self.0.request.auto_fill = v.into();
5182 self
5183 }
5184 }
5185
5186 #[doc(hidden)]
5187 impl gax::options::internal::RequestBuilder for UnresolvePullRequestComments {
5188 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5189 &mut self.0.options
5190 }
5191 }
5192
5193 #[derive(Clone, Debug)]
5212 pub struct CreateIssueComment(RequestBuilder<crate::model::CreateIssueCommentRequest>);
5213
5214 impl CreateIssueComment {
5215 pub(crate) fn new(
5216 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5217 ) -> Self {
5218 Self(RequestBuilder::new(stub))
5219 }
5220
5221 pub fn with_request<V: Into<crate::model::CreateIssueCommentRequest>>(
5223 mut self,
5224 v: V,
5225 ) -> Self {
5226 self.0.request = v.into();
5227 self
5228 }
5229
5230 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5232 self.0.options = v.into();
5233 self
5234 }
5235
5236 pub async fn send(self) -> Result<longrunning::model::Operation> {
5243 (*self.0.stub)
5244 .create_issue_comment(self.0.request, self.0.options)
5245 .await
5246 .map(gax::response::Response::into_body)
5247 }
5248
5249 pub fn poller(
5251 self,
5252 ) -> impl lro::Poller<crate::model::IssueComment, crate::model::OperationMetadata> {
5253 type Operation = lro::internal::Operation<
5254 crate::model::IssueComment,
5255 crate::model::OperationMetadata,
5256 >;
5257 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5258 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5259
5260 let stub = self.0.stub.clone();
5261 let mut options = self.0.options.clone();
5262 options.set_retry_policy(gax::retry_policy::NeverRetry);
5263 let query = move |name| {
5264 let stub = stub.clone();
5265 let options = options.clone();
5266 async {
5267 let op = GetOperation::new(stub)
5268 .set_name(name)
5269 .with_options(options)
5270 .send()
5271 .await?;
5272 Ok(Operation::new(op))
5273 }
5274 };
5275
5276 let start = move || async {
5277 let op = self.send().await?;
5278 Ok(Operation::new(op))
5279 };
5280
5281 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5282 }
5283
5284 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5288 self.0.request.parent = v.into();
5289 self
5290 }
5291
5292 pub fn set_issue_comment<T>(mut self, v: T) -> Self
5296 where
5297 T: std::convert::Into<crate::model::IssueComment>,
5298 {
5299 self.0.request.issue_comment = std::option::Option::Some(v.into());
5300 self
5301 }
5302
5303 pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
5307 where
5308 T: std::convert::Into<crate::model::IssueComment>,
5309 {
5310 self.0.request.issue_comment = v.map(|x| x.into());
5311 self
5312 }
5313 }
5314
5315 #[doc(hidden)]
5316 impl gax::options::internal::RequestBuilder for CreateIssueComment {
5317 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5318 &mut self.0.options
5319 }
5320 }
5321
5322 #[derive(Clone, Debug)]
5340 pub struct GetIssueComment(RequestBuilder<crate::model::GetIssueCommentRequest>);
5341
5342 impl GetIssueComment {
5343 pub(crate) fn new(
5344 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5345 ) -> Self {
5346 Self(RequestBuilder::new(stub))
5347 }
5348
5349 pub fn with_request<V: Into<crate::model::GetIssueCommentRequest>>(mut self, v: V) -> Self {
5351 self.0.request = v.into();
5352 self
5353 }
5354
5355 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5357 self.0.options = v.into();
5358 self
5359 }
5360
5361 pub async fn send(self) -> Result<crate::model::IssueComment> {
5363 (*self.0.stub)
5364 .get_issue_comment(self.0.request, self.0.options)
5365 .await
5366 .map(gax::response::Response::into_body)
5367 }
5368
5369 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5373 self.0.request.name = v.into();
5374 self
5375 }
5376 }
5377
5378 #[doc(hidden)]
5379 impl gax::options::internal::RequestBuilder for GetIssueComment {
5380 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5381 &mut self.0.options
5382 }
5383 }
5384
5385 #[derive(Clone, Debug)]
5407 pub struct ListIssueComments(RequestBuilder<crate::model::ListIssueCommentsRequest>);
5408
5409 impl ListIssueComments {
5410 pub(crate) fn new(
5411 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5412 ) -> Self {
5413 Self(RequestBuilder::new(stub))
5414 }
5415
5416 pub fn with_request<V: Into<crate::model::ListIssueCommentsRequest>>(
5418 mut self,
5419 v: V,
5420 ) -> Self {
5421 self.0.request = v.into();
5422 self
5423 }
5424
5425 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5427 self.0.options = v.into();
5428 self
5429 }
5430
5431 pub async fn send(self) -> Result<crate::model::ListIssueCommentsResponse> {
5433 (*self.0.stub)
5434 .list_issue_comments(self.0.request, self.0.options)
5435 .await
5436 .map(gax::response::Response::into_body)
5437 }
5438
5439 pub fn by_page(
5441 self,
5442 ) -> impl gax::paginator::Paginator<crate::model::ListIssueCommentsResponse, gax::error::Error>
5443 {
5444 use std::clone::Clone;
5445 let token = self.0.request.page_token.clone();
5446 let execute = move |token: String| {
5447 let mut builder = self.clone();
5448 builder.0.request = builder.0.request.set_page_token(token);
5449 builder.send()
5450 };
5451 gax::paginator::internal::new_paginator(token, execute)
5452 }
5453
5454 pub fn by_item(
5456 self,
5457 ) -> impl gax::paginator::ItemPaginator<crate::model::ListIssueCommentsResponse, gax::error::Error>
5458 {
5459 use gax::paginator::Paginator;
5460 self.by_page().items()
5461 }
5462
5463 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5467 self.0.request.parent = v.into();
5468 self
5469 }
5470
5471 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5473 self.0.request.page_size = v.into();
5474 self
5475 }
5476
5477 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5479 self.0.request.page_token = v.into();
5480 self
5481 }
5482 }
5483
5484 #[doc(hidden)]
5485 impl gax::options::internal::RequestBuilder for ListIssueComments {
5486 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5487 &mut self.0.options
5488 }
5489 }
5490
5491 #[derive(Clone, Debug)]
5510 pub struct UpdateIssueComment(RequestBuilder<crate::model::UpdateIssueCommentRequest>);
5511
5512 impl UpdateIssueComment {
5513 pub(crate) fn new(
5514 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5515 ) -> Self {
5516 Self(RequestBuilder::new(stub))
5517 }
5518
5519 pub fn with_request<V: Into<crate::model::UpdateIssueCommentRequest>>(
5521 mut self,
5522 v: V,
5523 ) -> Self {
5524 self.0.request = v.into();
5525 self
5526 }
5527
5528 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5530 self.0.options = v.into();
5531 self
5532 }
5533
5534 pub async fn send(self) -> Result<longrunning::model::Operation> {
5541 (*self.0.stub)
5542 .update_issue_comment(self.0.request, self.0.options)
5543 .await
5544 .map(gax::response::Response::into_body)
5545 }
5546
5547 pub fn poller(
5549 self,
5550 ) -> impl lro::Poller<crate::model::IssueComment, crate::model::OperationMetadata> {
5551 type Operation = lro::internal::Operation<
5552 crate::model::IssueComment,
5553 crate::model::OperationMetadata,
5554 >;
5555 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5556 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5557
5558 let stub = self.0.stub.clone();
5559 let mut options = self.0.options.clone();
5560 options.set_retry_policy(gax::retry_policy::NeverRetry);
5561 let query = move |name| {
5562 let stub = stub.clone();
5563 let options = options.clone();
5564 async {
5565 let op = GetOperation::new(stub)
5566 .set_name(name)
5567 .with_options(options)
5568 .send()
5569 .await?;
5570 Ok(Operation::new(op))
5571 }
5572 };
5573
5574 let start = move || async {
5575 let op = self.send().await?;
5576 Ok(Operation::new(op))
5577 };
5578
5579 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5580 }
5581
5582 pub fn set_issue_comment<T>(mut self, v: T) -> Self
5586 where
5587 T: std::convert::Into<crate::model::IssueComment>,
5588 {
5589 self.0.request.issue_comment = std::option::Option::Some(v.into());
5590 self
5591 }
5592
5593 pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
5597 where
5598 T: std::convert::Into<crate::model::IssueComment>,
5599 {
5600 self.0.request.issue_comment = v.map(|x| x.into());
5601 self
5602 }
5603
5604 pub fn set_update_mask<T>(mut self, v: T) -> Self
5606 where
5607 T: std::convert::Into<wkt::FieldMask>,
5608 {
5609 self.0.request.update_mask = std::option::Option::Some(v.into());
5610 self
5611 }
5612
5613 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5615 where
5616 T: std::convert::Into<wkt::FieldMask>,
5617 {
5618 self.0.request.update_mask = v.map(|x| x.into());
5619 self
5620 }
5621 }
5622
5623 #[doc(hidden)]
5624 impl gax::options::internal::RequestBuilder for UpdateIssueComment {
5625 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5626 &mut self.0.options
5627 }
5628 }
5629
5630 #[derive(Clone, Debug)]
5649 pub struct DeleteIssueComment(RequestBuilder<crate::model::DeleteIssueCommentRequest>);
5650
5651 impl DeleteIssueComment {
5652 pub(crate) fn new(
5653 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5654 ) -> Self {
5655 Self(RequestBuilder::new(stub))
5656 }
5657
5658 pub fn with_request<V: Into<crate::model::DeleteIssueCommentRequest>>(
5660 mut self,
5661 v: V,
5662 ) -> Self {
5663 self.0.request = v.into();
5664 self
5665 }
5666
5667 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5669 self.0.options = v.into();
5670 self
5671 }
5672
5673 pub async fn send(self) -> Result<longrunning::model::Operation> {
5680 (*self.0.stub)
5681 .delete_issue_comment(self.0.request, self.0.options)
5682 .await
5683 .map(gax::response::Response::into_body)
5684 }
5685
5686 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
5688 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5689 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5690 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5691
5692 let stub = self.0.stub.clone();
5693 let mut options = self.0.options.clone();
5694 options.set_retry_policy(gax::retry_policy::NeverRetry);
5695 let query = move |name| {
5696 let stub = stub.clone();
5697 let options = options.clone();
5698 async {
5699 let op = GetOperation::new(stub)
5700 .set_name(name)
5701 .with_options(options)
5702 .send()
5703 .await?;
5704 Ok(Operation::new(op))
5705 }
5706 };
5707
5708 let start = move || async {
5709 let op = self.send().await?;
5710 Ok(Operation::new(op))
5711 };
5712
5713 lro::internal::new_unit_response_poller(
5714 polling_error_policy,
5715 polling_backoff_policy,
5716 start,
5717 query,
5718 )
5719 }
5720
5721 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5725 self.0.request.name = v.into();
5726 self
5727 }
5728 }
5729
5730 #[doc(hidden)]
5731 impl gax::options::internal::RequestBuilder for DeleteIssueComment {
5732 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5733 &mut self.0.options
5734 }
5735 }
5736
5737 #[derive(Clone, Debug)]
5759 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5760
5761 impl ListLocations {
5762 pub(crate) fn new(
5763 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5764 ) -> Self {
5765 Self(RequestBuilder::new(stub))
5766 }
5767
5768 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5770 mut self,
5771 v: V,
5772 ) -> Self {
5773 self.0.request = v.into();
5774 self
5775 }
5776
5777 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5779 self.0.options = v.into();
5780 self
5781 }
5782
5783 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5785 (*self.0.stub)
5786 .list_locations(self.0.request, self.0.options)
5787 .await
5788 .map(gax::response::Response::into_body)
5789 }
5790
5791 pub fn by_page(
5793 self,
5794 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5795 {
5796 use std::clone::Clone;
5797 let token = self.0.request.page_token.clone();
5798 let execute = move |token: String| {
5799 let mut builder = self.clone();
5800 builder.0.request = builder.0.request.set_page_token(token);
5801 builder.send()
5802 };
5803 gax::paginator::internal::new_paginator(token, execute)
5804 }
5805
5806 pub fn by_item(
5808 self,
5809 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5810 {
5811 use gax::paginator::Paginator;
5812 self.by_page().items()
5813 }
5814
5815 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5817 self.0.request.name = v.into();
5818 self
5819 }
5820
5821 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5823 self.0.request.filter = v.into();
5824 self
5825 }
5826
5827 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5829 self.0.request.page_size = v.into();
5830 self
5831 }
5832
5833 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5835 self.0.request.page_token = v.into();
5836 self
5837 }
5838 }
5839
5840 #[doc(hidden)]
5841 impl gax::options::internal::RequestBuilder for ListLocations {
5842 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5843 &mut self.0.options
5844 }
5845 }
5846
5847 #[derive(Clone, Debug)]
5865 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5866
5867 impl GetLocation {
5868 pub(crate) fn new(
5869 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5870 ) -> Self {
5871 Self(RequestBuilder::new(stub))
5872 }
5873
5874 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5876 self.0.request = v.into();
5877 self
5878 }
5879
5880 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5882 self.0.options = v.into();
5883 self
5884 }
5885
5886 pub async fn send(self) -> Result<location::model::Location> {
5888 (*self.0.stub)
5889 .get_location(self.0.request, self.0.options)
5890 .await
5891 .map(gax::response::Response::into_body)
5892 }
5893
5894 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5896 self.0.request.name = v.into();
5897 self
5898 }
5899 }
5900
5901 #[doc(hidden)]
5902 impl gax::options::internal::RequestBuilder for GetLocation {
5903 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5904 &mut self.0.options
5905 }
5906 }
5907
5908 #[derive(Clone, Debug)]
5926 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5927
5928 impl SetIamPolicy {
5929 pub(crate) fn new(
5930 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5931 ) -> Self {
5932 Self(RequestBuilder::new(stub))
5933 }
5934
5935 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5937 self.0.request = v.into();
5938 self
5939 }
5940
5941 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5943 self.0.options = v.into();
5944 self
5945 }
5946
5947 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5949 (*self.0.stub)
5950 .set_iam_policy(self.0.request, self.0.options)
5951 .await
5952 .map(gax::response::Response::into_body)
5953 }
5954
5955 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5959 self.0.request.resource = v.into();
5960 self
5961 }
5962
5963 pub fn set_policy<T>(mut self, v: T) -> Self
5967 where
5968 T: std::convert::Into<iam_v1::model::Policy>,
5969 {
5970 self.0.request.policy = std::option::Option::Some(v.into());
5971 self
5972 }
5973
5974 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5978 where
5979 T: std::convert::Into<iam_v1::model::Policy>,
5980 {
5981 self.0.request.policy = v.map(|x| x.into());
5982 self
5983 }
5984
5985 pub fn set_update_mask<T>(mut self, v: T) -> Self
5987 where
5988 T: std::convert::Into<wkt::FieldMask>,
5989 {
5990 self.0.request.update_mask = std::option::Option::Some(v.into());
5991 self
5992 }
5993
5994 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5996 where
5997 T: std::convert::Into<wkt::FieldMask>,
5998 {
5999 self.0.request.update_mask = v.map(|x| x.into());
6000 self
6001 }
6002 }
6003
6004 #[doc(hidden)]
6005 impl gax::options::internal::RequestBuilder for SetIamPolicy {
6006 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6007 &mut self.0.options
6008 }
6009 }
6010
6011 #[derive(Clone, Debug)]
6029 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
6030
6031 impl GetIamPolicy {
6032 pub(crate) fn new(
6033 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6034 ) -> Self {
6035 Self(RequestBuilder::new(stub))
6036 }
6037
6038 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
6040 self.0.request = v.into();
6041 self
6042 }
6043
6044 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6046 self.0.options = v.into();
6047 self
6048 }
6049
6050 pub async fn send(self) -> Result<iam_v1::model::Policy> {
6052 (*self.0.stub)
6053 .get_iam_policy(self.0.request, self.0.options)
6054 .await
6055 .map(gax::response::Response::into_body)
6056 }
6057
6058 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6062 self.0.request.resource = v.into();
6063 self
6064 }
6065
6066 pub fn set_options<T>(mut self, v: T) -> Self
6068 where
6069 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
6070 {
6071 self.0.request.options = std::option::Option::Some(v.into());
6072 self
6073 }
6074
6075 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6077 where
6078 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
6079 {
6080 self.0.request.options = v.map(|x| x.into());
6081 self
6082 }
6083 }
6084
6085 #[doc(hidden)]
6086 impl gax::options::internal::RequestBuilder for GetIamPolicy {
6087 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6088 &mut self.0.options
6089 }
6090 }
6091
6092 #[derive(Clone, Debug)]
6110 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
6111
6112 impl TestIamPermissions {
6113 pub(crate) fn new(
6114 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6115 ) -> Self {
6116 Self(RequestBuilder::new(stub))
6117 }
6118
6119 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
6121 mut self,
6122 v: V,
6123 ) -> Self {
6124 self.0.request = v.into();
6125 self
6126 }
6127
6128 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6130 self.0.options = v.into();
6131 self
6132 }
6133
6134 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
6136 (*self.0.stub)
6137 .test_iam_permissions(self.0.request, self.0.options)
6138 .await
6139 .map(gax::response::Response::into_body)
6140 }
6141
6142 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6146 self.0.request.resource = v.into();
6147 self
6148 }
6149
6150 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6154 where
6155 T: std::iter::IntoIterator<Item = V>,
6156 V: std::convert::Into<std::string::String>,
6157 {
6158 use std::iter::Iterator;
6159 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6160 self
6161 }
6162 }
6163
6164 #[doc(hidden)]
6165 impl gax::options::internal::RequestBuilder for TestIamPermissions {
6166 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6167 &mut self.0.options
6168 }
6169 }
6170
6171 #[derive(Clone, Debug)]
6193 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6194
6195 impl ListOperations {
6196 pub(crate) fn new(
6197 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6198 ) -> Self {
6199 Self(RequestBuilder::new(stub))
6200 }
6201
6202 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6204 mut self,
6205 v: V,
6206 ) -> Self {
6207 self.0.request = v.into();
6208 self
6209 }
6210
6211 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6213 self.0.options = v.into();
6214 self
6215 }
6216
6217 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6219 (*self.0.stub)
6220 .list_operations(self.0.request, self.0.options)
6221 .await
6222 .map(gax::response::Response::into_body)
6223 }
6224
6225 pub fn by_page(
6227 self,
6228 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6229 {
6230 use std::clone::Clone;
6231 let token = self.0.request.page_token.clone();
6232 let execute = move |token: String| {
6233 let mut builder = self.clone();
6234 builder.0.request = builder.0.request.set_page_token(token);
6235 builder.send()
6236 };
6237 gax::paginator::internal::new_paginator(token, execute)
6238 }
6239
6240 pub fn by_item(
6242 self,
6243 ) -> impl gax::paginator::ItemPaginator<
6244 longrunning::model::ListOperationsResponse,
6245 gax::error::Error,
6246 > {
6247 use gax::paginator::Paginator;
6248 self.by_page().items()
6249 }
6250
6251 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6253 self.0.request.name = v.into();
6254 self
6255 }
6256
6257 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6259 self.0.request.filter = v.into();
6260 self
6261 }
6262
6263 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6265 self.0.request.page_size = v.into();
6266 self
6267 }
6268
6269 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6271 self.0.request.page_token = v.into();
6272 self
6273 }
6274
6275 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6277 self.0.request.return_partial_success = v.into();
6278 self
6279 }
6280 }
6281
6282 #[doc(hidden)]
6283 impl gax::options::internal::RequestBuilder for ListOperations {
6284 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6285 &mut self.0.options
6286 }
6287 }
6288
6289 #[derive(Clone, Debug)]
6307 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6308
6309 impl GetOperation {
6310 pub(crate) fn new(
6311 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6312 ) -> Self {
6313 Self(RequestBuilder::new(stub))
6314 }
6315
6316 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6318 mut self,
6319 v: V,
6320 ) -> Self {
6321 self.0.request = v.into();
6322 self
6323 }
6324
6325 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6327 self.0.options = v.into();
6328 self
6329 }
6330
6331 pub async fn send(self) -> Result<longrunning::model::Operation> {
6333 (*self.0.stub)
6334 .get_operation(self.0.request, self.0.options)
6335 .await
6336 .map(gax::response::Response::into_body)
6337 }
6338
6339 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6341 self.0.request.name = v.into();
6342 self
6343 }
6344 }
6345
6346 #[doc(hidden)]
6347 impl gax::options::internal::RequestBuilder for GetOperation {
6348 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6349 &mut self.0.options
6350 }
6351 }
6352
6353 #[derive(Clone, Debug)]
6371 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6372
6373 impl DeleteOperation {
6374 pub(crate) fn new(
6375 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6376 ) -> Self {
6377 Self(RequestBuilder::new(stub))
6378 }
6379
6380 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6382 mut self,
6383 v: V,
6384 ) -> Self {
6385 self.0.request = v.into();
6386 self
6387 }
6388
6389 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6391 self.0.options = v.into();
6392 self
6393 }
6394
6395 pub async fn send(self) -> Result<()> {
6397 (*self.0.stub)
6398 .delete_operation(self.0.request, self.0.options)
6399 .await
6400 .map(gax::response::Response::into_body)
6401 }
6402
6403 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6405 self.0.request.name = v.into();
6406 self
6407 }
6408 }
6409
6410 #[doc(hidden)]
6411 impl gax::options::internal::RequestBuilder for DeleteOperation {
6412 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6413 &mut self.0.options
6414 }
6415 }
6416
6417 #[derive(Clone, Debug)]
6435 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6436
6437 impl CancelOperation {
6438 pub(crate) fn new(
6439 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6440 ) -> Self {
6441 Self(RequestBuilder::new(stub))
6442 }
6443
6444 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6446 mut self,
6447 v: V,
6448 ) -> Self {
6449 self.0.request = v.into();
6450 self
6451 }
6452
6453 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6455 self.0.options = v.into();
6456 self
6457 }
6458
6459 pub async fn send(self) -> Result<()> {
6461 (*self.0.stub)
6462 .cancel_operation(self.0.request, self.0.options)
6463 .await
6464 .map(gax::response::Response::into_body)
6465 }
6466
6467 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6469 self.0.request.name = v.into();
6470 self
6471 }
6472 }
6473
6474 #[doc(hidden)]
6475 impl gax::options::internal::RequestBuilder for CancelOperation {
6476 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6477 &mut self.0.options
6478 }
6479 }
6480}