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