1pub mod repository_manager {
18 use crate::Result;
19 use std::sync::Arc;
20
21 pub type ClientBuilder =
35 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
36
37 pub(crate) mod client {
38 use super::super::super::client::RepositoryManager;
39 pub struct Factory;
40 impl gax::client_builder::internal::ClientFactory for Factory {
41 type Client = RepositoryManager;
42 type Credentials = gaxi::options::Credentials;
43 async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
44 Self::Client::new(config).await
45 }
46 }
47 }
48
49 #[derive(Clone, Debug)]
51 pub(crate) struct RequestBuilder<R: std::default::Default> {
52 stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>,
53 request: R,
54 options: gax::options::RequestOptions,
55 }
56
57 impl<R> RequestBuilder<R>
58 where
59 R: std::default::Default,
60 {
61 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
62 Self {
63 stub,
64 request: R::default(),
65 options: gax::options::RequestOptions::default(),
66 }
67 }
68 }
69
70 #[derive(Clone, Debug)]
72 pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
73
74 impl CreateConnection {
75 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
76 Self(RequestBuilder::new(stub))
77 }
78
79 pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
81 mut self,
82 v: V,
83 ) -> Self {
84 self.0.request = v.into();
85 self
86 }
87
88 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
90 self.0.options = v.into();
91 self
92 }
93
94 pub async fn send(self) -> Result<longrunning::model::Operation> {
101 (*self.0.stub)
102 .create_connection(self.0.request, self.0.options)
103 .await
104 .map(gax::response::Response::into_body)
105 }
106
107 pub fn poller(
109 self,
110 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
111 type Operation =
112 lro::Operation<crate::model::Connection, crate::model::OperationMetadata>;
113 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
114 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
115
116 let stub = self.0.stub.clone();
117 let mut options = self.0.options.clone();
118 options.set_retry_policy(gax::retry_policy::NeverRetry);
119 let query = move |name| {
120 let stub = stub.clone();
121 let options = options.clone();
122 async {
123 let op = GetOperation::new(stub)
124 .set_name(name)
125 .with_options(options)
126 .send()
127 .await?;
128 Ok(Operation::new(op))
129 }
130 };
131
132 let start = move || async {
133 let op = self.send().await?;
134 Ok(Operation::new(op))
135 };
136
137 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
138 }
139
140 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
142 self.0.request.parent = v.into();
143 self
144 }
145
146 pub fn set_connection<T: Into<std::option::Option<crate::model::Connection>>>(
148 mut self,
149 v: T,
150 ) -> Self {
151 self.0.request.connection = v.into();
152 self
153 }
154
155 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
157 self.0.request.connection_id = v.into();
158 self
159 }
160 }
161
162 #[doc(hidden)]
163 impl gax::options::internal::RequestBuilder for CreateConnection {
164 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
165 &mut self.0.options
166 }
167 }
168
169 #[derive(Clone, Debug)]
171 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
172
173 impl GetConnection {
174 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
175 Self(RequestBuilder::new(stub))
176 }
177
178 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
180 self.0.request = v.into();
181 self
182 }
183
184 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
186 self.0.options = v.into();
187 self
188 }
189
190 pub async fn send(self) -> Result<crate::model::Connection> {
192 (*self.0.stub)
193 .get_connection(self.0.request, self.0.options)
194 .await
195 .map(gax::response::Response::into_body)
196 }
197
198 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
200 self.0.request.name = v.into();
201 self
202 }
203 }
204
205 #[doc(hidden)]
206 impl gax::options::internal::RequestBuilder for GetConnection {
207 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
208 &mut self.0.options
209 }
210 }
211
212 #[derive(Clone, Debug)]
214 pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
215
216 impl ListConnections {
217 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
218 Self(RequestBuilder::new(stub))
219 }
220
221 pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
223 self.0.request = v.into();
224 self
225 }
226
227 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
229 self.0.options = v.into();
230 self
231 }
232
233 pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
235 (*self.0.stub)
236 .list_connections(self.0.request, self.0.options)
237 .await
238 .map(gax::response::Response::into_body)
239 }
240
241 pub async fn paginator(
243 self,
244 ) -> impl gax::paginator::Paginator<crate::model::ListConnectionsResponse, gax::error::Error>
245 {
246 use std::clone::Clone;
247 let token = self.0.request.page_token.clone();
248 let execute = move |token: String| {
249 let mut builder = self.clone();
250 builder.0.request = builder.0.request.set_page_token(token);
251 builder.send()
252 };
253 gax::paginator::internal::new_paginator(token, execute)
254 }
255
256 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
258 self.0.request.parent = v.into();
259 self
260 }
261
262 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
264 self.0.request.page_size = v.into();
265 self
266 }
267
268 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
270 self.0.request.page_token = v.into();
271 self
272 }
273 }
274
275 #[doc(hidden)]
276 impl gax::options::internal::RequestBuilder for ListConnections {
277 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
278 &mut self.0.options
279 }
280 }
281
282 #[derive(Clone, Debug)]
284 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
285
286 impl UpdateConnection {
287 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
288 Self(RequestBuilder::new(stub))
289 }
290
291 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
293 mut self,
294 v: V,
295 ) -> Self {
296 self.0.request = v.into();
297 self
298 }
299
300 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
302 self.0.options = v.into();
303 self
304 }
305
306 pub async fn send(self) -> Result<longrunning::model::Operation> {
313 (*self.0.stub)
314 .update_connection(self.0.request, self.0.options)
315 .await
316 .map(gax::response::Response::into_body)
317 }
318
319 pub fn poller(
321 self,
322 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
323 type Operation =
324 lro::Operation<crate::model::Connection, crate::model::OperationMetadata>;
325 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
326 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
327
328 let stub = self.0.stub.clone();
329 let mut options = self.0.options.clone();
330 options.set_retry_policy(gax::retry_policy::NeverRetry);
331 let query = move |name| {
332 let stub = stub.clone();
333 let options = options.clone();
334 async {
335 let op = GetOperation::new(stub)
336 .set_name(name)
337 .with_options(options)
338 .send()
339 .await?;
340 Ok(Operation::new(op))
341 }
342 };
343
344 let start = move || async {
345 let op = self.send().await?;
346 Ok(Operation::new(op))
347 };
348
349 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
350 }
351
352 pub fn set_connection<T: Into<std::option::Option<crate::model::Connection>>>(
354 mut self,
355 v: T,
356 ) -> Self {
357 self.0.request.connection = v.into();
358 self
359 }
360
361 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
363 mut self,
364 v: T,
365 ) -> Self {
366 self.0.request.update_mask = v.into();
367 self
368 }
369
370 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
372 self.0.request.allow_missing = v.into();
373 self
374 }
375
376 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
378 self.0.request.etag = v.into();
379 self
380 }
381 }
382
383 #[doc(hidden)]
384 impl gax::options::internal::RequestBuilder for UpdateConnection {
385 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
386 &mut self.0.options
387 }
388 }
389
390 #[derive(Clone, Debug)]
392 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
393
394 impl DeleteConnection {
395 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
396 Self(RequestBuilder::new(stub))
397 }
398
399 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
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 .delete_connection(self.0.request, self.0.options)
423 .await
424 .map(gax::response::Response::into_body)
425 }
426
427 pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
429 type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
430 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
431 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
432
433 let stub = self.0.stub.clone();
434 let mut options = self.0.options.clone();
435 options.set_retry_policy(gax::retry_policy::NeverRetry);
436 let query = move |name| {
437 let stub = stub.clone();
438 let options = options.clone();
439 async {
440 let op = GetOperation::new(stub)
441 .set_name(name)
442 .with_options(options)
443 .send()
444 .await?;
445 Ok(Operation::new(op))
446 }
447 };
448
449 let start = move || async {
450 let op = self.send().await?;
451 Ok(Operation::new(op))
452 };
453
454 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
455 }
456
457 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
459 self.0.request.name = v.into();
460 self
461 }
462
463 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
465 self.0.request.etag = v.into();
466 self
467 }
468
469 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
471 self.0.request.validate_only = v.into();
472 self
473 }
474 }
475
476 #[doc(hidden)]
477 impl gax::options::internal::RequestBuilder for DeleteConnection {
478 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
479 &mut self.0.options
480 }
481 }
482
483 #[derive(Clone, Debug)]
485 pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
486
487 impl CreateRepository {
488 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
489 Self(RequestBuilder::new(stub))
490 }
491
492 pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
494 mut self,
495 v: V,
496 ) -> Self {
497 self.0.request = v.into();
498 self
499 }
500
501 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
503 self.0.options = v.into();
504 self
505 }
506
507 pub async fn send(self) -> Result<longrunning::model::Operation> {
514 (*self.0.stub)
515 .create_repository(self.0.request, self.0.options)
516 .await
517 .map(gax::response::Response::into_body)
518 }
519
520 pub fn poller(
522 self,
523 ) -> impl lro::Poller<crate::model::Repository, crate::model::OperationMetadata> {
524 type Operation =
525 lro::Operation<crate::model::Repository, crate::model::OperationMetadata>;
526 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
527 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
528
529 let stub = self.0.stub.clone();
530 let mut options = self.0.options.clone();
531 options.set_retry_policy(gax::retry_policy::NeverRetry);
532 let query = move |name| {
533 let stub = stub.clone();
534 let options = options.clone();
535 async {
536 let op = GetOperation::new(stub)
537 .set_name(name)
538 .with_options(options)
539 .send()
540 .await?;
541 Ok(Operation::new(op))
542 }
543 };
544
545 let start = move || async {
546 let op = self.send().await?;
547 Ok(Operation::new(op))
548 };
549
550 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
551 }
552
553 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
555 self.0.request.parent = v.into();
556 self
557 }
558
559 pub fn set_repository<T: Into<std::option::Option<crate::model::Repository>>>(
561 mut self,
562 v: T,
563 ) -> Self {
564 self.0.request.repository = v.into();
565 self
566 }
567
568 pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
570 self.0.request.repository_id = v.into();
571 self
572 }
573 }
574
575 #[doc(hidden)]
576 impl gax::options::internal::RequestBuilder for CreateRepository {
577 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
578 &mut self.0.options
579 }
580 }
581
582 #[derive(Clone, Debug)]
584 pub struct BatchCreateRepositories(
585 RequestBuilder<crate::model::BatchCreateRepositoriesRequest>,
586 );
587
588 impl BatchCreateRepositories {
589 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
590 Self(RequestBuilder::new(stub))
591 }
592
593 pub fn with_request<V: Into<crate::model::BatchCreateRepositoriesRequest>>(
595 mut self,
596 v: V,
597 ) -> Self {
598 self.0.request = v.into();
599 self
600 }
601
602 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
604 self.0.options = v.into();
605 self
606 }
607
608 pub async fn send(self) -> Result<longrunning::model::Operation> {
615 (*self.0.stub)
616 .batch_create_repositories(self.0.request, self.0.options)
617 .await
618 .map(gax::response::Response::into_body)
619 }
620
621 pub fn poller(
623 self,
624 ) -> impl lro::Poller<
625 crate::model::BatchCreateRepositoriesResponse,
626 crate::model::OperationMetadata,
627 > {
628 type Operation = lro::Operation<
629 crate::model::BatchCreateRepositoriesResponse,
630 crate::model::OperationMetadata,
631 >;
632 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
633 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
634
635 let stub = self.0.stub.clone();
636 let mut options = self.0.options.clone();
637 options.set_retry_policy(gax::retry_policy::NeverRetry);
638 let query = move |name| {
639 let stub = stub.clone();
640 let options = options.clone();
641 async {
642 let op = GetOperation::new(stub)
643 .set_name(name)
644 .with_options(options)
645 .send()
646 .await?;
647 Ok(Operation::new(op))
648 }
649 };
650
651 let start = move || async {
652 let op = self.send().await?;
653 Ok(Operation::new(op))
654 };
655
656 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
657 }
658
659 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
661 self.0.request.parent = v.into();
662 self
663 }
664
665 pub fn set_requests<T, V>(mut self, v: T) -> Self
667 where
668 T: std::iter::IntoIterator<Item = V>,
669 V: std::convert::Into<crate::model::CreateRepositoryRequest>,
670 {
671 use std::iter::Iterator;
672 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
673 self
674 }
675 }
676
677 #[doc(hidden)]
678 impl gax::options::internal::RequestBuilder for BatchCreateRepositories {
679 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
680 &mut self.0.options
681 }
682 }
683
684 #[derive(Clone, Debug)]
686 pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
687
688 impl GetRepository {
689 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
690 Self(RequestBuilder::new(stub))
691 }
692
693 pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
695 self.0.request = v.into();
696 self
697 }
698
699 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
701 self.0.options = v.into();
702 self
703 }
704
705 pub async fn send(self) -> Result<crate::model::Repository> {
707 (*self.0.stub)
708 .get_repository(self.0.request, self.0.options)
709 .await
710 .map(gax::response::Response::into_body)
711 }
712
713 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
715 self.0.request.name = v.into();
716 self
717 }
718 }
719
720 #[doc(hidden)]
721 impl gax::options::internal::RequestBuilder for GetRepository {
722 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
723 &mut self.0.options
724 }
725 }
726
727 #[derive(Clone, Debug)]
729 pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
730
731 impl ListRepositories {
732 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
733 Self(RequestBuilder::new(stub))
734 }
735
736 pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
738 mut self,
739 v: V,
740 ) -> Self {
741 self.0.request = v.into();
742 self
743 }
744
745 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
747 self.0.options = v.into();
748 self
749 }
750
751 pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
753 (*self.0.stub)
754 .list_repositories(self.0.request, self.0.options)
755 .await
756 .map(gax::response::Response::into_body)
757 }
758
759 pub async fn paginator(
761 self,
762 ) -> impl gax::paginator::Paginator<crate::model::ListRepositoriesResponse, gax::error::Error>
763 {
764 use std::clone::Clone;
765 let token = self.0.request.page_token.clone();
766 let execute = move |token: String| {
767 let mut builder = self.clone();
768 builder.0.request = builder.0.request.set_page_token(token);
769 builder.send()
770 };
771 gax::paginator::internal::new_paginator(token, execute)
772 }
773
774 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
776 self.0.request.parent = v.into();
777 self
778 }
779
780 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
782 self.0.request.page_size = v.into();
783 self
784 }
785
786 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
788 self.0.request.page_token = v.into();
789 self
790 }
791
792 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
794 self.0.request.filter = v.into();
795 self
796 }
797 }
798
799 #[doc(hidden)]
800 impl gax::options::internal::RequestBuilder for ListRepositories {
801 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
802 &mut self.0.options
803 }
804 }
805
806 #[derive(Clone, Debug)]
808 pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
809
810 impl DeleteRepository {
811 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
812 Self(RequestBuilder::new(stub))
813 }
814
815 pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
817 mut self,
818 v: V,
819 ) -> Self {
820 self.0.request = v.into();
821 self
822 }
823
824 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
826 self.0.options = v.into();
827 self
828 }
829
830 pub async fn send(self) -> Result<longrunning::model::Operation> {
837 (*self.0.stub)
838 .delete_repository(self.0.request, self.0.options)
839 .await
840 .map(gax::response::Response::into_body)
841 }
842
843 pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
845 type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
846 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
847 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
848
849 let stub = self.0.stub.clone();
850 let mut options = self.0.options.clone();
851 options.set_retry_policy(gax::retry_policy::NeverRetry);
852 let query = move |name| {
853 let stub = stub.clone();
854 let options = options.clone();
855 async {
856 let op = GetOperation::new(stub)
857 .set_name(name)
858 .with_options(options)
859 .send()
860 .await?;
861 Ok(Operation::new(op))
862 }
863 };
864
865 let start = move || async {
866 let op = self.send().await?;
867 Ok(Operation::new(op))
868 };
869
870 lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
871 }
872
873 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
875 self.0.request.name = v.into();
876 self
877 }
878
879 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
881 self.0.request.etag = v.into();
882 self
883 }
884
885 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
887 self.0.request.validate_only = v.into();
888 self
889 }
890 }
891
892 #[doc(hidden)]
893 impl gax::options::internal::RequestBuilder for DeleteRepository {
894 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
895 &mut self.0.options
896 }
897 }
898
899 #[derive(Clone, Debug)]
901 pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
902
903 impl FetchReadWriteToken {
904 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
905 Self(RequestBuilder::new(stub))
906 }
907
908 pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
910 mut self,
911 v: V,
912 ) -> Self {
913 self.0.request = v.into();
914 self
915 }
916
917 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
919 self.0.options = v.into();
920 self
921 }
922
923 pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
925 (*self.0.stub)
926 .fetch_read_write_token(self.0.request, self.0.options)
927 .await
928 .map(gax::response::Response::into_body)
929 }
930
931 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
933 self.0.request.repository = v.into();
934 self
935 }
936 }
937
938 #[doc(hidden)]
939 impl gax::options::internal::RequestBuilder for FetchReadWriteToken {
940 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
941 &mut self.0.options
942 }
943 }
944
945 #[derive(Clone, Debug)]
947 pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
948
949 impl FetchReadToken {
950 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
951 Self(RequestBuilder::new(stub))
952 }
953
954 pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
956 self.0.request = v.into();
957 self
958 }
959
960 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
962 self.0.options = v.into();
963 self
964 }
965
966 pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
968 (*self.0.stub)
969 .fetch_read_token(self.0.request, self.0.options)
970 .await
971 .map(gax::response::Response::into_body)
972 }
973
974 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
976 self.0.request.repository = v.into();
977 self
978 }
979 }
980
981 #[doc(hidden)]
982 impl gax::options::internal::RequestBuilder for FetchReadToken {
983 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
984 &mut self.0.options
985 }
986 }
987
988 #[derive(Clone, Debug)]
990 pub struct FetchLinkableRepositories(
991 RequestBuilder<crate::model::FetchLinkableRepositoriesRequest>,
992 );
993
994 impl FetchLinkableRepositories {
995 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
996 Self(RequestBuilder::new(stub))
997 }
998
999 pub fn with_request<V: Into<crate::model::FetchLinkableRepositoriesRequest>>(
1001 mut self,
1002 v: V,
1003 ) -> Self {
1004 self.0.request = v.into();
1005 self
1006 }
1007
1008 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1010 self.0.options = v.into();
1011 self
1012 }
1013
1014 pub async fn send(self) -> Result<crate::model::FetchLinkableRepositoriesResponse> {
1016 (*self.0.stub)
1017 .fetch_linkable_repositories(self.0.request, self.0.options)
1018 .await
1019 .map(gax::response::Response::into_body)
1020 }
1021
1022 pub async fn paginator(
1024 self,
1025 ) -> impl gax::paginator::Paginator<
1026 crate::model::FetchLinkableRepositoriesResponse,
1027 gax::error::Error,
1028 > {
1029 use std::clone::Clone;
1030 let token = self.0.request.page_token.clone();
1031 let execute = move |token: String| {
1032 let mut builder = self.clone();
1033 builder.0.request = builder.0.request.set_page_token(token);
1034 builder.send()
1035 };
1036 gax::paginator::internal::new_paginator(token, execute)
1037 }
1038
1039 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1041 self.0.request.connection = v.into();
1042 self
1043 }
1044
1045 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1047 self.0.request.page_size = v.into();
1048 self
1049 }
1050
1051 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1053 self.0.request.page_token = v.into();
1054 self
1055 }
1056 }
1057
1058 #[doc(hidden)]
1059 impl gax::options::internal::RequestBuilder for FetchLinkableRepositories {
1060 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1061 &mut self.0.options
1062 }
1063 }
1064
1065 #[derive(Clone, Debug)]
1067 pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1068
1069 impl FetchGitRefs {
1070 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
1071 Self(RequestBuilder::new(stub))
1072 }
1073
1074 pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1076 self.0.request = v.into();
1077 self
1078 }
1079
1080 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1082 self.0.options = v.into();
1083 self
1084 }
1085
1086 pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1088 (*self.0.stub)
1089 .fetch_git_refs(self.0.request, self.0.options)
1090 .await
1091 .map(gax::response::Response::into_body)
1092 }
1093
1094 pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1096 self.0.request.repository = v.into();
1097 self
1098 }
1099
1100 pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1102 mut self,
1103 v: T,
1104 ) -> Self {
1105 self.0.request.ref_type = v.into();
1106 self
1107 }
1108 }
1109
1110 #[doc(hidden)]
1111 impl gax::options::internal::RequestBuilder for FetchGitRefs {
1112 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1113 &mut self.0.options
1114 }
1115 }
1116
1117 #[derive(Clone, Debug)]
1119 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1120
1121 impl SetIamPolicy {
1122 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
1123 Self(RequestBuilder::new(stub))
1124 }
1125
1126 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1128 self.0.request = v.into();
1129 self
1130 }
1131
1132 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1134 self.0.options = v.into();
1135 self
1136 }
1137
1138 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1140 (*self.0.stub)
1141 .set_iam_policy(self.0.request, self.0.options)
1142 .await
1143 .map(gax::response::Response::into_body)
1144 }
1145
1146 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1148 self.0.request.resource = v.into();
1149 self
1150 }
1151
1152 pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
1154 mut self,
1155 v: T,
1156 ) -> Self {
1157 self.0.request.policy = v.into();
1158 self
1159 }
1160
1161 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1163 mut self,
1164 v: T,
1165 ) -> Self {
1166 self.0.request.update_mask = v.into();
1167 self
1168 }
1169 }
1170
1171 #[doc(hidden)]
1172 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1173 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1174 &mut self.0.options
1175 }
1176 }
1177
1178 #[derive(Clone, Debug)]
1180 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1181
1182 impl GetIamPolicy {
1183 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
1184 Self(RequestBuilder::new(stub))
1185 }
1186
1187 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1189 self.0.request = v.into();
1190 self
1191 }
1192
1193 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1195 self.0.options = v.into();
1196 self
1197 }
1198
1199 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1201 (*self.0.stub)
1202 .get_iam_policy(self.0.request, self.0.options)
1203 .await
1204 .map(gax::response::Response::into_body)
1205 }
1206
1207 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1209 self.0.request.resource = v.into();
1210 self
1211 }
1212
1213 pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
1215 mut self,
1216 v: T,
1217 ) -> Self {
1218 self.0.request.options = v.into();
1219 self
1220 }
1221 }
1222
1223 #[doc(hidden)]
1224 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1225 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1226 &mut self.0.options
1227 }
1228 }
1229
1230 #[derive(Clone, Debug)]
1232 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1233
1234 impl TestIamPermissions {
1235 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
1236 Self(RequestBuilder::new(stub))
1237 }
1238
1239 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1241 mut self,
1242 v: V,
1243 ) -> Self {
1244 self.0.request = v.into();
1245 self
1246 }
1247
1248 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1250 self.0.options = v.into();
1251 self
1252 }
1253
1254 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1256 (*self.0.stub)
1257 .test_iam_permissions(self.0.request, self.0.options)
1258 .await
1259 .map(gax::response::Response::into_body)
1260 }
1261
1262 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1264 self.0.request.resource = v.into();
1265 self
1266 }
1267
1268 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1270 where
1271 T: std::iter::IntoIterator<Item = V>,
1272 V: std::convert::Into<std::string::String>,
1273 {
1274 use std::iter::Iterator;
1275 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1276 self
1277 }
1278 }
1279
1280 #[doc(hidden)]
1281 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1282 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1283 &mut self.0.options
1284 }
1285 }
1286
1287 #[derive(Clone, Debug)]
1289 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1290
1291 impl GetOperation {
1292 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
1293 Self(RequestBuilder::new(stub))
1294 }
1295
1296 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1298 mut self,
1299 v: V,
1300 ) -> Self {
1301 self.0.request = v.into();
1302 self
1303 }
1304
1305 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1307 self.0.options = v.into();
1308 self
1309 }
1310
1311 pub async fn send(self) -> Result<longrunning::model::Operation> {
1313 (*self.0.stub)
1314 .get_operation(self.0.request, self.0.options)
1315 .await
1316 .map(gax::response::Response::into_body)
1317 }
1318
1319 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1321 self.0.request.name = v.into();
1322 self
1323 }
1324 }
1325
1326 #[doc(hidden)]
1327 impl gax::options::internal::RequestBuilder for GetOperation {
1328 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1329 &mut self.0.options
1330 }
1331 }
1332
1333 #[derive(Clone, Debug)]
1335 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1336
1337 impl CancelOperation {
1338 pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::RepositoryManager>) -> Self {
1339 Self(RequestBuilder::new(stub))
1340 }
1341
1342 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1344 mut self,
1345 v: V,
1346 ) -> Self {
1347 self.0.request = v.into();
1348 self
1349 }
1350
1351 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1353 self.0.options = v.into();
1354 self
1355 }
1356
1357 pub async fn send(self) -> Result<()> {
1359 (*self.0.stub)
1360 .cancel_operation(self.0.request, self.0.options)
1361 .await
1362 .map(gax::response::Response::into_body)
1363 }
1364
1365 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1367 self.0.request.name = v.into();
1368 self
1369 }
1370 }
1371
1372 #[doc(hidden)]
1373 impl gax::options::internal::RequestBuilder for CancelOperation {
1374 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1375 &mut self.0.options
1376 }
1377 }
1378}