google_cloud_build_v2/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod repository_manager {
18    use crate::Result;
19
20    /// A builder for [RepositoryManager][crate::client::RepositoryManager].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_build_v2::*;
25    /// # use builder::repository_manager::ClientBuilder;
26    /// # use client::RepositoryManager;
27    /// let builder : ClientBuilder = RepositoryManager::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://cloudbuild.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    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    /// Common implementation for [crate::client::RepositoryManager] request builders.
52    #[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    /// The request builder for [RepositoryManager::create_connection][crate::client::RepositoryManager::create_connection] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_build_v2::builder;
79    /// use builder::repository_manager::CreateConnection;
80    /// # tokio_test::block_on(async {
81    /// use lro::Poller;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let response = builder.poller().until_done().await?;
85    /// # gax::Result::<()>::Ok(()) });
86    ///
87    /// fn prepare_request_builder() -> CreateConnection {
88    ///   # panic!();
89    ///   // ... details omitted ...
90    /// }
91    /// ```
92    #[derive(Clone, Debug)]
93    pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
94
95    impl CreateConnection {
96        pub(crate) fn new(
97            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
98        ) -> Self {
99            Self(RequestBuilder::new(stub))
100        }
101
102        /// Sets the full request, replacing any prior values.
103        pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
104            mut self,
105            v: V,
106        ) -> Self {
107            self.0.request = v.into();
108            self
109        }
110
111        /// Sets all the options, replacing any prior values.
112        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113            self.0.options = v.into();
114            self
115        }
116
117        /// Sends the request.
118        ///
119        /// # Long running operations
120        ///
121        /// This starts, but does not poll, a longrunning operation. More information
122        /// on [create_connection][crate::client::RepositoryManager::create_connection].
123        pub async fn send(self) -> Result<longrunning::model::Operation> {
124            (*self.0.stub)
125                .create_connection(self.0.request, self.0.options)
126                .await
127                .map(gax::response::Response::into_body)
128        }
129
130        /// Creates a [Poller][lro::Poller] to work with `create_connection`.
131        pub fn poller(
132            self,
133        ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
134            type Operation =
135                lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
136            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
137            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
138
139            let stub = self.0.stub.clone();
140            let mut options = self.0.options.clone();
141            options.set_retry_policy(gax::retry_policy::NeverRetry);
142            let query = move |name| {
143                let stub = stub.clone();
144                let options = options.clone();
145                async {
146                    let op = GetOperation::new(stub)
147                        .set_name(name)
148                        .with_options(options)
149                        .send()
150                        .await?;
151                    Ok(Operation::new(op))
152                }
153            };
154
155            let start = move || async {
156                let op = self.send().await?;
157                Ok(Operation::new(op))
158            };
159
160            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
161        }
162
163        /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
164        ///
165        /// This is a **required** field for requests.
166        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
167            self.0.request.parent = v.into();
168            self
169        }
170
171        /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
172        ///
173        /// This is a **required** field for requests.
174        pub fn set_connection<T>(mut self, v: T) -> Self
175        where
176            T: std::convert::Into<crate::model::Connection>,
177        {
178            self.0.request.connection = std::option::Option::Some(v.into());
179            self
180        }
181
182        /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
183        ///
184        /// This is a **required** field for requests.
185        pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
186        where
187            T: std::convert::Into<crate::model::Connection>,
188        {
189            self.0.request.connection = v.map(|x| x.into());
190            self
191        }
192
193        /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
194        ///
195        /// This is a **required** field for requests.
196        pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
197            self.0.request.connection_id = v.into();
198            self
199        }
200    }
201
202    #[doc(hidden)]
203    impl gax::options::internal::RequestBuilder for CreateConnection {
204        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
205            &mut self.0.options
206        }
207    }
208
209    /// The request builder for [RepositoryManager::get_connection][crate::client::RepositoryManager::get_connection] calls.
210    ///
211    /// # Example
212    /// ```no_run
213    /// # use google_cloud_build_v2::builder;
214    /// use builder::repository_manager::GetConnection;
215    /// # tokio_test::block_on(async {
216    ///
217    /// let builder = prepare_request_builder();
218    /// let response = builder.send().await?;
219    /// # gax::Result::<()>::Ok(()) });
220    ///
221    /// fn prepare_request_builder() -> GetConnection {
222    ///   # panic!();
223    ///   // ... details omitted ...
224    /// }
225    /// ```
226    #[derive(Clone, Debug)]
227    pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
228
229    impl GetConnection {
230        pub(crate) fn new(
231            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
232        ) -> Self {
233            Self(RequestBuilder::new(stub))
234        }
235
236        /// Sets the full request, replacing any prior values.
237        pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
238            self.0.request = v.into();
239            self
240        }
241
242        /// Sets all the options, replacing any prior values.
243        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
244            self.0.options = v.into();
245            self
246        }
247
248        /// Sends the request.
249        pub async fn send(self) -> Result<crate::model::Connection> {
250            (*self.0.stub)
251                .get_connection(self.0.request, self.0.options)
252                .await
253                .map(gax::response::Response::into_body)
254        }
255
256        /// Sets the value of [name][crate::model::GetConnectionRequest::name].
257        ///
258        /// This is a **required** field for requests.
259        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
260            self.0.request.name = v.into();
261            self
262        }
263    }
264
265    #[doc(hidden)]
266    impl gax::options::internal::RequestBuilder for GetConnection {
267        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
268            &mut self.0.options
269        }
270    }
271
272    /// The request builder for [RepositoryManager::list_connections][crate::client::RepositoryManager::list_connections] calls.
273    ///
274    /// # Example
275    /// ```no_run
276    /// # use google_cloud_build_v2::builder;
277    /// use builder::repository_manager::ListConnections;
278    /// # tokio_test::block_on(async {
279    /// use gax::paginator::ItemPaginator;
280    ///
281    /// let builder = prepare_request_builder();
282    /// let mut items = builder.by_item();
283    /// while let Some(result) = items.next().await {
284    ///   let item = result?;
285    /// }
286    /// # gax::Result::<()>::Ok(()) });
287    ///
288    /// fn prepare_request_builder() -> ListConnections {
289    ///   # panic!();
290    ///   // ... details omitted ...
291    /// }
292    /// ```
293    #[derive(Clone, Debug)]
294    pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
295
296    impl ListConnections {
297        pub(crate) fn new(
298            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
299        ) -> Self {
300            Self(RequestBuilder::new(stub))
301        }
302
303        /// Sets the full request, replacing any prior values.
304        pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
305            self.0.request = v.into();
306            self
307        }
308
309        /// Sets all the options, replacing any prior values.
310        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
311            self.0.options = v.into();
312            self
313        }
314
315        /// Sends the request.
316        pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
317            (*self.0.stub)
318                .list_connections(self.0.request, self.0.options)
319                .await
320                .map(gax::response::Response::into_body)
321        }
322
323        /// Streams each page in the collection.
324        pub fn by_page(
325            self,
326        ) -> impl gax::paginator::Paginator<crate::model::ListConnectionsResponse, gax::error::Error>
327        {
328            use std::clone::Clone;
329            let token = self.0.request.page_token.clone();
330            let execute = move |token: String| {
331                let mut builder = self.clone();
332                builder.0.request = builder.0.request.set_page_token(token);
333                builder.send()
334            };
335            gax::paginator::internal::new_paginator(token, execute)
336        }
337
338        /// Streams each item in the collection.
339        pub fn by_item(
340            self,
341        ) -> impl gax::paginator::ItemPaginator<crate::model::ListConnectionsResponse, gax::error::Error>
342        {
343            use gax::paginator::Paginator;
344            self.by_page().items()
345        }
346
347        /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
348        ///
349        /// This is a **required** field for requests.
350        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
351            self.0.request.parent = v.into();
352            self
353        }
354
355        /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
356        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
357            self.0.request.page_size = v.into();
358            self
359        }
360
361        /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
362        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
363            self.0.request.page_token = v.into();
364            self
365        }
366    }
367
368    #[doc(hidden)]
369    impl gax::options::internal::RequestBuilder for ListConnections {
370        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
371            &mut self.0.options
372        }
373    }
374
375    /// The request builder for [RepositoryManager::update_connection][crate::client::RepositoryManager::update_connection] calls.
376    ///
377    /// # Example
378    /// ```no_run
379    /// # use google_cloud_build_v2::builder;
380    /// use builder::repository_manager::UpdateConnection;
381    /// # tokio_test::block_on(async {
382    /// use lro::Poller;
383    ///
384    /// let builder = prepare_request_builder();
385    /// let response = builder.poller().until_done().await?;
386    /// # gax::Result::<()>::Ok(()) });
387    ///
388    /// fn prepare_request_builder() -> UpdateConnection {
389    ///   # panic!();
390    ///   // ... details omitted ...
391    /// }
392    /// ```
393    #[derive(Clone, Debug)]
394    pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
395
396    impl UpdateConnection {
397        pub(crate) fn new(
398            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
399        ) -> Self {
400            Self(RequestBuilder::new(stub))
401        }
402
403        /// Sets the full request, replacing any prior values.
404        pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
405            mut self,
406            v: V,
407        ) -> Self {
408            self.0.request = v.into();
409            self
410        }
411
412        /// Sets all the options, replacing any prior values.
413        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
414            self.0.options = v.into();
415            self
416        }
417
418        /// Sends the request.
419        ///
420        /// # Long running operations
421        ///
422        /// This starts, but does not poll, a longrunning operation. More information
423        /// on [update_connection][crate::client::RepositoryManager::update_connection].
424        pub async fn send(self) -> Result<longrunning::model::Operation> {
425            (*self.0.stub)
426                .update_connection(self.0.request, self.0.options)
427                .await
428                .map(gax::response::Response::into_body)
429        }
430
431        /// Creates a [Poller][lro::Poller] to work with `update_connection`.
432        pub fn poller(
433            self,
434        ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
435            type Operation =
436                lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
437            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
438            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
439
440            let stub = self.0.stub.clone();
441            let mut options = self.0.options.clone();
442            options.set_retry_policy(gax::retry_policy::NeverRetry);
443            let query = move |name| {
444                let stub = stub.clone();
445                let options = options.clone();
446                async {
447                    let op = GetOperation::new(stub)
448                        .set_name(name)
449                        .with_options(options)
450                        .send()
451                        .await?;
452                    Ok(Operation::new(op))
453                }
454            };
455
456            let start = move || async {
457                let op = self.send().await?;
458                Ok(Operation::new(op))
459            };
460
461            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
462        }
463
464        /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
465        ///
466        /// This is a **required** field for requests.
467        pub fn set_connection<T>(mut self, v: T) -> Self
468        where
469            T: std::convert::Into<crate::model::Connection>,
470        {
471            self.0.request.connection = std::option::Option::Some(v.into());
472            self
473        }
474
475        /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
476        ///
477        /// This is a **required** field for requests.
478        pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
479        where
480            T: std::convert::Into<crate::model::Connection>,
481        {
482            self.0.request.connection = v.map(|x| x.into());
483            self
484        }
485
486        /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
487        pub fn set_update_mask<T>(mut self, v: T) -> Self
488        where
489            T: std::convert::Into<wkt::FieldMask>,
490        {
491            self.0.request.update_mask = std::option::Option::Some(v.into());
492            self
493        }
494
495        /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
496        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
497        where
498            T: std::convert::Into<wkt::FieldMask>,
499        {
500            self.0.request.update_mask = v.map(|x| x.into());
501            self
502        }
503
504        /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
505        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
506            self.0.request.allow_missing = v.into();
507            self
508        }
509
510        /// Sets the value of [etag][crate::model::UpdateConnectionRequest::etag].
511        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
512            self.0.request.etag = v.into();
513            self
514        }
515    }
516
517    #[doc(hidden)]
518    impl gax::options::internal::RequestBuilder for UpdateConnection {
519        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
520            &mut self.0.options
521        }
522    }
523
524    /// The request builder for [RepositoryManager::delete_connection][crate::client::RepositoryManager::delete_connection] calls.
525    ///
526    /// # Example
527    /// ```no_run
528    /// # use google_cloud_build_v2::builder;
529    /// use builder::repository_manager::DeleteConnection;
530    /// # tokio_test::block_on(async {
531    /// use lro::Poller;
532    ///
533    /// let builder = prepare_request_builder();
534    /// let response = builder.poller().until_done().await?;
535    /// # gax::Result::<()>::Ok(()) });
536    ///
537    /// fn prepare_request_builder() -> DeleteConnection {
538    ///   # panic!();
539    ///   // ... details omitted ...
540    /// }
541    /// ```
542    #[derive(Clone, Debug)]
543    pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
544
545    impl DeleteConnection {
546        pub(crate) fn new(
547            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
548        ) -> Self {
549            Self(RequestBuilder::new(stub))
550        }
551
552        /// Sets the full request, replacing any prior values.
553        pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
554            mut self,
555            v: V,
556        ) -> Self {
557            self.0.request = v.into();
558            self
559        }
560
561        /// Sets all the options, replacing any prior values.
562        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
563            self.0.options = v.into();
564            self
565        }
566
567        /// Sends the request.
568        ///
569        /// # Long running operations
570        ///
571        /// This starts, but does not poll, a longrunning operation. More information
572        /// on [delete_connection][crate::client::RepositoryManager::delete_connection].
573        pub async fn send(self) -> Result<longrunning::model::Operation> {
574            (*self.0.stub)
575                .delete_connection(self.0.request, self.0.options)
576                .await
577                .map(gax::response::Response::into_body)
578        }
579
580        /// Creates a [Poller][lro::Poller] to work with `delete_connection`.
581        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
582            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
583            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
584            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
585
586            let stub = self.0.stub.clone();
587            let mut options = self.0.options.clone();
588            options.set_retry_policy(gax::retry_policy::NeverRetry);
589            let query = move |name| {
590                let stub = stub.clone();
591                let options = options.clone();
592                async {
593                    let op = GetOperation::new(stub)
594                        .set_name(name)
595                        .with_options(options)
596                        .send()
597                        .await?;
598                    Ok(Operation::new(op))
599                }
600            };
601
602            let start = move || async {
603                let op = self.send().await?;
604                Ok(Operation::new(op))
605            };
606
607            lro::internal::new_unit_response_poller(
608                polling_error_policy,
609                polling_backoff_policy,
610                start,
611                query,
612            )
613        }
614
615        /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
616        ///
617        /// This is a **required** field for requests.
618        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
619            self.0.request.name = v.into();
620            self
621        }
622
623        /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
624        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
625            self.0.request.etag = v.into();
626            self
627        }
628
629        /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
630        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
631            self.0.request.validate_only = v.into();
632            self
633        }
634    }
635
636    #[doc(hidden)]
637    impl gax::options::internal::RequestBuilder for DeleteConnection {
638        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
639            &mut self.0.options
640        }
641    }
642
643    /// The request builder for [RepositoryManager::create_repository][crate::client::RepositoryManager::create_repository] calls.
644    ///
645    /// # Example
646    /// ```no_run
647    /// # use google_cloud_build_v2::builder;
648    /// use builder::repository_manager::CreateRepository;
649    /// # tokio_test::block_on(async {
650    /// use lro::Poller;
651    ///
652    /// let builder = prepare_request_builder();
653    /// let response = builder.poller().until_done().await?;
654    /// # gax::Result::<()>::Ok(()) });
655    ///
656    /// fn prepare_request_builder() -> CreateRepository {
657    ///   # panic!();
658    ///   // ... details omitted ...
659    /// }
660    /// ```
661    #[derive(Clone, Debug)]
662    pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
663
664    impl CreateRepository {
665        pub(crate) fn new(
666            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
667        ) -> Self {
668            Self(RequestBuilder::new(stub))
669        }
670
671        /// Sets the full request, replacing any prior values.
672        pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
673            mut self,
674            v: V,
675        ) -> Self {
676            self.0.request = v.into();
677            self
678        }
679
680        /// Sets all the options, replacing any prior values.
681        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
682            self.0.options = v.into();
683            self
684        }
685
686        /// Sends the request.
687        ///
688        /// # Long running operations
689        ///
690        /// This starts, but does not poll, a longrunning operation. More information
691        /// on [create_repository][crate::client::RepositoryManager::create_repository].
692        pub async fn send(self) -> Result<longrunning::model::Operation> {
693            (*self.0.stub)
694                .create_repository(self.0.request, self.0.options)
695                .await
696                .map(gax::response::Response::into_body)
697        }
698
699        /// Creates a [Poller][lro::Poller] to work with `create_repository`.
700        pub fn poller(
701            self,
702        ) -> impl lro::Poller<crate::model::Repository, crate::model::OperationMetadata> {
703            type Operation =
704                lro::internal::Operation<crate::model::Repository, crate::model::OperationMetadata>;
705            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
706            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
707
708            let stub = self.0.stub.clone();
709            let mut options = self.0.options.clone();
710            options.set_retry_policy(gax::retry_policy::NeverRetry);
711            let query = move |name| {
712                let stub = stub.clone();
713                let options = options.clone();
714                async {
715                    let op = GetOperation::new(stub)
716                        .set_name(name)
717                        .with_options(options)
718                        .send()
719                        .await?;
720                    Ok(Operation::new(op))
721                }
722            };
723
724            let start = move || async {
725                let op = self.send().await?;
726                Ok(Operation::new(op))
727            };
728
729            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
730        }
731
732        /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
733        ///
734        /// This is a **required** field for requests.
735        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
736            self.0.request.parent = v.into();
737            self
738        }
739
740        /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
741        ///
742        /// This is a **required** field for requests.
743        pub fn set_repository<T>(mut self, v: T) -> Self
744        where
745            T: std::convert::Into<crate::model::Repository>,
746        {
747            self.0.request.repository = std::option::Option::Some(v.into());
748            self
749        }
750
751        /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
752        ///
753        /// This is a **required** field for requests.
754        pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
755        where
756            T: std::convert::Into<crate::model::Repository>,
757        {
758            self.0.request.repository = v.map(|x| x.into());
759            self
760        }
761
762        /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
763        ///
764        /// This is a **required** field for requests.
765        pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
766            self.0.request.repository_id = v.into();
767            self
768        }
769    }
770
771    #[doc(hidden)]
772    impl gax::options::internal::RequestBuilder for CreateRepository {
773        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
774            &mut self.0.options
775        }
776    }
777
778    /// The request builder for [RepositoryManager::batch_create_repositories][crate::client::RepositoryManager::batch_create_repositories] calls.
779    ///
780    /// # Example
781    /// ```no_run
782    /// # use google_cloud_build_v2::builder;
783    /// use builder::repository_manager::BatchCreateRepositories;
784    /// # tokio_test::block_on(async {
785    /// use lro::Poller;
786    ///
787    /// let builder = prepare_request_builder();
788    /// let response = builder.poller().until_done().await?;
789    /// # gax::Result::<()>::Ok(()) });
790    ///
791    /// fn prepare_request_builder() -> BatchCreateRepositories {
792    ///   # panic!();
793    ///   // ... details omitted ...
794    /// }
795    /// ```
796    #[derive(Clone, Debug)]
797    pub struct BatchCreateRepositories(
798        RequestBuilder<crate::model::BatchCreateRepositoriesRequest>,
799    );
800
801    impl BatchCreateRepositories {
802        pub(crate) fn new(
803            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
804        ) -> Self {
805            Self(RequestBuilder::new(stub))
806        }
807
808        /// Sets the full request, replacing any prior values.
809        pub fn with_request<V: Into<crate::model::BatchCreateRepositoriesRequest>>(
810            mut self,
811            v: V,
812        ) -> Self {
813            self.0.request = v.into();
814            self
815        }
816
817        /// Sets all the options, replacing any prior values.
818        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
819            self.0.options = v.into();
820            self
821        }
822
823        /// Sends the request.
824        ///
825        /// # Long running operations
826        ///
827        /// This starts, but does not poll, a longrunning operation. More information
828        /// on [batch_create_repositories][crate::client::RepositoryManager::batch_create_repositories].
829        pub async fn send(self) -> Result<longrunning::model::Operation> {
830            (*self.0.stub)
831                .batch_create_repositories(self.0.request, self.0.options)
832                .await
833                .map(gax::response::Response::into_body)
834        }
835
836        /// Creates a [Poller][lro::Poller] to work with `batch_create_repositories`.
837        pub fn poller(
838            self,
839        ) -> impl lro::Poller<
840            crate::model::BatchCreateRepositoriesResponse,
841            crate::model::OperationMetadata,
842        > {
843            type Operation = lro::internal::Operation<
844                crate::model::BatchCreateRepositoriesResponse,
845                crate::model::OperationMetadata,
846            >;
847            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
848            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
849
850            let stub = self.0.stub.clone();
851            let mut options = self.0.options.clone();
852            options.set_retry_policy(gax::retry_policy::NeverRetry);
853            let query = move |name| {
854                let stub = stub.clone();
855                let options = options.clone();
856                async {
857                    let op = GetOperation::new(stub)
858                        .set_name(name)
859                        .with_options(options)
860                        .send()
861                        .await?;
862                    Ok(Operation::new(op))
863                }
864            };
865
866            let start = move || async {
867                let op = self.send().await?;
868                Ok(Operation::new(op))
869            };
870
871            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
872        }
873
874        /// Sets the value of [parent][crate::model::BatchCreateRepositoriesRequest::parent].
875        ///
876        /// This is a **required** field for requests.
877        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
878            self.0.request.parent = v.into();
879            self
880        }
881
882        /// Sets the value of [requests][crate::model::BatchCreateRepositoriesRequest::requests].
883        ///
884        /// This is a **required** field for requests.
885        pub fn set_requests<T, V>(mut self, v: T) -> Self
886        where
887            T: std::iter::IntoIterator<Item = V>,
888            V: std::convert::Into<crate::model::CreateRepositoryRequest>,
889        {
890            use std::iter::Iterator;
891            self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
892            self
893        }
894    }
895
896    #[doc(hidden)]
897    impl gax::options::internal::RequestBuilder for BatchCreateRepositories {
898        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
899            &mut self.0.options
900        }
901    }
902
903    /// The request builder for [RepositoryManager::get_repository][crate::client::RepositoryManager::get_repository] calls.
904    ///
905    /// # Example
906    /// ```no_run
907    /// # use google_cloud_build_v2::builder;
908    /// use builder::repository_manager::GetRepository;
909    /// # tokio_test::block_on(async {
910    ///
911    /// let builder = prepare_request_builder();
912    /// let response = builder.send().await?;
913    /// # gax::Result::<()>::Ok(()) });
914    ///
915    /// fn prepare_request_builder() -> GetRepository {
916    ///   # panic!();
917    ///   // ... details omitted ...
918    /// }
919    /// ```
920    #[derive(Clone, Debug)]
921    pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
922
923    impl GetRepository {
924        pub(crate) fn new(
925            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
926        ) -> Self {
927            Self(RequestBuilder::new(stub))
928        }
929
930        /// Sets the full request, replacing any prior values.
931        pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
932            self.0.request = v.into();
933            self
934        }
935
936        /// Sets all the options, replacing any prior values.
937        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
938            self.0.options = v.into();
939            self
940        }
941
942        /// Sends the request.
943        pub async fn send(self) -> Result<crate::model::Repository> {
944            (*self.0.stub)
945                .get_repository(self.0.request, self.0.options)
946                .await
947                .map(gax::response::Response::into_body)
948        }
949
950        /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
951        ///
952        /// This is a **required** field for requests.
953        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
954            self.0.request.name = v.into();
955            self
956        }
957    }
958
959    #[doc(hidden)]
960    impl gax::options::internal::RequestBuilder for GetRepository {
961        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
962            &mut self.0.options
963        }
964    }
965
966    /// The request builder for [RepositoryManager::list_repositories][crate::client::RepositoryManager::list_repositories] calls.
967    ///
968    /// # Example
969    /// ```no_run
970    /// # use google_cloud_build_v2::builder;
971    /// use builder::repository_manager::ListRepositories;
972    /// # tokio_test::block_on(async {
973    /// use gax::paginator::ItemPaginator;
974    ///
975    /// let builder = prepare_request_builder();
976    /// let mut items = builder.by_item();
977    /// while let Some(result) = items.next().await {
978    ///   let item = result?;
979    /// }
980    /// # gax::Result::<()>::Ok(()) });
981    ///
982    /// fn prepare_request_builder() -> ListRepositories {
983    ///   # panic!();
984    ///   // ... details omitted ...
985    /// }
986    /// ```
987    #[derive(Clone, Debug)]
988    pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
989
990    impl ListRepositories {
991        pub(crate) fn new(
992            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
993        ) -> Self {
994            Self(RequestBuilder::new(stub))
995        }
996
997        /// Sets the full request, replacing any prior values.
998        pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
999            mut self,
1000            v: V,
1001        ) -> Self {
1002            self.0.request = v.into();
1003            self
1004        }
1005
1006        /// Sets all the options, replacing any prior values.
1007        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1008            self.0.options = v.into();
1009            self
1010        }
1011
1012        /// Sends the request.
1013        pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
1014            (*self.0.stub)
1015                .list_repositories(self.0.request, self.0.options)
1016                .await
1017                .map(gax::response::Response::into_body)
1018        }
1019
1020        /// Streams each page in the collection.
1021        pub fn by_page(
1022            self,
1023        ) -> impl gax::paginator::Paginator<crate::model::ListRepositoriesResponse, gax::error::Error>
1024        {
1025            use std::clone::Clone;
1026            let token = self.0.request.page_token.clone();
1027            let execute = move |token: String| {
1028                let mut builder = self.clone();
1029                builder.0.request = builder.0.request.set_page_token(token);
1030                builder.send()
1031            };
1032            gax::paginator::internal::new_paginator(token, execute)
1033        }
1034
1035        /// Streams each item in the collection.
1036        pub fn by_item(
1037            self,
1038        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRepositoriesResponse, gax::error::Error>
1039        {
1040            use gax::paginator::Paginator;
1041            self.by_page().items()
1042        }
1043
1044        /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
1045        ///
1046        /// This is a **required** field for requests.
1047        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1048            self.0.request.parent = v.into();
1049            self
1050        }
1051
1052        /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
1053        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1054            self.0.request.page_size = v.into();
1055            self
1056        }
1057
1058        /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
1059        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1060            self.0.request.page_token = v.into();
1061            self
1062        }
1063
1064        /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
1065        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1066            self.0.request.filter = v.into();
1067            self
1068        }
1069    }
1070
1071    #[doc(hidden)]
1072    impl gax::options::internal::RequestBuilder for ListRepositories {
1073        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1074            &mut self.0.options
1075        }
1076    }
1077
1078    /// The request builder for [RepositoryManager::delete_repository][crate::client::RepositoryManager::delete_repository] calls.
1079    ///
1080    /// # Example
1081    /// ```no_run
1082    /// # use google_cloud_build_v2::builder;
1083    /// use builder::repository_manager::DeleteRepository;
1084    /// # tokio_test::block_on(async {
1085    /// use lro::Poller;
1086    ///
1087    /// let builder = prepare_request_builder();
1088    /// let response = builder.poller().until_done().await?;
1089    /// # gax::Result::<()>::Ok(()) });
1090    ///
1091    /// fn prepare_request_builder() -> DeleteRepository {
1092    ///   # panic!();
1093    ///   // ... details omitted ...
1094    /// }
1095    /// ```
1096    #[derive(Clone, Debug)]
1097    pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
1098
1099    impl DeleteRepository {
1100        pub(crate) fn new(
1101            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1102        ) -> Self {
1103            Self(RequestBuilder::new(stub))
1104        }
1105
1106        /// Sets the full request, replacing any prior values.
1107        pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
1108            mut self,
1109            v: V,
1110        ) -> Self {
1111            self.0.request = v.into();
1112            self
1113        }
1114
1115        /// Sets all the options, replacing any prior values.
1116        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1117            self.0.options = v.into();
1118            self
1119        }
1120
1121        /// Sends the request.
1122        ///
1123        /// # Long running operations
1124        ///
1125        /// This starts, but does not poll, a longrunning operation. More information
1126        /// on [delete_repository][crate::client::RepositoryManager::delete_repository].
1127        pub async fn send(self) -> Result<longrunning::model::Operation> {
1128            (*self.0.stub)
1129                .delete_repository(self.0.request, self.0.options)
1130                .await
1131                .map(gax::response::Response::into_body)
1132        }
1133
1134        /// Creates a [Poller][lro::Poller] to work with `delete_repository`.
1135        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1136            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1137            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1138            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1139
1140            let stub = self.0.stub.clone();
1141            let mut options = self.0.options.clone();
1142            options.set_retry_policy(gax::retry_policy::NeverRetry);
1143            let query = move |name| {
1144                let stub = stub.clone();
1145                let options = options.clone();
1146                async {
1147                    let op = GetOperation::new(stub)
1148                        .set_name(name)
1149                        .with_options(options)
1150                        .send()
1151                        .await?;
1152                    Ok(Operation::new(op))
1153                }
1154            };
1155
1156            let start = move || async {
1157                let op = self.send().await?;
1158                Ok(Operation::new(op))
1159            };
1160
1161            lro::internal::new_unit_response_poller(
1162                polling_error_policy,
1163                polling_backoff_policy,
1164                start,
1165                query,
1166            )
1167        }
1168
1169        /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
1170        ///
1171        /// This is a **required** field for requests.
1172        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1173            self.0.request.name = v.into();
1174            self
1175        }
1176
1177        /// Sets the value of [etag][crate::model::DeleteRepositoryRequest::etag].
1178        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1179            self.0.request.etag = v.into();
1180            self
1181        }
1182
1183        /// Sets the value of [validate_only][crate::model::DeleteRepositoryRequest::validate_only].
1184        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1185            self.0.request.validate_only = v.into();
1186            self
1187        }
1188    }
1189
1190    #[doc(hidden)]
1191    impl gax::options::internal::RequestBuilder for DeleteRepository {
1192        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1193            &mut self.0.options
1194        }
1195    }
1196
1197    /// The request builder for [RepositoryManager::fetch_read_write_token][crate::client::RepositoryManager::fetch_read_write_token] calls.
1198    ///
1199    /// # Example
1200    /// ```no_run
1201    /// # use google_cloud_build_v2::builder;
1202    /// use builder::repository_manager::FetchReadWriteToken;
1203    /// # tokio_test::block_on(async {
1204    ///
1205    /// let builder = prepare_request_builder();
1206    /// let response = builder.send().await?;
1207    /// # gax::Result::<()>::Ok(()) });
1208    ///
1209    /// fn prepare_request_builder() -> FetchReadWriteToken {
1210    ///   # panic!();
1211    ///   // ... details omitted ...
1212    /// }
1213    /// ```
1214    #[derive(Clone, Debug)]
1215    pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
1216
1217    impl FetchReadWriteToken {
1218        pub(crate) fn new(
1219            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1220        ) -> Self {
1221            Self(RequestBuilder::new(stub))
1222        }
1223
1224        /// Sets the full request, replacing any prior values.
1225        pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
1226            mut self,
1227            v: V,
1228        ) -> Self {
1229            self.0.request = v.into();
1230            self
1231        }
1232
1233        /// Sets all the options, replacing any prior values.
1234        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1235            self.0.options = v.into();
1236            self
1237        }
1238
1239        /// Sends the request.
1240        pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
1241            (*self.0.stub)
1242                .fetch_read_write_token(self.0.request, self.0.options)
1243                .await
1244                .map(gax::response::Response::into_body)
1245        }
1246
1247        /// Sets the value of [repository][crate::model::FetchReadWriteTokenRequest::repository].
1248        ///
1249        /// This is a **required** field for requests.
1250        pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1251            self.0.request.repository = v.into();
1252            self
1253        }
1254    }
1255
1256    #[doc(hidden)]
1257    impl gax::options::internal::RequestBuilder for FetchReadWriteToken {
1258        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1259            &mut self.0.options
1260        }
1261    }
1262
1263    /// The request builder for [RepositoryManager::fetch_read_token][crate::client::RepositoryManager::fetch_read_token] calls.
1264    ///
1265    /// # Example
1266    /// ```no_run
1267    /// # use google_cloud_build_v2::builder;
1268    /// use builder::repository_manager::FetchReadToken;
1269    /// # tokio_test::block_on(async {
1270    ///
1271    /// let builder = prepare_request_builder();
1272    /// let response = builder.send().await?;
1273    /// # gax::Result::<()>::Ok(()) });
1274    ///
1275    /// fn prepare_request_builder() -> FetchReadToken {
1276    ///   # panic!();
1277    ///   // ... details omitted ...
1278    /// }
1279    /// ```
1280    #[derive(Clone, Debug)]
1281    pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
1282
1283    impl FetchReadToken {
1284        pub(crate) fn new(
1285            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1286        ) -> Self {
1287            Self(RequestBuilder::new(stub))
1288        }
1289
1290        /// Sets the full request, replacing any prior values.
1291        pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
1292            self.0.request = v.into();
1293            self
1294        }
1295
1296        /// Sets all the options, replacing any prior values.
1297        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1298            self.0.options = v.into();
1299            self
1300        }
1301
1302        /// Sends the request.
1303        pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
1304            (*self.0.stub)
1305                .fetch_read_token(self.0.request, self.0.options)
1306                .await
1307                .map(gax::response::Response::into_body)
1308        }
1309
1310        /// Sets the value of [repository][crate::model::FetchReadTokenRequest::repository].
1311        ///
1312        /// This is a **required** field for requests.
1313        pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1314            self.0.request.repository = v.into();
1315            self
1316        }
1317    }
1318
1319    #[doc(hidden)]
1320    impl gax::options::internal::RequestBuilder for FetchReadToken {
1321        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1322            &mut self.0.options
1323        }
1324    }
1325
1326    /// The request builder for [RepositoryManager::fetch_linkable_repositories][crate::client::RepositoryManager::fetch_linkable_repositories] calls.
1327    ///
1328    /// # Example
1329    /// ```no_run
1330    /// # use google_cloud_build_v2::builder;
1331    /// use builder::repository_manager::FetchLinkableRepositories;
1332    /// # tokio_test::block_on(async {
1333    /// use gax::paginator::ItemPaginator;
1334    ///
1335    /// let builder = prepare_request_builder();
1336    /// let mut items = builder.by_item();
1337    /// while let Some(result) = items.next().await {
1338    ///   let item = result?;
1339    /// }
1340    /// # gax::Result::<()>::Ok(()) });
1341    ///
1342    /// fn prepare_request_builder() -> FetchLinkableRepositories {
1343    ///   # panic!();
1344    ///   // ... details omitted ...
1345    /// }
1346    /// ```
1347    #[derive(Clone, Debug)]
1348    pub struct FetchLinkableRepositories(
1349        RequestBuilder<crate::model::FetchLinkableRepositoriesRequest>,
1350    );
1351
1352    impl FetchLinkableRepositories {
1353        pub(crate) fn new(
1354            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1355        ) -> Self {
1356            Self(RequestBuilder::new(stub))
1357        }
1358
1359        /// Sets the full request, replacing any prior values.
1360        pub fn with_request<V: Into<crate::model::FetchLinkableRepositoriesRequest>>(
1361            mut self,
1362            v: V,
1363        ) -> Self {
1364            self.0.request = v.into();
1365            self
1366        }
1367
1368        /// Sets all the options, replacing any prior values.
1369        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1370            self.0.options = v.into();
1371            self
1372        }
1373
1374        /// Sends the request.
1375        pub async fn send(self) -> Result<crate::model::FetchLinkableRepositoriesResponse> {
1376            (*self.0.stub)
1377                .fetch_linkable_repositories(self.0.request, self.0.options)
1378                .await
1379                .map(gax::response::Response::into_body)
1380        }
1381
1382        /// Streams each page in the collection.
1383        pub fn by_page(
1384            self,
1385        ) -> impl gax::paginator::Paginator<
1386            crate::model::FetchLinkableRepositoriesResponse,
1387            gax::error::Error,
1388        > {
1389            use std::clone::Clone;
1390            let token = self.0.request.page_token.clone();
1391            let execute = move |token: String| {
1392                let mut builder = self.clone();
1393                builder.0.request = builder.0.request.set_page_token(token);
1394                builder.send()
1395            };
1396            gax::paginator::internal::new_paginator(token, execute)
1397        }
1398
1399        /// Streams each item in the collection.
1400        pub fn by_item(
1401            self,
1402        ) -> impl gax::paginator::ItemPaginator<
1403            crate::model::FetchLinkableRepositoriesResponse,
1404            gax::error::Error,
1405        > {
1406            use gax::paginator::Paginator;
1407            self.by_page().items()
1408        }
1409
1410        /// Sets the value of [connection][crate::model::FetchLinkableRepositoriesRequest::connection].
1411        ///
1412        /// This is a **required** field for requests.
1413        pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1414            self.0.request.connection = v.into();
1415            self
1416        }
1417
1418        /// Sets the value of [page_size][crate::model::FetchLinkableRepositoriesRequest::page_size].
1419        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1420            self.0.request.page_size = v.into();
1421            self
1422        }
1423
1424        /// Sets the value of [page_token][crate::model::FetchLinkableRepositoriesRequest::page_token].
1425        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1426            self.0.request.page_token = v.into();
1427            self
1428        }
1429    }
1430
1431    #[doc(hidden)]
1432    impl gax::options::internal::RequestBuilder for FetchLinkableRepositories {
1433        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1434            &mut self.0.options
1435        }
1436    }
1437
1438    /// The request builder for [RepositoryManager::fetch_git_refs][crate::client::RepositoryManager::fetch_git_refs] calls.
1439    ///
1440    /// # Example
1441    /// ```no_run
1442    /// # use google_cloud_build_v2::builder;
1443    /// use builder::repository_manager::FetchGitRefs;
1444    /// # tokio_test::block_on(async {
1445    ///
1446    /// let builder = prepare_request_builder();
1447    /// let response = builder.send().await?;
1448    /// # gax::Result::<()>::Ok(()) });
1449    ///
1450    /// fn prepare_request_builder() -> FetchGitRefs {
1451    ///   # panic!();
1452    ///   // ... details omitted ...
1453    /// }
1454    /// ```
1455    #[derive(Clone, Debug)]
1456    pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1457
1458    impl FetchGitRefs {
1459        pub(crate) fn new(
1460            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1461        ) -> Self {
1462            Self(RequestBuilder::new(stub))
1463        }
1464
1465        /// Sets the full request, replacing any prior values.
1466        pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1467            self.0.request = v.into();
1468            self
1469        }
1470
1471        /// Sets all the options, replacing any prior values.
1472        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1473            self.0.options = v.into();
1474            self
1475        }
1476
1477        /// Sends the request.
1478        pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1479            (*self.0.stub)
1480                .fetch_git_refs(self.0.request, self.0.options)
1481                .await
1482                .map(gax::response::Response::into_body)
1483        }
1484
1485        /// Sets the value of [repository][crate::model::FetchGitRefsRequest::repository].
1486        ///
1487        /// This is a **required** field for requests.
1488        pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
1489            self.0.request.repository = v.into();
1490            self
1491        }
1492
1493        /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
1494        pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1495            mut self,
1496            v: T,
1497        ) -> Self {
1498            self.0.request.ref_type = v.into();
1499            self
1500        }
1501    }
1502
1503    #[doc(hidden)]
1504    impl gax::options::internal::RequestBuilder for FetchGitRefs {
1505        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1506            &mut self.0.options
1507        }
1508    }
1509
1510    /// The request builder for [RepositoryManager::set_iam_policy][crate::client::RepositoryManager::set_iam_policy] calls.
1511    ///
1512    /// # Example
1513    /// ```no_run
1514    /// # use google_cloud_build_v2::builder;
1515    /// use builder::repository_manager::SetIamPolicy;
1516    /// # tokio_test::block_on(async {
1517    ///
1518    /// let builder = prepare_request_builder();
1519    /// let response = builder.send().await?;
1520    /// # gax::Result::<()>::Ok(()) });
1521    ///
1522    /// fn prepare_request_builder() -> SetIamPolicy {
1523    ///   # panic!();
1524    ///   // ... details omitted ...
1525    /// }
1526    /// ```
1527    #[derive(Clone, Debug)]
1528    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1529
1530    impl SetIamPolicy {
1531        pub(crate) fn new(
1532            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1533        ) -> Self {
1534            Self(RequestBuilder::new(stub))
1535        }
1536
1537        /// Sets the full request, replacing any prior values.
1538        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1539            self.0.request = v.into();
1540            self
1541        }
1542
1543        /// Sets all the options, replacing any prior values.
1544        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1545            self.0.options = v.into();
1546            self
1547        }
1548
1549        /// Sends the request.
1550        pub async fn send(self) -> Result<iam_v1::model::Policy> {
1551            (*self.0.stub)
1552                .set_iam_policy(self.0.request, self.0.options)
1553                .await
1554                .map(gax::response::Response::into_body)
1555        }
1556
1557        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
1558        ///
1559        /// This is a **required** field for requests.
1560        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1561            self.0.request.resource = v.into();
1562            self
1563        }
1564
1565        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
1566        ///
1567        /// This is a **required** field for requests.
1568        pub fn set_policy<T>(mut self, v: T) -> Self
1569        where
1570            T: std::convert::Into<iam_v1::model::Policy>,
1571        {
1572            self.0.request.policy = std::option::Option::Some(v.into());
1573            self
1574        }
1575
1576        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
1577        ///
1578        /// This is a **required** field for requests.
1579        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1580        where
1581            T: std::convert::Into<iam_v1::model::Policy>,
1582        {
1583            self.0.request.policy = v.map(|x| x.into());
1584            self
1585        }
1586
1587        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
1588        pub fn set_update_mask<T>(mut self, v: T) -> Self
1589        where
1590            T: std::convert::Into<wkt::FieldMask>,
1591        {
1592            self.0.request.update_mask = std::option::Option::Some(v.into());
1593            self
1594        }
1595
1596        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
1597        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1598        where
1599            T: std::convert::Into<wkt::FieldMask>,
1600        {
1601            self.0.request.update_mask = v.map(|x| x.into());
1602            self
1603        }
1604    }
1605
1606    #[doc(hidden)]
1607    impl gax::options::internal::RequestBuilder for SetIamPolicy {
1608        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1609            &mut self.0.options
1610        }
1611    }
1612
1613    /// The request builder for [RepositoryManager::get_iam_policy][crate::client::RepositoryManager::get_iam_policy] calls.
1614    ///
1615    /// # Example
1616    /// ```no_run
1617    /// # use google_cloud_build_v2::builder;
1618    /// use builder::repository_manager::GetIamPolicy;
1619    /// # tokio_test::block_on(async {
1620    ///
1621    /// let builder = prepare_request_builder();
1622    /// let response = builder.send().await?;
1623    /// # gax::Result::<()>::Ok(()) });
1624    ///
1625    /// fn prepare_request_builder() -> GetIamPolicy {
1626    ///   # panic!();
1627    ///   // ... details omitted ...
1628    /// }
1629    /// ```
1630    #[derive(Clone, Debug)]
1631    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1632
1633    impl GetIamPolicy {
1634        pub(crate) fn new(
1635            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1636        ) -> Self {
1637            Self(RequestBuilder::new(stub))
1638        }
1639
1640        /// Sets the full request, replacing any prior values.
1641        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1642            self.0.request = v.into();
1643            self
1644        }
1645
1646        /// Sets all the options, replacing any prior values.
1647        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1648            self.0.options = v.into();
1649            self
1650        }
1651
1652        /// Sends the request.
1653        pub async fn send(self) -> Result<iam_v1::model::Policy> {
1654            (*self.0.stub)
1655                .get_iam_policy(self.0.request, self.0.options)
1656                .await
1657                .map(gax::response::Response::into_body)
1658        }
1659
1660        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
1661        ///
1662        /// This is a **required** field for requests.
1663        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1664            self.0.request.resource = v.into();
1665            self
1666        }
1667
1668        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
1669        pub fn set_options<T>(mut self, v: T) -> Self
1670        where
1671            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1672        {
1673            self.0.request.options = std::option::Option::Some(v.into());
1674            self
1675        }
1676
1677        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
1678        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1679        where
1680            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1681        {
1682            self.0.request.options = v.map(|x| x.into());
1683            self
1684        }
1685    }
1686
1687    #[doc(hidden)]
1688    impl gax::options::internal::RequestBuilder for GetIamPolicy {
1689        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1690            &mut self.0.options
1691        }
1692    }
1693
1694    /// The request builder for [RepositoryManager::test_iam_permissions][crate::client::RepositoryManager::test_iam_permissions] calls.
1695    ///
1696    /// # Example
1697    /// ```no_run
1698    /// # use google_cloud_build_v2::builder;
1699    /// use builder::repository_manager::TestIamPermissions;
1700    /// # tokio_test::block_on(async {
1701    ///
1702    /// let builder = prepare_request_builder();
1703    /// let response = builder.send().await?;
1704    /// # gax::Result::<()>::Ok(()) });
1705    ///
1706    /// fn prepare_request_builder() -> TestIamPermissions {
1707    ///   # panic!();
1708    ///   // ... details omitted ...
1709    /// }
1710    /// ```
1711    #[derive(Clone, Debug)]
1712    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1713
1714    impl TestIamPermissions {
1715        pub(crate) fn new(
1716            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1717        ) -> Self {
1718            Self(RequestBuilder::new(stub))
1719        }
1720
1721        /// Sets the full request, replacing any prior values.
1722        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1723            mut self,
1724            v: V,
1725        ) -> Self {
1726            self.0.request = v.into();
1727            self
1728        }
1729
1730        /// Sets all the options, replacing any prior values.
1731        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1732            self.0.options = v.into();
1733            self
1734        }
1735
1736        /// Sends the request.
1737        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1738            (*self.0.stub)
1739                .test_iam_permissions(self.0.request, self.0.options)
1740                .await
1741                .map(gax::response::Response::into_body)
1742        }
1743
1744        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
1745        ///
1746        /// This is a **required** field for requests.
1747        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1748            self.0.request.resource = v.into();
1749            self
1750        }
1751
1752        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
1753        ///
1754        /// This is a **required** field for requests.
1755        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1756        where
1757            T: std::iter::IntoIterator<Item = V>,
1758            V: std::convert::Into<std::string::String>,
1759        {
1760            use std::iter::Iterator;
1761            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1762            self
1763        }
1764    }
1765
1766    #[doc(hidden)]
1767    impl gax::options::internal::RequestBuilder for TestIamPermissions {
1768        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1769            &mut self.0.options
1770        }
1771    }
1772
1773    /// The request builder for [RepositoryManager::get_operation][crate::client::RepositoryManager::get_operation] calls.
1774    ///
1775    /// # Example
1776    /// ```no_run
1777    /// # use google_cloud_build_v2::builder;
1778    /// use builder::repository_manager::GetOperation;
1779    /// # tokio_test::block_on(async {
1780    ///
1781    /// let builder = prepare_request_builder();
1782    /// let response = builder.send().await?;
1783    /// # gax::Result::<()>::Ok(()) });
1784    ///
1785    /// fn prepare_request_builder() -> GetOperation {
1786    ///   # panic!();
1787    ///   // ... details omitted ...
1788    /// }
1789    /// ```
1790    #[derive(Clone, Debug)]
1791    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1792
1793    impl GetOperation {
1794        pub(crate) fn new(
1795            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1796        ) -> Self {
1797            Self(RequestBuilder::new(stub))
1798        }
1799
1800        /// Sets the full request, replacing any prior values.
1801        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1802            mut self,
1803            v: V,
1804        ) -> Self {
1805            self.0.request = v.into();
1806            self
1807        }
1808
1809        /// Sets all the options, replacing any prior values.
1810        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1811            self.0.options = v.into();
1812            self
1813        }
1814
1815        /// Sends the request.
1816        pub async fn send(self) -> Result<longrunning::model::Operation> {
1817            (*self.0.stub)
1818                .get_operation(self.0.request, self.0.options)
1819                .await
1820                .map(gax::response::Response::into_body)
1821        }
1822
1823        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1824        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1825            self.0.request.name = v.into();
1826            self
1827        }
1828    }
1829
1830    #[doc(hidden)]
1831    impl gax::options::internal::RequestBuilder for GetOperation {
1832        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1833            &mut self.0.options
1834        }
1835    }
1836
1837    /// The request builder for [RepositoryManager::cancel_operation][crate::client::RepositoryManager::cancel_operation] calls.
1838    ///
1839    /// # Example
1840    /// ```no_run
1841    /// # use google_cloud_build_v2::builder;
1842    /// use builder::repository_manager::CancelOperation;
1843    /// # tokio_test::block_on(async {
1844    ///
1845    /// let builder = prepare_request_builder();
1846    /// let response = builder.send().await?;
1847    /// # gax::Result::<()>::Ok(()) });
1848    ///
1849    /// fn prepare_request_builder() -> CancelOperation {
1850    ///   # panic!();
1851    ///   // ... details omitted ...
1852    /// }
1853    /// ```
1854    #[derive(Clone, Debug)]
1855    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1856
1857    impl CancelOperation {
1858        pub(crate) fn new(
1859            stub: std::sync::Arc<dyn super::super::stub::dynamic::RepositoryManager>,
1860        ) -> Self {
1861            Self(RequestBuilder::new(stub))
1862        }
1863
1864        /// Sets the full request, replacing any prior values.
1865        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1866            mut self,
1867            v: V,
1868        ) -> Self {
1869            self.0.request = v.into();
1870            self
1871        }
1872
1873        /// Sets all the options, replacing any prior values.
1874        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1875            self.0.options = v.into();
1876            self
1877        }
1878
1879        /// Sends the request.
1880        pub async fn send(self) -> Result<()> {
1881            (*self.0.stub)
1882                .cancel_operation(self.0.request, self.0.options)
1883                .await
1884                .map(gax::response::Response::into_body)
1885        }
1886
1887        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
1888        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1889            self.0.request.name = v.into();
1890            self
1891        }
1892    }
1893
1894    #[doc(hidden)]
1895    impl gax::options::internal::RequestBuilder for CancelOperation {
1896        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1897            &mut self.0.options
1898        }
1899    }
1900}