1pub mod secure_source_manager {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::SecureSourceManager;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = SecureSourceManager;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
94 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
95
96 impl ListInstances {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
117 (*self.0.stub)
118 .list_instances(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 pub fn by_page(
125 self,
126 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
127 {
128 use std::clone::Clone;
129 let token = self.0.request.page_token.clone();
130 let execute = move |token: String| {
131 let mut builder = self.clone();
132 builder.0.request = builder.0.request.set_page_token(token);
133 builder.send()
134 };
135 google_cloud_gax::paginator::internal::new_paginator(token, execute)
136 }
137
138 pub fn by_item(
140 self,
141 ) -> impl google_cloud_gax::paginator::ItemPaginator<
142 crate::model::ListInstancesResponse,
143 crate::Error,
144 > {
145 use google_cloud_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 crate::RequestBuilder for ListInstances {
184 fn request_options(&mut self) -> &mut crate::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[derive(Clone, Debug)]
206 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
207
208 impl GetInstance {
209 pub(crate) fn new(
210 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
211 ) -> Self {
212 Self(RequestBuilder::new(stub))
213 }
214
215 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
217 self.0.request = v.into();
218 self
219 }
220
221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
223 self.0.options = v.into();
224 self
225 }
226
227 pub async fn send(self) -> Result<crate::model::Instance> {
229 (*self.0.stub)
230 .get_instance(self.0.request, self.0.options)
231 .await
232 .map(crate::Response::into_body)
233 }
234
235 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
239 self.0.request.name = v.into();
240 self
241 }
242 }
243
244 #[doc(hidden)]
245 impl crate::RequestBuilder for GetInstance {
246 fn request_options(&mut self) -> &mut crate::RequestOptions {
247 &mut self.0.options
248 }
249 }
250
251 #[derive(Clone, Debug)]
269 pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
270
271 impl CreateInstance {
272 pub(crate) fn new(
273 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
274 ) -> Self {
275 Self(RequestBuilder::new(stub))
276 }
277
278 pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
280 self.0.request = v.into();
281 self
282 }
283
284 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
286 self.0.options = v.into();
287 self
288 }
289
290 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
297 (*self.0.stub)
298 .create_instance(self.0.request, self.0.options)
299 .await
300 .map(crate::Response::into_body)
301 }
302
303 pub fn poller(
305 self,
306 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
307 {
308 type Operation = google_cloud_lro::internal::Operation<
309 crate::model::Instance,
310 crate::model::OperationMetadata,
311 >;
312 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
313 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
314
315 let stub = self.0.stub.clone();
316 let mut options = self.0.options.clone();
317 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
318 let query = move |name| {
319 let stub = stub.clone();
320 let options = options.clone();
321 async {
322 let op = GetOperation::new(stub)
323 .set_name(name)
324 .with_options(options)
325 .send()
326 .await?;
327 Ok(Operation::new(op))
328 }
329 };
330
331 let start = move || async {
332 let op = self.send().await?;
333 Ok(Operation::new(op))
334 };
335
336 google_cloud_lro::internal::new_poller(
337 polling_error_policy,
338 polling_backoff_policy,
339 start,
340 query,
341 )
342 }
343
344 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
348 self.0.request.parent = v.into();
349 self
350 }
351
352 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
356 self.0.request.instance_id = v.into();
357 self
358 }
359
360 pub fn set_instance<T>(mut self, v: T) -> Self
364 where
365 T: std::convert::Into<crate::model::Instance>,
366 {
367 self.0.request.instance = std::option::Option::Some(v.into());
368 self
369 }
370
371 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
375 where
376 T: std::convert::Into<crate::model::Instance>,
377 {
378 self.0.request.instance = v.map(|x| x.into());
379 self
380 }
381
382 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
384 self.0.request.request_id = v.into();
385 self
386 }
387 }
388
389 #[doc(hidden)]
390 impl crate::RequestBuilder for CreateInstance {
391 fn request_options(&mut self) -> &mut crate::RequestOptions {
392 &mut self.0.options
393 }
394 }
395
396 #[derive(Clone, Debug)]
414 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
415
416 impl DeleteInstance {
417 pub(crate) fn new(
418 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
419 ) -> Self {
420 Self(RequestBuilder::new(stub))
421 }
422
423 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
425 self.0.request = v.into();
426 self
427 }
428
429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
431 self.0.options = v.into();
432 self
433 }
434
435 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
442 (*self.0.stub)
443 .delete_instance(self.0.request, self.0.options)
444 .await
445 .map(crate::Response::into_body)
446 }
447
448 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
450 type Operation =
451 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
452 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
453 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
454
455 let stub = self.0.stub.clone();
456 let mut options = self.0.options.clone();
457 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
458 let query = move |name| {
459 let stub = stub.clone();
460 let options = options.clone();
461 async {
462 let op = GetOperation::new(stub)
463 .set_name(name)
464 .with_options(options)
465 .send()
466 .await?;
467 Ok(Operation::new(op))
468 }
469 };
470
471 let start = move || async {
472 let op = self.send().await?;
473 Ok(Operation::new(op))
474 };
475
476 google_cloud_lro::internal::new_unit_response_poller(
477 polling_error_policy,
478 polling_backoff_policy,
479 start,
480 query,
481 )
482 }
483
484 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
488 self.0.request.name = v.into();
489 self
490 }
491
492 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
494 self.0.request.request_id = v.into();
495 self
496 }
497
498 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
500 self.0.request.force = v.into();
501 self
502 }
503 }
504
505 #[doc(hidden)]
506 impl crate::RequestBuilder for DeleteInstance {
507 fn request_options(&mut self) -> &mut crate::RequestOptions {
508 &mut self.0.options
509 }
510 }
511
512 #[derive(Clone, Debug)]
533 pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
534
535 impl ListRepositories {
536 pub(crate) fn new(
537 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
538 ) -> Self {
539 Self(RequestBuilder::new(stub))
540 }
541
542 pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
544 mut self,
545 v: V,
546 ) -> Self {
547 self.0.request = v.into();
548 self
549 }
550
551 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
553 self.0.options = v.into();
554 self
555 }
556
557 pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
559 (*self.0.stub)
560 .list_repositories(self.0.request, self.0.options)
561 .await
562 .map(crate::Response::into_body)
563 }
564
565 pub fn by_page(
567 self,
568 ) -> impl google_cloud_gax::paginator::Paginator<
569 crate::model::ListRepositoriesResponse,
570 crate::Error,
571 > {
572 use std::clone::Clone;
573 let token = self.0.request.page_token.clone();
574 let execute = move |token: String| {
575 let mut builder = self.clone();
576 builder.0.request = builder.0.request.set_page_token(token);
577 builder.send()
578 };
579 google_cloud_gax::paginator::internal::new_paginator(token, execute)
580 }
581
582 pub fn by_item(
584 self,
585 ) -> impl google_cloud_gax::paginator::ItemPaginator<
586 crate::model::ListRepositoriesResponse,
587 crate::Error,
588 > {
589 use google_cloud_gax::paginator::Paginator;
590 self.by_page().items()
591 }
592
593 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
597 self.0.request.parent = v.into();
598 self
599 }
600
601 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
603 self.0.request.page_size = v.into();
604 self
605 }
606
607 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
609 self.0.request.page_token = v.into();
610 self
611 }
612
613 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
615 self.0.request.filter = v.into();
616 self
617 }
618
619 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
621 self.0.request.instance = v.into();
622 self
623 }
624 }
625
626 #[doc(hidden)]
627 impl crate::RequestBuilder for ListRepositories {
628 fn request_options(&mut self) -> &mut crate::RequestOptions {
629 &mut self.0.options
630 }
631 }
632
633 #[derive(Clone, Debug)]
650 pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
651
652 impl GetRepository {
653 pub(crate) fn new(
654 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
655 ) -> Self {
656 Self(RequestBuilder::new(stub))
657 }
658
659 pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
661 self.0.request = v.into();
662 self
663 }
664
665 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
667 self.0.options = v.into();
668 self
669 }
670
671 pub async fn send(self) -> Result<crate::model::Repository> {
673 (*self.0.stub)
674 .get_repository(self.0.request, self.0.options)
675 .await
676 .map(crate::Response::into_body)
677 }
678
679 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
683 self.0.request.name = v.into();
684 self
685 }
686 }
687
688 #[doc(hidden)]
689 impl crate::RequestBuilder for GetRepository {
690 fn request_options(&mut self) -> &mut crate::RequestOptions {
691 &mut self.0.options
692 }
693 }
694
695 #[derive(Clone, Debug)]
713 pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
714
715 impl CreateRepository {
716 pub(crate) fn new(
717 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
718 ) -> Self {
719 Self(RequestBuilder::new(stub))
720 }
721
722 pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
724 mut self,
725 v: V,
726 ) -> Self {
727 self.0.request = v.into();
728 self
729 }
730
731 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
733 self.0.options = v.into();
734 self
735 }
736
737 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
744 (*self.0.stub)
745 .create_repository(self.0.request, self.0.options)
746 .await
747 .map(crate::Response::into_body)
748 }
749
750 pub fn poller(
752 self,
753 ) -> impl google_cloud_lro::Poller<crate::model::Repository, crate::model::OperationMetadata>
754 {
755 type Operation = google_cloud_lro::internal::Operation<
756 crate::model::Repository,
757 crate::model::OperationMetadata,
758 >;
759 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
760 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
761
762 let stub = self.0.stub.clone();
763 let mut options = self.0.options.clone();
764 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
765 let query = move |name| {
766 let stub = stub.clone();
767 let options = options.clone();
768 async {
769 let op = GetOperation::new(stub)
770 .set_name(name)
771 .with_options(options)
772 .send()
773 .await?;
774 Ok(Operation::new(op))
775 }
776 };
777
778 let start = move || async {
779 let op = self.send().await?;
780 Ok(Operation::new(op))
781 };
782
783 google_cloud_lro::internal::new_poller(
784 polling_error_policy,
785 polling_backoff_policy,
786 start,
787 query,
788 )
789 }
790
791 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
795 self.0.request.parent = v.into();
796 self
797 }
798
799 pub fn set_repository<T>(mut self, v: T) -> Self
803 where
804 T: std::convert::Into<crate::model::Repository>,
805 {
806 self.0.request.repository = std::option::Option::Some(v.into());
807 self
808 }
809
810 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
814 where
815 T: std::convert::Into<crate::model::Repository>,
816 {
817 self.0.request.repository = v.map(|x| x.into());
818 self
819 }
820
821 pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
825 self.0.request.repository_id = v.into();
826 self
827 }
828 }
829
830 #[doc(hidden)]
831 impl crate::RequestBuilder for CreateRepository {
832 fn request_options(&mut self) -> &mut crate::RequestOptions {
833 &mut self.0.options
834 }
835 }
836
837 #[derive(Clone, Debug)]
855 pub struct UpdateRepository(RequestBuilder<crate::model::UpdateRepositoryRequest>);
856
857 impl UpdateRepository {
858 pub(crate) fn new(
859 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
860 ) -> Self {
861 Self(RequestBuilder::new(stub))
862 }
863
864 pub fn with_request<V: Into<crate::model::UpdateRepositoryRequest>>(
866 mut self,
867 v: V,
868 ) -> Self {
869 self.0.request = v.into();
870 self
871 }
872
873 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
875 self.0.options = v.into();
876 self
877 }
878
879 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
886 (*self.0.stub)
887 .update_repository(self.0.request, self.0.options)
888 .await
889 .map(crate::Response::into_body)
890 }
891
892 pub fn poller(
894 self,
895 ) -> impl google_cloud_lro::Poller<crate::model::Repository, crate::model::OperationMetadata>
896 {
897 type Operation = google_cloud_lro::internal::Operation<
898 crate::model::Repository,
899 crate::model::OperationMetadata,
900 >;
901 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
902 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
903
904 let stub = self.0.stub.clone();
905 let mut options = self.0.options.clone();
906 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
907 let query = move |name| {
908 let stub = stub.clone();
909 let options = options.clone();
910 async {
911 let op = GetOperation::new(stub)
912 .set_name(name)
913 .with_options(options)
914 .send()
915 .await?;
916 Ok(Operation::new(op))
917 }
918 };
919
920 let start = move || async {
921 let op = self.send().await?;
922 Ok(Operation::new(op))
923 };
924
925 google_cloud_lro::internal::new_poller(
926 polling_error_policy,
927 polling_backoff_policy,
928 start,
929 query,
930 )
931 }
932
933 pub fn set_update_mask<T>(mut self, v: T) -> Self
935 where
936 T: std::convert::Into<wkt::FieldMask>,
937 {
938 self.0.request.update_mask = std::option::Option::Some(v.into());
939 self
940 }
941
942 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
944 where
945 T: std::convert::Into<wkt::FieldMask>,
946 {
947 self.0.request.update_mask = v.map(|x| x.into());
948 self
949 }
950
951 pub fn set_repository<T>(mut self, v: T) -> Self
955 where
956 T: std::convert::Into<crate::model::Repository>,
957 {
958 self.0.request.repository = std::option::Option::Some(v.into());
959 self
960 }
961
962 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
966 where
967 T: std::convert::Into<crate::model::Repository>,
968 {
969 self.0.request.repository = v.map(|x| x.into());
970 self
971 }
972
973 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
975 self.0.request.validate_only = v.into();
976 self
977 }
978 }
979
980 #[doc(hidden)]
981 impl crate::RequestBuilder for UpdateRepository {
982 fn request_options(&mut self) -> &mut crate::RequestOptions {
983 &mut self.0.options
984 }
985 }
986
987 #[derive(Clone, Debug)]
1005 pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
1006
1007 impl DeleteRepository {
1008 pub(crate) fn new(
1009 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1010 ) -> Self {
1011 Self(RequestBuilder::new(stub))
1012 }
1013
1014 pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
1016 mut self,
1017 v: V,
1018 ) -> Self {
1019 self.0.request = v.into();
1020 self
1021 }
1022
1023 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1025 self.0.options = v.into();
1026 self
1027 }
1028
1029 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1036 (*self.0.stub)
1037 .delete_repository(self.0.request, self.0.options)
1038 .await
1039 .map(crate::Response::into_body)
1040 }
1041
1042 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1044 type Operation =
1045 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1046 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1047 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1048
1049 let stub = self.0.stub.clone();
1050 let mut options = self.0.options.clone();
1051 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1052 let query = move |name| {
1053 let stub = stub.clone();
1054 let options = options.clone();
1055 async {
1056 let op = GetOperation::new(stub)
1057 .set_name(name)
1058 .with_options(options)
1059 .send()
1060 .await?;
1061 Ok(Operation::new(op))
1062 }
1063 };
1064
1065 let start = move || async {
1066 let op = self.send().await?;
1067 Ok(Operation::new(op))
1068 };
1069
1070 google_cloud_lro::internal::new_unit_response_poller(
1071 polling_error_policy,
1072 polling_backoff_policy,
1073 start,
1074 query,
1075 )
1076 }
1077
1078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1082 self.0.request.name = v.into();
1083 self
1084 }
1085
1086 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1088 self.0.request.allow_missing = v.into();
1089 self
1090 }
1091 }
1092
1093 #[doc(hidden)]
1094 impl crate::RequestBuilder for DeleteRepository {
1095 fn request_options(&mut self) -> &mut crate::RequestOptions {
1096 &mut self.0.options
1097 }
1098 }
1099
1100 #[derive(Clone, Debug)]
1121 pub struct ListHooks(RequestBuilder<crate::model::ListHooksRequest>);
1122
1123 impl ListHooks {
1124 pub(crate) fn new(
1125 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1126 ) -> Self {
1127 Self(RequestBuilder::new(stub))
1128 }
1129
1130 pub fn with_request<V: Into<crate::model::ListHooksRequest>>(mut self, v: V) -> Self {
1132 self.0.request = v.into();
1133 self
1134 }
1135
1136 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1138 self.0.options = v.into();
1139 self
1140 }
1141
1142 pub async fn send(self) -> Result<crate::model::ListHooksResponse> {
1144 (*self.0.stub)
1145 .list_hooks(self.0.request, self.0.options)
1146 .await
1147 .map(crate::Response::into_body)
1148 }
1149
1150 pub fn by_page(
1152 self,
1153 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHooksResponse, crate::Error>
1154 {
1155 use std::clone::Clone;
1156 let token = self.0.request.page_token.clone();
1157 let execute = move |token: String| {
1158 let mut builder = self.clone();
1159 builder.0.request = builder.0.request.set_page_token(token);
1160 builder.send()
1161 };
1162 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1163 }
1164
1165 pub fn by_item(
1167 self,
1168 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListHooksResponse, crate::Error>
1169 {
1170 use google_cloud_gax::paginator::Paginator;
1171 self.by_page().items()
1172 }
1173
1174 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1178 self.0.request.parent = v.into();
1179 self
1180 }
1181
1182 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1184 self.0.request.page_size = v.into();
1185 self
1186 }
1187
1188 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1190 self.0.request.page_token = v.into();
1191 self
1192 }
1193 }
1194
1195 #[doc(hidden)]
1196 impl crate::RequestBuilder for ListHooks {
1197 fn request_options(&mut self) -> &mut crate::RequestOptions {
1198 &mut self.0.options
1199 }
1200 }
1201
1202 #[derive(Clone, Debug)]
1219 pub struct GetHook(RequestBuilder<crate::model::GetHookRequest>);
1220
1221 impl GetHook {
1222 pub(crate) fn new(
1223 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1224 ) -> Self {
1225 Self(RequestBuilder::new(stub))
1226 }
1227
1228 pub fn with_request<V: Into<crate::model::GetHookRequest>>(mut self, v: V) -> Self {
1230 self.0.request = v.into();
1231 self
1232 }
1233
1234 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1236 self.0.options = v.into();
1237 self
1238 }
1239
1240 pub async fn send(self) -> Result<crate::model::Hook> {
1242 (*self.0.stub)
1243 .get_hook(self.0.request, self.0.options)
1244 .await
1245 .map(crate::Response::into_body)
1246 }
1247
1248 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1252 self.0.request.name = v.into();
1253 self
1254 }
1255 }
1256
1257 #[doc(hidden)]
1258 impl crate::RequestBuilder for GetHook {
1259 fn request_options(&mut self) -> &mut crate::RequestOptions {
1260 &mut self.0.options
1261 }
1262 }
1263
1264 #[derive(Clone, Debug)]
1282 pub struct CreateHook(RequestBuilder<crate::model::CreateHookRequest>);
1283
1284 impl CreateHook {
1285 pub(crate) fn new(
1286 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1287 ) -> Self {
1288 Self(RequestBuilder::new(stub))
1289 }
1290
1291 pub fn with_request<V: Into<crate::model::CreateHookRequest>>(mut self, v: V) -> Self {
1293 self.0.request = v.into();
1294 self
1295 }
1296
1297 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1299 self.0.options = v.into();
1300 self
1301 }
1302
1303 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1310 (*self.0.stub)
1311 .create_hook(self.0.request, self.0.options)
1312 .await
1313 .map(crate::Response::into_body)
1314 }
1315
1316 pub fn poller(
1318 self,
1319 ) -> impl google_cloud_lro::Poller<crate::model::Hook, crate::model::OperationMetadata>
1320 {
1321 type Operation = google_cloud_lro::internal::Operation<
1322 crate::model::Hook,
1323 crate::model::OperationMetadata,
1324 >;
1325 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1326 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1327
1328 let stub = self.0.stub.clone();
1329 let mut options = self.0.options.clone();
1330 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1331 let query = move |name| {
1332 let stub = stub.clone();
1333 let options = options.clone();
1334 async {
1335 let op = GetOperation::new(stub)
1336 .set_name(name)
1337 .with_options(options)
1338 .send()
1339 .await?;
1340 Ok(Operation::new(op))
1341 }
1342 };
1343
1344 let start = move || async {
1345 let op = self.send().await?;
1346 Ok(Operation::new(op))
1347 };
1348
1349 google_cloud_lro::internal::new_poller(
1350 polling_error_policy,
1351 polling_backoff_policy,
1352 start,
1353 query,
1354 )
1355 }
1356
1357 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1361 self.0.request.parent = v.into();
1362 self
1363 }
1364
1365 pub fn set_hook<T>(mut self, v: T) -> Self
1369 where
1370 T: std::convert::Into<crate::model::Hook>,
1371 {
1372 self.0.request.hook = std::option::Option::Some(v.into());
1373 self
1374 }
1375
1376 pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
1380 where
1381 T: std::convert::Into<crate::model::Hook>,
1382 {
1383 self.0.request.hook = v.map(|x| x.into());
1384 self
1385 }
1386
1387 pub fn set_hook_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1391 self.0.request.hook_id = v.into();
1392 self
1393 }
1394 }
1395
1396 #[doc(hidden)]
1397 impl crate::RequestBuilder for CreateHook {
1398 fn request_options(&mut self) -> &mut crate::RequestOptions {
1399 &mut self.0.options
1400 }
1401 }
1402
1403 #[derive(Clone, Debug)]
1421 pub struct UpdateHook(RequestBuilder<crate::model::UpdateHookRequest>);
1422
1423 impl UpdateHook {
1424 pub(crate) fn new(
1425 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1426 ) -> Self {
1427 Self(RequestBuilder::new(stub))
1428 }
1429
1430 pub fn with_request<V: Into<crate::model::UpdateHookRequest>>(mut self, v: V) -> Self {
1432 self.0.request = v.into();
1433 self
1434 }
1435
1436 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1438 self.0.options = v.into();
1439 self
1440 }
1441
1442 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1449 (*self.0.stub)
1450 .update_hook(self.0.request, self.0.options)
1451 .await
1452 .map(crate::Response::into_body)
1453 }
1454
1455 pub fn poller(
1457 self,
1458 ) -> impl google_cloud_lro::Poller<crate::model::Hook, crate::model::OperationMetadata>
1459 {
1460 type Operation = google_cloud_lro::internal::Operation<
1461 crate::model::Hook,
1462 crate::model::OperationMetadata,
1463 >;
1464 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1465 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1466
1467 let stub = self.0.stub.clone();
1468 let mut options = self.0.options.clone();
1469 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1470 let query = move |name| {
1471 let stub = stub.clone();
1472 let options = options.clone();
1473 async {
1474 let op = GetOperation::new(stub)
1475 .set_name(name)
1476 .with_options(options)
1477 .send()
1478 .await?;
1479 Ok(Operation::new(op))
1480 }
1481 };
1482
1483 let start = move || async {
1484 let op = self.send().await?;
1485 Ok(Operation::new(op))
1486 };
1487
1488 google_cloud_lro::internal::new_poller(
1489 polling_error_policy,
1490 polling_backoff_policy,
1491 start,
1492 query,
1493 )
1494 }
1495
1496 pub fn set_update_mask<T>(mut self, v: T) -> Self
1498 where
1499 T: std::convert::Into<wkt::FieldMask>,
1500 {
1501 self.0.request.update_mask = std::option::Option::Some(v.into());
1502 self
1503 }
1504
1505 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1507 where
1508 T: std::convert::Into<wkt::FieldMask>,
1509 {
1510 self.0.request.update_mask = v.map(|x| x.into());
1511 self
1512 }
1513
1514 pub fn set_hook<T>(mut self, v: T) -> Self
1518 where
1519 T: std::convert::Into<crate::model::Hook>,
1520 {
1521 self.0.request.hook = std::option::Option::Some(v.into());
1522 self
1523 }
1524
1525 pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
1529 where
1530 T: std::convert::Into<crate::model::Hook>,
1531 {
1532 self.0.request.hook = v.map(|x| x.into());
1533 self
1534 }
1535 }
1536
1537 #[doc(hidden)]
1538 impl crate::RequestBuilder for UpdateHook {
1539 fn request_options(&mut self) -> &mut crate::RequestOptions {
1540 &mut self.0.options
1541 }
1542 }
1543
1544 #[derive(Clone, Debug)]
1562 pub struct DeleteHook(RequestBuilder<crate::model::DeleteHookRequest>);
1563
1564 impl DeleteHook {
1565 pub(crate) fn new(
1566 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1567 ) -> Self {
1568 Self(RequestBuilder::new(stub))
1569 }
1570
1571 pub fn with_request<V: Into<crate::model::DeleteHookRequest>>(mut self, v: V) -> Self {
1573 self.0.request = v.into();
1574 self
1575 }
1576
1577 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1579 self.0.options = v.into();
1580 self
1581 }
1582
1583 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1590 (*self.0.stub)
1591 .delete_hook(self.0.request, self.0.options)
1592 .await
1593 .map(crate::Response::into_body)
1594 }
1595
1596 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1598 type Operation =
1599 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1600 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1601 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1602
1603 let stub = self.0.stub.clone();
1604 let mut options = self.0.options.clone();
1605 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1606 let query = move |name| {
1607 let stub = stub.clone();
1608 let options = options.clone();
1609 async {
1610 let op = GetOperation::new(stub)
1611 .set_name(name)
1612 .with_options(options)
1613 .send()
1614 .await?;
1615 Ok(Operation::new(op))
1616 }
1617 };
1618
1619 let start = move || async {
1620 let op = self.send().await?;
1621 Ok(Operation::new(op))
1622 };
1623
1624 google_cloud_lro::internal::new_unit_response_poller(
1625 polling_error_policy,
1626 polling_backoff_policy,
1627 start,
1628 query,
1629 )
1630 }
1631
1632 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1636 self.0.request.name = v.into();
1637 self
1638 }
1639 }
1640
1641 #[doc(hidden)]
1642 impl crate::RequestBuilder for DeleteHook {
1643 fn request_options(&mut self) -> &mut crate::RequestOptions {
1644 &mut self.0.options
1645 }
1646 }
1647
1648 #[derive(Clone, Debug)]
1665 pub struct GetIamPolicyRepo(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1666
1667 impl GetIamPolicyRepo {
1668 pub(crate) fn new(
1669 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1670 ) -> Self {
1671 Self(RequestBuilder::new(stub))
1672 }
1673
1674 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1676 mut self,
1677 v: V,
1678 ) -> Self {
1679 self.0.request = v.into();
1680 self
1681 }
1682
1683 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1685 self.0.options = v.into();
1686 self
1687 }
1688
1689 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1691 (*self.0.stub)
1692 .get_iam_policy_repo(self.0.request, self.0.options)
1693 .await
1694 .map(crate::Response::into_body)
1695 }
1696
1697 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1701 self.0.request.resource = v.into();
1702 self
1703 }
1704
1705 pub fn set_options<T>(mut self, v: T) -> Self
1707 where
1708 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1709 {
1710 self.0.request.options = std::option::Option::Some(v.into());
1711 self
1712 }
1713
1714 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1716 where
1717 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1718 {
1719 self.0.request.options = v.map(|x| x.into());
1720 self
1721 }
1722 }
1723
1724 #[doc(hidden)]
1725 impl crate::RequestBuilder for GetIamPolicyRepo {
1726 fn request_options(&mut self) -> &mut crate::RequestOptions {
1727 &mut self.0.options
1728 }
1729 }
1730
1731 #[derive(Clone, Debug)]
1748 pub struct SetIamPolicyRepo(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1749
1750 impl SetIamPolicyRepo {
1751 pub(crate) fn new(
1752 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1753 ) -> Self {
1754 Self(RequestBuilder::new(stub))
1755 }
1756
1757 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1759 mut self,
1760 v: V,
1761 ) -> Self {
1762 self.0.request = v.into();
1763 self
1764 }
1765
1766 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1768 self.0.options = v.into();
1769 self
1770 }
1771
1772 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1774 (*self.0.stub)
1775 .set_iam_policy_repo(self.0.request, self.0.options)
1776 .await
1777 .map(crate::Response::into_body)
1778 }
1779
1780 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1784 self.0.request.resource = v.into();
1785 self
1786 }
1787
1788 pub fn set_policy<T>(mut self, v: T) -> Self
1792 where
1793 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1794 {
1795 self.0.request.policy = std::option::Option::Some(v.into());
1796 self
1797 }
1798
1799 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1803 where
1804 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1805 {
1806 self.0.request.policy = v.map(|x| x.into());
1807 self
1808 }
1809
1810 pub fn set_update_mask<T>(mut self, v: T) -> Self
1812 where
1813 T: std::convert::Into<wkt::FieldMask>,
1814 {
1815 self.0.request.update_mask = std::option::Option::Some(v.into());
1816 self
1817 }
1818
1819 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1821 where
1822 T: std::convert::Into<wkt::FieldMask>,
1823 {
1824 self.0.request.update_mask = v.map(|x| x.into());
1825 self
1826 }
1827 }
1828
1829 #[doc(hidden)]
1830 impl crate::RequestBuilder for SetIamPolicyRepo {
1831 fn request_options(&mut self) -> &mut crate::RequestOptions {
1832 &mut self.0.options
1833 }
1834 }
1835
1836 #[derive(Clone, Debug)]
1853 pub struct TestIamPermissionsRepo(
1854 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1855 );
1856
1857 impl TestIamPermissionsRepo {
1858 pub(crate) fn new(
1859 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1860 ) -> Self {
1861 Self(RequestBuilder::new(stub))
1862 }
1863
1864 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1866 mut self,
1867 v: V,
1868 ) -> Self {
1869 self.0.request = v.into();
1870 self
1871 }
1872
1873 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1875 self.0.options = v.into();
1876 self
1877 }
1878
1879 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1881 (*self.0.stub)
1882 .test_iam_permissions_repo(self.0.request, self.0.options)
1883 .await
1884 .map(crate::Response::into_body)
1885 }
1886
1887 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1891 self.0.request.resource = v.into();
1892 self
1893 }
1894
1895 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1899 where
1900 T: std::iter::IntoIterator<Item = V>,
1901 V: std::convert::Into<std::string::String>,
1902 {
1903 use std::iter::Iterator;
1904 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1905 self
1906 }
1907 }
1908
1909 #[doc(hidden)]
1910 impl crate::RequestBuilder for TestIamPermissionsRepo {
1911 fn request_options(&mut self) -> &mut crate::RequestOptions {
1912 &mut self.0.options
1913 }
1914 }
1915
1916 #[derive(Clone, Debug)]
1934 pub struct CreateBranchRule(RequestBuilder<crate::model::CreateBranchRuleRequest>);
1935
1936 impl CreateBranchRule {
1937 pub(crate) fn new(
1938 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1939 ) -> Self {
1940 Self(RequestBuilder::new(stub))
1941 }
1942
1943 pub fn with_request<V: Into<crate::model::CreateBranchRuleRequest>>(
1945 mut self,
1946 v: V,
1947 ) -> Self {
1948 self.0.request = v.into();
1949 self
1950 }
1951
1952 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1954 self.0.options = v.into();
1955 self
1956 }
1957
1958 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1965 (*self.0.stub)
1966 .create_branch_rule(self.0.request, self.0.options)
1967 .await
1968 .map(crate::Response::into_body)
1969 }
1970
1971 pub fn poller(
1973 self,
1974 ) -> impl google_cloud_lro::Poller<crate::model::BranchRule, crate::model::OperationMetadata>
1975 {
1976 type Operation = google_cloud_lro::internal::Operation<
1977 crate::model::BranchRule,
1978 crate::model::OperationMetadata,
1979 >;
1980 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1981 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1982
1983 let stub = self.0.stub.clone();
1984 let mut options = self.0.options.clone();
1985 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1986 let query = move |name| {
1987 let stub = stub.clone();
1988 let options = options.clone();
1989 async {
1990 let op = GetOperation::new(stub)
1991 .set_name(name)
1992 .with_options(options)
1993 .send()
1994 .await?;
1995 Ok(Operation::new(op))
1996 }
1997 };
1998
1999 let start = move || async {
2000 let op = self.send().await?;
2001 Ok(Operation::new(op))
2002 };
2003
2004 google_cloud_lro::internal::new_poller(
2005 polling_error_policy,
2006 polling_backoff_policy,
2007 start,
2008 query,
2009 )
2010 }
2011
2012 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2016 self.0.request.parent = v.into();
2017 self
2018 }
2019
2020 pub fn set_branch_rule<T>(mut self, v: T) -> Self
2024 where
2025 T: std::convert::Into<crate::model::BranchRule>,
2026 {
2027 self.0.request.branch_rule = std::option::Option::Some(v.into());
2028 self
2029 }
2030
2031 pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
2035 where
2036 T: std::convert::Into<crate::model::BranchRule>,
2037 {
2038 self.0.request.branch_rule = v.map(|x| x.into());
2039 self
2040 }
2041
2042 pub fn set_branch_rule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2046 self.0.request.branch_rule_id = v.into();
2047 self
2048 }
2049 }
2050
2051 #[doc(hidden)]
2052 impl crate::RequestBuilder for CreateBranchRule {
2053 fn request_options(&mut self) -> &mut crate::RequestOptions {
2054 &mut self.0.options
2055 }
2056 }
2057
2058 #[derive(Clone, Debug)]
2079 pub struct ListBranchRules(RequestBuilder<crate::model::ListBranchRulesRequest>);
2080
2081 impl ListBranchRules {
2082 pub(crate) fn new(
2083 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2084 ) -> Self {
2085 Self(RequestBuilder::new(stub))
2086 }
2087
2088 pub fn with_request<V: Into<crate::model::ListBranchRulesRequest>>(mut self, v: V) -> Self {
2090 self.0.request = v.into();
2091 self
2092 }
2093
2094 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2096 self.0.options = v.into();
2097 self
2098 }
2099
2100 pub async fn send(self) -> Result<crate::model::ListBranchRulesResponse> {
2102 (*self.0.stub)
2103 .list_branch_rules(self.0.request, self.0.options)
2104 .await
2105 .map(crate::Response::into_body)
2106 }
2107
2108 pub fn by_page(
2110 self,
2111 ) -> impl google_cloud_gax::paginator::Paginator<
2112 crate::model::ListBranchRulesResponse,
2113 crate::Error,
2114 > {
2115 use std::clone::Clone;
2116 let token = self.0.request.page_token.clone();
2117 let execute = move |token: String| {
2118 let mut builder = self.clone();
2119 builder.0.request = builder.0.request.set_page_token(token);
2120 builder.send()
2121 };
2122 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2123 }
2124
2125 pub fn by_item(
2127 self,
2128 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2129 crate::model::ListBranchRulesResponse,
2130 crate::Error,
2131 > {
2132 use google_cloud_gax::paginator::Paginator;
2133 self.by_page().items()
2134 }
2135
2136 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2140 self.0.request.parent = v.into();
2141 self
2142 }
2143
2144 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2146 self.0.request.page_size = v.into();
2147 self
2148 }
2149
2150 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2152 self.0.request.page_token = v.into();
2153 self
2154 }
2155 }
2156
2157 #[doc(hidden)]
2158 impl crate::RequestBuilder for ListBranchRules {
2159 fn request_options(&mut self) -> &mut crate::RequestOptions {
2160 &mut self.0.options
2161 }
2162 }
2163
2164 #[derive(Clone, Debug)]
2181 pub struct GetBranchRule(RequestBuilder<crate::model::GetBranchRuleRequest>);
2182
2183 impl GetBranchRule {
2184 pub(crate) fn new(
2185 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2186 ) -> Self {
2187 Self(RequestBuilder::new(stub))
2188 }
2189
2190 pub fn with_request<V: Into<crate::model::GetBranchRuleRequest>>(mut self, v: V) -> Self {
2192 self.0.request = v.into();
2193 self
2194 }
2195
2196 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2198 self.0.options = v.into();
2199 self
2200 }
2201
2202 pub async fn send(self) -> Result<crate::model::BranchRule> {
2204 (*self.0.stub)
2205 .get_branch_rule(self.0.request, self.0.options)
2206 .await
2207 .map(crate::Response::into_body)
2208 }
2209
2210 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2214 self.0.request.name = v.into();
2215 self
2216 }
2217 }
2218
2219 #[doc(hidden)]
2220 impl crate::RequestBuilder for GetBranchRule {
2221 fn request_options(&mut self) -> &mut crate::RequestOptions {
2222 &mut self.0.options
2223 }
2224 }
2225
2226 #[derive(Clone, Debug)]
2244 pub struct UpdateBranchRule(RequestBuilder<crate::model::UpdateBranchRuleRequest>);
2245
2246 impl UpdateBranchRule {
2247 pub(crate) fn new(
2248 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2249 ) -> Self {
2250 Self(RequestBuilder::new(stub))
2251 }
2252
2253 pub fn with_request<V: Into<crate::model::UpdateBranchRuleRequest>>(
2255 mut self,
2256 v: V,
2257 ) -> Self {
2258 self.0.request = v.into();
2259 self
2260 }
2261
2262 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2264 self.0.options = v.into();
2265 self
2266 }
2267
2268 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2275 (*self.0.stub)
2276 .update_branch_rule(self.0.request, self.0.options)
2277 .await
2278 .map(crate::Response::into_body)
2279 }
2280
2281 pub fn poller(
2283 self,
2284 ) -> impl google_cloud_lro::Poller<crate::model::BranchRule, crate::model::OperationMetadata>
2285 {
2286 type Operation = google_cloud_lro::internal::Operation<
2287 crate::model::BranchRule,
2288 crate::model::OperationMetadata,
2289 >;
2290 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2291 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2292
2293 let stub = self.0.stub.clone();
2294 let mut options = self.0.options.clone();
2295 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2296 let query = move |name| {
2297 let stub = stub.clone();
2298 let options = options.clone();
2299 async {
2300 let op = GetOperation::new(stub)
2301 .set_name(name)
2302 .with_options(options)
2303 .send()
2304 .await?;
2305 Ok(Operation::new(op))
2306 }
2307 };
2308
2309 let start = move || async {
2310 let op = self.send().await?;
2311 Ok(Operation::new(op))
2312 };
2313
2314 google_cloud_lro::internal::new_poller(
2315 polling_error_policy,
2316 polling_backoff_policy,
2317 start,
2318 query,
2319 )
2320 }
2321
2322 pub fn set_branch_rule<T>(mut self, v: T) -> Self
2326 where
2327 T: std::convert::Into<crate::model::BranchRule>,
2328 {
2329 self.0.request.branch_rule = std::option::Option::Some(v.into());
2330 self
2331 }
2332
2333 pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
2337 where
2338 T: std::convert::Into<crate::model::BranchRule>,
2339 {
2340 self.0.request.branch_rule = v.map(|x| x.into());
2341 self
2342 }
2343
2344 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2346 self.0.request.validate_only = v.into();
2347 self
2348 }
2349
2350 pub fn set_update_mask<T>(mut self, v: T) -> Self
2352 where
2353 T: std::convert::Into<wkt::FieldMask>,
2354 {
2355 self.0.request.update_mask = std::option::Option::Some(v.into());
2356 self
2357 }
2358
2359 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2361 where
2362 T: std::convert::Into<wkt::FieldMask>,
2363 {
2364 self.0.request.update_mask = v.map(|x| x.into());
2365 self
2366 }
2367 }
2368
2369 #[doc(hidden)]
2370 impl crate::RequestBuilder for UpdateBranchRule {
2371 fn request_options(&mut self) -> &mut crate::RequestOptions {
2372 &mut self.0.options
2373 }
2374 }
2375
2376 #[derive(Clone, Debug)]
2394 pub struct DeleteBranchRule(RequestBuilder<crate::model::DeleteBranchRuleRequest>);
2395
2396 impl DeleteBranchRule {
2397 pub(crate) fn new(
2398 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2399 ) -> Self {
2400 Self(RequestBuilder::new(stub))
2401 }
2402
2403 pub fn with_request<V: Into<crate::model::DeleteBranchRuleRequest>>(
2405 mut self,
2406 v: V,
2407 ) -> Self {
2408 self.0.request = v.into();
2409 self
2410 }
2411
2412 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2414 self.0.options = v.into();
2415 self
2416 }
2417
2418 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2425 (*self.0.stub)
2426 .delete_branch_rule(self.0.request, self.0.options)
2427 .await
2428 .map(crate::Response::into_body)
2429 }
2430
2431 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2433 type Operation =
2434 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2435 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2436 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2437
2438 let stub = self.0.stub.clone();
2439 let mut options = self.0.options.clone();
2440 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2441 let query = move |name| {
2442 let stub = stub.clone();
2443 let options = options.clone();
2444 async {
2445 let op = GetOperation::new(stub)
2446 .set_name(name)
2447 .with_options(options)
2448 .send()
2449 .await?;
2450 Ok(Operation::new(op))
2451 }
2452 };
2453
2454 let start = move || async {
2455 let op = self.send().await?;
2456 Ok(Operation::new(op))
2457 };
2458
2459 google_cloud_lro::internal::new_unit_response_poller(
2460 polling_error_policy,
2461 polling_backoff_policy,
2462 start,
2463 query,
2464 )
2465 }
2466
2467 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2471 self.0.request.name = v.into();
2472 self
2473 }
2474
2475 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2477 self.0.request.allow_missing = v.into();
2478 self
2479 }
2480 }
2481
2482 #[doc(hidden)]
2483 impl crate::RequestBuilder for DeleteBranchRule {
2484 fn request_options(&mut self) -> &mut crate::RequestOptions {
2485 &mut self.0.options
2486 }
2487 }
2488
2489 #[derive(Clone, Debug)]
2507 pub struct CreatePullRequest(RequestBuilder<crate::model::CreatePullRequestRequest>);
2508
2509 impl CreatePullRequest {
2510 pub(crate) fn new(
2511 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2512 ) -> Self {
2513 Self(RequestBuilder::new(stub))
2514 }
2515
2516 pub fn with_request<V: Into<crate::model::CreatePullRequestRequest>>(
2518 mut self,
2519 v: V,
2520 ) -> Self {
2521 self.0.request = v.into();
2522 self
2523 }
2524
2525 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2527 self.0.options = v.into();
2528 self
2529 }
2530
2531 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2538 (*self.0.stub)
2539 .create_pull_request(self.0.request, self.0.options)
2540 .await
2541 .map(crate::Response::into_body)
2542 }
2543
2544 pub fn poller(
2546 self,
2547 ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
2548 {
2549 type Operation = google_cloud_lro::internal::Operation<
2550 crate::model::PullRequest,
2551 crate::model::OperationMetadata,
2552 >;
2553 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2554 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2555
2556 let stub = self.0.stub.clone();
2557 let mut options = self.0.options.clone();
2558 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2559 let query = move |name| {
2560 let stub = stub.clone();
2561 let options = options.clone();
2562 async {
2563 let op = GetOperation::new(stub)
2564 .set_name(name)
2565 .with_options(options)
2566 .send()
2567 .await?;
2568 Ok(Operation::new(op))
2569 }
2570 };
2571
2572 let start = move || async {
2573 let op = self.send().await?;
2574 Ok(Operation::new(op))
2575 };
2576
2577 google_cloud_lro::internal::new_poller(
2578 polling_error_policy,
2579 polling_backoff_policy,
2580 start,
2581 query,
2582 )
2583 }
2584
2585 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2589 self.0.request.parent = v.into();
2590 self
2591 }
2592
2593 pub fn set_pull_request<T>(mut self, v: T) -> Self
2597 where
2598 T: std::convert::Into<crate::model::PullRequest>,
2599 {
2600 self.0.request.pull_request = std::option::Option::Some(v.into());
2601 self
2602 }
2603
2604 pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
2608 where
2609 T: std::convert::Into<crate::model::PullRequest>,
2610 {
2611 self.0.request.pull_request = v.map(|x| x.into());
2612 self
2613 }
2614 }
2615
2616 #[doc(hidden)]
2617 impl crate::RequestBuilder for CreatePullRequest {
2618 fn request_options(&mut self) -> &mut crate::RequestOptions {
2619 &mut self.0.options
2620 }
2621 }
2622
2623 #[derive(Clone, Debug)]
2640 pub struct GetPullRequest(RequestBuilder<crate::model::GetPullRequestRequest>);
2641
2642 impl GetPullRequest {
2643 pub(crate) fn new(
2644 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2645 ) -> Self {
2646 Self(RequestBuilder::new(stub))
2647 }
2648
2649 pub fn with_request<V: Into<crate::model::GetPullRequestRequest>>(mut self, v: V) -> Self {
2651 self.0.request = v.into();
2652 self
2653 }
2654
2655 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2657 self.0.options = v.into();
2658 self
2659 }
2660
2661 pub async fn send(self) -> Result<crate::model::PullRequest> {
2663 (*self.0.stub)
2664 .get_pull_request(self.0.request, self.0.options)
2665 .await
2666 .map(crate::Response::into_body)
2667 }
2668
2669 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2673 self.0.request.name = v.into();
2674 self
2675 }
2676 }
2677
2678 #[doc(hidden)]
2679 impl crate::RequestBuilder for GetPullRequest {
2680 fn request_options(&mut self) -> &mut crate::RequestOptions {
2681 &mut self.0.options
2682 }
2683 }
2684
2685 #[derive(Clone, Debug)]
2706 pub struct ListPullRequests(RequestBuilder<crate::model::ListPullRequestsRequest>);
2707
2708 impl ListPullRequests {
2709 pub(crate) fn new(
2710 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2711 ) -> Self {
2712 Self(RequestBuilder::new(stub))
2713 }
2714
2715 pub fn with_request<V: Into<crate::model::ListPullRequestsRequest>>(
2717 mut self,
2718 v: V,
2719 ) -> Self {
2720 self.0.request = v.into();
2721 self
2722 }
2723
2724 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2726 self.0.options = v.into();
2727 self
2728 }
2729
2730 pub async fn send(self) -> Result<crate::model::ListPullRequestsResponse> {
2732 (*self.0.stub)
2733 .list_pull_requests(self.0.request, self.0.options)
2734 .await
2735 .map(crate::Response::into_body)
2736 }
2737
2738 pub fn by_page(
2740 self,
2741 ) -> impl google_cloud_gax::paginator::Paginator<
2742 crate::model::ListPullRequestsResponse,
2743 crate::Error,
2744 > {
2745 use std::clone::Clone;
2746 let token = self.0.request.page_token.clone();
2747 let execute = move |token: String| {
2748 let mut builder = self.clone();
2749 builder.0.request = builder.0.request.set_page_token(token);
2750 builder.send()
2751 };
2752 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2753 }
2754
2755 pub fn by_item(
2757 self,
2758 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2759 crate::model::ListPullRequestsResponse,
2760 crate::Error,
2761 > {
2762 use google_cloud_gax::paginator::Paginator;
2763 self.by_page().items()
2764 }
2765
2766 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2770 self.0.request.parent = v.into();
2771 self
2772 }
2773
2774 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2776 self.0.request.page_size = v.into();
2777 self
2778 }
2779
2780 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2782 self.0.request.page_token = v.into();
2783 self
2784 }
2785 }
2786
2787 #[doc(hidden)]
2788 impl crate::RequestBuilder for ListPullRequests {
2789 fn request_options(&mut self) -> &mut crate::RequestOptions {
2790 &mut self.0.options
2791 }
2792 }
2793
2794 #[derive(Clone, Debug)]
2812 pub struct UpdatePullRequest(RequestBuilder<crate::model::UpdatePullRequestRequest>);
2813
2814 impl UpdatePullRequest {
2815 pub(crate) fn new(
2816 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2817 ) -> Self {
2818 Self(RequestBuilder::new(stub))
2819 }
2820
2821 pub fn with_request<V: Into<crate::model::UpdatePullRequestRequest>>(
2823 mut self,
2824 v: V,
2825 ) -> Self {
2826 self.0.request = v.into();
2827 self
2828 }
2829
2830 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2832 self.0.options = v.into();
2833 self
2834 }
2835
2836 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2843 (*self.0.stub)
2844 .update_pull_request(self.0.request, self.0.options)
2845 .await
2846 .map(crate::Response::into_body)
2847 }
2848
2849 pub fn poller(
2851 self,
2852 ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
2853 {
2854 type Operation = google_cloud_lro::internal::Operation<
2855 crate::model::PullRequest,
2856 crate::model::OperationMetadata,
2857 >;
2858 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2859 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2860
2861 let stub = self.0.stub.clone();
2862 let mut options = self.0.options.clone();
2863 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2864 let query = move |name| {
2865 let stub = stub.clone();
2866 let options = options.clone();
2867 async {
2868 let op = GetOperation::new(stub)
2869 .set_name(name)
2870 .with_options(options)
2871 .send()
2872 .await?;
2873 Ok(Operation::new(op))
2874 }
2875 };
2876
2877 let start = move || async {
2878 let op = self.send().await?;
2879 Ok(Operation::new(op))
2880 };
2881
2882 google_cloud_lro::internal::new_poller(
2883 polling_error_policy,
2884 polling_backoff_policy,
2885 start,
2886 query,
2887 )
2888 }
2889
2890 pub fn set_pull_request<T>(mut self, v: T) -> Self
2894 where
2895 T: std::convert::Into<crate::model::PullRequest>,
2896 {
2897 self.0.request.pull_request = std::option::Option::Some(v.into());
2898 self
2899 }
2900
2901 pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
2905 where
2906 T: std::convert::Into<crate::model::PullRequest>,
2907 {
2908 self.0.request.pull_request = v.map(|x| x.into());
2909 self
2910 }
2911
2912 pub fn set_update_mask<T>(mut self, v: T) -> Self
2914 where
2915 T: std::convert::Into<wkt::FieldMask>,
2916 {
2917 self.0.request.update_mask = std::option::Option::Some(v.into());
2918 self
2919 }
2920
2921 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2923 where
2924 T: std::convert::Into<wkt::FieldMask>,
2925 {
2926 self.0.request.update_mask = v.map(|x| x.into());
2927 self
2928 }
2929 }
2930
2931 #[doc(hidden)]
2932 impl crate::RequestBuilder for UpdatePullRequest {
2933 fn request_options(&mut self) -> &mut crate::RequestOptions {
2934 &mut self.0.options
2935 }
2936 }
2937
2938 #[derive(Clone, Debug)]
2956 pub struct MergePullRequest(RequestBuilder<crate::model::MergePullRequestRequest>);
2957
2958 impl MergePullRequest {
2959 pub(crate) fn new(
2960 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2961 ) -> Self {
2962 Self(RequestBuilder::new(stub))
2963 }
2964
2965 pub fn with_request<V: Into<crate::model::MergePullRequestRequest>>(
2967 mut self,
2968 v: V,
2969 ) -> Self {
2970 self.0.request = v.into();
2971 self
2972 }
2973
2974 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2976 self.0.options = v.into();
2977 self
2978 }
2979
2980 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2987 (*self.0.stub)
2988 .merge_pull_request(self.0.request, self.0.options)
2989 .await
2990 .map(crate::Response::into_body)
2991 }
2992
2993 pub fn poller(
2995 self,
2996 ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
2997 {
2998 type Operation = google_cloud_lro::internal::Operation<
2999 crate::model::PullRequest,
3000 crate::model::OperationMetadata,
3001 >;
3002 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3003 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3004
3005 let stub = self.0.stub.clone();
3006 let mut options = self.0.options.clone();
3007 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3008 let query = move |name| {
3009 let stub = stub.clone();
3010 let options = options.clone();
3011 async {
3012 let op = GetOperation::new(stub)
3013 .set_name(name)
3014 .with_options(options)
3015 .send()
3016 .await?;
3017 Ok(Operation::new(op))
3018 }
3019 };
3020
3021 let start = move || async {
3022 let op = self.send().await?;
3023 Ok(Operation::new(op))
3024 };
3025
3026 google_cloud_lro::internal::new_poller(
3027 polling_error_policy,
3028 polling_backoff_policy,
3029 start,
3030 query,
3031 )
3032 }
3033
3034 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3038 self.0.request.name = v.into();
3039 self
3040 }
3041 }
3042
3043 #[doc(hidden)]
3044 impl crate::RequestBuilder for MergePullRequest {
3045 fn request_options(&mut self) -> &mut crate::RequestOptions {
3046 &mut self.0.options
3047 }
3048 }
3049
3050 #[derive(Clone, Debug)]
3068 pub struct OpenPullRequest(RequestBuilder<crate::model::OpenPullRequestRequest>);
3069
3070 impl OpenPullRequest {
3071 pub(crate) fn new(
3072 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3073 ) -> Self {
3074 Self(RequestBuilder::new(stub))
3075 }
3076
3077 pub fn with_request<V: Into<crate::model::OpenPullRequestRequest>>(mut self, v: V) -> Self {
3079 self.0.request = v.into();
3080 self
3081 }
3082
3083 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3085 self.0.options = v.into();
3086 self
3087 }
3088
3089 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3096 (*self.0.stub)
3097 .open_pull_request(self.0.request, self.0.options)
3098 .await
3099 .map(crate::Response::into_body)
3100 }
3101
3102 pub fn poller(
3104 self,
3105 ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
3106 {
3107 type Operation = google_cloud_lro::internal::Operation<
3108 crate::model::PullRequest,
3109 crate::model::OperationMetadata,
3110 >;
3111 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3112 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3113
3114 let stub = self.0.stub.clone();
3115 let mut options = self.0.options.clone();
3116 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3117 let query = move |name| {
3118 let stub = stub.clone();
3119 let options = options.clone();
3120 async {
3121 let op = GetOperation::new(stub)
3122 .set_name(name)
3123 .with_options(options)
3124 .send()
3125 .await?;
3126 Ok(Operation::new(op))
3127 }
3128 };
3129
3130 let start = move || async {
3131 let op = self.send().await?;
3132 Ok(Operation::new(op))
3133 };
3134
3135 google_cloud_lro::internal::new_poller(
3136 polling_error_policy,
3137 polling_backoff_policy,
3138 start,
3139 query,
3140 )
3141 }
3142
3143 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3147 self.0.request.name = v.into();
3148 self
3149 }
3150 }
3151
3152 #[doc(hidden)]
3153 impl crate::RequestBuilder for OpenPullRequest {
3154 fn request_options(&mut self) -> &mut crate::RequestOptions {
3155 &mut self.0.options
3156 }
3157 }
3158
3159 #[derive(Clone, Debug)]
3177 pub struct ClosePullRequest(RequestBuilder<crate::model::ClosePullRequestRequest>);
3178
3179 impl ClosePullRequest {
3180 pub(crate) fn new(
3181 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3182 ) -> Self {
3183 Self(RequestBuilder::new(stub))
3184 }
3185
3186 pub fn with_request<V: Into<crate::model::ClosePullRequestRequest>>(
3188 mut self,
3189 v: V,
3190 ) -> Self {
3191 self.0.request = v.into();
3192 self
3193 }
3194
3195 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3197 self.0.options = v.into();
3198 self
3199 }
3200
3201 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3208 (*self.0.stub)
3209 .close_pull_request(self.0.request, self.0.options)
3210 .await
3211 .map(crate::Response::into_body)
3212 }
3213
3214 pub fn poller(
3216 self,
3217 ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
3218 {
3219 type Operation = google_cloud_lro::internal::Operation<
3220 crate::model::PullRequest,
3221 crate::model::OperationMetadata,
3222 >;
3223 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3224 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3225
3226 let stub = self.0.stub.clone();
3227 let mut options = self.0.options.clone();
3228 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3229 let query = move |name| {
3230 let stub = stub.clone();
3231 let options = options.clone();
3232 async {
3233 let op = GetOperation::new(stub)
3234 .set_name(name)
3235 .with_options(options)
3236 .send()
3237 .await?;
3238 Ok(Operation::new(op))
3239 }
3240 };
3241
3242 let start = move || async {
3243 let op = self.send().await?;
3244 Ok(Operation::new(op))
3245 };
3246
3247 google_cloud_lro::internal::new_poller(
3248 polling_error_policy,
3249 polling_backoff_policy,
3250 start,
3251 query,
3252 )
3253 }
3254
3255 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3259 self.0.request.name = v.into();
3260 self
3261 }
3262 }
3263
3264 #[doc(hidden)]
3265 impl crate::RequestBuilder for ClosePullRequest {
3266 fn request_options(&mut self) -> &mut crate::RequestOptions {
3267 &mut self.0.options
3268 }
3269 }
3270
3271 #[derive(Clone, Debug)]
3292 pub struct ListPullRequestFileDiffs(
3293 RequestBuilder<crate::model::ListPullRequestFileDiffsRequest>,
3294 );
3295
3296 impl ListPullRequestFileDiffs {
3297 pub(crate) fn new(
3298 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3299 ) -> Self {
3300 Self(RequestBuilder::new(stub))
3301 }
3302
3303 pub fn with_request<V: Into<crate::model::ListPullRequestFileDiffsRequest>>(
3305 mut self,
3306 v: V,
3307 ) -> Self {
3308 self.0.request = v.into();
3309 self
3310 }
3311
3312 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3314 self.0.options = v.into();
3315 self
3316 }
3317
3318 pub async fn send(self) -> Result<crate::model::ListPullRequestFileDiffsResponse> {
3320 (*self.0.stub)
3321 .list_pull_request_file_diffs(self.0.request, self.0.options)
3322 .await
3323 .map(crate::Response::into_body)
3324 }
3325
3326 pub fn by_page(
3328 self,
3329 ) -> impl google_cloud_gax::paginator::Paginator<
3330 crate::model::ListPullRequestFileDiffsResponse,
3331 crate::Error,
3332 > {
3333 use std::clone::Clone;
3334 let token = self.0.request.page_token.clone();
3335 let execute = move |token: String| {
3336 let mut builder = self.clone();
3337 builder.0.request = builder.0.request.set_page_token(token);
3338 builder.send()
3339 };
3340 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3341 }
3342
3343 pub fn by_item(
3345 self,
3346 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3347 crate::model::ListPullRequestFileDiffsResponse,
3348 crate::Error,
3349 > {
3350 use google_cloud_gax::paginator::Paginator;
3351 self.by_page().items()
3352 }
3353
3354 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3358 self.0.request.name = v.into();
3359 self
3360 }
3361
3362 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3364 self.0.request.page_size = v.into();
3365 self
3366 }
3367
3368 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3370 self.0.request.page_token = v.into();
3371 self
3372 }
3373 }
3374
3375 #[doc(hidden)]
3376 impl crate::RequestBuilder for ListPullRequestFileDiffs {
3377 fn request_options(&mut self) -> &mut crate::RequestOptions {
3378 &mut self.0.options
3379 }
3380 }
3381
3382 #[derive(Clone, Debug)]
3403 pub struct FetchTree(RequestBuilder<crate::model::FetchTreeRequest>);
3404
3405 impl FetchTree {
3406 pub(crate) fn new(
3407 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3408 ) -> Self {
3409 Self(RequestBuilder::new(stub))
3410 }
3411
3412 pub fn with_request<V: Into<crate::model::FetchTreeRequest>>(mut self, v: V) -> Self {
3414 self.0.request = v.into();
3415 self
3416 }
3417
3418 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3420 self.0.options = v.into();
3421 self
3422 }
3423
3424 pub async fn send(self) -> Result<crate::model::FetchTreeResponse> {
3426 (*self.0.stub)
3427 .fetch_tree(self.0.request, self.0.options)
3428 .await
3429 .map(crate::Response::into_body)
3430 }
3431
3432 pub fn by_page(
3434 self,
3435 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::FetchTreeResponse, crate::Error>
3436 {
3437 use std::clone::Clone;
3438 let token = self.0.request.page_token.clone();
3439 let execute = move |token: String| {
3440 let mut builder = self.clone();
3441 builder.0.request = builder.0.request.set_page_token(token);
3442 builder.send()
3443 };
3444 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3445 }
3446
3447 pub fn by_item(
3449 self,
3450 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::FetchTreeResponse, crate::Error>
3451 {
3452 use google_cloud_gax::paginator::Paginator;
3453 self.by_page().items()
3454 }
3455
3456 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
3460 self.0.request.repository = v.into();
3461 self
3462 }
3463
3464 pub fn set_ref<T: Into<std::string::String>>(mut self, v: T) -> Self {
3466 self.0.request.r#ref = v.into();
3467 self
3468 }
3469
3470 pub fn set_recursive<T: Into<bool>>(mut self, v: T) -> Self {
3472 self.0.request.recursive = v.into();
3473 self
3474 }
3475
3476 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3478 self.0.request.page_size = v.into();
3479 self
3480 }
3481
3482 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3484 self.0.request.page_token = v.into();
3485 self
3486 }
3487 }
3488
3489 #[doc(hidden)]
3490 impl crate::RequestBuilder for FetchTree {
3491 fn request_options(&mut self) -> &mut crate::RequestOptions {
3492 &mut self.0.options
3493 }
3494 }
3495
3496 #[derive(Clone, Debug)]
3513 pub struct FetchBlob(RequestBuilder<crate::model::FetchBlobRequest>);
3514
3515 impl FetchBlob {
3516 pub(crate) fn new(
3517 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3518 ) -> Self {
3519 Self(RequestBuilder::new(stub))
3520 }
3521
3522 pub fn with_request<V: Into<crate::model::FetchBlobRequest>>(mut self, v: V) -> Self {
3524 self.0.request = v.into();
3525 self
3526 }
3527
3528 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3530 self.0.options = v.into();
3531 self
3532 }
3533
3534 pub async fn send(self) -> Result<crate::model::FetchBlobResponse> {
3536 (*self.0.stub)
3537 .fetch_blob(self.0.request, self.0.options)
3538 .await
3539 .map(crate::Response::into_body)
3540 }
3541
3542 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
3546 self.0.request.repository = v.into();
3547 self
3548 }
3549
3550 pub fn set_sha<T: Into<std::string::String>>(mut self, v: T) -> Self {
3554 self.0.request.sha = v.into();
3555 self
3556 }
3557 }
3558
3559 #[doc(hidden)]
3560 impl crate::RequestBuilder for FetchBlob {
3561 fn request_options(&mut self) -> &mut crate::RequestOptions {
3562 &mut self.0.options
3563 }
3564 }
3565
3566 #[derive(Clone, Debug)]
3584 pub struct CreateIssue(RequestBuilder<crate::model::CreateIssueRequest>);
3585
3586 impl CreateIssue {
3587 pub(crate) fn new(
3588 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3589 ) -> Self {
3590 Self(RequestBuilder::new(stub))
3591 }
3592
3593 pub fn with_request<V: Into<crate::model::CreateIssueRequest>>(mut self, v: V) -> Self {
3595 self.0.request = v.into();
3596 self
3597 }
3598
3599 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3601 self.0.options = v.into();
3602 self
3603 }
3604
3605 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3612 (*self.0.stub)
3613 .create_issue(self.0.request, self.0.options)
3614 .await
3615 .map(crate::Response::into_body)
3616 }
3617
3618 pub fn poller(
3620 self,
3621 ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
3622 {
3623 type Operation = google_cloud_lro::internal::Operation<
3624 crate::model::Issue,
3625 crate::model::OperationMetadata,
3626 >;
3627 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3628 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3629
3630 let stub = self.0.stub.clone();
3631 let mut options = self.0.options.clone();
3632 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3633 let query = move |name| {
3634 let stub = stub.clone();
3635 let options = options.clone();
3636 async {
3637 let op = GetOperation::new(stub)
3638 .set_name(name)
3639 .with_options(options)
3640 .send()
3641 .await?;
3642 Ok(Operation::new(op))
3643 }
3644 };
3645
3646 let start = move || async {
3647 let op = self.send().await?;
3648 Ok(Operation::new(op))
3649 };
3650
3651 google_cloud_lro::internal::new_poller(
3652 polling_error_policy,
3653 polling_backoff_policy,
3654 start,
3655 query,
3656 )
3657 }
3658
3659 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3663 self.0.request.parent = v.into();
3664 self
3665 }
3666
3667 pub fn set_issue<T>(mut self, v: T) -> Self
3671 where
3672 T: std::convert::Into<crate::model::Issue>,
3673 {
3674 self.0.request.issue = std::option::Option::Some(v.into());
3675 self
3676 }
3677
3678 pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
3682 where
3683 T: std::convert::Into<crate::model::Issue>,
3684 {
3685 self.0.request.issue = v.map(|x| x.into());
3686 self
3687 }
3688 }
3689
3690 #[doc(hidden)]
3691 impl crate::RequestBuilder for CreateIssue {
3692 fn request_options(&mut self) -> &mut crate::RequestOptions {
3693 &mut self.0.options
3694 }
3695 }
3696
3697 #[derive(Clone, Debug)]
3714 pub struct GetIssue(RequestBuilder<crate::model::GetIssueRequest>);
3715
3716 impl GetIssue {
3717 pub(crate) fn new(
3718 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3719 ) -> Self {
3720 Self(RequestBuilder::new(stub))
3721 }
3722
3723 pub fn with_request<V: Into<crate::model::GetIssueRequest>>(mut self, v: V) -> Self {
3725 self.0.request = v.into();
3726 self
3727 }
3728
3729 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3731 self.0.options = v.into();
3732 self
3733 }
3734
3735 pub async fn send(self) -> Result<crate::model::Issue> {
3737 (*self.0.stub)
3738 .get_issue(self.0.request, self.0.options)
3739 .await
3740 .map(crate::Response::into_body)
3741 }
3742
3743 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3747 self.0.request.name = v.into();
3748 self
3749 }
3750 }
3751
3752 #[doc(hidden)]
3753 impl crate::RequestBuilder for GetIssue {
3754 fn request_options(&mut self) -> &mut crate::RequestOptions {
3755 &mut self.0.options
3756 }
3757 }
3758
3759 #[derive(Clone, Debug)]
3780 pub struct ListIssues(RequestBuilder<crate::model::ListIssuesRequest>);
3781
3782 impl ListIssues {
3783 pub(crate) fn new(
3784 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3785 ) -> Self {
3786 Self(RequestBuilder::new(stub))
3787 }
3788
3789 pub fn with_request<V: Into<crate::model::ListIssuesRequest>>(mut self, v: V) -> Self {
3791 self.0.request = v.into();
3792 self
3793 }
3794
3795 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3797 self.0.options = v.into();
3798 self
3799 }
3800
3801 pub async fn send(self) -> Result<crate::model::ListIssuesResponse> {
3803 (*self.0.stub)
3804 .list_issues(self.0.request, self.0.options)
3805 .await
3806 .map(crate::Response::into_body)
3807 }
3808
3809 pub fn by_page(
3811 self,
3812 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListIssuesResponse, crate::Error>
3813 {
3814 use std::clone::Clone;
3815 let token = self.0.request.page_token.clone();
3816 let execute = move |token: String| {
3817 let mut builder = self.clone();
3818 builder.0.request = builder.0.request.set_page_token(token);
3819 builder.send()
3820 };
3821 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3822 }
3823
3824 pub fn by_item(
3826 self,
3827 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3828 crate::model::ListIssuesResponse,
3829 crate::Error,
3830 > {
3831 use google_cloud_gax::paginator::Paginator;
3832 self.by_page().items()
3833 }
3834
3835 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3839 self.0.request.parent = v.into();
3840 self
3841 }
3842
3843 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3845 self.0.request.page_size = v.into();
3846 self
3847 }
3848
3849 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3851 self.0.request.page_token = v.into();
3852 self
3853 }
3854
3855 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3857 self.0.request.filter = v.into();
3858 self
3859 }
3860 }
3861
3862 #[doc(hidden)]
3863 impl crate::RequestBuilder for ListIssues {
3864 fn request_options(&mut self) -> &mut crate::RequestOptions {
3865 &mut self.0.options
3866 }
3867 }
3868
3869 #[derive(Clone, Debug)]
3887 pub struct UpdateIssue(RequestBuilder<crate::model::UpdateIssueRequest>);
3888
3889 impl UpdateIssue {
3890 pub(crate) fn new(
3891 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3892 ) -> Self {
3893 Self(RequestBuilder::new(stub))
3894 }
3895
3896 pub fn with_request<V: Into<crate::model::UpdateIssueRequest>>(mut self, v: V) -> Self {
3898 self.0.request = v.into();
3899 self
3900 }
3901
3902 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3904 self.0.options = v.into();
3905 self
3906 }
3907
3908 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3915 (*self.0.stub)
3916 .update_issue(self.0.request, self.0.options)
3917 .await
3918 .map(crate::Response::into_body)
3919 }
3920
3921 pub fn poller(
3923 self,
3924 ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
3925 {
3926 type Operation = google_cloud_lro::internal::Operation<
3927 crate::model::Issue,
3928 crate::model::OperationMetadata,
3929 >;
3930 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3931 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3932
3933 let stub = self.0.stub.clone();
3934 let mut options = self.0.options.clone();
3935 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3936 let query = move |name| {
3937 let stub = stub.clone();
3938 let options = options.clone();
3939 async {
3940 let op = GetOperation::new(stub)
3941 .set_name(name)
3942 .with_options(options)
3943 .send()
3944 .await?;
3945 Ok(Operation::new(op))
3946 }
3947 };
3948
3949 let start = move || async {
3950 let op = self.send().await?;
3951 Ok(Operation::new(op))
3952 };
3953
3954 google_cloud_lro::internal::new_poller(
3955 polling_error_policy,
3956 polling_backoff_policy,
3957 start,
3958 query,
3959 )
3960 }
3961
3962 pub fn set_issue<T>(mut self, v: T) -> Self
3966 where
3967 T: std::convert::Into<crate::model::Issue>,
3968 {
3969 self.0.request.issue = std::option::Option::Some(v.into());
3970 self
3971 }
3972
3973 pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
3977 where
3978 T: std::convert::Into<crate::model::Issue>,
3979 {
3980 self.0.request.issue = v.map(|x| x.into());
3981 self
3982 }
3983
3984 pub fn set_update_mask<T>(mut self, v: T) -> Self
3986 where
3987 T: std::convert::Into<wkt::FieldMask>,
3988 {
3989 self.0.request.update_mask = std::option::Option::Some(v.into());
3990 self
3991 }
3992
3993 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3995 where
3996 T: std::convert::Into<wkt::FieldMask>,
3997 {
3998 self.0.request.update_mask = v.map(|x| x.into());
3999 self
4000 }
4001 }
4002
4003 #[doc(hidden)]
4004 impl crate::RequestBuilder for UpdateIssue {
4005 fn request_options(&mut self) -> &mut crate::RequestOptions {
4006 &mut self.0.options
4007 }
4008 }
4009
4010 #[derive(Clone, Debug)]
4028 pub struct DeleteIssue(RequestBuilder<crate::model::DeleteIssueRequest>);
4029
4030 impl DeleteIssue {
4031 pub(crate) fn new(
4032 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4033 ) -> Self {
4034 Self(RequestBuilder::new(stub))
4035 }
4036
4037 pub fn with_request<V: Into<crate::model::DeleteIssueRequest>>(mut self, v: V) -> Self {
4039 self.0.request = v.into();
4040 self
4041 }
4042
4043 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4045 self.0.options = v.into();
4046 self
4047 }
4048
4049 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4056 (*self.0.stub)
4057 .delete_issue(self.0.request, self.0.options)
4058 .await
4059 .map(crate::Response::into_body)
4060 }
4061
4062 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4064 type Operation =
4065 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4066 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4067 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4068
4069 let stub = self.0.stub.clone();
4070 let mut options = self.0.options.clone();
4071 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4072 let query = move |name| {
4073 let stub = stub.clone();
4074 let options = options.clone();
4075 async {
4076 let op = GetOperation::new(stub)
4077 .set_name(name)
4078 .with_options(options)
4079 .send()
4080 .await?;
4081 Ok(Operation::new(op))
4082 }
4083 };
4084
4085 let start = move || async {
4086 let op = self.send().await?;
4087 Ok(Operation::new(op))
4088 };
4089
4090 google_cloud_lro::internal::new_unit_response_poller(
4091 polling_error_policy,
4092 polling_backoff_policy,
4093 start,
4094 query,
4095 )
4096 }
4097
4098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4102 self.0.request.name = v.into();
4103 self
4104 }
4105
4106 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4108 self.0.request.etag = v.into();
4109 self
4110 }
4111 }
4112
4113 #[doc(hidden)]
4114 impl crate::RequestBuilder for DeleteIssue {
4115 fn request_options(&mut self) -> &mut crate::RequestOptions {
4116 &mut self.0.options
4117 }
4118 }
4119
4120 #[derive(Clone, Debug)]
4138 pub struct OpenIssue(RequestBuilder<crate::model::OpenIssueRequest>);
4139
4140 impl OpenIssue {
4141 pub(crate) fn new(
4142 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4143 ) -> Self {
4144 Self(RequestBuilder::new(stub))
4145 }
4146
4147 pub fn with_request<V: Into<crate::model::OpenIssueRequest>>(mut self, v: V) -> Self {
4149 self.0.request = v.into();
4150 self
4151 }
4152
4153 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4155 self.0.options = v.into();
4156 self
4157 }
4158
4159 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4166 (*self.0.stub)
4167 .open_issue(self.0.request, self.0.options)
4168 .await
4169 .map(crate::Response::into_body)
4170 }
4171
4172 pub fn poller(
4174 self,
4175 ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
4176 {
4177 type Operation = google_cloud_lro::internal::Operation<
4178 crate::model::Issue,
4179 crate::model::OperationMetadata,
4180 >;
4181 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4182 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4183
4184 let stub = self.0.stub.clone();
4185 let mut options = self.0.options.clone();
4186 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4187 let query = move |name| {
4188 let stub = stub.clone();
4189 let options = options.clone();
4190 async {
4191 let op = GetOperation::new(stub)
4192 .set_name(name)
4193 .with_options(options)
4194 .send()
4195 .await?;
4196 Ok(Operation::new(op))
4197 }
4198 };
4199
4200 let start = move || async {
4201 let op = self.send().await?;
4202 Ok(Operation::new(op))
4203 };
4204
4205 google_cloud_lro::internal::new_poller(
4206 polling_error_policy,
4207 polling_backoff_policy,
4208 start,
4209 query,
4210 )
4211 }
4212
4213 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4217 self.0.request.name = v.into();
4218 self
4219 }
4220
4221 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4223 self.0.request.etag = v.into();
4224 self
4225 }
4226 }
4227
4228 #[doc(hidden)]
4229 impl crate::RequestBuilder for OpenIssue {
4230 fn request_options(&mut self) -> &mut crate::RequestOptions {
4231 &mut self.0.options
4232 }
4233 }
4234
4235 #[derive(Clone, Debug)]
4253 pub struct CloseIssue(RequestBuilder<crate::model::CloseIssueRequest>);
4254
4255 impl CloseIssue {
4256 pub(crate) fn new(
4257 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4258 ) -> Self {
4259 Self(RequestBuilder::new(stub))
4260 }
4261
4262 pub fn with_request<V: Into<crate::model::CloseIssueRequest>>(mut self, v: V) -> Self {
4264 self.0.request = v.into();
4265 self
4266 }
4267
4268 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4270 self.0.options = v.into();
4271 self
4272 }
4273
4274 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4281 (*self.0.stub)
4282 .close_issue(self.0.request, self.0.options)
4283 .await
4284 .map(crate::Response::into_body)
4285 }
4286
4287 pub fn poller(
4289 self,
4290 ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
4291 {
4292 type Operation = google_cloud_lro::internal::Operation<
4293 crate::model::Issue,
4294 crate::model::OperationMetadata,
4295 >;
4296 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4297 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4298
4299 let stub = self.0.stub.clone();
4300 let mut options = self.0.options.clone();
4301 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4302 let query = move |name| {
4303 let stub = stub.clone();
4304 let options = options.clone();
4305 async {
4306 let op = GetOperation::new(stub)
4307 .set_name(name)
4308 .with_options(options)
4309 .send()
4310 .await?;
4311 Ok(Operation::new(op))
4312 }
4313 };
4314
4315 let start = move || async {
4316 let op = self.send().await?;
4317 Ok(Operation::new(op))
4318 };
4319
4320 google_cloud_lro::internal::new_poller(
4321 polling_error_policy,
4322 polling_backoff_policy,
4323 start,
4324 query,
4325 )
4326 }
4327
4328 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4332 self.0.request.name = v.into();
4333 self
4334 }
4335
4336 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4338 self.0.request.etag = v.into();
4339 self
4340 }
4341 }
4342
4343 #[doc(hidden)]
4344 impl crate::RequestBuilder for CloseIssue {
4345 fn request_options(&mut self) -> &mut crate::RequestOptions {
4346 &mut self.0.options
4347 }
4348 }
4349
4350 #[derive(Clone, Debug)]
4367 pub struct GetPullRequestComment(RequestBuilder<crate::model::GetPullRequestCommentRequest>);
4368
4369 impl GetPullRequestComment {
4370 pub(crate) fn new(
4371 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4372 ) -> Self {
4373 Self(RequestBuilder::new(stub))
4374 }
4375
4376 pub fn with_request<V: Into<crate::model::GetPullRequestCommentRequest>>(
4378 mut self,
4379 v: V,
4380 ) -> Self {
4381 self.0.request = v.into();
4382 self
4383 }
4384
4385 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4387 self.0.options = v.into();
4388 self
4389 }
4390
4391 pub async fn send(self) -> Result<crate::model::PullRequestComment> {
4393 (*self.0.stub)
4394 .get_pull_request_comment(self.0.request, self.0.options)
4395 .await
4396 .map(crate::Response::into_body)
4397 }
4398
4399 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4403 self.0.request.name = v.into();
4404 self
4405 }
4406 }
4407
4408 #[doc(hidden)]
4409 impl crate::RequestBuilder for GetPullRequestComment {
4410 fn request_options(&mut self) -> &mut crate::RequestOptions {
4411 &mut self.0.options
4412 }
4413 }
4414
4415 #[derive(Clone, Debug)]
4436 pub struct ListPullRequestComments(
4437 RequestBuilder<crate::model::ListPullRequestCommentsRequest>,
4438 );
4439
4440 impl ListPullRequestComments {
4441 pub(crate) fn new(
4442 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4443 ) -> Self {
4444 Self(RequestBuilder::new(stub))
4445 }
4446
4447 pub fn with_request<V: Into<crate::model::ListPullRequestCommentsRequest>>(
4449 mut self,
4450 v: V,
4451 ) -> Self {
4452 self.0.request = v.into();
4453 self
4454 }
4455
4456 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4458 self.0.options = v.into();
4459 self
4460 }
4461
4462 pub async fn send(self) -> Result<crate::model::ListPullRequestCommentsResponse> {
4464 (*self.0.stub)
4465 .list_pull_request_comments(self.0.request, self.0.options)
4466 .await
4467 .map(crate::Response::into_body)
4468 }
4469
4470 pub fn by_page(
4472 self,
4473 ) -> impl google_cloud_gax::paginator::Paginator<
4474 crate::model::ListPullRequestCommentsResponse,
4475 crate::Error,
4476 > {
4477 use std::clone::Clone;
4478 let token = self.0.request.page_token.clone();
4479 let execute = move |token: String| {
4480 let mut builder = self.clone();
4481 builder.0.request = builder.0.request.set_page_token(token);
4482 builder.send()
4483 };
4484 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4485 }
4486
4487 pub fn by_item(
4489 self,
4490 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4491 crate::model::ListPullRequestCommentsResponse,
4492 crate::Error,
4493 > {
4494 use google_cloud_gax::paginator::Paginator;
4495 self.by_page().items()
4496 }
4497
4498 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4502 self.0.request.parent = v.into();
4503 self
4504 }
4505
4506 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4508 self.0.request.page_size = v.into();
4509 self
4510 }
4511
4512 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4514 self.0.request.page_token = v.into();
4515 self
4516 }
4517 }
4518
4519 #[doc(hidden)]
4520 impl crate::RequestBuilder for ListPullRequestComments {
4521 fn request_options(&mut self) -> &mut crate::RequestOptions {
4522 &mut self.0.options
4523 }
4524 }
4525
4526 #[derive(Clone, Debug)]
4544 pub struct CreatePullRequestComment(
4545 RequestBuilder<crate::model::CreatePullRequestCommentRequest>,
4546 );
4547
4548 impl CreatePullRequestComment {
4549 pub(crate) fn new(
4550 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4551 ) -> Self {
4552 Self(RequestBuilder::new(stub))
4553 }
4554
4555 pub fn with_request<V: Into<crate::model::CreatePullRequestCommentRequest>>(
4557 mut self,
4558 v: V,
4559 ) -> Self {
4560 self.0.request = v.into();
4561 self
4562 }
4563
4564 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4566 self.0.options = v.into();
4567 self
4568 }
4569
4570 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4577 (*self.0.stub)
4578 .create_pull_request_comment(self.0.request, self.0.options)
4579 .await
4580 .map(crate::Response::into_body)
4581 }
4582
4583 pub fn poller(
4585 self,
4586 ) -> impl google_cloud_lro::Poller<
4587 crate::model::PullRequestComment,
4588 crate::model::OperationMetadata,
4589 > {
4590 type Operation = google_cloud_lro::internal::Operation<
4591 crate::model::PullRequestComment,
4592 crate::model::OperationMetadata,
4593 >;
4594 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4595 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4596
4597 let stub = self.0.stub.clone();
4598 let mut options = self.0.options.clone();
4599 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4600 let query = move |name| {
4601 let stub = stub.clone();
4602 let options = options.clone();
4603 async {
4604 let op = GetOperation::new(stub)
4605 .set_name(name)
4606 .with_options(options)
4607 .send()
4608 .await?;
4609 Ok(Operation::new(op))
4610 }
4611 };
4612
4613 let start = move || async {
4614 let op = self.send().await?;
4615 Ok(Operation::new(op))
4616 };
4617
4618 google_cloud_lro::internal::new_poller(
4619 polling_error_policy,
4620 polling_backoff_policy,
4621 start,
4622 query,
4623 )
4624 }
4625
4626 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4630 self.0.request.parent = v.into();
4631 self
4632 }
4633
4634 pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
4638 where
4639 T: std::convert::Into<crate::model::PullRequestComment>,
4640 {
4641 self.0.request.pull_request_comment = std::option::Option::Some(v.into());
4642 self
4643 }
4644
4645 pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
4649 where
4650 T: std::convert::Into<crate::model::PullRequestComment>,
4651 {
4652 self.0.request.pull_request_comment = v.map(|x| x.into());
4653 self
4654 }
4655 }
4656
4657 #[doc(hidden)]
4658 impl crate::RequestBuilder for CreatePullRequestComment {
4659 fn request_options(&mut self) -> &mut crate::RequestOptions {
4660 &mut self.0.options
4661 }
4662 }
4663
4664 #[derive(Clone, Debug)]
4682 pub struct UpdatePullRequestComment(
4683 RequestBuilder<crate::model::UpdatePullRequestCommentRequest>,
4684 );
4685
4686 impl UpdatePullRequestComment {
4687 pub(crate) fn new(
4688 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4689 ) -> Self {
4690 Self(RequestBuilder::new(stub))
4691 }
4692
4693 pub fn with_request<V: Into<crate::model::UpdatePullRequestCommentRequest>>(
4695 mut self,
4696 v: V,
4697 ) -> Self {
4698 self.0.request = v.into();
4699 self
4700 }
4701
4702 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4704 self.0.options = v.into();
4705 self
4706 }
4707
4708 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4715 (*self.0.stub)
4716 .update_pull_request_comment(self.0.request, self.0.options)
4717 .await
4718 .map(crate::Response::into_body)
4719 }
4720
4721 pub fn poller(
4723 self,
4724 ) -> impl google_cloud_lro::Poller<
4725 crate::model::PullRequestComment,
4726 crate::model::OperationMetadata,
4727 > {
4728 type Operation = google_cloud_lro::internal::Operation<
4729 crate::model::PullRequestComment,
4730 crate::model::OperationMetadata,
4731 >;
4732 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4733 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4734
4735 let stub = self.0.stub.clone();
4736 let mut options = self.0.options.clone();
4737 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4738 let query = move |name| {
4739 let stub = stub.clone();
4740 let options = options.clone();
4741 async {
4742 let op = GetOperation::new(stub)
4743 .set_name(name)
4744 .with_options(options)
4745 .send()
4746 .await?;
4747 Ok(Operation::new(op))
4748 }
4749 };
4750
4751 let start = move || async {
4752 let op = self.send().await?;
4753 Ok(Operation::new(op))
4754 };
4755
4756 google_cloud_lro::internal::new_poller(
4757 polling_error_policy,
4758 polling_backoff_policy,
4759 start,
4760 query,
4761 )
4762 }
4763
4764 pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
4768 where
4769 T: std::convert::Into<crate::model::PullRequestComment>,
4770 {
4771 self.0.request.pull_request_comment = std::option::Option::Some(v.into());
4772 self
4773 }
4774
4775 pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
4779 where
4780 T: std::convert::Into<crate::model::PullRequestComment>,
4781 {
4782 self.0.request.pull_request_comment = v.map(|x| x.into());
4783 self
4784 }
4785
4786 pub fn set_update_mask<T>(mut self, v: T) -> Self
4788 where
4789 T: std::convert::Into<wkt::FieldMask>,
4790 {
4791 self.0.request.update_mask = std::option::Option::Some(v.into());
4792 self
4793 }
4794
4795 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4797 where
4798 T: std::convert::Into<wkt::FieldMask>,
4799 {
4800 self.0.request.update_mask = v.map(|x| x.into());
4801 self
4802 }
4803 }
4804
4805 #[doc(hidden)]
4806 impl crate::RequestBuilder for UpdatePullRequestComment {
4807 fn request_options(&mut self) -> &mut crate::RequestOptions {
4808 &mut self.0.options
4809 }
4810 }
4811
4812 #[derive(Clone, Debug)]
4830 pub struct DeletePullRequestComment(
4831 RequestBuilder<crate::model::DeletePullRequestCommentRequest>,
4832 );
4833
4834 impl DeletePullRequestComment {
4835 pub(crate) fn new(
4836 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4837 ) -> Self {
4838 Self(RequestBuilder::new(stub))
4839 }
4840
4841 pub fn with_request<V: Into<crate::model::DeletePullRequestCommentRequest>>(
4843 mut self,
4844 v: V,
4845 ) -> Self {
4846 self.0.request = v.into();
4847 self
4848 }
4849
4850 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4852 self.0.options = v.into();
4853 self
4854 }
4855
4856 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4863 (*self.0.stub)
4864 .delete_pull_request_comment(self.0.request, self.0.options)
4865 .await
4866 .map(crate::Response::into_body)
4867 }
4868
4869 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4871 type Operation =
4872 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4873 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4874 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4875
4876 let stub = self.0.stub.clone();
4877 let mut options = self.0.options.clone();
4878 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4879 let query = move |name| {
4880 let stub = stub.clone();
4881 let options = options.clone();
4882 async {
4883 let op = GetOperation::new(stub)
4884 .set_name(name)
4885 .with_options(options)
4886 .send()
4887 .await?;
4888 Ok(Operation::new(op))
4889 }
4890 };
4891
4892 let start = move || async {
4893 let op = self.send().await?;
4894 Ok(Operation::new(op))
4895 };
4896
4897 google_cloud_lro::internal::new_unit_response_poller(
4898 polling_error_policy,
4899 polling_backoff_policy,
4900 start,
4901 query,
4902 )
4903 }
4904
4905 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4909 self.0.request.name = v.into();
4910 self
4911 }
4912 }
4913
4914 #[doc(hidden)]
4915 impl crate::RequestBuilder for DeletePullRequestComment {
4916 fn request_options(&mut self) -> &mut crate::RequestOptions {
4917 &mut self.0.options
4918 }
4919 }
4920
4921 #[derive(Clone, Debug)]
4939 pub struct BatchCreatePullRequestComments(
4940 RequestBuilder<crate::model::BatchCreatePullRequestCommentsRequest>,
4941 );
4942
4943 impl BatchCreatePullRequestComments {
4944 pub(crate) fn new(
4945 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4946 ) -> Self {
4947 Self(RequestBuilder::new(stub))
4948 }
4949
4950 pub fn with_request<V: Into<crate::model::BatchCreatePullRequestCommentsRequest>>(
4952 mut self,
4953 v: V,
4954 ) -> Self {
4955 self.0.request = v.into();
4956 self
4957 }
4958
4959 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4961 self.0.options = v.into();
4962 self
4963 }
4964
4965 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4972 (*self.0.stub)
4973 .batch_create_pull_request_comments(self.0.request, self.0.options)
4974 .await
4975 .map(crate::Response::into_body)
4976 }
4977
4978 pub fn poller(
4980 self,
4981 ) -> impl google_cloud_lro::Poller<
4982 crate::model::BatchCreatePullRequestCommentsResponse,
4983 crate::model::OperationMetadata,
4984 > {
4985 type Operation = google_cloud_lro::internal::Operation<
4986 crate::model::BatchCreatePullRequestCommentsResponse,
4987 crate::model::OperationMetadata,
4988 >;
4989 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4990 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4991
4992 let stub = self.0.stub.clone();
4993 let mut options = self.0.options.clone();
4994 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4995 let query = move |name| {
4996 let stub = stub.clone();
4997 let options = options.clone();
4998 async {
4999 let op = GetOperation::new(stub)
5000 .set_name(name)
5001 .with_options(options)
5002 .send()
5003 .await?;
5004 Ok(Operation::new(op))
5005 }
5006 };
5007
5008 let start = move || async {
5009 let op = self.send().await?;
5010 Ok(Operation::new(op))
5011 };
5012
5013 google_cloud_lro::internal::new_poller(
5014 polling_error_policy,
5015 polling_backoff_policy,
5016 start,
5017 query,
5018 )
5019 }
5020
5021 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5025 self.0.request.parent = v.into();
5026 self
5027 }
5028
5029 pub fn set_requests<T, V>(mut self, v: T) -> Self
5033 where
5034 T: std::iter::IntoIterator<Item = V>,
5035 V: std::convert::Into<crate::model::CreatePullRequestCommentRequest>,
5036 {
5037 use std::iter::Iterator;
5038 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
5039 self
5040 }
5041 }
5042
5043 #[doc(hidden)]
5044 impl crate::RequestBuilder for BatchCreatePullRequestComments {
5045 fn request_options(&mut self) -> &mut crate::RequestOptions {
5046 &mut self.0.options
5047 }
5048 }
5049
5050 #[derive(Clone, Debug)]
5068 pub struct ResolvePullRequestComments(
5069 RequestBuilder<crate::model::ResolvePullRequestCommentsRequest>,
5070 );
5071
5072 impl ResolvePullRequestComments {
5073 pub(crate) fn new(
5074 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5075 ) -> Self {
5076 Self(RequestBuilder::new(stub))
5077 }
5078
5079 pub fn with_request<V: Into<crate::model::ResolvePullRequestCommentsRequest>>(
5081 mut self,
5082 v: V,
5083 ) -> Self {
5084 self.0.request = v.into();
5085 self
5086 }
5087
5088 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5090 self.0.options = v.into();
5091 self
5092 }
5093
5094 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5101 (*self.0.stub)
5102 .resolve_pull_request_comments(self.0.request, self.0.options)
5103 .await
5104 .map(crate::Response::into_body)
5105 }
5106
5107 pub fn poller(
5109 self,
5110 ) -> impl google_cloud_lro::Poller<
5111 crate::model::ResolvePullRequestCommentsResponse,
5112 crate::model::OperationMetadata,
5113 > {
5114 type Operation = google_cloud_lro::internal::Operation<
5115 crate::model::ResolvePullRequestCommentsResponse,
5116 crate::model::OperationMetadata,
5117 >;
5118 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5119 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5120
5121 let stub = self.0.stub.clone();
5122 let mut options = self.0.options.clone();
5123 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5124 let query = move |name| {
5125 let stub = stub.clone();
5126 let options = options.clone();
5127 async {
5128 let op = GetOperation::new(stub)
5129 .set_name(name)
5130 .with_options(options)
5131 .send()
5132 .await?;
5133 Ok(Operation::new(op))
5134 }
5135 };
5136
5137 let start = move || async {
5138 let op = self.send().await?;
5139 Ok(Operation::new(op))
5140 };
5141
5142 google_cloud_lro::internal::new_poller(
5143 polling_error_policy,
5144 polling_backoff_policy,
5145 start,
5146 query,
5147 )
5148 }
5149
5150 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5154 self.0.request.parent = v.into();
5155 self
5156 }
5157
5158 pub fn set_names<T, V>(mut self, v: T) -> Self
5162 where
5163 T: std::iter::IntoIterator<Item = V>,
5164 V: std::convert::Into<std::string::String>,
5165 {
5166 use std::iter::Iterator;
5167 self.0.request.names = v.into_iter().map(|i| i.into()).collect();
5168 self
5169 }
5170
5171 pub fn set_auto_fill<T: Into<bool>>(mut self, v: T) -> Self {
5173 self.0.request.auto_fill = v.into();
5174 self
5175 }
5176 }
5177
5178 #[doc(hidden)]
5179 impl crate::RequestBuilder for ResolvePullRequestComments {
5180 fn request_options(&mut self) -> &mut crate::RequestOptions {
5181 &mut self.0.options
5182 }
5183 }
5184
5185 #[derive(Clone, Debug)]
5203 pub struct UnresolvePullRequestComments(
5204 RequestBuilder<crate::model::UnresolvePullRequestCommentsRequest>,
5205 );
5206
5207 impl UnresolvePullRequestComments {
5208 pub(crate) fn new(
5209 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5210 ) -> Self {
5211 Self(RequestBuilder::new(stub))
5212 }
5213
5214 pub fn with_request<V: Into<crate::model::UnresolvePullRequestCommentsRequest>>(
5216 mut self,
5217 v: V,
5218 ) -> Self {
5219 self.0.request = v.into();
5220 self
5221 }
5222
5223 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5225 self.0.options = v.into();
5226 self
5227 }
5228
5229 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5236 (*self.0.stub)
5237 .unresolve_pull_request_comments(self.0.request, self.0.options)
5238 .await
5239 .map(crate::Response::into_body)
5240 }
5241
5242 pub fn poller(
5244 self,
5245 ) -> impl google_cloud_lro::Poller<
5246 crate::model::UnresolvePullRequestCommentsResponse,
5247 crate::model::OperationMetadata,
5248 > {
5249 type Operation = google_cloud_lro::internal::Operation<
5250 crate::model::UnresolvePullRequestCommentsResponse,
5251 crate::model::OperationMetadata,
5252 >;
5253 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5254 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5255
5256 let stub = self.0.stub.clone();
5257 let mut options = self.0.options.clone();
5258 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5259 let query = move |name| {
5260 let stub = stub.clone();
5261 let options = options.clone();
5262 async {
5263 let op = GetOperation::new(stub)
5264 .set_name(name)
5265 .with_options(options)
5266 .send()
5267 .await?;
5268 Ok(Operation::new(op))
5269 }
5270 };
5271
5272 let start = move || async {
5273 let op = self.send().await?;
5274 Ok(Operation::new(op))
5275 };
5276
5277 google_cloud_lro::internal::new_poller(
5278 polling_error_policy,
5279 polling_backoff_policy,
5280 start,
5281 query,
5282 )
5283 }
5284
5285 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5289 self.0.request.parent = v.into();
5290 self
5291 }
5292
5293 pub fn set_names<T, V>(mut self, v: T) -> Self
5297 where
5298 T: std::iter::IntoIterator<Item = V>,
5299 V: std::convert::Into<std::string::String>,
5300 {
5301 use std::iter::Iterator;
5302 self.0.request.names = v.into_iter().map(|i| i.into()).collect();
5303 self
5304 }
5305
5306 pub fn set_auto_fill<T: Into<bool>>(mut self, v: T) -> Self {
5308 self.0.request.auto_fill = v.into();
5309 self
5310 }
5311 }
5312
5313 #[doc(hidden)]
5314 impl crate::RequestBuilder for UnresolvePullRequestComments {
5315 fn request_options(&mut self) -> &mut crate::RequestOptions {
5316 &mut self.0.options
5317 }
5318 }
5319
5320 #[derive(Clone, Debug)]
5338 pub struct CreateIssueComment(RequestBuilder<crate::model::CreateIssueCommentRequest>);
5339
5340 impl CreateIssueComment {
5341 pub(crate) fn new(
5342 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5343 ) -> Self {
5344 Self(RequestBuilder::new(stub))
5345 }
5346
5347 pub fn with_request<V: Into<crate::model::CreateIssueCommentRequest>>(
5349 mut self,
5350 v: V,
5351 ) -> Self {
5352 self.0.request = v.into();
5353 self
5354 }
5355
5356 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5358 self.0.options = v.into();
5359 self
5360 }
5361
5362 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5369 (*self.0.stub)
5370 .create_issue_comment(self.0.request, self.0.options)
5371 .await
5372 .map(crate::Response::into_body)
5373 }
5374
5375 pub fn poller(
5377 self,
5378 ) -> impl google_cloud_lro::Poller<crate::model::IssueComment, crate::model::OperationMetadata>
5379 {
5380 type Operation = google_cloud_lro::internal::Operation<
5381 crate::model::IssueComment,
5382 crate::model::OperationMetadata,
5383 >;
5384 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5385 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5386
5387 let stub = self.0.stub.clone();
5388 let mut options = self.0.options.clone();
5389 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5390 let query = move |name| {
5391 let stub = stub.clone();
5392 let options = options.clone();
5393 async {
5394 let op = GetOperation::new(stub)
5395 .set_name(name)
5396 .with_options(options)
5397 .send()
5398 .await?;
5399 Ok(Operation::new(op))
5400 }
5401 };
5402
5403 let start = move || async {
5404 let op = self.send().await?;
5405 Ok(Operation::new(op))
5406 };
5407
5408 google_cloud_lro::internal::new_poller(
5409 polling_error_policy,
5410 polling_backoff_policy,
5411 start,
5412 query,
5413 )
5414 }
5415
5416 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5420 self.0.request.parent = v.into();
5421 self
5422 }
5423
5424 pub fn set_issue_comment<T>(mut self, v: T) -> Self
5428 where
5429 T: std::convert::Into<crate::model::IssueComment>,
5430 {
5431 self.0.request.issue_comment = std::option::Option::Some(v.into());
5432 self
5433 }
5434
5435 pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
5439 where
5440 T: std::convert::Into<crate::model::IssueComment>,
5441 {
5442 self.0.request.issue_comment = v.map(|x| x.into());
5443 self
5444 }
5445 }
5446
5447 #[doc(hidden)]
5448 impl crate::RequestBuilder for CreateIssueComment {
5449 fn request_options(&mut self) -> &mut crate::RequestOptions {
5450 &mut self.0.options
5451 }
5452 }
5453
5454 #[derive(Clone, Debug)]
5471 pub struct GetIssueComment(RequestBuilder<crate::model::GetIssueCommentRequest>);
5472
5473 impl GetIssueComment {
5474 pub(crate) fn new(
5475 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5476 ) -> Self {
5477 Self(RequestBuilder::new(stub))
5478 }
5479
5480 pub fn with_request<V: Into<crate::model::GetIssueCommentRequest>>(mut self, v: V) -> Self {
5482 self.0.request = v.into();
5483 self
5484 }
5485
5486 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5488 self.0.options = v.into();
5489 self
5490 }
5491
5492 pub async fn send(self) -> Result<crate::model::IssueComment> {
5494 (*self.0.stub)
5495 .get_issue_comment(self.0.request, self.0.options)
5496 .await
5497 .map(crate::Response::into_body)
5498 }
5499
5500 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5504 self.0.request.name = v.into();
5505 self
5506 }
5507 }
5508
5509 #[doc(hidden)]
5510 impl crate::RequestBuilder for GetIssueComment {
5511 fn request_options(&mut self) -> &mut crate::RequestOptions {
5512 &mut self.0.options
5513 }
5514 }
5515
5516 #[derive(Clone, Debug)]
5537 pub struct ListIssueComments(RequestBuilder<crate::model::ListIssueCommentsRequest>);
5538
5539 impl ListIssueComments {
5540 pub(crate) fn new(
5541 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5542 ) -> Self {
5543 Self(RequestBuilder::new(stub))
5544 }
5545
5546 pub fn with_request<V: Into<crate::model::ListIssueCommentsRequest>>(
5548 mut self,
5549 v: V,
5550 ) -> Self {
5551 self.0.request = v.into();
5552 self
5553 }
5554
5555 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5557 self.0.options = v.into();
5558 self
5559 }
5560
5561 pub async fn send(self) -> Result<crate::model::ListIssueCommentsResponse> {
5563 (*self.0.stub)
5564 .list_issue_comments(self.0.request, self.0.options)
5565 .await
5566 .map(crate::Response::into_body)
5567 }
5568
5569 pub fn by_page(
5571 self,
5572 ) -> impl google_cloud_gax::paginator::Paginator<
5573 crate::model::ListIssueCommentsResponse,
5574 crate::Error,
5575 > {
5576 use std::clone::Clone;
5577 let token = self.0.request.page_token.clone();
5578 let execute = move |token: String| {
5579 let mut builder = self.clone();
5580 builder.0.request = builder.0.request.set_page_token(token);
5581 builder.send()
5582 };
5583 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5584 }
5585
5586 pub fn by_item(
5588 self,
5589 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5590 crate::model::ListIssueCommentsResponse,
5591 crate::Error,
5592 > {
5593 use google_cloud_gax::paginator::Paginator;
5594 self.by_page().items()
5595 }
5596
5597 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5601 self.0.request.parent = v.into();
5602 self
5603 }
5604
5605 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5607 self.0.request.page_size = v.into();
5608 self
5609 }
5610
5611 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5613 self.0.request.page_token = v.into();
5614 self
5615 }
5616 }
5617
5618 #[doc(hidden)]
5619 impl crate::RequestBuilder for ListIssueComments {
5620 fn request_options(&mut self) -> &mut crate::RequestOptions {
5621 &mut self.0.options
5622 }
5623 }
5624
5625 #[derive(Clone, Debug)]
5643 pub struct UpdateIssueComment(RequestBuilder<crate::model::UpdateIssueCommentRequest>);
5644
5645 impl UpdateIssueComment {
5646 pub(crate) fn new(
5647 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5648 ) -> Self {
5649 Self(RequestBuilder::new(stub))
5650 }
5651
5652 pub fn with_request<V: Into<crate::model::UpdateIssueCommentRequest>>(
5654 mut self,
5655 v: V,
5656 ) -> Self {
5657 self.0.request = v.into();
5658 self
5659 }
5660
5661 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5663 self.0.options = v.into();
5664 self
5665 }
5666
5667 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5674 (*self.0.stub)
5675 .update_issue_comment(self.0.request, self.0.options)
5676 .await
5677 .map(crate::Response::into_body)
5678 }
5679
5680 pub fn poller(
5682 self,
5683 ) -> impl google_cloud_lro::Poller<crate::model::IssueComment, crate::model::OperationMetadata>
5684 {
5685 type Operation = google_cloud_lro::internal::Operation<
5686 crate::model::IssueComment,
5687 crate::model::OperationMetadata,
5688 >;
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(google_cloud_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 google_cloud_lro::internal::new_poller(
5714 polling_error_policy,
5715 polling_backoff_policy,
5716 start,
5717 query,
5718 )
5719 }
5720
5721 pub fn set_issue_comment<T>(mut self, v: T) -> Self
5725 where
5726 T: std::convert::Into<crate::model::IssueComment>,
5727 {
5728 self.0.request.issue_comment = std::option::Option::Some(v.into());
5729 self
5730 }
5731
5732 pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
5736 where
5737 T: std::convert::Into<crate::model::IssueComment>,
5738 {
5739 self.0.request.issue_comment = v.map(|x| x.into());
5740 self
5741 }
5742
5743 pub fn set_update_mask<T>(mut self, v: T) -> Self
5745 where
5746 T: std::convert::Into<wkt::FieldMask>,
5747 {
5748 self.0.request.update_mask = std::option::Option::Some(v.into());
5749 self
5750 }
5751
5752 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5754 where
5755 T: std::convert::Into<wkt::FieldMask>,
5756 {
5757 self.0.request.update_mask = v.map(|x| x.into());
5758 self
5759 }
5760 }
5761
5762 #[doc(hidden)]
5763 impl crate::RequestBuilder for UpdateIssueComment {
5764 fn request_options(&mut self) -> &mut crate::RequestOptions {
5765 &mut self.0.options
5766 }
5767 }
5768
5769 #[derive(Clone, Debug)]
5787 pub struct DeleteIssueComment(RequestBuilder<crate::model::DeleteIssueCommentRequest>);
5788
5789 impl DeleteIssueComment {
5790 pub(crate) fn new(
5791 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5792 ) -> Self {
5793 Self(RequestBuilder::new(stub))
5794 }
5795
5796 pub fn with_request<V: Into<crate::model::DeleteIssueCommentRequest>>(
5798 mut self,
5799 v: V,
5800 ) -> Self {
5801 self.0.request = v.into();
5802 self
5803 }
5804
5805 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5807 self.0.options = v.into();
5808 self
5809 }
5810
5811 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5818 (*self.0.stub)
5819 .delete_issue_comment(self.0.request, self.0.options)
5820 .await
5821 .map(crate::Response::into_body)
5822 }
5823
5824 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5826 type Operation =
5827 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5828 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5829 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5830
5831 let stub = self.0.stub.clone();
5832 let mut options = self.0.options.clone();
5833 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5834 let query = move |name| {
5835 let stub = stub.clone();
5836 let options = options.clone();
5837 async {
5838 let op = GetOperation::new(stub)
5839 .set_name(name)
5840 .with_options(options)
5841 .send()
5842 .await?;
5843 Ok(Operation::new(op))
5844 }
5845 };
5846
5847 let start = move || async {
5848 let op = self.send().await?;
5849 Ok(Operation::new(op))
5850 };
5851
5852 google_cloud_lro::internal::new_unit_response_poller(
5853 polling_error_policy,
5854 polling_backoff_policy,
5855 start,
5856 query,
5857 )
5858 }
5859
5860 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5864 self.0.request.name = v.into();
5865 self
5866 }
5867 }
5868
5869 #[doc(hidden)]
5870 impl crate::RequestBuilder for DeleteIssueComment {
5871 fn request_options(&mut self) -> &mut crate::RequestOptions {
5872 &mut self.0.options
5873 }
5874 }
5875
5876 #[derive(Clone, Debug)]
5897 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5898
5899 impl ListLocations {
5900 pub(crate) fn new(
5901 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5902 ) -> Self {
5903 Self(RequestBuilder::new(stub))
5904 }
5905
5906 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5908 mut self,
5909 v: V,
5910 ) -> Self {
5911 self.0.request = v.into();
5912 self
5913 }
5914
5915 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5917 self.0.options = v.into();
5918 self
5919 }
5920
5921 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5923 (*self.0.stub)
5924 .list_locations(self.0.request, self.0.options)
5925 .await
5926 .map(crate::Response::into_body)
5927 }
5928
5929 pub fn by_page(
5931 self,
5932 ) -> impl google_cloud_gax::paginator::Paginator<
5933 google_cloud_location::model::ListLocationsResponse,
5934 crate::Error,
5935 > {
5936 use std::clone::Clone;
5937 let token = self.0.request.page_token.clone();
5938 let execute = move |token: String| {
5939 let mut builder = self.clone();
5940 builder.0.request = builder.0.request.set_page_token(token);
5941 builder.send()
5942 };
5943 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5944 }
5945
5946 pub fn by_item(
5948 self,
5949 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5950 google_cloud_location::model::ListLocationsResponse,
5951 crate::Error,
5952 > {
5953 use google_cloud_gax::paginator::Paginator;
5954 self.by_page().items()
5955 }
5956
5957 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5959 self.0.request.name = v.into();
5960 self
5961 }
5962
5963 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5965 self.0.request.filter = v.into();
5966 self
5967 }
5968
5969 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5971 self.0.request.page_size = v.into();
5972 self
5973 }
5974
5975 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5977 self.0.request.page_token = v.into();
5978 self
5979 }
5980 }
5981
5982 #[doc(hidden)]
5983 impl crate::RequestBuilder for ListLocations {
5984 fn request_options(&mut self) -> &mut crate::RequestOptions {
5985 &mut self.0.options
5986 }
5987 }
5988
5989 #[derive(Clone, Debug)]
6006 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6007
6008 impl GetLocation {
6009 pub(crate) fn new(
6010 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6011 ) -> Self {
6012 Self(RequestBuilder::new(stub))
6013 }
6014
6015 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6017 mut self,
6018 v: V,
6019 ) -> Self {
6020 self.0.request = v.into();
6021 self
6022 }
6023
6024 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6026 self.0.options = v.into();
6027 self
6028 }
6029
6030 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6032 (*self.0.stub)
6033 .get_location(self.0.request, self.0.options)
6034 .await
6035 .map(crate::Response::into_body)
6036 }
6037
6038 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6040 self.0.request.name = v.into();
6041 self
6042 }
6043 }
6044
6045 #[doc(hidden)]
6046 impl crate::RequestBuilder for GetLocation {
6047 fn request_options(&mut self) -> &mut crate::RequestOptions {
6048 &mut self.0.options
6049 }
6050 }
6051
6052 #[derive(Clone, Debug)]
6069 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6070
6071 impl SetIamPolicy {
6072 pub(crate) fn new(
6073 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6074 ) -> Self {
6075 Self(RequestBuilder::new(stub))
6076 }
6077
6078 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6080 mut self,
6081 v: V,
6082 ) -> Self {
6083 self.0.request = v.into();
6084 self
6085 }
6086
6087 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6089 self.0.options = v.into();
6090 self
6091 }
6092
6093 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6095 (*self.0.stub)
6096 .set_iam_policy(self.0.request, self.0.options)
6097 .await
6098 .map(crate::Response::into_body)
6099 }
6100
6101 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6105 self.0.request.resource = v.into();
6106 self
6107 }
6108
6109 pub fn set_policy<T>(mut self, v: T) -> Self
6113 where
6114 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6115 {
6116 self.0.request.policy = std::option::Option::Some(v.into());
6117 self
6118 }
6119
6120 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6124 where
6125 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6126 {
6127 self.0.request.policy = v.map(|x| x.into());
6128 self
6129 }
6130
6131 pub fn set_update_mask<T>(mut self, v: T) -> Self
6133 where
6134 T: std::convert::Into<wkt::FieldMask>,
6135 {
6136 self.0.request.update_mask = std::option::Option::Some(v.into());
6137 self
6138 }
6139
6140 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6142 where
6143 T: std::convert::Into<wkt::FieldMask>,
6144 {
6145 self.0.request.update_mask = v.map(|x| x.into());
6146 self
6147 }
6148 }
6149
6150 #[doc(hidden)]
6151 impl crate::RequestBuilder for SetIamPolicy {
6152 fn request_options(&mut self) -> &mut crate::RequestOptions {
6153 &mut self.0.options
6154 }
6155 }
6156
6157 #[derive(Clone, Debug)]
6174 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6175
6176 impl GetIamPolicy {
6177 pub(crate) fn new(
6178 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6179 ) -> Self {
6180 Self(RequestBuilder::new(stub))
6181 }
6182
6183 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6185 mut self,
6186 v: V,
6187 ) -> Self {
6188 self.0.request = v.into();
6189 self
6190 }
6191
6192 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6194 self.0.options = v.into();
6195 self
6196 }
6197
6198 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6200 (*self.0.stub)
6201 .get_iam_policy(self.0.request, self.0.options)
6202 .await
6203 .map(crate::Response::into_body)
6204 }
6205
6206 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6210 self.0.request.resource = v.into();
6211 self
6212 }
6213
6214 pub fn set_options<T>(mut self, v: T) -> Self
6216 where
6217 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6218 {
6219 self.0.request.options = std::option::Option::Some(v.into());
6220 self
6221 }
6222
6223 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6225 where
6226 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6227 {
6228 self.0.request.options = v.map(|x| x.into());
6229 self
6230 }
6231 }
6232
6233 #[doc(hidden)]
6234 impl crate::RequestBuilder for GetIamPolicy {
6235 fn request_options(&mut self) -> &mut crate::RequestOptions {
6236 &mut self.0.options
6237 }
6238 }
6239
6240 #[derive(Clone, Debug)]
6257 pub struct TestIamPermissions(
6258 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6259 );
6260
6261 impl TestIamPermissions {
6262 pub(crate) fn new(
6263 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6264 ) -> Self {
6265 Self(RequestBuilder::new(stub))
6266 }
6267
6268 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6270 mut self,
6271 v: V,
6272 ) -> Self {
6273 self.0.request = v.into();
6274 self
6275 }
6276
6277 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6279 self.0.options = v.into();
6280 self
6281 }
6282
6283 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6285 (*self.0.stub)
6286 .test_iam_permissions(self.0.request, self.0.options)
6287 .await
6288 .map(crate::Response::into_body)
6289 }
6290
6291 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6295 self.0.request.resource = v.into();
6296 self
6297 }
6298
6299 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6303 where
6304 T: std::iter::IntoIterator<Item = V>,
6305 V: std::convert::Into<std::string::String>,
6306 {
6307 use std::iter::Iterator;
6308 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6309 self
6310 }
6311 }
6312
6313 #[doc(hidden)]
6314 impl crate::RequestBuilder for TestIamPermissions {
6315 fn request_options(&mut self) -> &mut crate::RequestOptions {
6316 &mut self.0.options
6317 }
6318 }
6319
6320 #[derive(Clone, Debug)]
6341 pub struct ListOperations(
6342 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6343 );
6344
6345 impl ListOperations {
6346 pub(crate) fn new(
6347 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6348 ) -> Self {
6349 Self(RequestBuilder::new(stub))
6350 }
6351
6352 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6354 mut self,
6355 v: V,
6356 ) -> Self {
6357 self.0.request = v.into();
6358 self
6359 }
6360
6361 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6363 self.0.options = v.into();
6364 self
6365 }
6366
6367 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6369 (*self.0.stub)
6370 .list_operations(self.0.request, self.0.options)
6371 .await
6372 .map(crate::Response::into_body)
6373 }
6374
6375 pub fn by_page(
6377 self,
6378 ) -> impl google_cloud_gax::paginator::Paginator<
6379 google_cloud_longrunning::model::ListOperationsResponse,
6380 crate::Error,
6381 > {
6382 use std::clone::Clone;
6383 let token = self.0.request.page_token.clone();
6384 let execute = move |token: String| {
6385 let mut builder = self.clone();
6386 builder.0.request = builder.0.request.set_page_token(token);
6387 builder.send()
6388 };
6389 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6390 }
6391
6392 pub fn by_item(
6394 self,
6395 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6396 google_cloud_longrunning::model::ListOperationsResponse,
6397 crate::Error,
6398 > {
6399 use google_cloud_gax::paginator::Paginator;
6400 self.by_page().items()
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 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6411 self.0.request.filter = v.into();
6412 self
6413 }
6414
6415 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6417 self.0.request.page_size = v.into();
6418 self
6419 }
6420
6421 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6423 self.0.request.page_token = v.into();
6424 self
6425 }
6426
6427 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6429 self.0.request.return_partial_success = v.into();
6430 self
6431 }
6432 }
6433
6434 #[doc(hidden)]
6435 impl crate::RequestBuilder for ListOperations {
6436 fn request_options(&mut self) -> &mut crate::RequestOptions {
6437 &mut self.0.options
6438 }
6439 }
6440
6441 #[derive(Clone, Debug)]
6458 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6459
6460 impl GetOperation {
6461 pub(crate) fn new(
6462 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6463 ) -> Self {
6464 Self(RequestBuilder::new(stub))
6465 }
6466
6467 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6469 mut self,
6470 v: V,
6471 ) -> Self {
6472 self.0.request = v.into();
6473 self
6474 }
6475
6476 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6478 self.0.options = v.into();
6479 self
6480 }
6481
6482 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6484 (*self.0.stub)
6485 .get_operation(self.0.request, self.0.options)
6486 .await
6487 .map(crate::Response::into_body)
6488 }
6489
6490 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6492 self.0.request.name = v.into();
6493 self
6494 }
6495 }
6496
6497 #[doc(hidden)]
6498 impl crate::RequestBuilder for GetOperation {
6499 fn request_options(&mut self) -> &mut crate::RequestOptions {
6500 &mut self.0.options
6501 }
6502 }
6503
6504 #[derive(Clone, Debug)]
6521 pub struct DeleteOperation(
6522 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
6523 );
6524
6525 impl DeleteOperation {
6526 pub(crate) fn new(
6527 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6528 ) -> Self {
6529 Self(RequestBuilder::new(stub))
6530 }
6531
6532 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
6534 mut self,
6535 v: V,
6536 ) -> Self {
6537 self.0.request = v.into();
6538 self
6539 }
6540
6541 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6543 self.0.options = v.into();
6544 self
6545 }
6546
6547 pub async fn send(self) -> Result<()> {
6549 (*self.0.stub)
6550 .delete_operation(self.0.request, self.0.options)
6551 .await
6552 .map(crate::Response::into_body)
6553 }
6554
6555 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6557 self.0.request.name = v.into();
6558 self
6559 }
6560 }
6561
6562 #[doc(hidden)]
6563 impl crate::RequestBuilder for DeleteOperation {
6564 fn request_options(&mut self) -> &mut crate::RequestOptions {
6565 &mut self.0.options
6566 }
6567 }
6568
6569 #[derive(Clone, Debug)]
6586 pub struct CancelOperation(
6587 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6588 );
6589
6590 impl CancelOperation {
6591 pub(crate) fn new(
6592 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6593 ) -> Self {
6594 Self(RequestBuilder::new(stub))
6595 }
6596
6597 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6599 mut self,
6600 v: V,
6601 ) -> Self {
6602 self.0.request = v.into();
6603 self
6604 }
6605
6606 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6608 self.0.options = v.into();
6609 self
6610 }
6611
6612 pub async fn send(self) -> Result<()> {
6614 (*self.0.stub)
6615 .cancel_operation(self.0.request, self.0.options)
6616 .await
6617 .map(crate::Response::into_body)
6618 }
6619
6620 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6622 self.0.request.name = v.into();
6623 self
6624 }
6625 }
6626
6627 #[doc(hidden)]
6628 impl crate::RequestBuilder for CancelOperation {
6629 fn request_options(&mut self) -> &mut crate::RequestOptions {
6630 &mut self.0.options
6631 }
6632 }
6633}