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)]
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<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<longrunning::model::Operation> {
123 (*self.0.stub)
124 .create_connection(self.0.request, self.0.options)
125 .await
126 .map(gax::response::Response::into_body)
127 }
128
129 pub fn poller(
131 self,
132 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
133 type Operation =
134 lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
135 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
136 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
137
138 let stub = self.0.stub.clone();
139 let mut options = self.0.options.clone();
140 options.set_retry_policy(gax::retry_policy::NeverRetry);
141 let query = move |name| {
142 let stub = stub.clone();
143 let options = options.clone();
144 async {
145 let op = GetOperation::new(stub)
146 .set_name(name)
147 .with_options(options)
148 .send()
149 .await?;
150 Ok(Operation::new(op))
151 }
152 };
153
154 let start = move || async {
155 let op = self.send().await?;
156 Ok(Operation::new(op))
157 };
158
159 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
160 }
161
162 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
166 self.0.request.parent = v.into();
167 self
168 }
169
170 pub fn set_connection<T>(mut self, v: T) -> Self
174 where
175 T: std::convert::Into<crate::model::Connection>,
176 {
177 self.0.request.connection = std::option::Option::Some(v.into());
178 self
179 }
180
181 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
185 where
186 T: std::convert::Into<crate::model::Connection>,
187 {
188 self.0.request.connection = v.map(|x| x.into());
189 self
190 }
191
192 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
196 self.0.request.connection_id = v.into();
197 self
198 }
199 }
200
201 #[doc(hidden)]
202 impl gax::options::internal::RequestBuilder for CreateConnection {
203 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
204 &mut self.0.options
205 }
206 }
207
208 #[derive(Clone, Debug)]
225 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
226
227 impl GetConnection {
228 pub(crate) fn new(
229 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
230 ) -> Self {
231 Self(RequestBuilder::new(stub))
232 }
233
234 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
236 self.0.request = v.into();
237 self
238 }
239
240 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
242 self.0.options = v.into();
243 self
244 }
245
246 pub async fn send(self) -> Result<crate::model::Connection> {
248 (*self.0.stub)
249 .get_connection(self.0.request, self.0.options)
250 .await
251 .map(gax::response::Response::into_body)
252 }
253
254 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
258 self.0.request.name = v.into();
259 self
260 }
261 }
262
263 #[doc(hidden)]
264 impl gax::options::internal::RequestBuilder for GetConnection {
265 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
266 &mut self.0.options
267 }
268 }
269
270 #[derive(Clone, Debug)]
291 pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
292
293 impl ListConnections {
294 pub(crate) fn new(
295 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
296 ) -> Self {
297 Self(RequestBuilder::new(stub))
298 }
299
300 pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
302 self.0.request = v.into();
303 self
304 }
305
306 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
308 self.0.options = v.into();
309 self
310 }
311
312 pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
314 (*self.0.stub)
315 .list_connections(self.0.request, self.0.options)
316 .await
317 .map(gax::response::Response::into_body)
318 }
319
320 pub fn by_page(
322 self,
323 ) -> impl gax::paginator::Paginator<crate::model::ListConnectionsResponse, gax::error::Error>
324 {
325 use std::clone::Clone;
326 let token = self.0.request.page_token.clone();
327 let execute = move |token: String| {
328 let mut builder = self.clone();
329 builder.0.request = builder.0.request.set_page_token(token);
330 builder.send()
331 };
332 gax::paginator::internal::new_paginator(token, execute)
333 }
334
335 pub fn by_item(
337 self,
338 ) -> impl gax::paginator::ItemPaginator<crate::model::ListConnectionsResponse, gax::error::Error>
339 {
340 use gax::paginator::Paginator;
341 self.by_page().items()
342 }
343
344 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
348 self.0.request.parent = v.into();
349 self
350 }
351
352 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
354 self.0.request.page_size = v.into();
355 self
356 }
357
358 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
360 self.0.request.page_token = v.into();
361 self
362 }
363 }
364
365 #[doc(hidden)]
366 impl gax::options::internal::RequestBuilder for ListConnections {
367 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
368 &mut self.0.options
369 }
370 }
371
372 #[derive(Clone, Debug)]
390 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
391
392 impl UpdateConnection {
393 pub(crate) fn new(
394 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
395 ) -> Self {
396 Self(RequestBuilder::new(stub))
397 }
398
399 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
401 mut self,
402 v: V,
403 ) -> Self {
404 self.0.request = v.into();
405 self
406 }
407
408 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
410 self.0.options = v.into();
411 self
412 }
413
414 pub async fn send(self) -> Result<longrunning::model::Operation> {
421 (*self.0.stub)
422 .update_connection(self.0.request, self.0.options)
423 .await
424 .map(gax::response::Response::into_body)
425 }
426
427 pub fn poller(
429 self,
430 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
431 type Operation =
432 lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
433 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
434 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
435
436 let stub = self.0.stub.clone();
437 let mut options = self.0.options.clone();
438 options.set_retry_policy(gax::retry_policy::NeverRetry);
439 let query = move |name| {
440 let stub = stub.clone();
441 let options = options.clone();
442 async {
443 let op = GetOperation::new(stub)
444 .set_name(name)
445 .with_options(options)
446 .send()
447 .await?;
448 Ok(Operation::new(op))
449 }
450 };
451
452 let start = move || async {
453 let op = self.send().await?;
454 Ok(Operation::new(op))
455 };
456
457 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
458 }
459
460 pub fn set_connection<T>(mut self, v: T) -> Self
464 where
465 T: std::convert::Into<crate::model::Connection>,
466 {
467 self.0.request.connection = std::option::Option::Some(v.into());
468 self
469 }
470
471 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
475 where
476 T: std::convert::Into<crate::model::Connection>,
477 {
478 self.0.request.connection = v.map(|x| x.into());
479 self
480 }
481
482 pub fn set_update_mask<T>(mut self, v: T) -> Self
484 where
485 T: std::convert::Into<wkt::FieldMask>,
486 {
487 self.0.request.update_mask = std::option::Option::Some(v.into());
488 self
489 }
490
491 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
493 where
494 T: std::convert::Into<wkt::FieldMask>,
495 {
496 self.0.request.update_mask = v.map(|x| x.into());
497 self
498 }
499
500 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
502 self.0.request.allow_missing = v.into();
503 self
504 }
505
506 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
508 self.0.request.etag = v.into();
509 self
510 }
511 }
512
513 #[doc(hidden)]
514 impl gax::options::internal::RequestBuilder for UpdateConnection {
515 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
516 &mut self.0.options
517 }
518 }
519
520 #[derive(Clone, Debug)]
538 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
539
540 impl DeleteConnection {
541 pub(crate) fn new(
542 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
543 ) -> Self {
544 Self(RequestBuilder::new(stub))
545 }
546
547 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
549 mut self,
550 v: V,
551 ) -> Self {
552 self.0.request = v.into();
553 self
554 }
555
556 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
558 self.0.options = v.into();
559 self
560 }
561
562 pub async fn send(self) -> Result<longrunning::model::Operation> {
569 (*self.0.stub)
570 .delete_connection(self.0.request, self.0.options)
571 .await
572 .map(gax::response::Response::into_body)
573 }
574
575 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
577 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
578 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
579 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
580
581 let stub = self.0.stub.clone();
582 let mut options = self.0.options.clone();
583 options.set_retry_policy(gax::retry_policy::NeverRetry);
584 let query = move |name| {
585 let stub = stub.clone();
586 let options = options.clone();
587 async {
588 let op = GetOperation::new(stub)
589 .set_name(name)
590 .with_options(options)
591 .send()
592 .await?;
593 Ok(Operation::new(op))
594 }
595 };
596
597 let start = move || async {
598 let op = self.send().await?;
599 Ok(Operation::new(op))
600 };
601
602 lro::internal::new_unit_response_poller(
603 polling_error_policy,
604 polling_backoff_policy,
605 start,
606 query,
607 )
608 }
609
610 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
614 self.0.request.name = v.into();
615 self
616 }
617
618 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
620 self.0.request.etag = v.into();
621 self
622 }
623
624 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
626 self.0.request.validate_only = v.into();
627 self
628 }
629 }
630
631 #[doc(hidden)]
632 impl gax::options::internal::RequestBuilder for DeleteConnection {
633 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
634 &mut self.0.options
635 }
636 }
637
638 #[derive(Clone, Debug)]
656 pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
657
658 impl CreateRepository {
659 pub(crate) fn new(
660 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
661 ) -> Self {
662 Self(RequestBuilder::new(stub))
663 }
664
665 pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
667 mut self,
668 v: V,
669 ) -> Self {
670 self.0.request = v.into();
671 self
672 }
673
674 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
676 self.0.options = v.into();
677 self
678 }
679
680 pub async fn send(self) -> Result<longrunning::model::Operation> {
687 (*self.0.stub)
688 .create_repository(self.0.request, self.0.options)
689 .await
690 .map(gax::response::Response::into_body)
691 }
692
693 pub fn poller(
695 self,
696 ) -> impl lro::Poller<crate::model::Repository, crate::model::OperationMetadata> {
697 type Operation =
698 lro::internal::Operation<crate::model::Repository, crate::model::OperationMetadata>;
699 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
700 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
701
702 let stub = self.0.stub.clone();
703 let mut options = self.0.options.clone();
704 options.set_retry_policy(gax::retry_policy::NeverRetry);
705 let query = move |name| {
706 let stub = stub.clone();
707 let options = options.clone();
708 async {
709 let op = GetOperation::new(stub)
710 .set_name(name)
711 .with_options(options)
712 .send()
713 .await?;
714 Ok(Operation::new(op))
715 }
716 };
717
718 let start = move || async {
719 let op = self.send().await?;
720 Ok(Operation::new(op))
721 };
722
723 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
724 }
725
726 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
730 self.0.request.parent = v.into();
731 self
732 }
733
734 pub fn set_repository<T>(mut self, v: T) -> Self
738 where
739 T: std::convert::Into<crate::model::Repository>,
740 {
741 self.0.request.repository = std::option::Option::Some(v.into());
742 self
743 }
744
745 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
749 where
750 T: std::convert::Into<crate::model::Repository>,
751 {
752 self.0.request.repository = v.map(|x| x.into());
753 self
754 }
755
756 pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
760 self.0.request.repository_id = v.into();
761 self
762 }
763 }
764
765 #[doc(hidden)]
766 impl gax::options::internal::RequestBuilder for CreateRepository {
767 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
768 &mut self.0.options
769 }
770 }
771
772 #[derive(Clone, Debug)]
790 pub struct BatchCreateRepositories(
791 RequestBuilder<crate::model::BatchCreateRepositoriesRequest>,
792 );
793
794 impl BatchCreateRepositories {
795 pub(crate) fn new(
796 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
797 ) -> Self {
798 Self(RequestBuilder::new(stub))
799 }
800
801 pub fn with_request<V: Into<crate::model::BatchCreateRepositoriesRequest>>(
803 mut self,
804 v: V,
805 ) -> Self {
806 self.0.request = v.into();
807 self
808 }
809
810 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
812 self.0.options = v.into();
813 self
814 }
815
816 pub async fn send(self) -> Result<longrunning::model::Operation> {
823 (*self.0.stub)
824 .batch_create_repositories(self.0.request, self.0.options)
825 .await
826 .map(gax::response::Response::into_body)
827 }
828
829 pub fn poller(
831 self,
832 ) -> impl lro::Poller<
833 crate::model::BatchCreateRepositoriesResponse,
834 crate::model::OperationMetadata,
835 > {
836 type Operation = lro::internal::Operation<
837 crate::model::BatchCreateRepositoriesResponse,
838 crate::model::OperationMetadata,
839 >;
840 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
841 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
842
843 let stub = self.0.stub.clone();
844 let mut options = self.0.options.clone();
845 options.set_retry_policy(gax::retry_policy::NeverRetry);
846 let query = move |name| {
847 let stub = stub.clone();
848 let options = options.clone();
849 async {
850 let op = GetOperation::new(stub)
851 .set_name(name)
852 .with_options(options)
853 .send()
854 .await?;
855 Ok(Operation::new(op))
856 }
857 };
858
859 let start = move || async {
860 let op = self.send().await?;
861 Ok(Operation::new(op))
862 };
863
864 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
865 }
866
867 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
871 self.0.request.parent = v.into();
872 self
873 }
874
875 pub fn set_requests<T, V>(mut self, v: T) -> Self
879 where
880 T: std::iter::IntoIterator<Item = V>,
881 V: std::convert::Into<crate::model::CreateRepositoryRequest>,
882 {
883 use std::iter::Iterator;
884 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
885 self
886 }
887 }
888
889 #[doc(hidden)]
890 impl gax::options::internal::RequestBuilder for BatchCreateRepositories {
891 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
892 &mut self.0.options
893 }
894 }
895
896 #[derive(Clone, Debug)]
913 pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
914
915 impl GetRepository {
916 pub(crate) fn new(
917 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
918 ) -> Self {
919 Self(RequestBuilder::new(stub))
920 }
921
922 pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
924 self.0.request = v.into();
925 self
926 }
927
928 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
930 self.0.options = v.into();
931 self
932 }
933
934 pub async fn send(self) -> Result<crate::model::Repository> {
936 (*self.0.stub)
937 .get_repository(self.0.request, self.0.options)
938 .await
939 .map(gax::response::Response::into_body)
940 }
941
942 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
946 self.0.request.name = v.into();
947 self
948 }
949 }
950
951 #[doc(hidden)]
952 impl gax::options::internal::RequestBuilder for GetRepository {
953 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
954 &mut self.0.options
955 }
956 }
957
958 #[derive(Clone, Debug)]
979 pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
980
981 impl ListRepositories {
982 pub(crate) fn new(
983 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
984 ) -> Self {
985 Self(RequestBuilder::new(stub))
986 }
987
988 pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
990 mut self,
991 v: V,
992 ) -> Self {
993 self.0.request = v.into();
994 self
995 }
996
997 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
999 self.0.options = v.into();
1000 self
1001 }
1002
1003 pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
1005 (*self.0.stub)
1006 .list_repositories(self.0.request, self.0.options)
1007 .await
1008 .map(gax::response::Response::into_body)
1009 }
1010
1011 pub fn by_page(
1013 self,
1014 ) -> impl gax::paginator::Paginator<crate::model::ListRepositoriesResponse, gax::error::Error>
1015 {
1016 use std::clone::Clone;
1017 let token = self.0.request.page_token.clone();
1018 let execute = move |token: String| {
1019 let mut builder = self.clone();
1020 builder.0.request = builder.0.request.set_page_token(token);
1021 builder.send()
1022 };
1023 gax::paginator::internal::new_paginator(token, execute)
1024 }
1025
1026 pub fn by_item(
1028 self,
1029 ) -> impl gax::paginator::ItemPaginator<crate::model::ListRepositoriesResponse, gax::error::Error>
1030 {
1031 use gax::paginator::Paginator;
1032 self.by_page().items()
1033 }
1034
1035 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1039 self.0.request.parent = v.into();
1040 self
1041 }
1042
1043 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1045 self.0.request.page_size = v.into();
1046 self
1047 }
1048
1049 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1051 self.0.request.page_token = v.into();
1052 self
1053 }
1054
1055 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1057 self.0.request.filter = v.into();
1058 self
1059 }
1060 }
1061
1062 #[doc(hidden)]
1063 impl gax::options::internal::RequestBuilder for ListRepositories {
1064 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1065 &mut self.0.options
1066 }
1067 }
1068
1069 #[derive(Clone, Debug)]
1087 pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
1088
1089 impl DeleteRepository {
1090 pub(crate) fn new(
1091 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1092 ) -> Self {
1093 Self(RequestBuilder::new(stub))
1094 }
1095
1096 pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
1098 mut self,
1099 v: V,
1100 ) -> Self {
1101 self.0.request = v.into();
1102 self
1103 }
1104
1105 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1107 self.0.options = v.into();
1108 self
1109 }
1110
1111 pub async fn send(self) -> Result<longrunning::model::Operation> {
1118 (*self.0.stub)
1119 .delete_repository(self.0.request, self.0.options)
1120 .await
1121 .map(gax::response::Response::into_body)
1122 }
1123
1124 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1126 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1127 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1128 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1129
1130 let stub = self.0.stub.clone();
1131 let mut options = self.0.options.clone();
1132 options.set_retry_policy(gax::retry_policy::NeverRetry);
1133 let query = move |name| {
1134 let stub = stub.clone();
1135 let options = options.clone();
1136 async {
1137 let op = GetOperation::new(stub)
1138 .set_name(name)
1139 .with_options(options)
1140 .send()
1141 .await?;
1142 Ok(Operation::new(op))
1143 }
1144 };
1145
1146 let start = move || async {
1147 let op = self.send().await?;
1148 Ok(Operation::new(op))
1149 };
1150
1151 lro::internal::new_unit_response_poller(
1152 polling_error_policy,
1153 polling_backoff_policy,
1154 start,
1155 query,
1156 )
1157 }
1158
1159 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1163 self.0.request.name = v.into();
1164 self
1165 }
1166
1167 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1169 self.0.request.etag = v.into();
1170 self
1171 }
1172
1173 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1175 self.0.request.validate_only = v.into();
1176 self
1177 }
1178 }
1179
1180 #[doc(hidden)]
1181 impl gax::options::internal::RequestBuilder for DeleteRepository {
1182 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1183 &mut self.0.options
1184 }
1185 }
1186
1187 #[derive(Clone, Debug)]
1204 pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
1205
1206 impl FetchReadWriteToken {
1207 pub(crate) fn new(
1208 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1209 ) -> Self {
1210 Self(RequestBuilder::new(stub))
1211 }
1212
1213 pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
1215 mut self,
1216 v: V,
1217 ) -> Self {
1218 self.0.request = v.into();
1219 self
1220 }
1221
1222 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1224 self.0.options = v.into();
1225 self
1226 }
1227
1228 pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
1230 (*self.0.stub)
1231 .fetch_read_write_token(self.0.request, self.0.options)
1232 .await
1233 .map(gax::response::Response::into_body)
1234 }
1235
1236 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1240 self.0.request.repository = v.into();
1241 self
1242 }
1243 }
1244
1245 #[doc(hidden)]
1246 impl gax::options::internal::RequestBuilder for FetchReadWriteToken {
1247 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1248 &mut self.0.options
1249 }
1250 }
1251
1252 #[derive(Clone, Debug)]
1269 pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
1270
1271 impl FetchReadToken {
1272 pub(crate) fn new(
1273 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1274 ) -> Self {
1275 Self(RequestBuilder::new(stub))
1276 }
1277
1278 pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
1280 self.0.request = v.into();
1281 self
1282 }
1283
1284 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1286 self.0.options = v.into();
1287 self
1288 }
1289
1290 pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
1292 (*self.0.stub)
1293 .fetch_read_token(self.0.request, self.0.options)
1294 .await
1295 .map(gax::response::Response::into_body)
1296 }
1297
1298 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1302 self.0.request.repository = v.into();
1303 self
1304 }
1305 }
1306
1307 #[doc(hidden)]
1308 impl gax::options::internal::RequestBuilder for FetchReadToken {
1309 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1310 &mut self.0.options
1311 }
1312 }
1313
1314 #[derive(Clone, Debug)]
1335 pub struct FetchLinkableRepositories(
1336 RequestBuilder<crate::model::FetchLinkableRepositoriesRequest>,
1337 );
1338
1339 impl FetchLinkableRepositories {
1340 pub(crate) fn new(
1341 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1342 ) -> Self {
1343 Self(RequestBuilder::new(stub))
1344 }
1345
1346 pub fn with_request<V: Into<crate::model::FetchLinkableRepositoriesRequest>>(
1348 mut self,
1349 v: V,
1350 ) -> Self {
1351 self.0.request = v.into();
1352 self
1353 }
1354
1355 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1357 self.0.options = v.into();
1358 self
1359 }
1360
1361 pub async fn send(self) -> Result<crate::model::FetchLinkableRepositoriesResponse> {
1363 (*self.0.stub)
1364 .fetch_linkable_repositories(self.0.request, self.0.options)
1365 .await
1366 .map(gax::response::Response::into_body)
1367 }
1368
1369 pub fn by_page(
1371 self,
1372 ) -> impl gax::paginator::Paginator<
1373 crate::model::FetchLinkableRepositoriesResponse,
1374 gax::error::Error,
1375 > {
1376 use std::clone::Clone;
1377 let token = self.0.request.page_token.clone();
1378 let execute = move |token: String| {
1379 let mut builder = self.clone();
1380 builder.0.request = builder.0.request.set_page_token(token);
1381 builder.send()
1382 };
1383 gax::paginator::internal::new_paginator(token, execute)
1384 }
1385
1386 pub fn by_item(
1388 self,
1389 ) -> impl gax::paginator::ItemPaginator<
1390 crate::model::FetchLinkableRepositoriesResponse,
1391 gax::error::Error,
1392 > {
1393 use gax::paginator::Paginator;
1394 self.by_page().items()
1395 }
1396
1397 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1401 self.0.request.connection = v.into();
1402 self
1403 }
1404
1405 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1407 self.0.request.page_size = v.into();
1408 self
1409 }
1410
1411 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1413 self.0.request.page_token = v.into();
1414 self
1415 }
1416 }
1417
1418 #[doc(hidden)]
1419 impl gax::options::internal::RequestBuilder for FetchLinkableRepositories {
1420 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1421 &mut self.0.options
1422 }
1423 }
1424
1425 #[derive(Clone, Debug)]
1442 pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1443
1444 impl FetchGitRefs {
1445 pub(crate) fn new(
1446 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1447 ) -> Self {
1448 Self(RequestBuilder::new(stub))
1449 }
1450
1451 pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1453 self.0.request = v.into();
1454 self
1455 }
1456
1457 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1459 self.0.options = v.into();
1460 self
1461 }
1462
1463 pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1465 (*self.0.stub)
1466 .fetch_git_refs(self.0.request, self.0.options)
1467 .await
1468 .map(gax::response::Response::into_body)
1469 }
1470
1471 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1475 self.0.request.repository = v.into();
1476 self
1477 }
1478
1479 pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1481 mut self,
1482 v: T,
1483 ) -> Self {
1484 self.0.request.ref_type = v.into();
1485 self
1486 }
1487 }
1488
1489 #[doc(hidden)]
1490 impl gax::options::internal::RequestBuilder for FetchGitRefs {
1491 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1492 &mut self.0.options
1493 }
1494 }
1495
1496 #[derive(Clone, Debug)]
1513 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1514
1515 impl SetIamPolicy {
1516 pub(crate) fn new(
1517 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1518 ) -> Self {
1519 Self(RequestBuilder::new(stub))
1520 }
1521
1522 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(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<iam_v1::model::Policy> {
1536 (*self.0.stub)
1537 .set_iam_policy(self.0.request, self.0.options)
1538 .await
1539 .map(gax::response::Response::into_body)
1540 }
1541
1542 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.0.request.resource = v.into();
1547 self
1548 }
1549
1550 pub fn set_policy<T>(mut self, v: T) -> Self
1554 where
1555 T: std::convert::Into<iam_v1::model::Policy>,
1556 {
1557 self.0.request.policy = std::option::Option::Some(v.into());
1558 self
1559 }
1560
1561 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1565 where
1566 T: std::convert::Into<iam_v1::model::Policy>,
1567 {
1568 self.0.request.policy = v.map(|x| x.into());
1569 self
1570 }
1571
1572 pub fn set_update_mask<T>(mut self, v: T) -> Self
1574 where
1575 T: std::convert::Into<wkt::FieldMask>,
1576 {
1577 self.0.request.update_mask = std::option::Option::Some(v.into());
1578 self
1579 }
1580
1581 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1583 where
1584 T: std::convert::Into<wkt::FieldMask>,
1585 {
1586 self.0.request.update_mask = v.map(|x| x.into());
1587 self
1588 }
1589 }
1590
1591 #[doc(hidden)]
1592 impl gax::options::internal::RequestBuilder for SetIamPolicy {
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 GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1616
1617 impl GetIamPolicy {
1618 pub(crate) fn new(
1619 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
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(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 GetIamPolicy {
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 TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1696
1697 impl TestIamPermissions {
1698 pub(crate) fn new(
1699 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1700 ) -> Self {
1701 Self(RequestBuilder::new(stub))
1702 }
1703
1704 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1706 mut self,
1707 v: V,
1708 ) -> Self {
1709 self.0.request = v.into();
1710 self
1711 }
1712
1713 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1715 self.0.options = v.into();
1716 self
1717 }
1718
1719 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1721 (*self.0.stub)
1722 .test_iam_permissions(self.0.request, self.0.options)
1723 .await
1724 .map(gax::response::Response::into_body)
1725 }
1726
1727 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1731 self.0.request.resource = v.into();
1732 self
1733 }
1734
1735 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1739 where
1740 T: std::iter::IntoIterator<Item = V>,
1741 V: std::convert::Into<std::string::String>,
1742 {
1743 use std::iter::Iterator;
1744 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1745 self
1746 }
1747 }
1748
1749 #[doc(hidden)]
1750 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1751 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1752 &mut self.0.options
1753 }
1754 }
1755
1756 #[derive(Clone, Debug)]
1773 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1774
1775 impl GetOperation {
1776 pub(crate) fn new(
1777 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1778 ) -> Self {
1779 Self(RequestBuilder::new(stub))
1780 }
1781
1782 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1784 mut self,
1785 v: V,
1786 ) -> Self {
1787 self.0.request = v.into();
1788 self
1789 }
1790
1791 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1793 self.0.options = v.into();
1794 self
1795 }
1796
1797 pub async fn send(self) -> Result<longrunning::model::Operation> {
1799 (*self.0.stub)
1800 .get_operation(self.0.request, self.0.options)
1801 .await
1802 .map(gax::response::Response::into_body)
1803 }
1804
1805 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1807 self.0.request.name = v.into();
1808 self
1809 }
1810 }
1811
1812 #[doc(hidden)]
1813 impl gax::options::internal::RequestBuilder for GetOperation {
1814 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1815 &mut self.0.options
1816 }
1817 }
1818
1819 #[derive(Clone, Debug)]
1836 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1837
1838 impl CancelOperation {
1839 pub(crate) fn new(
1840 stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1841 ) -> Self {
1842 Self(RequestBuilder::new(stub))
1843 }
1844
1845 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1847 mut self,
1848 v: V,
1849 ) -> Self {
1850 self.0.request = v.into();
1851 self
1852 }
1853
1854 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1856 self.0.options = v.into();
1857 self
1858 }
1859
1860 pub async fn send(self) -> Result<()> {
1862 (*self.0.stub)
1863 .cancel_operation(self.0.request, self.0.options)
1864 .await
1865 .map(gax::response::Response::into_body)
1866 }
1867
1868 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1870 self.0.request.name = v.into();
1871 self
1872 }
1873 }
1874
1875 #[doc(hidden)]
1876 impl gax::options::internal::RequestBuilder for CancelOperation {
1877 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1878 &mut self.0.options
1879 }
1880 }
1881}