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