1pub mod secure_source_manager {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::SecureSourceManager;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = SecureSourceManager;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
94 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
95
96 impl ListInstances {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
117 (*self.0.stub)
118 .list_instances(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 pub fn by_page(
125 self,
126 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
127 {
128 use std::clone::Clone;
129 let token = self.0.request.page_token.clone();
130 let execute = move |token: String| {
131 let mut builder = self.clone();
132 builder.0.request = builder.0.request.set_page_token(token);
133 builder.send()
134 };
135 google_cloud_gax::paginator::internal::new_paginator(token, execute)
136 }
137
138 pub fn by_item(
140 self,
141 ) -> impl google_cloud_gax::paginator::ItemPaginator<
142 crate::model::ListInstancesResponse,
143 crate::Error,
144 > {
145 use google_cloud_gax::paginator::Paginator;
146 self.by_page().items()
147 }
148
149 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153 self.0.request.parent = v.into();
154 self
155 }
156
157 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159 self.0.request.page_size = v.into();
160 self
161 }
162
163 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165 self.0.request.page_token = v.into();
166 self
167 }
168
169 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.filter = v.into();
172 self
173 }
174
175 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
177 self.0.request.order_by = v.into();
178 self
179 }
180 }
181
182 #[doc(hidden)]
183 impl crate::RequestBuilder for ListInstances {
184 fn request_options(&mut self) -> &mut crate::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[derive(Clone, Debug)]
206 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
207
208 impl GetInstance {
209 pub(crate) fn new(
210 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
211 ) -> Self {
212 Self(RequestBuilder::new(stub))
213 }
214
215 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
217 self.0.request = v.into();
218 self
219 }
220
221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
223 self.0.options = v.into();
224 self
225 }
226
227 pub async fn send(self) -> Result<crate::model::Instance> {
229 (*self.0.stub)
230 .get_instance(self.0.request, self.0.options)
231 .await
232 .map(crate::Response::into_body)
233 }
234
235 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
239 self.0.request.name = v.into();
240 self
241 }
242 }
243
244 #[doc(hidden)]
245 impl crate::RequestBuilder for GetInstance {
246 fn request_options(&mut self) -> &mut crate::RequestOptions {
247 &mut self.0.options
248 }
249 }
250
251 #[derive(Clone, Debug)]
269 pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
270
271 impl CreateInstance {
272 pub(crate) fn new(
273 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
274 ) -> Self {
275 Self(RequestBuilder::new(stub))
276 }
277
278 pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
280 self.0.request = v.into();
281 self
282 }
283
284 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
286 self.0.options = v.into();
287 self
288 }
289
290 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
297 (*self.0.stub)
298 .create_instance(self.0.request, self.0.options)
299 .await
300 .map(crate::Response::into_body)
301 }
302
303 pub fn poller(
305 self,
306 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
307 {
308 type Operation = google_cloud_lro::internal::Operation<
309 crate::model::Instance,
310 crate::model::OperationMetadata,
311 >;
312 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
313 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
314
315 let stub = self.0.stub.clone();
316 let mut options = self.0.options.clone();
317 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
318 let query = move |name| {
319 let stub = stub.clone();
320 let options = options.clone();
321 async {
322 let op = GetOperation::new(stub)
323 .set_name(name)
324 .with_options(options)
325 .send()
326 .await?;
327 Ok(Operation::new(op))
328 }
329 };
330
331 let start = move || async {
332 let op = self.send().await?;
333 Ok(Operation::new(op))
334 };
335
336 google_cloud_lro::internal::new_poller(
337 polling_error_policy,
338 polling_backoff_policy,
339 start,
340 query,
341 )
342 }
343
344 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
348 self.0.request.parent = v.into();
349 self
350 }
351
352 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
356 self.0.request.instance_id = v.into();
357 self
358 }
359
360 pub fn set_instance<T>(mut self, v: T) -> Self
364 where
365 T: std::convert::Into<crate::model::Instance>,
366 {
367 self.0.request.instance = std::option::Option::Some(v.into());
368 self
369 }
370
371 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
375 where
376 T: std::convert::Into<crate::model::Instance>,
377 {
378 self.0.request.instance = v.map(|x| x.into());
379 self
380 }
381
382 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
384 self.0.request.request_id = v.into();
385 self
386 }
387 }
388
389 #[doc(hidden)]
390 impl crate::RequestBuilder for CreateInstance {
391 fn request_options(&mut self) -> &mut crate::RequestOptions {
392 &mut self.0.options
393 }
394 }
395
396 #[derive(Clone, Debug)]
414 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
415
416 impl DeleteInstance {
417 pub(crate) fn new(
418 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
419 ) -> Self {
420 Self(RequestBuilder::new(stub))
421 }
422
423 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
425 self.0.request = v.into();
426 self
427 }
428
429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
431 self.0.options = v.into();
432 self
433 }
434
435 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
442 (*self.0.stub)
443 .delete_instance(self.0.request, self.0.options)
444 .await
445 .map(crate::Response::into_body)
446 }
447
448 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
450 type Operation =
451 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
452 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
453 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
454
455 let stub = self.0.stub.clone();
456 let mut options = self.0.options.clone();
457 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
458 let query = move |name| {
459 let stub = stub.clone();
460 let options = options.clone();
461 async {
462 let op = GetOperation::new(stub)
463 .set_name(name)
464 .with_options(options)
465 .send()
466 .await?;
467 Ok(Operation::new(op))
468 }
469 };
470
471 let start = move || async {
472 let op = self.send().await?;
473 Ok(Operation::new(op))
474 };
475
476 google_cloud_lro::internal::new_unit_response_poller(
477 polling_error_policy,
478 polling_backoff_policy,
479 start,
480 query,
481 )
482 }
483
484 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
488 self.0.request.name = v.into();
489 self
490 }
491
492 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
494 self.0.request.request_id = v.into();
495 self
496 }
497 }
498
499 #[doc(hidden)]
500 impl crate::RequestBuilder for DeleteInstance {
501 fn request_options(&mut self) -> &mut crate::RequestOptions {
502 &mut self.0.options
503 }
504 }
505
506 #[derive(Clone, Debug)]
527 pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
528
529 impl ListRepositories {
530 pub(crate) fn new(
531 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
532 ) -> Self {
533 Self(RequestBuilder::new(stub))
534 }
535
536 pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
538 mut self,
539 v: V,
540 ) -> Self {
541 self.0.request = v.into();
542 self
543 }
544
545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
547 self.0.options = v.into();
548 self
549 }
550
551 pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
553 (*self.0.stub)
554 .list_repositories(self.0.request, self.0.options)
555 .await
556 .map(crate::Response::into_body)
557 }
558
559 pub fn by_page(
561 self,
562 ) -> impl google_cloud_gax::paginator::Paginator<
563 crate::model::ListRepositoriesResponse,
564 crate::Error,
565 > {
566 use std::clone::Clone;
567 let token = self.0.request.page_token.clone();
568 let execute = move |token: String| {
569 let mut builder = self.clone();
570 builder.0.request = builder.0.request.set_page_token(token);
571 builder.send()
572 };
573 google_cloud_gax::paginator::internal::new_paginator(token, execute)
574 }
575
576 pub fn by_item(
578 self,
579 ) -> impl google_cloud_gax::paginator::ItemPaginator<
580 crate::model::ListRepositoriesResponse,
581 crate::Error,
582 > {
583 use google_cloud_gax::paginator::Paginator;
584 self.by_page().items()
585 }
586
587 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
591 self.0.request.parent = v.into();
592 self
593 }
594
595 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
597 self.0.request.page_size = v.into();
598 self
599 }
600
601 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
603 self.0.request.page_token = v.into();
604 self
605 }
606
607 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
609 self.0.request.filter = v.into();
610 self
611 }
612
613 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
615 self.0.request.instance = v.into();
616 self
617 }
618 }
619
620 #[doc(hidden)]
621 impl crate::RequestBuilder for ListRepositories {
622 fn request_options(&mut self) -> &mut crate::RequestOptions {
623 &mut self.0.options
624 }
625 }
626
627 #[derive(Clone, Debug)]
644 pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
645
646 impl GetRepository {
647 pub(crate) fn new(
648 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
649 ) -> Self {
650 Self(RequestBuilder::new(stub))
651 }
652
653 pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
655 self.0.request = v.into();
656 self
657 }
658
659 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
661 self.0.options = v.into();
662 self
663 }
664
665 pub async fn send(self) -> Result<crate::model::Repository> {
667 (*self.0.stub)
668 .get_repository(self.0.request, self.0.options)
669 .await
670 .map(crate::Response::into_body)
671 }
672
673 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
677 self.0.request.name = v.into();
678 self
679 }
680 }
681
682 #[doc(hidden)]
683 impl crate::RequestBuilder for GetRepository {
684 fn request_options(&mut self) -> &mut crate::RequestOptions {
685 &mut self.0.options
686 }
687 }
688
689 #[derive(Clone, Debug)]
707 pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
708
709 impl CreateRepository {
710 pub(crate) fn new(
711 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
712 ) -> Self {
713 Self(RequestBuilder::new(stub))
714 }
715
716 pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
718 mut self,
719 v: V,
720 ) -> Self {
721 self.0.request = v.into();
722 self
723 }
724
725 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
727 self.0.options = v.into();
728 self
729 }
730
731 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
738 (*self.0.stub)
739 .create_repository(self.0.request, self.0.options)
740 .await
741 .map(crate::Response::into_body)
742 }
743
744 pub fn poller(
746 self,
747 ) -> impl google_cloud_lro::Poller<crate::model::Repository, crate::model::OperationMetadata>
748 {
749 type Operation = google_cloud_lro::internal::Operation<
750 crate::model::Repository,
751 crate::model::OperationMetadata,
752 >;
753 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
754 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
755
756 let stub = self.0.stub.clone();
757 let mut options = self.0.options.clone();
758 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
759 let query = move |name| {
760 let stub = stub.clone();
761 let options = options.clone();
762 async {
763 let op = GetOperation::new(stub)
764 .set_name(name)
765 .with_options(options)
766 .send()
767 .await?;
768 Ok(Operation::new(op))
769 }
770 };
771
772 let start = move || async {
773 let op = self.send().await?;
774 Ok(Operation::new(op))
775 };
776
777 google_cloud_lro::internal::new_poller(
778 polling_error_policy,
779 polling_backoff_policy,
780 start,
781 query,
782 )
783 }
784
785 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
789 self.0.request.parent = v.into();
790 self
791 }
792
793 pub fn set_repository<T>(mut self, v: T) -> Self
797 where
798 T: std::convert::Into<crate::model::Repository>,
799 {
800 self.0.request.repository = std::option::Option::Some(v.into());
801 self
802 }
803
804 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
808 where
809 T: std::convert::Into<crate::model::Repository>,
810 {
811 self.0.request.repository = v.map(|x| x.into());
812 self
813 }
814
815 pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
819 self.0.request.repository_id = v.into();
820 self
821 }
822 }
823
824 #[doc(hidden)]
825 impl crate::RequestBuilder for CreateRepository {
826 fn request_options(&mut self) -> &mut crate::RequestOptions {
827 &mut self.0.options
828 }
829 }
830
831 #[derive(Clone, Debug)]
849 pub struct UpdateRepository(RequestBuilder<crate::model::UpdateRepositoryRequest>);
850
851 impl UpdateRepository {
852 pub(crate) fn new(
853 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
854 ) -> Self {
855 Self(RequestBuilder::new(stub))
856 }
857
858 pub fn with_request<V: Into<crate::model::UpdateRepositoryRequest>>(
860 mut self,
861 v: V,
862 ) -> Self {
863 self.0.request = v.into();
864 self
865 }
866
867 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
869 self.0.options = v.into();
870 self
871 }
872
873 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
880 (*self.0.stub)
881 .update_repository(self.0.request, self.0.options)
882 .await
883 .map(crate::Response::into_body)
884 }
885
886 pub fn poller(
888 self,
889 ) -> impl google_cloud_lro::Poller<crate::model::Repository, crate::model::OperationMetadata>
890 {
891 type Operation = google_cloud_lro::internal::Operation<
892 crate::model::Repository,
893 crate::model::OperationMetadata,
894 >;
895 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
896 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
897
898 let stub = self.0.stub.clone();
899 let mut options = self.0.options.clone();
900 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
901 let query = move |name| {
902 let stub = stub.clone();
903 let options = options.clone();
904 async {
905 let op = GetOperation::new(stub)
906 .set_name(name)
907 .with_options(options)
908 .send()
909 .await?;
910 Ok(Operation::new(op))
911 }
912 };
913
914 let start = move || async {
915 let op = self.send().await?;
916 Ok(Operation::new(op))
917 };
918
919 google_cloud_lro::internal::new_poller(
920 polling_error_policy,
921 polling_backoff_policy,
922 start,
923 query,
924 )
925 }
926
927 pub fn set_update_mask<T>(mut self, v: T) -> Self
929 where
930 T: std::convert::Into<wkt::FieldMask>,
931 {
932 self.0.request.update_mask = std::option::Option::Some(v.into());
933 self
934 }
935
936 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
938 where
939 T: std::convert::Into<wkt::FieldMask>,
940 {
941 self.0.request.update_mask = v.map(|x| x.into());
942 self
943 }
944
945 pub fn set_repository<T>(mut self, v: T) -> Self
949 where
950 T: std::convert::Into<crate::model::Repository>,
951 {
952 self.0.request.repository = std::option::Option::Some(v.into());
953 self
954 }
955
956 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
960 where
961 T: std::convert::Into<crate::model::Repository>,
962 {
963 self.0.request.repository = v.map(|x| x.into());
964 self
965 }
966
967 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
969 self.0.request.validate_only = v.into();
970 self
971 }
972 }
973
974 #[doc(hidden)]
975 impl crate::RequestBuilder for UpdateRepository {
976 fn request_options(&mut self) -> &mut crate::RequestOptions {
977 &mut self.0.options
978 }
979 }
980
981 #[derive(Clone, Debug)]
999 pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
1000
1001 impl DeleteRepository {
1002 pub(crate) fn new(
1003 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1004 ) -> Self {
1005 Self(RequestBuilder::new(stub))
1006 }
1007
1008 pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
1010 mut self,
1011 v: V,
1012 ) -> Self {
1013 self.0.request = v.into();
1014 self
1015 }
1016
1017 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1019 self.0.options = v.into();
1020 self
1021 }
1022
1023 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1030 (*self.0.stub)
1031 .delete_repository(self.0.request, self.0.options)
1032 .await
1033 .map(crate::Response::into_body)
1034 }
1035
1036 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1038 type Operation =
1039 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1040 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1041 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1042
1043 let stub = self.0.stub.clone();
1044 let mut options = self.0.options.clone();
1045 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1046 let query = move |name| {
1047 let stub = stub.clone();
1048 let options = options.clone();
1049 async {
1050 let op = GetOperation::new(stub)
1051 .set_name(name)
1052 .with_options(options)
1053 .send()
1054 .await?;
1055 Ok(Operation::new(op))
1056 }
1057 };
1058
1059 let start = move || async {
1060 let op = self.send().await?;
1061 Ok(Operation::new(op))
1062 };
1063
1064 google_cloud_lro::internal::new_unit_response_poller(
1065 polling_error_policy,
1066 polling_backoff_policy,
1067 start,
1068 query,
1069 )
1070 }
1071
1072 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1076 self.0.request.name = v.into();
1077 self
1078 }
1079
1080 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1082 self.0.request.allow_missing = v.into();
1083 self
1084 }
1085 }
1086
1087 #[doc(hidden)]
1088 impl crate::RequestBuilder for DeleteRepository {
1089 fn request_options(&mut self) -> &mut crate::RequestOptions {
1090 &mut self.0.options
1091 }
1092 }
1093
1094 #[derive(Clone, Debug)]
1115 pub struct ListHooks(RequestBuilder<crate::model::ListHooksRequest>);
1116
1117 impl ListHooks {
1118 pub(crate) fn new(
1119 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1120 ) -> Self {
1121 Self(RequestBuilder::new(stub))
1122 }
1123
1124 pub fn with_request<V: Into<crate::model::ListHooksRequest>>(mut self, v: V) -> Self {
1126 self.0.request = v.into();
1127 self
1128 }
1129
1130 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1132 self.0.options = v.into();
1133 self
1134 }
1135
1136 pub async fn send(self) -> Result<crate::model::ListHooksResponse> {
1138 (*self.0.stub)
1139 .list_hooks(self.0.request, self.0.options)
1140 .await
1141 .map(crate::Response::into_body)
1142 }
1143
1144 pub fn by_page(
1146 self,
1147 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHooksResponse, crate::Error>
1148 {
1149 use std::clone::Clone;
1150 let token = self.0.request.page_token.clone();
1151 let execute = move |token: String| {
1152 let mut builder = self.clone();
1153 builder.0.request = builder.0.request.set_page_token(token);
1154 builder.send()
1155 };
1156 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1157 }
1158
1159 pub fn by_item(
1161 self,
1162 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListHooksResponse, crate::Error>
1163 {
1164 use google_cloud_gax::paginator::Paginator;
1165 self.by_page().items()
1166 }
1167
1168 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1172 self.0.request.parent = v.into();
1173 self
1174 }
1175
1176 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1178 self.0.request.page_size = v.into();
1179 self
1180 }
1181
1182 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1184 self.0.request.page_token = v.into();
1185 self
1186 }
1187 }
1188
1189 #[doc(hidden)]
1190 impl crate::RequestBuilder for ListHooks {
1191 fn request_options(&mut self) -> &mut crate::RequestOptions {
1192 &mut self.0.options
1193 }
1194 }
1195
1196 #[derive(Clone, Debug)]
1213 pub struct GetHook(RequestBuilder<crate::model::GetHookRequest>);
1214
1215 impl GetHook {
1216 pub(crate) fn new(
1217 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1218 ) -> Self {
1219 Self(RequestBuilder::new(stub))
1220 }
1221
1222 pub fn with_request<V: Into<crate::model::GetHookRequest>>(mut self, v: V) -> Self {
1224 self.0.request = v.into();
1225 self
1226 }
1227
1228 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1230 self.0.options = v.into();
1231 self
1232 }
1233
1234 pub async fn send(self) -> Result<crate::model::Hook> {
1236 (*self.0.stub)
1237 .get_hook(self.0.request, self.0.options)
1238 .await
1239 .map(crate::Response::into_body)
1240 }
1241
1242 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1246 self.0.request.name = v.into();
1247 self
1248 }
1249 }
1250
1251 #[doc(hidden)]
1252 impl crate::RequestBuilder for GetHook {
1253 fn request_options(&mut self) -> &mut crate::RequestOptions {
1254 &mut self.0.options
1255 }
1256 }
1257
1258 #[derive(Clone, Debug)]
1276 pub struct CreateHook(RequestBuilder<crate::model::CreateHookRequest>);
1277
1278 impl CreateHook {
1279 pub(crate) fn new(
1280 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1281 ) -> Self {
1282 Self(RequestBuilder::new(stub))
1283 }
1284
1285 pub fn with_request<V: Into<crate::model::CreateHookRequest>>(mut self, v: V) -> Self {
1287 self.0.request = v.into();
1288 self
1289 }
1290
1291 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1293 self.0.options = v.into();
1294 self
1295 }
1296
1297 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1304 (*self.0.stub)
1305 .create_hook(self.0.request, self.0.options)
1306 .await
1307 .map(crate::Response::into_body)
1308 }
1309
1310 pub fn poller(
1312 self,
1313 ) -> impl google_cloud_lro::Poller<crate::model::Hook, crate::model::OperationMetadata>
1314 {
1315 type Operation = google_cloud_lro::internal::Operation<
1316 crate::model::Hook,
1317 crate::model::OperationMetadata,
1318 >;
1319 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1320 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1321
1322 let stub = self.0.stub.clone();
1323 let mut options = self.0.options.clone();
1324 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1325 let query = move |name| {
1326 let stub = stub.clone();
1327 let options = options.clone();
1328 async {
1329 let op = GetOperation::new(stub)
1330 .set_name(name)
1331 .with_options(options)
1332 .send()
1333 .await?;
1334 Ok(Operation::new(op))
1335 }
1336 };
1337
1338 let start = move || async {
1339 let op = self.send().await?;
1340 Ok(Operation::new(op))
1341 };
1342
1343 google_cloud_lro::internal::new_poller(
1344 polling_error_policy,
1345 polling_backoff_policy,
1346 start,
1347 query,
1348 )
1349 }
1350
1351 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1355 self.0.request.parent = v.into();
1356 self
1357 }
1358
1359 pub fn set_hook<T>(mut self, v: T) -> Self
1363 where
1364 T: std::convert::Into<crate::model::Hook>,
1365 {
1366 self.0.request.hook = std::option::Option::Some(v.into());
1367 self
1368 }
1369
1370 pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
1374 where
1375 T: std::convert::Into<crate::model::Hook>,
1376 {
1377 self.0.request.hook = v.map(|x| x.into());
1378 self
1379 }
1380
1381 pub fn set_hook_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1385 self.0.request.hook_id = v.into();
1386 self
1387 }
1388 }
1389
1390 #[doc(hidden)]
1391 impl crate::RequestBuilder for CreateHook {
1392 fn request_options(&mut self) -> &mut crate::RequestOptions {
1393 &mut self.0.options
1394 }
1395 }
1396
1397 #[derive(Clone, Debug)]
1415 pub struct UpdateHook(RequestBuilder<crate::model::UpdateHookRequest>);
1416
1417 impl UpdateHook {
1418 pub(crate) fn new(
1419 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1420 ) -> Self {
1421 Self(RequestBuilder::new(stub))
1422 }
1423
1424 pub fn with_request<V: Into<crate::model::UpdateHookRequest>>(mut self, v: V) -> Self {
1426 self.0.request = v.into();
1427 self
1428 }
1429
1430 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1432 self.0.options = v.into();
1433 self
1434 }
1435
1436 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1443 (*self.0.stub)
1444 .update_hook(self.0.request, self.0.options)
1445 .await
1446 .map(crate::Response::into_body)
1447 }
1448
1449 pub fn poller(
1451 self,
1452 ) -> impl google_cloud_lro::Poller<crate::model::Hook, crate::model::OperationMetadata>
1453 {
1454 type Operation = google_cloud_lro::internal::Operation<
1455 crate::model::Hook,
1456 crate::model::OperationMetadata,
1457 >;
1458 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1459 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1460
1461 let stub = self.0.stub.clone();
1462 let mut options = self.0.options.clone();
1463 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1464 let query = move |name| {
1465 let stub = stub.clone();
1466 let options = options.clone();
1467 async {
1468 let op = GetOperation::new(stub)
1469 .set_name(name)
1470 .with_options(options)
1471 .send()
1472 .await?;
1473 Ok(Operation::new(op))
1474 }
1475 };
1476
1477 let start = move || async {
1478 let op = self.send().await?;
1479 Ok(Operation::new(op))
1480 };
1481
1482 google_cloud_lro::internal::new_poller(
1483 polling_error_policy,
1484 polling_backoff_policy,
1485 start,
1486 query,
1487 )
1488 }
1489
1490 pub fn set_update_mask<T>(mut self, v: T) -> Self
1494 where
1495 T: std::convert::Into<wkt::FieldMask>,
1496 {
1497 self.0.request.update_mask = std::option::Option::Some(v.into());
1498 self
1499 }
1500
1501 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1505 where
1506 T: std::convert::Into<wkt::FieldMask>,
1507 {
1508 self.0.request.update_mask = v.map(|x| x.into());
1509 self
1510 }
1511
1512 pub fn set_hook<T>(mut self, v: T) -> Self
1516 where
1517 T: std::convert::Into<crate::model::Hook>,
1518 {
1519 self.0.request.hook = std::option::Option::Some(v.into());
1520 self
1521 }
1522
1523 pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
1527 where
1528 T: std::convert::Into<crate::model::Hook>,
1529 {
1530 self.0.request.hook = v.map(|x| x.into());
1531 self
1532 }
1533 }
1534
1535 #[doc(hidden)]
1536 impl crate::RequestBuilder for UpdateHook {
1537 fn request_options(&mut self) -> &mut crate::RequestOptions {
1538 &mut self.0.options
1539 }
1540 }
1541
1542 #[derive(Clone, Debug)]
1560 pub struct DeleteHook(RequestBuilder<crate::model::DeleteHookRequest>);
1561
1562 impl DeleteHook {
1563 pub(crate) fn new(
1564 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1565 ) -> Self {
1566 Self(RequestBuilder::new(stub))
1567 }
1568
1569 pub fn with_request<V: Into<crate::model::DeleteHookRequest>>(mut self, v: V) -> Self {
1571 self.0.request = v.into();
1572 self
1573 }
1574
1575 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1577 self.0.options = v.into();
1578 self
1579 }
1580
1581 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1588 (*self.0.stub)
1589 .delete_hook(self.0.request, self.0.options)
1590 .await
1591 .map(crate::Response::into_body)
1592 }
1593
1594 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1596 type Operation =
1597 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1598 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1599 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1600
1601 let stub = self.0.stub.clone();
1602 let mut options = self.0.options.clone();
1603 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1604 let query = move |name| {
1605 let stub = stub.clone();
1606 let options = options.clone();
1607 async {
1608 let op = GetOperation::new(stub)
1609 .set_name(name)
1610 .with_options(options)
1611 .send()
1612 .await?;
1613 Ok(Operation::new(op))
1614 }
1615 };
1616
1617 let start = move || async {
1618 let op = self.send().await?;
1619 Ok(Operation::new(op))
1620 };
1621
1622 google_cloud_lro::internal::new_unit_response_poller(
1623 polling_error_policy,
1624 polling_backoff_policy,
1625 start,
1626 query,
1627 )
1628 }
1629
1630 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1634 self.0.request.name = v.into();
1635 self
1636 }
1637 }
1638
1639 #[doc(hidden)]
1640 impl crate::RequestBuilder for DeleteHook {
1641 fn request_options(&mut self) -> &mut crate::RequestOptions {
1642 &mut self.0.options
1643 }
1644 }
1645
1646 #[derive(Clone, Debug)]
1663 pub struct GetIamPolicyRepo(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1664
1665 impl GetIamPolicyRepo {
1666 pub(crate) fn new(
1667 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1668 ) -> Self {
1669 Self(RequestBuilder::new(stub))
1670 }
1671
1672 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1674 mut self,
1675 v: V,
1676 ) -> Self {
1677 self.0.request = v.into();
1678 self
1679 }
1680
1681 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1683 self.0.options = v.into();
1684 self
1685 }
1686
1687 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1689 (*self.0.stub)
1690 .get_iam_policy_repo(self.0.request, self.0.options)
1691 .await
1692 .map(crate::Response::into_body)
1693 }
1694
1695 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1699 self.0.request.resource = v.into();
1700 self
1701 }
1702
1703 pub fn set_options<T>(mut self, v: T) -> Self
1705 where
1706 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1707 {
1708 self.0.request.options = std::option::Option::Some(v.into());
1709 self
1710 }
1711
1712 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1714 where
1715 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1716 {
1717 self.0.request.options = v.map(|x| x.into());
1718 self
1719 }
1720 }
1721
1722 #[doc(hidden)]
1723 impl crate::RequestBuilder for GetIamPolicyRepo {
1724 fn request_options(&mut self) -> &mut crate::RequestOptions {
1725 &mut self.0.options
1726 }
1727 }
1728
1729 #[derive(Clone, Debug)]
1746 pub struct SetIamPolicyRepo(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1747
1748 impl SetIamPolicyRepo {
1749 pub(crate) fn new(
1750 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1751 ) -> Self {
1752 Self(RequestBuilder::new(stub))
1753 }
1754
1755 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1757 mut self,
1758 v: V,
1759 ) -> Self {
1760 self.0.request = v.into();
1761 self
1762 }
1763
1764 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1766 self.0.options = v.into();
1767 self
1768 }
1769
1770 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1772 (*self.0.stub)
1773 .set_iam_policy_repo(self.0.request, self.0.options)
1774 .await
1775 .map(crate::Response::into_body)
1776 }
1777
1778 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1782 self.0.request.resource = v.into();
1783 self
1784 }
1785
1786 pub fn set_policy<T>(mut self, v: T) -> Self
1790 where
1791 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1792 {
1793 self.0.request.policy = std::option::Option::Some(v.into());
1794 self
1795 }
1796
1797 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1801 where
1802 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1803 {
1804 self.0.request.policy = v.map(|x| x.into());
1805 self
1806 }
1807
1808 pub fn set_update_mask<T>(mut self, v: T) -> Self
1810 where
1811 T: std::convert::Into<wkt::FieldMask>,
1812 {
1813 self.0.request.update_mask = std::option::Option::Some(v.into());
1814 self
1815 }
1816
1817 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1819 where
1820 T: std::convert::Into<wkt::FieldMask>,
1821 {
1822 self.0.request.update_mask = v.map(|x| x.into());
1823 self
1824 }
1825 }
1826
1827 #[doc(hidden)]
1828 impl crate::RequestBuilder for SetIamPolicyRepo {
1829 fn request_options(&mut self) -> &mut crate::RequestOptions {
1830 &mut self.0.options
1831 }
1832 }
1833
1834 #[derive(Clone, Debug)]
1851 pub struct TestIamPermissionsRepo(
1852 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1853 );
1854
1855 impl TestIamPermissionsRepo {
1856 pub(crate) fn new(
1857 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1858 ) -> Self {
1859 Self(RequestBuilder::new(stub))
1860 }
1861
1862 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1864 mut self,
1865 v: V,
1866 ) -> Self {
1867 self.0.request = v.into();
1868 self
1869 }
1870
1871 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1873 self.0.options = v.into();
1874 self
1875 }
1876
1877 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1879 (*self.0.stub)
1880 .test_iam_permissions_repo(self.0.request, self.0.options)
1881 .await
1882 .map(crate::Response::into_body)
1883 }
1884
1885 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1889 self.0.request.resource = v.into();
1890 self
1891 }
1892
1893 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1897 where
1898 T: std::iter::IntoIterator<Item = V>,
1899 V: std::convert::Into<std::string::String>,
1900 {
1901 use std::iter::Iterator;
1902 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1903 self
1904 }
1905 }
1906
1907 #[doc(hidden)]
1908 impl crate::RequestBuilder for TestIamPermissionsRepo {
1909 fn request_options(&mut self) -> &mut crate::RequestOptions {
1910 &mut self.0.options
1911 }
1912 }
1913
1914 #[derive(Clone, Debug)]
1932 pub struct CreateBranchRule(RequestBuilder<crate::model::CreateBranchRuleRequest>);
1933
1934 impl CreateBranchRule {
1935 pub(crate) fn new(
1936 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1937 ) -> Self {
1938 Self(RequestBuilder::new(stub))
1939 }
1940
1941 pub fn with_request<V: Into<crate::model::CreateBranchRuleRequest>>(
1943 mut self,
1944 v: V,
1945 ) -> Self {
1946 self.0.request = v.into();
1947 self
1948 }
1949
1950 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1952 self.0.options = v.into();
1953 self
1954 }
1955
1956 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1963 (*self.0.stub)
1964 .create_branch_rule(self.0.request, self.0.options)
1965 .await
1966 .map(crate::Response::into_body)
1967 }
1968
1969 pub fn poller(
1971 self,
1972 ) -> impl google_cloud_lro::Poller<crate::model::BranchRule, crate::model::OperationMetadata>
1973 {
1974 type Operation = google_cloud_lro::internal::Operation<
1975 crate::model::BranchRule,
1976 crate::model::OperationMetadata,
1977 >;
1978 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1979 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1980
1981 let stub = self.0.stub.clone();
1982 let mut options = self.0.options.clone();
1983 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1984 let query = move |name| {
1985 let stub = stub.clone();
1986 let options = options.clone();
1987 async {
1988 let op = GetOperation::new(stub)
1989 .set_name(name)
1990 .with_options(options)
1991 .send()
1992 .await?;
1993 Ok(Operation::new(op))
1994 }
1995 };
1996
1997 let start = move || async {
1998 let op = self.send().await?;
1999 Ok(Operation::new(op))
2000 };
2001
2002 google_cloud_lro::internal::new_poller(
2003 polling_error_policy,
2004 polling_backoff_policy,
2005 start,
2006 query,
2007 )
2008 }
2009
2010 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2014 self.0.request.parent = v.into();
2015 self
2016 }
2017
2018 pub fn set_branch_rule<T>(mut self, v: T) -> Self
2022 where
2023 T: std::convert::Into<crate::model::BranchRule>,
2024 {
2025 self.0.request.branch_rule = std::option::Option::Some(v.into());
2026 self
2027 }
2028
2029 pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
2033 where
2034 T: std::convert::Into<crate::model::BranchRule>,
2035 {
2036 self.0.request.branch_rule = v.map(|x| x.into());
2037 self
2038 }
2039
2040 pub fn set_branch_rule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2044 self.0.request.branch_rule_id = v.into();
2045 self
2046 }
2047 }
2048
2049 #[doc(hidden)]
2050 impl crate::RequestBuilder for CreateBranchRule {
2051 fn request_options(&mut self) -> &mut crate::RequestOptions {
2052 &mut self.0.options
2053 }
2054 }
2055
2056 #[derive(Clone, Debug)]
2077 pub struct ListBranchRules(RequestBuilder<crate::model::ListBranchRulesRequest>);
2078
2079 impl ListBranchRules {
2080 pub(crate) fn new(
2081 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2082 ) -> Self {
2083 Self(RequestBuilder::new(stub))
2084 }
2085
2086 pub fn with_request<V: Into<crate::model::ListBranchRulesRequest>>(mut self, v: V) -> Self {
2088 self.0.request = v.into();
2089 self
2090 }
2091
2092 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2094 self.0.options = v.into();
2095 self
2096 }
2097
2098 pub async fn send(self) -> Result<crate::model::ListBranchRulesResponse> {
2100 (*self.0.stub)
2101 .list_branch_rules(self.0.request, self.0.options)
2102 .await
2103 .map(crate::Response::into_body)
2104 }
2105
2106 pub fn by_page(
2108 self,
2109 ) -> impl google_cloud_gax::paginator::Paginator<
2110 crate::model::ListBranchRulesResponse,
2111 crate::Error,
2112 > {
2113 use std::clone::Clone;
2114 let token = self.0.request.page_token.clone();
2115 let execute = move |token: String| {
2116 let mut builder = self.clone();
2117 builder.0.request = builder.0.request.set_page_token(token);
2118 builder.send()
2119 };
2120 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2121 }
2122
2123 pub fn by_item(
2125 self,
2126 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2127 crate::model::ListBranchRulesResponse,
2128 crate::Error,
2129 > {
2130 use google_cloud_gax::paginator::Paginator;
2131 self.by_page().items()
2132 }
2133
2134 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2138 self.0.request.parent = v.into();
2139 self
2140 }
2141
2142 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2144 self.0.request.page_size = v.into();
2145 self
2146 }
2147
2148 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2150 self.0.request.page_token = v.into();
2151 self
2152 }
2153 }
2154
2155 #[doc(hidden)]
2156 impl crate::RequestBuilder for ListBranchRules {
2157 fn request_options(&mut self) -> &mut crate::RequestOptions {
2158 &mut self.0.options
2159 }
2160 }
2161
2162 #[derive(Clone, Debug)]
2179 pub struct GetBranchRule(RequestBuilder<crate::model::GetBranchRuleRequest>);
2180
2181 impl GetBranchRule {
2182 pub(crate) fn new(
2183 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2184 ) -> Self {
2185 Self(RequestBuilder::new(stub))
2186 }
2187
2188 pub fn with_request<V: Into<crate::model::GetBranchRuleRequest>>(mut self, v: V) -> Self {
2190 self.0.request = v.into();
2191 self
2192 }
2193
2194 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2196 self.0.options = v.into();
2197 self
2198 }
2199
2200 pub async fn send(self) -> Result<crate::model::BranchRule> {
2202 (*self.0.stub)
2203 .get_branch_rule(self.0.request, self.0.options)
2204 .await
2205 .map(crate::Response::into_body)
2206 }
2207
2208 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2212 self.0.request.name = v.into();
2213 self
2214 }
2215 }
2216
2217 #[doc(hidden)]
2218 impl crate::RequestBuilder for GetBranchRule {
2219 fn request_options(&mut self) -> &mut crate::RequestOptions {
2220 &mut self.0.options
2221 }
2222 }
2223
2224 #[derive(Clone, Debug)]
2242 pub struct UpdateBranchRule(RequestBuilder<crate::model::UpdateBranchRuleRequest>);
2243
2244 impl UpdateBranchRule {
2245 pub(crate) fn new(
2246 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2247 ) -> Self {
2248 Self(RequestBuilder::new(stub))
2249 }
2250
2251 pub fn with_request<V: Into<crate::model::UpdateBranchRuleRequest>>(
2253 mut self,
2254 v: V,
2255 ) -> Self {
2256 self.0.request = v.into();
2257 self
2258 }
2259
2260 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2262 self.0.options = v.into();
2263 self
2264 }
2265
2266 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2273 (*self.0.stub)
2274 .update_branch_rule(self.0.request, self.0.options)
2275 .await
2276 .map(crate::Response::into_body)
2277 }
2278
2279 pub fn poller(
2281 self,
2282 ) -> impl google_cloud_lro::Poller<crate::model::BranchRule, crate::model::OperationMetadata>
2283 {
2284 type Operation = google_cloud_lro::internal::Operation<
2285 crate::model::BranchRule,
2286 crate::model::OperationMetadata,
2287 >;
2288 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2289 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2290
2291 let stub = self.0.stub.clone();
2292 let mut options = self.0.options.clone();
2293 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2294 let query = move |name| {
2295 let stub = stub.clone();
2296 let options = options.clone();
2297 async {
2298 let op = GetOperation::new(stub)
2299 .set_name(name)
2300 .with_options(options)
2301 .send()
2302 .await?;
2303 Ok(Operation::new(op))
2304 }
2305 };
2306
2307 let start = move || async {
2308 let op = self.send().await?;
2309 Ok(Operation::new(op))
2310 };
2311
2312 google_cloud_lro::internal::new_poller(
2313 polling_error_policy,
2314 polling_backoff_policy,
2315 start,
2316 query,
2317 )
2318 }
2319
2320 pub fn set_branch_rule<T>(mut self, v: T) -> Self
2324 where
2325 T: std::convert::Into<crate::model::BranchRule>,
2326 {
2327 self.0.request.branch_rule = std::option::Option::Some(v.into());
2328 self
2329 }
2330
2331 pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
2335 where
2336 T: std::convert::Into<crate::model::BranchRule>,
2337 {
2338 self.0.request.branch_rule = v.map(|x| x.into());
2339 self
2340 }
2341
2342 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2344 self.0.request.validate_only = v.into();
2345 self
2346 }
2347
2348 pub fn set_update_mask<T>(mut self, v: T) -> Self
2352 where
2353 T: std::convert::Into<wkt::FieldMask>,
2354 {
2355 self.0.request.update_mask = std::option::Option::Some(v.into());
2356 self
2357 }
2358
2359 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2363 where
2364 T: std::convert::Into<wkt::FieldMask>,
2365 {
2366 self.0.request.update_mask = v.map(|x| x.into());
2367 self
2368 }
2369 }
2370
2371 #[doc(hidden)]
2372 impl crate::RequestBuilder for UpdateBranchRule {
2373 fn request_options(&mut self) -> &mut crate::RequestOptions {
2374 &mut self.0.options
2375 }
2376 }
2377
2378 #[derive(Clone, Debug)]
2396 pub struct DeleteBranchRule(RequestBuilder<crate::model::DeleteBranchRuleRequest>);
2397
2398 impl DeleteBranchRule {
2399 pub(crate) fn new(
2400 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2401 ) -> Self {
2402 Self(RequestBuilder::new(stub))
2403 }
2404
2405 pub fn with_request<V: Into<crate::model::DeleteBranchRuleRequest>>(
2407 mut self,
2408 v: V,
2409 ) -> Self {
2410 self.0.request = v.into();
2411 self
2412 }
2413
2414 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2416 self.0.options = v.into();
2417 self
2418 }
2419
2420 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2427 (*self.0.stub)
2428 .delete_branch_rule(self.0.request, self.0.options)
2429 .await
2430 .map(crate::Response::into_body)
2431 }
2432
2433 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2435 type Operation =
2436 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2437 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2438 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2439
2440 let stub = self.0.stub.clone();
2441 let mut options = self.0.options.clone();
2442 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2443 let query = move |name| {
2444 let stub = stub.clone();
2445 let options = options.clone();
2446 async {
2447 let op = GetOperation::new(stub)
2448 .set_name(name)
2449 .with_options(options)
2450 .send()
2451 .await?;
2452 Ok(Operation::new(op))
2453 }
2454 };
2455
2456 let start = move || async {
2457 let op = self.send().await?;
2458 Ok(Operation::new(op))
2459 };
2460
2461 google_cloud_lro::internal::new_unit_response_poller(
2462 polling_error_policy,
2463 polling_backoff_policy,
2464 start,
2465 query,
2466 )
2467 }
2468
2469 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2473 self.0.request.name = v.into();
2474 self
2475 }
2476
2477 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2479 self.0.request.allow_missing = v.into();
2480 self
2481 }
2482 }
2483
2484 #[doc(hidden)]
2485 impl crate::RequestBuilder for DeleteBranchRule {
2486 fn request_options(&mut self) -> &mut crate::RequestOptions {
2487 &mut self.0.options
2488 }
2489 }
2490
2491 #[derive(Clone, Debug)]
2509 pub struct CreatePullRequest(RequestBuilder<crate::model::CreatePullRequestRequest>);
2510
2511 impl CreatePullRequest {
2512 pub(crate) fn new(
2513 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2514 ) -> Self {
2515 Self(RequestBuilder::new(stub))
2516 }
2517
2518 pub fn with_request<V: Into<crate::model::CreatePullRequestRequest>>(
2520 mut self,
2521 v: V,
2522 ) -> Self {
2523 self.0.request = v.into();
2524 self
2525 }
2526
2527 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2529 self.0.options = v.into();
2530 self
2531 }
2532
2533 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2540 (*self.0.stub)
2541 .create_pull_request(self.0.request, self.0.options)
2542 .await
2543 .map(crate::Response::into_body)
2544 }
2545
2546 pub fn poller(
2548 self,
2549 ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
2550 {
2551 type Operation = google_cloud_lro::internal::Operation<
2552 crate::model::PullRequest,
2553 crate::model::OperationMetadata,
2554 >;
2555 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2556 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2557
2558 let stub = self.0.stub.clone();
2559 let mut options = self.0.options.clone();
2560 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2561 let query = move |name| {
2562 let stub = stub.clone();
2563 let options = options.clone();
2564 async {
2565 let op = GetOperation::new(stub)
2566 .set_name(name)
2567 .with_options(options)
2568 .send()
2569 .await?;
2570 Ok(Operation::new(op))
2571 }
2572 };
2573
2574 let start = move || async {
2575 let op = self.send().await?;
2576 Ok(Operation::new(op))
2577 };
2578
2579 google_cloud_lro::internal::new_poller(
2580 polling_error_policy,
2581 polling_backoff_policy,
2582 start,
2583 query,
2584 )
2585 }
2586
2587 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2591 self.0.request.parent = v.into();
2592 self
2593 }
2594
2595 pub fn set_pull_request<T>(mut self, v: T) -> Self
2599 where
2600 T: std::convert::Into<crate::model::PullRequest>,
2601 {
2602 self.0.request.pull_request = std::option::Option::Some(v.into());
2603 self
2604 }
2605
2606 pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
2610 where
2611 T: std::convert::Into<crate::model::PullRequest>,
2612 {
2613 self.0.request.pull_request = v.map(|x| x.into());
2614 self
2615 }
2616 }
2617
2618 #[doc(hidden)]
2619 impl crate::RequestBuilder for CreatePullRequest {
2620 fn request_options(&mut self) -> &mut crate::RequestOptions {
2621 &mut self.0.options
2622 }
2623 }
2624
2625 #[derive(Clone, Debug)]
2642 pub struct GetPullRequest(RequestBuilder<crate::model::GetPullRequestRequest>);
2643
2644 impl GetPullRequest {
2645 pub(crate) fn new(
2646 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2647 ) -> Self {
2648 Self(RequestBuilder::new(stub))
2649 }
2650
2651 pub fn with_request<V: Into<crate::model::GetPullRequestRequest>>(mut self, v: V) -> Self {
2653 self.0.request = v.into();
2654 self
2655 }
2656
2657 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2659 self.0.options = v.into();
2660 self
2661 }
2662
2663 pub async fn send(self) -> Result<crate::model::PullRequest> {
2665 (*self.0.stub)
2666 .get_pull_request(self.0.request, self.0.options)
2667 .await
2668 .map(crate::Response::into_body)
2669 }
2670
2671 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2675 self.0.request.name = v.into();
2676 self
2677 }
2678 }
2679
2680 #[doc(hidden)]
2681 impl crate::RequestBuilder for GetPullRequest {
2682 fn request_options(&mut self) -> &mut crate::RequestOptions {
2683 &mut self.0.options
2684 }
2685 }
2686
2687 #[derive(Clone, Debug)]
2708 pub struct ListPullRequests(RequestBuilder<crate::model::ListPullRequestsRequest>);
2709
2710 impl ListPullRequests {
2711 pub(crate) fn new(
2712 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2713 ) -> Self {
2714 Self(RequestBuilder::new(stub))
2715 }
2716
2717 pub fn with_request<V: Into<crate::model::ListPullRequestsRequest>>(
2719 mut self,
2720 v: V,
2721 ) -> Self {
2722 self.0.request = v.into();
2723 self
2724 }
2725
2726 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2728 self.0.options = v.into();
2729 self
2730 }
2731
2732 pub async fn send(self) -> Result<crate::model::ListPullRequestsResponse> {
2734 (*self.0.stub)
2735 .list_pull_requests(self.0.request, self.0.options)
2736 .await
2737 .map(crate::Response::into_body)
2738 }
2739
2740 pub fn by_page(
2742 self,
2743 ) -> impl google_cloud_gax::paginator::Paginator<
2744 crate::model::ListPullRequestsResponse,
2745 crate::Error,
2746 > {
2747 use std::clone::Clone;
2748 let token = self.0.request.page_token.clone();
2749 let execute = move |token: String| {
2750 let mut builder = self.clone();
2751 builder.0.request = builder.0.request.set_page_token(token);
2752 builder.send()
2753 };
2754 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2755 }
2756
2757 pub fn by_item(
2759 self,
2760 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2761 crate::model::ListPullRequestsResponse,
2762 crate::Error,
2763 > {
2764 use google_cloud_gax::paginator::Paginator;
2765 self.by_page().items()
2766 }
2767
2768 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2772 self.0.request.parent = v.into();
2773 self
2774 }
2775
2776 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2778 self.0.request.page_size = v.into();
2779 self
2780 }
2781
2782 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2784 self.0.request.page_token = v.into();
2785 self
2786 }
2787 }
2788
2789 #[doc(hidden)]
2790 impl crate::RequestBuilder for ListPullRequests {
2791 fn request_options(&mut self) -> &mut crate::RequestOptions {
2792 &mut self.0.options
2793 }
2794 }
2795
2796 #[derive(Clone, Debug)]
2814 pub struct UpdatePullRequest(RequestBuilder<crate::model::UpdatePullRequestRequest>);
2815
2816 impl UpdatePullRequest {
2817 pub(crate) fn new(
2818 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2819 ) -> Self {
2820 Self(RequestBuilder::new(stub))
2821 }
2822
2823 pub fn with_request<V: Into<crate::model::UpdatePullRequestRequest>>(
2825 mut self,
2826 v: V,
2827 ) -> Self {
2828 self.0.request = v.into();
2829 self
2830 }
2831
2832 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2834 self.0.options = v.into();
2835 self
2836 }
2837
2838 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2845 (*self.0.stub)
2846 .update_pull_request(self.0.request, self.0.options)
2847 .await
2848 .map(crate::Response::into_body)
2849 }
2850
2851 pub fn poller(
2853 self,
2854 ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
2855 {
2856 type Operation = google_cloud_lro::internal::Operation<
2857 crate::model::PullRequest,
2858 crate::model::OperationMetadata,
2859 >;
2860 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2861 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2862
2863 let stub = self.0.stub.clone();
2864 let mut options = self.0.options.clone();
2865 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2866 let query = move |name| {
2867 let stub = stub.clone();
2868 let options = options.clone();
2869 async {
2870 let op = GetOperation::new(stub)
2871 .set_name(name)
2872 .with_options(options)
2873 .send()
2874 .await?;
2875 Ok(Operation::new(op))
2876 }
2877 };
2878
2879 let start = move || async {
2880 let op = self.send().await?;
2881 Ok(Operation::new(op))
2882 };
2883
2884 google_cloud_lro::internal::new_poller(
2885 polling_error_policy,
2886 polling_backoff_policy,
2887 start,
2888 query,
2889 )
2890 }
2891
2892 pub fn set_pull_request<T>(mut self, v: T) -> Self
2896 where
2897 T: std::convert::Into<crate::model::PullRequest>,
2898 {
2899 self.0.request.pull_request = std::option::Option::Some(v.into());
2900 self
2901 }
2902
2903 pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
2907 where
2908 T: std::convert::Into<crate::model::PullRequest>,
2909 {
2910 self.0.request.pull_request = v.map(|x| x.into());
2911 self
2912 }
2913
2914 pub fn set_update_mask<T>(mut self, v: T) -> Self
2916 where
2917 T: std::convert::Into<wkt::FieldMask>,
2918 {
2919 self.0.request.update_mask = std::option::Option::Some(v.into());
2920 self
2921 }
2922
2923 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2925 where
2926 T: std::convert::Into<wkt::FieldMask>,
2927 {
2928 self.0.request.update_mask = v.map(|x| x.into());
2929 self
2930 }
2931 }
2932
2933 #[doc(hidden)]
2934 impl crate::RequestBuilder for UpdatePullRequest {
2935 fn request_options(&mut self) -> &mut crate::RequestOptions {
2936 &mut self.0.options
2937 }
2938 }
2939
2940 #[derive(Clone, Debug)]
2958 pub struct MergePullRequest(RequestBuilder<crate::model::MergePullRequestRequest>);
2959
2960 impl MergePullRequest {
2961 pub(crate) fn new(
2962 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2963 ) -> Self {
2964 Self(RequestBuilder::new(stub))
2965 }
2966
2967 pub fn with_request<V: Into<crate::model::MergePullRequestRequest>>(
2969 mut self,
2970 v: V,
2971 ) -> Self {
2972 self.0.request = v.into();
2973 self
2974 }
2975
2976 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2978 self.0.options = v.into();
2979 self
2980 }
2981
2982 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2989 (*self.0.stub)
2990 .merge_pull_request(self.0.request, self.0.options)
2991 .await
2992 .map(crate::Response::into_body)
2993 }
2994
2995 pub fn poller(
2997 self,
2998 ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
2999 {
3000 type Operation = google_cloud_lro::internal::Operation<
3001 crate::model::PullRequest,
3002 crate::model::OperationMetadata,
3003 >;
3004 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3005 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3006
3007 let stub = self.0.stub.clone();
3008 let mut options = self.0.options.clone();
3009 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3010 let query = move |name| {
3011 let stub = stub.clone();
3012 let options = options.clone();
3013 async {
3014 let op = GetOperation::new(stub)
3015 .set_name(name)
3016 .with_options(options)
3017 .send()
3018 .await?;
3019 Ok(Operation::new(op))
3020 }
3021 };
3022
3023 let start = move || async {
3024 let op = self.send().await?;
3025 Ok(Operation::new(op))
3026 };
3027
3028 google_cloud_lro::internal::new_poller(
3029 polling_error_policy,
3030 polling_backoff_policy,
3031 start,
3032 query,
3033 )
3034 }
3035
3036 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3040 self.0.request.name = v.into();
3041 self
3042 }
3043 }
3044
3045 #[doc(hidden)]
3046 impl crate::RequestBuilder for MergePullRequest {
3047 fn request_options(&mut self) -> &mut crate::RequestOptions {
3048 &mut self.0.options
3049 }
3050 }
3051
3052 #[derive(Clone, Debug)]
3070 pub struct OpenPullRequest(RequestBuilder<crate::model::OpenPullRequestRequest>);
3071
3072 impl OpenPullRequest {
3073 pub(crate) fn new(
3074 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3075 ) -> Self {
3076 Self(RequestBuilder::new(stub))
3077 }
3078
3079 pub fn with_request<V: Into<crate::model::OpenPullRequestRequest>>(mut self, v: V) -> Self {
3081 self.0.request = v.into();
3082 self
3083 }
3084
3085 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3087 self.0.options = v.into();
3088 self
3089 }
3090
3091 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3098 (*self.0.stub)
3099 .open_pull_request(self.0.request, self.0.options)
3100 .await
3101 .map(crate::Response::into_body)
3102 }
3103
3104 pub fn poller(
3106 self,
3107 ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
3108 {
3109 type Operation = google_cloud_lro::internal::Operation<
3110 crate::model::PullRequest,
3111 crate::model::OperationMetadata,
3112 >;
3113 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3114 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3115
3116 let stub = self.0.stub.clone();
3117 let mut options = self.0.options.clone();
3118 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3119 let query = move |name| {
3120 let stub = stub.clone();
3121 let options = options.clone();
3122 async {
3123 let op = GetOperation::new(stub)
3124 .set_name(name)
3125 .with_options(options)
3126 .send()
3127 .await?;
3128 Ok(Operation::new(op))
3129 }
3130 };
3131
3132 let start = move || async {
3133 let op = self.send().await?;
3134 Ok(Operation::new(op))
3135 };
3136
3137 google_cloud_lro::internal::new_poller(
3138 polling_error_policy,
3139 polling_backoff_policy,
3140 start,
3141 query,
3142 )
3143 }
3144
3145 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3149 self.0.request.name = v.into();
3150 self
3151 }
3152 }
3153
3154 #[doc(hidden)]
3155 impl crate::RequestBuilder for OpenPullRequest {
3156 fn request_options(&mut self) -> &mut crate::RequestOptions {
3157 &mut self.0.options
3158 }
3159 }
3160
3161 #[derive(Clone, Debug)]
3179 pub struct ClosePullRequest(RequestBuilder<crate::model::ClosePullRequestRequest>);
3180
3181 impl ClosePullRequest {
3182 pub(crate) fn new(
3183 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3184 ) -> Self {
3185 Self(RequestBuilder::new(stub))
3186 }
3187
3188 pub fn with_request<V: Into<crate::model::ClosePullRequestRequest>>(
3190 mut self,
3191 v: V,
3192 ) -> Self {
3193 self.0.request = v.into();
3194 self
3195 }
3196
3197 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3199 self.0.options = v.into();
3200 self
3201 }
3202
3203 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3210 (*self.0.stub)
3211 .close_pull_request(self.0.request, self.0.options)
3212 .await
3213 .map(crate::Response::into_body)
3214 }
3215
3216 pub fn poller(
3218 self,
3219 ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
3220 {
3221 type Operation = google_cloud_lro::internal::Operation<
3222 crate::model::PullRequest,
3223 crate::model::OperationMetadata,
3224 >;
3225 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3226 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3227
3228 let stub = self.0.stub.clone();
3229 let mut options = self.0.options.clone();
3230 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3231 let query = move |name| {
3232 let stub = stub.clone();
3233 let options = options.clone();
3234 async {
3235 let op = GetOperation::new(stub)
3236 .set_name(name)
3237 .with_options(options)
3238 .send()
3239 .await?;
3240 Ok(Operation::new(op))
3241 }
3242 };
3243
3244 let start = move || async {
3245 let op = self.send().await?;
3246 Ok(Operation::new(op))
3247 };
3248
3249 google_cloud_lro::internal::new_poller(
3250 polling_error_policy,
3251 polling_backoff_policy,
3252 start,
3253 query,
3254 )
3255 }
3256
3257 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3261 self.0.request.name = v.into();
3262 self
3263 }
3264 }
3265
3266 #[doc(hidden)]
3267 impl crate::RequestBuilder for ClosePullRequest {
3268 fn request_options(&mut self) -> &mut crate::RequestOptions {
3269 &mut self.0.options
3270 }
3271 }
3272
3273 #[derive(Clone, Debug)]
3294 pub struct ListPullRequestFileDiffs(
3295 RequestBuilder<crate::model::ListPullRequestFileDiffsRequest>,
3296 );
3297
3298 impl ListPullRequestFileDiffs {
3299 pub(crate) fn new(
3300 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3301 ) -> Self {
3302 Self(RequestBuilder::new(stub))
3303 }
3304
3305 pub fn with_request<V: Into<crate::model::ListPullRequestFileDiffsRequest>>(
3307 mut self,
3308 v: V,
3309 ) -> Self {
3310 self.0.request = v.into();
3311 self
3312 }
3313
3314 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3316 self.0.options = v.into();
3317 self
3318 }
3319
3320 pub async fn send(self) -> Result<crate::model::ListPullRequestFileDiffsResponse> {
3322 (*self.0.stub)
3323 .list_pull_request_file_diffs(self.0.request, self.0.options)
3324 .await
3325 .map(crate::Response::into_body)
3326 }
3327
3328 pub fn by_page(
3330 self,
3331 ) -> impl google_cloud_gax::paginator::Paginator<
3332 crate::model::ListPullRequestFileDiffsResponse,
3333 crate::Error,
3334 > {
3335 use std::clone::Clone;
3336 let token = self.0.request.page_token.clone();
3337 let execute = move |token: String| {
3338 let mut builder = self.clone();
3339 builder.0.request = builder.0.request.set_page_token(token);
3340 builder.send()
3341 };
3342 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3343 }
3344
3345 pub fn by_item(
3347 self,
3348 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3349 crate::model::ListPullRequestFileDiffsResponse,
3350 crate::Error,
3351 > {
3352 use google_cloud_gax::paginator::Paginator;
3353 self.by_page().items()
3354 }
3355
3356 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3360 self.0.request.name = v.into();
3361 self
3362 }
3363
3364 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3366 self.0.request.page_size = v.into();
3367 self
3368 }
3369
3370 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3372 self.0.request.page_token = v.into();
3373 self
3374 }
3375 }
3376
3377 #[doc(hidden)]
3378 impl crate::RequestBuilder for ListPullRequestFileDiffs {
3379 fn request_options(&mut self) -> &mut crate::RequestOptions {
3380 &mut self.0.options
3381 }
3382 }
3383
3384 #[derive(Clone, Debug)]
3405 pub struct FetchTree(RequestBuilder<crate::model::FetchTreeRequest>);
3406
3407 impl FetchTree {
3408 pub(crate) fn new(
3409 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3410 ) -> Self {
3411 Self(RequestBuilder::new(stub))
3412 }
3413
3414 pub fn with_request<V: Into<crate::model::FetchTreeRequest>>(mut self, v: V) -> Self {
3416 self.0.request = v.into();
3417 self
3418 }
3419
3420 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3422 self.0.options = v.into();
3423 self
3424 }
3425
3426 pub async fn send(self) -> Result<crate::model::FetchTreeResponse> {
3428 (*self.0.stub)
3429 .fetch_tree(self.0.request, self.0.options)
3430 .await
3431 .map(crate::Response::into_body)
3432 }
3433
3434 pub fn by_page(
3436 self,
3437 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::FetchTreeResponse, crate::Error>
3438 {
3439 use std::clone::Clone;
3440 let token = self.0.request.page_token.clone();
3441 let execute = move |token: String| {
3442 let mut builder = self.clone();
3443 builder.0.request = builder.0.request.set_page_token(token);
3444 builder.send()
3445 };
3446 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3447 }
3448
3449 pub fn by_item(
3451 self,
3452 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::FetchTreeResponse, crate::Error>
3453 {
3454 use google_cloud_gax::paginator::Paginator;
3455 self.by_page().items()
3456 }
3457
3458 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
3462 self.0.request.repository = v.into();
3463 self
3464 }
3465
3466 pub fn set_ref<T: Into<std::string::String>>(mut self, v: T) -> Self {
3468 self.0.request.r#ref = v.into();
3469 self
3470 }
3471
3472 pub fn set_recursive<T: Into<bool>>(mut self, v: T) -> Self {
3474 self.0.request.recursive = v.into();
3475 self
3476 }
3477
3478 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3480 self.0.request.page_size = v.into();
3481 self
3482 }
3483
3484 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3486 self.0.request.page_token = v.into();
3487 self
3488 }
3489 }
3490
3491 #[doc(hidden)]
3492 impl crate::RequestBuilder for FetchTree {
3493 fn request_options(&mut self) -> &mut crate::RequestOptions {
3494 &mut self.0.options
3495 }
3496 }
3497
3498 #[derive(Clone, Debug)]
3515 pub struct FetchBlob(RequestBuilder<crate::model::FetchBlobRequest>);
3516
3517 impl FetchBlob {
3518 pub(crate) fn new(
3519 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3520 ) -> Self {
3521 Self(RequestBuilder::new(stub))
3522 }
3523
3524 pub fn with_request<V: Into<crate::model::FetchBlobRequest>>(mut self, v: V) -> Self {
3526 self.0.request = v.into();
3527 self
3528 }
3529
3530 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3532 self.0.options = v.into();
3533 self
3534 }
3535
3536 pub async fn send(self) -> Result<crate::model::FetchBlobResponse> {
3538 (*self.0.stub)
3539 .fetch_blob(self.0.request, self.0.options)
3540 .await
3541 .map(crate::Response::into_body)
3542 }
3543
3544 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
3548 self.0.request.repository = v.into();
3549 self
3550 }
3551
3552 pub fn set_sha<T: Into<std::string::String>>(mut self, v: T) -> Self {
3556 self.0.request.sha = v.into();
3557 self
3558 }
3559 }
3560
3561 #[doc(hidden)]
3562 impl crate::RequestBuilder for FetchBlob {
3563 fn request_options(&mut self) -> &mut crate::RequestOptions {
3564 &mut self.0.options
3565 }
3566 }
3567
3568 #[derive(Clone, Debug)]
3586 pub struct CreateIssue(RequestBuilder<crate::model::CreateIssueRequest>);
3587
3588 impl CreateIssue {
3589 pub(crate) fn new(
3590 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3591 ) -> Self {
3592 Self(RequestBuilder::new(stub))
3593 }
3594
3595 pub fn with_request<V: Into<crate::model::CreateIssueRequest>>(mut self, v: V) -> Self {
3597 self.0.request = v.into();
3598 self
3599 }
3600
3601 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3603 self.0.options = v.into();
3604 self
3605 }
3606
3607 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3614 (*self.0.stub)
3615 .create_issue(self.0.request, self.0.options)
3616 .await
3617 .map(crate::Response::into_body)
3618 }
3619
3620 pub fn poller(
3622 self,
3623 ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
3624 {
3625 type Operation = google_cloud_lro::internal::Operation<
3626 crate::model::Issue,
3627 crate::model::OperationMetadata,
3628 >;
3629 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3630 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3631
3632 let stub = self.0.stub.clone();
3633 let mut options = self.0.options.clone();
3634 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3635 let query = move |name| {
3636 let stub = stub.clone();
3637 let options = options.clone();
3638 async {
3639 let op = GetOperation::new(stub)
3640 .set_name(name)
3641 .with_options(options)
3642 .send()
3643 .await?;
3644 Ok(Operation::new(op))
3645 }
3646 };
3647
3648 let start = move || async {
3649 let op = self.send().await?;
3650 Ok(Operation::new(op))
3651 };
3652
3653 google_cloud_lro::internal::new_poller(
3654 polling_error_policy,
3655 polling_backoff_policy,
3656 start,
3657 query,
3658 )
3659 }
3660
3661 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3665 self.0.request.parent = v.into();
3666 self
3667 }
3668
3669 pub fn set_issue<T>(mut self, v: T) -> Self
3673 where
3674 T: std::convert::Into<crate::model::Issue>,
3675 {
3676 self.0.request.issue = std::option::Option::Some(v.into());
3677 self
3678 }
3679
3680 pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
3684 where
3685 T: std::convert::Into<crate::model::Issue>,
3686 {
3687 self.0.request.issue = v.map(|x| x.into());
3688 self
3689 }
3690 }
3691
3692 #[doc(hidden)]
3693 impl crate::RequestBuilder for CreateIssue {
3694 fn request_options(&mut self) -> &mut crate::RequestOptions {
3695 &mut self.0.options
3696 }
3697 }
3698
3699 #[derive(Clone, Debug)]
3716 pub struct GetIssue(RequestBuilder<crate::model::GetIssueRequest>);
3717
3718 impl GetIssue {
3719 pub(crate) fn new(
3720 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3721 ) -> Self {
3722 Self(RequestBuilder::new(stub))
3723 }
3724
3725 pub fn with_request<V: Into<crate::model::GetIssueRequest>>(mut self, v: V) -> Self {
3727 self.0.request = v.into();
3728 self
3729 }
3730
3731 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3733 self.0.options = v.into();
3734 self
3735 }
3736
3737 pub async fn send(self) -> Result<crate::model::Issue> {
3739 (*self.0.stub)
3740 .get_issue(self.0.request, self.0.options)
3741 .await
3742 .map(crate::Response::into_body)
3743 }
3744
3745 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3749 self.0.request.name = v.into();
3750 self
3751 }
3752 }
3753
3754 #[doc(hidden)]
3755 impl crate::RequestBuilder for GetIssue {
3756 fn request_options(&mut self) -> &mut crate::RequestOptions {
3757 &mut self.0.options
3758 }
3759 }
3760
3761 #[derive(Clone, Debug)]
3782 pub struct ListIssues(RequestBuilder<crate::model::ListIssuesRequest>);
3783
3784 impl ListIssues {
3785 pub(crate) fn new(
3786 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3787 ) -> Self {
3788 Self(RequestBuilder::new(stub))
3789 }
3790
3791 pub fn with_request<V: Into<crate::model::ListIssuesRequest>>(mut self, v: V) -> Self {
3793 self.0.request = v.into();
3794 self
3795 }
3796
3797 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3799 self.0.options = v.into();
3800 self
3801 }
3802
3803 pub async fn send(self) -> Result<crate::model::ListIssuesResponse> {
3805 (*self.0.stub)
3806 .list_issues(self.0.request, self.0.options)
3807 .await
3808 .map(crate::Response::into_body)
3809 }
3810
3811 pub fn by_page(
3813 self,
3814 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListIssuesResponse, crate::Error>
3815 {
3816 use std::clone::Clone;
3817 let token = self.0.request.page_token.clone();
3818 let execute = move |token: String| {
3819 let mut builder = self.clone();
3820 builder.0.request = builder.0.request.set_page_token(token);
3821 builder.send()
3822 };
3823 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3824 }
3825
3826 pub fn by_item(
3828 self,
3829 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3830 crate::model::ListIssuesResponse,
3831 crate::Error,
3832 > {
3833 use google_cloud_gax::paginator::Paginator;
3834 self.by_page().items()
3835 }
3836
3837 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3841 self.0.request.parent = v.into();
3842 self
3843 }
3844
3845 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3847 self.0.request.page_size = v.into();
3848 self
3849 }
3850
3851 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3853 self.0.request.page_token = v.into();
3854 self
3855 }
3856
3857 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3859 self.0.request.filter = v.into();
3860 self
3861 }
3862 }
3863
3864 #[doc(hidden)]
3865 impl crate::RequestBuilder for ListIssues {
3866 fn request_options(&mut self) -> &mut crate::RequestOptions {
3867 &mut self.0.options
3868 }
3869 }
3870
3871 #[derive(Clone, Debug)]
3889 pub struct UpdateIssue(RequestBuilder<crate::model::UpdateIssueRequest>);
3890
3891 impl UpdateIssue {
3892 pub(crate) fn new(
3893 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3894 ) -> Self {
3895 Self(RequestBuilder::new(stub))
3896 }
3897
3898 pub fn with_request<V: Into<crate::model::UpdateIssueRequest>>(mut self, v: V) -> Self {
3900 self.0.request = v.into();
3901 self
3902 }
3903
3904 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3906 self.0.options = v.into();
3907 self
3908 }
3909
3910 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3917 (*self.0.stub)
3918 .update_issue(self.0.request, self.0.options)
3919 .await
3920 .map(crate::Response::into_body)
3921 }
3922
3923 pub fn poller(
3925 self,
3926 ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
3927 {
3928 type Operation = google_cloud_lro::internal::Operation<
3929 crate::model::Issue,
3930 crate::model::OperationMetadata,
3931 >;
3932 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3933 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3934
3935 let stub = self.0.stub.clone();
3936 let mut options = self.0.options.clone();
3937 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3938 let query = move |name| {
3939 let stub = stub.clone();
3940 let options = options.clone();
3941 async {
3942 let op = GetOperation::new(stub)
3943 .set_name(name)
3944 .with_options(options)
3945 .send()
3946 .await?;
3947 Ok(Operation::new(op))
3948 }
3949 };
3950
3951 let start = move || async {
3952 let op = self.send().await?;
3953 Ok(Operation::new(op))
3954 };
3955
3956 google_cloud_lro::internal::new_poller(
3957 polling_error_policy,
3958 polling_backoff_policy,
3959 start,
3960 query,
3961 )
3962 }
3963
3964 pub fn set_issue<T>(mut self, v: T) -> Self
3968 where
3969 T: std::convert::Into<crate::model::Issue>,
3970 {
3971 self.0.request.issue = std::option::Option::Some(v.into());
3972 self
3973 }
3974
3975 pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
3979 where
3980 T: std::convert::Into<crate::model::Issue>,
3981 {
3982 self.0.request.issue = v.map(|x| x.into());
3983 self
3984 }
3985
3986 pub fn set_update_mask<T>(mut self, v: T) -> Self
3988 where
3989 T: std::convert::Into<wkt::FieldMask>,
3990 {
3991 self.0.request.update_mask = std::option::Option::Some(v.into());
3992 self
3993 }
3994
3995 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3997 where
3998 T: std::convert::Into<wkt::FieldMask>,
3999 {
4000 self.0.request.update_mask = v.map(|x| x.into());
4001 self
4002 }
4003 }
4004
4005 #[doc(hidden)]
4006 impl crate::RequestBuilder for UpdateIssue {
4007 fn request_options(&mut self) -> &mut crate::RequestOptions {
4008 &mut self.0.options
4009 }
4010 }
4011
4012 #[derive(Clone, Debug)]
4030 pub struct DeleteIssue(RequestBuilder<crate::model::DeleteIssueRequest>);
4031
4032 impl DeleteIssue {
4033 pub(crate) fn new(
4034 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4035 ) -> Self {
4036 Self(RequestBuilder::new(stub))
4037 }
4038
4039 pub fn with_request<V: Into<crate::model::DeleteIssueRequest>>(mut self, v: V) -> Self {
4041 self.0.request = v.into();
4042 self
4043 }
4044
4045 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4047 self.0.options = v.into();
4048 self
4049 }
4050
4051 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4058 (*self.0.stub)
4059 .delete_issue(self.0.request, self.0.options)
4060 .await
4061 .map(crate::Response::into_body)
4062 }
4063
4064 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4066 type Operation =
4067 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4068 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4069 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4070
4071 let stub = self.0.stub.clone();
4072 let mut options = self.0.options.clone();
4073 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4074 let query = move |name| {
4075 let stub = stub.clone();
4076 let options = options.clone();
4077 async {
4078 let op = GetOperation::new(stub)
4079 .set_name(name)
4080 .with_options(options)
4081 .send()
4082 .await?;
4083 Ok(Operation::new(op))
4084 }
4085 };
4086
4087 let start = move || async {
4088 let op = self.send().await?;
4089 Ok(Operation::new(op))
4090 };
4091
4092 google_cloud_lro::internal::new_unit_response_poller(
4093 polling_error_policy,
4094 polling_backoff_policy,
4095 start,
4096 query,
4097 )
4098 }
4099
4100 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4104 self.0.request.name = v.into();
4105 self
4106 }
4107
4108 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4110 self.0.request.etag = v.into();
4111 self
4112 }
4113 }
4114
4115 #[doc(hidden)]
4116 impl crate::RequestBuilder for DeleteIssue {
4117 fn request_options(&mut self) -> &mut crate::RequestOptions {
4118 &mut self.0.options
4119 }
4120 }
4121
4122 #[derive(Clone, Debug)]
4140 pub struct OpenIssue(RequestBuilder<crate::model::OpenIssueRequest>);
4141
4142 impl OpenIssue {
4143 pub(crate) fn new(
4144 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4145 ) -> Self {
4146 Self(RequestBuilder::new(stub))
4147 }
4148
4149 pub fn with_request<V: Into<crate::model::OpenIssueRequest>>(mut self, v: V) -> Self {
4151 self.0.request = v.into();
4152 self
4153 }
4154
4155 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4157 self.0.options = v.into();
4158 self
4159 }
4160
4161 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4168 (*self.0.stub)
4169 .open_issue(self.0.request, self.0.options)
4170 .await
4171 .map(crate::Response::into_body)
4172 }
4173
4174 pub fn poller(
4176 self,
4177 ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
4178 {
4179 type Operation = google_cloud_lro::internal::Operation<
4180 crate::model::Issue,
4181 crate::model::OperationMetadata,
4182 >;
4183 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4184 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4185
4186 let stub = self.0.stub.clone();
4187 let mut options = self.0.options.clone();
4188 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4189 let query = move |name| {
4190 let stub = stub.clone();
4191 let options = options.clone();
4192 async {
4193 let op = GetOperation::new(stub)
4194 .set_name(name)
4195 .with_options(options)
4196 .send()
4197 .await?;
4198 Ok(Operation::new(op))
4199 }
4200 };
4201
4202 let start = move || async {
4203 let op = self.send().await?;
4204 Ok(Operation::new(op))
4205 };
4206
4207 google_cloud_lro::internal::new_poller(
4208 polling_error_policy,
4209 polling_backoff_policy,
4210 start,
4211 query,
4212 )
4213 }
4214
4215 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4219 self.0.request.name = v.into();
4220 self
4221 }
4222
4223 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4225 self.0.request.etag = v.into();
4226 self
4227 }
4228 }
4229
4230 #[doc(hidden)]
4231 impl crate::RequestBuilder for OpenIssue {
4232 fn request_options(&mut self) -> &mut crate::RequestOptions {
4233 &mut self.0.options
4234 }
4235 }
4236
4237 #[derive(Clone, Debug)]
4255 pub struct CloseIssue(RequestBuilder<crate::model::CloseIssueRequest>);
4256
4257 impl CloseIssue {
4258 pub(crate) fn new(
4259 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4260 ) -> Self {
4261 Self(RequestBuilder::new(stub))
4262 }
4263
4264 pub fn with_request<V: Into<crate::model::CloseIssueRequest>>(mut self, v: V) -> Self {
4266 self.0.request = v.into();
4267 self
4268 }
4269
4270 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4272 self.0.options = v.into();
4273 self
4274 }
4275
4276 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4283 (*self.0.stub)
4284 .close_issue(self.0.request, self.0.options)
4285 .await
4286 .map(crate::Response::into_body)
4287 }
4288
4289 pub fn poller(
4291 self,
4292 ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
4293 {
4294 type Operation = google_cloud_lro::internal::Operation<
4295 crate::model::Issue,
4296 crate::model::OperationMetadata,
4297 >;
4298 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4299 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4300
4301 let stub = self.0.stub.clone();
4302 let mut options = self.0.options.clone();
4303 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4304 let query = move |name| {
4305 let stub = stub.clone();
4306 let options = options.clone();
4307 async {
4308 let op = GetOperation::new(stub)
4309 .set_name(name)
4310 .with_options(options)
4311 .send()
4312 .await?;
4313 Ok(Operation::new(op))
4314 }
4315 };
4316
4317 let start = move || async {
4318 let op = self.send().await?;
4319 Ok(Operation::new(op))
4320 };
4321
4322 google_cloud_lro::internal::new_poller(
4323 polling_error_policy,
4324 polling_backoff_policy,
4325 start,
4326 query,
4327 )
4328 }
4329
4330 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4334 self.0.request.name = v.into();
4335 self
4336 }
4337
4338 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4340 self.0.request.etag = v.into();
4341 self
4342 }
4343 }
4344
4345 #[doc(hidden)]
4346 impl crate::RequestBuilder for CloseIssue {
4347 fn request_options(&mut self) -> &mut crate::RequestOptions {
4348 &mut self.0.options
4349 }
4350 }
4351
4352 #[derive(Clone, Debug)]
4369 pub struct GetPullRequestComment(RequestBuilder<crate::model::GetPullRequestCommentRequest>);
4370
4371 impl GetPullRequestComment {
4372 pub(crate) fn new(
4373 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4374 ) -> Self {
4375 Self(RequestBuilder::new(stub))
4376 }
4377
4378 pub fn with_request<V: Into<crate::model::GetPullRequestCommentRequest>>(
4380 mut self,
4381 v: V,
4382 ) -> Self {
4383 self.0.request = v.into();
4384 self
4385 }
4386
4387 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4389 self.0.options = v.into();
4390 self
4391 }
4392
4393 pub async fn send(self) -> Result<crate::model::PullRequestComment> {
4395 (*self.0.stub)
4396 .get_pull_request_comment(self.0.request, self.0.options)
4397 .await
4398 .map(crate::Response::into_body)
4399 }
4400
4401 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4405 self.0.request.name = v.into();
4406 self
4407 }
4408 }
4409
4410 #[doc(hidden)]
4411 impl crate::RequestBuilder for GetPullRequestComment {
4412 fn request_options(&mut self) -> &mut crate::RequestOptions {
4413 &mut self.0.options
4414 }
4415 }
4416
4417 #[derive(Clone, Debug)]
4438 pub struct ListPullRequestComments(
4439 RequestBuilder<crate::model::ListPullRequestCommentsRequest>,
4440 );
4441
4442 impl ListPullRequestComments {
4443 pub(crate) fn new(
4444 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4445 ) -> Self {
4446 Self(RequestBuilder::new(stub))
4447 }
4448
4449 pub fn with_request<V: Into<crate::model::ListPullRequestCommentsRequest>>(
4451 mut self,
4452 v: V,
4453 ) -> Self {
4454 self.0.request = v.into();
4455 self
4456 }
4457
4458 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4460 self.0.options = v.into();
4461 self
4462 }
4463
4464 pub async fn send(self) -> Result<crate::model::ListPullRequestCommentsResponse> {
4466 (*self.0.stub)
4467 .list_pull_request_comments(self.0.request, self.0.options)
4468 .await
4469 .map(crate::Response::into_body)
4470 }
4471
4472 pub fn by_page(
4474 self,
4475 ) -> impl google_cloud_gax::paginator::Paginator<
4476 crate::model::ListPullRequestCommentsResponse,
4477 crate::Error,
4478 > {
4479 use std::clone::Clone;
4480 let token = self.0.request.page_token.clone();
4481 let execute = move |token: String| {
4482 let mut builder = self.clone();
4483 builder.0.request = builder.0.request.set_page_token(token);
4484 builder.send()
4485 };
4486 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4487 }
4488
4489 pub fn by_item(
4491 self,
4492 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4493 crate::model::ListPullRequestCommentsResponse,
4494 crate::Error,
4495 > {
4496 use google_cloud_gax::paginator::Paginator;
4497 self.by_page().items()
4498 }
4499
4500 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4504 self.0.request.parent = v.into();
4505 self
4506 }
4507
4508 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4510 self.0.request.page_size = v.into();
4511 self
4512 }
4513
4514 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4516 self.0.request.page_token = v.into();
4517 self
4518 }
4519 }
4520
4521 #[doc(hidden)]
4522 impl crate::RequestBuilder for ListPullRequestComments {
4523 fn request_options(&mut self) -> &mut crate::RequestOptions {
4524 &mut self.0.options
4525 }
4526 }
4527
4528 #[derive(Clone, Debug)]
4546 pub struct CreatePullRequestComment(
4547 RequestBuilder<crate::model::CreatePullRequestCommentRequest>,
4548 );
4549
4550 impl CreatePullRequestComment {
4551 pub(crate) fn new(
4552 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4553 ) -> Self {
4554 Self(RequestBuilder::new(stub))
4555 }
4556
4557 pub fn with_request<V: Into<crate::model::CreatePullRequestCommentRequest>>(
4559 mut self,
4560 v: V,
4561 ) -> Self {
4562 self.0.request = v.into();
4563 self
4564 }
4565
4566 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4568 self.0.options = v.into();
4569 self
4570 }
4571
4572 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4579 (*self.0.stub)
4580 .create_pull_request_comment(self.0.request, self.0.options)
4581 .await
4582 .map(crate::Response::into_body)
4583 }
4584
4585 pub fn poller(
4587 self,
4588 ) -> impl google_cloud_lro::Poller<
4589 crate::model::PullRequestComment,
4590 crate::model::OperationMetadata,
4591 > {
4592 type Operation = google_cloud_lro::internal::Operation<
4593 crate::model::PullRequestComment,
4594 crate::model::OperationMetadata,
4595 >;
4596 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4597 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4598
4599 let stub = self.0.stub.clone();
4600 let mut options = self.0.options.clone();
4601 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4602 let query = move |name| {
4603 let stub = stub.clone();
4604 let options = options.clone();
4605 async {
4606 let op = GetOperation::new(stub)
4607 .set_name(name)
4608 .with_options(options)
4609 .send()
4610 .await?;
4611 Ok(Operation::new(op))
4612 }
4613 };
4614
4615 let start = move || async {
4616 let op = self.send().await?;
4617 Ok(Operation::new(op))
4618 };
4619
4620 google_cloud_lro::internal::new_poller(
4621 polling_error_policy,
4622 polling_backoff_policy,
4623 start,
4624 query,
4625 )
4626 }
4627
4628 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4632 self.0.request.parent = v.into();
4633 self
4634 }
4635
4636 pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
4640 where
4641 T: std::convert::Into<crate::model::PullRequestComment>,
4642 {
4643 self.0.request.pull_request_comment = std::option::Option::Some(v.into());
4644 self
4645 }
4646
4647 pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
4651 where
4652 T: std::convert::Into<crate::model::PullRequestComment>,
4653 {
4654 self.0.request.pull_request_comment = v.map(|x| x.into());
4655 self
4656 }
4657 }
4658
4659 #[doc(hidden)]
4660 impl crate::RequestBuilder for CreatePullRequestComment {
4661 fn request_options(&mut self) -> &mut crate::RequestOptions {
4662 &mut self.0.options
4663 }
4664 }
4665
4666 #[derive(Clone, Debug)]
4684 pub struct UpdatePullRequestComment(
4685 RequestBuilder<crate::model::UpdatePullRequestCommentRequest>,
4686 );
4687
4688 impl UpdatePullRequestComment {
4689 pub(crate) fn new(
4690 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4691 ) -> Self {
4692 Self(RequestBuilder::new(stub))
4693 }
4694
4695 pub fn with_request<V: Into<crate::model::UpdatePullRequestCommentRequest>>(
4697 mut self,
4698 v: V,
4699 ) -> Self {
4700 self.0.request = v.into();
4701 self
4702 }
4703
4704 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4706 self.0.options = v.into();
4707 self
4708 }
4709
4710 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4717 (*self.0.stub)
4718 .update_pull_request_comment(self.0.request, self.0.options)
4719 .await
4720 .map(crate::Response::into_body)
4721 }
4722
4723 pub fn poller(
4725 self,
4726 ) -> impl google_cloud_lro::Poller<
4727 crate::model::PullRequestComment,
4728 crate::model::OperationMetadata,
4729 > {
4730 type Operation = google_cloud_lro::internal::Operation<
4731 crate::model::PullRequestComment,
4732 crate::model::OperationMetadata,
4733 >;
4734 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4735 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4736
4737 let stub = self.0.stub.clone();
4738 let mut options = self.0.options.clone();
4739 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4740 let query = move |name| {
4741 let stub = stub.clone();
4742 let options = options.clone();
4743 async {
4744 let op = GetOperation::new(stub)
4745 .set_name(name)
4746 .with_options(options)
4747 .send()
4748 .await?;
4749 Ok(Operation::new(op))
4750 }
4751 };
4752
4753 let start = move || async {
4754 let op = self.send().await?;
4755 Ok(Operation::new(op))
4756 };
4757
4758 google_cloud_lro::internal::new_poller(
4759 polling_error_policy,
4760 polling_backoff_policy,
4761 start,
4762 query,
4763 )
4764 }
4765
4766 pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
4770 where
4771 T: std::convert::Into<crate::model::PullRequestComment>,
4772 {
4773 self.0.request.pull_request_comment = std::option::Option::Some(v.into());
4774 self
4775 }
4776
4777 pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
4781 where
4782 T: std::convert::Into<crate::model::PullRequestComment>,
4783 {
4784 self.0.request.pull_request_comment = v.map(|x| x.into());
4785 self
4786 }
4787
4788 pub fn set_update_mask<T>(mut self, v: T) -> Self
4790 where
4791 T: std::convert::Into<wkt::FieldMask>,
4792 {
4793 self.0.request.update_mask = std::option::Option::Some(v.into());
4794 self
4795 }
4796
4797 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4799 where
4800 T: std::convert::Into<wkt::FieldMask>,
4801 {
4802 self.0.request.update_mask = v.map(|x| x.into());
4803 self
4804 }
4805 }
4806
4807 #[doc(hidden)]
4808 impl crate::RequestBuilder for UpdatePullRequestComment {
4809 fn request_options(&mut self) -> &mut crate::RequestOptions {
4810 &mut self.0.options
4811 }
4812 }
4813
4814 #[derive(Clone, Debug)]
4832 pub struct DeletePullRequestComment(
4833 RequestBuilder<crate::model::DeletePullRequestCommentRequest>,
4834 );
4835
4836 impl DeletePullRequestComment {
4837 pub(crate) fn new(
4838 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4839 ) -> Self {
4840 Self(RequestBuilder::new(stub))
4841 }
4842
4843 pub fn with_request<V: Into<crate::model::DeletePullRequestCommentRequest>>(
4845 mut self,
4846 v: V,
4847 ) -> Self {
4848 self.0.request = v.into();
4849 self
4850 }
4851
4852 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4854 self.0.options = v.into();
4855 self
4856 }
4857
4858 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4865 (*self.0.stub)
4866 .delete_pull_request_comment(self.0.request, self.0.options)
4867 .await
4868 .map(crate::Response::into_body)
4869 }
4870
4871 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4873 type Operation =
4874 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4875 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4876 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4877
4878 let stub = self.0.stub.clone();
4879 let mut options = self.0.options.clone();
4880 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4881 let query = move |name| {
4882 let stub = stub.clone();
4883 let options = options.clone();
4884 async {
4885 let op = GetOperation::new(stub)
4886 .set_name(name)
4887 .with_options(options)
4888 .send()
4889 .await?;
4890 Ok(Operation::new(op))
4891 }
4892 };
4893
4894 let start = move || async {
4895 let op = self.send().await?;
4896 Ok(Operation::new(op))
4897 };
4898
4899 google_cloud_lro::internal::new_unit_response_poller(
4900 polling_error_policy,
4901 polling_backoff_policy,
4902 start,
4903 query,
4904 )
4905 }
4906
4907 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4911 self.0.request.name = v.into();
4912 self
4913 }
4914 }
4915
4916 #[doc(hidden)]
4917 impl crate::RequestBuilder for DeletePullRequestComment {
4918 fn request_options(&mut self) -> &mut crate::RequestOptions {
4919 &mut self.0.options
4920 }
4921 }
4922
4923 #[derive(Clone, Debug)]
4941 pub struct BatchCreatePullRequestComments(
4942 RequestBuilder<crate::model::BatchCreatePullRequestCommentsRequest>,
4943 );
4944
4945 impl BatchCreatePullRequestComments {
4946 pub(crate) fn new(
4947 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4948 ) -> Self {
4949 Self(RequestBuilder::new(stub))
4950 }
4951
4952 pub fn with_request<V: Into<crate::model::BatchCreatePullRequestCommentsRequest>>(
4954 mut self,
4955 v: V,
4956 ) -> Self {
4957 self.0.request = v.into();
4958 self
4959 }
4960
4961 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4963 self.0.options = v.into();
4964 self
4965 }
4966
4967 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4974 (*self.0.stub)
4975 .batch_create_pull_request_comments(self.0.request, self.0.options)
4976 .await
4977 .map(crate::Response::into_body)
4978 }
4979
4980 pub fn poller(
4982 self,
4983 ) -> impl google_cloud_lro::Poller<
4984 crate::model::BatchCreatePullRequestCommentsResponse,
4985 crate::model::OperationMetadata,
4986 > {
4987 type Operation = google_cloud_lro::internal::Operation<
4988 crate::model::BatchCreatePullRequestCommentsResponse,
4989 crate::model::OperationMetadata,
4990 >;
4991 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4992 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4993
4994 let stub = self.0.stub.clone();
4995 let mut options = self.0.options.clone();
4996 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4997 let query = move |name| {
4998 let stub = stub.clone();
4999 let options = options.clone();
5000 async {
5001 let op = GetOperation::new(stub)
5002 .set_name(name)
5003 .with_options(options)
5004 .send()
5005 .await?;
5006 Ok(Operation::new(op))
5007 }
5008 };
5009
5010 let start = move || async {
5011 let op = self.send().await?;
5012 Ok(Operation::new(op))
5013 };
5014
5015 google_cloud_lro::internal::new_poller(
5016 polling_error_policy,
5017 polling_backoff_policy,
5018 start,
5019 query,
5020 )
5021 }
5022
5023 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5027 self.0.request.parent = v.into();
5028 self
5029 }
5030
5031 pub fn set_requests<T, V>(mut self, v: T) -> Self
5035 where
5036 T: std::iter::IntoIterator<Item = V>,
5037 V: std::convert::Into<crate::model::CreatePullRequestCommentRequest>,
5038 {
5039 use std::iter::Iterator;
5040 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
5041 self
5042 }
5043 }
5044
5045 #[doc(hidden)]
5046 impl crate::RequestBuilder for BatchCreatePullRequestComments {
5047 fn request_options(&mut self) -> &mut crate::RequestOptions {
5048 &mut self.0.options
5049 }
5050 }
5051
5052 #[derive(Clone, Debug)]
5070 pub struct ResolvePullRequestComments(
5071 RequestBuilder<crate::model::ResolvePullRequestCommentsRequest>,
5072 );
5073
5074 impl ResolvePullRequestComments {
5075 pub(crate) fn new(
5076 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5077 ) -> Self {
5078 Self(RequestBuilder::new(stub))
5079 }
5080
5081 pub fn with_request<V: Into<crate::model::ResolvePullRequestCommentsRequest>>(
5083 mut self,
5084 v: V,
5085 ) -> Self {
5086 self.0.request = v.into();
5087 self
5088 }
5089
5090 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5092 self.0.options = v.into();
5093 self
5094 }
5095
5096 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5103 (*self.0.stub)
5104 .resolve_pull_request_comments(self.0.request, self.0.options)
5105 .await
5106 .map(crate::Response::into_body)
5107 }
5108
5109 pub fn poller(
5111 self,
5112 ) -> impl google_cloud_lro::Poller<
5113 crate::model::ResolvePullRequestCommentsResponse,
5114 crate::model::OperationMetadata,
5115 > {
5116 type Operation = google_cloud_lro::internal::Operation<
5117 crate::model::ResolvePullRequestCommentsResponse,
5118 crate::model::OperationMetadata,
5119 >;
5120 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5121 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5122
5123 let stub = self.0.stub.clone();
5124 let mut options = self.0.options.clone();
5125 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5126 let query = move |name| {
5127 let stub = stub.clone();
5128 let options = options.clone();
5129 async {
5130 let op = GetOperation::new(stub)
5131 .set_name(name)
5132 .with_options(options)
5133 .send()
5134 .await?;
5135 Ok(Operation::new(op))
5136 }
5137 };
5138
5139 let start = move || async {
5140 let op = self.send().await?;
5141 Ok(Operation::new(op))
5142 };
5143
5144 google_cloud_lro::internal::new_poller(
5145 polling_error_policy,
5146 polling_backoff_policy,
5147 start,
5148 query,
5149 )
5150 }
5151
5152 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5156 self.0.request.parent = v.into();
5157 self
5158 }
5159
5160 pub fn set_names<T, V>(mut self, v: T) -> Self
5164 where
5165 T: std::iter::IntoIterator<Item = V>,
5166 V: std::convert::Into<std::string::String>,
5167 {
5168 use std::iter::Iterator;
5169 self.0.request.names = v.into_iter().map(|i| i.into()).collect();
5170 self
5171 }
5172
5173 pub fn set_auto_fill<T: Into<bool>>(mut self, v: T) -> Self {
5175 self.0.request.auto_fill = v.into();
5176 self
5177 }
5178 }
5179
5180 #[doc(hidden)]
5181 impl crate::RequestBuilder for ResolvePullRequestComments {
5182 fn request_options(&mut self) -> &mut crate::RequestOptions {
5183 &mut self.0.options
5184 }
5185 }
5186
5187 #[derive(Clone, Debug)]
5205 pub struct UnresolvePullRequestComments(
5206 RequestBuilder<crate::model::UnresolvePullRequestCommentsRequest>,
5207 );
5208
5209 impl UnresolvePullRequestComments {
5210 pub(crate) fn new(
5211 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5212 ) -> Self {
5213 Self(RequestBuilder::new(stub))
5214 }
5215
5216 pub fn with_request<V: Into<crate::model::UnresolvePullRequestCommentsRequest>>(
5218 mut self,
5219 v: V,
5220 ) -> Self {
5221 self.0.request = v.into();
5222 self
5223 }
5224
5225 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5227 self.0.options = v.into();
5228 self
5229 }
5230
5231 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5238 (*self.0.stub)
5239 .unresolve_pull_request_comments(self.0.request, self.0.options)
5240 .await
5241 .map(crate::Response::into_body)
5242 }
5243
5244 pub fn poller(
5246 self,
5247 ) -> impl google_cloud_lro::Poller<
5248 crate::model::UnresolvePullRequestCommentsResponse,
5249 crate::model::OperationMetadata,
5250 > {
5251 type Operation = google_cloud_lro::internal::Operation<
5252 crate::model::UnresolvePullRequestCommentsResponse,
5253 crate::model::OperationMetadata,
5254 >;
5255 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5256 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5257
5258 let stub = self.0.stub.clone();
5259 let mut options = self.0.options.clone();
5260 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5261 let query = move |name| {
5262 let stub = stub.clone();
5263 let options = options.clone();
5264 async {
5265 let op = GetOperation::new(stub)
5266 .set_name(name)
5267 .with_options(options)
5268 .send()
5269 .await?;
5270 Ok(Operation::new(op))
5271 }
5272 };
5273
5274 let start = move || async {
5275 let op = self.send().await?;
5276 Ok(Operation::new(op))
5277 };
5278
5279 google_cloud_lro::internal::new_poller(
5280 polling_error_policy,
5281 polling_backoff_policy,
5282 start,
5283 query,
5284 )
5285 }
5286
5287 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5291 self.0.request.parent = v.into();
5292 self
5293 }
5294
5295 pub fn set_names<T, V>(mut self, v: T) -> Self
5299 where
5300 T: std::iter::IntoIterator<Item = V>,
5301 V: std::convert::Into<std::string::String>,
5302 {
5303 use std::iter::Iterator;
5304 self.0.request.names = v.into_iter().map(|i| i.into()).collect();
5305 self
5306 }
5307
5308 pub fn set_auto_fill<T: Into<bool>>(mut self, v: T) -> Self {
5310 self.0.request.auto_fill = v.into();
5311 self
5312 }
5313 }
5314
5315 #[doc(hidden)]
5316 impl crate::RequestBuilder for UnresolvePullRequestComments {
5317 fn request_options(&mut self) -> &mut crate::RequestOptions {
5318 &mut self.0.options
5319 }
5320 }
5321
5322 #[derive(Clone, Debug)]
5340 pub struct CreateIssueComment(RequestBuilder<crate::model::CreateIssueCommentRequest>);
5341
5342 impl CreateIssueComment {
5343 pub(crate) fn new(
5344 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5345 ) -> Self {
5346 Self(RequestBuilder::new(stub))
5347 }
5348
5349 pub fn with_request<V: Into<crate::model::CreateIssueCommentRequest>>(
5351 mut self,
5352 v: V,
5353 ) -> Self {
5354 self.0.request = v.into();
5355 self
5356 }
5357
5358 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5360 self.0.options = v.into();
5361 self
5362 }
5363
5364 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5371 (*self.0.stub)
5372 .create_issue_comment(self.0.request, self.0.options)
5373 .await
5374 .map(crate::Response::into_body)
5375 }
5376
5377 pub fn poller(
5379 self,
5380 ) -> impl google_cloud_lro::Poller<crate::model::IssueComment, crate::model::OperationMetadata>
5381 {
5382 type Operation = google_cloud_lro::internal::Operation<
5383 crate::model::IssueComment,
5384 crate::model::OperationMetadata,
5385 >;
5386 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5387 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5388
5389 let stub = self.0.stub.clone();
5390 let mut options = self.0.options.clone();
5391 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5392 let query = move |name| {
5393 let stub = stub.clone();
5394 let options = options.clone();
5395 async {
5396 let op = GetOperation::new(stub)
5397 .set_name(name)
5398 .with_options(options)
5399 .send()
5400 .await?;
5401 Ok(Operation::new(op))
5402 }
5403 };
5404
5405 let start = move || async {
5406 let op = self.send().await?;
5407 Ok(Operation::new(op))
5408 };
5409
5410 google_cloud_lro::internal::new_poller(
5411 polling_error_policy,
5412 polling_backoff_policy,
5413 start,
5414 query,
5415 )
5416 }
5417
5418 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5422 self.0.request.parent = v.into();
5423 self
5424 }
5425
5426 pub fn set_issue_comment<T>(mut self, v: T) -> Self
5430 where
5431 T: std::convert::Into<crate::model::IssueComment>,
5432 {
5433 self.0.request.issue_comment = std::option::Option::Some(v.into());
5434 self
5435 }
5436
5437 pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
5441 where
5442 T: std::convert::Into<crate::model::IssueComment>,
5443 {
5444 self.0.request.issue_comment = v.map(|x| x.into());
5445 self
5446 }
5447 }
5448
5449 #[doc(hidden)]
5450 impl crate::RequestBuilder for CreateIssueComment {
5451 fn request_options(&mut self) -> &mut crate::RequestOptions {
5452 &mut self.0.options
5453 }
5454 }
5455
5456 #[derive(Clone, Debug)]
5473 pub struct GetIssueComment(RequestBuilder<crate::model::GetIssueCommentRequest>);
5474
5475 impl GetIssueComment {
5476 pub(crate) fn new(
5477 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5478 ) -> Self {
5479 Self(RequestBuilder::new(stub))
5480 }
5481
5482 pub fn with_request<V: Into<crate::model::GetIssueCommentRequest>>(mut self, v: V) -> Self {
5484 self.0.request = v.into();
5485 self
5486 }
5487
5488 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5490 self.0.options = v.into();
5491 self
5492 }
5493
5494 pub async fn send(self) -> Result<crate::model::IssueComment> {
5496 (*self.0.stub)
5497 .get_issue_comment(self.0.request, self.0.options)
5498 .await
5499 .map(crate::Response::into_body)
5500 }
5501
5502 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5506 self.0.request.name = v.into();
5507 self
5508 }
5509 }
5510
5511 #[doc(hidden)]
5512 impl crate::RequestBuilder for GetIssueComment {
5513 fn request_options(&mut self) -> &mut crate::RequestOptions {
5514 &mut self.0.options
5515 }
5516 }
5517
5518 #[derive(Clone, Debug)]
5539 pub struct ListIssueComments(RequestBuilder<crate::model::ListIssueCommentsRequest>);
5540
5541 impl ListIssueComments {
5542 pub(crate) fn new(
5543 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5544 ) -> Self {
5545 Self(RequestBuilder::new(stub))
5546 }
5547
5548 pub fn with_request<V: Into<crate::model::ListIssueCommentsRequest>>(
5550 mut self,
5551 v: V,
5552 ) -> Self {
5553 self.0.request = v.into();
5554 self
5555 }
5556
5557 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5559 self.0.options = v.into();
5560 self
5561 }
5562
5563 pub async fn send(self) -> Result<crate::model::ListIssueCommentsResponse> {
5565 (*self.0.stub)
5566 .list_issue_comments(self.0.request, self.0.options)
5567 .await
5568 .map(crate::Response::into_body)
5569 }
5570
5571 pub fn by_page(
5573 self,
5574 ) -> impl google_cloud_gax::paginator::Paginator<
5575 crate::model::ListIssueCommentsResponse,
5576 crate::Error,
5577 > {
5578 use std::clone::Clone;
5579 let token = self.0.request.page_token.clone();
5580 let execute = move |token: String| {
5581 let mut builder = self.clone();
5582 builder.0.request = builder.0.request.set_page_token(token);
5583 builder.send()
5584 };
5585 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5586 }
5587
5588 pub fn by_item(
5590 self,
5591 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5592 crate::model::ListIssueCommentsResponse,
5593 crate::Error,
5594 > {
5595 use google_cloud_gax::paginator::Paginator;
5596 self.by_page().items()
5597 }
5598
5599 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5603 self.0.request.parent = v.into();
5604 self
5605 }
5606
5607 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5609 self.0.request.page_size = v.into();
5610 self
5611 }
5612
5613 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5615 self.0.request.page_token = v.into();
5616 self
5617 }
5618 }
5619
5620 #[doc(hidden)]
5621 impl crate::RequestBuilder for ListIssueComments {
5622 fn request_options(&mut self) -> &mut crate::RequestOptions {
5623 &mut self.0.options
5624 }
5625 }
5626
5627 #[derive(Clone, Debug)]
5645 pub struct UpdateIssueComment(RequestBuilder<crate::model::UpdateIssueCommentRequest>);
5646
5647 impl UpdateIssueComment {
5648 pub(crate) fn new(
5649 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5650 ) -> Self {
5651 Self(RequestBuilder::new(stub))
5652 }
5653
5654 pub fn with_request<V: Into<crate::model::UpdateIssueCommentRequest>>(
5656 mut self,
5657 v: V,
5658 ) -> Self {
5659 self.0.request = v.into();
5660 self
5661 }
5662
5663 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5665 self.0.options = v.into();
5666 self
5667 }
5668
5669 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5676 (*self.0.stub)
5677 .update_issue_comment(self.0.request, self.0.options)
5678 .await
5679 .map(crate::Response::into_body)
5680 }
5681
5682 pub fn poller(
5684 self,
5685 ) -> impl google_cloud_lro::Poller<crate::model::IssueComment, crate::model::OperationMetadata>
5686 {
5687 type Operation = google_cloud_lro::internal::Operation<
5688 crate::model::IssueComment,
5689 crate::model::OperationMetadata,
5690 >;
5691 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5692 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5693
5694 let stub = self.0.stub.clone();
5695 let mut options = self.0.options.clone();
5696 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5697 let query = move |name| {
5698 let stub = stub.clone();
5699 let options = options.clone();
5700 async {
5701 let op = GetOperation::new(stub)
5702 .set_name(name)
5703 .with_options(options)
5704 .send()
5705 .await?;
5706 Ok(Operation::new(op))
5707 }
5708 };
5709
5710 let start = move || async {
5711 let op = self.send().await?;
5712 Ok(Operation::new(op))
5713 };
5714
5715 google_cloud_lro::internal::new_poller(
5716 polling_error_policy,
5717 polling_backoff_policy,
5718 start,
5719 query,
5720 )
5721 }
5722
5723 pub fn set_issue_comment<T>(mut self, v: T) -> Self
5727 where
5728 T: std::convert::Into<crate::model::IssueComment>,
5729 {
5730 self.0.request.issue_comment = std::option::Option::Some(v.into());
5731 self
5732 }
5733
5734 pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
5738 where
5739 T: std::convert::Into<crate::model::IssueComment>,
5740 {
5741 self.0.request.issue_comment = v.map(|x| x.into());
5742 self
5743 }
5744
5745 pub fn set_update_mask<T>(mut self, v: T) -> Self
5747 where
5748 T: std::convert::Into<wkt::FieldMask>,
5749 {
5750 self.0.request.update_mask = std::option::Option::Some(v.into());
5751 self
5752 }
5753
5754 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5756 where
5757 T: std::convert::Into<wkt::FieldMask>,
5758 {
5759 self.0.request.update_mask = v.map(|x| x.into());
5760 self
5761 }
5762 }
5763
5764 #[doc(hidden)]
5765 impl crate::RequestBuilder for UpdateIssueComment {
5766 fn request_options(&mut self) -> &mut crate::RequestOptions {
5767 &mut self.0.options
5768 }
5769 }
5770
5771 #[derive(Clone, Debug)]
5789 pub struct DeleteIssueComment(RequestBuilder<crate::model::DeleteIssueCommentRequest>);
5790
5791 impl DeleteIssueComment {
5792 pub(crate) fn new(
5793 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5794 ) -> Self {
5795 Self(RequestBuilder::new(stub))
5796 }
5797
5798 pub fn with_request<V: Into<crate::model::DeleteIssueCommentRequest>>(
5800 mut self,
5801 v: V,
5802 ) -> Self {
5803 self.0.request = v.into();
5804 self
5805 }
5806
5807 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5809 self.0.options = v.into();
5810 self
5811 }
5812
5813 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5820 (*self.0.stub)
5821 .delete_issue_comment(self.0.request, self.0.options)
5822 .await
5823 .map(crate::Response::into_body)
5824 }
5825
5826 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5828 type Operation =
5829 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5830 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5831 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5832
5833 let stub = self.0.stub.clone();
5834 let mut options = self.0.options.clone();
5835 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5836 let query = move |name| {
5837 let stub = stub.clone();
5838 let options = options.clone();
5839 async {
5840 let op = GetOperation::new(stub)
5841 .set_name(name)
5842 .with_options(options)
5843 .send()
5844 .await?;
5845 Ok(Operation::new(op))
5846 }
5847 };
5848
5849 let start = move || async {
5850 let op = self.send().await?;
5851 Ok(Operation::new(op))
5852 };
5853
5854 google_cloud_lro::internal::new_unit_response_poller(
5855 polling_error_policy,
5856 polling_backoff_policy,
5857 start,
5858 query,
5859 )
5860 }
5861
5862 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5866 self.0.request.name = v.into();
5867 self
5868 }
5869 }
5870
5871 #[doc(hidden)]
5872 impl crate::RequestBuilder for DeleteIssueComment {
5873 fn request_options(&mut self) -> &mut crate::RequestOptions {
5874 &mut self.0.options
5875 }
5876 }
5877
5878 #[derive(Clone, Debug)]
5899 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5900
5901 impl ListLocations {
5902 pub(crate) fn new(
5903 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5904 ) -> Self {
5905 Self(RequestBuilder::new(stub))
5906 }
5907
5908 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5910 mut self,
5911 v: V,
5912 ) -> Self {
5913 self.0.request = v.into();
5914 self
5915 }
5916
5917 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5919 self.0.options = v.into();
5920 self
5921 }
5922
5923 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5925 (*self.0.stub)
5926 .list_locations(self.0.request, self.0.options)
5927 .await
5928 .map(crate::Response::into_body)
5929 }
5930
5931 pub fn by_page(
5933 self,
5934 ) -> impl google_cloud_gax::paginator::Paginator<
5935 google_cloud_location::model::ListLocationsResponse,
5936 crate::Error,
5937 > {
5938 use std::clone::Clone;
5939 let token = self.0.request.page_token.clone();
5940 let execute = move |token: String| {
5941 let mut builder = self.clone();
5942 builder.0.request = builder.0.request.set_page_token(token);
5943 builder.send()
5944 };
5945 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5946 }
5947
5948 pub fn by_item(
5950 self,
5951 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5952 google_cloud_location::model::ListLocationsResponse,
5953 crate::Error,
5954 > {
5955 use google_cloud_gax::paginator::Paginator;
5956 self.by_page().items()
5957 }
5958
5959 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5961 self.0.request.name = v.into();
5962 self
5963 }
5964
5965 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5967 self.0.request.filter = v.into();
5968 self
5969 }
5970
5971 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5973 self.0.request.page_size = v.into();
5974 self
5975 }
5976
5977 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5979 self.0.request.page_token = v.into();
5980 self
5981 }
5982 }
5983
5984 #[doc(hidden)]
5985 impl crate::RequestBuilder for ListLocations {
5986 fn request_options(&mut self) -> &mut crate::RequestOptions {
5987 &mut self.0.options
5988 }
5989 }
5990
5991 #[derive(Clone, Debug)]
6008 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6009
6010 impl GetLocation {
6011 pub(crate) fn new(
6012 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6013 ) -> Self {
6014 Self(RequestBuilder::new(stub))
6015 }
6016
6017 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6019 mut self,
6020 v: V,
6021 ) -> Self {
6022 self.0.request = v.into();
6023 self
6024 }
6025
6026 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6028 self.0.options = v.into();
6029 self
6030 }
6031
6032 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6034 (*self.0.stub)
6035 .get_location(self.0.request, self.0.options)
6036 .await
6037 .map(crate::Response::into_body)
6038 }
6039
6040 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6042 self.0.request.name = v.into();
6043 self
6044 }
6045 }
6046
6047 #[doc(hidden)]
6048 impl crate::RequestBuilder for GetLocation {
6049 fn request_options(&mut self) -> &mut crate::RequestOptions {
6050 &mut self.0.options
6051 }
6052 }
6053
6054 #[derive(Clone, Debug)]
6071 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6072
6073 impl SetIamPolicy {
6074 pub(crate) fn new(
6075 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6076 ) -> Self {
6077 Self(RequestBuilder::new(stub))
6078 }
6079
6080 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6082 mut self,
6083 v: V,
6084 ) -> Self {
6085 self.0.request = v.into();
6086 self
6087 }
6088
6089 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6091 self.0.options = v.into();
6092 self
6093 }
6094
6095 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6097 (*self.0.stub)
6098 .set_iam_policy(self.0.request, self.0.options)
6099 .await
6100 .map(crate::Response::into_body)
6101 }
6102
6103 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6107 self.0.request.resource = v.into();
6108 self
6109 }
6110
6111 pub fn set_policy<T>(mut self, v: T) -> Self
6115 where
6116 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6117 {
6118 self.0.request.policy = std::option::Option::Some(v.into());
6119 self
6120 }
6121
6122 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6126 where
6127 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6128 {
6129 self.0.request.policy = v.map(|x| x.into());
6130 self
6131 }
6132
6133 pub fn set_update_mask<T>(mut self, v: T) -> Self
6135 where
6136 T: std::convert::Into<wkt::FieldMask>,
6137 {
6138 self.0.request.update_mask = std::option::Option::Some(v.into());
6139 self
6140 }
6141
6142 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6144 where
6145 T: std::convert::Into<wkt::FieldMask>,
6146 {
6147 self.0.request.update_mask = v.map(|x| x.into());
6148 self
6149 }
6150 }
6151
6152 #[doc(hidden)]
6153 impl crate::RequestBuilder for SetIamPolicy {
6154 fn request_options(&mut self) -> &mut crate::RequestOptions {
6155 &mut self.0.options
6156 }
6157 }
6158
6159 #[derive(Clone, Debug)]
6176 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6177
6178 impl GetIamPolicy {
6179 pub(crate) fn new(
6180 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6181 ) -> Self {
6182 Self(RequestBuilder::new(stub))
6183 }
6184
6185 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6187 mut self,
6188 v: V,
6189 ) -> Self {
6190 self.0.request = v.into();
6191 self
6192 }
6193
6194 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6196 self.0.options = v.into();
6197 self
6198 }
6199
6200 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6202 (*self.0.stub)
6203 .get_iam_policy(self.0.request, self.0.options)
6204 .await
6205 .map(crate::Response::into_body)
6206 }
6207
6208 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6212 self.0.request.resource = v.into();
6213 self
6214 }
6215
6216 pub fn set_options<T>(mut self, v: T) -> Self
6218 where
6219 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6220 {
6221 self.0.request.options = std::option::Option::Some(v.into());
6222 self
6223 }
6224
6225 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6227 where
6228 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6229 {
6230 self.0.request.options = v.map(|x| x.into());
6231 self
6232 }
6233 }
6234
6235 #[doc(hidden)]
6236 impl crate::RequestBuilder for GetIamPolicy {
6237 fn request_options(&mut self) -> &mut crate::RequestOptions {
6238 &mut self.0.options
6239 }
6240 }
6241
6242 #[derive(Clone, Debug)]
6259 pub struct TestIamPermissions(
6260 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6261 );
6262
6263 impl TestIamPermissions {
6264 pub(crate) fn new(
6265 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6266 ) -> Self {
6267 Self(RequestBuilder::new(stub))
6268 }
6269
6270 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6272 mut self,
6273 v: V,
6274 ) -> Self {
6275 self.0.request = v.into();
6276 self
6277 }
6278
6279 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6281 self.0.options = v.into();
6282 self
6283 }
6284
6285 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6287 (*self.0.stub)
6288 .test_iam_permissions(self.0.request, self.0.options)
6289 .await
6290 .map(crate::Response::into_body)
6291 }
6292
6293 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6297 self.0.request.resource = v.into();
6298 self
6299 }
6300
6301 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6305 where
6306 T: std::iter::IntoIterator<Item = V>,
6307 V: std::convert::Into<std::string::String>,
6308 {
6309 use std::iter::Iterator;
6310 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6311 self
6312 }
6313 }
6314
6315 #[doc(hidden)]
6316 impl crate::RequestBuilder for TestIamPermissions {
6317 fn request_options(&mut self) -> &mut crate::RequestOptions {
6318 &mut self.0.options
6319 }
6320 }
6321
6322 #[derive(Clone, Debug)]
6343 pub struct ListOperations(
6344 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6345 );
6346
6347 impl ListOperations {
6348 pub(crate) fn new(
6349 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6350 ) -> Self {
6351 Self(RequestBuilder::new(stub))
6352 }
6353
6354 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6356 mut self,
6357 v: V,
6358 ) -> Self {
6359 self.0.request = v.into();
6360 self
6361 }
6362
6363 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6365 self.0.options = v.into();
6366 self
6367 }
6368
6369 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6371 (*self.0.stub)
6372 .list_operations(self.0.request, self.0.options)
6373 .await
6374 .map(crate::Response::into_body)
6375 }
6376
6377 pub fn by_page(
6379 self,
6380 ) -> impl google_cloud_gax::paginator::Paginator<
6381 google_cloud_longrunning::model::ListOperationsResponse,
6382 crate::Error,
6383 > {
6384 use std::clone::Clone;
6385 let token = self.0.request.page_token.clone();
6386 let execute = move |token: String| {
6387 let mut builder = self.clone();
6388 builder.0.request = builder.0.request.set_page_token(token);
6389 builder.send()
6390 };
6391 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6392 }
6393
6394 pub fn by_item(
6396 self,
6397 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6398 google_cloud_longrunning::model::ListOperationsResponse,
6399 crate::Error,
6400 > {
6401 use google_cloud_gax::paginator::Paginator;
6402 self.by_page().items()
6403 }
6404
6405 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6407 self.0.request.name = v.into();
6408 self
6409 }
6410
6411 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6413 self.0.request.filter = v.into();
6414 self
6415 }
6416
6417 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6419 self.0.request.page_size = v.into();
6420 self
6421 }
6422
6423 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6425 self.0.request.page_token = v.into();
6426 self
6427 }
6428
6429 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6431 self.0.request.return_partial_success = v.into();
6432 self
6433 }
6434 }
6435
6436 #[doc(hidden)]
6437 impl crate::RequestBuilder for ListOperations {
6438 fn request_options(&mut self) -> &mut crate::RequestOptions {
6439 &mut self.0.options
6440 }
6441 }
6442
6443 #[derive(Clone, Debug)]
6460 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6461
6462 impl GetOperation {
6463 pub(crate) fn new(
6464 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6465 ) -> Self {
6466 Self(RequestBuilder::new(stub))
6467 }
6468
6469 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6471 mut self,
6472 v: V,
6473 ) -> Self {
6474 self.0.request = v.into();
6475 self
6476 }
6477
6478 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6480 self.0.options = v.into();
6481 self
6482 }
6483
6484 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6486 (*self.0.stub)
6487 .get_operation(self.0.request, self.0.options)
6488 .await
6489 .map(crate::Response::into_body)
6490 }
6491
6492 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6494 self.0.request.name = v.into();
6495 self
6496 }
6497 }
6498
6499 #[doc(hidden)]
6500 impl crate::RequestBuilder for GetOperation {
6501 fn request_options(&mut self) -> &mut crate::RequestOptions {
6502 &mut self.0.options
6503 }
6504 }
6505
6506 #[derive(Clone, Debug)]
6523 pub struct DeleteOperation(
6524 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
6525 );
6526
6527 impl DeleteOperation {
6528 pub(crate) fn new(
6529 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6530 ) -> Self {
6531 Self(RequestBuilder::new(stub))
6532 }
6533
6534 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
6536 mut self,
6537 v: V,
6538 ) -> Self {
6539 self.0.request = v.into();
6540 self
6541 }
6542
6543 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6545 self.0.options = v.into();
6546 self
6547 }
6548
6549 pub async fn send(self) -> Result<()> {
6551 (*self.0.stub)
6552 .delete_operation(self.0.request, self.0.options)
6553 .await
6554 .map(crate::Response::into_body)
6555 }
6556
6557 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6559 self.0.request.name = v.into();
6560 self
6561 }
6562 }
6563
6564 #[doc(hidden)]
6565 impl crate::RequestBuilder for DeleteOperation {
6566 fn request_options(&mut self) -> &mut crate::RequestOptions {
6567 &mut self.0.options
6568 }
6569 }
6570
6571 #[derive(Clone, Debug)]
6588 pub struct CancelOperation(
6589 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6590 );
6591
6592 impl CancelOperation {
6593 pub(crate) fn new(
6594 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6595 ) -> Self {
6596 Self(RequestBuilder::new(stub))
6597 }
6598
6599 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6601 mut self,
6602 v: V,
6603 ) -> Self {
6604 self.0.request = v.into();
6605 self
6606 }
6607
6608 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6610 self.0.options = v.into();
6611 self
6612 }
6613
6614 pub async fn send(self) -> Result<()> {
6616 (*self.0.stub)
6617 .cancel_operation(self.0.request, self.0.options)
6618 .await
6619 .map(crate::Response::into_body)
6620 }
6621
6622 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6624 self.0.request.name = v.into();
6625 self
6626 }
6627 }
6628
6629 #[doc(hidden)]
6630 impl crate::RequestBuilder for CancelOperation {
6631 fn request_options(&mut self) -> &mut crate::RequestOptions {
6632 &mut self.0.options
6633 }
6634 }
6635}