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