Skip to main content

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