1pub mod repository_manager {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::RepositoryManager;
38 pub struct Factory;
39 impl crate::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 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
92 pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
93
94 impl CreateConnection {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
103 mut self,
104 v: V,
105 ) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
123 (*self.0.stub)
124 .create_connection(self.0.request, self.0.options)
125 .await
126 .map(crate::Response::into_body)
127 }
128
129 pub fn poller(
131 self,
132 ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
133 {
134 type Operation = google_cloud_lro::internal::Operation<
135 crate::model::Connection,
136 crate::model::OperationMetadata,
137 >;
138 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
139 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
140 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
141 if let Some(ref mut details) = poller_options.tracing {
142 details.method_name = "google_cloud_build_v2::client::RepositoryManager::create_connection::until_done";
143 }
144
145 let stub = self.0.stub.clone();
146 let mut options = self.0.options.clone();
147 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
148 let query = move |name| {
149 let stub = stub.clone();
150 let options = options.clone();
151 async {
152 let op = GetOperation::new(stub)
153 .set_name(name)
154 .with_options(options)
155 .send()
156 .await?;
157 Ok(Operation::new(op))
158 }
159 };
160
161 let start = move || async {
162 let op = self.send().await?;
163 Ok(Operation::new(op))
164 };
165
166 use google_cloud_lro::internal::PollerExt;
167 {
168 google_cloud_lro::internal::new_poller(
169 polling_error_policy,
170 polling_backoff_policy,
171 start,
172 query,
173 )
174 }
175 .with_options(poller_options)
176 }
177
178 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
182 self.0.request.parent = v.into();
183 self
184 }
185
186 pub fn set_connection<T>(mut self, v: T) -> Self
190 where
191 T: std::convert::Into<crate::model::Connection>,
192 {
193 self.0.request.connection = std::option::Option::Some(v.into());
194 self
195 }
196
197 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
201 where
202 T: std::convert::Into<crate::model::Connection>,
203 {
204 self.0.request.connection = v.map(|x| x.into());
205 self
206 }
207
208 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
212 self.0.request.connection_id = v.into();
213 self
214 }
215 }
216
217 #[doc(hidden)]
218 impl crate::RequestBuilder for CreateConnection {
219 fn request_options(&mut self) -> &mut crate::RequestOptions {
220 &mut self.0.options
221 }
222 }
223
224 #[derive(Clone, Debug)]
241 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
242
243 impl GetConnection {
244 pub(crate) fn new(
245 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
246 ) -> Self {
247 Self(RequestBuilder::new(stub))
248 }
249
250 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
252 self.0.request = v.into();
253 self
254 }
255
256 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
258 self.0.options = v.into();
259 self
260 }
261
262 pub async fn send(self) -> Result<crate::model::Connection> {
264 (*self.0.stub)
265 .get_connection(self.0.request, self.0.options)
266 .await
267 .map(crate::Response::into_body)
268 }
269
270 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
274 self.0.request.name = v.into();
275 self
276 }
277 }
278
279 #[doc(hidden)]
280 impl crate::RequestBuilder for GetConnection {
281 fn request_options(&mut self) -> &mut crate::RequestOptions {
282 &mut self.0.options
283 }
284 }
285
286 #[derive(Clone, Debug)]
307 pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
308
309 impl ListConnections {
310 pub(crate) fn new(
311 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
312 ) -> Self {
313 Self(RequestBuilder::new(stub))
314 }
315
316 pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
318 self.0.request = v.into();
319 self
320 }
321
322 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
324 self.0.options = v.into();
325 self
326 }
327
328 pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
330 (*self.0.stub)
331 .list_connections(self.0.request, self.0.options)
332 .await
333 .map(crate::Response::into_body)
334 }
335
336 pub fn by_page(
338 self,
339 ) -> impl google_cloud_gax::paginator::Paginator<
340 crate::model::ListConnectionsResponse,
341 crate::Error,
342 > {
343 use std::clone::Clone;
344 let token = self.0.request.page_token.clone();
345 let execute = move |token: String| {
346 let mut builder = self.clone();
347 builder.0.request = builder.0.request.set_page_token(token);
348 builder.send()
349 };
350 google_cloud_gax::paginator::internal::new_paginator(token, execute)
351 }
352
353 pub fn by_item(
355 self,
356 ) -> impl google_cloud_gax::paginator::ItemPaginator<
357 crate::model::ListConnectionsResponse,
358 crate::Error,
359 > {
360 use google_cloud_gax::paginator::Paginator;
361 self.by_page().items()
362 }
363
364 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
368 self.0.request.parent = v.into();
369 self
370 }
371
372 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
374 self.0.request.page_size = v.into();
375 self
376 }
377
378 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
380 self.0.request.page_token = v.into();
381 self
382 }
383 }
384
385 #[doc(hidden)]
386 impl crate::RequestBuilder for ListConnections {
387 fn request_options(&mut self) -> &mut crate::RequestOptions {
388 &mut self.0.options
389 }
390 }
391
392 #[derive(Clone, Debug)]
410 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
411
412 impl UpdateConnection {
413 pub(crate) fn new(
414 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
415 ) -> Self {
416 Self(RequestBuilder::new(stub))
417 }
418
419 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
421 mut self,
422 v: V,
423 ) -> Self {
424 self.0.request = v.into();
425 self
426 }
427
428 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
430 self.0.options = v.into();
431 self
432 }
433
434 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
441 (*self.0.stub)
442 .update_connection(self.0.request, self.0.options)
443 .await
444 .map(crate::Response::into_body)
445 }
446
447 pub fn poller(
449 self,
450 ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
451 {
452 type Operation = google_cloud_lro::internal::Operation<
453 crate::model::Connection,
454 crate::model::OperationMetadata,
455 >;
456 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
457 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
458 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
459 if let Some(ref mut details) = poller_options.tracing {
460 details.method_name = "google_cloud_build_v2::client::RepositoryManager::update_connection::until_done";
461 }
462
463 let stub = self.0.stub.clone();
464 let mut options = self.0.options.clone();
465 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
466 let query = move |name| {
467 let stub = stub.clone();
468 let options = options.clone();
469 async {
470 let op = GetOperation::new(stub)
471 .set_name(name)
472 .with_options(options)
473 .send()
474 .await?;
475 Ok(Operation::new(op))
476 }
477 };
478
479 let start = move || async {
480 let op = self.send().await?;
481 Ok(Operation::new(op))
482 };
483
484 use google_cloud_lro::internal::PollerExt;
485 {
486 google_cloud_lro::internal::new_poller(
487 polling_error_policy,
488 polling_backoff_policy,
489 start,
490 query,
491 )
492 }
493 .with_options(poller_options)
494 }
495
496 pub fn set_connection<T>(mut self, v: T) -> Self
500 where
501 T: std::convert::Into<crate::model::Connection>,
502 {
503 self.0.request.connection = std::option::Option::Some(v.into());
504 self
505 }
506
507 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
511 where
512 T: std::convert::Into<crate::model::Connection>,
513 {
514 self.0.request.connection = v.map(|x| x.into());
515 self
516 }
517
518 pub fn set_update_mask<T>(mut self, v: T) -> Self
520 where
521 T: std::convert::Into<wkt::FieldMask>,
522 {
523 self.0.request.update_mask = std::option::Option::Some(v.into());
524 self
525 }
526
527 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
529 where
530 T: std::convert::Into<wkt::FieldMask>,
531 {
532 self.0.request.update_mask = v.map(|x| x.into());
533 self
534 }
535
536 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
538 self.0.request.allow_missing = v.into();
539 self
540 }
541
542 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
544 self.0.request.etag = v.into();
545 self
546 }
547 }
548
549 #[doc(hidden)]
550 impl crate::RequestBuilder for UpdateConnection {
551 fn request_options(&mut self) -> &mut crate::RequestOptions {
552 &mut self.0.options
553 }
554 }
555
556 #[derive(Clone, Debug)]
574 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
575
576 impl DeleteConnection {
577 pub(crate) fn new(
578 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
579 ) -> Self {
580 Self(RequestBuilder::new(stub))
581 }
582
583 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
585 mut self,
586 v: V,
587 ) -> Self {
588 self.0.request = v.into();
589 self
590 }
591
592 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
594 self.0.options = v.into();
595 self
596 }
597
598 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
605 (*self.0.stub)
606 .delete_connection(self.0.request, self.0.options)
607 .await
608 .map(crate::Response::into_body)
609 }
610
611 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
613 type Operation =
614 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
615 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
616 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
617 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
618 if let Some(ref mut details) = poller_options.tracing {
619 details.method_name = "google_cloud_build_v2::client::RepositoryManager::delete_connection::until_done";
620 }
621
622 let stub = self.0.stub.clone();
623 let mut options = self.0.options.clone();
624 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
625 let query = move |name| {
626 let stub = stub.clone();
627 let options = options.clone();
628 async {
629 let op = GetOperation::new(stub)
630 .set_name(name)
631 .with_options(options)
632 .send()
633 .await?;
634 Ok(Operation::new(op))
635 }
636 };
637
638 let start = move || async {
639 let op = self.send().await?;
640 Ok(Operation::new(op))
641 };
642
643 use google_cloud_lro::internal::PollerExt;
644 {
645 google_cloud_lro::internal::new_unit_response_poller(
646 polling_error_policy,
647 polling_backoff_policy,
648 start,
649 query,
650 )
651 }
652 .with_options(poller_options)
653 }
654
655 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
659 self.0.request.name = v.into();
660 self
661 }
662
663 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
665 self.0.request.etag = v.into();
666 self
667 }
668
669 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
671 self.0.request.validate_only = v.into();
672 self
673 }
674 }
675
676 #[doc(hidden)]
677 impl crate::RequestBuilder for DeleteConnection {
678 fn request_options(&mut self) -> &mut crate::RequestOptions {
679 &mut self.0.options
680 }
681 }
682
683 #[derive(Clone, Debug)]
701 pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
702
703 impl CreateRepository {
704 pub(crate) fn new(
705 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
706 ) -> Self {
707 Self(RequestBuilder::new(stub))
708 }
709
710 pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
712 mut self,
713 v: V,
714 ) -> Self {
715 self.0.request = v.into();
716 self
717 }
718
719 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
721 self.0.options = v.into();
722 self
723 }
724
725 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
732 (*self.0.stub)
733 .create_repository(self.0.request, self.0.options)
734 .await
735 .map(crate::Response::into_body)
736 }
737
738 pub fn poller(
740 self,
741 ) -> impl google_cloud_lro::Poller<crate::model::Repository, crate::model::OperationMetadata>
742 {
743 type Operation = google_cloud_lro::internal::Operation<
744 crate::model::Repository,
745 crate::model::OperationMetadata,
746 >;
747 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
748 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
749 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
750 if let Some(ref mut details) = poller_options.tracing {
751 details.method_name = "google_cloud_build_v2::client::RepositoryManager::create_repository::until_done";
752 }
753
754 let stub = self.0.stub.clone();
755 let mut options = self.0.options.clone();
756 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
757 let query = move |name| {
758 let stub = stub.clone();
759 let options = options.clone();
760 async {
761 let op = GetOperation::new(stub)
762 .set_name(name)
763 .with_options(options)
764 .send()
765 .await?;
766 Ok(Operation::new(op))
767 }
768 };
769
770 let start = move || async {
771 let op = self.send().await?;
772 Ok(Operation::new(op))
773 };
774
775 use google_cloud_lro::internal::PollerExt;
776 {
777 google_cloud_lro::internal::new_poller(
778 polling_error_policy,
779 polling_backoff_policy,
780 start,
781 query,
782 )
783 }
784 .with_options(poller_options)
785 }
786
787 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
791 self.0.request.parent = v.into();
792 self
793 }
794
795 pub fn set_repository<T>(mut self, v: T) -> Self
799 where
800 T: std::convert::Into<crate::model::Repository>,
801 {
802 self.0.request.repository = std::option::Option::Some(v.into());
803 self
804 }
805
806 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
810 where
811 T: std::convert::Into<crate::model::Repository>,
812 {
813 self.0.request.repository = v.map(|x| x.into());
814 self
815 }
816
817 pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
821 self.0.request.repository_id = v.into();
822 self
823 }
824 }
825
826 #[doc(hidden)]
827 impl crate::RequestBuilder for CreateRepository {
828 fn request_options(&mut self) -> &mut crate::RequestOptions {
829 &mut self.0.options
830 }
831 }
832
833 #[derive(Clone, Debug)]
851 pub struct BatchCreateRepositories(
852 RequestBuilder<crate::model::BatchCreateRepositoriesRequest>,
853 );
854
855 impl BatchCreateRepositories {
856 pub(crate) fn new(
857 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
858 ) -> Self {
859 Self(RequestBuilder::new(stub))
860 }
861
862 pub fn with_request<V: Into<crate::model::BatchCreateRepositoriesRequest>>(
864 mut self,
865 v: V,
866 ) -> Self {
867 self.0.request = v.into();
868 self
869 }
870
871 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
873 self.0.options = v.into();
874 self
875 }
876
877 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
884 (*self.0.stub)
885 .batch_create_repositories(self.0.request, self.0.options)
886 .await
887 .map(crate::Response::into_body)
888 }
889
890 pub fn poller(
892 self,
893 ) -> impl google_cloud_lro::Poller<
894 crate::model::BatchCreateRepositoriesResponse,
895 crate::model::OperationMetadata,
896 > {
897 type Operation = google_cloud_lro::internal::Operation<
898 crate::model::BatchCreateRepositoriesResponse,
899 crate::model::OperationMetadata,
900 >;
901 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
902 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
903 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
904 if let Some(ref mut details) = poller_options.tracing {
905 details.method_name = "google_cloud_build_v2::client::RepositoryManager::batch_create_repositories::until_done";
906 }
907
908 let stub = self.0.stub.clone();
909 let mut options = self.0.options.clone();
910 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
911 let query = move |name| {
912 let stub = stub.clone();
913 let options = options.clone();
914 async {
915 let op = GetOperation::new(stub)
916 .set_name(name)
917 .with_options(options)
918 .send()
919 .await?;
920 Ok(Operation::new(op))
921 }
922 };
923
924 let start = move || async {
925 let op = self.send().await?;
926 Ok(Operation::new(op))
927 };
928
929 use google_cloud_lro::internal::PollerExt;
930 {
931 google_cloud_lro::internal::new_poller(
932 polling_error_policy,
933 polling_backoff_policy,
934 start,
935 query,
936 )
937 }
938 .with_options(poller_options)
939 }
940
941 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
945 self.0.request.parent = v.into();
946 self
947 }
948
949 pub fn set_requests<T, V>(mut self, v: T) -> Self
953 where
954 T: std::iter::IntoIterator<Item = V>,
955 V: std::convert::Into<crate::model::CreateRepositoryRequest>,
956 {
957 use std::iter::Iterator;
958 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
959 self
960 }
961 }
962
963 #[doc(hidden)]
964 impl crate::RequestBuilder for BatchCreateRepositories {
965 fn request_options(&mut self) -> &mut crate::RequestOptions {
966 &mut self.0.options
967 }
968 }
969
970 #[derive(Clone, Debug)]
987 pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
988
989 impl GetRepository {
990 pub(crate) fn new(
991 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
992 ) -> Self {
993 Self(RequestBuilder::new(stub))
994 }
995
996 pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
998 self.0.request = v.into();
999 self
1000 }
1001
1002 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1004 self.0.options = v.into();
1005 self
1006 }
1007
1008 pub async fn send(self) -> Result<crate::model::Repository> {
1010 (*self.0.stub)
1011 .get_repository(self.0.request, self.0.options)
1012 .await
1013 .map(crate::Response::into_body)
1014 }
1015
1016 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1020 self.0.request.name = v.into();
1021 self
1022 }
1023 }
1024
1025 #[doc(hidden)]
1026 impl crate::RequestBuilder for GetRepository {
1027 fn request_options(&mut self) -> &mut crate::RequestOptions {
1028 &mut self.0.options
1029 }
1030 }
1031
1032 #[derive(Clone, Debug)]
1053 pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
1054
1055 impl ListRepositories {
1056 pub(crate) fn new(
1057 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1058 ) -> Self {
1059 Self(RequestBuilder::new(stub))
1060 }
1061
1062 pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
1064 mut self,
1065 v: V,
1066 ) -> Self {
1067 self.0.request = v.into();
1068 self
1069 }
1070
1071 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1073 self.0.options = v.into();
1074 self
1075 }
1076
1077 pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
1079 (*self.0.stub)
1080 .list_repositories(self.0.request, self.0.options)
1081 .await
1082 .map(crate::Response::into_body)
1083 }
1084
1085 pub fn by_page(
1087 self,
1088 ) -> impl google_cloud_gax::paginator::Paginator<
1089 crate::model::ListRepositoriesResponse,
1090 crate::Error,
1091 > {
1092 use std::clone::Clone;
1093 let token = self.0.request.page_token.clone();
1094 let execute = move |token: String| {
1095 let mut builder = self.clone();
1096 builder.0.request = builder.0.request.set_page_token(token);
1097 builder.send()
1098 };
1099 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1100 }
1101
1102 pub fn by_item(
1104 self,
1105 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1106 crate::model::ListRepositoriesResponse,
1107 crate::Error,
1108 > {
1109 use google_cloud_gax::paginator::Paginator;
1110 self.by_page().items()
1111 }
1112
1113 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1117 self.0.request.parent = v.into();
1118 self
1119 }
1120
1121 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1123 self.0.request.page_size = v.into();
1124 self
1125 }
1126
1127 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1129 self.0.request.page_token = v.into();
1130 self
1131 }
1132
1133 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1135 self.0.request.filter = v.into();
1136 self
1137 }
1138 }
1139
1140 #[doc(hidden)]
1141 impl crate::RequestBuilder for ListRepositories {
1142 fn request_options(&mut self) -> &mut crate::RequestOptions {
1143 &mut self.0.options
1144 }
1145 }
1146
1147 #[derive(Clone, Debug)]
1165 pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
1166
1167 impl DeleteRepository {
1168 pub(crate) fn new(
1169 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1170 ) -> Self {
1171 Self(RequestBuilder::new(stub))
1172 }
1173
1174 pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
1176 mut self,
1177 v: V,
1178 ) -> Self {
1179 self.0.request = v.into();
1180 self
1181 }
1182
1183 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1185 self.0.options = v.into();
1186 self
1187 }
1188
1189 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1196 (*self.0.stub)
1197 .delete_repository(self.0.request, self.0.options)
1198 .await
1199 .map(crate::Response::into_body)
1200 }
1201
1202 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1204 type Operation =
1205 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1206 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1207 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1208 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1209 if let Some(ref mut details) = poller_options.tracing {
1210 details.method_name = "google_cloud_build_v2::client::RepositoryManager::delete_repository::until_done";
1211 }
1212
1213 let stub = self.0.stub.clone();
1214 let mut options = self.0.options.clone();
1215 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1216 let query = move |name| {
1217 let stub = stub.clone();
1218 let options = options.clone();
1219 async {
1220 let op = GetOperation::new(stub)
1221 .set_name(name)
1222 .with_options(options)
1223 .send()
1224 .await?;
1225 Ok(Operation::new(op))
1226 }
1227 };
1228
1229 let start = move || async {
1230 let op = self.send().await?;
1231 Ok(Operation::new(op))
1232 };
1233
1234 use google_cloud_lro::internal::PollerExt;
1235 {
1236 google_cloud_lro::internal::new_unit_response_poller(
1237 polling_error_policy,
1238 polling_backoff_policy,
1239 start,
1240 query,
1241 )
1242 }
1243 .with_options(poller_options)
1244 }
1245
1246 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1250 self.0.request.name = v.into();
1251 self
1252 }
1253
1254 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1256 self.0.request.etag = v.into();
1257 self
1258 }
1259
1260 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1262 self.0.request.validate_only = v.into();
1263 self
1264 }
1265 }
1266
1267 #[doc(hidden)]
1268 impl crate::RequestBuilder for DeleteRepository {
1269 fn request_options(&mut self) -> &mut crate::RequestOptions {
1270 &mut self.0.options
1271 }
1272 }
1273
1274 #[derive(Clone, Debug)]
1291 pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
1292
1293 impl FetchReadWriteToken {
1294 pub(crate) fn new(
1295 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1296 ) -> Self {
1297 Self(RequestBuilder::new(stub))
1298 }
1299
1300 pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
1302 mut self,
1303 v: V,
1304 ) -> Self {
1305 self.0.request = v.into();
1306 self
1307 }
1308
1309 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1311 self.0.options = v.into();
1312 self
1313 }
1314
1315 pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
1317 (*self.0.stub)
1318 .fetch_read_write_token(self.0.request, self.0.options)
1319 .await
1320 .map(crate::Response::into_body)
1321 }
1322
1323 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1327 self.0.request.repository = v.into();
1328 self
1329 }
1330 }
1331
1332 #[doc(hidden)]
1333 impl crate::RequestBuilder for FetchReadWriteToken {
1334 fn request_options(&mut self) -> &mut crate::RequestOptions {
1335 &mut self.0.options
1336 }
1337 }
1338
1339 #[derive(Clone, Debug)]
1356 pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
1357
1358 impl FetchReadToken {
1359 pub(crate) fn new(
1360 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1361 ) -> Self {
1362 Self(RequestBuilder::new(stub))
1363 }
1364
1365 pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
1367 self.0.request = v.into();
1368 self
1369 }
1370
1371 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1373 self.0.options = v.into();
1374 self
1375 }
1376
1377 pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
1379 (*self.0.stub)
1380 .fetch_read_token(self.0.request, self.0.options)
1381 .await
1382 .map(crate::Response::into_body)
1383 }
1384
1385 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1389 self.0.request.repository = v.into();
1390 self
1391 }
1392 }
1393
1394 #[doc(hidden)]
1395 impl crate::RequestBuilder for FetchReadToken {
1396 fn request_options(&mut self) -> &mut crate::RequestOptions {
1397 &mut self.0.options
1398 }
1399 }
1400
1401 #[derive(Clone, Debug)]
1422 pub struct FetchLinkableRepositories(
1423 RequestBuilder<crate::model::FetchLinkableRepositoriesRequest>,
1424 );
1425
1426 impl FetchLinkableRepositories {
1427 pub(crate) fn new(
1428 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1429 ) -> Self {
1430 Self(RequestBuilder::new(stub))
1431 }
1432
1433 pub fn with_request<V: Into<crate::model::FetchLinkableRepositoriesRequest>>(
1435 mut self,
1436 v: V,
1437 ) -> Self {
1438 self.0.request = v.into();
1439 self
1440 }
1441
1442 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1444 self.0.options = v.into();
1445 self
1446 }
1447
1448 pub async fn send(self) -> Result<crate::model::FetchLinkableRepositoriesResponse> {
1450 (*self.0.stub)
1451 .fetch_linkable_repositories(self.0.request, self.0.options)
1452 .await
1453 .map(crate::Response::into_body)
1454 }
1455
1456 pub fn by_page(
1458 self,
1459 ) -> impl google_cloud_gax::paginator::Paginator<
1460 crate::model::FetchLinkableRepositoriesResponse,
1461 crate::Error,
1462 > {
1463 use std::clone::Clone;
1464 let token = self.0.request.page_token.clone();
1465 let execute = move |token: String| {
1466 let mut builder = self.clone();
1467 builder.0.request = builder.0.request.set_page_token(token);
1468 builder.send()
1469 };
1470 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1471 }
1472
1473 pub fn by_item(
1475 self,
1476 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1477 crate::model::FetchLinkableRepositoriesResponse,
1478 crate::Error,
1479 > {
1480 use google_cloud_gax::paginator::Paginator;
1481 self.by_page().items()
1482 }
1483
1484 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1488 self.0.request.connection = v.into();
1489 self
1490 }
1491
1492 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1494 self.0.request.page_size = v.into();
1495 self
1496 }
1497
1498 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1500 self.0.request.page_token = v.into();
1501 self
1502 }
1503 }
1504
1505 #[doc(hidden)]
1506 impl crate::RequestBuilder for FetchLinkableRepositories {
1507 fn request_options(&mut self) -> &mut crate::RequestOptions {
1508 &mut self.0.options
1509 }
1510 }
1511
1512 #[derive(Clone, Debug)]
1529 pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1530
1531 impl FetchGitRefs {
1532 pub(crate) fn new(
1533 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1534 ) -> Self {
1535 Self(RequestBuilder::new(stub))
1536 }
1537
1538 pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1540 self.0.request = v.into();
1541 self
1542 }
1543
1544 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1546 self.0.options = v.into();
1547 self
1548 }
1549
1550 pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1552 (*self.0.stub)
1553 .fetch_git_refs(self.0.request, self.0.options)
1554 .await
1555 .map(crate::Response::into_body)
1556 }
1557
1558 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1562 self.0.request.repository = v.into();
1563 self
1564 }
1565
1566 pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1568 mut self,
1569 v: T,
1570 ) -> Self {
1571 self.0.request.ref_type = v.into();
1572 self
1573 }
1574 }
1575
1576 #[doc(hidden)]
1577 impl crate::RequestBuilder for FetchGitRefs {
1578 fn request_options(&mut self) -> &mut crate::RequestOptions {
1579 &mut self.0.options
1580 }
1581 }
1582
1583 #[derive(Clone, Debug)]
1600 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1601
1602 impl SetIamPolicy {
1603 pub(crate) fn new(
1604 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1605 ) -> Self {
1606 Self(RequestBuilder::new(stub))
1607 }
1608
1609 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1611 mut self,
1612 v: V,
1613 ) -> Self {
1614 self.0.request = v.into();
1615 self
1616 }
1617
1618 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1620 self.0.options = v.into();
1621 self
1622 }
1623
1624 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1626 (*self.0.stub)
1627 .set_iam_policy(self.0.request, self.0.options)
1628 .await
1629 .map(crate::Response::into_body)
1630 }
1631
1632 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1636 self.0.request.resource = v.into();
1637 self
1638 }
1639
1640 pub fn set_policy<T>(mut self, v: T) -> Self
1644 where
1645 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1646 {
1647 self.0.request.policy = std::option::Option::Some(v.into());
1648 self
1649 }
1650
1651 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1655 where
1656 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1657 {
1658 self.0.request.policy = v.map(|x| x.into());
1659 self
1660 }
1661
1662 pub fn set_update_mask<T>(mut self, v: T) -> Self
1664 where
1665 T: std::convert::Into<wkt::FieldMask>,
1666 {
1667 self.0.request.update_mask = std::option::Option::Some(v.into());
1668 self
1669 }
1670
1671 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1673 where
1674 T: std::convert::Into<wkt::FieldMask>,
1675 {
1676 self.0.request.update_mask = v.map(|x| x.into());
1677 self
1678 }
1679 }
1680
1681 #[doc(hidden)]
1682 impl crate::RequestBuilder for SetIamPolicy {
1683 fn request_options(&mut self) -> &mut crate::RequestOptions {
1684 &mut self.0.options
1685 }
1686 }
1687
1688 #[derive(Clone, Debug)]
1705 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1706
1707 impl GetIamPolicy {
1708 pub(crate) fn new(
1709 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1710 ) -> Self {
1711 Self(RequestBuilder::new(stub))
1712 }
1713
1714 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1716 mut self,
1717 v: V,
1718 ) -> Self {
1719 self.0.request = v.into();
1720 self
1721 }
1722
1723 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1725 self.0.options = v.into();
1726 self
1727 }
1728
1729 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1731 (*self.0.stub)
1732 .get_iam_policy(self.0.request, self.0.options)
1733 .await
1734 .map(crate::Response::into_body)
1735 }
1736
1737 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1741 self.0.request.resource = v.into();
1742 self
1743 }
1744
1745 pub fn set_options<T>(mut self, v: T) -> Self
1747 where
1748 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1749 {
1750 self.0.request.options = std::option::Option::Some(v.into());
1751 self
1752 }
1753
1754 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1756 where
1757 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1758 {
1759 self.0.request.options = v.map(|x| x.into());
1760 self
1761 }
1762 }
1763
1764 #[doc(hidden)]
1765 impl crate::RequestBuilder for GetIamPolicy {
1766 fn request_options(&mut self) -> &mut crate::RequestOptions {
1767 &mut self.0.options
1768 }
1769 }
1770
1771 #[derive(Clone, Debug)]
1788 pub struct TestIamPermissions(
1789 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1790 );
1791
1792 impl TestIamPermissions {
1793 pub(crate) fn new(
1794 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1795 ) -> Self {
1796 Self(RequestBuilder::new(stub))
1797 }
1798
1799 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1801 mut self,
1802 v: V,
1803 ) -> Self {
1804 self.0.request = v.into();
1805 self
1806 }
1807
1808 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1810 self.0.options = v.into();
1811 self
1812 }
1813
1814 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1816 (*self.0.stub)
1817 .test_iam_permissions(self.0.request, self.0.options)
1818 .await
1819 .map(crate::Response::into_body)
1820 }
1821
1822 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1826 self.0.request.resource = v.into();
1827 self
1828 }
1829
1830 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1834 where
1835 T: std::iter::IntoIterator<Item = V>,
1836 V: std::convert::Into<std::string::String>,
1837 {
1838 use std::iter::Iterator;
1839 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1840 self
1841 }
1842 }
1843
1844 #[doc(hidden)]
1845 impl crate::RequestBuilder for TestIamPermissions {
1846 fn request_options(&mut self) -> &mut crate::RequestOptions {
1847 &mut self.0.options
1848 }
1849 }
1850
1851 #[derive(Clone, Debug)]
1868 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1869
1870 impl GetOperation {
1871 pub(crate) fn new(
1872 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1873 ) -> Self {
1874 Self(RequestBuilder::new(stub))
1875 }
1876
1877 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1879 mut self,
1880 v: V,
1881 ) -> Self {
1882 self.0.request = v.into();
1883 self
1884 }
1885
1886 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1888 self.0.options = v.into();
1889 self
1890 }
1891
1892 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1894 (*self.0.stub)
1895 .get_operation(self.0.request, self.0.options)
1896 .await
1897 .map(crate::Response::into_body)
1898 }
1899
1900 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1902 self.0.request.name = v.into();
1903 self
1904 }
1905 }
1906
1907 #[doc(hidden)]
1908 impl crate::RequestBuilder for GetOperation {
1909 fn request_options(&mut self) -> &mut crate::RequestOptions {
1910 &mut self.0.options
1911 }
1912 }
1913
1914 #[derive(Clone, Debug)]
1931 pub struct CancelOperation(
1932 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1933 );
1934
1935 impl CancelOperation {
1936 pub(crate) fn new(
1937 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1938 ) -> Self {
1939 Self(RequestBuilder::new(stub))
1940 }
1941
1942 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1944 mut self,
1945 v: V,
1946 ) -> Self {
1947 self.0.request = v.into();
1948 self
1949 }
1950
1951 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1953 self.0.options = v.into();
1954 self
1955 }
1956
1957 pub async fn send(self) -> Result<()> {
1959 (*self.0.stub)
1960 .cancel_operation(self.0.request, self.0.options)
1961 .await
1962 .map(crate::Response::into_body)
1963 }
1964
1965 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1967 self.0.request.name = v.into();
1968 self
1969 }
1970 }
1971
1972 #[doc(hidden)]
1973 impl crate::RequestBuilder for CancelOperation {
1974 fn request_options(&mut self) -> &mut crate::RequestOptions {
1975 &mut self.0.options
1976 }
1977 }
1978}