1pub mod secure_source_manager {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::SecureSourceManager;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = SecureSourceManager;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
96
97 impl ListInstances {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
118 (*self.0.stub)
119 .list_instances(self.0.request, self.0.options)
120 .await
121 .map(gax::response::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::Error>
128 {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
143 {
144 use gax::paginator::Paginator;
145 self.by_page().items()
146 }
147
148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152 self.0.request.parent = v.into();
153 self
154 }
155
156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158 self.0.request.page_size = v.into();
159 self
160 }
161
162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.page_token = v.into();
165 self
166 }
167
168 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.filter = v.into();
171 self
172 }
173
174 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.order_by = v.into();
177 self
178 }
179 }
180
181 #[doc(hidden)]
182 impl gax::options::internal::RequestBuilder for ListInstances {
183 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
184 &mut self.0.options
185 }
186 }
187
188 #[derive(Clone, Debug)]
205 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
206
207 impl GetInstance {
208 pub(crate) fn new(
209 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
210 ) -> Self {
211 Self(RequestBuilder::new(stub))
212 }
213
214 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
216 self.0.request = v.into();
217 self
218 }
219
220 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
222 self.0.options = v.into();
223 self
224 }
225
226 pub async fn send(self) -> Result<crate::model::Instance> {
228 (*self.0.stub)
229 .get_instance(self.0.request, self.0.options)
230 .await
231 .map(gax::response::Response::into_body)
232 }
233
234 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
238 self.0.request.name = v.into();
239 self
240 }
241 }
242
243 #[doc(hidden)]
244 impl gax::options::internal::RequestBuilder for GetInstance {
245 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
246 &mut self.0.options
247 }
248 }
249
250 #[derive(Clone, Debug)]
268 pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
269
270 impl CreateInstance {
271 pub(crate) fn new(
272 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
273 ) -> Self {
274 Self(RequestBuilder::new(stub))
275 }
276
277 pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
279 self.0.request = v.into();
280 self
281 }
282
283 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
285 self.0.options = v.into();
286 self
287 }
288
289 pub async fn send(self) -> Result<longrunning::model::Operation> {
296 (*self.0.stub)
297 .create_instance(self.0.request, self.0.options)
298 .await
299 .map(gax::response::Response::into_body)
300 }
301
302 pub fn poller(
304 self,
305 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
306 type Operation =
307 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
308 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
309 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
310
311 let stub = self.0.stub.clone();
312 let mut options = self.0.options.clone();
313 options.set_retry_policy(gax::retry_policy::NeverRetry);
314 let query = move |name| {
315 let stub = stub.clone();
316 let options = options.clone();
317 async {
318 let op = GetOperation::new(stub)
319 .set_name(name)
320 .with_options(options)
321 .send()
322 .await?;
323 Ok(Operation::new(op))
324 }
325 };
326
327 let start = move || async {
328 let op = self.send().await?;
329 Ok(Operation::new(op))
330 };
331
332 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
333 }
334
335 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
339 self.0.request.parent = v.into();
340 self
341 }
342
343 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
347 self.0.request.instance_id = v.into();
348 self
349 }
350
351 pub fn set_instance<T>(mut self, v: T) -> Self
355 where
356 T: std::convert::Into<crate::model::Instance>,
357 {
358 self.0.request.instance = std::option::Option::Some(v.into());
359 self
360 }
361
362 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
366 where
367 T: std::convert::Into<crate::model::Instance>,
368 {
369 self.0.request.instance = v.map(|x| x.into());
370 self
371 }
372
373 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
375 self.0.request.request_id = v.into();
376 self
377 }
378 }
379
380 #[doc(hidden)]
381 impl gax::options::internal::RequestBuilder for CreateInstance {
382 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
383 &mut self.0.options
384 }
385 }
386
387 #[derive(Clone, Debug)]
405 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
406
407 impl DeleteInstance {
408 pub(crate) fn new(
409 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
410 ) -> Self {
411 Self(RequestBuilder::new(stub))
412 }
413
414 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
416 self.0.request = v.into();
417 self
418 }
419
420 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
422 self.0.options = v.into();
423 self
424 }
425
426 pub async fn send(self) -> Result<longrunning::model::Operation> {
433 (*self.0.stub)
434 .delete_instance(self.0.request, self.0.options)
435 .await
436 .map(gax::response::Response::into_body)
437 }
438
439 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
441 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
442 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
443 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
444
445 let stub = self.0.stub.clone();
446 let mut options = self.0.options.clone();
447 options.set_retry_policy(gax::retry_policy::NeverRetry);
448 let query = move |name| {
449 let stub = stub.clone();
450 let options = options.clone();
451 async {
452 let op = GetOperation::new(stub)
453 .set_name(name)
454 .with_options(options)
455 .send()
456 .await?;
457 Ok(Operation::new(op))
458 }
459 };
460
461 let start = move || async {
462 let op = self.send().await?;
463 Ok(Operation::new(op))
464 };
465
466 lro::internal::new_unit_response_poller(
467 polling_error_policy,
468 polling_backoff_policy,
469 start,
470 query,
471 )
472 }
473
474 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
478 self.0.request.name = v.into();
479 self
480 }
481
482 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
484 self.0.request.request_id = v.into();
485 self
486 }
487 }
488
489 #[doc(hidden)]
490 impl gax::options::internal::RequestBuilder for DeleteInstance {
491 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
492 &mut self.0.options
493 }
494 }
495
496 #[derive(Clone, Debug)]
517 pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
518
519 impl ListRepositories {
520 pub(crate) fn new(
521 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
522 ) -> Self {
523 Self(RequestBuilder::new(stub))
524 }
525
526 pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
528 mut self,
529 v: V,
530 ) -> Self {
531 self.0.request = v.into();
532 self
533 }
534
535 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
537 self.0.options = v.into();
538 self
539 }
540
541 pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
543 (*self.0.stub)
544 .list_repositories(self.0.request, self.0.options)
545 .await
546 .map(gax::response::Response::into_body)
547 }
548
549 pub fn by_page(
551 self,
552 ) -> impl gax::paginator::Paginator<crate::model::ListRepositoriesResponse, gax::error::Error>
553 {
554 use std::clone::Clone;
555 let token = self.0.request.page_token.clone();
556 let execute = move |token: String| {
557 let mut builder = self.clone();
558 builder.0.request = builder.0.request.set_page_token(token);
559 builder.send()
560 };
561 gax::paginator::internal::new_paginator(token, execute)
562 }
563
564 pub fn by_item(
566 self,
567 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRepositoriesResponse, gax::error::Error>
568 {
569 use gax::paginator::Paginator;
570 self.by_page().items()
571 }
572
573 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
577 self.0.request.parent = v.into();
578 self
579 }
580
581 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
583 self.0.request.page_size = v.into();
584 self
585 }
586
587 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
589 self.0.request.page_token = v.into();
590 self
591 }
592
593 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
595 self.0.request.filter = v.into();
596 self
597 }
598
599 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
601 self.0.request.instance = v.into();
602 self
603 }
604 }
605
606 #[doc(hidden)]
607 impl gax::options::internal::RequestBuilder for ListRepositories {
608 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
609 &mut self.0.options
610 }
611 }
612
613 #[derive(Clone, Debug)]
630 pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
631
632 impl GetRepository {
633 pub(crate) fn new(
634 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
635 ) -> Self {
636 Self(RequestBuilder::new(stub))
637 }
638
639 pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
641 self.0.request = v.into();
642 self
643 }
644
645 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
647 self.0.options = v.into();
648 self
649 }
650
651 pub async fn send(self) -> Result<crate::model::Repository> {
653 (*self.0.stub)
654 .get_repository(self.0.request, self.0.options)
655 .await
656 .map(gax::response::Response::into_body)
657 }
658
659 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
663 self.0.request.name = v.into();
664 self
665 }
666 }
667
668 #[doc(hidden)]
669 impl gax::options::internal::RequestBuilder for GetRepository {
670 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
671 &mut self.0.options
672 }
673 }
674
675 #[derive(Clone, Debug)]
693 pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
694
695 impl CreateRepository {
696 pub(crate) fn new(
697 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
698 ) -> Self {
699 Self(RequestBuilder::new(stub))
700 }
701
702 pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
704 mut self,
705 v: V,
706 ) -> Self {
707 self.0.request = v.into();
708 self
709 }
710
711 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
713 self.0.options = v.into();
714 self
715 }
716
717 pub async fn send(self) -> Result<longrunning::model::Operation> {
724 (*self.0.stub)
725 .create_repository(self.0.request, self.0.options)
726 .await
727 .map(gax::response::Response::into_body)
728 }
729
730 pub fn poller(
732 self,
733 ) -> impl lro::Poller<crate::model::Repository, crate::model::OperationMetadata> {
734 type Operation =
735 lro::internal::Operation<crate::model::Repository, crate::model::OperationMetadata>;
736 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
737 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
738
739 let stub = self.0.stub.clone();
740 let mut options = self.0.options.clone();
741 options.set_retry_policy(gax::retry_policy::NeverRetry);
742 let query = move |name| {
743 let stub = stub.clone();
744 let options = options.clone();
745 async {
746 let op = GetOperation::new(stub)
747 .set_name(name)
748 .with_options(options)
749 .send()
750 .await?;
751 Ok(Operation::new(op))
752 }
753 };
754
755 let start = move || async {
756 let op = self.send().await?;
757 Ok(Operation::new(op))
758 };
759
760 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
761 }
762
763 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
767 self.0.request.parent = v.into();
768 self
769 }
770
771 pub fn set_repository<T>(mut self, v: T) -> Self
775 where
776 T: std::convert::Into<crate::model::Repository>,
777 {
778 self.0.request.repository = std::option::Option::Some(v.into());
779 self
780 }
781
782 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
786 where
787 T: std::convert::Into<crate::model::Repository>,
788 {
789 self.0.request.repository = v.map(|x| x.into());
790 self
791 }
792
793 pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
797 self.0.request.repository_id = v.into();
798 self
799 }
800 }
801
802 #[doc(hidden)]
803 impl gax::options::internal::RequestBuilder for CreateRepository {
804 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
805 &mut self.0.options
806 }
807 }
808
809 #[derive(Clone, Debug)]
827 pub struct UpdateRepository(RequestBuilder<crate::model::UpdateRepositoryRequest>);
828
829 impl UpdateRepository {
830 pub(crate) fn new(
831 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
832 ) -> Self {
833 Self(RequestBuilder::new(stub))
834 }
835
836 pub fn with_request<V: Into<crate::model::UpdateRepositoryRequest>>(
838 mut self,
839 v: V,
840 ) -> Self {
841 self.0.request = v.into();
842 self
843 }
844
845 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
847 self.0.options = v.into();
848 self
849 }
850
851 pub async fn send(self) -> Result<longrunning::model::Operation> {
858 (*self.0.stub)
859 .update_repository(self.0.request, self.0.options)
860 .await
861 .map(gax::response::Response::into_body)
862 }
863
864 pub fn poller(
866 self,
867 ) -> impl lro::Poller<crate::model::Repository, crate::model::OperationMetadata> {
868 type Operation =
869 lro::internal::Operation<crate::model::Repository, crate::model::OperationMetadata>;
870 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
871 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
872
873 let stub = self.0.stub.clone();
874 let mut options = self.0.options.clone();
875 options.set_retry_policy(gax::retry_policy::NeverRetry);
876 let query = move |name| {
877 let stub = stub.clone();
878 let options = options.clone();
879 async {
880 let op = GetOperation::new(stub)
881 .set_name(name)
882 .with_options(options)
883 .send()
884 .await?;
885 Ok(Operation::new(op))
886 }
887 };
888
889 let start = move || async {
890 let op = self.send().await?;
891 Ok(Operation::new(op))
892 };
893
894 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
895 }
896
897 pub fn set_update_mask<T>(mut self, v: T) -> Self
899 where
900 T: std::convert::Into<wkt::FieldMask>,
901 {
902 self.0.request.update_mask = std::option::Option::Some(v.into());
903 self
904 }
905
906 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
908 where
909 T: std::convert::Into<wkt::FieldMask>,
910 {
911 self.0.request.update_mask = v.map(|x| x.into());
912 self
913 }
914
915 pub fn set_repository<T>(mut self, v: T) -> Self
919 where
920 T: std::convert::Into<crate::model::Repository>,
921 {
922 self.0.request.repository = std::option::Option::Some(v.into());
923 self
924 }
925
926 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
930 where
931 T: std::convert::Into<crate::model::Repository>,
932 {
933 self.0.request.repository = v.map(|x| x.into());
934 self
935 }
936
937 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
939 self.0.request.validate_only = v.into();
940 self
941 }
942 }
943
944 #[doc(hidden)]
945 impl gax::options::internal::RequestBuilder for UpdateRepository {
946 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
947 &mut self.0.options
948 }
949 }
950
951 #[derive(Clone, Debug)]
969 pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
970
971 impl DeleteRepository {
972 pub(crate) fn new(
973 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
974 ) -> Self {
975 Self(RequestBuilder::new(stub))
976 }
977
978 pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
980 mut self,
981 v: V,
982 ) -> Self {
983 self.0.request = v.into();
984 self
985 }
986
987 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
989 self.0.options = v.into();
990 self
991 }
992
993 pub async fn send(self) -> Result<longrunning::model::Operation> {
1000 (*self.0.stub)
1001 .delete_repository(self.0.request, self.0.options)
1002 .await
1003 .map(gax::response::Response::into_body)
1004 }
1005
1006 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1008 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1009 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1010 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1011
1012 let stub = self.0.stub.clone();
1013 let mut options = self.0.options.clone();
1014 options.set_retry_policy(gax::retry_policy::NeverRetry);
1015 let query = move |name| {
1016 let stub = stub.clone();
1017 let options = options.clone();
1018 async {
1019 let op = GetOperation::new(stub)
1020 .set_name(name)
1021 .with_options(options)
1022 .send()
1023 .await?;
1024 Ok(Operation::new(op))
1025 }
1026 };
1027
1028 let start = move || async {
1029 let op = self.send().await?;
1030 Ok(Operation::new(op))
1031 };
1032
1033 lro::internal::new_unit_response_poller(
1034 polling_error_policy,
1035 polling_backoff_policy,
1036 start,
1037 query,
1038 )
1039 }
1040
1041 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1045 self.0.request.name = v.into();
1046 self
1047 }
1048
1049 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1051 self.0.request.allow_missing = v.into();
1052 self
1053 }
1054 }
1055
1056 #[doc(hidden)]
1057 impl gax::options::internal::RequestBuilder for DeleteRepository {
1058 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1059 &mut self.0.options
1060 }
1061 }
1062
1063 #[derive(Clone, Debug)]
1084 pub struct ListHooks(RequestBuilder<crate::model::ListHooksRequest>);
1085
1086 impl ListHooks {
1087 pub(crate) fn new(
1088 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1089 ) -> Self {
1090 Self(RequestBuilder::new(stub))
1091 }
1092
1093 pub fn with_request<V: Into<crate::model::ListHooksRequest>>(mut self, v: V) -> Self {
1095 self.0.request = v.into();
1096 self
1097 }
1098
1099 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1101 self.0.options = v.into();
1102 self
1103 }
1104
1105 pub async fn send(self) -> Result<crate::model::ListHooksResponse> {
1107 (*self.0.stub)
1108 .list_hooks(self.0.request, self.0.options)
1109 .await
1110 .map(gax::response::Response::into_body)
1111 }
1112
1113 pub fn by_page(
1115 self,
1116 ) -> impl gax::paginator::Paginator<crate::model::ListHooksResponse, gax::error::Error>
1117 {
1118 use std::clone::Clone;
1119 let token = self.0.request.page_token.clone();
1120 let execute = move |token: String| {
1121 let mut builder = self.clone();
1122 builder.0.request = builder.0.request.set_page_token(token);
1123 builder.send()
1124 };
1125 gax::paginator::internal::new_paginator(token, execute)
1126 }
1127
1128 pub fn by_item(
1130 self,
1131 ) -> impl gax::paginator::ItemPaginator<crate::model::ListHooksResponse, gax::error::Error>
1132 {
1133 use gax::paginator::Paginator;
1134 self.by_page().items()
1135 }
1136
1137 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1141 self.0.request.parent = v.into();
1142 self
1143 }
1144
1145 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1147 self.0.request.page_size = v.into();
1148 self
1149 }
1150
1151 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1153 self.0.request.page_token = v.into();
1154 self
1155 }
1156 }
1157
1158 #[doc(hidden)]
1159 impl gax::options::internal::RequestBuilder for ListHooks {
1160 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1161 &mut self.0.options
1162 }
1163 }
1164
1165 #[derive(Clone, Debug)]
1182 pub struct GetHook(RequestBuilder<crate::model::GetHookRequest>);
1183
1184 impl GetHook {
1185 pub(crate) fn new(
1186 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1187 ) -> Self {
1188 Self(RequestBuilder::new(stub))
1189 }
1190
1191 pub fn with_request<V: Into<crate::model::GetHookRequest>>(mut self, v: V) -> Self {
1193 self.0.request = v.into();
1194 self
1195 }
1196
1197 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1199 self.0.options = v.into();
1200 self
1201 }
1202
1203 pub async fn send(self) -> Result<crate::model::Hook> {
1205 (*self.0.stub)
1206 .get_hook(self.0.request, self.0.options)
1207 .await
1208 .map(gax::response::Response::into_body)
1209 }
1210
1211 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1215 self.0.request.name = v.into();
1216 self
1217 }
1218 }
1219
1220 #[doc(hidden)]
1221 impl gax::options::internal::RequestBuilder for GetHook {
1222 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1223 &mut self.0.options
1224 }
1225 }
1226
1227 #[derive(Clone, Debug)]
1245 pub struct CreateHook(RequestBuilder<crate::model::CreateHookRequest>);
1246
1247 impl CreateHook {
1248 pub(crate) fn new(
1249 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1250 ) -> Self {
1251 Self(RequestBuilder::new(stub))
1252 }
1253
1254 pub fn with_request<V: Into<crate::model::CreateHookRequest>>(mut self, v: V) -> Self {
1256 self.0.request = v.into();
1257 self
1258 }
1259
1260 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1262 self.0.options = v.into();
1263 self
1264 }
1265
1266 pub async fn send(self) -> Result<longrunning::model::Operation> {
1273 (*self.0.stub)
1274 .create_hook(self.0.request, self.0.options)
1275 .await
1276 .map(gax::response::Response::into_body)
1277 }
1278
1279 pub fn poller(
1281 self,
1282 ) -> impl lro::Poller<crate::model::Hook, crate::model::OperationMetadata> {
1283 type Operation =
1284 lro::internal::Operation<crate::model::Hook, crate::model::OperationMetadata>;
1285 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1286 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1287
1288 let stub = self.0.stub.clone();
1289 let mut options = self.0.options.clone();
1290 options.set_retry_policy(gax::retry_policy::NeverRetry);
1291 let query = move |name| {
1292 let stub = stub.clone();
1293 let options = options.clone();
1294 async {
1295 let op = GetOperation::new(stub)
1296 .set_name(name)
1297 .with_options(options)
1298 .send()
1299 .await?;
1300 Ok(Operation::new(op))
1301 }
1302 };
1303
1304 let start = move || async {
1305 let op = self.send().await?;
1306 Ok(Operation::new(op))
1307 };
1308
1309 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1310 }
1311
1312 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1316 self.0.request.parent = v.into();
1317 self
1318 }
1319
1320 pub fn set_hook<T>(mut self, v: T) -> Self
1324 where
1325 T: std::convert::Into<crate::model::Hook>,
1326 {
1327 self.0.request.hook = std::option::Option::Some(v.into());
1328 self
1329 }
1330
1331 pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
1335 where
1336 T: std::convert::Into<crate::model::Hook>,
1337 {
1338 self.0.request.hook = v.map(|x| x.into());
1339 self
1340 }
1341
1342 pub fn set_hook_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1346 self.0.request.hook_id = v.into();
1347 self
1348 }
1349 }
1350
1351 #[doc(hidden)]
1352 impl gax::options::internal::RequestBuilder for CreateHook {
1353 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1354 &mut self.0.options
1355 }
1356 }
1357
1358 #[derive(Clone, Debug)]
1376 pub struct UpdateHook(RequestBuilder<crate::model::UpdateHookRequest>);
1377
1378 impl UpdateHook {
1379 pub(crate) fn new(
1380 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1381 ) -> Self {
1382 Self(RequestBuilder::new(stub))
1383 }
1384
1385 pub fn with_request<V: Into<crate::model::UpdateHookRequest>>(mut self, v: V) -> Self {
1387 self.0.request = v.into();
1388 self
1389 }
1390
1391 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1393 self.0.options = v.into();
1394 self
1395 }
1396
1397 pub async fn send(self) -> Result<longrunning::model::Operation> {
1404 (*self.0.stub)
1405 .update_hook(self.0.request, self.0.options)
1406 .await
1407 .map(gax::response::Response::into_body)
1408 }
1409
1410 pub fn poller(
1412 self,
1413 ) -> impl lro::Poller<crate::model::Hook, crate::model::OperationMetadata> {
1414 type Operation =
1415 lro::internal::Operation<crate::model::Hook, crate::model::OperationMetadata>;
1416 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1417 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1418
1419 let stub = self.0.stub.clone();
1420 let mut options = self.0.options.clone();
1421 options.set_retry_policy(gax::retry_policy::NeverRetry);
1422 let query = move |name| {
1423 let stub = stub.clone();
1424 let options = options.clone();
1425 async {
1426 let op = GetOperation::new(stub)
1427 .set_name(name)
1428 .with_options(options)
1429 .send()
1430 .await?;
1431 Ok(Operation::new(op))
1432 }
1433 };
1434
1435 let start = move || async {
1436 let op = self.send().await?;
1437 Ok(Operation::new(op))
1438 };
1439
1440 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1441 }
1442
1443 pub fn set_update_mask<T>(mut self, v: T) -> Self
1447 where
1448 T: std::convert::Into<wkt::FieldMask>,
1449 {
1450 self.0.request.update_mask = std::option::Option::Some(v.into());
1451 self
1452 }
1453
1454 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1458 where
1459 T: std::convert::Into<wkt::FieldMask>,
1460 {
1461 self.0.request.update_mask = v.map(|x| x.into());
1462 self
1463 }
1464
1465 pub fn set_hook<T>(mut self, v: T) -> Self
1469 where
1470 T: std::convert::Into<crate::model::Hook>,
1471 {
1472 self.0.request.hook = std::option::Option::Some(v.into());
1473 self
1474 }
1475
1476 pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
1480 where
1481 T: std::convert::Into<crate::model::Hook>,
1482 {
1483 self.0.request.hook = v.map(|x| x.into());
1484 self
1485 }
1486 }
1487
1488 #[doc(hidden)]
1489 impl gax::options::internal::RequestBuilder for UpdateHook {
1490 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1491 &mut self.0.options
1492 }
1493 }
1494
1495 #[derive(Clone, Debug)]
1513 pub struct DeleteHook(RequestBuilder<crate::model::DeleteHookRequest>);
1514
1515 impl DeleteHook {
1516 pub(crate) fn new(
1517 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1518 ) -> Self {
1519 Self(RequestBuilder::new(stub))
1520 }
1521
1522 pub fn with_request<V: Into<crate::model::DeleteHookRequest>>(mut self, v: V) -> Self {
1524 self.0.request = v.into();
1525 self
1526 }
1527
1528 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1530 self.0.options = v.into();
1531 self
1532 }
1533
1534 pub async fn send(self) -> Result<longrunning::model::Operation> {
1541 (*self.0.stub)
1542 .delete_hook(self.0.request, self.0.options)
1543 .await
1544 .map(gax::response::Response::into_body)
1545 }
1546
1547 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1549 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1550 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1551 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1552
1553 let stub = self.0.stub.clone();
1554 let mut options = self.0.options.clone();
1555 options.set_retry_policy(gax::retry_policy::NeverRetry);
1556 let query = move |name| {
1557 let stub = stub.clone();
1558 let options = options.clone();
1559 async {
1560 let op = GetOperation::new(stub)
1561 .set_name(name)
1562 .with_options(options)
1563 .send()
1564 .await?;
1565 Ok(Operation::new(op))
1566 }
1567 };
1568
1569 let start = move || async {
1570 let op = self.send().await?;
1571 Ok(Operation::new(op))
1572 };
1573
1574 lro::internal::new_unit_response_poller(
1575 polling_error_policy,
1576 polling_backoff_policy,
1577 start,
1578 query,
1579 )
1580 }
1581
1582 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1586 self.0.request.name = v.into();
1587 self
1588 }
1589 }
1590
1591 #[doc(hidden)]
1592 impl gax::options::internal::RequestBuilder for DeleteHook {
1593 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1594 &mut self.0.options
1595 }
1596 }
1597
1598 #[derive(Clone, Debug)]
1615 pub struct GetIamPolicyRepo(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1616
1617 impl GetIamPolicyRepo {
1618 pub(crate) fn new(
1619 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1620 ) -> Self {
1621 Self(RequestBuilder::new(stub))
1622 }
1623
1624 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1626 self.0.request = v.into();
1627 self
1628 }
1629
1630 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1632 self.0.options = v.into();
1633 self
1634 }
1635
1636 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1638 (*self.0.stub)
1639 .get_iam_policy_repo(self.0.request, self.0.options)
1640 .await
1641 .map(gax::response::Response::into_body)
1642 }
1643
1644 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1648 self.0.request.resource = v.into();
1649 self
1650 }
1651
1652 pub fn set_options<T>(mut self, v: T) -> Self
1654 where
1655 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1656 {
1657 self.0.request.options = std::option::Option::Some(v.into());
1658 self
1659 }
1660
1661 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1663 where
1664 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1665 {
1666 self.0.request.options = v.map(|x| x.into());
1667 self
1668 }
1669 }
1670
1671 #[doc(hidden)]
1672 impl gax::options::internal::RequestBuilder for GetIamPolicyRepo {
1673 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1674 &mut self.0.options
1675 }
1676 }
1677
1678 #[derive(Clone, Debug)]
1695 pub struct SetIamPolicyRepo(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1696
1697 impl SetIamPolicyRepo {
1698 pub(crate) fn new(
1699 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1700 ) -> Self {
1701 Self(RequestBuilder::new(stub))
1702 }
1703
1704 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1706 self.0.request = v.into();
1707 self
1708 }
1709
1710 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1712 self.0.options = v.into();
1713 self
1714 }
1715
1716 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1718 (*self.0.stub)
1719 .set_iam_policy_repo(self.0.request, self.0.options)
1720 .await
1721 .map(gax::response::Response::into_body)
1722 }
1723
1724 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1728 self.0.request.resource = v.into();
1729 self
1730 }
1731
1732 pub fn set_policy<T>(mut self, v: T) -> Self
1736 where
1737 T: std::convert::Into<iam_v1::model::Policy>,
1738 {
1739 self.0.request.policy = std::option::Option::Some(v.into());
1740 self
1741 }
1742
1743 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1747 where
1748 T: std::convert::Into<iam_v1::model::Policy>,
1749 {
1750 self.0.request.policy = v.map(|x| x.into());
1751 self
1752 }
1753
1754 pub fn set_update_mask<T>(mut self, v: T) -> Self
1756 where
1757 T: std::convert::Into<wkt::FieldMask>,
1758 {
1759 self.0.request.update_mask = std::option::Option::Some(v.into());
1760 self
1761 }
1762
1763 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1765 where
1766 T: std::convert::Into<wkt::FieldMask>,
1767 {
1768 self.0.request.update_mask = v.map(|x| x.into());
1769 self
1770 }
1771 }
1772
1773 #[doc(hidden)]
1774 impl gax::options::internal::RequestBuilder for SetIamPolicyRepo {
1775 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1776 &mut self.0.options
1777 }
1778 }
1779
1780 #[derive(Clone, Debug)]
1797 pub struct TestIamPermissionsRepo(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1798
1799 impl TestIamPermissionsRepo {
1800 pub(crate) fn new(
1801 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1802 ) -> Self {
1803 Self(RequestBuilder::new(stub))
1804 }
1805
1806 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1808 mut self,
1809 v: V,
1810 ) -> Self {
1811 self.0.request = v.into();
1812 self
1813 }
1814
1815 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1817 self.0.options = v.into();
1818 self
1819 }
1820
1821 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1823 (*self.0.stub)
1824 .test_iam_permissions_repo(self.0.request, self.0.options)
1825 .await
1826 .map(gax::response::Response::into_body)
1827 }
1828
1829 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1833 self.0.request.resource = v.into();
1834 self
1835 }
1836
1837 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1841 where
1842 T: std::iter::IntoIterator<Item = V>,
1843 V: std::convert::Into<std::string::String>,
1844 {
1845 use std::iter::Iterator;
1846 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1847 self
1848 }
1849 }
1850
1851 #[doc(hidden)]
1852 impl gax::options::internal::RequestBuilder for TestIamPermissionsRepo {
1853 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1854 &mut self.0.options
1855 }
1856 }
1857
1858 #[derive(Clone, Debug)]
1876 pub struct CreateBranchRule(RequestBuilder<crate::model::CreateBranchRuleRequest>);
1877
1878 impl CreateBranchRule {
1879 pub(crate) fn new(
1880 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1881 ) -> Self {
1882 Self(RequestBuilder::new(stub))
1883 }
1884
1885 pub fn with_request<V: Into<crate::model::CreateBranchRuleRequest>>(
1887 mut self,
1888 v: V,
1889 ) -> Self {
1890 self.0.request = v.into();
1891 self
1892 }
1893
1894 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1896 self.0.options = v.into();
1897 self
1898 }
1899
1900 pub async fn send(self) -> Result<longrunning::model::Operation> {
1907 (*self.0.stub)
1908 .create_branch_rule(self.0.request, self.0.options)
1909 .await
1910 .map(gax::response::Response::into_body)
1911 }
1912
1913 pub fn poller(
1915 self,
1916 ) -> impl lro::Poller<crate::model::BranchRule, crate::model::OperationMetadata> {
1917 type Operation =
1918 lro::internal::Operation<crate::model::BranchRule, crate::model::OperationMetadata>;
1919 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1920 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1921
1922 let stub = self.0.stub.clone();
1923 let mut options = self.0.options.clone();
1924 options.set_retry_policy(gax::retry_policy::NeverRetry);
1925 let query = move |name| {
1926 let stub = stub.clone();
1927 let options = options.clone();
1928 async {
1929 let op = GetOperation::new(stub)
1930 .set_name(name)
1931 .with_options(options)
1932 .send()
1933 .await?;
1934 Ok(Operation::new(op))
1935 }
1936 };
1937
1938 let start = move || async {
1939 let op = self.send().await?;
1940 Ok(Operation::new(op))
1941 };
1942
1943 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1944 }
1945
1946 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1950 self.0.request.parent = v.into();
1951 self
1952 }
1953
1954 pub fn set_branch_rule<T>(mut self, v: T) -> Self
1958 where
1959 T: std::convert::Into<crate::model::BranchRule>,
1960 {
1961 self.0.request.branch_rule = std::option::Option::Some(v.into());
1962 self
1963 }
1964
1965 pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
1969 where
1970 T: std::convert::Into<crate::model::BranchRule>,
1971 {
1972 self.0.request.branch_rule = v.map(|x| x.into());
1973 self
1974 }
1975
1976 pub fn set_branch_rule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1980 self.0.request.branch_rule_id = v.into();
1981 self
1982 }
1983 }
1984
1985 #[doc(hidden)]
1986 impl gax::options::internal::RequestBuilder for CreateBranchRule {
1987 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1988 &mut self.0.options
1989 }
1990 }
1991
1992 #[derive(Clone, Debug)]
2013 pub struct ListBranchRules(RequestBuilder<crate::model::ListBranchRulesRequest>);
2014
2015 impl ListBranchRules {
2016 pub(crate) fn new(
2017 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2018 ) -> Self {
2019 Self(RequestBuilder::new(stub))
2020 }
2021
2022 pub fn with_request<V: Into<crate::model::ListBranchRulesRequest>>(mut self, v: V) -> Self {
2024 self.0.request = v.into();
2025 self
2026 }
2027
2028 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2030 self.0.options = v.into();
2031 self
2032 }
2033
2034 pub async fn send(self) -> Result<crate::model::ListBranchRulesResponse> {
2036 (*self.0.stub)
2037 .list_branch_rules(self.0.request, self.0.options)
2038 .await
2039 .map(gax::response::Response::into_body)
2040 }
2041
2042 pub fn by_page(
2044 self,
2045 ) -> impl gax::paginator::Paginator<crate::model::ListBranchRulesResponse, gax::error::Error>
2046 {
2047 use std::clone::Clone;
2048 let token = self.0.request.page_token.clone();
2049 let execute = move |token: String| {
2050 let mut builder = self.clone();
2051 builder.0.request = builder.0.request.set_page_token(token);
2052 builder.send()
2053 };
2054 gax::paginator::internal::new_paginator(token, execute)
2055 }
2056
2057 pub fn by_item(
2059 self,
2060 ) -> impl gax::paginator::ItemPaginator<crate::model::ListBranchRulesResponse, gax::error::Error>
2061 {
2062 use gax::paginator::Paginator;
2063 self.by_page().items()
2064 }
2065
2066 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2070 self.0.request.parent = v.into();
2071 self
2072 }
2073
2074 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2076 self.0.request.page_size = v.into();
2077 self
2078 }
2079
2080 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2082 self.0.request.page_token = v.into();
2083 self
2084 }
2085 }
2086
2087 #[doc(hidden)]
2088 impl gax::options::internal::RequestBuilder for ListBranchRules {
2089 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2090 &mut self.0.options
2091 }
2092 }
2093
2094 #[derive(Clone, Debug)]
2111 pub struct GetBranchRule(RequestBuilder<crate::model::GetBranchRuleRequest>);
2112
2113 impl GetBranchRule {
2114 pub(crate) fn new(
2115 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2116 ) -> Self {
2117 Self(RequestBuilder::new(stub))
2118 }
2119
2120 pub fn with_request<V: Into<crate::model::GetBranchRuleRequest>>(mut self, v: V) -> Self {
2122 self.0.request = v.into();
2123 self
2124 }
2125
2126 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2128 self.0.options = v.into();
2129 self
2130 }
2131
2132 pub async fn send(self) -> Result<crate::model::BranchRule> {
2134 (*self.0.stub)
2135 .get_branch_rule(self.0.request, self.0.options)
2136 .await
2137 .map(gax::response::Response::into_body)
2138 }
2139
2140 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2144 self.0.request.name = v.into();
2145 self
2146 }
2147 }
2148
2149 #[doc(hidden)]
2150 impl gax::options::internal::RequestBuilder for GetBranchRule {
2151 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2152 &mut self.0.options
2153 }
2154 }
2155
2156 #[derive(Clone, Debug)]
2174 pub struct UpdateBranchRule(RequestBuilder<crate::model::UpdateBranchRuleRequest>);
2175
2176 impl UpdateBranchRule {
2177 pub(crate) fn new(
2178 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2179 ) -> Self {
2180 Self(RequestBuilder::new(stub))
2181 }
2182
2183 pub fn with_request<V: Into<crate::model::UpdateBranchRuleRequest>>(
2185 mut self,
2186 v: V,
2187 ) -> Self {
2188 self.0.request = v.into();
2189 self
2190 }
2191
2192 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2194 self.0.options = v.into();
2195 self
2196 }
2197
2198 pub async fn send(self) -> Result<longrunning::model::Operation> {
2205 (*self.0.stub)
2206 .update_branch_rule(self.0.request, self.0.options)
2207 .await
2208 .map(gax::response::Response::into_body)
2209 }
2210
2211 pub fn poller(
2213 self,
2214 ) -> impl lro::Poller<crate::model::BranchRule, crate::model::OperationMetadata> {
2215 type Operation =
2216 lro::internal::Operation<crate::model::BranchRule, crate::model::OperationMetadata>;
2217 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2218 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2219
2220 let stub = self.0.stub.clone();
2221 let mut options = self.0.options.clone();
2222 options.set_retry_policy(gax::retry_policy::NeverRetry);
2223 let query = move |name| {
2224 let stub = stub.clone();
2225 let options = options.clone();
2226 async {
2227 let op = GetOperation::new(stub)
2228 .set_name(name)
2229 .with_options(options)
2230 .send()
2231 .await?;
2232 Ok(Operation::new(op))
2233 }
2234 };
2235
2236 let start = move || async {
2237 let op = self.send().await?;
2238 Ok(Operation::new(op))
2239 };
2240
2241 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2242 }
2243
2244 pub fn set_branch_rule<T>(mut self, v: T) -> Self
2248 where
2249 T: std::convert::Into<crate::model::BranchRule>,
2250 {
2251 self.0.request.branch_rule = std::option::Option::Some(v.into());
2252 self
2253 }
2254
2255 pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
2259 where
2260 T: std::convert::Into<crate::model::BranchRule>,
2261 {
2262 self.0.request.branch_rule = v.map(|x| x.into());
2263 self
2264 }
2265
2266 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2268 self.0.request.validate_only = v.into();
2269 self
2270 }
2271
2272 pub fn set_update_mask<T>(mut self, v: T) -> Self
2276 where
2277 T: std::convert::Into<wkt::FieldMask>,
2278 {
2279 self.0.request.update_mask = std::option::Option::Some(v.into());
2280 self
2281 }
2282
2283 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2287 where
2288 T: std::convert::Into<wkt::FieldMask>,
2289 {
2290 self.0.request.update_mask = v.map(|x| x.into());
2291 self
2292 }
2293 }
2294
2295 #[doc(hidden)]
2296 impl gax::options::internal::RequestBuilder for UpdateBranchRule {
2297 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2298 &mut self.0.options
2299 }
2300 }
2301
2302 #[derive(Clone, Debug)]
2320 pub struct DeleteBranchRule(RequestBuilder<crate::model::DeleteBranchRuleRequest>);
2321
2322 impl DeleteBranchRule {
2323 pub(crate) fn new(
2324 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2325 ) -> Self {
2326 Self(RequestBuilder::new(stub))
2327 }
2328
2329 pub fn with_request<V: Into<crate::model::DeleteBranchRuleRequest>>(
2331 mut self,
2332 v: V,
2333 ) -> Self {
2334 self.0.request = v.into();
2335 self
2336 }
2337
2338 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2340 self.0.options = v.into();
2341 self
2342 }
2343
2344 pub async fn send(self) -> Result<longrunning::model::Operation> {
2351 (*self.0.stub)
2352 .delete_branch_rule(self.0.request, self.0.options)
2353 .await
2354 .map(gax::response::Response::into_body)
2355 }
2356
2357 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2359 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2360 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2361 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2362
2363 let stub = self.0.stub.clone();
2364 let mut options = self.0.options.clone();
2365 options.set_retry_policy(gax::retry_policy::NeverRetry);
2366 let query = move |name| {
2367 let stub = stub.clone();
2368 let options = options.clone();
2369 async {
2370 let op = GetOperation::new(stub)
2371 .set_name(name)
2372 .with_options(options)
2373 .send()
2374 .await?;
2375 Ok(Operation::new(op))
2376 }
2377 };
2378
2379 let start = move || async {
2380 let op = self.send().await?;
2381 Ok(Operation::new(op))
2382 };
2383
2384 lro::internal::new_unit_response_poller(
2385 polling_error_policy,
2386 polling_backoff_policy,
2387 start,
2388 query,
2389 )
2390 }
2391
2392 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2396 self.0.request.name = v.into();
2397 self
2398 }
2399
2400 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2402 self.0.request.allow_missing = v.into();
2403 self
2404 }
2405 }
2406
2407 #[doc(hidden)]
2408 impl gax::options::internal::RequestBuilder for DeleteBranchRule {
2409 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2410 &mut self.0.options
2411 }
2412 }
2413
2414 #[derive(Clone, Debug)]
2432 pub struct CreatePullRequest(RequestBuilder<crate::model::CreatePullRequestRequest>);
2433
2434 impl CreatePullRequest {
2435 pub(crate) fn new(
2436 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2437 ) -> Self {
2438 Self(RequestBuilder::new(stub))
2439 }
2440
2441 pub fn with_request<V: Into<crate::model::CreatePullRequestRequest>>(
2443 mut self,
2444 v: V,
2445 ) -> Self {
2446 self.0.request = v.into();
2447 self
2448 }
2449
2450 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2452 self.0.options = v.into();
2453 self
2454 }
2455
2456 pub async fn send(self) -> Result<longrunning::model::Operation> {
2463 (*self.0.stub)
2464 .create_pull_request(self.0.request, self.0.options)
2465 .await
2466 .map(gax::response::Response::into_body)
2467 }
2468
2469 pub fn poller(
2471 self,
2472 ) -> impl lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata> {
2473 type Operation = lro::internal::Operation<
2474 crate::model::PullRequest,
2475 crate::model::OperationMetadata,
2476 >;
2477 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2478 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2479
2480 let stub = self.0.stub.clone();
2481 let mut options = self.0.options.clone();
2482 options.set_retry_policy(gax::retry_policy::NeverRetry);
2483 let query = move |name| {
2484 let stub = stub.clone();
2485 let options = options.clone();
2486 async {
2487 let op = GetOperation::new(stub)
2488 .set_name(name)
2489 .with_options(options)
2490 .send()
2491 .await?;
2492 Ok(Operation::new(op))
2493 }
2494 };
2495
2496 let start = move || async {
2497 let op = self.send().await?;
2498 Ok(Operation::new(op))
2499 };
2500
2501 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2502 }
2503
2504 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2508 self.0.request.parent = v.into();
2509 self
2510 }
2511
2512 pub fn set_pull_request<T>(mut self, v: T) -> Self
2516 where
2517 T: std::convert::Into<crate::model::PullRequest>,
2518 {
2519 self.0.request.pull_request = std::option::Option::Some(v.into());
2520 self
2521 }
2522
2523 pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
2527 where
2528 T: std::convert::Into<crate::model::PullRequest>,
2529 {
2530 self.0.request.pull_request = v.map(|x| x.into());
2531 self
2532 }
2533 }
2534
2535 #[doc(hidden)]
2536 impl gax::options::internal::RequestBuilder for CreatePullRequest {
2537 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2538 &mut self.0.options
2539 }
2540 }
2541
2542 #[derive(Clone, Debug)]
2559 pub struct GetPullRequest(RequestBuilder<crate::model::GetPullRequestRequest>);
2560
2561 impl GetPullRequest {
2562 pub(crate) fn new(
2563 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2564 ) -> Self {
2565 Self(RequestBuilder::new(stub))
2566 }
2567
2568 pub fn with_request<V: Into<crate::model::GetPullRequestRequest>>(mut self, v: V) -> Self {
2570 self.0.request = v.into();
2571 self
2572 }
2573
2574 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2576 self.0.options = v.into();
2577 self
2578 }
2579
2580 pub async fn send(self) -> Result<crate::model::PullRequest> {
2582 (*self.0.stub)
2583 .get_pull_request(self.0.request, self.0.options)
2584 .await
2585 .map(gax::response::Response::into_body)
2586 }
2587
2588 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2592 self.0.request.name = v.into();
2593 self
2594 }
2595 }
2596
2597 #[doc(hidden)]
2598 impl gax::options::internal::RequestBuilder for GetPullRequest {
2599 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2600 &mut self.0.options
2601 }
2602 }
2603
2604 #[derive(Clone, Debug)]
2625 pub struct ListPullRequests(RequestBuilder<crate::model::ListPullRequestsRequest>);
2626
2627 impl ListPullRequests {
2628 pub(crate) fn new(
2629 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2630 ) -> Self {
2631 Self(RequestBuilder::new(stub))
2632 }
2633
2634 pub fn with_request<V: Into<crate::model::ListPullRequestsRequest>>(
2636 mut self,
2637 v: V,
2638 ) -> Self {
2639 self.0.request = v.into();
2640 self
2641 }
2642
2643 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2645 self.0.options = v.into();
2646 self
2647 }
2648
2649 pub async fn send(self) -> Result<crate::model::ListPullRequestsResponse> {
2651 (*self.0.stub)
2652 .list_pull_requests(self.0.request, self.0.options)
2653 .await
2654 .map(gax::response::Response::into_body)
2655 }
2656
2657 pub fn by_page(
2659 self,
2660 ) -> impl gax::paginator::Paginator<crate::model::ListPullRequestsResponse, gax::error::Error>
2661 {
2662 use std::clone::Clone;
2663 let token = self.0.request.page_token.clone();
2664 let execute = move |token: String| {
2665 let mut builder = self.clone();
2666 builder.0.request = builder.0.request.set_page_token(token);
2667 builder.send()
2668 };
2669 gax::paginator::internal::new_paginator(token, execute)
2670 }
2671
2672 pub fn by_item(
2674 self,
2675 ) -> impl gax::paginator::ItemPaginator<crate::model::ListPullRequestsResponse, gax::error::Error>
2676 {
2677 use gax::paginator::Paginator;
2678 self.by_page().items()
2679 }
2680
2681 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2685 self.0.request.parent = v.into();
2686 self
2687 }
2688
2689 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2691 self.0.request.page_size = v.into();
2692 self
2693 }
2694
2695 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2697 self.0.request.page_token = v.into();
2698 self
2699 }
2700 }
2701
2702 #[doc(hidden)]
2703 impl gax::options::internal::RequestBuilder for ListPullRequests {
2704 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2705 &mut self.0.options
2706 }
2707 }
2708
2709 #[derive(Clone, Debug)]
2727 pub struct UpdatePullRequest(RequestBuilder<crate::model::UpdatePullRequestRequest>);
2728
2729 impl UpdatePullRequest {
2730 pub(crate) fn new(
2731 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2732 ) -> Self {
2733 Self(RequestBuilder::new(stub))
2734 }
2735
2736 pub fn with_request<V: Into<crate::model::UpdatePullRequestRequest>>(
2738 mut self,
2739 v: V,
2740 ) -> Self {
2741 self.0.request = v.into();
2742 self
2743 }
2744
2745 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2747 self.0.options = v.into();
2748 self
2749 }
2750
2751 pub async fn send(self) -> Result<longrunning::model::Operation> {
2758 (*self.0.stub)
2759 .update_pull_request(self.0.request, self.0.options)
2760 .await
2761 .map(gax::response::Response::into_body)
2762 }
2763
2764 pub fn poller(
2766 self,
2767 ) -> impl lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata> {
2768 type Operation = lro::internal::Operation<
2769 crate::model::PullRequest,
2770 crate::model::OperationMetadata,
2771 >;
2772 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2773 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2774
2775 let stub = self.0.stub.clone();
2776 let mut options = self.0.options.clone();
2777 options.set_retry_policy(gax::retry_policy::NeverRetry);
2778 let query = move |name| {
2779 let stub = stub.clone();
2780 let options = options.clone();
2781 async {
2782 let op = GetOperation::new(stub)
2783 .set_name(name)
2784 .with_options(options)
2785 .send()
2786 .await?;
2787 Ok(Operation::new(op))
2788 }
2789 };
2790
2791 let start = move || async {
2792 let op = self.send().await?;
2793 Ok(Operation::new(op))
2794 };
2795
2796 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2797 }
2798
2799 pub fn set_pull_request<T>(mut self, v: T) -> Self
2803 where
2804 T: std::convert::Into<crate::model::PullRequest>,
2805 {
2806 self.0.request.pull_request = std::option::Option::Some(v.into());
2807 self
2808 }
2809
2810 pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
2814 where
2815 T: std::convert::Into<crate::model::PullRequest>,
2816 {
2817 self.0.request.pull_request = v.map(|x| x.into());
2818 self
2819 }
2820
2821 pub fn set_update_mask<T>(mut self, v: T) -> Self
2823 where
2824 T: std::convert::Into<wkt::FieldMask>,
2825 {
2826 self.0.request.update_mask = std::option::Option::Some(v.into());
2827 self
2828 }
2829
2830 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2832 where
2833 T: std::convert::Into<wkt::FieldMask>,
2834 {
2835 self.0.request.update_mask = v.map(|x| x.into());
2836 self
2837 }
2838 }
2839
2840 #[doc(hidden)]
2841 impl gax::options::internal::RequestBuilder for UpdatePullRequest {
2842 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2843 &mut self.0.options
2844 }
2845 }
2846
2847 #[derive(Clone, Debug)]
2865 pub struct MergePullRequest(RequestBuilder<crate::model::MergePullRequestRequest>);
2866
2867 impl MergePullRequest {
2868 pub(crate) fn new(
2869 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2870 ) -> Self {
2871 Self(RequestBuilder::new(stub))
2872 }
2873
2874 pub fn with_request<V: Into<crate::model::MergePullRequestRequest>>(
2876 mut self,
2877 v: V,
2878 ) -> Self {
2879 self.0.request = v.into();
2880 self
2881 }
2882
2883 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2885 self.0.options = v.into();
2886 self
2887 }
2888
2889 pub async fn send(self) -> Result<longrunning::model::Operation> {
2896 (*self.0.stub)
2897 .merge_pull_request(self.0.request, self.0.options)
2898 .await
2899 .map(gax::response::Response::into_body)
2900 }
2901
2902 pub fn poller(
2904 self,
2905 ) -> impl lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata> {
2906 type Operation = lro::internal::Operation<
2907 crate::model::PullRequest,
2908 crate::model::OperationMetadata,
2909 >;
2910 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2911 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2912
2913 let stub = self.0.stub.clone();
2914 let mut options = self.0.options.clone();
2915 options.set_retry_policy(gax::retry_policy::NeverRetry);
2916 let query = move |name| {
2917 let stub = stub.clone();
2918 let options = options.clone();
2919 async {
2920 let op = GetOperation::new(stub)
2921 .set_name(name)
2922 .with_options(options)
2923 .send()
2924 .await?;
2925 Ok(Operation::new(op))
2926 }
2927 };
2928
2929 let start = move || async {
2930 let op = self.send().await?;
2931 Ok(Operation::new(op))
2932 };
2933
2934 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2935 }
2936
2937 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2941 self.0.request.name = v.into();
2942 self
2943 }
2944 }
2945
2946 #[doc(hidden)]
2947 impl gax::options::internal::RequestBuilder for MergePullRequest {
2948 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2949 &mut self.0.options
2950 }
2951 }
2952
2953 #[derive(Clone, Debug)]
2971 pub struct OpenPullRequest(RequestBuilder<crate::model::OpenPullRequestRequest>);
2972
2973 impl OpenPullRequest {
2974 pub(crate) fn new(
2975 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2976 ) -> Self {
2977 Self(RequestBuilder::new(stub))
2978 }
2979
2980 pub fn with_request<V: Into<crate::model::OpenPullRequestRequest>>(mut self, v: V) -> Self {
2982 self.0.request = v.into();
2983 self
2984 }
2985
2986 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2988 self.0.options = v.into();
2989 self
2990 }
2991
2992 pub async fn send(self) -> Result<longrunning::model::Operation> {
2999 (*self.0.stub)
3000 .open_pull_request(self.0.request, self.0.options)
3001 .await
3002 .map(gax::response::Response::into_body)
3003 }
3004
3005 pub fn poller(
3007 self,
3008 ) -> impl lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata> {
3009 type Operation = lro::internal::Operation<
3010 crate::model::PullRequest,
3011 crate::model::OperationMetadata,
3012 >;
3013 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3014 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3015
3016 let stub = self.0.stub.clone();
3017 let mut options = self.0.options.clone();
3018 options.set_retry_policy(gax::retry_policy::NeverRetry);
3019 let query = move |name| {
3020 let stub = stub.clone();
3021 let options = options.clone();
3022 async {
3023 let op = GetOperation::new(stub)
3024 .set_name(name)
3025 .with_options(options)
3026 .send()
3027 .await?;
3028 Ok(Operation::new(op))
3029 }
3030 };
3031
3032 let start = move || async {
3033 let op = self.send().await?;
3034 Ok(Operation::new(op))
3035 };
3036
3037 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3038 }
3039
3040 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3044 self.0.request.name = v.into();
3045 self
3046 }
3047 }
3048
3049 #[doc(hidden)]
3050 impl gax::options::internal::RequestBuilder for OpenPullRequest {
3051 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3052 &mut self.0.options
3053 }
3054 }
3055
3056 #[derive(Clone, Debug)]
3074 pub struct ClosePullRequest(RequestBuilder<crate::model::ClosePullRequestRequest>);
3075
3076 impl ClosePullRequest {
3077 pub(crate) fn new(
3078 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3079 ) -> Self {
3080 Self(RequestBuilder::new(stub))
3081 }
3082
3083 pub fn with_request<V: Into<crate::model::ClosePullRequestRequest>>(
3085 mut self,
3086 v: V,
3087 ) -> Self {
3088 self.0.request = v.into();
3089 self
3090 }
3091
3092 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3094 self.0.options = v.into();
3095 self
3096 }
3097
3098 pub async fn send(self) -> Result<longrunning::model::Operation> {
3105 (*self.0.stub)
3106 .close_pull_request(self.0.request, self.0.options)
3107 .await
3108 .map(gax::response::Response::into_body)
3109 }
3110
3111 pub fn poller(
3113 self,
3114 ) -> impl lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata> {
3115 type Operation = lro::internal::Operation<
3116 crate::model::PullRequest,
3117 crate::model::OperationMetadata,
3118 >;
3119 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3120 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3121
3122 let stub = self.0.stub.clone();
3123 let mut options = self.0.options.clone();
3124 options.set_retry_policy(gax::retry_policy::NeverRetry);
3125 let query = move |name| {
3126 let stub = stub.clone();
3127 let options = options.clone();
3128 async {
3129 let op = GetOperation::new(stub)
3130 .set_name(name)
3131 .with_options(options)
3132 .send()
3133 .await?;
3134 Ok(Operation::new(op))
3135 }
3136 };
3137
3138 let start = move || async {
3139 let op = self.send().await?;
3140 Ok(Operation::new(op))
3141 };
3142
3143 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3144 }
3145
3146 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3150 self.0.request.name = v.into();
3151 self
3152 }
3153 }
3154
3155 #[doc(hidden)]
3156 impl gax::options::internal::RequestBuilder for ClosePullRequest {
3157 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3158 &mut self.0.options
3159 }
3160 }
3161
3162 #[derive(Clone, Debug)]
3183 pub struct ListPullRequestFileDiffs(
3184 RequestBuilder<crate::model::ListPullRequestFileDiffsRequest>,
3185 );
3186
3187 impl ListPullRequestFileDiffs {
3188 pub(crate) fn new(
3189 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3190 ) -> Self {
3191 Self(RequestBuilder::new(stub))
3192 }
3193
3194 pub fn with_request<V: Into<crate::model::ListPullRequestFileDiffsRequest>>(
3196 mut self,
3197 v: V,
3198 ) -> Self {
3199 self.0.request = v.into();
3200 self
3201 }
3202
3203 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3205 self.0.options = v.into();
3206 self
3207 }
3208
3209 pub async fn send(self) -> Result<crate::model::ListPullRequestFileDiffsResponse> {
3211 (*self.0.stub)
3212 .list_pull_request_file_diffs(self.0.request, self.0.options)
3213 .await
3214 .map(gax::response::Response::into_body)
3215 }
3216
3217 pub fn by_page(
3219 self,
3220 ) -> impl gax::paginator::Paginator<
3221 crate::model::ListPullRequestFileDiffsResponse,
3222 gax::error::Error,
3223 > {
3224 use std::clone::Clone;
3225 let token = self.0.request.page_token.clone();
3226 let execute = move |token: String| {
3227 let mut builder = self.clone();
3228 builder.0.request = builder.0.request.set_page_token(token);
3229 builder.send()
3230 };
3231 gax::paginator::internal::new_paginator(token, execute)
3232 }
3233
3234 pub fn by_item(
3236 self,
3237 ) -> impl gax::paginator::ItemPaginator<
3238 crate::model::ListPullRequestFileDiffsResponse,
3239 gax::error::Error,
3240 > {
3241 use gax::paginator::Paginator;
3242 self.by_page().items()
3243 }
3244
3245 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3249 self.0.request.name = v.into();
3250 self
3251 }
3252
3253 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3255 self.0.request.page_size = v.into();
3256 self
3257 }
3258
3259 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3261 self.0.request.page_token = v.into();
3262 self
3263 }
3264 }
3265
3266 #[doc(hidden)]
3267 impl gax::options::internal::RequestBuilder for ListPullRequestFileDiffs {
3268 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3269 &mut self.0.options
3270 }
3271 }
3272
3273 #[derive(Clone, Debug)]
3294 pub struct FetchTree(RequestBuilder<crate::model::FetchTreeRequest>);
3295
3296 impl FetchTree {
3297 pub(crate) fn new(
3298 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3299 ) -> Self {
3300 Self(RequestBuilder::new(stub))
3301 }
3302
3303 pub fn with_request<V: Into<crate::model::FetchTreeRequest>>(mut self, v: V) -> Self {
3305 self.0.request = v.into();
3306 self
3307 }
3308
3309 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3311 self.0.options = v.into();
3312 self
3313 }
3314
3315 pub async fn send(self) -> Result<crate::model::FetchTreeResponse> {
3317 (*self.0.stub)
3318 .fetch_tree(self.0.request, self.0.options)
3319 .await
3320 .map(gax::response::Response::into_body)
3321 }
3322
3323 pub fn by_page(
3325 self,
3326 ) -> impl gax::paginator::Paginator<crate::model::FetchTreeResponse, gax::error::Error>
3327 {
3328 use std::clone::Clone;
3329 let token = self.0.request.page_token.clone();
3330 let execute = move |token: String| {
3331 let mut builder = self.clone();
3332 builder.0.request = builder.0.request.set_page_token(token);
3333 builder.send()
3334 };
3335 gax::paginator::internal::new_paginator(token, execute)
3336 }
3337
3338 pub fn by_item(
3340 self,
3341 ) -> impl gax::paginator::ItemPaginator<crate::model::FetchTreeResponse, gax::error::Error>
3342 {
3343 use gax::paginator::Paginator;
3344 self.by_page().items()
3345 }
3346
3347 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
3351 self.0.request.repository = v.into();
3352 self
3353 }
3354
3355 pub fn set_ref<T: Into<std::string::String>>(mut self, v: T) -> Self {
3357 self.0.request.r#ref = v.into();
3358 self
3359 }
3360
3361 pub fn set_recursive<T: Into<bool>>(mut self, v: T) -> Self {
3363 self.0.request.recursive = v.into();
3364 self
3365 }
3366
3367 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3369 self.0.request.page_size = v.into();
3370 self
3371 }
3372
3373 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3375 self.0.request.page_token = v.into();
3376 self
3377 }
3378 }
3379
3380 #[doc(hidden)]
3381 impl gax::options::internal::RequestBuilder for FetchTree {
3382 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3383 &mut self.0.options
3384 }
3385 }
3386
3387 #[derive(Clone, Debug)]
3404 pub struct FetchBlob(RequestBuilder<crate::model::FetchBlobRequest>);
3405
3406 impl FetchBlob {
3407 pub(crate) fn new(
3408 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3409 ) -> Self {
3410 Self(RequestBuilder::new(stub))
3411 }
3412
3413 pub fn with_request<V: Into<crate::model::FetchBlobRequest>>(mut self, v: V) -> Self {
3415 self.0.request = v.into();
3416 self
3417 }
3418
3419 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3421 self.0.options = v.into();
3422 self
3423 }
3424
3425 pub async fn send(self) -> Result<crate::model::FetchBlobResponse> {
3427 (*self.0.stub)
3428 .fetch_blob(self.0.request, self.0.options)
3429 .await
3430 .map(gax::response::Response::into_body)
3431 }
3432
3433 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
3437 self.0.request.repository = v.into();
3438 self
3439 }
3440
3441 pub fn set_sha<T: Into<std::string::String>>(mut self, v: T) -> Self {
3445 self.0.request.sha = v.into();
3446 self
3447 }
3448 }
3449
3450 #[doc(hidden)]
3451 impl gax::options::internal::RequestBuilder for FetchBlob {
3452 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3453 &mut self.0.options
3454 }
3455 }
3456
3457 #[derive(Clone, Debug)]
3475 pub struct CreateIssue(RequestBuilder<crate::model::CreateIssueRequest>);
3476
3477 impl CreateIssue {
3478 pub(crate) fn new(
3479 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3480 ) -> Self {
3481 Self(RequestBuilder::new(stub))
3482 }
3483
3484 pub fn with_request<V: Into<crate::model::CreateIssueRequest>>(mut self, v: V) -> Self {
3486 self.0.request = v.into();
3487 self
3488 }
3489
3490 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3492 self.0.options = v.into();
3493 self
3494 }
3495
3496 pub async fn send(self) -> Result<longrunning::model::Operation> {
3503 (*self.0.stub)
3504 .create_issue(self.0.request, self.0.options)
3505 .await
3506 .map(gax::response::Response::into_body)
3507 }
3508
3509 pub fn poller(
3511 self,
3512 ) -> impl lro::Poller<crate::model::Issue, crate::model::OperationMetadata> {
3513 type Operation =
3514 lro::internal::Operation<crate::model::Issue, crate::model::OperationMetadata>;
3515 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3516 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3517
3518 let stub = self.0.stub.clone();
3519 let mut options = self.0.options.clone();
3520 options.set_retry_policy(gax::retry_policy::NeverRetry);
3521 let query = move |name| {
3522 let stub = stub.clone();
3523 let options = options.clone();
3524 async {
3525 let op = GetOperation::new(stub)
3526 .set_name(name)
3527 .with_options(options)
3528 .send()
3529 .await?;
3530 Ok(Operation::new(op))
3531 }
3532 };
3533
3534 let start = move || async {
3535 let op = self.send().await?;
3536 Ok(Operation::new(op))
3537 };
3538
3539 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3540 }
3541
3542 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3546 self.0.request.parent = v.into();
3547 self
3548 }
3549
3550 pub fn set_issue<T>(mut self, v: T) -> Self
3554 where
3555 T: std::convert::Into<crate::model::Issue>,
3556 {
3557 self.0.request.issue = std::option::Option::Some(v.into());
3558 self
3559 }
3560
3561 pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
3565 where
3566 T: std::convert::Into<crate::model::Issue>,
3567 {
3568 self.0.request.issue = v.map(|x| x.into());
3569 self
3570 }
3571 }
3572
3573 #[doc(hidden)]
3574 impl gax::options::internal::RequestBuilder for CreateIssue {
3575 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3576 &mut self.0.options
3577 }
3578 }
3579
3580 #[derive(Clone, Debug)]
3597 pub struct GetIssue(RequestBuilder<crate::model::GetIssueRequest>);
3598
3599 impl GetIssue {
3600 pub(crate) fn new(
3601 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3602 ) -> Self {
3603 Self(RequestBuilder::new(stub))
3604 }
3605
3606 pub fn with_request<V: Into<crate::model::GetIssueRequest>>(mut self, v: V) -> Self {
3608 self.0.request = v.into();
3609 self
3610 }
3611
3612 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3614 self.0.options = v.into();
3615 self
3616 }
3617
3618 pub async fn send(self) -> Result<crate::model::Issue> {
3620 (*self.0.stub)
3621 .get_issue(self.0.request, self.0.options)
3622 .await
3623 .map(gax::response::Response::into_body)
3624 }
3625
3626 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3630 self.0.request.name = v.into();
3631 self
3632 }
3633 }
3634
3635 #[doc(hidden)]
3636 impl gax::options::internal::RequestBuilder for GetIssue {
3637 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3638 &mut self.0.options
3639 }
3640 }
3641
3642 #[derive(Clone, Debug)]
3663 pub struct ListIssues(RequestBuilder<crate::model::ListIssuesRequest>);
3664
3665 impl ListIssues {
3666 pub(crate) fn new(
3667 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3668 ) -> Self {
3669 Self(RequestBuilder::new(stub))
3670 }
3671
3672 pub fn with_request<V: Into<crate::model::ListIssuesRequest>>(mut self, v: V) -> Self {
3674 self.0.request = v.into();
3675 self
3676 }
3677
3678 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3680 self.0.options = v.into();
3681 self
3682 }
3683
3684 pub async fn send(self) -> Result<crate::model::ListIssuesResponse> {
3686 (*self.0.stub)
3687 .list_issues(self.0.request, self.0.options)
3688 .await
3689 .map(gax::response::Response::into_body)
3690 }
3691
3692 pub fn by_page(
3694 self,
3695 ) -> impl gax::paginator::Paginator<crate::model::ListIssuesResponse, gax::error::Error>
3696 {
3697 use std::clone::Clone;
3698 let token = self.0.request.page_token.clone();
3699 let execute = move |token: String| {
3700 let mut builder = self.clone();
3701 builder.0.request = builder.0.request.set_page_token(token);
3702 builder.send()
3703 };
3704 gax::paginator::internal::new_paginator(token, execute)
3705 }
3706
3707 pub fn by_item(
3709 self,
3710 ) -> impl gax::paginator::ItemPaginator<crate::model::ListIssuesResponse, gax::error::Error>
3711 {
3712 use gax::paginator::Paginator;
3713 self.by_page().items()
3714 }
3715
3716 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3720 self.0.request.parent = v.into();
3721 self
3722 }
3723
3724 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3726 self.0.request.page_size = v.into();
3727 self
3728 }
3729
3730 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3732 self.0.request.page_token = v.into();
3733 self
3734 }
3735
3736 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3738 self.0.request.filter = v.into();
3739 self
3740 }
3741 }
3742
3743 #[doc(hidden)]
3744 impl gax::options::internal::RequestBuilder for ListIssues {
3745 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3746 &mut self.0.options
3747 }
3748 }
3749
3750 #[derive(Clone, Debug)]
3768 pub struct UpdateIssue(RequestBuilder<crate::model::UpdateIssueRequest>);
3769
3770 impl UpdateIssue {
3771 pub(crate) fn new(
3772 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3773 ) -> Self {
3774 Self(RequestBuilder::new(stub))
3775 }
3776
3777 pub fn with_request<V: Into<crate::model::UpdateIssueRequest>>(mut self, v: V) -> Self {
3779 self.0.request = v.into();
3780 self
3781 }
3782
3783 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3785 self.0.options = v.into();
3786 self
3787 }
3788
3789 pub async fn send(self) -> Result<longrunning::model::Operation> {
3796 (*self.0.stub)
3797 .update_issue(self.0.request, self.0.options)
3798 .await
3799 .map(gax::response::Response::into_body)
3800 }
3801
3802 pub fn poller(
3804 self,
3805 ) -> impl lro::Poller<crate::model::Issue, crate::model::OperationMetadata> {
3806 type Operation =
3807 lro::internal::Operation<crate::model::Issue, crate::model::OperationMetadata>;
3808 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3809 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3810
3811 let stub = self.0.stub.clone();
3812 let mut options = self.0.options.clone();
3813 options.set_retry_policy(gax::retry_policy::NeverRetry);
3814 let query = move |name| {
3815 let stub = stub.clone();
3816 let options = options.clone();
3817 async {
3818 let op = GetOperation::new(stub)
3819 .set_name(name)
3820 .with_options(options)
3821 .send()
3822 .await?;
3823 Ok(Operation::new(op))
3824 }
3825 };
3826
3827 let start = move || async {
3828 let op = self.send().await?;
3829 Ok(Operation::new(op))
3830 };
3831
3832 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3833 }
3834
3835 pub fn set_issue<T>(mut self, v: T) -> Self
3839 where
3840 T: std::convert::Into<crate::model::Issue>,
3841 {
3842 self.0.request.issue = std::option::Option::Some(v.into());
3843 self
3844 }
3845
3846 pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
3850 where
3851 T: std::convert::Into<crate::model::Issue>,
3852 {
3853 self.0.request.issue = v.map(|x| x.into());
3854 self
3855 }
3856
3857 pub fn set_update_mask<T>(mut self, v: T) -> Self
3859 where
3860 T: std::convert::Into<wkt::FieldMask>,
3861 {
3862 self.0.request.update_mask = std::option::Option::Some(v.into());
3863 self
3864 }
3865
3866 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3868 where
3869 T: std::convert::Into<wkt::FieldMask>,
3870 {
3871 self.0.request.update_mask = v.map(|x| x.into());
3872 self
3873 }
3874 }
3875
3876 #[doc(hidden)]
3877 impl gax::options::internal::RequestBuilder for UpdateIssue {
3878 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3879 &mut self.0.options
3880 }
3881 }
3882
3883 #[derive(Clone, Debug)]
3901 pub struct DeleteIssue(RequestBuilder<crate::model::DeleteIssueRequest>);
3902
3903 impl DeleteIssue {
3904 pub(crate) fn new(
3905 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3906 ) -> Self {
3907 Self(RequestBuilder::new(stub))
3908 }
3909
3910 pub fn with_request<V: Into<crate::model::DeleteIssueRequest>>(mut self, v: V) -> Self {
3912 self.0.request = v.into();
3913 self
3914 }
3915
3916 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3918 self.0.options = v.into();
3919 self
3920 }
3921
3922 pub async fn send(self) -> Result<longrunning::model::Operation> {
3929 (*self.0.stub)
3930 .delete_issue(self.0.request, self.0.options)
3931 .await
3932 .map(gax::response::Response::into_body)
3933 }
3934
3935 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3937 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3938 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3939 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3940
3941 let stub = self.0.stub.clone();
3942 let mut options = self.0.options.clone();
3943 options.set_retry_policy(gax::retry_policy::NeverRetry);
3944 let query = move |name| {
3945 let stub = stub.clone();
3946 let options = options.clone();
3947 async {
3948 let op = GetOperation::new(stub)
3949 .set_name(name)
3950 .with_options(options)
3951 .send()
3952 .await?;
3953 Ok(Operation::new(op))
3954 }
3955 };
3956
3957 let start = move || async {
3958 let op = self.send().await?;
3959 Ok(Operation::new(op))
3960 };
3961
3962 lro::internal::new_unit_response_poller(
3963 polling_error_policy,
3964 polling_backoff_policy,
3965 start,
3966 query,
3967 )
3968 }
3969
3970 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3974 self.0.request.name = v.into();
3975 self
3976 }
3977
3978 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3980 self.0.request.etag = v.into();
3981 self
3982 }
3983 }
3984
3985 #[doc(hidden)]
3986 impl gax::options::internal::RequestBuilder for DeleteIssue {
3987 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3988 &mut self.0.options
3989 }
3990 }
3991
3992 #[derive(Clone, Debug)]
4010 pub struct OpenIssue(RequestBuilder<crate::model::OpenIssueRequest>);
4011
4012 impl OpenIssue {
4013 pub(crate) fn new(
4014 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4015 ) -> Self {
4016 Self(RequestBuilder::new(stub))
4017 }
4018
4019 pub fn with_request<V: Into<crate::model::OpenIssueRequest>>(mut self, v: V) -> Self {
4021 self.0.request = v.into();
4022 self
4023 }
4024
4025 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4027 self.0.options = v.into();
4028 self
4029 }
4030
4031 pub async fn send(self) -> Result<longrunning::model::Operation> {
4038 (*self.0.stub)
4039 .open_issue(self.0.request, self.0.options)
4040 .await
4041 .map(gax::response::Response::into_body)
4042 }
4043
4044 pub fn poller(
4046 self,
4047 ) -> impl lro::Poller<crate::model::Issue, crate::model::OperationMetadata> {
4048 type Operation =
4049 lro::internal::Operation<crate::model::Issue, crate::model::OperationMetadata>;
4050 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4051 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4052
4053 let stub = self.0.stub.clone();
4054 let mut options = self.0.options.clone();
4055 options.set_retry_policy(gax::retry_policy::NeverRetry);
4056 let query = move |name| {
4057 let stub = stub.clone();
4058 let options = options.clone();
4059 async {
4060 let op = GetOperation::new(stub)
4061 .set_name(name)
4062 .with_options(options)
4063 .send()
4064 .await?;
4065 Ok(Operation::new(op))
4066 }
4067 };
4068
4069 let start = move || async {
4070 let op = self.send().await?;
4071 Ok(Operation::new(op))
4072 };
4073
4074 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4075 }
4076
4077 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4081 self.0.request.name = v.into();
4082 self
4083 }
4084
4085 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4087 self.0.request.etag = v.into();
4088 self
4089 }
4090 }
4091
4092 #[doc(hidden)]
4093 impl gax::options::internal::RequestBuilder for OpenIssue {
4094 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4095 &mut self.0.options
4096 }
4097 }
4098
4099 #[derive(Clone, Debug)]
4117 pub struct CloseIssue(RequestBuilder<crate::model::CloseIssueRequest>);
4118
4119 impl CloseIssue {
4120 pub(crate) fn new(
4121 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4122 ) -> Self {
4123 Self(RequestBuilder::new(stub))
4124 }
4125
4126 pub fn with_request<V: Into<crate::model::CloseIssueRequest>>(mut self, v: V) -> Self {
4128 self.0.request = v.into();
4129 self
4130 }
4131
4132 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4134 self.0.options = v.into();
4135 self
4136 }
4137
4138 pub async fn send(self) -> Result<longrunning::model::Operation> {
4145 (*self.0.stub)
4146 .close_issue(self.0.request, self.0.options)
4147 .await
4148 .map(gax::response::Response::into_body)
4149 }
4150
4151 pub fn poller(
4153 self,
4154 ) -> impl lro::Poller<crate::model::Issue, crate::model::OperationMetadata> {
4155 type Operation =
4156 lro::internal::Operation<crate::model::Issue, crate::model::OperationMetadata>;
4157 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4158 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4159
4160 let stub = self.0.stub.clone();
4161 let mut options = self.0.options.clone();
4162 options.set_retry_policy(gax::retry_policy::NeverRetry);
4163 let query = move |name| {
4164 let stub = stub.clone();
4165 let options = options.clone();
4166 async {
4167 let op = GetOperation::new(stub)
4168 .set_name(name)
4169 .with_options(options)
4170 .send()
4171 .await?;
4172 Ok(Operation::new(op))
4173 }
4174 };
4175
4176 let start = move || async {
4177 let op = self.send().await?;
4178 Ok(Operation::new(op))
4179 };
4180
4181 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4182 }
4183
4184 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4188 self.0.request.name = v.into();
4189 self
4190 }
4191
4192 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4194 self.0.request.etag = v.into();
4195 self
4196 }
4197 }
4198
4199 #[doc(hidden)]
4200 impl gax::options::internal::RequestBuilder for CloseIssue {
4201 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4202 &mut self.0.options
4203 }
4204 }
4205
4206 #[derive(Clone, Debug)]
4223 pub struct GetPullRequestComment(RequestBuilder<crate::model::GetPullRequestCommentRequest>);
4224
4225 impl GetPullRequestComment {
4226 pub(crate) fn new(
4227 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4228 ) -> Self {
4229 Self(RequestBuilder::new(stub))
4230 }
4231
4232 pub fn with_request<V: Into<crate::model::GetPullRequestCommentRequest>>(
4234 mut self,
4235 v: V,
4236 ) -> Self {
4237 self.0.request = v.into();
4238 self
4239 }
4240
4241 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4243 self.0.options = v.into();
4244 self
4245 }
4246
4247 pub async fn send(self) -> Result<crate::model::PullRequestComment> {
4249 (*self.0.stub)
4250 .get_pull_request_comment(self.0.request, self.0.options)
4251 .await
4252 .map(gax::response::Response::into_body)
4253 }
4254
4255 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4259 self.0.request.name = v.into();
4260 self
4261 }
4262 }
4263
4264 #[doc(hidden)]
4265 impl gax::options::internal::RequestBuilder for GetPullRequestComment {
4266 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4267 &mut self.0.options
4268 }
4269 }
4270
4271 #[derive(Clone, Debug)]
4292 pub struct ListPullRequestComments(
4293 RequestBuilder<crate::model::ListPullRequestCommentsRequest>,
4294 );
4295
4296 impl ListPullRequestComments {
4297 pub(crate) fn new(
4298 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4299 ) -> Self {
4300 Self(RequestBuilder::new(stub))
4301 }
4302
4303 pub fn with_request<V: Into<crate::model::ListPullRequestCommentsRequest>>(
4305 mut self,
4306 v: V,
4307 ) -> Self {
4308 self.0.request = v.into();
4309 self
4310 }
4311
4312 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4314 self.0.options = v.into();
4315 self
4316 }
4317
4318 pub async fn send(self) -> Result<crate::model::ListPullRequestCommentsResponse> {
4320 (*self.0.stub)
4321 .list_pull_request_comments(self.0.request, self.0.options)
4322 .await
4323 .map(gax::response::Response::into_body)
4324 }
4325
4326 pub fn by_page(
4328 self,
4329 ) -> impl gax::paginator::Paginator<
4330 crate::model::ListPullRequestCommentsResponse,
4331 gax::error::Error,
4332 > {
4333 use std::clone::Clone;
4334 let token = self.0.request.page_token.clone();
4335 let execute = move |token: String| {
4336 let mut builder = self.clone();
4337 builder.0.request = builder.0.request.set_page_token(token);
4338 builder.send()
4339 };
4340 gax::paginator::internal::new_paginator(token, execute)
4341 }
4342
4343 pub fn by_item(
4345 self,
4346 ) -> impl gax::paginator::ItemPaginator<
4347 crate::model::ListPullRequestCommentsResponse,
4348 gax::error::Error,
4349 > {
4350 use gax::paginator::Paginator;
4351 self.by_page().items()
4352 }
4353
4354 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4358 self.0.request.parent = v.into();
4359 self
4360 }
4361
4362 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4364 self.0.request.page_size = v.into();
4365 self
4366 }
4367
4368 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4370 self.0.request.page_token = v.into();
4371 self
4372 }
4373 }
4374
4375 #[doc(hidden)]
4376 impl gax::options::internal::RequestBuilder for ListPullRequestComments {
4377 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4378 &mut self.0.options
4379 }
4380 }
4381
4382 #[derive(Clone, Debug)]
4400 pub struct CreatePullRequestComment(
4401 RequestBuilder<crate::model::CreatePullRequestCommentRequest>,
4402 );
4403
4404 impl CreatePullRequestComment {
4405 pub(crate) fn new(
4406 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4407 ) -> Self {
4408 Self(RequestBuilder::new(stub))
4409 }
4410
4411 pub fn with_request<V: Into<crate::model::CreatePullRequestCommentRequest>>(
4413 mut self,
4414 v: V,
4415 ) -> Self {
4416 self.0.request = v.into();
4417 self
4418 }
4419
4420 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4422 self.0.options = v.into();
4423 self
4424 }
4425
4426 pub async fn send(self) -> Result<longrunning::model::Operation> {
4433 (*self.0.stub)
4434 .create_pull_request_comment(self.0.request, self.0.options)
4435 .await
4436 .map(gax::response::Response::into_body)
4437 }
4438
4439 pub fn poller(
4441 self,
4442 ) -> impl lro::Poller<crate::model::PullRequestComment, crate::model::OperationMetadata>
4443 {
4444 type Operation = lro::internal::Operation<
4445 crate::model::PullRequestComment,
4446 crate::model::OperationMetadata,
4447 >;
4448 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4449 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4450
4451 let stub = self.0.stub.clone();
4452 let mut options = self.0.options.clone();
4453 options.set_retry_policy(gax::retry_policy::NeverRetry);
4454 let query = move |name| {
4455 let stub = stub.clone();
4456 let options = options.clone();
4457 async {
4458 let op = GetOperation::new(stub)
4459 .set_name(name)
4460 .with_options(options)
4461 .send()
4462 .await?;
4463 Ok(Operation::new(op))
4464 }
4465 };
4466
4467 let start = move || async {
4468 let op = self.send().await?;
4469 Ok(Operation::new(op))
4470 };
4471
4472 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4473 }
4474
4475 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4479 self.0.request.parent = v.into();
4480 self
4481 }
4482
4483 pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
4487 where
4488 T: std::convert::Into<crate::model::PullRequestComment>,
4489 {
4490 self.0.request.pull_request_comment = std::option::Option::Some(v.into());
4491 self
4492 }
4493
4494 pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
4498 where
4499 T: std::convert::Into<crate::model::PullRequestComment>,
4500 {
4501 self.0.request.pull_request_comment = v.map(|x| x.into());
4502 self
4503 }
4504 }
4505
4506 #[doc(hidden)]
4507 impl gax::options::internal::RequestBuilder for CreatePullRequestComment {
4508 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4509 &mut self.0.options
4510 }
4511 }
4512
4513 #[derive(Clone, Debug)]
4531 pub struct UpdatePullRequestComment(
4532 RequestBuilder<crate::model::UpdatePullRequestCommentRequest>,
4533 );
4534
4535 impl UpdatePullRequestComment {
4536 pub(crate) fn new(
4537 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4538 ) -> Self {
4539 Self(RequestBuilder::new(stub))
4540 }
4541
4542 pub fn with_request<V: Into<crate::model::UpdatePullRequestCommentRequest>>(
4544 mut self,
4545 v: V,
4546 ) -> Self {
4547 self.0.request = v.into();
4548 self
4549 }
4550
4551 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4553 self.0.options = v.into();
4554 self
4555 }
4556
4557 pub async fn send(self) -> Result<longrunning::model::Operation> {
4564 (*self.0.stub)
4565 .update_pull_request_comment(self.0.request, self.0.options)
4566 .await
4567 .map(gax::response::Response::into_body)
4568 }
4569
4570 pub fn poller(
4572 self,
4573 ) -> impl lro::Poller<crate::model::PullRequestComment, crate::model::OperationMetadata>
4574 {
4575 type Operation = lro::internal::Operation<
4576 crate::model::PullRequestComment,
4577 crate::model::OperationMetadata,
4578 >;
4579 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4580 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4581
4582 let stub = self.0.stub.clone();
4583 let mut options = self.0.options.clone();
4584 options.set_retry_policy(gax::retry_policy::NeverRetry);
4585 let query = move |name| {
4586 let stub = stub.clone();
4587 let options = options.clone();
4588 async {
4589 let op = GetOperation::new(stub)
4590 .set_name(name)
4591 .with_options(options)
4592 .send()
4593 .await?;
4594 Ok(Operation::new(op))
4595 }
4596 };
4597
4598 let start = move || async {
4599 let op = self.send().await?;
4600 Ok(Operation::new(op))
4601 };
4602
4603 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4604 }
4605
4606 pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
4610 where
4611 T: std::convert::Into<crate::model::PullRequestComment>,
4612 {
4613 self.0.request.pull_request_comment = std::option::Option::Some(v.into());
4614 self
4615 }
4616
4617 pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
4621 where
4622 T: std::convert::Into<crate::model::PullRequestComment>,
4623 {
4624 self.0.request.pull_request_comment = v.map(|x| x.into());
4625 self
4626 }
4627
4628 pub fn set_update_mask<T>(mut self, v: T) -> Self
4630 where
4631 T: std::convert::Into<wkt::FieldMask>,
4632 {
4633 self.0.request.update_mask = std::option::Option::Some(v.into());
4634 self
4635 }
4636
4637 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4639 where
4640 T: std::convert::Into<wkt::FieldMask>,
4641 {
4642 self.0.request.update_mask = v.map(|x| x.into());
4643 self
4644 }
4645 }
4646
4647 #[doc(hidden)]
4648 impl gax::options::internal::RequestBuilder for UpdatePullRequestComment {
4649 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4650 &mut self.0.options
4651 }
4652 }
4653
4654 #[derive(Clone, Debug)]
4672 pub struct DeletePullRequestComment(
4673 RequestBuilder<crate::model::DeletePullRequestCommentRequest>,
4674 );
4675
4676 impl DeletePullRequestComment {
4677 pub(crate) fn new(
4678 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4679 ) -> Self {
4680 Self(RequestBuilder::new(stub))
4681 }
4682
4683 pub fn with_request<V: Into<crate::model::DeletePullRequestCommentRequest>>(
4685 mut self,
4686 v: V,
4687 ) -> Self {
4688 self.0.request = v.into();
4689 self
4690 }
4691
4692 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4694 self.0.options = v.into();
4695 self
4696 }
4697
4698 pub async fn send(self) -> Result<longrunning::model::Operation> {
4705 (*self.0.stub)
4706 .delete_pull_request_comment(self.0.request, self.0.options)
4707 .await
4708 .map(gax::response::Response::into_body)
4709 }
4710
4711 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4713 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4714 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4715 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4716
4717 let stub = self.0.stub.clone();
4718 let mut options = self.0.options.clone();
4719 options.set_retry_policy(gax::retry_policy::NeverRetry);
4720 let query = move |name| {
4721 let stub = stub.clone();
4722 let options = options.clone();
4723 async {
4724 let op = GetOperation::new(stub)
4725 .set_name(name)
4726 .with_options(options)
4727 .send()
4728 .await?;
4729 Ok(Operation::new(op))
4730 }
4731 };
4732
4733 let start = move || async {
4734 let op = self.send().await?;
4735 Ok(Operation::new(op))
4736 };
4737
4738 lro::internal::new_unit_response_poller(
4739 polling_error_policy,
4740 polling_backoff_policy,
4741 start,
4742 query,
4743 )
4744 }
4745
4746 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4750 self.0.request.name = v.into();
4751 self
4752 }
4753 }
4754
4755 #[doc(hidden)]
4756 impl gax::options::internal::RequestBuilder for DeletePullRequestComment {
4757 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4758 &mut self.0.options
4759 }
4760 }
4761
4762 #[derive(Clone, Debug)]
4780 pub struct BatchCreatePullRequestComments(
4781 RequestBuilder<crate::model::BatchCreatePullRequestCommentsRequest>,
4782 );
4783
4784 impl BatchCreatePullRequestComments {
4785 pub(crate) fn new(
4786 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4787 ) -> Self {
4788 Self(RequestBuilder::new(stub))
4789 }
4790
4791 pub fn with_request<V: Into<crate::model::BatchCreatePullRequestCommentsRequest>>(
4793 mut self,
4794 v: V,
4795 ) -> Self {
4796 self.0.request = v.into();
4797 self
4798 }
4799
4800 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4802 self.0.options = v.into();
4803 self
4804 }
4805
4806 pub async fn send(self) -> Result<longrunning::model::Operation> {
4813 (*self.0.stub)
4814 .batch_create_pull_request_comments(self.0.request, self.0.options)
4815 .await
4816 .map(gax::response::Response::into_body)
4817 }
4818
4819 pub fn poller(
4821 self,
4822 ) -> impl lro::Poller<
4823 crate::model::BatchCreatePullRequestCommentsResponse,
4824 crate::model::OperationMetadata,
4825 > {
4826 type Operation = lro::internal::Operation<
4827 crate::model::BatchCreatePullRequestCommentsResponse,
4828 crate::model::OperationMetadata,
4829 >;
4830 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4831 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4832
4833 let stub = self.0.stub.clone();
4834 let mut options = self.0.options.clone();
4835 options.set_retry_policy(gax::retry_policy::NeverRetry);
4836 let query = move |name| {
4837 let stub = stub.clone();
4838 let options = options.clone();
4839 async {
4840 let op = GetOperation::new(stub)
4841 .set_name(name)
4842 .with_options(options)
4843 .send()
4844 .await?;
4845 Ok(Operation::new(op))
4846 }
4847 };
4848
4849 let start = move || async {
4850 let op = self.send().await?;
4851 Ok(Operation::new(op))
4852 };
4853
4854 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4855 }
4856
4857 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4861 self.0.request.parent = v.into();
4862 self
4863 }
4864
4865 pub fn set_requests<T, V>(mut self, v: T) -> Self
4869 where
4870 T: std::iter::IntoIterator<Item = V>,
4871 V: std::convert::Into<crate::model::CreatePullRequestCommentRequest>,
4872 {
4873 use std::iter::Iterator;
4874 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
4875 self
4876 }
4877 }
4878
4879 #[doc(hidden)]
4880 impl gax::options::internal::RequestBuilder for BatchCreatePullRequestComments {
4881 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4882 &mut self.0.options
4883 }
4884 }
4885
4886 #[derive(Clone, Debug)]
4904 pub struct ResolvePullRequestComments(
4905 RequestBuilder<crate::model::ResolvePullRequestCommentsRequest>,
4906 );
4907
4908 impl ResolvePullRequestComments {
4909 pub(crate) fn new(
4910 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4911 ) -> Self {
4912 Self(RequestBuilder::new(stub))
4913 }
4914
4915 pub fn with_request<V: Into<crate::model::ResolvePullRequestCommentsRequest>>(
4917 mut self,
4918 v: V,
4919 ) -> Self {
4920 self.0.request = v.into();
4921 self
4922 }
4923
4924 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4926 self.0.options = v.into();
4927 self
4928 }
4929
4930 pub async fn send(self) -> Result<longrunning::model::Operation> {
4937 (*self.0.stub)
4938 .resolve_pull_request_comments(self.0.request, self.0.options)
4939 .await
4940 .map(gax::response::Response::into_body)
4941 }
4942
4943 pub fn poller(
4945 self,
4946 ) -> impl lro::Poller<
4947 crate::model::ResolvePullRequestCommentsResponse,
4948 crate::model::OperationMetadata,
4949 > {
4950 type Operation = lro::internal::Operation<
4951 crate::model::ResolvePullRequestCommentsResponse,
4952 crate::model::OperationMetadata,
4953 >;
4954 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4955 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4956
4957 let stub = self.0.stub.clone();
4958 let mut options = self.0.options.clone();
4959 options.set_retry_policy(gax::retry_policy::NeverRetry);
4960 let query = move |name| {
4961 let stub = stub.clone();
4962 let options = options.clone();
4963 async {
4964 let op = GetOperation::new(stub)
4965 .set_name(name)
4966 .with_options(options)
4967 .send()
4968 .await?;
4969 Ok(Operation::new(op))
4970 }
4971 };
4972
4973 let start = move || async {
4974 let op = self.send().await?;
4975 Ok(Operation::new(op))
4976 };
4977
4978 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4979 }
4980
4981 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4985 self.0.request.parent = v.into();
4986 self
4987 }
4988
4989 pub fn set_names<T, V>(mut self, v: T) -> Self
4993 where
4994 T: std::iter::IntoIterator<Item = V>,
4995 V: std::convert::Into<std::string::String>,
4996 {
4997 use std::iter::Iterator;
4998 self.0.request.names = v.into_iter().map(|i| i.into()).collect();
4999 self
5000 }
5001
5002 pub fn set_auto_fill<T: Into<bool>>(mut self, v: T) -> Self {
5004 self.0.request.auto_fill = v.into();
5005 self
5006 }
5007 }
5008
5009 #[doc(hidden)]
5010 impl gax::options::internal::RequestBuilder for ResolvePullRequestComments {
5011 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5012 &mut self.0.options
5013 }
5014 }
5015
5016 #[derive(Clone, Debug)]
5034 pub struct UnresolvePullRequestComments(
5035 RequestBuilder<crate::model::UnresolvePullRequestCommentsRequest>,
5036 );
5037
5038 impl UnresolvePullRequestComments {
5039 pub(crate) fn new(
5040 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5041 ) -> Self {
5042 Self(RequestBuilder::new(stub))
5043 }
5044
5045 pub fn with_request<V: Into<crate::model::UnresolvePullRequestCommentsRequest>>(
5047 mut self,
5048 v: V,
5049 ) -> Self {
5050 self.0.request = v.into();
5051 self
5052 }
5053
5054 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5056 self.0.options = v.into();
5057 self
5058 }
5059
5060 pub async fn send(self) -> Result<longrunning::model::Operation> {
5067 (*self.0.stub)
5068 .unresolve_pull_request_comments(self.0.request, self.0.options)
5069 .await
5070 .map(gax::response::Response::into_body)
5071 }
5072
5073 pub fn poller(
5075 self,
5076 ) -> impl lro::Poller<
5077 crate::model::UnresolvePullRequestCommentsResponse,
5078 crate::model::OperationMetadata,
5079 > {
5080 type Operation = lro::internal::Operation<
5081 crate::model::UnresolvePullRequestCommentsResponse,
5082 crate::model::OperationMetadata,
5083 >;
5084 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5085 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5086
5087 let stub = self.0.stub.clone();
5088 let mut options = self.0.options.clone();
5089 options.set_retry_policy(gax::retry_policy::NeverRetry);
5090 let query = move |name| {
5091 let stub = stub.clone();
5092 let options = options.clone();
5093 async {
5094 let op = GetOperation::new(stub)
5095 .set_name(name)
5096 .with_options(options)
5097 .send()
5098 .await?;
5099 Ok(Operation::new(op))
5100 }
5101 };
5102
5103 let start = move || async {
5104 let op = self.send().await?;
5105 Ok(Operation::new(op))
5106 };
5107
5108 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5109 }
5110
5111 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5115 self.0.request.parent = v.into();
5116 self
5117 }
5118
5119 pub fn set_names<T, V>(mut self, v: T) -> Self
5123 where
5124 T: std::iter::IntoIterator<Item = V>,
5125 V: std::convert::Into<std::string::String>,
5126 {
5127 use std::iter::Iterator;
5128 self.0.request.names = v.into_iter().map(|i| i.into()).collect();
5129 self
5130 }
5131
5132 pub fn set_auto_fill<T: Into<bool>>(mut self, v: T) -> Self {
5134 self.0.request.auto_fill = v.into();
5135 self
5136 }
5137 }
5138
5139 #[doc(hidden)]
5140 impl gax::options::internal::RequestBuilder for UnresolvePullRequestComments {
5141 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5142 &mut self.0.options
5143 }
5144 }
5145
5146 #[derive(Clone, Debug)]
5164 pub struct CreateIssueComment(RequestBuilder<crate::model::CreateIssueCommentRequest>);
5165
5166 impl CreateIssueComment {
5167 pub(crate) fn new(
5168 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5169 ) -> Self {
5170 Self(RequestBuilder::new(stub))
5171 }
5172
5173 pub fn with_request<V: Into<crate::model::CreateIssueCommentRequest>>(
5175 mut self,
5176 v: V,
5177 ) -> Self {
5178 self.0.request = v.into();
5179 self
5180 }
5181
5182 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5184 self.0.options = v.into();
5185 self
5186 }
5187
5188 pub async fn send(self) -> Result<longrunning::model::Operation> {
5195 (*self.0.stub)
5196 .create_issue_comment(self.0.request, self.0.options)
5197 .await
5198 .map(gax::response::Response::into_body)
5199 }
5200
5201 pub fn poller(
5203 self,
5204 ) -> impl lro::Poller<crate::model::IssueComment, crate::model::OperationMetadata> {
5205 type Operation = lro::internal::Operation<
5206 crate::model::IssueComment,
5207 crate::model::OperationMetadata,
5208 >;
5209 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5210 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5211
5212 let stub = self.0.stub.clone();
5213 let mut options = self.0.options.clone();
5214 options.set_retry_policy(gax::retry_policy::NeverRetry);
5215 let query = move |name| {
5216 let stub = stub.clone();
5217 let options = options.clone();
5218 async {
5219 let op = GetOperation::new(stub)
5220 .set_name(name)
5221 .with_options(options)
5222 .send()
5223 .await?;
5224 Ok(Operation::new(op))
5225 }
5226 };
5227
5228 let start = move || async {
5229 let op = self.send().await?;
5230 Ok(Operation::new(op))
5231 };
5232
5233 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5234 }
5235
5236 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5240 self.0.request.parent = v.into();
5241 self
5242 }
5243
5244 pub fn set_issue_comment<T>(mut self, v: T) -> Self
5248 where
5249 T: std::convert::Into<crate::model::IssueComment>,
5250 {
5251 self.0.request.issue_comment = std::option::Option::Some(v.into());
5252 self
5253 }
5254
5255 pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
5259 where
5260 T: std::convert::Into<crate::model::IssueComment>,
5261 {
5262 self.0.request.issue_comment = v.map(|x| x.into());
5263 self
5264 }
5265 }
5266
5267 #[doc(hidden)]
5268 impl gax::options::internal::RequestBuilder for CreateIssueComment {
5269 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5270 &mut self.0.options
5271 }
5272 }
5273
5274 #[derive(Clone, Debug)]
5291 pub struct GetIssueComment(RequestBuilder<crate::model::GetIssueCommentRequest>);
5292
5293 impl GetIssueComment {
5294 pub(crate) fn new(
5295 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5296 ) -> Self {
5297 Self(RequestBuilder::new(stub))
5298 }
5299
5300 pub fn with_request<V: Into<crate::model::GetIssueCommentRequest>>(mut self, v: V) -> Self {
5302 self.0.request = v.into();
5303 self
5304 }
5305
5306 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5308 self.0.options = v.into();
5309 self
5310 }
5311
5312 pub async fn send(self) -> Result<crate::model::IssueComment> {
5314 (*self.0.stub)
5315 .get_issue_comment(self.0.request, self.0.options)
5316 .await
5317 .map(gax::response::Response::into_body)
5318 }
5319
5320 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5324 self.0.request.name = v.into();
5325 self
5326 }
5327 }
5328
5329 #[doc(hidden)]
5330 impl gax::options::internal::RequestBuilder for GetIssueComment {
5331 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5332 &mut self.0.options
5333 }
5334 }
5335
5336 #[derive(Clone, Debug)]
5357 pub struct ListIssueComments(RequestBuilder<crate::model::ListIssueCommentsRequest>);
5358
5359 impl ListIssueComments {
5360 pub(crate) fn new(
5361 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5362 ) -> Self {
5363 Self(RequestBuilder::new(stub))
5364 }
5365
5366 pub fn with_request<V: Into<crate::model::ListIssueCommentsRequest>>(
5368 mut self,
5369 v: V,
5370 ) -> Self {
5371 self.0.request = v.into();
5372 self
5373 }
5374
5375 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5377 self.0.options = v.into();
5378 self
5379 }
5380
5381 pub async fn send(self) -> Result<crate::model::ListIssueCommentsResponse> {
5383 (*self.0.stub)
5384 .list_issue_comments(self.0.request, self.0.options)
5385 .await
5386 .map(gax::response::Response::into_body)
5387 }
5388
5389 pub fn by_page(
5391 self,
5392 ) -> impl gax::paginator::Paginator<crate::model::ListIssueCommentsResponse, gax::error::Error>
5393 {
5394 use std::clone::Clone;
5395 let token = self.0.request.page_token.clone();
5396 let execute = move |token: String| {
5397 let mut builder = self.clone();
5398 builder.0.request = builder.0.request.set_page_token(token);
5399 builder.send()
5400 };
5401 gax::paginator::internal::new_paginator(token, execute)
5402 }
5403
5404 pub fn by_item(
5406 self,
5407 ) -> impl gax::paginator::ItemPaginator<crate::model::ListIssueCommentsResponse, gax::error::Error>
5408 {
5409 use gax::paginator::Paginator;
5410 self.by_page().items()
5411 }
5412
5413 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5417 self.0.request.parent = v.into();
5418 self
5419 }
5420
5421 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5423 self.0.request.page_size = v.into();
5424 self
5425 }
5426
5427 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5429 self.0.request.page_token = v.into();
5430 self
5431 }
5432 }
5433
5434 #[doc(hidden)]
5435 impl gax::options::internal::RequestBuilder for ListIssueComments {
5436 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5437 &mut self.0.options
5438 }
5439 }
5440
5441 #[derive(Clone, Debug)]
5459 pub struct UpdateIssueComment(RequestBuilder<crate::model::UpdateIssueCommentRequest>);
5460
5461 impl UpdateIssueComment {
5462 pub(crate) fn new(
5463 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5464 ) -> Self {
5465 Self(RequestBuilder::new(stub))
5466 }
5467
5468 pub fn with_request<V: Into<crate::model::UpdateIssueCommentRequest>>(
5470 mut self,
5471 v: V,
5472 ) -> Self {
5473 self.0.request = v.into();
5474 self
5475 }
5476
5477 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5479 self.0.options = v.into();
5480 self
5481 }
5482
5483 pub async fn send(self) -> Result<longrunning::model::Operation> {
5490 (*self.0.stub)
5491 .update_issue_comment(self.0.request, self.0.options)
5492 .await
5493 .map(gax::response::Response::into_body)
5494 }
5495
5496 pub fn poller(
5498 self,
5499 ) -> impl lro::Poller<crate::model::IssueComment, crate::model::OperationMetadata> {
5500 type Operation = lro::internal::Operation<
5501 crate::model::IssueComment,
5502 crate::model::OperationMetadata,
5503 >;
5504 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5505 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5506
5507 let stub = self.0.stub.clone();
5508 let mut options = self.0.options.clone();
5509 options.set_retry_policy(gax::retry_policy::NeverRetry);
5510 let query = move |name| {
5511 let stub = stub.clone();
5512 let options = options.clone();
5513 async {
5514 let op = GetOperation::new(stub)
5515 .set_name(name)
5516 .with_options(options)
5517 .send()
5518 .await?;
5519 Ok(Operation::new(op))
5520 }
5521 };
5522
5523 let start = move || async {
5524 let op = self.send().await?;
5525 Ok(Operation::new(op))
5526 };
5527
5528 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5529 }
5530
5531 pub fn set_issue_comment<T>(mut self, v: T) -> Self
5535 where
5536 T: std::convert::Into<crate::model::IssueComment>,
5537 {
5538 self.0.request.issue_comment = std::option::Option::Some(v.into());
5539 self
5540 }
5541
5542 pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
5546 where
5547 T: std::convert::Into<crate::model::IssueComment>,
5548 {
5549 self.0.request.issue_comment = v.map(|x| x.into());
5550 self
5551 }
5552
5553 pub fn set_update_mask<T>(mut self, v: T) -> Self
5555 where
5556 T: std::convert::Into<wkt::FieldMask>,
5557 {
5558 self.0.request.update_mask = std::option::Option::Some(v.into());
5559 self
5560 }
5561
5562 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5564 where
5565 T: std::convert::Into<wkt::FieldMask>,
5566 {
5567 self.0.request.update_mask = v.map(|x| x.into());
5568 self
5569 }
5570 }
5571
5572 #[doc(hidden)]
5573 impl gax::options::internal::RequestBuilder for UpdateIssueComment {
5574 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5575 &mut self.0.options
5576 }
5577 }
5578
5579 #[derive(Clone, Debug)]
5597 pub struct DeleteIssueComment(RequestBuilder<crate::model::DeleteIssueCommentRequest>);
5598
5599 impl DeleteIssueComment {
5600 pub(crate) fn new(
5601 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5602 ) -> Self {
5603 Self(RequestBuilder::new(stub))
5604 }
5605
5606 pub fn with_request<V: Into<crate::model::DeleteIssueCommentRequest>>(
5608 mut self,
5609 v: V,
5610 ) -> Self {
5611 self.0.request = v.into();
5612 self
5613 }
5614
5615 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5617 self.0.options = v.into();
5618 self
5619 }
5620
5621 pub async fn send(self) -> Result<longrunning::model::Operation> {
5628 (*self.0.stub)
5629 .delete_issue_comment(self.0.request, self.0.options)
5630 .await
5631 .map(gax::response::Response::into_body)
5632 }
5633
5634 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
5636 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5637 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5638 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5639
5640 let stub = self.0.stub.clone();
5641 let mut options = self.0.options.clone();
5642 options.set_retry_policy(gax::retry_policy::NeverRetry);
5643 let query = move |name| {
5644 let stub = stub.clone();
5645 let options = options.clone();
5646 async {
5647 let op = GetOperation::new(stub)
5648 .set_name(name)
5649 .with_options(options)
5650 .send()
5651 .await?;
5652 Ok(Operation::new(op))
5653 }
5654 };
5655
5656 let start = move || async {
5657 let op = self.send().await?;
5658 Ok(Operation::new(op))
5659 };
5660
5661 lro::internal::new_unit_response_poller(
5662 polling_error_policy,
5663 polling_backoff_policy,
5664 start,
5665 query,
5666 )
5667 }
5668
5669 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5673 self.0.request.name = v.into();
5674 self
5675 }
5676 }
5677
5678 #[doc(hidden)]
5679 impl gax::options::internal::RequestBuilder for DeleteIssueComment {
5680 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5681 &mut self.0.options
5682 }
5683 }
5684
5685 #[derive(Clone, Debug)]
5706 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5707
5708 impl ListLocations {
5709 pub(crate) fn new(
5710 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5711 ) -> Self {
5712 Self(RequestBuilder::new(stub))
5713 }
5714
5715 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5717 mut self,
5718 v: V,
5719 ) -> Self {
5720 self.0.request = v.into();
5721 self
5722 }
5723
5724 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5726 self.0.options = v.into();
5727 self
5728 }
5729
5730 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5732 (*self.0.stub)
5733 .list_locations(self.0.request, self.0.options)
5734 .await
5735 .map(gax::response::Response::into_body)
5736 }
5737
5738 pub fn by_page(
5740 self,
5741 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5742 {
5743 use std::clone::Clone;
5744 let token = self.0.request.page_token.clone();
5745 let execute = move |token: String| {
5746 let mut builder = self.clone();
5747 builder.0.request = builder.0.request.set_page_token(token);
5748 builder.send()
5749 };
5750 gax::paginator::internal::new_paginator(token, execute)
5751 }
5752
5753 pub fn by_item(
5755 self,
5756 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5757 {
5758 use gax::paginator::Paginator;
5759 self.by_page().items()
5760 }
5761
5762 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5764 self.0.request.name = v.into();
5765 self
5766 }
5767
5768 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5770 self.0.request.filter = v.into();
5771 self
5772 }
5773
5774 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5776 self.0.request.page_size = v.into();
5777 self
5778 }
5779
5780 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5782 self.0.request.page_token = v.into();
5783 self
5784 }
5785 }
5786
5787 #[doc(hidden)]
5788 impl gax::options::internal::RequestBuilder for ListLocations {
5789 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5790 &mut self.0.options
5791 }
5792 }
5793
5794 #[derive(Clone, Debug)]
5811 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5812
5813 impl GetLocation {
5814 pub(crate) fn new(
5815 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5816 ) -> Self {
5817 Self(RequestBuilder::new(stub))
5818 }
5819
5820 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5822 self.0.request = v.into();
5823 self
5824 }
5825
5826 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5828 self.0.options = v.into();
5829 self
5830 }
5831
5832 pub async fn send(self) -> Result<location::model::Location> {
5834 (*self.0.stub)
5835 .get_location(self.0.request, self.0.options)
5836 .await
5837 .map(gax::response::Response::into_body)
5838 }
5839
5840 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5842 self.0.request.name = v.into();
5843 self
5844 }
5845 }
5846
5847 #[doc(hidden)]
5848 impl gax::options::internal::RequestBuilder for GetLocation {
5849 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5850 &mut self.0.options
5851 }
5852 }
5853
5854 #[derive(Clone, Debug)]
5871 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5872
5873 impl SetIamPolicy {
5874 pub(crate) fn new(
5875 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5876 ) -> Self {
5877 Self(RequestBuilder::new(stub))
5878 }
5879
5880 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5882 self.0.request = v.into();
5883 self
5884 }
5885
5886 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5888 self.0.options = v.into();
5889 self
5890 }
5891
5892 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5894 (*self.0.stub)
5895 .set_iam_policy(self.0.request, self.0.options)
5896 .await
5897 .map(gax::response::Response::into_body)
5898 }
5899
5900 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5904 self.0.request.resource = v.into();
5905 self
5906 }
5907
5908 pub fn set_policy<T>(mut self, v: T) -> Self
5912 where
5913 T: std::convert::Into<iam_v1::model::Policy>,
5914 {
5915 self.0.request.policy = std::option::Option::Some(v.into());
5916 self
5917 }
5918
5919 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5923 where
5924 T: std::convert::Into<iam_v1::model::Policy>,
5925 {
5926 self.0.request.policy = v.map(|x| x.into());
5927 self
5928 }
5929
5930 pub fn set_update_mask<T>(mut self, v: T) -> Self
5932 where
5933 T: std::convert::Into<wkt::FieldMask>,
5934 {
5935 self.0.request.update_mask = std::option::Option::Some(v.into());
5936 self
5937 }
5938
5939 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5941 where
5942 T: std::convert::Into<wkt::FieldMask>,
5943 {
5944 self.0.request.update_mask = v.map(|x| x.into());
5945 self
5946 }
5947 }
5948
5949 #[doc(hidden)]
5950 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5951 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5952 &mut self.0.options
5953 }
5954 }
5955
5956 #[derive(Clone, Debug)]
5973 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5974
5975 impl GetIamPolicy {
5976 pub(crate) fn new(
5977 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5978 ) -> Self {
5979 Self(RequestBuilder::new(stub))
5980 }
5981
5982 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5984 self.0.request = v.into();
5985 self
5986 }
5987
5988 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5990 self.0.options = v.into();
5991 self
5992 }
5993
5994 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5996 (*self.0.stub)
5997 .get_iam_policy(self.0.request, self.0.options)
5998 .await
5999 .map(gax::response::Response::into_body)
6000 }
6001
6002 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6006 self.0.request.resource = v.into();
6007 self
6008 }
6009
6010 pub fn set_options<T>(mut self, v: T) -> Self
6012 where
6013 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
6014 {
6015 self.0.request.options = std::option::Option::Some(v.into());
6016 self
6017 }
6018
6019 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6021 where
6022 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
6023 {
6024 self.0.request.options = v.map(|x| x.into());
6025 self
6026 }
6027 }
6028
6029 #[doc(hidden)]
6030 impl gax::options::internal::RequestBuilder for GetIamPolicy {
6031 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6032 &mut self.0.options
6033 }
6034 }
6035
6036 #[derive(Clone, Debug)]
6053 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
6054
6055 impl TestIamPermissions {
6056 pub(crate) fn new(
6057 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6058 ) -> Self {
6059 Self(RequestBuilder::new(stub))
6060 }
6061
6062 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
6064 mut self,
6065 v: V,
6066 ) -> Self {
6067 self.0.request = v.into();
6068 self
6069 }
6070
6071 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6073 self.0.options = v.into();
6074 self
6075 }
6076
6077 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
6079 (*self.0.stub)
6080 .test_iam_permissions(self.0.request, self.0.options)
6081 .await
6082 .map(gax::response::Response::into_body)
6083 }
6084
6085 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6089 self.0.request.resource = v.into();
6090 self
6091 }
6092
6093 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6097 where
6098 T: std::iter::IntoIterator<Item = V>,
6099 V: std::convert::Into<std::string::String>,
6100 {
6101 use std::iter::Iterator;
6102 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6103 self
6104 }
6105 }
6106
6107 #[doc(hidden)]
6108 impl gax::options::internal::RequestBuilder for TestIamPermissions {
6109 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6110 &mut self.0.options
6111 }
6112 }
6113
6114 #[derive(Clone, Debug)]
6135 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6136
6137 impl ListOperations {
6138 pub(crate) fn new(
6139 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6140 ) -> Self {
6141 Self(RequestBuilder::new(stub))
6142 }
6143
6144 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6146 mut self,
6147 v: V,
6148 ) -> Self {
6149 self.0.request = v.into();
6150 self
6151 }
6152
6153 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6155 self.0.options = v.into();
6156 self
6157 }
6158
6159 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6161 (*self.0.stub)
6162 .list_operations(self.0.request, self.0.options)
6163 .await
6164 .map(gax::response::Response::into_body)
6165 }
6166
6167 pub fn by_page(
6169 self,
6170 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6171 {
6172 use std::clone::Clone;
6173 let token = self.0.request.page_token.clone();
6174 let execute = move |token: String| {
6175 let mut builder = self.clone();
6176 builder.0.request = builder.0.request.set_page_token(token);
6177 builder.send()
6178 };
6179 gax::paginator::internal::new_paginator(token, execute)
6180 }
6181
6182 pub fn by_item(
6184 self,
6185 ) -> impl gax::paginator::ItemPaginator<
6186 longrunning::model::ListOperationsResponse,
6187 gax::error::Error,
6188 > {
6189 use gax::paginator::Paginator;
6190 self.by_page().items()
6191 }
6192
6193 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6195 self.0.request.name = v.into();
6196 self
6197 }
6198
6199 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6201 self.0.request.filter = v.into();
6202 self
6203 }
6204
6205 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6207 self.0.request.page_size = v.into();
6208 self
6209 }
6210
6211 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6213 self.0.request.page_token = v.into();
6214 self
6215 }
6216
6217 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6219 self.0.request.return_partial_success = v.into();
6220 self
6221 }
6222 }
6223
6224 #[doc(hidden)]
6225 impl gax::options::internal::RequestBuilder for ListOperations {
6226 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6227 &mut self.0.options
6228 }
6229 }
6230
6231 #[derive(Clone, Debug)]
6248 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6249
6250 impl GetOperation {
6251 pub(crate) fn new(
6252 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6253 ) -> Self {
6254 Self(RequestBuilder::new(stub))
6255 }
6256
6257 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6259 mut self,
6260 v: V,
6261 ) -> Self {
6262 self.0.request = v.into();
6263 self
6264 }
6265
6266 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6268 self.0.options = v.into();
6269 self
6270 }
6271
6272 pub async fn send(self) -> Result<longrunning::model::Operation> {
6274 (*self.0.stub)
6275 .get_operation(self.0.request, self.0.options)
6276 .await
6277 .map(gax::response::Response::into_body)
6278 }
6279
6280 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6282 self.0.request.name = v.into();
6283 self
6284 }
6285 }
6286
6287 #[doc(hidden)]
6288 impl gax::options::internal::RequestBuilder for GetOperation {
6289 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6290 &mut self.0.options
6291 }
6292 }
6293
6294 #[derive(Clone, Debug)]
6311 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6312
6313 impl DeleteOperation {
6314 pub(crate) fn new(
6315 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6316 ) -> Self {
6317 Self(RequestBuilder::new(stub))
6318 }
6319
6320 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6322 mut self,
6323 v: V,
6324 ) -> Self {
6325 self.0.request = v.into();
6326 self
6327 }
6328
6329 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6331 self.0.options = v.into();
6332 self
6333 }
6334
6335 pub async fn send(self) -> Result<()> {
6337 (*self.0.stub)
6338 .delete_operation(self.0.request, self.0.options)
6339 .await
6340 .map(gax::response::Response::into_body)
6341 }
6342
6343 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6345 self.0.request.name = v.into();
6346 self
6347 }
6348 }
6349
6350 #[doc(hidden)]
6351 impl gax::options::internal::RequestBuilder for DeleteOperation {
6352 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6353 &mut self.0.options
6354 }
6355 }
6356
6357 #[derive(Clone, Debug)]
6374 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6375
6376 impl CancelOperation {
6377 pub(crate) fn new(
6378 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6379 ) -> Self {
6380 Self(RequestBuilder::new(stub))
6381 }
6382
6383 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6385 mut self,
6386 v: V,
6387 ) -> Self {
6388 self.0.request = v.into();
6389 self
6390 }
6391
6392 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6394 self.0.options = v.into();
6395 self
6396 }
6397
6398 pub async fn send(self) -> Result<()> {
6400 (*self.0.stub)
6401 .cancel_operation(self.0.request, self.0.options)
6402 .await
6403 .map(gax::response::Response::into_body)
6404 }
6405
6406 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6408 self.0.request.name = v.into();
6409 self
6410 }
6411 }
6412
6413 #[doc(hidden)]
6414 impl gax::options::internal::RequestBuilder for CancelOperation {
6415 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6416 &mut self.0.options
6417 }
6418 }
6419}