1pub mod repository_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::RepositoryManager;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = RepositoryManager;
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::RepositoryManager>,
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::RepositoryManager>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
93 pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
94
95 impl CreateConnection {
96 pub(crate) fn new(
97 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
98 ) -> Self {
99 Self(RequestBuilder::new(stub))
100 }
101
102 pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
104 mut self,
105 v: V,
106 ) -> Self {
107 self.0.request = v.into();
108 self
109 }
110
111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113 self.0.options = v.into();
114 self
115 }
116
117 pub async fn send(self) -> Result<longrunning::model::Operation> {
124 (*self.0.stub)
125 .create_connection(self.0.request, self.0.options)
126 .await
127 .map(gax::response::Response::into_body)
128 }
129
130 pub fn poller(
132 self,
133 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
134 type Operation =
135 lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
136 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
137 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
138
139 let stub = self.0.stub.clone();
140 let mut options = self.0.options.clone();
141 options.set_retry_policy(gax::retry_policy::NeverRetry);
142 let query = move |name| {
143 let stub = stub.clone();
144 let options = options.clone();
145 async {
146 let op = GetOperation::new(stub)
147 .set_name(name)
148 .with_options(options)
149 .send()
150 .await?;
151 Ok(Operation::new(op))
152 }
153 };
154
155 let start = move || async {
156 let op = self.send().await?;
157 Ok(Operation::new(op))
158 };
159
160 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
161 }
162
163 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
167 self.0.request.parent = v.into();
168 self
169 }
170
171 pub fn set_connection<T>(mut self, v: T) -> Self
175 where
176 T: std::convert::Into<crate::model::Connection>,
177 {
178 self.0.request.connection = std::option::Option::Some(v.into());
179 self
180 }
181
182 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
186 where
187 T: std::convert::Into<crate::model::Connection>,
188 {
189 self.0.request.connection = v.map(|x| x.into());
190 self
191 }
192
193 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
197 self.0.request.connection_id = v.into();
198 self
199 }
200 }
201
202 #[doc(hidden)]
203 impl gax::options::internal::RequestBuilder for CreateConnection {
204 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
205 &mut self.0.options
206 }
207 }
208
209 #[derive(Clone, Debug)]
227 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
228
229 impl GetConnection {
230 pub(crate) fn new(
231 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
232 ) -> Self {
233 Self(RequestBuilder::new(stub))
234 }
235
236 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
238 self.0.request = v.into();
239 self
240 }
241
242 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
244 self.0.options = v.into();
245 self
246 }
247
248 pub async fn send(self) -> Result<crate::model::Connection> {
250 (*self.0.stub)
251 .get_connection(self.0.request, self.0.options)
252 .await
253 .map(gax::response::Response::into_body)
254 }
255
256 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
260 self.0.request.name = v.into();
261 self
262 }
263 }
264
265 #[doc(hidden)]
266 impl gax::options::internal::RequestBuilder for GetConnection {
267 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
268 &mut self.0.options
269 }
270 }
271
272 #[derive(Clone, Debug)]
294 pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
295
296 impl ListConnections {
297 pub(crate) fn new(
298 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
299 ) -> Self {
300 Self(RequestBuilder::new(stub))
301 }
302
303 pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
305 self.0.request = v.into();
306 self
307 }
308
309 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
311 self.0.options = v.into();
312 self
313 }
314
315 pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
317 (*self.0.stub)
318 .list_connections(self.0.request, self.0.options)
319 .await
320 .map(gax::response::Response::into_body)
321 }
322
323 pub fn by_page(
325 self,
326 ) -> impl gax::paginator::Paginator<crate::model::ListConnectionsResponse, gax::error::Error>
327 {
328 use std::clone::Clone;
329 let token = self.0.request.page_token.clone();
330 let execute = move |token: String| {
331 let mut builder = self.clone();
332 builder.0.request = builder.0.request.set_page_token(token);
333 builder.send()
334 };
335 gax::paginator::internal::new_paginator(token, execute)
336 }
337
338 pub fn by_item(
340 self,
341 ) -> impl gax::paginator::ItemPaginator<crate::model::ListConnectionsResponse, gax::error::Error>
342 {
343 use gax::paginator::Paginator;
344 self.by_page().items()
345 }
346
347 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
351 self.0.request.parent = v.into();
352 self
353 }
354
355 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
357 self.0.request.page_size = v.into();
358 self
359 }
360
361 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
363 self.0.request.page_token = v.into();
364 self
365 }
366 }
367
368 #[doc(hidden)]
369 impl gax::options::internal::RequestBuilder for ListConnections {
370 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
371 &mut self.0.options
372 }
373 }
374
375 #[derive(Clone, Debug)]
394 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
395
396 impl UpdateConnection {
397 pub(crate) fn new(
398 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
399 ) -> Self {
400 Self(RequestBuilder::new(stub))
401 }
402
403 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
405 mut self,
406 v: V,
407 ) -> Self {
408 self.0.request = v.into();
409 self
410 }
411
412 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
414 self.0.options = v.into();
415 self
416 }
417
418 pub async fn send(self) -> Result<longrunning::model::Operation> {
425 (*self.0.stub)
426 .update_connection(self.0.request, self.0.options)
427 .await
428 .map(gax::response::Response::into_body)
429 }
430
431 pub fn poller(
433 self,
434 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
435 type Operation =
436 lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
437 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
438 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
439
440 let stub = self.0.stub.clone();
441 let mut options = self.0.options.clone();
442 options.set_retry_policy(gax::retry_policy::NeverRetry);
443 let query = move |name| {
444 let stub = stub.clone();
445 let options = options.clone();
446 async {
447 let op = GetOperation::new(stub)
448 .set_name(name)
449 .with_options(options)
450 .send()
451 .await?;
452 Ok(Operation::new(op))
453 }
454 };
455
456 let start = move || async {
457 let op = self.send().await?;
458 Ok(Operation::new(op))
459 };
460
461 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
462 }
463
464 pub fn set_connection<T>(mut self, v: T) -> Self
468 where
469 T: std::convert::Into<crate::model::Connection>,
470 {
471 self.0.request.connection = std::option::Option::Some(v.into());
472 self
473 }
474
475 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
479 where
480 T: std::convert::Into<crate::model::Connection>,
481 {
482 self.0.request.connection = v.map(|x| x.into());
483 self
484 }
485
486 pub fn set_update_mask<T>(mut self, v: T) -> Self
488 where
489 T: std::convert::Into<wkt::FieldMask>,
490 {
491 self.0.request.update_mask = std::option::Option::Some(v.into());
492 self
493 }
494
495 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
497 where
498 T: std::convert::Into<wkt::FieldMask>,
499 {
500 self.0.request.update_mask = v.map(|x| x.into());
501 self
502 }
503
504 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
506 self.0.request.allow_missing = v.into();
507 self
508 }
509
510 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
512 self.0.request.etag = v.into();
513 self
514 }
515 }
516
517 #[doc(hidden)]
518 impl gax::options::internal::RequestBuilder for UpdateConnection {
519 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
520 &mut self.0.options
521 }
522 }
523
524 #[derive(Clone, Debug)]
543 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
544
545 impl DeleteConnection {
546 pub(crate) fn new(
547 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
548 ) -> Self {
549 Self(RequestBuilder::new(stub))
550 }
551
552 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
554 mut self,
555 v: V,
556 ) -> Self {
557 self.0.request = v.into();
558 self
559 }
560
561 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
563 self.0.options = v.into();
564 self
565 }
566
567 pub async fn send(self) -> Result<longrunning::model::Operation> {
574 (*self.0.stub)
575 .delete_connection(self.0.request, self.0.options)
576 .await
577 .map(gax::response::Response::into_body)
578 }
579
580 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
582 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
583 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
584 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
585
586 let stub = self.0.stub.clone();
587 let mut options = self.0.options.clone();
588 options.set_retry_policy(gax::retry_policy::NeverRetry);
589 let query = move |name| {
590 let stub = stub.clone();
591 let options = options.clone();
592 async {
593 let op = GetOperation::new(stub)
594 .set_name(name)
595 .with_options(options)
596 .send()
597 .await?;
598 Ok(Operation::new(op))
599 }
600 };
601
602 let start = move || async {
603 let op = self.send().await?;
604 Ok(Operation::new(op))
605 };
606
607 lro::internal::new_unit_response_poller(
608 polling_error_policy,
609 polling_backoff_policy,
610 start,
611 query,
612 )
613 }
614
615 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
619 self.0.request.name = v.into();
620 self
621 }
622
623 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
625 self.0.request.etag = v.into();
626 self
627 }
628
629 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
631 self.0.request.validate_only = v.into();
632 self
633 }
634 }
635
636 #[doc(hidden)]
637 impl gax::options::internal::RequestBuilder for DeleteConnection {
638 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
639 &mut self.0.options
640 }
641 }
642
643 #[derive(Clone, Debug)]
662 pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
663
664 impl CreateRepository {
665 pub(crate) fn new(
666 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
667 ) -> Self {
668 Self(RequestBuilder::new(stub))
669 }
670
671 pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
673 mut self,
674 v: V,
675 ) -> Self {
676 self.0.request = v.into();
677 self
678 }
679
680 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
682 self.0.options = v.into();
683 self
684 }
685
686 pub async fn send(self) -> Result<longrunning::model::Operation> {
693 (*self.0.stub)
694 .create_repository(self.0.request, self.0.options)
695 .await
696 .map(gax::response::Response::into_body)
697 }
698
699 pub fn poller(
701 self,
702 ) -> impl lro::Poller<crate::model::Repository, crate::model::OperationMetadata> {
703 type Operation =
704 lro::internal::Operation<crate::model::Repository, crate::model::OperationMetadata>;
705 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
706 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
707
708 let stub = self.0.stub.clone();
709 let mut options = self.0.options.clone();
710 options.set_retry_policy(gax::retry_policy::NeverRetry);
711 let query = move |name| {
712 let stub = stub.clone();
713 let options = options.clone();
714 async {
715 let op = GetOperation::new(stub)
716 .set_name(name)
717 .with_options(options)
718 .send()
719 .await?;
720 Ok(Operation::new(op))
721 }
722 };
723
724 let start = move || async {
725 let op = self.send().await?;
726 Ok(Operation::new(op))
727 };
728
729 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
730 }
731
732 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
736 self.0.request.parent = v.into();
737 self
738 }
739
740 pub fn set_repository<T>(mut self, v: T) -> Self
744 where
745 T: std::convert::Into<crate::model::Repository>,
746 {
747 self.0.request.repository = std::option::Option::Some(v.into());
748 self
749 }
750
751 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
755 where
756 T: std::convert::Into<crate::model::Repository>,
757 {
758 self.0.request.repository = v.map(|x| x.into());
759 self
760 }
761
762 pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
766 self.0.request.repository_id = v.into();
767 self
768 }
769 }
770
771 #[doc(hidden)]
772 impl gax::options::internal::RequestBuilder for CreateRepository {
773 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
774 &mut self.0.options
775 }
776 }
777
778 #[derive(Clone, Debug)]
797 pub struct BatchCreateRepositories(
798 RequestBuilder<crate::model::BatchCreateRepositoriesRequest>,
799 );
800
801 impl BatchCreateRepositories {
802 pub(crate) fn new(
803 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
804 ) -> Self {
805 Self(RequestBuilder::new(stub))
806 }
807
808 pub fn with_request<V: Into<crate::model::BatchCreateRepositoriesRequest>>(
810 mut self,
811 v: V,
812 ) -> Self {
813 self.0.request = v.into();
814 self
815 }
816
817 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
819 self.0.options = v.into();
820 self
821 }
822
823 pub async fn send(self) -> Result<longrunning::model::Operation> {
830 (*self.0.stub)
831 .batch_create_repositories(self.0.request, self.0.options)
832 .await
833 .map(gax::response::Response::into_body)
834 }
835
836 pub fn poller(
838 self,
839 ) -> impl lro::Poller<
840 crate::model::BatchCreateRepositoriesResponse,
841 crate::model::OperationMetadata,
842 > {
843 type Operation = lro::internal::Operation<
844 crate::model::BatchCreateRepositoriesResponse,
845 crate::model::OperationMetadata,
846 >;
847 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
848 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
849
850 let stub = self.0.stub.clone();
851 let mut options = self.0.options.clone();
852 options.set_retry_policy(gax::retry_policy::NeverRetry);
853 let query = move |name| {
854 let stub = stub.clone();
855 let options = options.clone();
856 async {
857 let op = GetOperation::new(stub)
858 .set_name(name)
859 .with_options(options)
860 .send()
861 .await?;
862 Ok(Operation::new(op))
863 }
864 };
865
866 let start = move || async {
867 let op = self.send().await?;
868 Ok(Operation::new(op))
869 };
870
871 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
872 }
873
874 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
878 self.0.request.parent = v.into();
879 self
880 }
881
882 pub fn set_requests<T, V>(mut self, v: T) -> Self
886 where
887 T: std::iter::IntoIterator<Item = V>,
888 V: std::convert::Into<crate::model::CreateRepositoryRequest>,
889 {
890 use std::iter::Iterator;
891 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
892 self
893 }
894 }
895
896 #[doc(hidden)]
897 impl gax::options::internal::RequestBuilder for BatchCreateRepositories {
898 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
899 &mut self.0.options
900 }
901 }
902
903 #[derive(Clone, Debug)]
921 pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
922
923 impl GetRepository {
924 pub(crate) fn new(
925 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
926 ) -> Self {
927 Self(RequestBuilder::new(stub))
928 }
929
930 pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
932 self.0.request = v.into();
933 self
934 }
935
936 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
938 self.0.options = v.into();
939 self
940 }
941
942 pub async fn send(self) -> Result<crate::model::Repository> {
944 (*self.0.stub)
945 .get_repository(self.0.request, self.0.options)
946 .await
947 .map(gax::response::Response::into_body)
948 }
949
950 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
954 self.0.request.name = v.into();
955 self
956 }
957 }
958
959 #[doc(hidden)]
960 impl gax::options::internal::RequestBuilder for GetRepository {
961 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
962 &mut self.0.options
963 }
964 }
965
966 #[derive(Clone, Debug)]
988 pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
989
990 impl ListRepositories {
991 pub(crate) fn new(
992 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
993 ) -> Self {
994 Self(RequestBuilder::new(stub))
995 }
996
997 pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
999 mut self,
1000 v: V,
1001 ) -> Self {
1002 self.0.request = v.into();
1003 self
1004 }
1005
1006 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1008 self.0.options = v.into();
1009 self
1010 }
1011
1012 pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
1014 (*self.0.stub)
1015 .list_repositories(self.0.request, self.0.options)
1016 .await
1017 .map(gax::response::Response::into_body)
1018 }
1019
1020 pub fn by_page(
1022 self,
1023 ) -> impl gax::paginator::Paginator<crate::model::ListRepositoriesResponse, gax::error::Error>
1024 {
1025 use std::clone::Clone;
1026 let token = self.0.request.page_token.clone();
1027 let execute = move |token: String| {
1028 let mut builder = self.clone();
1029 builder.0.request = builder.0.request.set_page_token(token);
1030 builder.send()
1031 };
1032 gax::paginator::internal::new_paginator(token, execute)
1033 }
1034
1035 pub fn by_item(
1037 self,
1038 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRepositoriesResponse, gax::error::Error>
1039 {
1040 use gax::paginator::Paginator;
1041 self.by_page().items()
1042 }
1043
1044 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1048 self.0.request.parent = v.into();
1049 self
1050 }
1051
1052 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1054 self.0.request.page_size = v.into();
1055 self
1056 }
1057
1058 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1060 self.0.request.page_token = v.into();
1061 self
1062 }
1063
1064 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1066 self.0.request.filter = v.into();
1067 self
1068 }
1069 }
1070
1071 #[doc(hidden)]
1072 impl gax::options::internal::RequestBuilder for ListRepositories {
1073 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1074 &mut self.0.options
1075 }
1076 }
1077
1078 #[derive(Clone, Debug)]
1097 pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
1098
1099 impl DeleteRepository {
1100 pub(crate) fn new(
1101 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1102 ) -> Self {
1103 Self(RequestBuilder::new(stub))
1104 }
1105
1106 pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
1108 mut self,
1109 v: V,
1110 ) -> Self {
1111 self.0.request = v.into();
1112 self
1113 }
1114
1115 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1117 self.0.options = v.into();
1118 self
1119 }
1120
1121 pub async fn send(self) -> Result<longrunning::model::Operation> {
1128 (*self.0.stub)
1129 .delete_repository(self.0.request, self.0.options)
1130 .await
1131 .map(gax::response::Response::into_body)
1132 }
1133
1134 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1136 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1137 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1138 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1139
1140 let stub = self.0.stub.clone();
1141 let mut options = self.0.options.clone();
1142 options.set_retry_policy(gax::retry_policy::NeverRetry);
1143 let query = move |name| {
1144 let stub = stub.clone();
1145 let options = options.clone();
1146 async {
1147 let op = GetOperation::new(stub)
1148 .set_name(name)
1149 .with_options(options)
1150 .send()
1151 .await?;
1152 Ok(Operation::new(op))
1153 }
1154 };
1155
1156 let start = move || async {
1157 let op = self.send().await?;
1158 Ok(Operation::new(op))
1159 };
1160
1161 lro::internal::new_unit_response_poller(
1162 polling_error_policy,
1163 polling_backoff_policy,
1164 start,
1165 query,
1166 )
1167 }
1168
1169 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1173 self.0.request.name = v.into();
1174 self
1175 }
1176
1177 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1179 self.0.request.etag = v.into();
1180 self
1181 }
1182
1183 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1185 self.0.request.validate_only = v.into();
1186 self
1187 }
1188 }
1189
1190 #[doc(hidden)]
1191 impl gax::options::internal::RequestBuilder for DeleteRepository {
1192 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1193 &mut self.0.options
1194 }
1195 }
1196
1197 #[derive(Clone, Debug)]
1215 pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
1216
1217 impl FetchReadWriteToken {
1218 pub(crate) fn new(
1219 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1220 ) -> Self {
1221 Self(RequestBuilder::new(stub))
1222 }
1223
1224 pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
1226 mut self,
1227 v: V,
1228 ) -> Self {
1229 self.0.request = v.into();
1230 self
1231 }
1232
1233 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1235 self.0.options = v.into();
1236 self
1237 }
1238
1239 pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
1241 (*self.0.stub)
1242 .fetch_read_write_token(self.0.request, self.0.options)
1243 .await
1244 .map(gax::response::Response::into_body)
1245 }
1246
1247 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1251 self.0.request.repository = v.into();
1252 self
1253 }
1254 }
1255
1256 #[doc(hidden)]
1257 impl gax::options::internal::RequestBuilder for FetchReadWriteToken {
1258 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1259 &mut self.0.options
1260 }
1261 }
1262
1263 #[derive(Clone, Debug)]
1281 pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
1282
1283 impl FetchReadToken {
1284 pub(crate) fn new(
1285 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1286 ) -> Self {
1287 Self(RequestBuilder::new(stub))
1288 }
1289
1290 pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
1292 self.0.request = v.into();
1293 self
1294 }
1295
1296 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1298 self.0.options = v.into();
1299 self
1300 }
1301
1302 pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
1304 (*self.0.stub)
1305 .fetch_read_token(self.0.request, self.0.options)
1306 .await
1307 .map(gax::response::Response::into_body)
1308 }
1309
1310 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1314 self.0.request.repository = v.into();
1315 self
1316 }
1317 }
1318
1319 #[doc(hidden)]
1320 impl gax::options::internal::RequestBuilder for FetchReadToken {
1321 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1322 &mut self.0.options
1323 }
1324 }
1325
1326 #[derive(Clone, Debug)]
1348 pub struct FetchLinkableRepositories(
1349 RequestBuilder<crate::model::FetchLinkableRepositoriesRequest>,
1350 );
1351
1352 impl FetchLinkableRepositories {
1353 pub(crate) fn new(
1354 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1355 ) -> Self {
1356 Self(RequestBuilder::new(stub))
1357 }
1358
1359 pub fn with_request<V: Into<crate::model::FetchLinkableRepositoriesRequest>>(
1361 mut self,
1362 v: V,
1363 ) -> Self {
1364 self.0.request = v.into();
1365 self
1366 }
1367
1368 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1370 self.0.options = v.into();
1371 self
1372 }
1373
1374 pub async fn send(self) -> Result<crate::model::FetchLinkableRepositoriesResponse> {
1376 (*self.0.stub)
1377 .fetch_linkable_repositories(self.0.request, self.0.options)
1378 .await
1379 .map(gax::response::Response::into_body)
1380 }
1381
1382 pub fn by_page(
1384 self,
1385 ) -> impl gax::paginator::Paginator<
1386 crate::model::FetchLinkableRepositoriesResponse,
1387 gax::error::Error,
1388 > {
1389 use std::clone::Clone;
1390 let token = self.0.request.page_token.clone();
1391 let execute = move |token: String| {
1392 let mut builder = self.clone();
1393 builder.0.request = builder.0.request.set_page_token(token);
1394 builder.send()
1395 };
1396 gax::paginator::internal::new_paginator(token, execute)
1397 }
1398
1399 pub fn by_item(
1401 self,
1402 ) -> impl gax::paginator::ItemPaginator<
1403 crate::model::FetchLinkableRepositoriesResponse,
1404 gax::error::Error,
1405 > {
1406 use gax::paginator::Paginator;
1407 self.by_page().items()
1408 }
1409
1410 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1414 self.0.request.connection = v.into();
1415 self
1416 }
1417
1418 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1420 self.0.request.page_size = v.into();
1421 self
1422 }
1423
1424 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1426 self.0.request.page_token = v.into();
1427 self
1428 }
1429 }
1430
1431 #[doc(hidden)]
1432 impl gax::options::internal::RequestBuilder for FetchLinkableRepositories {
1433 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1434 &mut self.0.options
1435 }
1436 }
1437
1438 #[derive(Clone, Debug)]
1456 pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1457
1458 impl FetchGitRefs {
1459 pub(crate) fn new(
1460 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1461 ) -> Self {
1462 Self(RequestBuilder::new(stub))
1463 }
1464
1465 pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1467 self.0.request = v.into();
1468 self
1469 }
1470
1471 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1473 self.0.options = v.into();
1474 self
1475 }
1476
1477 pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1479 (*self.0.stub)
1480 .fetch_git_refs(self.0.request, self.0.options)
1481 .await
1482 .map(gax::response::Response::into_body)
1483 }
1484
1485 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1489 self.0.request.repository = v.into();
1490 self
1491 }
1492
1493 pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1495 mut self,
1496 v: T,
1497 ) -> Self {
1498 self.0.request.ref_type = v.into();
1499 self
1500 }
1501 }
1502
1503 #[doc(hidden)]
1504 impl gax::options::internal::RequestBuilder for FetchGitRefs {
1505 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1506 &mut self.0.options
1507 }
1508 }
1509
1510 #[derive(Clone, Debug)]
1528 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1529
1530 impl SetIamPolicy {
1531 pub(crate) fn new(
1532 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1533 ) -> Self {
1534 Self(RequestBuilder::new(stub))
1535 }
1536
1537 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1539 self.0.request = v.into();
1540 self
1541 }
1542
1543 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1545 self.0.options = v.into();
1546 self
1547 }
1548
1549 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1551 (*self.0.stub)
1552 .set_iam_policy(self.0.request, self.0.options)
1553 .await
1554 .map(gax::response::Response::into_body)
1555 }
1556
1557 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1561 self.0.request.resource = v.into();
1562 self
1563 }
1564
1565 pub fn set_policy<T>(mut self, v: T) -> Self
1569 where
1570 T: std::convert::Into<iam_v1::model::Policy>,
1571 {
1572 self.0.request.policy = std::option::Option::Some(v.into());
1573 self
1574 }
1575
1576 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1580 where
1581 T: std::convert::Into<iam_v1::model::Policy>,
1582 {
1583 self.0.request.policy = v.map(|x| x.into());
1584 self
1585 }
1586
1587 pub fn set_update_mask<T>(mut self, v: T) -> Self
1589 where
1590 T: std::convert::Into<wkt::FieldMask>,
1591 {
1592 self.0.request.update_mask = std::option::Option::Some(v.into());
1593 self
1594 }
1595
1596 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1598 where
1599 T: std::convert::Into<wkt::FieldMask>,
1600 {
1601 self.0.request.update_mask = v.map(|x| x.into());
1602 self
1603 }
1604 }
1605
1606 #[doc(hidden)]
1607 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1608 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1609 &mut self.0.options
1610 }
1611 }
1612
1613 #[derive(Clone, Debug)]
1631 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1632
1633 impl GetIamPolicy {
1634 pub(crate) fn new(
1635 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1636 ) -> Self {
1637 Self(RequestBuilder::new(stub))
1638 }
1639
1640 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1642 self.0.request = v.into();
1643 self
1644 }
1645
1646 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1648 self.0.options = v.into();
1649 self
1650 }
1651
1652 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1654 (*self.0.stub)
1655 .get_iam_policy(self.0.request, self.0.options)
1656 .await
1657 .map(gax::response::Response::into_body)
1658 }
1659
1660 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1664 self.0.request.resource = v.into();
1665 self
1666 }
1667
1668 pub fn set_options<T>(mut self, v: T) -> Self
1670 where
1671 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1672 {
1673 self.0.request.options = std::option::Option::Some(v.into());
1674 self
1675 }
1676
1677 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1679 where
1680 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1681 {
1682 self.0.request.options = v.map(|x| x.into());
1683 self
1684 }
1685 }
1686
1687 #[doc(hidden)]
1688 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1689 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1690 &mut self.0.options
1691 }
1692 }
1693
1694 #[derive(Clone, Debug)]
1712 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1713
1714 impl TestIamPermissions {
1715 pub(crate) fn new(
1716 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1717 ) -> Self {
1718 Self(RequestBuilder::new(stub))
1719 }
1720
1721 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1723 mut self,
1724 v: V,
1725 ) -> Self {
1726 self.0.request = v.into();
1727 self
1728 }
1729
1730 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1732 self.0.options = v.into();
1733 self
1734 }
1735
1736 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1738 (*self.0.stub)
1739 .test_iam_permissions(self.0.request, self.0.options)
1740 .await
1741 .map(gax::response::Response::into_body)
1742 }
1743
1744 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1748 self.0.request.resource = v.into();
1749 self
1750 }
1751
1752 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1756 where
1757 T: std::iter::IntoIterator<Item = V>,
1758 V: std::convert::Into<std::string::String>,
1759 {
1760 use std::iter::Iterator;
1761 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1762 self
1763 }
1764 }
1765
1766 #[doc(hidden)]
1767 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1768 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1769 &mut self.0.options
1770 }
1771 }
1772
1773 #[derive(Clone, Debug)]
1791 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1792
1793 impl GetOperation {
1794 pub(crate) fn new(
1795 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1796 ) -> Self {
1797 Self(RequestBuilder::new(stub))
1798 }
1799
1800 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1802 mut self,
1803 v: V,
1804 ) -> Self {
1805 self.0.request = v.into();
1806 self
1807 }
1808
1809 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1811 self.0.options = v.into();
1812 self
1813 }
1814
1815 pub async fn send(self) -> Result<longrunning::model::Operation> {
1817 (*self.0.stub)
1818 .get_operation(self.0.request, self.0.options)
1819 .await
1820 .map(gax::response::Response::into_body)
1821 }
1822
1823 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1825 self.0.request.name = v.into();
1826 self
1827 }
1828 }
1829
1830 #[doc(hidden)]
1831 impl gax::options::internal::RequestBuilder for GetOperation {
1832 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1833 &mut self.0.options
1834 }
1835 }
1836
1837 #[derive(Clone, Debug)]
1855 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1856
1857 impl CancelOperation {
1858 pub(crate) fn new(
1859 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1860 ) -> Self {
1861 Self(RequestBuilder::new(stub))
1862 }
1863
1864 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1866 mut self,
1867 v: V,
1868 ) -> Self {
1869 self.0.request = v.into();
1870 self
1871 }
1872
1873 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1875 self.0.options = v.into();
1876 self
1877 }
1878
1879 pub async fn send(self) -> Result<()> {
1881 (*self.0.stub)
1882 .cancel_operation(self.0.request, self.0.options)
1883 .await
1884 .map(gax::response::Response::into_body)
1885 }
1886
1887 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1889 self.0.request.name = v.into();
1890 self
1891 }
1892 }
1893
1894 #[doc(hidden)]
1895 impl gax::options::internal::RequestBuilder for CancelOperation {
1896 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1897 &mut self.0.options
1898 }
1899 }
1900}