Skip to main content

google_cloud_securesourcemanager_v1/
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 [SecureSourceManager][crate::client::SecureSourceManager].
18pub mod secure_source_manager {
19    use crate::Result;
20
21    /// A builder for [SecureSourceManager][crate::client::SecureSourceManager].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_securesourcemanager_v1::*;
26    /// # use builder::secure_source_manager::ClientBuilder;
27    /// # use client::SecureSourceManager;
28    /// let builder : ClientBuilder = SecureSourceManager::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://securesourcemanager.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::SecureSourceManager;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = SecureSourceManager;
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::SecureSourceManager] 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::SecureSourceManager>,
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::SecureSourceManager>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [SecureSourceManager::list_instances][crate::client::SecureSourceManager::list_instances] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ListInstances;
79    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
80    /// use google_cloud_gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListInstances {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
96
97    impl ListInstances {
98        pub(crate) fn new(
99            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
100        ) -> Self {
101            Self(RequestBuilder::new(stub))
102        }
103
104        /// Sets the full request, replacing any prior values.
105        pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> 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        pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
118            (*self.0.stub)
119                .list_instances(self.0.request, self.0.options)
120                .await
121                .map(crate::Response::into_body)
122        }
123
124        /// Streams each page in the collection.
125        pub fn by_page(
126            self,
127        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
128        {
129            use std::clone::Clone;
130            let token = self.0.request.page_token.clone();
131            let execute = move |token: String| {
132                let mut builder = self.clone();
133                builder.0.request = builder.0.request.set_page_token(token);
134                builder.send()
135            };
136            google_cloud_gax::paginator::internal::new_paginator(token, execute)
137        }
138
139        /// Streams each item in the collection.
140        pub fn by_item(
141            self,
142        ) -> impl google_cloud_gax::paginator::ItemPaginator<
143            crate::model::ListInstancesResponse,
144            crate::Error,
145        > {
146            use google_cloud_gax::paginator::Paginator;
147            self.by_page().items()
148        }
149
150        /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
151        ///
152        /// This is a **required** field for requests.
153        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
154            self.0.request.parent = v.into();
155            self
156        }
157
158        /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
159        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
160            self.0.request.page_size = v.into();
161            self
162        }
163
164        /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
165        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
166            self.0.request.page_token = v.into();
167            self
168        }
169
170        /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
171        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
172            self.0.request.filter = v.into();
173            self
174        }
175
176        /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
177        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
178            self.0.request.order_by = v.into();
179            self
180        }
181    }
182
183    #[doc(hidden)]
184    impl crate::RequestBuilder for ListInstances {
185        fn request_options(&mut self) -> &mut crate::RequestOptions {
186            &mut self.0.options
187        }
188    }
189
190    /// The request builder for [SecureSourceManager::get_instance][crate::client::SecureSourceManager::get_instance] calls.
191    ///
192    /// # Example
193    /// ```
194    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetInstance;
195    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
196    ///
197    /// let builder = prepare_request_builder();
198    /// let response = builder.send().await?;
199    /// # Ok(()) }
200    ///
201    /// fn prepare_request_builder() -> GetInstance {
202    ///   # panic!();
203    ///   // ... details omitted ...
204    /// }
205    /// ```
206    #[derive(Clone, Debug)]
207    pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
208
209    impl GetInstance {
210        pub(crate) fn new(
211            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
212        ) -> Self {
213            Self(RequestBuilder::new(stub))
214        }
215
216        /// Sets the full request, replacing any prior values.
217        pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
218            self.0.request = v.into();
219            self
220        }
221
222        /// Sets all the options, replacing any prior values.
223        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
224            self.0.options = v.into();
225            self
226        }
227
228        /// Sends the request.
229        pub async fn send(self) -> Result<crate::model::Instance> {
230            (*self.0.stub)
231                .get_instance(self.0.request, self.0.options)
232                .await
233                .map(crate::Response::into_body)
234        }
235
236        /// Sets the value of [name][crate::model::GetInstanceRequest::name].
237        ///
238        /// This is a **required** field for requests.
239        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240            self.0.request.name = v.into();
241            self
242        }
243    }
244
245    #[doc(hidden)]
246    impl crate::RequestBuilder for GetInstance {
247        fn request_options(&mut self) -> &mut crate::RequestOptions {
248            &mut self.0.options
249        }
250    }
251
252    /// The request builder for [SecureSourceManager::create_instance][crate::client::SecureSourceManager::create_instance] calls.
253    ///
254    /// # Example
255    /// ```
256    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::CreateInstance;
257    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
258    /// use google_cloud_lro::Poller;
259    ///
260    /// let builder = prepare_request_builder();
261    /// let response = builder.poller().until_done().await?;
262    /// # Ok(()) }
263    ///
264    /// fn prepare_request_builder() -> CreateInstance {
265    ///   # panic!();
266    ///   // ... details omitted ...
267    /// }
268    /// ```
269    #[derive(Clone, Debug)]
270    pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
271
272    impl CreateInstance {
273        pub(crate) fn new(
274            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
275        ) -> Self {
276            Self(RequestBuilder::new(stub))
277        }
278
279        /// Sets the full request, replacing any prior values.
280        pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
281            self.0.request = v.into();
282            self
283        }
284
285        /// Sets all the options, replacing any prior values.
286        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
287            self.0.options = v.into();
288            self
289        }
290
291        /// Sends the request.
292        ///
293        /// # Long running operations
294        ///
295        /// This starts, but does not poll, a longrunning operation. More information
296        /// on [create_instance][crate::client::SecureSourceManager::create_instance].
297        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
298            (*self.0.stub)
299                .create_instance(self.0.request, self.0.options)
300                .await
301                .map(crate::Response::into_body)
302        }
303
304        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_instance`.
305        pub fn poller(
306            self,
307        ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
308        {
309            type Operation = google_cloud_lro::internal::Operation<
310                crate::model::Instance,
311                crate::model::OperationMetadata,
312            >;
313            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
314            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
315            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
316            if let Some(ref mut details) = poller_options.tracing {
317                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::create_instance::until_done";
318            }
319
320            let stub = self.0.stub.clone();
321            let mut options = self.0.options.clone();
322            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
323            let query = move |name| {
324                let stub = stub.clone();
325                let options = options.clone();
326                async {
327                    let op = GetOperation::new(stub)
328                        .set_name(name)
329                        .with_options(options)
330                        .send()
331                        .await?;
332                    Ok(Operation::new(op))
333                }
334            };
335
336            let start = move || async {
337                let op = self.send().await?;
338                Ok(Operation::new(op))
339            };
340
341            use google_cloud_lro::internal::PollerExt;
342            {
343                google_cloud_lro::internal::new_poller(
344                    polling_error_policy,
345                    polling_backoff_policy,
346                    start,
347                    query,
348                )
349            }
350            .with_options(poller_options)
351        }
352
353        /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
354        ///
355        /// This is a **required** field for requests.
356        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
357            self.0.request.parent = v.into();
358            self
359        }
360
361        /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
362        ///
363        /// This is a **required** field for requests.
364        pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
365            self.0.request.instance_id = v.into();
366            self
367        }
368
369        /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
370        ///
371        /// This is a **required** field for requests.
372        pub fn set_instance<T>(mut self, v: T) -> Self
373        where
374            T: std::convert::Into<crate::model::Instance>,
375        {
376            self.0.request.instance = std::option::Option::Some(v.into());
377            self
378        }
379
380        /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
381        ///
382        /// This is a **required** field for requests.
383        pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
384        where
385            T: std::convert::Into<crate::model::Instance>,
386        {
387            self.0.request.instance = v.map(|x| x.into());
388            self
389        }
390
391        /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
392        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
393            self.0.request.request_id = v.into();
394            self
395        }
396    }
397
398    #[doc(hidden)]
399    impl crate::RequestBuilder for CreateInstance {
400        fn request_options(&mut self) -> &mut crate::RequestOptions {
401            &mut self.0.options
402        }
403    }
404
405    /// The request builder for [SecureSourceManager::delete_instance][crate::client::SecureSourceManager::delete_instance] calls.
406    ///
407    /// # Example
408    /// ```
409    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::DeleteInstance;
410    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
411    /// use google_cloud_lro::Poller;
412    ///
413    /// let builder = prepare_request_builder();
414    /// let response = builder.poller().until_done().await?;
415    /// # Ok(()) }
416    ///
417    /// fn prepare_request_builder() -> DeleteInstance {
418    ///   # panic!();
419    ///   // ... details omitted ...
420    /// }
421    /// ```
422    #[derive(Clone, Debug)]
423    pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
424
425    impl DeleteInstance {
426        pub(crate) fn new(
427            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
428        ) -> Self {
429            Self(RequestBuilder::new(stub))
430        }
431
432        /// Sets the full request, replacing any prior values.
433        pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
434            self.0.request = v.into();
435            self
436        }
437
438        /// Sets all the options, replacing any prior values.
439        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
440            self.0.options = v.into();
441            self
442        }
443
444        /// Sends the request.
445        ///
446        /// # Long running operations
447        ///
448        /// This starts, but does not poll, a longrunning operation. More information
449        /// on [delete_instance][crate::client::SecureSourceManager::delete_instance].
450        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
451            (*self.0.stub)
452                .delete_instance(self.0.request, self.0.options)
453                .await
454                .map(crate::Response::into_body)
455        }
456
457        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_instance`.
458        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
459            type Operation =
460                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
461            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
462            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
463            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
464            if let Some(ref mut details) = poller_options.tracing {
465                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::delete_instance::until_done";
466            }
467
468            let stub = self.0.stub.clone();
469            let mut options = self.0.options.clone();
470            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
471            let query = move |name| {
472                let stub = stub.clone();
473                let options = options.clone();
474                async {
475                    let op = GetOperation::new(stub)
476                        .set_name(name)
477                        .with_options(options)
478                        .send()
479                        .await?;
480                    Ok(Operation::new(op))
481                }
482            };
483
484            let start = move || async {
485                let op = self.send().await?;
486                Ok(Operation::new(op))
487            };
488
489            use google_cloud_lro::internal::PollerExt;
490            {
491                google_cloud_lro::internal::new_unit_response_poller(
492                    polling_error_policy,
493                    polling_backoff_policy,
494                    start,
495                    query,
496                )
497            }
498            .with_options(poller_options)
499        }
500
501        /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
502        ///
503        /// This is a **required** field for requests.
504        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
505            self.0.request.name = v.into();
506            self
507        }
508
509        /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
510        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
511            self.0.request.request_id = v.into();
512            self
513        }
514
515        /// Sets the value of [force][crate::model::DeleteInstanceRequest::force].
516        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
517            self.0.request.force = v.into();
518            self
519        }
520    }
521
522    #[doc(hidden)]
523    impl crate::RequestBuilder for DeleteInstance {
524        fn request_options(&mut self) -> &mut crate::RequestOptions {
525            &mut self.0.options
526        }
527    }
528
529    /// The request builder for [SecureSourceManager::list_repositories][crate::client::SecureSourceManager::list_repositories] calls.
530    ///
531    /// # Example
532    /// ```
533    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ListRepositories;
534    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
535    /// use google_cloud_gax::paginator::ItemPaginator;
536    ///
537    /// let builder = prepare_request_builder();
538    /// let mut items = builder.by_item();
539    /// while let Some(result) = items.next().await {
540    ///   let item = result?;
541    /// }
542    /// # Ok(()) }
543    ///
544    /// fn prepare_request_builder() -> ListRepositories {
545    ///   # panic!();
546    ///   // ... details omitted ...
547    /// }
548    /// ```
549    #[derive(Clone, Debug)]
550    pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
551
552    impl ListRepositories {
553        pub(crate) fn new(
554            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
555        ) -> Self {
556            Self(RequestBuilder::new(stub))
557        }
558
559        /// Sets the full request, replacing any prior values.
560        pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
561            mut self,
562            v: V,
563        ) -> Self {
564            self.0.request = v.into();
565            self
566        }
567
568        /// Sets all the options, replacing any prior values.
569        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
570            self.0.options = v.into();
571            self
572        }
573
574        /// Sends the request.
575        pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
576            (*self.0.stub)
577                .list_repositories(self.0.request, self.0.options)
578                .await
579                .map(crate::Response::into_body)
580        }
581
582        /// Streams each page in the collection.
583        pub fn by_page(
584            self,
585        ) -> impl google_cloud_gax::paginator::Paginator<
586            crate::model::ListRepositoriesResponse,
587            crate::Error,
588        > {
589            use std::clone::Clone;
590            let token = self.0.request.page_token.clone();
591            let execute = move |token: String| {
592                let mut builder = self.clone();
593                builder.0.request = builder.0.request.set_page_token(token);
594                builder.send()
595            };
596            google_cloud_gax::paginator::internal::new_paginator(token, execute)
597        }
598
599        /// Streams each item in the collection.
600        pub fn by_item(
601            self,
602        ) -> impl google_cloud_gax::paginator::ItemPaginator<
603            crate::model::ListRepositoriesResponse,
604            crate::Error,
605        > {
606            use google_cloud_gax::paginator::Paginator;
607            self.by_page().items()
608        }
609
610        /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
611        ///
612        /// This is a **required** field for requests.
613        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
614            self.0.request.parent = v.into();
615            self
616        }
617
618        /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
619        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
620            self.0.request.page_size = v.into();
621            self
622        }
623
624        /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
625        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
626            self.0.request.page_token = v.into();
627            self
628        }
629
630        /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
631        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
632            self.0.request.filter = v.into();
633            self
634        }
635
636        /// Sets the value of [instance][crate::model::ListRepositoriesRequest::instance].
637        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
638            self.0.request.instance = v.into();
639            self
640        }
641    }
642
643    #[doc(hidden)]
644    impl crate::RequestBuilder for ListRepositories {
645        fn request_options(&mut self) -> &mut crate::RequestOptions {
646            &mut self.0.options
647        }
648    }
649
650    /// The request builder for [SecureSourceManager::get_repository][crate::client::SecureSourceManager::get_repository] calls.
651    ///
652    /// # Example
653    /// ```
654    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetRepository;
655    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
656    ///
657    /// let builder = prepare_request_builder();
658    /// let response = builder.send().await?;
659    /// # Ok(()) }
660    ///
661    /// fn prepare_request_builder() -> GetRepository {
662    ///   # panic!();
663    ///   // ... details omitted ...
664    /// }
665    /// ```
666    #[derive(Clone, Debug)]
667    pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
668
669    impl GetRepository {
670        pub(crate) fn new(
671            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
672        ) -> Self {
673            Self(RequestBuilder::new(stub))
674        }
675
676        /// Sets the full request, replacing any prior values.
677        pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
678            self.0.request = v.into();
679            self
680        }
681
682        /// Sets all the options, replacing any prior values.
683        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
684            self.0.options = v.into();
685            self
686        }
687
688        /// Sends the request.
689        pub async fn send(self) -> Result<crate::model::Repository> {
690            (*self.0.stub)
691                .get_repository(self.0.request, self.0.options)
692                .await
693                .map(crate::Response::into_body)
694        }
695
696        /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
697        ///
698        /// This is a **required** field for requests.
699        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
700            self.0.request.name = v.into();
701            self
702        }
703    }
704
705    #[doc(hidden)]
706    impl crate::RequestBuilder for GetRepository {
707        fn request_options(&mut self) -> &mut crate::RequestOptions {
708            &mut self.0.options
709        }
710    }
711
712    /// The request builder for [SecureSourceManager::create_repository][crate::client::SecureSourceManager::create_repository] calls.
713    ///
714    /// # Example
715    /// ```
716    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::CreateRepository;
717    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
718    /// use google_cloud_lro::Poller;
719    ///
720    /// let builder = prepare_request_builder();
721    /// let response = builder.poller().until_done().await?;
722    /// # Ok(()) }
723    ///
724    /// fn prepare_request_builder() -> CreateRepository {
725    ///   # panic!();
726    ///   // ... details omitted ...
727    /// }
728    /// ```
729    #[derive(Clone, Debug)]
730    pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
731
732    impl CreateRepository {
733        pub(crate) fn new(
734            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
735        ) -> Self {
736            Self(RequestBuilder::new(stub))
737        }
738
739        /// Sets the full request, replacing any prior values.
740        pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
741            mut self,
742            v: V,
743        ) -> Self {
744            self.0.request = v.into();
745            self
746        }
747
748        /// Sets all the options, replacing any prior values.
749        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
750            self.0.options = v.into();
751            self
752        }
753
754        /// Sends the request.
755        ///
756        /// # Long running operations
757        ///
758        /// This starts, but does not poll, a longrunning operation. More information
759        /// on [create_repository][crate::client::SecureSourceManager::create_repository].
760        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
761            (*self.0.stub)
762                .create_repository(self.0.request, self.0.options)
763                .await
764                .map(crate::Response::into_body)
765        }
766
767        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_repository`.
768        pub fn poller(
769            self,
770        ) -> impl google_cloud_lro::Poller<crate::model::Repository, crate::model::OperationMetadata>
771        {
772            type Operation = google_cloud_lro::internal::Operation<
773                crate::model::Repository,
774                crate::model::OperationMetadata,
775            >;
776            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
777            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
778            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
779            if let Some(ref mut details) = poller_options.tracing {
780                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::create_repository::until_done";
781            }
782
783            let stub = self.0.stub.clone();
784            let mut options = self.0.options.clone();
785            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
786            let query = move |name| {
787                let stub = stub.clone();
788                let options = options.clone();
789                async {
790                    let op = GetOperation::new(stub)
791                        .set_name(name)
792                        .with_options(options)
793                        .send()
794                        .await?;
795                    Ok(Operation::new(op))
796                }
797            };
798
799            let start = move || async {
800                let op = self.send().await?;
801                Ok(Operation::new(op))
802            };
803
804            use google_cloud_lro::internal::PollerExt;
805            {
806                google_cloud_lro::internal::new_poller(
807                    polling_error_policy,
808                    polling_backoff_policy,
809                    start,
810                    query,
811                )
812            }
813            .with_options(poller_options)
814        }
815
816        /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
817        ///
818        /// This is a **required** field for requests.
819        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
820            self.0.request.parent = v.into();
821            self
822        }
823
824        /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
825        ///
826        /// This is a **required** field for requests.
827        pub fn set_repository<T>(mut self, v: T) -> Self
828        where
829            T: std::convert::Into<crate::model::Repository>,
830        {
831            self.0.request.repository = std::option::Option::Some(v.into());
832            self
833        }
834
835        /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
836        ///
837        /// This is a **required** field for requests.
838        pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
839        where
840            T: std::convert::Into<crate::model::Repository>,
841        {
842            self.0.request.repository = v.map(|x| x.into());
843            self
844        }
845
846        /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
847        ///
848        /// This is a **required** field for requests.
849        pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
850            self.0.request.repository_id = v.into();
851            self
852        }
853    }
854
855    #[doc(hidden)]
856    impl crate::RequestBuilder for CreateRepository {
857        fn request_options(&mut self) -> &mut crate::RequestOptions {
858            &mut self.0.options
859        }
860    }
861
862    /// The request builder for [SecureSourceManager::update_repository][crate::client::SecureSourceManager::update_repository] calls.
863    ///
864    /// # Example
865    /// ```
866    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::UpdateRepository;
867    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
868    /// use google_cloud_lro::Poller;
869    ///
870    /// let builder = prepare_request_builder();
871    /// let response = builder.poller().until_done().await?;
872    /// # Ok(()) }
873    ///
874    /// fn prepare_request_builder() -> UpdateRepository {
875    ///   # panic!();
876    ///   // ... details omitted ...
877    /// }
878    /// ```
879    #[derive(Clone, Debug)]
880    pub struct UpdateRepository(RequestBuilder<crate::model::UpdateRepositoryRequest>);
881
882    impl UpdateRepository {
883        pub(crate) fn new(
884            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
885        ) -> Self {
886            Self(RequestBuilder::new(stub))
887        }
888
889        /// Sets the full request, replacing any prior values.
890        pub fn with_request<V: Into<crate::model::UpdateRepositoryRequest>>(
891            mut self,
892            v: V,
893        ) -> Self {
894            self.0.request = v.into();
895            self
896        }
897
898        /// Sets all the options, replacing any prior values.
899        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
900            self.0.options = v.into();
901            self
902        }
903
904        /// Sends the request.
905        ///
906        /// # Long running operations
907        ///
908        /// This starts, but does not poll, a longrunning operation. More information
909        /// on [update_repository][crate::client::SecureSourceManager::update_repository].
910        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
911            (*self.0.stub)
912                .update_repository(self.0.request, self.0.options)
913                .await
914                .map(crate::Response::into_body)
915        }
916
917        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_repository`.
918        pub fn poller(
919            self,
920        ) -> impl google_cloud_lro::Poller<crate::model::Repository, crate::model::OperationMetadata>
921        {
922            type Operation = google_cloud_lro::internal::Operation<
923                crate::model::Repository,
924                crate::model::OperationMetadata,
925            >;
926            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
927            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
928            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
929            if let Some(ref mut details) = poller_options.tracing {
930                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::update_repository::until_done";
931            }
932
933            let stub = self.0.stub.clone();
934            let mut options = self.0.options.clone();
935            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
936            let query = move |name| {
937                let stub = stub.clone();
938                let options = options.clone();
939                async {
940                    let op = GetOperation::new(stub)
941                        .set_name(name)
942                        .with_options(options)
943                        .send()
944                        .await?;
945                    Ok(Operation::new(op))
946                }
947            };
948
949            let start = move || async {
950                let op = self.send().await?;
951                Ok(Operation::new(op))
952            };
953
954            use google_cloud_lro::internal::PollerExt;
955            {
956                google_cloud_lro::internal::new_poller(
957                    polling_error_policy,
958                    polling_backoff_policy,
959                    start,
960                    query,
961                )
962            }
963            .with_options(poller_options)
964        }
965
966        /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
967        pub fn set_update_mask<T>(mut self, v: T) -> Self
968        where
969            T: std::convert::Into<wkt::FieldMask>,
970        {
971            self.0.request.update_mask = std::option::Option::Some(v.into());
972            self
973        }
974
975        /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
976        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
977        where
978            T: std::convert::Into<wkt::FieldMask>,
979        {
980            self.0.request.update_mask = v.map(|x| x.into());
981            self
982        }
983
984        /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
985        ///
986        /// This is a **required** field for requests.
987        pub fn set_repository<T>(mut self, v: T) -> Self
988        where
989            T: std::convert::Into<crate::model::Repository>,
990        {
991            self.0.request.repository = std::option::Option::Some(v.into());
992            self
993        }
994
995        /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
996        ///
997        /// This is a **required** field for requests.
998        pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
999        where
1000            T: std::convert::Into<crate::model::Repository>,
1001        {
1002            self.0.request.repository = v.map(|x| x.into());
1003            self
1004        }
1005
1006        /// Sets the value of [validate_only][crate::model::UpdateRepositoryRequest::validate_only].
1007        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1008            self.0.request.validate_only = v.into();
1009            self
1010        }
1011    }
1012
1013    #[doc(hidden)]
1014    impl crate::RequestBuilder for UpdateRepository {
1015        fn request_options(&mut self) -> &mut crate::RequestOptions {
1016            &mut self.0.options
1017        }
1018    }
1019
1020    /// The request builder for [SecureSourceManager::delete_repository][crate::client::SecureSourceManager::delete_repository] calls.
1021    ///
1022    /// # Example
1023    /// ```
1024    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::DeleteRepository;
1025    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
1026    /// use google_cloud_lro::Poller;
1027    ///
1028    /// let builder = prepare_request_builder();
1029    /// let response = builder.poller().until_done().await?;
1030    /// # Ok(()) }
1031    ///
1032    /// fn prepare_request_builder() -> DeleteRepository {
1033    ///   # panic!();
1034    ///   // ... details omitted ...
1035    /// }
1036    /// ```
1037    #[derive(Clone, Debug)]
1038    pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
1039
1040    impl DeleteRepository {
1041        pub(crate) fn new(
1042            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1043        ) -> Self {
1044            Self(RequestBuilder::new(stub))
1045        }
1046
1047        /// Sets the full request, replacing any prior values.
1048        pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
1049            mut self,
1050            v: V,
1051        ) -> Self {
1052            self.0.request = v.into();
1053            self
1054        }
1055
1056        /// Sets all the options, replacing any prior values.
1057        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1058            self.0.options = v.into();
1059            self
1060        }
1061
1062        /// Sends the request.
1063        ///
1064        /// # Long running operations
1065        ///
1066        /// This starts, but does not poll, a longrunning operation. More information
1067        /// on [delete_repository][crate::client::SecureSourceManager::delete_repository].
1068        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1069            (*self.0.stub)
1070                .delete_repository(self.0.request, self.0.options)
1071                .await
1072                .map(crate::Response::into_body)
1073        }
1074
1075        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_repository`.
1076        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1077            type Operation =
1078                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1079            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1080            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1081            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1082            if let Some(ref mut details) = poller_options.tracing {
1083                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::delete_repository::until_done";
1084            }
1085
1086            let stub = self.0.stub.clone();
1087            let mut options = self.0.options.clone();
1088            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1089            let query = move |name| {
1090                let stub = stub.clone();
1091                let options = options.clone();
1092                async {
1093                    let op = GetOperation::new(stub)
1094                        .set_name(name)
1095                        .with_options(options)
1096                        .send()
1097                        .await?;
1098                    Ok(Operation::new(op))
1099                }
1100            };
1101
1102            let start = move || async {
1103                let op = self.send().await?;
1104                Ok(Operation::new(op))
1105            };
1106
1107            use google_cloud_lro::internal::PollerExt;
1108            {
1109                google_cloud_lro::internal::new_unit_response_poller(
1110                    polling_error_policy,
1111                    polling_backoff_policy,
1112                    start,
1113                    query,
1114                )
1115            }
1116            .with_options(poller_options)
1117        }
1118
1119        /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
1120        ///
1121        /// This is a **required** field for requests.
1122        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1123            self.0.request.name = v.into();
1124            self
1125        }
1126
1127        /// Sets the value of [allow_missing][crate::model::DeleteRepositoryRequest::allow_missing].
1128        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
1129            self.0.request.allow_missing = v.into();
1130            self
1131        }
1132    }
1133
1134    #[doc(hidden)]
1135    impl crate::RequestBuilder for DeleteRepository {
1136        fn request_options(&mut self) -> &mut crate::RequestOptions {
1137            &mut self.0.options
1138        }
1139    }
1140
1141    /// The request builder for [SecureSourceManager::list_hooks][crate::client::SecureSourceManager::list_hooks] calls.
1142    ///
1143    /// # Example
1144    /// ```
1145    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ListHooks;
1146    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
1147    /// use google_cloud_gax::paginator::ItemPaginator;
1148    ///
1149    /// let builder = prepare_request_builder();
1150    /// let mut items = builder.by_item();
1151    /// while let Some(result) = items.next().await {
1152    ///   let item = result?;
1153    /// }
1154    /// # Ok(()) }
1155    ///
1156    /// fn prepare_request_builder() -> ListHooks {
1157    ///   # panic!();
1158    ///   // ... details omitted ...
1159    /// }
1160    /// ```
1161    #[derive(Clone, Debug)]
1162    pub struct ListHooks(RequestBuilder<crate::model::ListHooksRequest>);
1163
1164    impl ListHooks {
1165        pub(crate) fn new(
1166            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1167        ) -> Self {
1168            Self(RequestBuilder::new(stub))
1169        }
1170
1171        /// Sets the full request, replacing any prior values.
1172        pub fn with_request<V: Into<crate::model::ListHooksRequest>>(mut self, v: V) -> Self {
1173            self.0.request = v.into();
1174            self
1175        }
1176
1177        /// Sets all the options, replacing any prior values.
1178        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1179            self.0.options = v.into();
1180            self
1181        }
1182
1183        /// Sends the request.
1184        pub async fn send(self) -> Result<crate::model::ListHooksResponse> {
1185            (*self.0.stub)
1186                .list_hooks(self.0.request, self.0.options)
1187                .await
1188                .map(crate::Response::into_body)
1189        }
1190
1191        /// Streams each page in the collection.
1192        pub fn by_page(
1193            self,
1194        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHooksResponse, crate::Error>
1195        {
1196            use std::clone::Clone;
1197            let token = self.0.request.page_token.clone();
1198            let execute = move |token: String| {
1199                let mut builder = self.clone();
1200                builder.0.request = builder.0.request.set_page_token(token);
1201                builder.send()
1202            };
1203            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1204        }
1205
1206        /// Streams each item in the collection.
1207        pub fn by_item(
1208            self,
1209        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListHooksResponse, crate::Error>
1210        {
1211            use google_cloud_gax::paginator::Paginator;
1212            self.by_page().items()
1213        }
1214
1215        /// Sets the value of [parent][crate::model::ListHooksRequest::parent].
1216        ///
1217        /// This is a **required** field for requests.
1218        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1219            self.0.request.parent = v.into();
1220            self
1221        }
1222
1223        /// Sets the value of [page_size][crate::model::ListHooksRequest::page_size].
1224        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1225            self.0.request.page_size = v.into();
1226            self
1227        }
1228
1229        /// Sets the value of [page_token][crate::model::ListHooksRequest::page_token].
1230        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1231            self.0.request.page_token = v.into();
1232            self
1233        }
1234    }
1235
1236    #[doc(hidden)]
1237    impl crate::RequestBuilder for ListHooks {
1238        fn request_options(&mut self) -> &mut crate::RequestOptions {
1239            &mut self.0.options
1240        }
1241    }
1242
1243    /// The request builder for [SecureSourceManager::get_hook][crate::client::SecureSourceManager::get_hook] calls.
1244    ///
1245    /// # Example
1246    /// ```
1247    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetHook;
1248    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
1249    ///
1250    /// let builder = prepare_request_builder();
1251    /// let response = builder.send().await?;
1252    /// # Ok(()) }
1253    ///
1254    /// fn prepare_request_builder() -> GetHook {
1255    ///   # panic!();
1256    ///   // ... details omitted ...
1257    /// }
1258    /// ```
1259    #[derive(Clone, Debug)]
1260    pub struct GetHook(RequestBuilder<crate::model::GetHookRequest>);
1261
1262    impl GetHook {
1263        pub(crate) fn new(
1264            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1265        ) -> Self {
1266            Self(RequestBuilder::new(stub))
1267        }
1268
1269        /// Sets the full request, replacing any prior values.
1270        pub fn with_request<V: Into<crate::model::GetHookRequest>>(mut self, v: V) -> Self {
1271            self.0.request = v.into();
1272            self
1273        }
1274
1275        /// Sets all the options, replacing any prior values.
1276        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1277            self.0.options = v.into();
1278            self
1279        }
1280
1281        /// Sends the request.
1282        pub async fn send(self) -> Result<crate::model::Hook> {
1283            (*self.0.stub)
1284                .get_hook(self.0.request, self.0.options)
1285                .await
1286                .map(crate::Response::into_body)
1287        }
1288
1289        /// Sets the value of [name][crate::model::GetHookRequest::name].
1290        ///
1291        /// This is a **required** field for requests.
1292        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1293            self.0.request.name = v.into();
1294            self
1295        }
1296    }
1297
1298    #[doc(hidden)]
1299    impl crate::RequestBuilder for GetHook {
1300        fn request_options(&mut self) -> &mut crate::RequestOptions {
1301            &mut self.0.options
1302        }
1303    }
1304
1305    /// The request builder for [SecureSourceManager::create_hook][crate::client::SecureSourceManager::create_hook] calls.
1306    ///
1307    /// # Example
1308    /// ```
1309    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::CreateHook;
1310    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
1311    /// use google_cloud_lro::Poller;
1312    ///
1313    /// let builder = prepare_request_builder();
1314    /// let response = builder.poller().until_done().await?;
1315    /// # Ok(()) }
1316    ///
1317    /// fn prepare_request_builder() -> CreateHook {
1318    ///   # panic!();
1319    ///   // ... details omitted ...
1320    /// }
1321    /// ```
1322    #[derive(Clone, Debug)]
1323    pub struct CreateHook(RequestBuilder<crate::model::CreateHookRequest>);
1324
1325    impl CreateHook {
1326        pub(crate) fn new(
1327            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1328        ) -> Self {
1329            Self(RequestBuilder::new(stub))
1330        }
1331
1332        /// Sets the full request, replacing any prior values.
1333        pub fn with_request<V: Into<crate::model::CreateHookRequest>>(mut self, v: V) -> Self {
1334            self.0.request = v.into();
1335            self
1336        }
1337
1338        /// Sets all the options, replacing any prior values.
1339        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1340            self.0.options = v.into();
1341            self
1342        }
1343
1344        /// Sends the request.
1345        ///
1346        /// # Long running operations
1347        ///
1348        /// This starts, but does not poll, a longrunning operation. More information
1349        /// on [create_hook][crate::client::SecureSourceManager::create_hook].
1350        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1351            (*self.0.stub)
1352                .create_hook(self.0.request, self.0.options)
1353                .await
1354                .map(crate::Response::into_body)
1355        }
1356
1357        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_hook`.
1358        pub fn poller(
1359            self,
1360        ) -> impl google_cloud_lro::Poller<crate::model::Hook, crate::model::OperationMetadata>
1361        {
1362            type Operation = google_cloud_lro::internal::Operation<
1363                crate::model::Hook,
1364                crate::model::OperationMetadata,
1365            >;
1366            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1367            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1368            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1369            if let Some(ref mut details) = poller_options.tracing {
1370                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::create_hook::until_done";
1371            }
1372
1373            let stub = self.0.stub.clone();
1374            let mut options = self.0.options.clone();
1375            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1376            let query = move |name| {
1377                let stub = stub.clone();
1378                let options = options.clone();
1379                async {
1380                    let op = GetOperation::new(stub)
1381                        .set_name(name)
1382                        .with_options(options)
1383                        .send()
1384                        .await?;
1385                    Ok(Operation::new(op))
1386                }
1387            };
1388
1389            let start = move || async {
1390                let op = self.send().await?;
1391                Ok(Operation::new(op))
1392            };
1393
1394            use google_cloud_lro::internal::PollerExt;
1395            {
1396                google_cloud_lro::internal::new_poller(
1397                    polling_error_policy,
1398                    polling_backoff_policy,
1399                    start,
1400                    query,
1401                )
1402            }
1403            .with_options(poller_options)
1404        }
1405
1406        /// Sets the value of [parent][crate::model::CreateHookRequest::parent].
1407        ///
1408        /// This is a **required** field for requests.
1409        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1410            self.0.request.parent = v.into();
1411            self
1412        }
1413
1414        /// Sets the value of [hook][crate::model::CreateHookRequest::hook].
1415        ///
1416        /// This is a **required** field for requests.
1417        pub fn set_hook<T>(mut self, v: T) -> Self
1418        where
1419            T: std::convert::Into<crate::model::Hook>,
1420        {
1421            self.0.request.hook = std::option::Option::Some(v.into());
1422            self
1423        }
1424
1425        /// Sets or clears the value of [hook][crate::model::CreateHookRequest::hook].
1426        ///
1427        /// This is a **required** field for requests.
1428        pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
1429        where
1430            T: std::convert::Into<crate::model::Hook>,
1431        {
1432            self.0.request.hook = v.map(|x| x.into());
1433            self
1434        }
1435
1436        /// Sets the value of [hook_id][crate::model::CreateHookRequest::hook_id].
1437        ///
1438        /// This is a **required** field for requests.
1439        pub fn set_hook_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1440            self.0.request.hook_id = v.into();
1441            self
1442        }
1443    }
1444
1445    #[doc(hidden)]
1446    impl crate::RequestBuilder for CreateHook {
1447        fn request_options(&mut self) -> &mut crate::RequestOptions {
1448            &mut self.0.options
1449        }
1450    }
1451
1452    /// The request builder for [SecureSourceManager::update_hook][crate::client::SecureSourceManager::update_hook] calls.
1453    ///
1454    /// # Example
1455    /// ```
1456    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::UpdateHook;
1457    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
1458    /// use google_cloud_lro::Poller;
1459    ///
1460    /// let builder = prepare_request_builder();
1461    /// let response = builder.poller().until_done().await?;
1462    /// # Ok(()) }
1463    ///
1464    /// fn prepare_request_builder() -> UpdateHook {
1465    ///   # panic!();
1466    ///   // ... details omitted ...
1467    /// }
1468    /// ```
1469    #[derive(Clone, Debug)]
1470    pub struct UpdateHook(RequestBuilder<crate::model::UpdateHookRequest>);
1471
1472    impl UpdateHook {
1473        pub(crate) fn new(
1474            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1475        ) -> Self {
1476            Self(RequestBuilder::new(stub))
1477        }
1478
1479        /// Sets the full request, replacing any prior values.
1480        pub fn with_request<V: Into<crate::model::UpdateHookRequest>>(mut self, v: V) -> Self {
1481            self.0.request = v.into();
1482            self
1483        }
1484
1485        /// Sets all the options, replacing any prior values.
1486        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1487            self.0.options = v.into();
1488            self
1489        }
1490
1491        /// Sends the request.
1492        ///
1493        /// # Long running operations
1494        ///
1495        /// This starts, but does not poll, a longrunning operation. More information
1496        /// on [update_hook][crate::client::SecureSourceManager::update_hook].
1497        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1498            (*self.0.stub)
1499                .update_hook(self.0.request, self.0.options)
1500                .await
1501                .map(crate::Response::into_body)
1502        }
1503
1504        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_hook`.
1505        pub fn poller(
1506            self,
1507        ) -> impl google_cloud_lro::Poller<crate::model::Hook, crate::model::OperationMetadata>
1508        {
1509            type Operation = google_cloud_lro::internal::Operation<
1510                crate::model::Hook,
1511                crate::model::OperationMetadata,
1512            >;
1513            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1514            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1515            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1516            if let Some(ref mut details) = poller_options.tracing {
1517                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::update_hook::until_done";
1518            }
1519
1520            let stub = self.0.stub.clone();
1521            let mut options = self.0.options.clone();
1522            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1523            let query = move |name| {
1524                let stub = stub.clone();
1525                let options = options.clone();
1526                async {
1527                    let op = GetOperation::new(stub)
1528                        .set_name(name)
1529                        .with_options(options)
1530                        .send()
1531                        .await?;
1532                    Ok(Operation::new(op))
1533                }
1534            };
1535
1536            let start = move || async {
1537                let op = self.send().await?;
1538                Ok(Operation::new(op))
1539            };
1540
1541            use google_cloud_lro::internal::PollerExt;
1542            {
1543                google_cloud_lro::internal::new_poller(
1544                    polling_error_policy,
1545                    polling_backoff_policy,
1546                    start,
1547                    query,
1548                )
1549            }
1550            .with_options(poller_options)
1551        }
1552
1553        /// Sets the value of [update_mask][crate::model::UpdateHookRequest::update_mask].
1554        pub fn set_update_mask<T>(mut self, v: T) -> Self
1555        where
1556            T: std::convert::Into<wkt::FieldMask>,
1557        {
1558            self.0.request.update_mask = std::option::Option::Some(v.into());
1559            self
1560        }
1561
1562        /// Sets or clears the value of [update_mask][crate::model::UpdateHookRequest::update_mask].
1563        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1564        where
1565            T: std::convert::Into<wkt::FieldMask>,
1566        {
1567            self.0.request.update_mask = v.map(|x| x.into());
1568            self
1569        }
1570
1571        /// Sets the value of [hook][crate::model::UpdateHookRequest::hook].
1572        ///
1573        /// This is a **required** field for requests.
1574        pub fn set_hook<T>(mut self, v: T) -> Self
1575        where
1576            T: std::convert::Into<crate::model::Hook>,
1577        {
1578            self.0.request.hook = std::option::Option::Some(v.into());
1579            self
1580        }
1581
1582        /// Sets or clears the value of [hook][crate::model::UpdateHookRequest::hook].
1583        ///
1584        /// This is a **required** field for requests.
1585        pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
1586        where
1587            T: std::convert::Into<crate::model::Hook>,
1588        {
1589            self.0.request.hook = v.map(|x| x.into());
1590            self
1591        }
1592    }
1593
1594    #[doc(hidden)]
1595    impl crate::RequestBuilder for UpdateHook {
1596        fn request_options(&mut self) -> &mut crate::RequestOptions {
1597            &mut self.0.options
1598        }
1599    }
1600
1601    /// The request builder for [SecureSourceManager::delete_hook][crate::client::SecureSourceManager::delete_hook] calls.
1602    ///
1603    /// # Example
1604    /// ```
1605    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::DeleteHook;
1606    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
1607    /// use google_cloud_lro::Poller;
1608    ///
1609    /// let builder = prepare_request_builder();
1610    /// let response = builder.poller().until_done().await?;
1611    /// # Ok(()) }
1612    ///
1613    /// fn prepare_request_builder() -> DeleteHook {
1614    ///   # panic!();
1615    ///   // ... details omitted ...
1616    /// }
1617    /// ```
1618    #[derive(Clone, Debug)]
1619    pub struct DeleteHook(RequestBuilder<crate::model::DeleteHookRequest>);
1620
1621    impl DeleteHook {
1622        pub(crate) fn new(
1623            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1624        ) -> Self {
1625            Self(RequestBuilder::new(stub))
1626        }
1627
1628        /// Sets the full request, replacing any prior values.
1629        pub fn with_request<V: Into<crate::model::DeleteHookRequest>>(mut self, v: V) -> Self {
1630            self.0.request = v.into();
1631            self
1632        }
1633
1634        /// Sets all the options, replacing any prior values.
1635        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1636            self.0.options = v.into();
1637            self
1638        }
1639
1640        /// Sends the request.
1641        ///
1642        /// # Long running operations
1643        ///
1644        /// This starts, but does not poll, a longrunning operation. More information
1645        /// on [delete_hook][crate::client::SecureSourceManager::delete_hook].
1646        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1647            (*self.0.stub)
1648                .delete_hook(self.0.request, self.0.options)
1649                .await
1650                .map(crate::Response::into_body)
1651        }
1652
1653        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_hook`.
1654        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1655            type Operation =
1656                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1657            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1658            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1659            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1660            if let Some(ref mut details) = poller_options.tracing {
1661                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::delete_hook::until_done";
1662            }
1663
1664            let stub = self.0.stub.clone();
1665            let mut options = self.0.options.clone();
1666            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1667            let query = move |name| {
1668                let stub = stub.clone();
1669                let options = options.clone();
1670                async {
1671                    let op = GetOperation::new(stub)
1672                        .set_name(name)
1673                        .with_options(options)
1674                        .send()
1675                        .await?;
1676                    Ok(Operation::new(op))
1677                }
1678            };
1679
1680            let start = move || async {
1681                let op = self.send().await?;
1682                Ok(Operation::new(op))
1683            };
1684
1685            use google_cloud_lro::internal::PollerExt;
1686            {
1687                google_cloud_lro::internal::new_unit_response_poller(
1688                    polling_error_policy,
1689                    polling_backoff_policy,
1690                    start,
1691                    query,
1692                )
1693            }
1694            .with_options(poller_options)
1695        }
1696
1697        /// Sets the value of [name][crate::model::DeleteHookRequest::name].
1698        ///
1699        /// This is a **required** field for requests.
1700        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1701            self.0.request.name = v.into();
1702            self
1703        }
1704    }
1705
1706    #[doc(hidden)]
1707    impl crate::RequestBuilder for DeleteHook {
1708        fn request_options(&mut self) -> &mut crate::RequestOptions {
1709            &mut self.0.options
1710        }
1711    }
1712
1713    /// The request builder for [SecureSourceManager::get_iam_policy_repo][crate::client::SecureSourceManager::get_iam_policy_repo] calls.
1714    ///
1715    /// # Example
1716    /// ```
1717    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetIamPolicyRepo;
1718    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
1719    ///
1720    /// let builder = prepare_request_builder();
1721    /// let response = builder.send().await?;
1722    /// # Ok(()) }
1723    ///
1724    /// fn prepare_request_builder() -> GetIamPolicyRepo {
1725    ///   # panic!();
1726    ///   // ... details omitted ...
1727    /// }
1728    /// ```
1729    #[derive(Clone, Debug)]
1730    pub struct GetIamPolicyRepo(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1731
1732    impl GetIamPolicyRepo {
1733        pub(crate) fn new(
1734            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1735        ) -> Self {
1736            Self(RequestBuilder::new(stub))
1737        }
1738
1739        /// Sets the full request, replacing any prior values.
1740        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1741            mut self,
1742            v: V,
1743        ) -> Self {
1744            self.0.request = v.into();
1745            self
1746        }
1747
1748        /// Sets all the options, replacing any prior values.
1749        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1750            self.0.options = v.into();
1751            self
1752        }
1753
1754        /// Sends the request.
1755        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1756            (*self.0.stub)
1757                .get_iam_policy_repo(self.0.request, self.0.options)
1758                .await
1759                .map(crate::Response::into_body)
1760        }
1761
1762        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1763        ///
1764        /// This is a **required** field for requests.
1765        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1766            self.0.request.resource = v.into();
1767            self
1768        }
1769
1770        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1771        pub fn set_options<T>(mut self, v: T) -> Self
1772        where
1773            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1774        {
1775            self.0.request.options = std::option::Option::Some(v.into());
1776            self
1777        }
1778
1779        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1780        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1781        where
1782            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1783        {
1784            self.0.request.options = v.map(|x| x.into());
1785            self
1786        }
1787    }
1788
1789    #[doc(hidden)]
1790    impl crate::RequestBuilder for GetIamPolicyRepo {
1791        fn request_options(&mut self) -> &mut crate::RequestOptions {
1792            &mut self.0.options
1793        }
1794    }
1795
1796    /// The request builder for [SecureSourceManager::set_iam_policy_repo][crate::client::SecureSourceManager::set_iam_policy_repo] calls.
1797    ///
1798    /// # Example
1799    /// ```
1800    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::SetIamPolicyRepo;
1801    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
1802    ///
1803    /// let builder = prepare_request_builder();
1804    /// let response = builder.send().await?;
1805    /// # Ok(()) }
1806    ///
1807    /// fn prepare_request_builder() -> SetIamPolicyRepo {
1808    ///   # panic!();
1809    ///   // ... details omitted ...
1810    /// }
1811    /// ```
1812    #[derive(Clone, Debug)]
1813    pub struct SetIamPolicyRepo(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1814
1815    impl SetIamPolicyRepo {
1816        pub(crate) fn new(
1817            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1818        ) -> Self {
1819            Self(RequestBuilder::new(stub))
1820        }
1821
1822        /// Sets the full request, replacing any prior values.
1823        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1824            mut self,
1825            v: V,
1826        ) -> Self {
1827            self.0.request = v.into();
1828            self
1829        }
1830
1831        /// Sets all the options, replacing any prior values.
1832        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1833            self.0.options = v.into();
1834            self
1835        }
1836
1837        /// Sends the request.
1838        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1839            (*self.0.stub)
1840                .set_iam_policy_repo(self.0.request, self.0.options)
1841                .await
1842                .map(crate::Response::into_body)
1843        }
1844
1845        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1846        ///
1847        /// This is a **required** field for requests.
1848        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1849            self.0.request.resource = v.into();
1850            self
1851        }
1852
1853        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1854        ///
1855        /// This is a **required** field for requests.
1856        pub fn set_policy<T>(mut self, v: T) -> Self
1857        where
1858            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1859        {
1860            self.0.request.policy = std::option::Option::Some(v.into());
1861            self
1862        }
1863
1864        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1865        ///
1866        /// This is a **required** field for requests.
1867        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1868        where
1869            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1870        {
1871            self.0.request.policy = v.map(|x| x.into());
1872            self
1873        }
1874
1875        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1876        pub fn set_update_mask<T>(mut self, v: T) -> Self
1877        where
1878            T: std::convert::Into<wkt::FieldMask>,
1879        {
1880            self.0.request.update_mask = std::option::Option::Some(v.into());
1881            self
1882        }
1883
1884        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1885        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1886        where
1887            T: std::convert::Into<wkt::FieldMask>,
1888        {
1889            self.0.request.update_mask = v.map(|x| x.into());
1890            self
1891        }
1892    }
1893
1894    #[doc(hidden)]
1895    impl crate::RequestBuilder for SetIamPolicyRepo {
1896        fn request_options(&mut self) -> &mut crate::RequestOptions {
1897            &mut self.0.options
1898        }
1899    }
1900
1901    /// The request builder for [SecureSourceManager::test_iam_permissions_repo][crate::client::SecureSourceManager::test_iam_permissions_repo] calls.
1902    ///
1903    /// # Example
1904    /// ```
1905    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::TestIamPermissionsRepo;
1906    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
1907    ///
1908    /// let builder = prepare_request_builder();
1909    /// let response = builder.send().await?;
1910    /// # Ok(()) }
1911    ///
1912    /// fn prepare_request_builder() -> TestIamPermissionsRepo {
1913    ///   # panic!();
1914    ///   // ... details omitted ...
1915    /// }
1916    /// ```
1917    #[derive(Clone, Debug)]
1918    pub struct TestIamPermissionsRepo(
1919        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1920    );
1921
1922    impl TestIamPermissionsRepo {
1923        pub(crate) fn new(
1924            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
1925        ) -> Self {
1926            Self(RequestBuilder::new(stub))
1927        }
1928
1929        /// Sets the full request, replacing any prior values.
1930        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1931            mut self,
1932            v: V,
1933        ) -> Self {
1934            self.0.request = v.into();
1935            self
1936        }
1937
1938        /// Sets all the options, replacing any prior values.
1939        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1940            self.0.options = v.into();
1941            self
1942        }
1943
1944        /// Sends the request.
1945        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1946            (*self.0.stub)
1947                .test_iam_permissions_repo(self.0.request, self.0.options)
1948                .await
1949                .map(crate::Response::into_body)
1950        }
1951
1952        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
1953        ///
1954        /// This is a **required** field for requests.
1955        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1956            self.0.request.resource = v.into();
1957            self
1958        }
1959
1960        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
1961        ///
1962        /// This is a **required** field for requests.
1963        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1964        where
1965            T: std::iter::IntoIterator<Item = V>,
1966            V: std::convert::Into<std::string::String>,
1967        {
1968            use std::iter::Iterator;
1969            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1970            self
1971        }
1972    }
1973
1974    #[doc(hidden)]
1975    impl crate::RequestBuilder for TestIamPermissionsRepo {
1976        fn request_options(&mut self) -> &mut crate::RequestOptions {
1977            &mut self.0.options
1978        }
1979    }
1980
1981    /// The request builder for [SecureSourceManager::create_branch_rule][crate::client::SecureSourceManager::create_branch_rule] calls.
1982    ///
1983    /// # Example
1984    /// ```
1985    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::CreateBranchRule;
1986    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
1987    /// use google_cloud_lro::Poller;
1988    ///
1989    /// let builder = prepare_request_builder();
1990    /// let response = builder.poller().until_done().await?;
1991    /// # Ok(()) }
1992    ///
1993    /// fn prepare_request_builder() -> CreateBranchRule {
1994    ///   # panic!();
1995    ///   // ... details omitted ...
1996    /// }
1997    /// ```
1998    #[derive(Clone, Debug)]
1999    pub struct CreateBranchRule(RequestBuilder<crate::model::CreateBranchRuleRequest>);
2000
2001    impl CreateBranchRule {
2002        pub(crate) fn new(
2003            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2004        ) -> Self {
2005            Self(RequestBuilder::new(stub))
2006        }
2007
2008        /// Sets the full request, replacing any prior values.
2009        pub fn with_request<V: Into<crate::model::CreateBranchRuleRequest>>(
2010            mut self,
2011            v: V,
2012        ) -> Self {
2013            self.0.request = v.into();
2014            self
2015        }
2016
2017        /// Sets all the options, replacing any prior values.
2018        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2019            self.0.options = v.into();
2020            self
2021        }
2022
2023        /// Sends the request.
2024        ///
2025        /// # Long running operations
2026        ///
2027        /// This starts, but does not poll, a longrunning operation. More information
2028        /// on [create_branch_rule][crate::client::SecureSourceManager::create_branch_rule].
2029        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2030            (*self.0.stub)
2031                .create_branch_rule(self.0.request, self.0.options)
2032                .await
2033                .map(crate::Response::into_body)
2034        }
2035
2036        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_branch_rule`.
2037        pub fn poller(
2038            self,
2039        ) -> impl google_cloud_lro::Poller<crate::model::BranchRule, crate::model::OperationMetadata>
2040        {
2041            type Operation = google_cloud_lro::internal::Operation<
2042                crate::model::BranchRule,
2043                crate::model::OperationMetadata,
2044            >;
2045            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2046            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2047            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2048            if let Some(ref mut details) = poller_options.tracing {
2049                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::create_branch_rule::until_done";
2050            }
2051
2052            let stub = self.0.stub.clone();
2053            let mut options = self.0.options.clone();
2054            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2055            let query = move |name| {
2056                let stub = stub.clone();
2057                let options = options.clone();
2058                async {
2059                    let op = GetOperation::new(stub)
2060                        .set_name(name)
2061                        .with_options(options)
2062                        .send()
2063                        .await?;
2064                    Ok(Operation::new(op))
2065                }
2066            };
2067
2068            let start = move || async {
2069                let op = self.send().await?;
2070                Ok(Operation::new(op))
2071            };
2072
2073            use google_cloud_lro::internal::PollerExt;
2074            {
2075                google_cloud_lro::internal::new_poller(
2076                    polling_error_policy,
2077                    polling_backoff_policy,
2078                    start,
2079                    query,
2080                )
2081            }
2082            .with_options(poller_options)
2083        }
2084
2085        /// Sets the value of [parent][crate::model::CreateBranchRuleRequest::parent].
2086        ///
2087        /// This is a **required** field for requests.
2088        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2089            self.0.request.parent = v.into();
2090            self
2091        }
2092
2093        /// Sets the value of [branch_rule][crate::model::CreateBranchRuleRequest::branch_rule].
2094        ///
2095        /// This is a **required** field for requests.
2096        pub fn set_branch_rule<T>(mut self, v: T) -> Self
2097        where
2098            T: std::convert::Into<crate::model::BranchRule>,
2099        {
2100            self.0.request.branch_rule = std::option::Option::Some(v.into());
2101            self
2102        }
2103
2104        /// Sets or clears the value of [branch_rule][crate::model::CreateBranchRuleRequest::branch_rule].
2105        ///
2106        /// This is a **required** field for requests.
2107        pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
2108        where
2109            T: std::convert::Into<crate::model::BranchRule>,
2110        {
2111            self.0.request.branch_rule = v.map(|x| x.into());
2112            self
2113        }
2114
2115        /// Sets the value of [branch_rule_id][crate::model::CreateBranchRuleRequest::branch_rule_id].
2116        ///
2117        /// This is a **required** field for requests.
2118        pub fn set_branch_rule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2119            self.0.request.branch_rule_id = v.into();
2120            self
2121        }
2122    }
2123
2124    #[doc(hidden)]
2125    impl crate::RequestBuilder for CreateBranchRule {
2126        fn request_options(&mut self) -> &mut crate::RequestOptions {
2127            &mut self.0.options
2128        }
2129    }
2130
2131    /// The request builder for [SecureSourceManager::list_branch_rules][crate::client::SecureSourceManager::list_branch_rules] calls.
2132    ///
2133    /// # Example
2134    /// ```
2135    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ListBranchRules;
2136    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
2137    /// use google_cloud_gax::paginator::ItemPaginator;
2138    ///
2139    /// let builder = prepare_request_builder();
2140    /// let mut items = builder.by_item();
2141    /// while let Some(result) = items.next().await {
2142    ///   let item = result?;
2143    /// }
2144    /// # Ok(()) }
2145    ///
2146    /// fn prepare_request_builder() -> ListBranchRules {
2147    ///   # panic!();
2148    ///   // ... details omitted ...
2149    /// }
2150    /// ```
2151    #[derive(Clone, Debug)]
2152    pub struct ListBranchRules(RequestBuilder<crate::model::ListBranchRulesRequest>);
2153
2154    impl ListBranchRules {
2155        pub(crate) fn new(
2156            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2157        ) -> Self {
2158            Self(RequestBuilder::new(stub))
2159        }
2160
2161        /// Sets the full request, replacing any prior values.
2162        pub fn with_request<V: Into<crate::model::ListBranchRulesRequest>>(mut self, v: V) -> Self {
2163            self.0.request = v.into();
2164            self
2165        }
2166
2167        /// Sets all the options, replacing any prior values.
2168        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2169            self.0.options = v.into();
2170            self
2171        }
2172
2173        /// Sends the request.
2174        pub async fn send(self) -> Result<crate::model::ListBranchRulesResponse> {
2175            (*self.0.stub)
2176                .list_branch_rules(self.0.request, self.0.options)
2177                .await
2178                .map(crate::Response::into_body)
2179        }
2180
2181        /// Streams each page in the collection.
2182        pub fn by_page(
2183            self,
2184        ) -> impl google_cloud_gax::paginator::Paginator<
2185            crate::model::ListBranchRulesResponse,
2186            crate::Error,
2187        > {
2188            use std::clone::Clone;
2189            let token = self.0.request.page_token.clone();
2190            let execute = move |token: String| {
2191                let mut builder = self.clone();
2192                builder.0.request = builder.0.request.set_page_token(token);
2193                builder.send()
2194            };
2195            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2196        }
2197
2198        /// Streams each item in the collection.
2199        pub fn by_item(
2200            self,
2201        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2202            crate::model::ListBranchRulesResponse,
2203            crate::Error,
2204        > {
2205            use google_cloud_gax::paginator::Paginator;
2206            self.by_page().items()
2207        }
2208
2209        /// Sets the value of [parent][crate::model::ListBranchRulesRequest::parent].
2210        ///
2211        /// This is a **required** field for requests.
2212        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2213            self.0.request.parent = v.into();
2214            self
2215        }
2216
2217        /// Sets the value of [page_size][crate::model::ListBranchRulesRequest::page_size].
2218        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2219            self.0.request.page_size = v.into();
2220            self
2221        }
2222
2223        /// Sets the value of [page_token][crate::model::ListBranchRulesRequest::page_token].
2224        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2225            self.0.request.page_token = v.into();
2226            self
2227        }
2228    }
2229
2230    #[doc(hidden)]
2231    impl crate::RequestBuilder for ListBranchRules {
2232        fn request_options(&mut self) -> &mut crate::RequestOptions {
2233            &mut self.0.options
2234        }
2235    }
2236
2237    /// The request builder for [SecureSourceManager::get_branch_rule][crate::client::SecureSourceManager::get_branch_rule] calls.
2238    ///
2239    /// # Example
2240    /// ```
2241    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetBranchRule;
2242    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
2243    ///
2244    /// let builder = prepare_request_builder();
2245    /// let response = builder.send().await?;
2246    /// # Ok(()) }
2247    ///
2248    /// fn prepare_request_builder() -> GetBranchRule {
2249    ///   # panic!();
2250    ///   // ... details omitted ...
2251    /// }
2252    /// ```
2253    #[derive(Clone, Debug)]
2254    pub struct GetBranchRule(RequestBuilder<crate::model::GetBranchRuleRequest>);
2255
2256    impl GetBranchRule {
2257        pub(crate) fn new(
2258            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2259        ) -> Self {
2260            Self(RequestBuilder::new(stub))
2261        }
2262
2263        /// Sets the full request, replacing any prior values.
2264        pub fn with_request<V: Into<crate::model::GetBranchRuleRequest>>(mut self, v: V) -> Self {
2265            self.0.request = v.into();
2266            self
2267        }
2268
2269        /// Sets all the options, replacing any prior values.
2270        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2271            self.0.options = v.into();
2272            self
2273        }
2274
2275        /// Sends the request.
2276        pub async fn send(self) -> Result<crate::model::BranchRule> {
2277            (*self.0.stub)
2278                .get_branch_rule(self.0.request, self.0.options)
2279                .await
2280                .map(crate::Response::into_body)
2281        }
2282
2283        /// Sets the value of [name][crate::model::GetBranchRuleRequest::name].
2284        ///
2285        /// This is a **required** field for requests.
2286        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2287            self.0.request.name = v.into();
2288            self
2289        }
2290    }
2291
2292    #[doc(hidden)]
2293    impl crate::RequestBuilder for GetBranchRule {
2294        fn request_options(&mut self) -> &mut crate::RequestOptions {
2295            &mut self.0.options
2296        }
2297    }
2298
2299    /// The request builder for [SecureSourceManager::update_branch_rule][crate::client::SecureSourceManager::update_branch_rule] calls.
2300    ///
2301    /// # Example
2302    /// ```
2303    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::UpdateBranchRule;
2304    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
2305    /// use google_cloud_lro::Poller;
2306    ///
2307    /// let builder = prepare_request_builder();
2308    /// let response = builder.poller().until_done().await?;
2309    /// # Ok(()) }
2310    ///
2311    /// fn prepare_request_builder() -> UpdateBranchRule {
2312    ///   # panic!();
2313    ///   // ... details omitted ...
2314    /// }
2315    /// ```
2316    #[derive(Clone, Debug)]
2317    pub struct UpdateBranchRule(RequestBuilder<crate::model::UpdateBranchRuleRequest>);
2318
2319    impl UpdateBranchRule {
2320        pub(crate) fn new(
2321            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2322        ) -> Self {
2323            Self(RequestBuilder::new(stub))
2324        }
2325
2326        /// Sets the full request, replacing any prior values.
2327        pub fn with_request<V: Into<crate::model::UpdateBranchRuleRequest>>(
2328            mut self,
2329            v: V,
2330        ) -> Self {
2331            self.0.request = v.into();
2332            self
2333        }
2334
2335        /// Sets all the options, replacing any prior values.
2336        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2337            self.0.options = v.into();
2338            self
2339        }
2340
2341        /// Sends the request.
2342        ///
2343        /// # Long running operations
2344        ///
2345        /// This starts, but does not poll, a longrunning operation. More information
2346        /// on [update_branch_rule][crate::client::SecureSourceManager::update_branch_rule].
2347        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2348            (*self.0.stub)
2349                .update_branch_rule(self.0.request, self.0.options)
2350                .await
2351                .map(crate::Response::into_body)
2352        }
2353
2354        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_branch_rule`.
2355        pub fn poller(
2356            self,
2357        ) -> impl google_cloud_lro::Poller<crate::model::BranchRule, crate::model::OperationMetadata>
2358        {
2359            type Operation = google_cloud_lro::internal::Operation<
2360                crate::model::BranchRule,
2361                crate::model::OperationMetadata,
2362            >;
2363            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2364            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2365            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2366            if let Some(ref mut details) = poller_options.tracing {
2367                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::update_branch_rule::until_done";
2368            }
2369
2370            let stub = self.0.stub.clone();
2371            let mut options = self.0.options.clone();
2372            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2373            let query = move |name| {
2374                let stub = stub.clone();
2375                let options = options.clone();
2376                async {
2377                    let op = GetOperation::new(stub)
2378                        .set_name(name)
2379                        .with_options(options)
2380                        .send()
2381                        .await?;
2382                    Ok(Operation::new(op))
2383                }
2384            };
2385
2386            let start = move || async {
2387                let op = self.send().await?;
2388                Ok(Operation::new(op))
2389            };
2390
2391            use google_cloud_lro::internal::PollerExt;
2392            {
2393                google_cloud_lro::internal::new_poller(
2394                    polling_error_policy,
2395                    polling_backoff_policy,
2396                    start,
2397                    query,
2398                )
2399            }
2400            .with_options(poller_options)
2401        }
2402
2403        /// Sets the value of [branch_rule][crate::model::UpdateBranchRuleRequest::branch_rule].
2404        ///
2405        /// This is a **required** field for requests.
2406        pub fn set_branch_rule<T>(mut self, v: T) -> Self
2407        where
2408            T: std::convert::Into<crate::model::BranchRule>,
2409        {
2410            self.0.request.branch_rule = std::option::Option::Some(v.into());
2411            self
2412        }
2413
2414        /// Sets or clears the value of [branch_rule][crate::model::UpdateBranchRuleRequest::branch_rule].
2415        ///
2416        /// This is a **required** field for requests.
2417        pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
2418        where
2419            T: std::convert::Into<crate::model::BranchRule>,
2420        {
2421            self.0.request.branch_rule = v.map(|x| x.into());
2422            self
2423        }
2424
2425        /// Sets the value of [validate_only][crate::model::UpdateBranchRuleRequest::validate_only].
2426        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2427            self.0.request.validate_only = v.into();
2428            self
2429        }
2430
2431        /// Sets the value of [update_mask][crate::model::UpdateBranchRuleRequest::update_mask].
2432        pub fn set_update_mask<T>(mut self, v: T) -> Self
2433        where
2434            T: std::convert::Into<wkt::FieldMask>,
2435        {
2436            self.0.request.update_mask = std::option::Option::Some(v.into());
2437            self
2438        }
2439
2440        /// Sets or clears the value of [update_mask][crate::model::UpdateBranchRuleRequest::update_mask].
2441        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2442        where
2443            T: std::convert::Into<wkt::FieldMask>,
2444        {
2445            self.0.request.update_mask = v.map(|x| x.into());
2446            self
2447        }
2448    }
2449
2450    #[doc(hidden)]
2451    impl crate::RequestBuilder for UpdateBranchRule {
2452        fn request_options(&mut self) -> &mut crate::RequestOptions {
2453            &mut self.0.options
2454        }
2455    }
2456
2457    /// The request builder for [SecureSourceManager::delete_branch_rule][crate::client::SecureSourceManager::delete_branch_rule] calls.
2458    ///
2459    /// # Example
2460    /// ```
2461    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::DeleteBranchRule;
2462    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
2463    /// use google_cloud_lro::Poller;
2464    ///
2465    /// let builder = prepare_request_builder();
2466    /// let response = builder.poller().until_done().await?;
2467    /// # Ok(()) }
2468    ///
2469    /// fn prepare_request_builder() -> DeleteBranchRule {
2470    ///   # panic!();
2471    ///   // ... details omitted ...
2472    /// }
2473    /// ```
2474    #[derive(Clone, Debug)]
2475    pub struct DeleteBranchRule(RequestBuilder<crate::model::DeleteBranchRuleRequest>);
2476
2477    impl DeleteBranchRule {
2478        pub(crate) fn new(
2479            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2480        ) -> Self {
2481            Self(RequestBuilder::new(stub))
2482        }
2483
2484        /// Sets the full request, replacing any prior values.
2485        pub fn with_request<V: Into<crate::model::DeleteBranchRuleRequest>>(
2486            mut self,
2487            v: V,
2488        ) -> Self {
2489            self.0.request = v.into();
2490            self
2491        }
2492
2493        /// Sets all the options, replacing any prior values.
2494        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2495            self.0.options = v.into();
2496            self
2497        }
2498
2499        /// Sends the request.
2500        ///
2501        /// # Long running operations
2502        ///
2503        /// This starts, but does not poll, a longrunning operation. More information
2504        /// on [delete_branch_rule][crate::client::SecureSourceManager::delete_branch_rule].
2505        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2506            (*self.0.stub)
2507                .delete_branch_rule(self.0.request, self.0.options)
2508                .await
2509                .map(crate::Response::into_body)
2510        }
2511
2512        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_branch_rule`.
2513        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2514            type Operation =
2515                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2516            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2517            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2518            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2519            if let Some(ref mut details) = poller_options.tracing {
2520                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::delete_branch_rule::until_done";
2521            }
2522
2523            let stub = self.0.stub.clone();
2524            let mut options = self.0.options.clone();
2525            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2526            let query = move |name| {
2527                let stub = stub.clone();
2528                let options = options.clone();
2529                async {
2530                    let op = GetOperation::new(stub)
2531                        .set_name(name)
2532                        .with_options(options)
2533                        .send()
2534                        .await?;
2535                    Ok(Operation::new(op))
2536                }
2537            };
2538
2539            let start = move || async {
2540                let op = self.send().await?;
2541                Ok(Operation::new(op))
2542            };
2543
2544            use google_cloud_lro::internal::PollerExt;
2545            {
2546                google_cloud_lro::internal::new_unit_response_poller(
2547                    polling_error_policy,
2548                    polling_backoff_policy,
2549                    start,
2550                    query,
2551                )
2552            }
2553            .with_options(poller_options)
2554        }
2555
2556        /// Sets the value of [name][crate::model::DeleteBranchRuleRequest::name].
2557        ///
2558        /// This is a **required** field for requests.
2559        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2560            self.0.request.name = v.into();
2561            self
2562        }
2563
2564        /// Sets the value of [allow_missing][crate::model::DeleteBranchRuleRequest::allow_missing].
2565        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2566            self.0.request.allow_missing = v.into();
2567            self
2568        }
2569    }
2570
2571    #[doc(hidden)]
2572    impl crate::RequestBuilder for DeleteBranchRule {
2573        fn request_options(&mut self) -> &mut crate::RequestOptions {
2574            &mut self.0.options
2575        }
2576    }
2577
2578    /// The request builder for [SecureSourceManager::create_pull_request][crate::client::SecureSourceManager::create_pull_request] calls.
2579    ///
2580    /// # Example
2581    /// ```
2582    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::CreatePullRequest;
2583    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
2584    /// use google_cloud_lro::Poller;
2585    ///
2586    /// let builder = prepare_request_builder();
2587    /// let response = builder.poller().until_done().await?;
2588    /// # Ok(()) }
2589    ///
2590    /// fn prepare_request_builder() -> CreatePullRequest {
2591    ///   # panic!();
2592    ///   // ... details omitted ...
2593    /// }
2594    /// ```
2595    #[derive(Clone, Debug)]
2596    pub struct CreatePullRequest(RequestBuilder<crate::model::CreatePullRequestRequest>);
2597
2598    impl CreatePullRequest {
2599        pub(crate) fn new(
2600            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2601        ) -> Self {
2602            Self(RequestBuilder::new(stub))
2603        }
2604
2605        /// Sets the full request, replacing any prior values.
2606        pub fn with_request<V: Into<crate::model::CreatePullRequestRequest>>(
2607            mut self,
2608            v: V,
2609        ) -> Self {
2610            self.0.request = v.into();
2611            self
2612        }
2613
2614        /// Sets all the options, replacing any prior values.
2615        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2616            self.0.options = v.into();
2617            self
2618        }
2619
2620        /// Sends the request.
2621        ///
2622        /// # Long running operations
2623        ///
2624        /// This starts, but does not poll, a longrunning operation. More information
2625        /// on [create_pull_request][crate::client::SecureSourceManager::create_pull_request].
2626        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2627            (*self.0.stub)
2628                .create_pull_request(self.0.request, self.0.options)
2629                .await
2630                .map(crate::Response::into_body)
2631        }
2632
2633        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_pull_request`.
2634        pub fn poller(
2635            self,
2636        ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
2637        {
2638            type Operation = google_cloud_lro::internal::Operation<
2639                crate::model::PullRequest,
2640                crate::model::OperationMetadata,
2641            >;
2642            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2643            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2644            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2645            if let Some(ref mut details) = poller_options.tracing {
2646                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::create_pull_request::until_done";
2647            }
2648
2649            let stub = self.0.stub.clone();
2650            let mut options = self.0.options.clone();
2651            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2652            let query = move |name| {
2653                let stub = stub.clone();
2654                let options = options.clone();
2655                async {
2656                    let op = GetOperation::new(stub)
2657                        .set_name(name)
2658                        .with_options(options)
2659                        .send()
2660                        .await?;
2661                    Ok(Operation::new(op))
2662                }
2663            };
2664
2665            let start = move || async {
2666                let op = self.send().await?;
2667                Ok(Operation::new(op))
2668            };
2669
2670            use google_cloud_lro::internal::PollerExt;
2671            {
2672                google_cloud_lro::internal::new_poller(
2673                    polling_error_policy,
2674                    polling_backoff_policy,
2675                    start,
2676                    query,
2677                )
2678            }
2679            .with_options(poller_options)
2680        }
2681
2682        /// Sets the value of [parent][crate::model::CreatePullRequestRequest::parent].
2683        ///
2684        /// This is a **required** field for requests.
2685        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2686            self.0.request.parent = v.into();
2687            self
2688        }
2689
2690        /// Sets the value of [pull_request][crate::model::CreatePullRequestRequest::pull_request].
2691        ///
2692        /// This is a **required** field for requests.
2693        pub fn set_pull_request<T>(mut self, v: T) -> Self
2694        where
2695            T: std::convert::Into<crate::model::PullRequest>,
2696        {
2697            self.0.request.pull_request = std::option::Option::Some(v.into());
2698            self
2699        }
2700
2701        /// Sets or clears the value of [pull_request][crate::model::CreatePullRequestRequest::pull_request].
2702        ///
2703        /// This is a **required** field for requests.
2704        pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
2705        where
2706            T: std::convert::Into<crate::model::PullRequest>,
2707        {
2708            self.0.request.pull_request = v.map(|x| x.into());
2709            self
2710        }
2711    }
2712
2713    #[doc(hidden)]
2714    impl crate::RequestBuilder for CreatePullRequest {
2715        fn request_options(&mut self) -> &mut crate::RequestOptions {
2716            &mut self.0.options
2717        }
2718    }
2719
2720    /// The request builder for [SecureSourceManager::get_pull_request][crate::client::SecureSourceManager::get_pull_request] calls.
2721    ///
2722    /// # Example
2723    /// ```
2724    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetPullRequest;
2725    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
2726    ///
2727    /// let builder = prepare_request_builder();
2728    /// let response = builder.send().await?;
2729    /// # Ok(()) }
2730    ///
2731    /// fn prepare_request_builder() -> GetPullRequest {
2732    ///   # panic!();
2733    ///   // ... details omitted ...
2734    /// }
2735    /// ```
2736    #[derive(Clone, Debug)]
2737    pub struct GetPullRequest(RequestBuilder<crate::model::GetPullRequestRequest>);
2738
2739    impl GetPullRequest {
2740        pub(crate) fn new(
2741            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2742        ) -> Self {
2743            Self(RequestBuilder::new(stub))
2744        }
2745
2746        /// Sets the full request, replacing any prior values.
2747        pub fn with_request<V: Into<crate::model::GetPullRequestRequest>>(mut self, v: V) -> Self {
2748            self.0.request = v.into();
2749            self
2750        }
2751
2752        /// Sets all the options, replacing any prior values.
2753        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2754            self.0.options = v.into();
2755            self
2756        }
2757
2758        /// Sends the request.
2759        pub async fn send(self) -> Result<crate::model::PullRequest> {
2760            (*self.0.stub)
2761                .get_pull_request(self.0.request, self.0.options)
2762                .await
2763                .map(crate::Response::into_body)
2764        }
2765
2766        /// Sets the value of [name][crate::model::GetPullRequestRequest::name].
2767        ///
2768        /// This is a **required** field for requests.
2769        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2770            self.0.request.name = v.into();
2771            self
2772        }
2773    }
2774
2775    #[doc(hidden)]
2776    impl crate::RequestBuilder for GetPullRequest {
2777        fn request_options(&mut self) -> &mut crate::RequestOptions {
2778            &mut self.0.options
2779        }
2780    }
2781
2782    /// The request builder for [SecureSourceManager::list_pull_requests][crate::client::SecureSourceManager::list_pull_requests] calls.
2783    ///
2784    /// # Example
2785    /// ```
2786    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ListPullRequests;
2787    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
2788    /// use google_cloud_gax::paginator::ItemPaginator;
2789    ///
2790    /// let builder = prepare_request_builder();
2791    /// let mut items = builder.by_item();
2792    /// while let Some(result) = items.next().await {
2793    ///   let item = result?;
2794    /// }
2795    /// # Ok(()) }
2796    ///
2797    /// fn prepare_request_builder() -> ListPullRequests {
2798    ///   # panic!();
2799    ///   // ... details omitted ...
2800    /// }
2801    /// ```
2802    #[derive(Clone, Debug)]
2803    pub struct ListPullRequests(RequestBuilder<crate::model::ListPullRequestsRequest>);
2804
2805    impl ListPullRequests {
2806        pub(crate) fn new(
2807            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2808        ) -> Self {
2809            Self(RequestBuilder::new(stub))
2810        }
2811
2812        /// Sets the full request, replacing any prior values.
2813        pub fn with_request<V: Into<crate::model::ListPullRequestsRequest>>(
2814            mut self,
2815            v: V,
2816        ) -> Self {
2817            self.0.request = v.into();
2818            self
2819        }
2820
2821        /// Sets all the options, replacing any prior values.
2822        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2823            self.0.options = v.into();
2824            self
2825        }
2826
2827        /// Sends the request.
2828        pub async fn send(self) -> Result<crate::model::ListPullRequestsResponse> {
2829            (*self.0.stub)
2830                .list_pull_requests(self.0.request, self.0.options)
2831                .await
2832                .map(crate::Response::into_body)
2833        }
2834
2835        /// Streams each page in the collection.
2836        pub fn by_page(
2837            self,
2838        ) -> impl google_cloud_gax::paginator::Paginator<
2839            crate::model::ListPullRequestsResponse,
2840            crate::Error,
2841        > {
2842            use std::clone::Clone;
2843            let token = self.0.request.page_token.clone();
2844            let execute = move |token: String| {
2845                let mut builder = self.clone();
2846                builder.0.request = builder.0.request.set_page_token(token);
2847                builder.send()
2848            };
2849            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2850        }
2851
2852        /// Streams each item in the collection.
2853        pub fn by_item(
2854            self,
2855        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2856            crate::model::ListPullRequestsResponse,
2857            crate::Error,
2858        > {
2859            use google_cloud_gax::paginator::Paginator;
2860            self.by_page().items()
2861        }
2862
2863        /// Sets the value of [parent][crate::model::ListPullRequestsRequest::parent].
2864        ///
2865        /// This is a **required** field for requests.
2866        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2867            self.0.request.parent = v.into();
2868            self
2869        }
2870
2871        /// Sets the value of [page_size][crate::model::ListPullRequestsRequest::page_size].
2872        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2873            self.0.request.page_size = v.into();
2874            self
2875        }
2876
2877        /// Sets the value of [page_token][crate::model::ListPullRequestsRequest::page_token].
2878        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2879            self.0.request.page_token = v.into();
2880            self
2881        }
2882    }
2883
2884    #[doc(hidden)]
2885    impl crate::RequestBuilder for ListPullRequests {
2886        fn request_options(&mut self) -> &mut crate::RequestOptions {
2887            &mut self.0.options
2888        }
2889    }
2890
2891    /// The request builder for [SecureSourceManager::update_pull_request][crate::client::SecureSourceManager::update_pull_request] calls.
2892    ///
2893    /// # Example
2894    /// ```
2895    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::UpdatePullRequest;
2896    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
2897    /// use google_cloud_lro::Poller;
2898    ///
2899    /// let builder = prepare_request_builder();
2900    /// let response = builder.poller().until_done().await?;
2901    /// # Ok(()) }
2902    ///
2903    /// fn prepare_request_builder() -> UpdatePullRequest {
2904    ///   # panic!();
2905    ///   // ... details omitted ...
2906    /// }
2907    /// ```
2908    #[derive(Clone, Debug)]
2909    pub struct UpdatePullRequest(RequestBuilder<crate::model::UpdatePullRequestRequest>);
2910
2911    impl UpdatePullRequest {
2912        pub(crate) fn new(
2913            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
2914        ) -> Self {
2915            Self(RequestBuilder::new(stub))
2916        }
2917
2918        /// Sets the full request, replacing any prior values.
2919        pub fn with_request<V: Into<crate::model::UpdatePullRequestRequest>>(
2920            mut self,
2921            v: V,
2922        ) -> Self {
2923            self.0.request = v.into();
2924            self
2925        }
2926
2927        /// Sets all the options, replacing any prior values.
2928        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2929            self.0.options = v.into();
2930            self
2931        }
2932
2933        /// Sends the request.
2934        ///
2935        /// # Long running operations
2936        ///
2937        /// This starts, but does not poll, a longrunning operation. More information
2938        /// on [update_pull_request][crate::client::SecureSourceManager::update_pull_request].
2939        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2940            (*self.0.stub)
2941                .update_pull_request(self.0.request, self.0.options)
2942                .await
2943                .map(crate::Response::into_body)
2944        }
2945
2946        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_pull_request`.
2947        pub fn poller(
2948            self,
2949        ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
2950        {
2951            type Operation = google_cloud_lro::internal::Operation<
2952                crate::model::PullRequest,
2953                crate::model::OperationMetadata,
2954            >;
2955            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2956            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2957            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2958            if let Some(ref mut details) = poller_options.tracing {
2959                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::update_pull_request::until_done";
2960            }
2961
2962            let stub = self.0.stub.clone();
2963            let mut options = self.0.options.clone();
2964            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2965            let query = move |name| {
2966                let stub = stub.clone();
2967                let options = options.clone();
2968                async {
2969                    let op = GetOperation::new(stub)
2970                        .set_name(name)
2971                        .with_options(options)
2972                        .send()
2973                        .await?;
2974                    Ok(Operation::new(op))
2975                }
2976            };
2977
2978            let start = move || async {
2979                let op = self.send().await?;
2980                Ok(Operation::new(op))
2981            };
2982
2983            use google_cloud_lro::internal::PollerExt;
2984            {
2985                google_cloud_lro::internal::new_poller(
2986                    polling_error_policy,
2987                    polling_backoff_policy,
2988                    start,
2989                    query,
2990                )
2991            }
2992            .with_options(poller_options)
2993        }
2994
2995        /// Sets the value of [pull_request][crate::model::UpdatePullRequestRequest::pull_request].
2996        ///
2997        /// This is a **required** field for requests.
2998        pub fn set_pull_request<T>(mut self, v: T) -> Self
2999        where
3000            T: std::convert::Into<crate::model::PullRequest>,
3001        {
3002            self.0.request.pull_request = std::option::Option::Some(v.into());
3003            self
3004        }
3005
3006        /// Sets or clears the value of [pull_request][crate::model::UpdatePullRequestRequest::pull_request].
3007        ///
3008        /// This is a **required** field for requests.
3009        pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
3010        where
3011            T: std::convert::Into<crate::model::PullRequest>,
3012        {
3013            self.0.request.pull_request = v.map(|x| x.into());
3014            self
3015        }
3016
3017        /// Sets the value of [update_mask][crate::model::UpdatePullRequestRequest::update_mask].
3018        pub fn set_update_mask<T>(mut self, v: T) -> Self
3019        where
3020            T: std::convert::Into<wkt::FieldMask>,
3021        {
3022            self.0.request.update_mask = std::option::Option::Some(v.into());
3023            self
3024        }
3025
3026        /// Sets or clears the value of [update_mask][crate::model::UpdatePullRequestRequest::update_mask].
3027        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3028        where
3029            T: std::convert::Into<wkt::FieldMask>,
3030        {
3031            self.0.request.update_mask = v.map(|x| x.into());
3032            self
3033        }
3034    }
3035
3036    #[doc(hidden)]
3037    impl crate::RequestBuilder for UpdatePullRequest {
3038        fn request_options(&mut self) -> &mut crate::RequestOptions {
3039            &mut self.0.options
3040        }
3041    }
3042
3043    /// The request builder for [SecureSourceManager::merge_pull_request][crate::client::SecureSourceManager::merge_pull_request] calls.
3044    ///
3045    /// # Example
3046    /// ```
3047    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::MergePullRequest;
3048    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
3049    /// use google_cloud_lro::Poller;
3050    ///
3051    /// let builder = prepare_request_builder();
3052    /// let response = builder.poller().until_done().await?;
3053    /// # Ok(()) }
3054    ///
3055    /// fn prepare_request_builder() -> MergePullRequest {
3056    ///   # panic!();
3057    ///   // ... details omitted ...
3058    /// }
3059    /// ```
3060    #[derive(Clone, Debug)]
3061    pub struct MergePullRequest(RequestBuilder<crate::model::MergePullRequestRequest>);
3062
3063    impl MergePullRequest {
3064        pub(crate) fn new(
3065            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3066        ) -> Self {
3067            Self(RequestBuilder::new(stub))
3068        }
3069
3070        /// Sets the full request, replacing any prior values.
3071        pub fn with_request<V: Into<crate::model::MergePullRequestRequest>>(
3072            mut self,
3073            v: V,
3074        ) -> Self {
3075            self.0.request = v.into();
3076            self
3077        }
3078
3079        /// Sets all the options, replacing any prior values.
3080        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3081            self.0.options = v.into();
3082            self
3083        }
3084
3085        /// Sends the request.
3086        ///
3087        /// # Long running operations
3088        ///
3089        /// This starts, but does not poll, a longrunning operation. More information
3090        /// on [merge_pull_request][crate::client::SecureSourceManager::merge_pull_request].
3091        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3092            (*self.0.stub)
3093                .merge_pull_request(self.0.request, self.0.options)
3094                .await
3095                .map(crate::Response::into_body)
3096        }
3097
3098        /// Creates a [Poller][google_cloud_lro::Poller] to work with `merge_pull_request`.
3099        pub fn poller(
3100            self,
3101        ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
3102        {
3103            type Operation = google_cloud_lro::internal::Operation<
3104                crate::model::PullRequest,
3105                crate::model::OperationMetadata,
3106            >;
3107            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3108            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3109            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3110            if let Some(ref mut details) = poller_options.tracing {
3111                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::merge_pull_request::until_done";
3112            }
3113
3114            let stub = self.0.stub.clone();
3115            let mut options = self.0.options.clone();
3116            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3117            let query = move |name| {
3118                let stub = stub.clone();
3119                let options = options.clone();
3120                async {
3121                    let op = GetOperation::new(stub)
3122                        .set_name(name)
3123                        .with_options(options)
3124                        .send()
3125                        .await?;
3126                    Ok(Operation::new(op))
3127                }
3128            };
3129
3130            let start = move || async {
3131                let op = self.send().await?;
3132                Ok(Operation::new(op))
3133            };
3134
3135            use google_cloud_lro::internal::PollerExt;
3136            {
3137                google_cloud_lro::internal::new_poller(
3138                    polling_error_policy,
3139                    polling_backoff_policy,
3140                    start,
3141                    query,
3142                )
3143            }
3144            .with_options(poller_options)
3145        }
3146
3147        /// Sets the value of [name][crate::model::MergePullRequestRequest::name].
3148        ///
3149        /// This is a **required** field for requests.
3150        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3151            self.0.request.name = v.into();
3152            self
3153        }
3154    }
3155
3156    #[doc(hidden)]
3157    impl crate::RequestBuilder for MergePullRequest {
3158        fn request_options(&mut self) -> &mut crate::RequestOptions {
3159            &mut self.0.options
3160        }
3161    }
3162
3163    /// The request builder for [SecureSourceManager::open_pull_request][crate::client::SecureSourceManager::open_pull_request] calls.
3164    ///
3165    /// # Example
3166    /// ```
3167    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::OpenPullRequest;
3168    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
3169    /// use google_cloud_lro::Poller;
3170    ///
3171    /// let builder = prepare_request_builder();
3172    /// let response = builder.poller().until_done().await?;
3173    /// # Ok(()) }
3174    ///
3175    /// fn prepare_request_builder() -> OpenPullRequest {
3176    ///   # panic!();
3177    ///   // ... details omitted ...
3178    /// }
3179    /// ```
3180    #[derive(Clone, Debug)]
3181    pub struct OpenPullRequest(RequestBuilder<crate::model::OpenPullRequestRequest>);
3182
3183    impl OpenPullRequest {
3184        pub(crate) fn new(
3185            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3186        ) -> Self {
3187            Self(RequestBuilder::new(stub))
3188        }
3189
3190        /// Sets the full request, replacing any prior values.
3191        pub fn with_request<V: Into<crate::model::OpenPullRequestRequest>>(mut self, v: V) -> Self {
3192            self.0.request = v.into();
3193            self
3194        }
3195
3196        /// Sets all the options, replacing any prior values.
3197        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3198            self.0.options = v.into();
3199            self
3200        }
3201
3202        /// Sends the request.
3203        ///
3204        /// # Long running operations
3205        ///
3206        /// This starts, but does not poll, a longrunning operation. More information
3207        /// on [open_pull_request][crate::client::SecureSourceManager::open_pull_request].
3208        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3209            (*self.0.stub)
3210                .open_pull_request(self.0.request, self.0.options)
3211                .await
3212                .map(crate::Response::into_body)
3213        }
3214
3215        /// Creates a [Poller][google_cloud_lro::Poller] to work with `open_pull_request`.
3216        pub fn poller(
3217            self,
3218        ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
3219        {
3220            type Operation = google_cloud_lro::internal::Operation<
3221                crate::model::PullRequest,
3222                crate::model::OperationMetadata,
3223            >;
3224            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3225            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3226            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3227            if let Some(ref mut details) = poller_options.tracing {
3228                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::open_pull_request::until_done";
3229            }
3230
3231            let stub = self.0.stub.clone();
3232            let mut options = self.0.options.clone();
3233            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3234            let query = move |name| {
3235                let stub = stub.clone();
3236                let options = options.clone();
3237                async {
3238                    let op = GetOperation::new(stub)
3239                        .set_name(name)
3240                        .with_options(options)
3241                        .send()
3242                        .await?;
3243                    Ok(Operation::new(op))
3244                }
3245            };
3246
3247            let start = move || async {
3248                let op = self.send().await?;
3249                Ok(Operation::new(op))
3250            };
3251
3252            use google_cloud_lro::internal::PollerExt;
3253            {
3254                google_cloud_lro::internal::new_poller(
3255                    polling_error_policy,
3256                    polling_backoff_policy,
3257                    start,
3258                    query,
3259                )
3260            }
3261            .with_options(poller_options)
3262        }
3263
3264        /// Sets the value of [name][crate::model::OpenPullRequestRequest::name].
3265        ///
3266        /// This is a **required** field for requests.
3267        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3268            self.0.request.name = v.into();
3269            self
3270        }
3271    }
3272
3273    #[doc(hidden)]
3274    impl crate::RequestBuilder for OpenPullRequest {
3275        fn request_options(&mut self) -> &mut crate::RequestOptions {
3276            &mut self.0.options
3277        }
3278    }
3279
3280    /// The request builder for [SecureSourceManager::close_pull_request][crate::client::SecureSourceManager::close_pull_request] calls.
3281    ///
3282    /// # Example
3283    /// ```
3284    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ClosePullRequest;
3285    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
3286    /// use google_cloud_lro::Poller;
3287    ///
3288    /// let builder = prepare_request_builder();
3289    /// let response = builder.poller().until_done().await?;
3290    /// # Ok(()) }
3291    ///
3292    /// fn prepare_request_builder() -> ClosePullRequest {
3293    ///   # panic!();
3294    ///   // ... details omitted ...
3295    /// }
3296    /// ```
3297    #[derive(Clone, Debug)]
3298    pub struct ClosePullRequest(RequestBuilder<crate::model::ClosePullRequestRequest>);
3299
3300    impl ClosePullRequest {
3301        pub(crate) fn new(
3302            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3303        ) -> Self {
3304            Self(RequestBuilder::new(stub))
3305        }
3306
3307        /// Sets the full request, replacing any prior values.
3308        pub fn with_request<V: Into<crate::model::ClosePullRequestRequest>>(
3309            mut self,
3310            v: V,
3311        ) -> Self {
3312            self.0.request = v.into();
3313            self
3314        }
3315
3316        /// Sets all the options, replacing any prior values.
3317        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3318            self.0.options = v.into();
3319            self
3320        }
3321
3322        /// Sends the request.
3323        ///
3324        /// # Long running operations
3325        ///
3326        /// This starts, but does not poll, a longrunning operation. More information
3327        /// on [close_pull_request][crate::client::SecureSourceManager::close_pull_request].
3328        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3329            (*self.0.stub)
3330                .close_pull_request(self.0.request, self.0.options)
3331                .await
3332                .map(crate::Response::into_body)
3333        }
3334
3335        /// Creates a [Poller][google_cloud_lro::Poller] to work with `close_pull_request`.
3336        pub fn poller(
3337            self,
3338        ) -> impl google_cloud_lro::Poller<crate::model::PullRequest, crate::model::OperationMetadata>
3339        {
3340            type Operation = google_cloud_lro::internal::Operation<
3341                crate::model::PullRequest,
3342                crate::model::OperationMetadata,
3343            >;
3344            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3345            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3346            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3347            if let Some(ref mut details) = poller_options.tracing {
3348                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::close_pull_request::until_done";
3349            }
3350
3351            let stub = self.0.stub.clone();
3352            let mut options = self.0.options.clone();
3353            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3354            let query = move |name| {
3355                let stub = stub.clone();
3356                let options = options.clone();
3357                async {
3358                    let op = GetOperation::new(stub)
3359                        .set_name(name)
3360                        .with_options(options)
3361                        .send()
3362                        .await?;
3363                    Ok(Operation::new(op))
3364                }
3365            };
3366
3367            let start = move || async {
3368                let op = self.send().await?;
3369                Ok(Operation::new(op))
3370            };
3371
3372            use google_cloud_lro::internal::PollerExt;
3373            {
3374                google_cloud_lro::internal::new_poller(
3375                    polling_error_policy,
3376                    polling_backoff_policy,
3377                    start,
3378                    query,
3379                )
3380            }
3381            .with_options(poller_options)
3382        }
3383
3384        /// Sets the value of [name][crate::model::ClosePullRequestRequest::name].
3385        ///
3386        /// This is a **required** field for requests.
3387        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3388            self.0.request.name = v.into();
3389            self
3390        }
3391    }
3392
3393    #[doc(hidden)]
3394    impl crate::RequestBuilder for ClosePullRequest {
3395        fn request_options(&mut self) -> &mut crate::RequestOptions {
3396            &mut self.0.options
3397        }
3398    }
3399
3400    /// The request builder for [SecureSourceManager::list_pull_request_file_diffs][crate::client::SecureSourceManager::list_pull_request_file_diffs] calls.
3401    ///
3402    /// # Example
3403    /// ```
3404    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ListPullRequestFileDiffs;
3405    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
3406    /// use google_cloud_gax::paginator::ItemPaginator;
3407    ///
3408    /// let builder = prepare_request_builder();
3409    /// let mut items = builder.by_item();
3410    /// while let Some(result) = items.next().await {
3411    ///   let item = result?;
3412    /// }
3413    /// # Ok(()) }
3414    ///
3415    /// fn prepare_request_builder() -> ListPullRequestFileDiffs {
3416    ///   # panic!();
3417    ///   // ... details omitted ...
3418    /// }
3419    /// ```
3420    #[derive(Clone, Debug)]
3421    pub struct ListPullRequestFileDiffs(
3422        RequestBuilder<crate::model::ListPullRequestFileDiffsRequest>,
3423    );
3424
3425    impl ListPullRequestFileDiffs {
3426        pub(crate) fn new(
3427            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3428        ) -> Self {
3429            Self(RequestBuilder::new(stub))
3430        }
3431
3432        /// Sets the full request, replacing any prior values.
3433        pub fn with_request<V: Into<crate::model::ListPullRequestFileDiffsRequest>>(
3434            mut self,
3435            v: V,
3436        ) -> Self {
3437            self.0.request = v.into();
3438            self
3439        }
3440
3441        /// Sets all the options, replacing any prior values.
3442        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3443            self.0.options = v.into();
3444            self
3445        }
3446
3447        /// Sends the request.
3448        pub async fn send(self) -> Result<crate::model::ListPullRequestFileDiffsResponse> {
3449            (*self.0.stub)
3450                .list_pull_request_file_diffs(self.0.request, self.0.options)
3451                .await
3452                .map(crate::Response::into_body)
3453        }
3454
3455        /// Streams each page in the collection.
3456        pub fn by_page(
3457            self,
3458        ) -> impl google_cloud_gax::paginator::Paginator<
3459            crate::model::ListPullRequestFileDiffsResponse,
3460            crate::Error,
3461        > {
3462            use std::clone::Clone;
3463            let token = self.0.request.page_token.clone();
3464            let execute = move |token: String| {
3465                let mut builder = self.clone();
3466                builder.0.request = builder.0.request.set_page_token(token);
3467                builder.send()
3468            };
3469            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3470        }
3471
3472        /// Streams each item in the collection.
3473        pub fn by_item(
3474            self,
3475        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3476            crate::model::ListPullRequestFileDiffsResponse,
3477            crate::Error,
3478        > {
3479            use google_cloud_gax::paginator::Paginator;
3480            self.by_page().items()
3481        }
3482
3483        /// Sets the value of [name][crate::model::ListPullRequestFileDiffsRequest::name].
3484        ///
3485        /// This is a **required** field for requests.
3486        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3487            self.0.request.name = v.into();
3488            self
3489        }
3490
3491        /// Sets the value of [page_size][crate::model::ListPullRequestFileDiffsRequest::page_size].
3492        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3493            self.0.request.page_size = v.into();
3494            self
3495        }
3496
3497        /// Sets the value of [page_token][crate::model::ListPullRequestFileDiffsRequest::page_token].
3498        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3499            self.0.request.page_token = v.into();
3500            self
3501        }
3502    }
3503
3504    #[doc(hidden)]
3505    impl crate::RequestBuilder for ListPullRequestFileDiffs {
3506        fn request_options(&mut self) -> &mut crate::RequestOptions {
3507            &mut self.0.options
3508        }
3509    }
3510
3511    /// The request builder for [SecureSourceManager::fetch_tree][crate::client::SecureSourceManager::fetch_tree] calls.
3512    ///
3513    /// # Example
3514    /// ```
3515    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::FetchTree;
3516    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
3517    /// use google_cloud_gax::paginator::ItemPaginator;
3518    ///
3519    /// let builder = prepare_request_builder();
3520    /// let mut items = builder.by_item();
3521    /// while let Some(result) = items.next().await {
3522    ///   let item = result?;
3523    /// }
3524    /// # Ok(()) }
3525    ///
3526    /// fn prepare_request_builder() -> FetchTree {
3527    ///   # panic!();
3528    ///   // ... details omitted ...
3529    /// }
3530    /// ```
3531    #[derive(Clone, Debug)]
3532    pub struct FetchTree(RequestBuilder<crate::model::FetchTreeRequest>);
3533
3534    impl FetchTree {
3535        pub(crate) fn new(
3536            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3537        ) -> Self {
3538            Self(RequestBuilder::new(stub))
3539        }
3540
3541        /// Sets the full request, replacing any prior values.
3542        pub fn with_request<V: Into<crate::model::FetchTreeRequest>>(mut self, v: V) -> Self {
3543            self.0.request = v.into();
3544            self
3545        }
3546
3547        /// Sets all the options, replacing any prior values.
3548        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3549            self.0.options = v.into();
3550            self
3551        }
3552
3553        /// Sends the request.
3554        pub async fn send(self) -> Result<crate::model::FetchTreeResponse> {
3555            (*self.0.stub)
3556                .fetch_tree(self.0.request, self.0.options)
3557                .await
3558                .map(crate::Response::into_body)
3559        }
3560
3561        /// Streams each page in the collection.
3562        pub fn by_page(
3563            self,
3564        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::FetchTreeResponse, crate::Error>
3565        {
3566            use std::clone::Clone;
3567            let token = self.0.request.page_token.clone();
3568            let execute = move |token: String| {
3569                let mut builder = self.clone();
3570                builder.0.request = builder.0.request.set_page_token(token);
3571                builder.send()
3572            };
3573            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3574        }
3575
3576        /// Streams each item in the collection.
3577        pub fn by_item(
3578            self,
3579        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::FetchTreeResponse, crate::Error>
3580        {
3581            use google_cloud_gax::paginator::Paginator;
3582            self.by_page().items()
3583        }
3584
3585        /// Sets the value of [repository][crate::model::FetchTreeRequest::repository].
3586        ///
3587        /// This is a **required** field for requests.
3588        pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
3589            self.0.request.repository = v.into();
3590            self
3591        }
3592
3593        /// Sets the value of [r#ref][crate::model::FetchTreeRequest::ref].
3594        pub fn set_ref<T: Into<std::string::String>>(mut self, v: T) -> Self {
3595            self.0.request.r#ref = v.into();
3596            self
3597        }
3598
3599        /// Sets the value of [recursive][crate::model::FetchTreeRequest::recursive].
3600        pub fn set_recursive<T: Into<bool>>(mut self, v: T) -> Self {
3601            self.0.request.recursive = v.into();
3602            self
3603        }
3604
3605        /// Sets the value of [page_size][crate::model::FetchTreeRequest::page_size].
3606        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3607            self.0.request.page_size = v.into();
3608            self
3609        }
3610
3611        /// Sets the value of [page_token][crate::model::FetchTreeRequest::page_token].
3612        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3613            self.0.request.page_token = v.into();
3614            self
3615        }
3616    }
3617
3618    #[doc(hidden)]
3619    impl crate::RequestBuilder for FetchTree {
3620        fn request_options(&mut self) -> &mut crate::RequestOptions {
3621            &mut self.0.options
3622        }
3623    }
3624
3625    /// The request builder for [SecureSourceManager::fetch_blob][crate::client::SecureSourceManager::fetch_blob] calls.
3626    ///
3627    /// # Example
3628    /// ```
3629    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::FetchBlob;
3630    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
3631    ///
3632    /// let builder = prepare_request_builder();
3633    /// let response = builder.send().await?;
3634    /// # Ok(()) }
3635    ///
3636    /// fn prepare_request_builder() -> FetchBlob {
3637    ///   # panic!();
3638    ///   // ... details omitted ...
3639    /// }
3640    /// ```
3641    #[derive(Clone, Debug)]
3642    pub struct FetchBlob(RequestBuilder<crate::model::FetchBlobRequest>);
3643
3644    impl FetchBlob {
3645        pub(crate) fn new(
3646            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3647        ) -> Self {
3648            Self(RequestBuilder::new(stub))
3649        }
3650
3651        /// Sets the full request, replacing any prior values.
3652        pub fn with_request<V: Into<crate::model::FetchBlobRequest>>(mut self, v: V) -> Self {
3653            self.0.request = v.into();
3654            self
3655        }
3656
3657        /// Sets all the options, replacing any prior values.
3658        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3659            self.0.options = v.into();
3660            self
3661        }
3662
3663        /// Sends the request.
3664        pub async fn send(self) -> Result<crate::model::FetchBlobResponse> {
3665            (*self.0.stub)
3666                .fetch_blob(self.0.request, self.0.options)
3667                .await
3668                .map(crate::Response::into_body)
3669        }
3670
3671        /// Sets the value of [repository][crate::model::FetchBlobRequest::repository].
3672        ///
3673        /// This is a **required** field for requests.
3674        pub fn set_repository<T: Into<std::string::String>>(mut self, v: T) -> Self {
3675            self.0.request.repository = v.into();
3676            self
3677        }
3678
3679        /// Sets the value of [sha][crate::model::FetchBlobRequest::sha].
3680        ///
3681        /// This is a **required** field for requests.
3682        pub fn set_sha<T: Into<std::string::String>>(mut self, v: T) -> Self {
3683            self.0.request.sha = v.into();
3684            self
3685        }
3686    }
3687
3688    #[doc(hidden)]
3689    impl crate::RequestBuilder for FetchBlob {
3690        fn request_options(&mut self) -> &mut crate::RequestOptions {
3691            &mut self.0.options
3692        }
3693    }
3694
3695    /// The request builder for [SecureSourceManager::create_issue][crate::client::SecureSourceManager::create_issue] calls.
3696    ///
3697    /// # Example
3698    /// ```
3699    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::CreateIssue;
3700    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
3701    /// use google_cloud_lro::Poller;
3702    ///
3703    /// let builder = prepare_request_builder();
3704    /// let response = builder.poller().until_done().await?;
3705    /// # Ok(()) }
3706    ///
3707    /// fn prepare_request_builder() -> CreateIssue {
3708    ///   # panic!();
3709    ///   // ... details omitted ...
3710    /// }
3711    /// ```
3712    #[derive(Clone, Debug)]
3713    pub struct CreateIssue(RequestBuilder<crate::model::CreateIssueRequest>);
3714
3715    impl CreateIssue {
3716        pub(crate) fn new(
3717            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3718        ) -> Self {
3719            Self(RequestBuilder::new(stub))
3720        }
3721
3722        /// Sets the full request, replacing any prior values.
3723        pub fn with_request<V: Into<crate::model::CreateIssueRequest>>(mut self, v: V) -> Self {
3724            self.0.request = v.into();
3725            self
3726        }
3727
3728        /// Sets all the options, replacing any prior values.
3729        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3730            self.0.options = v.into();
3731            self
3732        }
3733
3734        /// Sends the request.
3735        ///
3736        /// # Long running operations
3737        ///
3738        /// This starts, but does not poll, a longrunning operation. More information
3739        /// on [create_issue][crate::client::SecureSourceManager::create_issue].
3740        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3741            (*self.0.stub)
3742                .create_issue(self.0.request, self.0.options)
3743                .await
3744                .map(crate::Response::into_body)
3745        }
3746
3747        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_issue`.
3748        pub fn poller(
3749            self,
3750        ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
3751        {
3752            type Operation = google_cloud_lro::internal::Operation<
3753                crate::model::Issue,
3754                crate::model::OperationMetadata,
3755            >;
3756            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3757            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3758            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3759            if let Some(ref mut details) = poller_options.tracing {
3760                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::create_issue::until_done";
3761            }
3762
3763            let stub = self.0.stub.clone();
3764            let mut options = self.0.options.clone();
3765            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3766            let query = move |name| {
3767                let stub = stub.clone();
3768                let options = options.clone();
3769                async {
3770                    let op = GetOperation::new(stub)
3771                        .set_name(name)
3772                        .with_options(options)
3773                        .send()
3774                        .await?;
3775                    Ok(Operation::new(op))
3776                }
3777            };
3778
3779            let start = move || async {
3780                let op = self.send().await?;
3781                Ok(Operation::new(op))
3782            };
3783
3784            use google_cloud_lro::internal::PollerExt;
3785            {
3786                google_cloud_lro::internal::new_poller(
3787                    polling_error_policy,
3788                    polling_backoff_policy,
3789                    start,
3790                    query,
3791                )
3792            }
3793            .with_options(poller_options)
3794        }
3795
3796        /// Sets the value of [parent][crate::model::CreateIssueRequest::parent].
3797        ///
3798        /// This is a **required** field for requests.
3799        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3800            self.0.request.parent = v.into();
3801            self
3802        }
3803
3804        /// Sets the value of [issue][crate::model::CreateIssueRequest::issue].
3805        ///
3806        /// This is a **required** field for requests.
3807        pub fn set_issue<T>(mut self, v: T) -> Self
3808        where
3809            T: std::convert::Into<crate::model::Issue>,
3810        {
3811            self.0.request.issue = std::option::Option::Some(v.into());
3812            self
3813        }
3814
3815        /// Sets or clears the value of [issue][crate::model::CreateIssueRequest::issue].
3816        ///
3817        /// This is a **required** field for requests.
3818        pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
3819        where
3820            T: std::convert::Into<crate::model::Issue>,
3821        {
3822            self.0.request.issue = v.map(|x| x.into());
3823            self
3824        }
3825    }
3826
3827    #[doc(hidden)]
3828    impl crate::RequestBuilder for CreateIssue {
3829        fn request_options(&mut self) -> &mut crate::RequestOptions {
3830            &mut self.0.options
3831        }
3832    }
3833
3834    /// The request builder for [SecureSourceManager::get_issue][crate::client::SecureSourceManager::get_issue] calls.
3835    ///
3836    /// # Example
3837    /// ```
3838    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetIssue;
3839    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
3840    ///
3841    /// let builder = prepare_request_builder();
3842    /// let response = builder.send().await?;
3843    /// # Ok(()) }
3844    ///
3845    /// fn prepare_request_builder() -> GetIssue {
3846    ///   # panic!();
3847    ///   // ... details omitted ...
3848    /// }
3849    /// ```
3850    #[derive(Clone, Debug)]
3851    pub struct GetIssue(RequestBuilder<crate::model::GetIssueRequest>);
3852
3853    impl GetIssue {
3854        pub(crate) fn new(
3855            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3856        ) -> Self {
3857            Self(RequestBuilder::new(stub))
3858        }
3859
3860        /// Sets the full request, replacing any prior values.
3861        pub fn with_request<V: Into<crate::model::GetIssueRequest>>(mut self, v: V) -> Self {
3862            self.0.request = v.into();
3863            self
3864        }
3865
3866        /// Sets all the options, replacing any prior values.
3867        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3868            self.0.options = v.into();
3869            self
3870        }
3871
3872        /// Sends the request.
3873        pub async fn send(self) -> Result<crate::model::Issue> {
3874            (*self.0.stub)
3875                .get_issue(self.0.request, self.0.options)
3876                .await
3877                .map(crate::Response::into_body)
3878        }
3879
3880        /// Sets the value of [name][crate::model::GetIssueRequest::name].
3881        ///
3882        /// This is a **required** field for requests.
3883        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3884            self.0.request.name = v.into();
3885            self
3886        }
3887    }
3888
3889    #[doc(hidden)]
3890    impl crate::RequestBuilder for GetIssue {
3891        fn request_options(&mut self) -> &mut crate::RequestOptions {
3892            &mut self.0.options
3893        }
3894    }
3895
3896    /// The request builder for [SecureSourceManager::list_issues][crate::client::SecureSourceManager::list_issues] calls.
3897    ///
3898    /// # Example
3899    /// ```
3900    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ListIssues;
3901    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
3902    /// use google_cloud_gax::paginator::ItemPaginator;
3903    ///
3904    /// let builder = prepare_request_builder();
3905    /// let mut items = builder.by_item();
3906    /// while let Some(result) = items.next().await {
3907    ///   let item = result?;
3908    /// }
3909    /// # Ok(()) }
3910    ///
3911    /// fn prepare_request_builder() -> ListIssues {
3912    ///   # panic!();
3913    ///   // ... details omitted ...
3914    /// }
3915    /// ```
3916    #[derive(Clone, Debug)]
3917    pub struct ListIssues(RequestBuilder<crate::model::ListIssuesRequest>);
3918
3919    impl ListIssues {
3920        pub(crate) fn new(
3921            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
3922        ) -> Self {
3923            Self(RequestBuilder::new(stub))
3924        }
3925
3926        /// Sets the full request, replacing any prior values.
3927        pub fn with_request<V: Into<crate::model::ListIssuesRequest>>(mut self, v: V) -> Self {
3928            self.0.request = v.into();
3929            self
3930        }
3931
3932        /// Sets all the options, replacing any prior values.
3933        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3934            self.0.options = v.into();
3935            self
3936        }
3937
3938        /// Sends the request.
3939        pub async fn send(self) -> Result<crate::model::ListIssuesResponse> {
3940            (*self.0.stub)
3941                .list_issues(self.0.request, self.0.options)
3942                .await
3943                .map(crate::Response::into_body)
3944        }
3945
3946        /// Streams each page in the collection.
3947        pub fn by_page(
3948            self,
3949        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListIssuesResponse, crate::Error>
3950        {
3951            use std::clone::Clone;
3952            let token = self.0.request.page_token.clone();
3953            let execute = move |token: String| {
3954                let mut builder = self.clone();
3955                builder.0.request = builder.0.request.set_page_token(token);
3956                builder.send()
3957            };
3958            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3959        }
3960
3961        /// Streams each item in the collection.
3962        pub fn by_item(
3963            self,
3964        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3965            crate::model::ListIssuesResponse,
3966            crate::Error,
3967        > {
3968            use google_cloud_gax::paginator::Paginator;
3969            self.by_page().items()
3970        }
3971
3972        /// Sets the value of [parent][crate::model::ListIssuesRequest::parent].
3973        ///
3974        /// This is a **required** field for requests.
3975        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3976            self.0.request.parent = v.into();
3977            self
3978        }
3979
3980        /// Sets the value of [page_size][crate::model::ListIssuesRequest::page_size].
3981        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3982            self.0.request.page_size = v.into();
3983            self
3984        }
3985
3986        /// Sets the value of [page_token][crate::model::ListIssuesRequest::page_token].
3987        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3988            self.0.request.page_token = v.into();
3989            self
3990        }
3991
3992        /// Sets the value of [filter][crate::model::ListIssuesRequest::filter].
3993        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3994            self.0.request.filter = v.into();
3995            self
3996        }
3997    }
3998
3999    #[doc(hidden)]
4000    impl crate::RequestBuilder for ListIssues {
4001        fn request_options(&mut self) -> &mut crate::RequestOptions {
4002            &mut self.0.options
4003        }
4004    }
4005
4006    /// The request builder for [SecureSourceManager::update_issue][crate::client::SecureSourceManager::update_issue] calls.
4007    ///
4008    /// # Example
4009    /// ```
4010    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::UpdateIssue;
4011    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
4012    /// use google_cloud_lro::Poller;
4013    ///
4014    /// let builder = prepare_request_builder();
4015    /// let response = builder.poller().until_done().await?;
4016    /// # Ok(()) }
4017    ///
4018    /// fn prepare_request_builder() -> UpdateIssue {
4019    ///   # panic!();
4020    ///   // ... details omitted ...
4021    /// }
4022    /// ```
4023    #[derive(Clone, Debug)]
4024    pub struct UpdateIssue(RequestBuilder<crate::model::UpdateIssueRequest>);
4025
4026    impl UpdateIssue {
4027        pub(crate) fn new(
4028            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4029        ) -> Self {
4030            Self(RequestBuilder::new(stub))
4031        }
4032
4033        /// Sets the full request, replacing any prior values.
4034        pub fn with_request<V: Into<crate::model::UpdateIssueRequest>>(mut self, v: V) -> Self {
4035            self.0.request = v.into();
4036            self
4037        }
4038
4039        /// Sets all the options, replacing any prior values.
4040        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4041            self.0.options = v.into();
4042            self
4043        }
4044
4045        /// Sends the request.
4046        ///
4047        /// # Long running operations
4048        ///
4049        /// This starts, but does not poll, a longrunning operation. More information
4050        /// on [update_issue][crate::client::SecureSourceManager::update_issue].
4051        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4052            (*self.0.stub)
4053                .update_issue(self.0.request, self.0.options)
4054                .await
4055                .map(crate::Response::into_body)
4056        }
4057
4058        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_issue`.
4059        pub fn poller(
4060            self,
4061        ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
4062        {
4063            type Operation = google_cloud_lro::internal::Operation<
4064                crate::model::Issue,
4065                crate::model::OperationMetadata,
4066            >;
4067            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4068            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4069            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4070            if let Some(ref mut details) = poller_options.tracing {
4071                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::update_issue::until_done";
4072            }
4073
4074            let stub = self.0.stub.clone();
4075            let mut options = self.0.options.clone();
4076            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4077            let query = move |name| {
4078                let stub = stub.clone();
4079                let options = options.clone();
4080                async {
4081                    let op = GetOperation::new(stub)
4082                        .set_name(name)
4083                        .with_options(options)
4084                        .send()
4085                        .await?;
4086                    Ok(Operation::new(op))
4087                }
4088            };
4089
4090            let start = move || async {
4091                let op = self.send().await?;
4092                Ok(Operation::new(op))
4093            };
4094
4095            use google_cloud_lro::internal::PollerExt;
4096            {
4097                google_cloud_lro::internal::new_poller(
4098                    polling_error_policy,
4099                    polling_backoff_policy,
4100                    start,
4101                    query,
4102                )
4103            }
4104            .with_options(poller_options)
4105        }
4106
4107        /// Sets the value of [issue][crate::model::UpdateIssueRequest::issue].
4108        ///
4109        /// This is a **required** field for requests.
4110        pub fn set_issue<T>(mut self, v: T) -> Self
4111        where
4112            T: std::convert::Into<crate::model::Issue>,
4113        {
4114            self.0.request.issue = std::option::Option::Some(v.into());
4115            self
4116        }
4117
4118        /// Sets or clears the value of [issue][crate::model::UpdateIssueRequest::issue].
4119        ///
4120        /// This is a **required** field for requests.
4121        pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
4122        where
4123            T: std::convert::Into<crate::model::Issue>,
4124        {
4125            self.0.request.issue = v.map(|x| x.into());
4126            self
4127        }
4128
4129        /// Sets the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
4130        pub fn set_update_mask<T>(mut self, v: T) -> Self
4131        where
4132            T: std::convert::Into<wkt::FieldMask>,
4133        {
4134            self.0.request.update_mask = std::option::Option::Some(v.into());
4135            self
4136        }
4137
4138        /// Sets or clears the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
4139        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4140        where
4141            T: std::convert::Into<wkt::FieldMask>,
4142        {
4143            self.0.request.update_mask = v.map(|x| x.into());
4144            self
4145        }
4146    }
4147
4148    #[doc(hidden)]
4149    impl crate::RequestBuilder for UpdateIssue {
4150        fn request_options(&mut self) -> &mut crate::RequestOptions {
4151            &mut self.0.options
4152        }
4153    }
4154
4155    /// The request builder for [SecureSourceManager::delete_issue][crate::client::SecureSourceManager::delete_issue] calls.
4156    ///
4157    /// # Example
4158    /// ```
4159    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::DeleteIssue;
4160    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
4161    /// use google_cloud_lro::Poller;
4162    ///
4163    /// let builder = prepare_request_builder();
4164    /// let response = builder.poller().until_done().await?;
4165    /// # Ok(()) }
4166    ///
4167    /// fn prepare_request_builder() -> DeleteIssue {
4168    ///   # panic!();
4169    ///   // ... details omitted ...
4170    /// }
4171    /// ```
4172    #[derive(Clone, Debug)]
4173    pub struct DeleteIssue(RequestBuilder<crate::model::DeleteIssueRequest>);
4174
4175    impl DeleteIssue {
4176        pub(crate) fn new(
4177            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4178        ) -> Self {
4179            Self(RequestBuilder::new(stub))
4180        }
4181
4182        /// Sets the full request, replacing any prior values.
4183        pub fn with_request<V: Into<crate::model::DeleteIssueRequest>>(mut self, v: V) -> Self {
4184            self.0.request = v.into();
4185            self
4186        }
4187
4188        /// Sets all the options, replacing any prior values.
4189        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4190            self.0.options = v.into();
4191            self
4192        }
4193
4194        /// Sends the request.
4195        ///
4196        /// # Long running operations
4197        ///
4198        /// This starts, but does not poll, a longrunning operation. More information
4199        /// on [delete_issue][crate::client::SecureSourceManager::delete_issue].
4200        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4201            (*self.0.stub)
4202                .delete_issue(self.0.request, self.0.options)
4203                .await
4204                .map(crate::Response::into_body)
4205        }
4206
4207        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_issue`.
4208        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4209            type Operation =
4210                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4211            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4212            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4213            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4214            if let Some(ref mut details) = poller_options.tracing {
4215                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::delete_issue::until_done";
4216            }
4217
4218            let stub = self.0.stub.clone();
4219            let mut options = self.0.options.clone();
4220            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4221            let query = move |name| {
4222                let stub = stub.clone();
4223                let options = options.clone();
4224                async {
4225                    let op = GetOperation::new(stub)
4226                        .set_name(name)
4227                        .with_options(options)
4228                        .send()
4229                        .await?;
4230                    Ok(Operation::new(op))
4231                }
4232            };
4233
4234            let start = move || async {
4235                let op = self.send().await?;
4236                Ok(Operation::new(op))
4237            };
4238
4239            use google_cloud_lro::internal::PollerExt;
4240            {
4241                google_cloud_lro::internal::new_unit_response_poller(
4242                    polling_error_policy,
4243                    polling_backoff_policy,
4244                    start,
4245                    query,
4246                )
4247            }
4248            .with_options(poller_options)
4249        }
4250
4251        /// Sets the value of [name][crate::model::DeleteIssueRequest::name].
4252        ///
4253        /// This is a **required** field for requests.
4254        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4255            self.0.request.name = v.into();
4256            self
4257        }
4258
4259        /// Sets the value of [etag][crate::model::DeleteIssueRequest::etag].
4260        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4261            self.0.request.etag = v.into();
4262            self
4263        }
4264    }
4265
4266    #[doc(hidden)]
4267    impl crate::RequestBuilder for DeleteIssue {
4268        fn request_options(&mut self) -> &mut crate::RequestOptions {
4269            &mut self.0.options
4270        }
4271    }
4272
4273    /// The request builder for [SecureSourceManager::open_issue][crate::client::SecureSourceManager::open_issue] calls.
4274    ///
4275    /// # Example
4276    /// ```
4277    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::OpenIssue;
4278    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
4279    /// use google_cloud_lro::Poller;
4280    ///
4281    /// let builder = prepare_request_builder();
4282    /// let response = builder.poller().until_done().await?;
4283    /// # Ok(()) }
4284    ///
4285    /// fn prepare_request_builder() -> OpenIssue {
4286    ///   # panic!();
4287    ///   // ... details omitted ...
4288    /// }
4289    /// ```
4290    #[derive(Clone, Debug)]
4291    pub struct OpenIssue(RequestBuilder<crate::model::OpenIssueRequest>);
4292
4293    impl OpenIssue {
4294        pub(crate) fn new(
4295            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4296        ) -> Self {
4297            Self(RequestBuilder::new(stub))
4298        }
4299
4300        /// Sets the full request, replacing any prior values.
4301        pub fn with_request<V: Into<crate::model::OpenIssueRequest>>(mut self, v: V) -> Self {
4302            self.0.request = v.into();
4303            self
4304        }
4305
4306        /// Sets all the options, replacing any prior values.
4307        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4308            self.0.options = v.into();
4309            self
4310        }
4311
4312        /// Sends the request.
4313        ///
4314        /// # Long running operations
4315        ///
4316        /// This starts, but does not poll, a longrunning operation. More information
4317        /// on [open_issue][crate::client::SecureSourceManager::open_issue].
4318        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4319            (*self.0.stub)
4320                .open_issue(self.0.request, self.0.options)
4321                .await
4322                .map(crate::Response::into_body)
4323        }
4324
4325        /// Creates a [Poller][google_cloud_lro::Poller] to work with `open_issue`.
4326        pub fn poller(
4327            self,
4328        ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
4329        {
4330            type Operation = google_cloud_lro::internal::Operation<
4331                crate::model::Issue,
4332                crate::model::OperationMetadata,
4333            >;
4334            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4335            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4336            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4337            if let Some(ref mut details) = poller_options.tracing {
4338                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::open_issue::until_done";
4339            }
4340
4341            let stub = self.0.stub.clone();
4342            let mut options = self.0.options.clone();
4343            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4344            let query = move |name| {
4345                let stub = stub.clone();
4346                let options = options.clone();
4347                async {
4348                    let op = GetOperation::new(stub)
4349                        .set_name(name)
4350                        .with_options(options)
4351                        .send()
4352                        .await?;
4353                    Ok(Operation::new(op))
4354                }
4355            };
4356
4357            let start = move || async {
4358                let op = self.send().await?;
4359                Ok(Operation::new(op))
4360            };
4361
4362            use google_cloud_lro::internal::PollerExt;
4363            {
4364                google_cloud_lro::internal::new_poller(
4365                    polling_error_policy,
4366                    polling_backoff_policy,
4367                    start,
4368                    query,
4369                )
4370            }
4371            .with_options(poller_options)
4372        }
4373
4374        /// Sets the value of [name][crate::model::OpenIssueRequest::name].
4375        ///
4376        /// This is a **required** field for requests.
4377        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4378            self.0.request.name = v.into();
4379            self
4380        }
4381
4382        /// Sets the value of [etag][crate::model::OpenIssueRequest::etag].
4383        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4384            self.0.request.etag = v.into();
4385            self
4386        }
4387    }
4388
4389    #[doc(hidden)]
4390    impl crate::RequestBuilder for OpenIssue {
4391        fn request_options(&mut self) -> &mut crate::RequestOptions {
4392            &mut self.0.options
4393        }
4394    }
4395
4396    /// The request builder for [SecureSourceManager::close_issue][crate::client::SecureSourceManager::close_issue] calls.
4397    ///
4398    /// # Example
4399    /// ```
4400    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::CloseIssue;
4401    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
4402    /// use google_cloud_lro::Poller;
4403    ///
4404    /// let builder = prepare_request_builder();
4405    /// let response = builder.poller().until_done().await?;
4406    /// # Ok(()) }
4407    ///
4408    /// fn prepare_request_builder() -> CloseIssue {
4409    ///   # panic!();
4410    ///   // ... details omitted ...
4411    /// }
4412    /// ```
4413    #[derive(Clone, Debug)]
4414    pub struct CloseIssue(RequestBuilder<crate::model::CloseIssueRequest>);
4415
4416    impl CloseIssue {
4417        pub(crate) fn new(
4418            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4419        ) -> Self {
4420            Self(RequestBuilder::new(stub))
4421        }
4422
4423        /// Sets the full request, replacing any prior values.
4424        pub fn with_request<V: Into<crate::model::CloseIssueRequest>>(mut self, v: V) -> Self {
4425            self.0.request = v.into();
4426            self
4427        }
4428
4429        /// Sets all the options, replacing any prior values.
4430        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4431            self.0.options = v.into();
4432            self
4433        }
4434
4435        /// Sends the request.
4436        ///
4437        /// # Long running operations
4438        ///
4439        /// This starts, but does not poll, a longrunning operation. More information
4440        /// on [close_issue][crate::client::SecureSourceManager::close_issue].
4441        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4442            (*self.0.stub)
4443                .close_issue(self.0.request, self.0.options)
4444                .await
4445                .map(crate::Response::into_body)
4446        }
4447
4448        /// Creates a [Poller][google_cloud_lro::Poller] to work with `close_issue`.
4449        pub fn poller(
4450            self,
4451        ) -> impl google_cloud_lro::Poller<crate::model::Issue, crate::model::OperationMetadata>
4452        {
4453            type Operation = google_cloud_lro::internal::Operation<
4454                crate::model::Issue,
4455                crate::model::OperationMetadata,
4456            >;
4457            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4458            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4459            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4460            if let Some(ref mut details) = poller_options.tracing {
4461                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::close_issue::until_done";
4462            }
4463
4464            let stub = self.0.stub.clone();
4465            let mut options = self.0.options.clone();
4466            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4467            let query = move |name| {
4468                let stub = stub.clone();
4469                let options = options.clone();
4470                async {
4471                    let op = GetOperation::new(stub)
4472                        .set_name(name)
4473                        .with_options(options)
4474                        .send()
4475                        .await?;
4476                    Ok(Operation::new(op))
4477                }
4478            };
4479
4480            let start = move || async {
4481                let op = self.send().await?;
4482                Ok(Operation::new(op))
4483            };
4484
4485            use google_cloud_lro::internal::PollerExt;
4486            {
4487                google_cloud_lro::internal::new_poller(
4488                    polling_error_policy,
4489                    polling_backoff_policy,
4490                    start,
4491                    query,
4492                )
4493            }
4494            .with_options(poller_options)
4495        }
4496
4497        /// Sets the value of [name][crate::model::CloseIssueRequest::name].
4498        ///
4499        /// This is a **required** field for requests.
4500        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4501            self.0.request.name = v.into();
4502            self
4503        }
4504
4505        /// Sets the value of [etag][crate::model::CloseIssueRequest::etag].
4506        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4507            self.0.request.etag = v.into();
4508            self
4509        }
4510    }
4511
4512    #[doc(hidden)]
4513    impl crate::RequestBuilder for CloseIssue {
4514        fn request_options(&mut self) -> &mut crate::RequestOptions {
4515            &mut self.0.options
4516        }
4517    }
4518
4519    /// The request builder for [SecureSourceManager::get_pull_request_comment][crate::client::SecureSourceManager::get_pull_request_comment] calls.
4520    ///
4521    /// # Example
4522    /// ```
4523    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetPullRequestComment;
4524    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
4525    ///
4526    /// let builder = prepare_request_builder();
4527    /// let response = builder.send().await?;
4528    /// # Ok(()) }
4529    ///
4530    /// fn prepare_request_builder() -> GetPullRequestComment {
4531    ///   # panic!();
4532    ///   // ... details omitted ...
4533    /// }
4534    /// ```
4535    #[derive(Clone, Debug)]
4536    pub struct GetPullRequestComment(RequestBuilder<crate::model::GetPullRequestCommentRequest>);
4537
4538    impl GetPullRequestComment {
4539        pub(crate) fn new(
4540            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4541        ) -> Self {
4542            Self(RequestBuilder::new(stub))
4543        }
4544
4545        /// Sets the full request, replacing any prior values.
4546        pub fn with_request<V: Into<crate::model::GetPullRequestCommentRequest>>(
4547            mut self,
4548            v: V,
4549        ) -> Self {
4550            self.0.request = v.into();
4551            self
4552        }
4553
4554        /// Sets all the options, replacing any prior values.
4555        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4556            self.0.options = v.into();
4557            self
4558        }
4559
4560        /// Sends the request.
4561        pub async fn send(self) -> Result<crate::model::PullRequestComment> {
4562            (*self.0.stub)
4563                .get_pull_request_comment(self.0.request, self.0.options)
4564                .await
4565                .map(crate::Response::into_body)
4566        }
4567
4568        /// Sets the value of [name][crate::model::GetPullRequestCommentRequest::name].
4569        ///
4570        /// This is a **required** field for requests.
4571        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4572            self.0.request.name = v.into();
4573            self
4574        }
4575    }
4576
4577    #[doc(hidden)]
4578    impl crate::RequestBuilder for GetPullRequestComment {
4579        fn request_options(&mut self) -> &mut crate::RequestOptions {
4580            &mut self.0.options
4581        }
4582    }
4583
4584    /// The request builder for [SecureSourceManager::list_pull_request_comments][crate::client::SecureSourceManager::list_pull_request_comments] calls.
4585    ///
4586    /// # Example
4587    /// ```
4588    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ListPullRequestComments;
4589    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
4590    /// use google_cloud_gax::paginator::ItemPaginator;
4591    ///
4592    /// let builder = prepare_request_builder();
4593    /// let mut items = builder.by_item();
4594    /// while let Some(result) = items.next().await {
4595    ///   let item = result?;
4596    /// }
4597    /// # Ok(()) }
4598    ///
4599    /// fn prepare_request_builder() -> ListPullRequestComments {
4600    ///   # panic!();
4601    ///   // ... details omitted ...
4602    /// }
4603    /// ```
4604    #[derive(Clone, Debug)]
4605    pub struct ListPullRequestComments(
4606        RequestBuilder<crate::model::ListPullRequestCommentsRequest>,
4607    );
4608
4609    impl ListPullRequestComments {
4610        pub(crate) fn new(
4611            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4612        ) -> Self {
4613            Self(RequestBuilder::new(stub))
4614        }
4615
4616        /// Sets the full request, replacing any prior values.
4617        pub fn with_request<V: Into<crate::model::ListPullRequestCommentsRequest>>(
4618            mut self,
4619            v: V,
4620        ) -> Self {
4621            self.0.request = v.into();
4622            self
4623        }
4624
4625        /// Sets all the options, replacing any prior values.
4626        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4627            self.0.options = v.into();
4628            self
4629        }
4630
4631        /// Sends the request.
4632        pub async fn send(self) -> Result<crate::model::ListPullRequestCommentsResponse> {
4633            (*self.0.stub)
4634                .list_pull_request_comments(self.0.request, self.0.options)
4635                .await
4636                .map(crate::Response::into_body)
4637        }
4638
4639        /// Streams each page in the collection.
4640        pub fn by_page(
4641            self,
4642        ) -> impl google_cloud_gax::paginator::Paginator<
4643            crate::model::ListPullRequestCommentsResponse,
4644            crate::Error,
4645        > {
4646            use std::clone::Clone;
4647            let token = self.0.request.page_token.clone();
4648            let execute = move |token: String| {
4649                let mut builder = self.clone();
4650                builder.0.request = builder.0.request.set_page_token(token);
4651                builder.send()
4652            };
4653            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4654        }
4655
4656        /// Streams each item in the collection.
4657        pub fn by_item(
4658            self,
4659        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4660            crate::model::ListPullRequestCommentsResponse,
4661            crate::Error,
4662        > {
4663            use google_cloud_gax::paginator::Paginator;
4664            self.by_page().items()
4665        }
4666
4667        /// Sets the value of [parent][crate::model::ListPullRequestCommentsRequest::parent].
4668        ///
4669        /// This is a **required** field for requests.
4670        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4671            self.0.request.parent = v.into();
4672            self
4673        }
4674
4675        /// Sets the value of [page_size][crate::model::ListPullRequestCommentsRequest::page_size].
4676        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4677            self.0.request.page_size = v.into();
4678            self
4679        }
4680
4681        /// Sets the value of [page_token][crate::model::ListPullRequestCommentsRequest::page_token].
4682        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4683            self.0.request.page_token = v.into();
4684            self
4685        }
4686    }
4687
4688    #[doc(hidden)]
4689    impl crate::RequestBuilder for ListPullRequestComments {
4690        fn request_options(&mut self) -> &mut crate::RequestOptions {
4691            &mut self.0.options
4692        }
4693    }
4694
4695    /// The request builder for [SecureSourceManager::create_pull_request_comment][crate::client::SecureSourceManager::create_pull_request_comment] calls.
4696    ///
4697    /// # Example
4698    /// ```
4699    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::CreatePullRequestComment;
4700    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
4701    /// use google_cloud_lro::Poller;
4702    ///
4703    /// let builder = prepare_request_builder();
4704    /// let response = builder.poller().until_done().await?;
4705    /// # Ok(()) }
4706    ///
4707    /// fn prepare_request_builder() -> CreatePullRequestComment {
4708    ///   # panic!();
4709    ///   // ... details omitted ...
4710    /// }
4711    /// ```
4712    #[derive(Clone, Debug)]
4713    pub struct CreatePullRequestComment(
4714        RequestBuilder<crate::model::CreatePullRequestCommentRequest>,
4715    );
4716
4717    impl CreatePullRequestComment {
4718        pub(crate) fn new(
4719            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4720        ) -> Self {
4721            Self(RequestBuilder::new(stub))
4722        }
4723
4724        /// Sets the full request, replacing any prior values.
4725        pub fn with_request<V: Into<crate::model::CreatePullRequestCommentRequest>>(
4726            mut self,
4727            v: V,
4728        ) -> Self {
4729            self.0.request = v.into();
4730            self
4731        }
4732
4733        /// Sets all the options, replacing any prior values.
4734        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4735            self.0.options = v.into();
4736            self
4737        }
4738
4739        /// Sends the request.
4740        ///
4741        /// # Long running operations
4742        ///
4743        /// This starts, but does not poll, a longrunning operation. More information
4744        /// on [create_pull_request_comment][crate::client::SecureSourceManager::create_pull_request_comment].
4745        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4746            (*self.0.stub)
4747                .create_pull_request_comment(self.0.request, self.0.options)
4748                .await
4749                .map(crate::Response::into_body)
4750        }
4751
4752        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_pull_request_comment`.
4753        pub fn poller(
4754            self,
4755        ) -> impl google_cloud_lro::Poller<
4756            crate::model::PullRequestComment,
4757            crate::model::OperationMetadata,
4758        > {
4759            type Operation = google_cloud_lro::internal::Operation<
4760                crate::model::PullRequestComment,
4761                crate::model::OperationMetadata,
4762            >;
4763            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4764            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4765            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4766            if let Some(ref mut details) = poller_options.tracing {
4767                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::create_pull_request_comment::until_done";
4768            }
4769
4770            let stub = self.0.stub.clone();
4771            let mut options = self.0.options.clone();
4772            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4773            let query = move |name| {
4774                let stub = stub.clone();
4775                let options = options.clone();
4776                async {
4777                    let op = GetOperation::new(stub)
4778                        .set_name(name)
4779                        .with_options(options)
4780                        .send()
4781                        .await?;
4782                    Ok(Operation::new(op))
4783                }
4784            };
4785
4786            let start = move || async {
4787                let op = self.send().await?;
4788                Ok(Operation::new(op))
4789            };
4790
4791            use google_cloud_lro::internal::PollerExt;
4792            {
4793                google_cloud_lro::internal::new_poller(
4794                    polling_error_policy,
4795                    polling_backoff_policy,
4796                    start,
4797                    query,
4798                )
4799            }
4800            .with_options(poller_options)
4801        }
4802
4803        /// Sets the value of [parent][crate::model::CreatePullRequestCommentRequest::parent].
4804        ///
4805        /// This is a **required** field for requests.
4806        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4807            self.0.request.parent = v.into();
4808            self
4809        }
4810
4811        /// Sets the value of [pull_request_comment][crate::model::CreatePullRequestCommentRequest::pull_request_comment].
4812        ///
4813        /// This is a **required** field for requests.
4814        pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
4815        where
4816            T: std::convert::Into<crate::model::PullRequestComment>,
4817        {
4818            self.0.request.pull_request_comment = std::option::Option::Some(v.into());
4819            self
4820        }
4821
4822        /// Sets or clears the value of [pull_request_comment][crate::model::CreatePullRequestCommentRequest::pull_request_comment].
4823        ///
4824        /// This is a **required** field for requests.
4825        pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
4826        where
4827            T: std::convert::Into<crate::model::PullRequestComment>,
4828        {
4829            self.0.request.pull_request_comment = v.map(|x| x.into());
4830            self
4831        }
4832    }
4833
4834    #[doc(hidden)]
4835    impl crate::RequestBuilder for CreatePullRequestComment {
4836        fn request_options(&mut self) -> &mut crate::RequestOptions {
4837            &mut self.0.options
4838        }
4839    }
4840
4841    /// The request builder for [SecureSourceManager::update_pull_request_comment][crate::client::SecureSourceManager::update_pull_request_comment] calls.
4842    ///
4843    /// # Example
4844    /// ```
4845    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::UpdatePullRequestComment;
4846    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
4847    /// use google_cloud_lro::Poller;
4848    ///
4849    /// let builder = prepare_request_builder();
4850    /// let response = builder.poller().until_done().await?;
4851    /// # Ok(()) }
4852    ///
4853    /// fn prepare_request_builder() -> UpdatePullRequestComment {
4854    ///   # panic!();
4855    ///   // ... details omitted ...
4856    /// }
4857    /// ```
4858    #[derive(Clone, Debug)]
4859    pub struct UpdatePullRequestComment(
4860        RequestBuilder<crate::model::UpdatePullRequestCommentRequest>,
4861    );
4862
4863    impl UpdatePullRequestComment {
4864        pub(crate) fn new(
4865            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
4866        ) -> Self {
4867            Self(RequestBuilder::new(stub))
4868        }
4869
4870        /// Sets the full request, replacing any prior values.
4871        pub fn with_request<V: Into<crate::model::UpdatePullRequestCommentRequest>>(
4872            mut self,
4873            v: V,
4874        ) -> Self {
4875            self.0.request = v.into();
4876            self
4877        }
4878
4879        /// Sets all the options, replacing any prior values.
4880        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4881            self.0.options = v.into();
4882            self
4883        }
4884
4885        /// Sends the request.
4886        ///
4887        /// # Long running operations
4888        ///
4889        /// This starts, but does not poll, a longrunning operation. More information
4890        /// on [update_pull_request_comment][crate::client::SecureSourceManager::update_pull_request_comment].
4891        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4892            (*self.0.stub)
4893                .update_pull_request_comment(self.0.request, self.0.options)
4894                .await
4895                .map(crate::Response::into_body)
4896        }
4897
4898        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_pull_request_comment`.
4899        pub fn poller(
4900            self,
4901        ) -> impl google_cloud_lro::Poller<
4902            crate::model::PullRequestComment,
4903            crate::model::OperationMetadata,
4904        > {
4905            type Operation = google_cloud_lro::internal::Operation<
4906                crate::model::PullRequestComment,
4907                crate::model::OperationMetadata,
4908            >;
4909            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4910            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4911            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4912            if let Some(ref mut details) = poller_options.tracing {
4913                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::update_pull_request_comment::until_done";
4914            }
4915
4916            let stub = self.0.stub.clone();
4917            let mut options = self.0.options.clone();
4918            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4919            let query = move |name| {
4920                let stub = stub.clone();
4921                let options = options.clone();
4922                async {
4923                    let op = GetOperation::new(stub)
4924                        .set_name(name)
4925                        .with_options(options)
4926                        .send()
4927                        .await?;
4928                    Ok(Operation::new(op))
4929                }
4930            };
4931
4932            let start = move || async {
4933                let op = self.send().await?;
4934                Ok(Operation::new(op))
4935            };
4936
4937            use google_cloud_lro::internal::PollerExt;
4938            {
4939                google_cloud_lro::internal::new_poller(
4940                    polling_error_policy,
4941                    polling_backoff_policy,
4942                    start,
4943                    query,
4944                )
4945            }
4946            .with_options(poller_options)
4947        }
4948
4949        /// Sets the value of [pull_request_comment][crate::model::UpdatePullRequestCommentRequest::pull_request_comment].
4950        ///
4951        /// This is a **required** field for requests.
4952        pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
4953        where
4954            T: std::convert::Into<crate::model::PullRequestComment>,
4955        {
4956            self.0.request.pull_request_comment = std::option::Option::Some(v.into());
4957            self
4958        }
4959
4960        /// Sets or clears the value of [pull_request_comment][crate::model::UpdatePullRequestCommentRequest::pull_request_comment].
4961        ///
4962        /// This is a **required** field for requests.
4963        pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
4964        where
4965            T: std::convert::Into<crate::model::PullRequestComment>,
4966        {
4967            self.0.request.pull_request_comment = v.map(|x| x.into());
4968            self
4969        }
4970
4971        /// Sets the value of [update_mask][crate::model::UpdatePullRequestCommentRequest::update_mask].
4972        pub fn set_update_mask<T>(mut self, v: T) -> Self
4973        where
4974            T: std::convert::Into<wkt::FieldMask>,
4975        {
4976            self.0.request.update_mask = std::option::Option::Some(v.into());
4977            self
4978        }
4979
4980        /// Sets or clears the value of [update_mask][crate::model::UpdatePullRequestCommentRequest::update_mask].
4981        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4982        where
4983            T: std::convert::Into<wkt::FieldMask>,
4984        {
4985            self.0.request.update_mask = v.map(|x| x.into());
4986            self
4987        }
4988    }
4989
4990    #[doc(hidden)]
4991    impl crate::RequestBuilder for UpdatePullRequestComment {
4992        fn request_options(&mut self) -> &mut crate::RequestOptions {
4993            &mut self.0.options
4994        }
4995    }
4996
4997    /// The request builder for [SecureSourceManager::delete_pull_request_comment][crate::client::SecureSourceManager::delete_pull_request_comment] calls.
4998    ///
4999    /// # Example
5000    /// ```
5001    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::DeletePullRequestComment;
5002    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
5003    /// use google_cloud_lro::Poller;
5004    ///
5005    /// let builder = prepare_request_builder();
5006    /// let response = builder.poller().until_done().await?;
5007    /// # Ok(()) }
5008    ///
5009    /// fn prepare_request_builder() -> DeletePullRequestComment {
5010    ///   # panic!();
5011    ///   // ... details omitted ...
5012    /// }
5013    /// ```
5014    #[derive(Clone, Debug)]
5015    pub struct DeletePullRequestComment(
5016        RequestBuilder<crate::model::DeletePullRequestCommentRequest>,
5017    );
5018
5019    impl DeletePullRequestComment {
5020        pub(crate) fn new(
5021            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5022        ) -> Self {
5023            Self(RequestBuilder::new(stub))
5024        }
5025
5026        /// Sets the full request, replacing any prior values.
5027        pub fn with_request<V: Into<crate::model::DeletePullRequestCommentRequest>>(
5028            mut self,
5029            v: V,
5030        ) -> Self {
5031            self.0.request = v.into();
5032            self
5033        }
5034
5035        /// Sets all the options, replacing any prior values.
5036        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5037            self.0.options = v.into();
5038            self
5039        }
5040
5041        /// Sends the request.
5042        ///
5043        /// # Long running operations
5044        ///
5045        /// This starts, but does not poll, a longrunning operation. More information
5046        /// on [delete_pull_request_comment][crate::client::SecureSourceManager::delete_pull_request_comment].
5047        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5048            (*self.0.stub)
5049                .delete_pull_request_comment(self.0.request, self.0.options)
5050                .await
5051                .map(crate::Response::into_body)
5052        }
5053
5054        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_pull_request_comment`.
5055        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5056            type Operation =
5057                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5058            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5059            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5060            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5061            if let Some(ref mut details) = poller_options.tracing {
5062                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::delete_pull_request_comment::until_done";
5063            }
5064
5065            let stub = self.0.stub.clone();
5066            let mut options = self.0.options.clone();
5067            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5068            let query = move |name| {
5069                let stub = stub.clone();
5070                let options = options.clone();
5071                async {
5072                    let op = GetOperation::new(stub)
5073                        .set_name(name)
5074                        .with_options(options)
5075                        .send()
5076                        .await?;
5077                    Ok(Operation::new(op))
5078                }
5079            };
5080
5081            let start = move || async {
5082                let op = self.send().await?;
5083                Ok(Operation::new(op))
5084            };
5085
5086            use google_cloud_lro::internal::PollerExt;
5087            {
5088                google_cloud_lro::internal::new_unit_response_poller(
5089                    polling_error_policy,
5090                    polling_backoff_policy,
5091                    start,
5092                    query,
5093                )
5094            }
5095            .with_options(poller_options)
5096        }
5097
5098        /// Sets the value of [name][crate::model::DeletePullRequestCommentRequest::name].
5099        ///
5100        /// This is a **required** field for requests.
5101        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5102            self.0.request.name = v.into();
5103            self
5104        }
5105    }
5106
5107    #[doc(hidden)]
5108    impl crate::RequestBuilder for DeletePullRequestComment {
5109        fn request_options(&mut self) -> &mut crate::RequestOptions {
5110            &mut self.0.options
5111        }
5112    }
5113
5114    /// The request builder for [SecureSourceManager::batch_create_pull_request_comments][crate::client::SecureSourceManager::batch_create_pull_request_comments] calls.
5115    ///
5116    /// # Example
5117    /// ```
5118    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::BatchCreatePullRequestComments;
5119    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
5120    /// use google_cloud_lro::Poller;
5121    ///
5122    /// let builder = prepare_request_builder();
5123    /// let response = builder.poller().until_done().await?;
5124    /// # Ok(()) }
5125    ///
5126    /// fn prepare_request_builder() -> BatchCreatePullRequestComments {
5127    ///   # panic!();
5128    ///   // ... details omitted ...
5129    /// }
5130    /// ```
5131    #[derive(Clone, Debug)]
5132    pub struct BatchCreatePullRequestComments(
5133        RequestBuilder<crate::model::BatchCreatePullRequestCommentsRequest>,
5134    );
5135
5136    impl BatchCreatePullRequestComments {
5137        pub(crate) fn new(
5138            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5139        ) -> Self {
5140            Self(RequestBuilder::new(stub))
5141        }
5142
5143        /// Sets the full request, replacing any prior values.
5144        pub fn with_request<V: Into<crate::model::BatchCreatePullRequestCommentsRequest>>(
5145            mut self,
5146            v: V,
5147        ) -> Self {
5148            self.0.request = v.into();
5149            self
5150        }
5151
5152        /// Sets all the options, replacing any prior values.
5153        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5154            self.0.options = v.into();
5155            self
5156        }
5157
5158        /// Sends the request.
5159        ///
5160        /// # Long running operations
5161        ///
5162        /// This starts, but does not poll, a longrunning operation. More information
5163        /// on [batch_create_pull_request_comments][crate::client::SecureSourceManager::batch_create_pull_request_comments].
5164        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5165            (*self.0.stub)
5166                .batch_create_pull_request_comments(self.0.request, self.0.options)
5167                .await
5168                .map(crate::Response::into_body)
5169        }
5170
5171        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_create_pull_request_comments`.
5172        pub fn poller(
5173            self,
5174        ) -> impl google_cloud_lro::Poller<
5175            crate::model::BatchCreatePullRequestCommentsResponse,
5176            crate::model::OperationMetadata,
5177        > {
5178            type Operation = google_cloud_lro::internal::Operation<
5179                crate::model::BatchCreatePullRequestCommentsResponse,
5180                crate::model::OperationMetadata,
5181            >;
5182            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5183            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5184            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5185            if let Some(ref mut details) = poller_options.tracing {
5186                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::batch_create_pull_request_comments::until_done";
5187            }
5188
5189            let stub = self.0.stub.clone();
5190            let mut options = self.0.options.clone();
5191            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5192            let query = move |name| {
5193                let stub = stub.clone();
5194                let options = options.clone();
5195                async {
5196                    let op = GetOperation::new(stub)
5197                        .set_name(name)
5198                        .with_options(options)
5199                        .send()
5200                        .await?;
5201                    Ok(Operation::new(op))
5202                }
5203            };
5204
5205            let start = move || async {
5206                let op = self.send().await?;
5207                Ok(Operation::new(op))
5208            };
5209
5210            use google_cloud_lro::internal::PollerExt;
5211            {
5212                google_cloud_lro::internal::new_poller(
5213                    polling_error_policy,
5214                    polling_backoff_policy,
5215                    start,
5216                    query,
5217                )
5218            }
5219            .with_options(poller_options)
5220        }
5221
5222        /// Sets the value of [parent][crate::model::BatchCreatePullRequestCommentsRequest::parent].
5223        ///
5224        /// This is a **required** field for requests.
5225        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5226            self.0.request.parent = v.into();
5227            self
5228        }
5229
5230        /// Sets the value of [requests][crate::model::BatchCreatePullRequestCommentsRequest::requests].
5231        ///
5232        /// This is a **required** field for requests.
5233        pub fn set_requests<T, V>(mut self, v: T) -> Self
5234        where
5235            T: std::iter::IntoIterator<Item = V>,
5236            V: std::convert::Into<crate::model::CreatePullRequestCommentRequest>,
5237        {
5238            use std::iter::Iterator;
5239            self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
5240            self
5241        }
5242    }
5243
5244    #[doc(hidden)]
5245    impl crate::RequestBuilder for BatchCreatePullRequestComments {
5246        fn request_options(&mut self) -> &mut crate::RequestOptions {
5247            &mut self.0.options
5248        }
5249    }
5250
5251    /// The request builder for [SecureSourceManager::resolve_pull_request_comments][crate::client::SecureSourceManager::resolve_pull_request_comments] calls.
5252    ///
5253    /// # Example
5254    /// ```
5255    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ResolvePullRequestComments;
5256    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
5257    /// use google_cloud_lro::Poller;
5258    ///
5259    /// let builder = prepare_request_builder();
5260    /// let response = builder.poller().until_done().await?;
5261    /// # Ok(()) }
5262    ///
5263    /// fn prepare_request_builder() -> ResolvePullRequestComments {
5264    ///   # panic!();
5265    ///   // ... details omitted ...
5266    /// }
5267    /// ```
5268    #[derive(Clone, Debug)]
5269    pub struct ResolvePullRequestComments(
5270        RequestBuilder<crate::model::ResolvePullRequestCommentsRequest>,
5271    );
5272
5273    impl ResolvePullRequestComments {
5274        pub(crate) fn new(
5275            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5276        ) -> Self {
5277            Self(RequestBuilder::new(stub))
5278        }
5279
5280        /// Sets the full request, replacing any prior values.
5281        pub fn with_request<V: Into<crate::model::ResolvePullRequestCommentsRequest>>(
5282            mut self,
5283            v: V,
5284        ) -> Self {
5285            self.0.request = v.into();
5286            self
5287        }
5288
5289        /// Sets all the options, replacing any prior values.
5290        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5291            self.0.options = v.into();
5292            self
5293        }
5294
5295        /// Sends the request.
5296        ///
5297        /// # Long running operations
5298        ///
5299        /// This starts, but does not poll, a longrunning operation. More information
5300        /// on [resolve_pull_request_comments][crate::client::SecureSourceManager::resolve_pull_request_comments].
5301        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5302            (*self.0.stub)
5303                .resolve_pull_request_comments(self.0.request, self.0.options)
5304                .await
5305                .map(crate::Response::into_body)
5306        }
5307
5308        /// Creates a [Poller][google_cloud_lro::Poller] to work with `resolve_pull_request_comments`.
5309        pub fn poller(
5310            self,
5311        ) -> impl google_cloud_lro::Poller<
5312            crate::model::ResolvePullRequestCommentsResponse,
5313            crate::model::OperationMetadata,
5314        > {
5315            type Operation = google_cloud_lro::internal::Operation<
5316                crate::model::ResolvePullRequestCommentsResponse,
5317                crate::model::OperationMetadata,
5318            >;
5319            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5320            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5321            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5322            if let Some(ref mut details) = poller_options.tracing {
5323                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::resolve_pull_request_comments::until_done";
5324            }
5325
5326            let stub = self.0.stub.clone();
5327            let mut options = self.0.options.clone();
5328            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5329            let query = move |name| {
5330                let stub = stub.clone();
5331                let options = options.clone();
5332                async {
5333                    let op = GetOperation::new(stub)
5334                        .set_name(name)
5335                        .with_options(options)
5336                        .send()
5337                        .await?;
5338                    Ok(Operation::new(op))
5339                }
5340            };
5341
5342            let start = move || async {
5343                let op = self.send().await?;
5344                Ok(Operation::new(op))
5345            };
5346
5347            use google_cloud_lro::internal::PollerExt;
5348            {
5349                google_cloud_lro::internal::new_poller(
5350                    polling_error_policy,
5351                    polling_backoff_policy,
5352                    start,
5353                    query,
5354                )
5355            }
5356            .with_options(poller_options)
5357        }
5358
5359        /// Sets the value of [parent][crate::model::ResolvePullRequestCommentsRequest::parent].
5360        ///
5361        /// This is a **required** field for requests.
5362        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5363            self.0.request.parent = v.into();
5364            self
5365        }
5366
5367        /// Sets the value of [names][crate::model::ResolvePullRequestCommentsRequest::names].
5368        ///
5369        /// This is a **required** field for requests.
5370        pub fn set_names<T, V>(mut self, v: T) -> Self
5371        where
5372            T: std::iter::IntoIterator<Item = V>,
5373            V: std::convert::Into<std::string::String>,
5374        {
5375            use std::iter::Iterator;
5376            self.0.request.names = v.into_iter().map(|i| i.into()).collect();
5377            self
5378        }
5379
5380        /// Sets the value of [auto_fill][crate::model::ResolvePullRequestCommentsRequest::auto_fill].
5381        pub fn set_auto_fill<T: Into<bool>>(mut self, v: T) -> Self {
5382            self.0.request.auto_fill = v.into();
5383            self
5384        }
5385    }
5386
5387    #[doc(hidden)]
5388    impl crate::RequestBuilder for ResolvePullRequestComments {
5389        fn request_options(&mut self) -> &mut crate::RequestOptions {
5390            &mut self.0.options
5391        }
5392    }
5393
5394    /// The request builder for [SecureSourceManager::unresolve_pull_request_comments][crate::client::SecureSourceManager::unresolve_pull_request_comments] calls.
5395    ///
5396    /// # Example
5397    /// ```
5398    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::UnresolvePullRequestComments;
5399    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
5400    /// use google_cloud_lro::Poller;
5401    ///
5402    /// let builder = prepare_request_builder();
5403    /// let response = builder.poller().until_done().await?;
5404    /// # Ok(()) }
5405    ///
5406    /// fn prepare_request_builder() -> UnresolvePullRequestComments {
5407    ///   # panic!();
5408    ///   // ... details omitted ...
5409    /// }
5410    /// ```
5411    #[derive(Clone, Debug)]
5412    pub struct UnresolvePullRequestComments(
5413        RequestBuilder<crate::model::UnresolvePullRequestCommentsRequest>,
5414    );
5415
5416    impl UnresolvePullRequestComments {
5417        pub(crate) fn new(
5418            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5419        ) -> Self {
5420            Self(RequestBuilder::new(stub))
5421        }
5422
5423        /// Sets the full request, replacing any prior values.
5424        pub fn with_request<V: Into<crate::model::UnresolvePullRequestCommentsRequest>>(
5425            mut self,
5426            v: V,
5427        ) -> Self {
5428            self.0.request = v.into();
5429            self
5430        }
5431
5432        /// Sets all the options, replacing any prior values.
5433        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5434            self.0.options = v.into();
5435            self
5436        }
5437
5438        /// Sends the request.
5439        ///
5440        /// # Long running operations
5441        ///
5442        /// This starts, but does not poll, a longrunning operation. More information
5443        /// on [unresolve_pull_request_comments][crate::client::SecureSourceManager::unresolve_pull_request_comments].
5444        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5445            (*self.0.stub)
5446                .unresolve_pull_request_comments(self.0.request, self.0.options)
5447                .await
5448                .map(crate::Response::into_body)
5449        }
5450
5451        /// Creates a [Poller][google_cloud_lro::Poller] to work with `unresolve_pull_request_comments`.
5452        pub fn poller(
5453            self,
5454        ) -> impl google_cloud_lro::Poller<
5455            crate::model::UnresolvePullRequestCommentsResponse,
5456            crate::model::OperationMetadata,
5457        > {
5458            type Operation = google_cloud_lro::internal::Operation<
5459                crate::model::UnresolvePullRequestCommentsResponse,
5460                crate::model::OperationMetadata,
5461            >;
5462            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5463            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5464            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5465            if let Some(ref mut details) = poller_options.tracing {
5466                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::unresolve_pull_request_comments::until_done";
5467            }
5468
5469            let stub = self.0.stub.clone();
5470            let mut options = self.0.options.clone();
5471            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5472            let query = move |name| {
5473                let stub = stub.clone();
5474                let options = options.clone();
5475                async {
5476                    let op = GetOperation::new(stub)
5477                        .set_name(name)
5478                        .with_options(options)
5479                        .send()
5480                        .await?;
5481                    Ok(Operation::new(op))
5482                }
5483            };
5484
5485            let start = move || async {
5486                let op = self.send().await?;
5487                Ok(Operation::new(op))
5488            };
5489
5490            use google_cloud_lro::internal::PollerExt;
5491            {
5492                google_cloud_lro::internal::new_poller(
5493                    polling_error_policy,
5494                    polling_backoff_policy,
5495                    start,
5496                    query,
5497                )
5498            }
5499            .with_options(poller_options)
5500        }
5501
5502        /// Sets the value of [parent][crate::model::UnresolvePullRequestCommentsRequest::parent].
5503        ///
5504        /// This is a **required** field for requests.
5505        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5506            self.0.request.parent = v.into();
5507            self
5508        }
5509
5510        /// Sets the value of [names][crate::model::UnresolvePullRequestCommentsRequest::names].
5511        ///
5512        /// This is a **required** field for requests.
5513        pub fn set_names<T, V>(mut self, v: T) -> Self
5514        where
5515            T: std::iter::IntoIterator<Item = V>,
5516            V: std::convert::Into<std::string::String>,
5517        {
5518            use std::iter::Iterator;
5519            self.0.request.names = v.into_iter().map(|i| i.into()).collect();
5520            self
5521        }
5522
5523        /// Sets the value of [auto_fill][crate::model::UnresolvePullRequestCommentsRequest::auto_fill].
5524        pub fn set_auto_fill<T: Into<bool>>(mut self, v: T) -> Self {
5525            self.0.request.auto_fill = v.into();
5526            self
5527        }
5528    }
5529
5530    #[doc(hidden)]
5531    impl crate::RequestBuilder for UnresolvePullRequestComments {
5532        fn request_options(&mut self) -> &mut crate::RequestOptions {
5533            &mut self.0.options
5534        }
5535    }
5536
5537    /// The request builder for [SecureSourceManager::create_issue_comment][crate::client::SecureSourceManager::create_issue_comment] calls.
5538    ///
5539    /// # Example
5540    /// ```
5541    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::CreateIssueComment;
5542    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
5543    /// use google_cloud_lro::Poller;
5544    ///
5545    /// let builder = prepare_request_builder();
5546    /// let response = builder.poller().until_done().await?;
5547    /// # Ok(()) }
5548    ///
5549    /// fn prepare_request_builder() -> CreateIssueComment {
5550    ///   # panic!();
5551    ///   // ... details omitted ...
5552    /// }
5553    /// ```
5554    #[derive(Clone, Debug)]
5555    pub struct CreateIssueComment(RequestBuilder<crate::model::CreateIssueCommentRequest>);
5556
5557    impl CreateIssueComment {
5558        pub(crate) fn new(
5559            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5560        ) -> Self {
5561            Self(RequestBuilder::new(stub))
5562        }
5563
5564        /// Sets the full request, replacing any prior values.
5565        pub fn with_request<V: Into<crate::model::CreateIssueCommentRequest>>(
5566            mut self,
5567            v: V,
5568        ) -> Self {
5569            self.0.request = v.into();
5570            self
5571        }
5572
5573        /// Sets all the options, replacing any prior values.
5574        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5575            self.0.options = v.into();
5576            self
5577        }
5578
5579        /// Sends the request.
5580        ///
5581        /// # Long running operations
5582        ///
5583        /// This starts, but does not poll, a longrunning operation. More information
5584        /// on [create_issue_comment][crate::client::SecureSourceManager::create_issue_comment].
5585        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5586            (*self.0.stub)
5587                .create_issue_comment(self.0.request, self.0.options)
5588                .await
5589                .map(crate::Response::into_body)
5590        }
5591
5592        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_issue_comment`.
5593        pub fn poller(
5594            self,
5595        ) -> impl google_cloud_lro::Poller<crate::model::IssueComment, crate::model::OperationMetadata>
5596        {
5597            type Operation = google_cloud_lro::internal::Operation<
5598                crate::model::IssueComment,
5599                crate::model::OperationMetadata,
5600            >;
5601            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5602            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5603            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5604            if let Some(ref mut details) = poller_options.tracing {
5605                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::create_issue_comment::until_done";
5606            }
5607
5608            let stub = self.0.stub.clone();
5609            let mut options = self.0.options.clone();
5610            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5611            let query = move |name| {
5612                let stub = stub.clone();
5613                let options = options.clone();
5614                async {
5615                    let op = GetOperation::new(stub)
5616                        .set_name(name)
5617                        .with_options(options)
5618                        .send()
5619                        .await?;
5620                    Ok(Operation::new(op))
5621                }
5622            };
5623
5624            let start = move || async {
5625                let op = self.send().await?;
5626                Ok(Operation::new(op))
5627            };
5628
5629            use google_cloud_lro::internal::PollerExt;
5630            {
5631                google_cloud_lro::internal::new_poller(
5632                    polling_error_policy,
5633                    polling_backoff_policy,
5634                    start,
5635                    query,
5636                )
5637            }
5638            .with_options(poller_options)
5639        }
5640
5641        /// Sets the value of [parent][crate::model::CreateIssueCommentRequest::parent].
5642        ///
5643        /// This is a **required** field for requests.
5644        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5645            self.0.request.parent = v.into();
5646            self
5647        }
5648
5649        /// Sets the value of [issue_comment][crate::model::CreateIssueCommentRequest::issue_comment].
5650        ///
5651        /// This is a **required** field for requests.
5652        pub fn set_issue_comment<T>(mut self, v: T) -> Self
5653        where
5654            T: std::convert::Into<crate::model::IssueComment>,
5655        {
5656            self.0.request.issue_comment = std::option::Option::Some(v.into());
5657            self
5658        }
5659
5660        /// Sets or clears the value of [issue_comment][crate::model::CreateIssueCommentRequest::issue_comment].
5661        ///
5662        /// This is a **required** field for requests.
5663        pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
5664        where
5665            T: std::convert::Into<crate::model::IssueComment>,
5666        {
5667            self.0.request.issue_comment = v.map(|x| x.into());
5668            self
5669        }
5670    }
5671
5672    #[doc(hidden)]
5673    impl crate::RequestBuilder for CreateIssueComment {
5674        fn request_options(&mut self) -> &mut crate::RequestOptions {
5675            &mut self.0.options
5676        }
5677    }
5678
5679    /// The request builder for [SecureSourceManager::get_issue_comment][crate::client::SecureSourceManager::get_issue_comment] calls.
5680    ///
5681    /// # Example
5682    /// ```
5683    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetIssueComment;
5684    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
5685    ///
5686    /// let builder = prepare_request_builder();
5687    /// let response = builder.send().await?;
5688    /// # Ok(()) }
5689    ///
5690    /// fn prepare_request_builder() -> GetIssueComment {
5691    ///   # panic!();
5692    ///   // ... details omitted ...
5693    /// }
5694    /// ```
5695    #[derive(Clone, Debug)]
5696    pub struct GetIssueComment(RequestBuilder<crate::model::GetIssueCommentRequest>);
5697
5698    impl GetIssueComment {
5699        pub(crate) fn new(
5700            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5701        ) -> Self {
5702            Self(RequestBuilder::new(stub))
5703        }
5704
5705        /// Sets the full request, replacing any prior values.
5706        pub fn with_request<V: Into<crate::model::GetIssueCommentRequest>>(mut self, v: V) -> Self {
5707            self.0.request = v.into();
5708            self
5709        }
5710
5711        /// Sets all the options, replacing any prior values.
5712        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5713            self.0.options = v.into();
5714            self
5715        }
5716
5717        /// Sends the request.
5718        pub async fn send(self) -> Result<crate::model::IssueComment> {
5719            (*self.0.stub)
5720                .get_issue_comment(self.0.request, self.0.options)
5721                .await
5722                .map(crate::Response::into_body)
5723        }
5724
5725        /// Sets the value of [name][crate::model::GetIssueCommentRequest::name].
5726        ///
5727        /// This is a **required** field for requests.
5728        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5729            self.0.request.name = v.into();
5730            self
5731        }
5732    }
5733
5734    #[doc(hidden)]
5735    impl crate::RequestBuilder for GetIssueComment {
5736        fn request_options(&mut self) -> &mut crate::RequestOptions {
5737            &mut self.0.options
5738        }
5739    }
5740
5741    /// The request builder for [SecureSourceManager::list_issue_comments][crate::client::SecureSourceManager::list_issue_comments] calls.
5742    ///
5743    /// # Example
5744    /// ```
5745    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ListIssueComments;
5746    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
5747    /// use google_cloud_gax::paginator::ItemPaginator;
5748    ///
5749    /// let builder = prepare_request_builder();
5750    /// let mut items = builder.by_item();
5751    /// while let Some(result) = items.next().await {
5752    ///   let item = result?;
5753    /// }
5754    /// # Ok(()) }
5755    ///
5756    /// fn prepare_request_builder() -> ListIssueComments {
5757    ///   # panic!();
5758    ///   // ... details omitted ...
5759    /// }
5760    /// ```
5761    #[derive(Clone, Debug)]
5762    pub struct ListIssueComments(RequestBuilder<crate::model::ListIssueCommentsRequest>);
5763
5764    impl ListIssueComments {
5765        pub(crate) fn new(
5766            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5767        ) -> Self {
5768            Self(RequestBuilder::new(stub))
5769        }
5770
5771        /// Sets the full request, replacing any prior values.
5772        pub fn with_request<V: Into<crate::model::ListIssueCommentsRequest>>(
5773            mut self,
5774            v: V,
5775        ) -> Self {
5776            self.0.request = v.into();
5777            self
5778        }
5779
5780        /// Sets all the options, replacing any prior values.
5781        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5782            self.0.options = v.into();
5783            self
5784        }
5785
5786        /// Sends the request.
5787        pub async fn send(self) -> Result<crate::model::ListIssueCommentsResponse> {
5788            (*self.0.stub)
5789                .list_issue_comments(self.0.request, self.0.options)
5790                .await
5791                .map(crate::Response::into_body)
5792        }
5793
5794        /// Streams each page in the collection.
5795        pub fn by_page(
5796            self,
5797        ) -> impl google_cloud_gax::paginator::Paginator<
5798            crate::model::ListIssueCommentsResponse,
5799            crate::Error,
5800        > {
5801            use std::clone::Clone;
5802            let token = self.0.request.page_token.clone();
5803            let execute = move |token: String| {
5804                let mut builder = self.clone();
5805                builder.0.request = builder.0.request.set_page_token(token);
5806                builder.send()
5807            };
5808            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5809        }
5810
5811        /// Streams each item in the collection.
5812        pub fn by_item(
5813            self,
5814        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5815            crate::model::ListIssueCommentsResponse,
5816            crate::Error,
5817        > {
5818            use google_cloud_gax::paginator::Paginator;
5819            self.by_page().items()
5820        }
5821
5822        /// Sets the value of [parent][crate::model::ListIssueCommentsRequest::parent].
5823        ///
5824        /// This is a **required** field for requests.
5825        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5826            self.0.request.parent = v.into();
5827            self
5828        }
5829
5830        /// Sets the value of [page_size][crate::model::ListIssueCommentsRequest::page_size].
5831        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5832            self.0.request.page_size = v.into();
5833            self
5834        }
5835
5836        /// Sets the value of [page_token][crate::model::ListIssueCommentsRequest::page_token].
5837        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5838            self.0.request.page_token = v.into();
5839            self
5840        }
5841    }
5842
5843    #[doc(hidden)]
5844    impl crate::RequestBuilder for ListIssueComments {
5845        fn request_options(&mut self) -> &mut crate::RequestOptions {
5846            &mut self.0.options
5847        }
5848    }
5849
5850    /// The request builder for [SecureSourceManager::update_issue_comment][crate::client::SecureSourceManager::update_issue_comment] calls.
5851    ///
5852    /// # Example
5853    /// ```
5854    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::UpdateIssueComment;
5855    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
5856    /// use google_cloud_lro::Poller;
5857    ///
5858    /// let builder = prepare_request_builder();
5859    /// let response = builder.poller().until_done().await?;
5860    /// # Ok(()) }
5861    ///
5862    /// fn prepare_request_builder() -> UpdateIssueComment {
5863    ///   # panic!();
5864    ///   // ... details omitted ...
5865    /// }
5866    /// ```
5867    #[derive(Clone, Debug)]
5868    pub struct UpdateIssueComment(RequestBuilder<crate::model::UpdateIssueCommentRequest>);
5869
5870    impl UpdateIssueComment {
5871        pub(crate) fn new(
5872            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
5873        ) -> Self {
5874            Self(RequestBuilder::new(stub))
5875        }
5876
5877        /// Sets the full request, replacing any prior values.
5878        pub fn with_request<V: Into<crate::model::UpdateIssueCommentRequest>>(
5879            mut self,
5880            v: V,
5881        ) -> Self {
5882            self.0.request = v.into();
5883            self
5884        }
5885
5886        /// Sets all the options, replacing any prior values.
5887        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5888            self.0.options = v.into();
5889            self
5890        }
5891
5892        /// Sends the request.
5893        ///
5894        /// # Long running operations
5895        ///
5896        /// This starts, but does not poll, a longrunning operation. More information
5897        /// on [update_issue_comment][crate::client::SecureSourceManager::update_issue_comment].
5898        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5899            (*self.0.stub)
5900                .update_issue_comment(self.0.request, self.0.options)
5901                .await
5902                .map(crate::Response::into_body)
5903        }
5904
5905        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_issue_comment`.
5906        pub fn poller(
5907            self,
5908        ) -> impl google_cloud_lro::Poller<crate::model::IssueComment, crate::model::OperationMetadata>
5909        {
5910            type Operation = google_cloud_lro::internal::Operation<
5911                crate::model::IssueComment,
5912                crate::model::OperationMetadata,
5913            >;
5914            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5915            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5916            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5917            if let Some(ref mut details) = poller_options.tracing {
5918                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::update_issue_comment::until_done";
5919            }
5920
5921            let stub = self.0.stub.clone();
5922            let mut options = self.0.options.clone();
5923            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5924            let query = move |name| {
5925                let stub = stub.clone();
5926                let options = options.clone();
5927                async {
5928                    let op = GetOperation::new(stub)
5929                        .set_name(name)
5930                        .with_options(options)
5931                        .send()
5932                        .await?;
5933                    Ok(Operation::new(op))
5934                }
5935            };
5936
5937            let start = move || async {
5938                let op = self.send().await?;
5939                Ok(Operation::new(op))
5940            };
5941
5942            use google_cloud_lro::internal::PollerExt;
5943            {
5944                google_cloud_lro::internal::new_poller(
5945                    polling_error_policy,
5946                    polling_backoff_policy,
5947                    start,
5948                    query,
5949                )
5950            }
5951            .with_options(poller_options)
5952        }
5953
5954        /// Sets the value of [issue_comment][crate::model::UpdateIssueCommentRequest::issue_comment].
5955        ///
5956        /// This is a **required** field for requests.
5957        pub fn set_issue_comment<T>(mut self, v: T) -> Self
5958        where
5959            T: std::convert::Into<crate::model::IssueComment>,
5960        {
5961            self.0.request.issue_comment = std::option::Option::Some(v.into());
5962            self
5963        }
5964
5965        /// Sets or clears the value of [issue_comment][crate::model::UpdateIssueCommentRequest::issue_comment].
5966        ///
5967        /// This is a **required** field for requests.
5968        pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
5969        where
5970            T: std::convert::Into<crate::model::IssueComment>,
5971        {
5972            self.0.request.issue_comment = v.map(|x| x.into());
5973            self
5974        }
5975
5976        /// Sets the value of [update_mask][crate::model::UpdateIssueCommentRequest::update_mask].
5977        pub fn set_update_mask<T>(mut self, v: T) -> Self
5978        where
5979            T: std::convert::Into<wkt::FieldMask>,
5980        {
5981            self.0.request.update_mask = std::option::Option::Some(v.into());
5982            self
5983        }
5984
5985        /// Sets or clears the value of [update_mask][crate::model::UpdateIssueCommentRequest::update_mask].
5986        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5987        where
5988            T: std::convert::Into<wkt::FieldMask>,
5989        {
5990            self.0.request.update_mask = v.map(|x| x.into());
5991            self
5992        }
5993    }
5994
5995    #[doc(hidden)]
5996    impl crate::RequestBuilder for UpdateIssueComment {
5997        fn request_options(&mut self) -> &mut crate::RequestOptions {
5998            &mut self.0.options
5999        }
6000    }
6001
6002    /// The request builder for [SecureSourceManager::delete_issue_comment][crate::client::SecureSourceManager::delete_issue_comment] calls.
6003    ///
6004    /// # Example
6005    /// ```
6006    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::DeleteIssueComment;
6007    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
6008    /// use google_cloud_lro::Poller;
6009    ///
6010    /// let builder = prepare_request_builder();
6011    /// let response = builder.poller().until_done().await?;
6012    /// # Ok(()) }
6013    ///
6014    /// fn prepare_request_builder() -> DeleteIssueComment {
6015    ///   # panic!();
6016    ///   // ... details omitted ...
6017    /// }
6018    /// ```
6019    #[derive(Clone, Debug)]
6020    pub struct DeleteIssueComment(RequestBuilder<crate::model::DeleteIssueCommentRequest>);
6021
6022    impl DeleteIssueComment {
6023        pub(crate) fn new(
6024            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6025        ) -> Self {
6026            Self(RequestBuilder::new(stub))
6027        }
6028
6029        /// Sets the full request, replacing any prior values.
6030        pub fn with_request<V: Into<crate::model::DeleteIssueCommentRequest>>(
6031            mut self,
6032            v: V,
6033        ) -> Self {
6034            self.0.request = v.into();
6035            self
6036        }
6037
6038        /// Sets all the options, replacing any prior values.
6039        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6040            self.0.options = v.into();
6041            self
6042        }
6043
6044        /// Sends the request.
6045        ///
6046        /// # Long running operations
6047        ///
6048        /// This starts, but does not poll, a longrunning operation. More information
6049        /// on [delete_issue_comment][crate::client::SecureSourceManager::delete_issue_comment].
6050        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6051            (*self.0.stub)
6052                .delete_issue_comment(self.0.request, self.0.options)
6053                .await
6054                .map(crate::Response::into_body)
6055        }
6056
6057        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_issue_comment`.
6058        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6059            type Operation =
6060                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6061            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6062            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6063            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6064            if let Some(ref mut details) = poller_options.tracing {
6065                details.method_name = "google_cloud_securesourcemanager_v1::client::SecureSourceManager::delete_issue_comment::until_done";
6066            }
6067
6068            let stub = self.0.stub.clone();
6069            let mut options = self.0.options.clone();
6070            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6071            let query = move |name| {
6072                let stub = stub.clone();
6073                let options = options.clone();
6074                async {
6075                    let op = GetOperation::new(stub)
6076                        .set_name(name)
6077                        .with_options(options)
6078                        .send()
6079                        .await?;
6080                    Ok(Operation::new(op))
6081                }
6082            };
6083
6084            let start = move || async {
6085                let op = self.send().await?;
6086                Ok(Operation::new(op))
6087            };
6088
6089            use google_cloud_lro::internal::PollerExt;
6090            {
6091                google_cloud_lro::internal::new_unit_response_poller(
6092                    polling_error_policy,
6093                    polling_backoff_policy,
6094                    start,
6095                    query,
6096                )
6097            }
6098            .with_options(poller_options)
6099        }
6100
6101        /// Sets the value of [name][crate::model::DeleteIssueCommentRequest::name].
6102        ///
6103        /// This is a **required** field for requests.
6104        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6105            self.0.request.name = v.into();
6106            self
6107        }
6108    }
6109
6110    #[doc(hidden)]
6111    impl crate::RequestBuilder for DeleteIssueComment {
6112        fn request_options(&mut self) -> &mut crate::RequestOptions {
6113            &mut self.0.options
6114        }
6115    }
6116
6117    /// The request builder for [SecureSourceManager::list_locations][crate::client::SecureSourceManager::list_locations] calls.
6118    ///
6119    /// # Example
6120    /// ```
6121    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ListLocations;
6122    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
6123    /// use google_cloud_gax::paginator::ItemPaginator;
6124    ///
6125    /// let builder = prepare_request_builder();
6126    /// let mut items = builder.by_item();
6127    /// while let Some(result) = items.next().await {
6128    ///   let item = result?;
6129    /// }
6130    /// # Ok(()) }
6131    ///
6132    /// fn prepare_request_builder() -> ListLocations {
6133    ///   # panic!();
6134    ///   // ... details omitted ...
6135    /// }
6136    /// ```
6137    #[derive(Clone, Debug)]
6138    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6139
6140    impl ListLocations {
6141        pub(crate) fn new(
6142            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6143        ) -> Self {
6144            Self(RequestBuilder::new(stub))
6145        }
6146
6147        /// Sets the full request, replacing any prior values.
6148        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6149            mut self,
6150            v: V,
6151        ) -> Self {
6152            self.0.request = v.into();
6153            self
6154        }
6155
6156        /// Sets all the options, replacing any prior values.
6157        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6158            self.0.options = v.into();
6159            self
6160        }
6161
6162        /// Sends the request.
6163        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6164            (*self.0.stub)
6165                .list_locations(self.0.request, self.0.options)
6166                .await
6167                .map(crate::Response::into_body)
6168        }
6169
6170        /// Streams each page in the collection.
6171        pub fn by_page(
6172            self,
6173        ) -> impl google_cloud_gax::paginator::Paginator<
6174            google_cloud_location::model::ListLocationsResponse,
6175            crate::Error,
6176        > {
6177            use std::clone::Clone;
6178            let token = self.0.request.page_token.clone();
6179            let execute = move |token: String| {
6180                let mut builder = self.clone();
6181                builder.0.request = builder.0.request.set_page_token(token);
6182                builder.send()
6183            };
6184            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6185        }
6186
6187        /// Streams each item in the collection.
6188        pub fn by_item(
6189            self,
6190        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6191            google_cloud_location::model::ListLocationsResponse,
6192            crate::Error,
6193        > {
6194            use google_cloud_gax::paginator::Paginator;
6195            self.by_page().items()
6196        }
6197
6198        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
6199        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6200            self.0.request.name = v.into();
6201            self
6202        }
6203
6204        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
6205        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6206            self.0.request.filter = v.into();
6207            self
6208        }
6209
6210        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
6211        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6212            self.0.request.page_size = v.into();
6213            self
6214        }
6215
6216        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
6217        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6218            self.0.request.page_token = v.into();
6219            self
6220        }
6221    }
6222
6223    #[doc(hidden)]
6224    impl crate::RequestBuilder for ListLocations {
6225        fn request_options(&mut self) -> &mut crate::RequestOptions {
6226            &mut self.0.options
6227        }
6228    }
6229
6230    /// The request builder for [SecureSourceManager::get_location][crate::client::SecureSourceManager::get_location] calls.
6231    ///
6232    /// # Example
6233    /// ```
6234    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetLocation;
6235    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
6236    ///
6237    /// let builder = prepare_request_builder();
6238    /// let response = builder.send().await?;
6239    /// # Ok(()) }
6240    ///
6241    /// fn prepare_request_builder() -> GetLocation {
6242    ///   # panic!();
6243    ///   // ... details omitted ...
6244    /// }
6245    /// ```
6246    #[derive(Clone, Debug)]
6247    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6248
6249    impl GetLocation {
6250        pub(crate) fn new(
6251            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6252        ) -> Self {
6253            Self(RequestBuilder::new(stub))
6254        }
6255
6256        /// Sets the full request, replacing any prior values.
6257        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6258            mut self,
6259            v: V,
6260        ) -> Self {
6261            self.0.request = v.into();
6262            self
6263        }
6264
6265        /// Sets all the options, replacing any prior values.
6266        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6267            self.0.options = v.into();
6268            self
6269        }
6270
6271        /// Sends the request.
6272        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6273            (*self.0.stub)
6274                .get_location(self.0.request, self.0.options)
6275                .await
6276                .map(crate::Response::into_body)
6277        }
6278
6279        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
6280        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6281            self.0.request.name = v.into();
6282            self
6283        }
6284    }
6285
6286    #[doc(hidden)]
6287    impl crate::RequestBuilder for GetLocation {
6288        fn request_options(&mut self) -> &mut crate::RequestOptions {
6289            &mut self.0.options
6290        }
6291    }
6292
6293    /// The request builder for [SecureSourceManager::set_iam_policy][crate::client::SecureSourceManager::set_iam_policy] calls.
6294    ///
6295    /// # Example
6296    /// ```
6297    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::SetIamPolicy;
6298    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
6299    ///
6300    /// let builder = prepare_request_builder();
6301    /// let response = builder.send().await?;
6302    /// # Ok(()) }
6303    ///
6304    /// fn prepare_request_builder() -> SetIamPolicy {
6305    ///   # panic!();
6306    ///   // ... details omitted ...
6307    /// }
6308    /// ```
6309    #[derive(Clone, Debug)]
6310    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6311
6312    impl SetIamPolicy {
6313        pub(crate) fn new(
6314            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6315        ) -> Self {
6316            Self(RequestBuilder::new(stub))
6317        }
6318
6319        /// Sets the full request, replacing any prior values.
6320        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6321            mut self,
6322            v: V,
6323        ) -> Self {
6324            self.0.request = v.into();
6325            self
6326        }
6327
6328        /// Sets all the options, replacing any prior values.
6329        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6330            self.0.options = v.into();
6331            self
6332        }
6333
6334        /// Sends the request.
6335        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6336            (*self.0.stub)
6337                .set_iam_policy(self.0.request, self.0.options)
6338                .await
6339                .map(crate::Response::into_body)
6340        }
6341
6342        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
6343        ///
6344        /// This is a **required** field for requests.
6345        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6346            self.0.request.resource = v.into();
6347            self
6348        }
6349
6350        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6351        ///
6352        /// This is a **required** field for requests.
6353        pub fn set_policy<T>(mut self, v: T) -> Self
6354        where
6355            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6356        {
6357            self.0.request.policy = std::option::Option::Some(v.into());
6358            self
6359        }
6360
6361        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6362        ///
6363        /// This is a **required** field for requests.
6364        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6365        where
6366            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6367        {
6368            self.0.request.policy = v.map(|x| x.into());
6369            self
6370        }
6371
6372        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6373        pub fn set_update_mask<T>(mut self, v: T) -> Self
6374        where
6375            T: std::convert::Into<wkt::FieldMask>,
6376        {
6377            self.0.request.update_mask = std::option::Option::Some(v.into());
6378            self
6379        }
6380
6381        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6382        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6383        where
6384            T: std::convert::Into<wkt::FieldMask>,
6385        {
6386            self.0.request.update_mask = v.map(|x| x.into());
6387            self
6388        }
6389    }
6390
6391    #[doc(hidden)]
6392    impl crate::RequestBuilder for SetIamPolicy {
6393        fn request_options(&mut self) -> &mut crate::RequestOptions {
6394            &mut self.0.options
6395        }
6396    }
6397
6398    /// The request builder for [SecureSourceManager::get_iam_policy][crate::client::SecureSourceManager::get_iam_policy] calls.
6399    ///
6400    /// # Example
6401    /// ```
6402    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetIamPolicy;
6403    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
6404    ///
6405    /// let builder = prepare_request_builder();
6406    /// let response = builder.send().await?;
6407    /// # Ok(()) }
6408    ///
6409    /// fn prepare_request_builder() -> GetIamPolicy {
6410    ///   # panic!();
6411    ///   // ... details omitted ...
6412    /// }
6413    /// ```
6414    #[derive(Clone, Debug)]
6415    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6416
6417    impl GetIamPolicy {
6418        pub(crate) fn new(
6419            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6420        ) -> Self {
6421            Self(RequestBuilder::new(stub))
6422        }
6423
6424        /// Sets the full request, replacing any prior values.
6425        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6426            mut self,
6427            v: V,
6428        ) -> Self {
6429            self.0.request = v.into();
6430            self
6431        }
6432
6433        /// Sets all the options, replacing any prior values.
6434        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6435            self.0.options = v.into();
6436            self
6437        }
6438
6439        /// Sends the request.
6440        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6441            (*self.0.stub)
6442                .get_iam_policy(self.0.request, self.0.options)
6443                .await
6444                .map(crate::Response::into_body)
6445        }
6446
6447        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
6448        ///
6449        /// This is a **required** field for requests.
6450        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6451            self.0.request.resource = v.into();
6452            self
6453        }
6454
6455        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6456        pub fn set_options<T>(mut self, v: T) -> Self
6457        where
6458            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6459        {
6460            self.0.request.options = std::option::Option::Some(v.into());
6461            self
6462        }
6463
6464        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6465        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6466        where
6467            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6468        {
6469            self.0.request.options = v.map(|x| x.into());
6470            self
6471        }
6472    }
6473
6474    #[doc(hidden)]
6475    impl crate::RequestBuilder for GetIamPolicy {
6476        fn request_options(&mut self) -> &mut crate::RequestOptions {
6477            &mut self.0.options
6478        }
6479    }
6480
6481    /// The request builder for [SecureSourceManager::test_iam_permissions][crate::client::SecureSourceManager::test_iam_permissions] calls.
6482    ///
6483    /// # Example
6484    /// ```
6485    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::TestIamPermissions;
6486    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
6487    ///
6488    /// let builder = prepare_request_builder();
6489    /// let response = builder.send().await?;
6490    /// # Ok(()) }
6491    ///
6492    /// fn prepare_request_builder() -> TestIamPermissions {
6493    ///   # panic!();
6494    ///   // ... details omitted ...
6495    /// }
6496    /// ```
6497    #[derive(Clone, Debug)]
6498    pub struct TestIamPermissions(
6499        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6500    );
6501
6502    impl TestIamPermissions {
6503        pub(crate) fn new(
6504            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6505        ) -> Self {
6506            Self(RequestBuilder::new(stub))
6507        }
6508
6509        /// Sets the full request, replacing any prior values.
6510        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6511            mut self,
6512            v: V,
6513        ) -> Self {
6514            self.0.request = v.into();
6515            self
6516        }
6517
6518        /// Sets all the options, replacing any prior values.
6519        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6520            self.0.options = v.into();
6521            self
6522        }
6523
6524        /// Sends the request.
6525        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6526            (*self.0.stub)
6527                .test_iam_permissions(self.0.request, self.0.options)
6528                .await
6529                .map(crate::Response::into_body)
6530        }
6531
6532        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
6533        ///
6534        /// This is a **required** field for requests.
6535        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6536            self.0.request.resource = v.into();
6537            self
6538        }
6539
6540        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
6541        ///
6542        /// This is a **required** field for requests.
6543        pub fn set_permissions<T, V>(mut self, v: T) -> Self
6544        where
6545            T: std::iter::IntoIterator<Item = V>,
6546            V: std::convert::Into<std::string::String>,
6547        {
6548            use std::iter::Iterator;
6549            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6550            self
6551        }
6552    }
6553
6554    #[doc(hidden)]
6555    impl crate::RequestBuilder for TestIamPermissions {
6556        fn request_options(&mut self) -> &mut crate::RequestOptions {
6557            &mut self.0.options
6558        }
6559    }
6560
6561    /// The request builder for [SecureSourceManager::list_operations][crate::client::SecureSourceManager::list_operations] calls.
6562    ///
6563    /// # Example
6564    /// ```
6565    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::ListOperations;
6566    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
6567    /// use google_cloud_gax::paginator::ItemPaginator;
6568    ///
6569    /// let builder = prepare_request_builder();
6570    /// let mut items = builder.by_item();
6571    /// while let Some(result) = items.next().await {
6572    ///   let item = result?;
6573    /// }
6574    /// # Ok(()) }
6575    ///
6576    /// fn prepare_request_builder() -> ListOperations {
6577    ///   # panic!();
6578    ///   // ... details omitted ...
6579    /// }
6580    /// ```
6581    #[derive(Clone, Debug)]
6582    pub struct ListOperations(
6583        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6584    );
6585
6586    impl ListOperations {
6587        pub(crate) fn new(
6588            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6589        ) -> Self {
6590            Self(RequestBuilder::new(stub))
6591        }
6592
6593        /// Sets the full request, replacing any prior values.
6594        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6595            mut self,
6596            v: V,
6597        ) -> Self {
6598            self.0.request = v.into();
6599            self
6600        }
6601
6602        /// Sets all the options, replacing any prior values.
6603        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6604            self.0.options = v.into();
6605            self
6606        }
6607
6608        /// Sends the request.
6609        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6610            (*self.0.stub)
6611                .list_operations(self.0.request, self.0.options)
6612                .await
6613                .map(crate::Response::into_body)
6614        }
6615
6616        /// Streams each page in the collection.
6617        pub fn by_page(
6618            self,
6619        ) -> impl google_cloud_gax::paginator::Paginator<
6620            google_cloud_longrunning::model::ListOperationsResponse,
6621            crate::Error,
6622        > {
6623            use std::clone::Clone;
6624            let token = self.0.request.page_token.clone();
6625            let execute = move |token: String| {
6626                let mut builder = self.clone();
6627                builder.0.request = builder.0.request.set_page_token(token);
6628                builder.send()
6629            };
6630            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6631        }
6632
6633        /// Streams each item in the collection.
6634        pub fn by_item(
6635            self,
6636        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6637            google_cloud_longrunning::model::ListOperationsResponse,
6638            crate::Error,
6639        > {
6640            use google_cloud_gax::paginator::Paginator;
6641            self.by_page().items()
6642        }
6643
6644        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
6645        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6646            self.0.request.name = v.into();
6647            self
6648        }
6649
6650        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
6651        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6652            self.0.request.filter = v.into();
6653            self
6654        }
6655
6656        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
6657        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6658            self.0.request.page_size = v.into();
6659            self
6660        }
6661
6662        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
6663        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6664            self.0.request.page_token = v.into();
6665            self
6666        }
6667
6668        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
6669        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6670            self.0.request.return_partial_success = v.into();
6671            self
6672        }
6673    }
6674
6675    #[doc(hidden)]
6676    impl crate::RequestBuilder for ListOperations {
6677        fn request_options(&mut self) -> &mut crate::RequestOptions {
6678            &mut self.0.options
6679        }
6680    }
6681
6682    /// The request builder for [SecureSourceManager::get_operation][crate::client::SecureSourceManager::get_operation] calls.
6683    ///
6684    /// # Example
6685    /// ```
6686    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::GetOperation;
6687    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
6688    ///
6689    /// let builder = prepare_request_builder();
6690    /// let response = builder.send().await?;
6691    /// # Ok(()) }
6692    ///
6693    /// fn prepare_request_builder() -> GetOperation {
6694    ///   # panic!();
6695    ///   // ... details omitted ...
6696    /// }
6697    /// ```
6698    #[derive(Clone, Debug)]
6699    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6700
6701    impl GetOperation {
6702        pub(crate) fn new(
6703            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6704        ) -> Self {
6705            Self(RequestBuilder::new(stub))
6706        }
6707
6708        /// Sets the full request, replacing any prior values.
6709        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6710            mut self,
6711            v: V,
6712        ) -> Self {
6713            self.0.request = v.into();
6714            self
6715        }
6716
6717        /// Sets all the options, replacing any prior values.
6718        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6719            self.0.options = v.into();
6720            self
6721        }
6722
6723        /// Sends the request.
6724        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6725            (*self.0.stub)
6726                .get_operation(self.0.request, self.0.options)
6727                .await
6728                .map(crate::Response::into_body)
6729        }
6730
6731        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
6732        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6733            self.0.request.name = v.into();
6734            self
6735        }
6736    }
6737
6738    #[doc(hidden)]
6739    impl crate::RequestBuilder for GetOperation {
6740        fn request_options(&mut self) -> &mut crate::RequestOptions {
6741            &mut self.0.options
6742        }
6743    }
6744
6745    /// The request builder for [SecureSourceManager::delete_operation][crate::client::SecureSourceManager::delete_operation] calls.
6746    ///
6747    /// # Example
6748    /// ```
6749    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::DeleteOperation;
6750    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
6751    ///
6752    /// let builder = prepare_request_builder();
6753    /// let response = builder.send().await?;
6754    /// # Ok(()) }
6755    ///
6756    /// fn prepare_request_builder() -> DeleteOperation {
6757    ///   # panic!();
6758    ///   // ... details omitted ...
6759    /// }
6760    /// ```
6761    #[derive(Clone, Debug)]
6762    pub struct DeleteOperation(
6763        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
6764    );
6765
6766    impl DeleteOperation {
6767        pub(crate) fn new(
6768            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6769        ) -> Self {
6770            Self(RequestBuilder::new(stub))
6771        }
6772
6773        /// Sets the full request, replacing any prior values.
6774        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
6775            mut self,
6776            v: V,
6777        ) -> Self {
6778            self.0.request = v.into();
6779            self
6780        }
6781
6782        /// Sets all the options, replacing any prior values.
6783        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6784            self.0.options = v.into();
6785            self
6786        }
6787
6788        /// Sends the request.
6789        pub async fn send(self) -> Result<()> {
6790            (*self.0.stub)
6791                .delete_operation(self.0.request, self.0.options)
6792                .await
6793                .map(crate::Response::into_body)
6794        }
6795
6796        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
6797        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6798            self.0.request.name = v.into();
6799            self
6800        }
6801    }
6802
6803    #[doc(hidden)]
6804    impl crate::RequestBuilder for DeleteOperation {
6805        fn request_options(&mut self) -> &mut crate::RequestOptions {
6806            &mut self.0.options
6807        }
6808    }
6809
6810    /// The request builder for [SecureSourceManager::cancel_operation][crate::client::SecureSourceManager::cancel_operation] calls.
6811    ///
6812    /// # Example
6813    /// ```
6814    /// # use google_cloud_securesourcemanager_v1::builder::secure_source_manager::CancelOperation;
6815    /// # async fn sample() -> google_cloud_securesourcemanager_v1::Result<()> {
6816    ///
6817    /// let builder = prepare_request_builder();
6818    /// let response = builder.send().await?;
6819    /// # Ok(()) }
6820    ///
6821    /// fn prepare_request_builder() -> CancelOperation {
6822    ///   # panic!();
6823    ///   // ... details omitted ...
6824    /// }
6825    /// ```
6826    #[derive(Clone, Debug)]
6827    pub struct CancelOperation(
6828        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6829    );
6830
6831    impl CancelOperation {
6832        pub(crate) fn new(
6833            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecureSourceManager>,
6834        ) -> Self {
6835            Self(RequestBuilder::new(stub))
6836        }
6837
6838        /// Sets the full request, replacing any prior values.
6839        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6840            mut self,
6841            v: V,
6842        ) -> Self {
6843            self.0.request = v.into();
6844            self
6845        }
6846
6847        /// Sets all the options, replacing any prior values.
6848        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6849            self.0.options = v.into();
6850            self
6851        }
6852
6853        /// Sends the request.
6854        pub async fn send(self) -> Result<()> {
6855            (*self.0.stub)
6856                .cancel_operation(self.0.request, self.0.options)
6857                .await
6858                .map(crate::Response::into_body)
6859        }
6860
6861        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
6862        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6863            self.0.request.name = v.into();
6864            self
6865        }
6866    }
6867
6868    #[doc(hidden)]
6869    impl crate::RequestBuilder for CancelOperation {
6870        fn request_options(&mut self) -> &mut crate::RequestOptions {
6871            &mut self.0.options
6872        }
6873    }
6874}