Skip to main content

google_cloud_osconfig_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 [OsConfigService][crate::client::OsConfigService].
18pub mod os_config_service {
19    use crate::Result;
20
21    /// A builder for [OsConfigService][crate::client::OsConfigService].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_osconfig_v1::*;
26    /// # use builder::os_config_service::ClientBuilder;
27    /// # use client::OsConfigService;
28    /// let builder : ClientBuilder = OsConfigService::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://osconfig.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::OsConfigService;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = OsConfigService;
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::OsConfigService] 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::OsConfigService>,
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::OsConfigService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [OsConfigService::execute_patch_job][crate::client::OsConfigService::execute_patch_job] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_osconfig_v1::builder::os_config_service::ExecutePatchJob;
79    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
80    ///
81    /// let builder = prepare_request_builder();
82    /// let response = builder.send().await?;
83    /// # Ok(()) }
84    ///
85    /// fn prepare_request_builder() -> ExecutePatchJob {
86    ///   # panic!();
87    ///   // ... details omitted ...
88    /// }
89    /// ```
90    #[derive(Clone, Debug)]
91    pub struct ExecutePatchJob(RequestBuilder<crate::model::ExecutePatchJobRequest>);
92
93    impl ExecutePatchJob {
94        pub(crate) fn new(
95            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
96        ) -> Self {
97            Self(RequestBuilder::new(stub))
98        }
99
100        /// Sets the full request, replacing any prior values.
101        pub fn with_request<V: Into<crate::model::ExecutePatchJobRequest>>(mut self, v: V) -> Self {
102            self.0.request = v.into();
103            self
104        }
105
106        /// Sets all the options, replacing any prior values.
107        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108            self.0.options = v.into();
109            self
110        }
111
112        /// Sends the request.
113        pub async fn send(self) -> Result<crate::model::PatchJob> {
114            (*self.0.stub)
115                .execute_patch_job(self.0.request, self.0.options)
116                .await
117                .map(crate::Response::into_body)
118        }
119
120        /// Sets the value of [parent][crate::model::ExecutePatchJobRequest::parent].
121        ///
122        /// This is a **required** field for requests.
123        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
124            self.0.request.parent = v.into();
125            self
126        }
127
128        /// Sets the value of [description][crate::model::ExecutePatchJobRequest::description].
129        pub fn set_description<T: Into<std::string::String>>(mut self, v: T) -> Self {
130            self.0.request.description = v.into();
131            self
132        }
133
134        /// Sets the value of [instance_filter][crate::model::ExecutePatchJobRequest::instance_filter].
135        ///
136        /// This is a **required** field for requests.
137        pub fn set_instance_filter<T>(mut self, v: T) -> Self
138        where
139            T: std::convert::Into<crate::model::PatchInstanceFilter>,
140        {
141            self.0.request.instance_filter = std::option::Option::Some(v.into());
142            self
143        }
144
145        /// Sets or clears the value of [instance_filter][crate::model::ExecutePatchJobRequest::instance_filter].
146        ///
147        /// This is a **required** field for requests.
148        pub fn set_or_clear_instance_filter<T>(mut self, v: std::option::Option<T>) -> Self
149        where
150            T: std::convert::Into<crate::model::PatchInstanceFilter>,
151        {
152            self.0.request.instance_filter = v.map(|x| x.into());
153            self
154        }
155
156        /// Sets the value of [patch_config][crate::model::ExecutePatchJobRequest::patch_config].
157        pub fn set_patch_config<T>(mut self, v: T) -> Self
158        where
159            T: std::convert::Into<crate::model::PatchConfig>,
160        {
161            self.0.request.patch_config = std::option::Option::Some(v.into());
162            self
163        }
164
165        /// Sets or clears the value of [patch_config][crate::model::ExecutePatchJobRequest::patch_config].
166        pub fn set_or_clear_patch_config<T>(mut self, v: std::option::Option<T>) -> Self
167        where
168            T: std::convert::Into<crate::model::PatchConfig>,
169        {
170            self.0.request.patch_config = v.map(|x| x.into());
171            self
172        }
173
174        /// Sets the value of [duration][crate::model::ExecutePatchJobRequest::duration].
175        pub fn set_duration<T>(mut self, v: T) -> Self
176        where
177            T: std::convert::Into<wkt::Duration>,
178        {
179            self.0.request.duration = std::option::Option::Some(v.into());
180            self
181        }
182
183        /// Sets or clears the value of [duration][crate::model::ExecutePatchJobRequest::duration].
184        pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
185        where
186            T: std::convert::Into<wkt::Duration>,
187        {
188            self.0.request.duration = v.map(|x| x.into());
189            self
190        }
191
192        /// Sets the value of [dry_run][crate::model::ExecutePatchJobRequest::dry_run].
193        pub fn set_dry_run<T: Into<bool>>(mut self, v: T) -> Self {
194            self.0.request.dry_run = v.into();
195            self
196        }
197
198        /// Sets the value of [display_name][crate::model::ExecutePatchJobRequest::display_name].
199        pub fn set_display_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
200            self.0.request.display_name = v.into();
201            self
202        }
203
204        /// Sets the value of [rollout][crate::model::ExecutePatchJobRequest::rollout].
205        pub fn set_rollout<T>(mut self, v: T) -> Self
206        where
207            T: std::convert::Into<crate::model::PatchRollout>,
208        {
209            self.0.request.rollout = std::option::Option::Some(v.into());
210            self
211        }
212
213        /// Sets or clears the value of [rollout][crate::model::ExecutePatchJobRequest::rollout].
214        pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
215        where
216            T: std::convert::Into<crate::model::PatchRollout>,
217        {
218            self.0.request.rollout = v.map(|x| x.into());
219            self
220        }
221    }
222
223    #[doc(hidden)]
224    impl crate::RequestBuilder for ExecutePatchJob {
225        fn request_options(&mut self) -> &mut crate::RequestOptions {
226            &mut self.0.options
227        }
228    }
229
230    /// The request builder for [OsConfigService::get_patch_job][crate::client::OsConfigService::get_patch_job] calls.
231    ///
232    /// # Example
233    /// ```
234    /// # use google_cloud_osconfig_v1::builder::os_config_service::GetPatchJob;
235    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
236    ///
237    /// let builder = prepare_request_builder();
238    /// let response = builder.send().await?;
239    /// # Ok(()) }
240    ///
241    /// fn prepare_request_builder() -> GetPatchJob {
242    ///   # panic!();
243    ///   // ... details omitted ...
244    /// }
245    /// ```
246    #[derive(Clone, Debug)]
247    pub struct GetPatchJob(RequestBuilder<crate::model::GetPatchJobRequest>);
248
249    impl GetPatchJob {
250        pub(crate) fn new(
251            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
252        ) -> Self {
253            Self(RequestBuilder::new(stub))
254        }
255
256        /// Sets the full request, replacing any prior values.
257        pub fn with_request<V: Into<crate::model::GetPatchJobRequest>>(mut self, v: V) -> Self {
258            self.0.request = v.into();
259            self
260        }
261
262        /// Sets all the options, replacing any prior values.
263        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
264            self.0.options = v.into();
265            self
266        }
267
268        /// Sends the request.
269        pub async fn send(self) -> Result<crate::model::PatchJob> {
270            (*self.0.stub)
271                .get_patch_job(self.0.request, self.0.options)
272                .await
273                .map(crate::Response::into_body)
274        }
275
276        /// Sets the value of [name][crate::model::GetPatchJobRequest::name].
277        ///
278        /// This is a **required** field for requests.
279        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
280            self.0.request.name = v.into();
281            self
282        }
283    }
284
285    #[doc(hidden)]
286    impl crate::RequestBuilder for GetPatchJob {
287        fn request_options(&mut self) -> &mut crate::RequestOptions {
288            &mut self.0.options
289        }
290    }
291
292    /// The request builder for [OsConfigService::cancel_patch_job][crate::client::OsConfigService::cancel_patch_job] calls.
293    ///
294    /// # Example
295    /// ```
296    /// # use google_cloud_osconfig_v1::builder::os_config_service::CancelPatchJob;
297    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
298    ///
299    /// let builder = prepare_request_builder();
300    /// let response = builder.send().await?;
301    /// # Ok(()) }
302    ///
303    /// fn prepare_request_builder() -> CancelPatchJob {
304    ///   # panic!();
305    ///   // ... details omitted ...
306    /// }
307    /// ```
308    #[derive(Clone, Debug)]
309    pub struct CancelPatchJob(RequestBuilder<crate::model::CancelPatchJobRequest>);
310
311    impl CancelPatchJob {
312        pub(crate) fn new(
313            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
314        ) -> Self {
315            Self(RequestBuilder::new(stub))
316        }
317
318        /// Sets the full request, replacing any prior values.
319        pub fn with_request<V: Into<crate::model::CancelPatchJobRequest>>(mut self, v: V) -> Self {
320            self.0.request = v.into();
321            self
322        }
323
324        /// Sets all the options, replacing any prior values.
325        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
326            self.0.options = v.into();
327            self
328        }
329
330        /// Sends the request.
331        pub async fn send(self) -> Result<crate::model::PatchJob> {
332            (*self.0.stub)
333                .cancel_patch_job(self.0.request, self.0.options)
334                .await
335                .map(crate::Response::into_body)
336        }
337
338        /// Sets the value of [name][crate::model::CancelPatchJobRequest::name].
339        ///
340        /// This is a **required** field for requests.
341        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
342            self.0.request.name = v.into();
343            self
344        }
345    }
346
347    #[doc(hidden)]
348    impl crate::RequestBuilder for CancelPatchJob {
349        fn request_options(&mut self) -> &mut crate::RequestOptions {
350            &mut self.0.options
351        }
352    }
353
354    /// The request builder for [OsConfigService::list_patch_jobs][crate::client::OsConfigService::list_patch_jobs] calls.
355    ///
356    /// # Example
357    /// ```
358    /// # use google_cloud_osconfig_v1::builder::os_config_service::ListPatchJobs;
359    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
360    /// use google_cloud_gax::paginator::ItemPaginator;
361    ///
362    /// let builder = prepare_request_builder();
363    /// let mut items = builder.by_item();
364    /// while let Some(result) = items.next().await {
365    ///   let item = result?;
366    /// }
367    /// # Ok(()) }
368    ///
369    /// fn prepare_request_builder() -> ListPatchJobs {
370    ///   # panic!();
371    ///   // ... details omitted ...
372    /// }
373    /// ```
374    #[derive(Clone, Debug)]
375    pub struct ListPatchJobs(RequestBuilder<crate::model::ListPatchJobsRequest>);
376
377    impl ListPatchJobs {
378        pub(crate) fn new(
379            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
380        ) -> Self {
381            Self(RequestBuilder::new(stub))
382        }
383
384        /// Sets the full request, replacing any prior values.
385        pub fn with_request<V: Into<crate::model::ListPatchJobsRequest>>(mut self, v: V) -> Self {
386            self.0.request = v.into();
387            self
388        }
389
390        /// Sets all the options, replacing any prior values.
391        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
392            self.0.options = v.into();
393            self
394        }
395
396        /// Sends the request.
397        pub async fn send(self) -> Result<crate::model::ListPatchJobsResponse> {
398            (*self.0.stub)
399                .list_patch_jobs(self.0.request, self.0.options)
400                .await
401                .map(crate::Response::into_body)
402        }
403
404        /// Streams each page in the collection.
405        pub fn by_page(
406            self,
407        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListPatchJobsResponse, crate::Error>
408        {
409            use std::clone::Clone;
410            let token = self.0.request.page_token.clone();
411            let execute = move |token: String| {
412                let mut builder = self.clone();
413                builder.0.request = builder.0.request.set_page_token(token);
414                builder.send()
415            };
416            google_cloud_gax::paginator::internal::new_paginator(token, execute)
417        }
418
419        /// Streams each item in the collection.
420        pub fn by_item(
421            self,
422        ) -> impl google_cloud_gax::paginator::ItemPaginator<
423            crate::model::ListPatchJobsResponse,
424            crate::Error,
425        > {
426            use google_cloud_gax::paginator::Paginator;
427            self.by_page().items()
428        }
429
430        /// Sets the value of [parent][crate::model::ListPatchJobsRequest::parent].
431        ///
432        /// This is a **required** field for requests.
433        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
434            self.0.request.parent = v.into();
435            self
436        }
437
438        /// Sets the value of [page_size][crate::model::ListPatchJobsRequest::page_size].
439        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
440            self.0.request.page_size = v.into();
441            self
442        }
443
444        /// Sets the value of [page_token][crate::model::ListPatchJobsRequest::page_token].
445        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
446            self.0.request.page_token = v.into();
447            self
448        }
449
450        /// Sets the value of [filter][crate::model::ListPatchJobsRequest::filter].
451        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
452            self.0.request.filter = v.into();
453            self
454        }
455    }
456
457    #[doc(hidden)]
458    impl crate::RequestBuilder for ListPatchJobs {
459        fn request_options(&mut self) -> &mut crate::RequestOptions {
460            &mut self.0.options
461        }
462    }
463
464    /// The request builder for [OsConfigService::list_patch_job_instance_details][crate::client::OsConfigService::list_patch_job_instance_details] calls.
465    ///
466    /// # Example
467    /// ```
468    /// # use google_cloud_osconfig_v1::builder::os_config_service::ListPatchJobInstanceDetails;
469    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
470    /// use google_cloud_gax::paginator::ItemPaginator;
471    ///
472    /// let builder = prepare_request_builder();
473    /// let mut items = builder.by_item();
474    /// while let Some(result) = items.next().await {
475    ///   let item = result?;
476    /// }
477    /// # Ok(()) }
478    ///
479    /// fn prepare_request_builder() -> ListPatchJobInstanceDetails {
480    ///   # panic!();
481    ///   // ... details omitted ...
482    /// }
483    /// ```
484    #[derive(Clone, Debug)]
485    pub struct ListPatchJobInstanceDetails(
486        RequestBuilder<crate::model::ListPatchJobInstanceDetailsRequest>,
487    );
488
489    impl ListPatchJobInstanceDetails {
490        pub(crate) fn new(
491            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
492        ) -> Self {
493            Self(RequestBuilder::new(stub))
494        }
495
496        /// Sets the full request, replacing any prior values.
497        pub fn with_request<V: Into<crate::model::ListPatchJobInstanceDetailsRequest>>(
498            mut self,
499            v: V,
500        ) -> Self {
501            self.0.request = v.into();
502            self
503        }
504
505        /// Sets all the options, replacing any prior values.
506        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
507            self.0.options = v.into();
508            self
509        }
510
511        /// Sends the request.
512        pub async fn send(self) -> Result<crate::model::ListPatchJobInstanceDetailsResponse> {
513            (*self.0.stub)
514                .list_patch_job_instance_details(self.0.request, self.0.options)
515                .await
516                .map(crate::Response::into_body)
517        }
518
519        /// Streams each page in the collection.
520        pub fn by_page(
521            self,
522        ) -> impl google_cloud_gax::paginator::Paginator<
523            crate::model::ListPatchJobInstanceDetailsResponse,
524            crate::Error,
525        > {
526            use std::clone::Clone;
527            let token = self.0.request.page_token.clone();
528            let execute = move |token: String| {
529                let mut builder = self.clone();
530                builder.0.request = builder.0.request.set_page_token(token);
531                builder.send()
532            };
533            google_cloud_gax::paginator::internal::new_paginator(token, execute)
534        }
535
536        /// Streams each item in the collection.
537        pub fn by_item(
538            self,
539        ) -> impl google_cloud_gax::paginator::ItemPaginator<
540            crate::model::ListPatchJobInstanceDetailsResponse,
541            crate::Error,
542        > {
543            use google_cloud_gax::paginator::Paginator;
544            self.by_page().items()
545        }
546
547        /// Sets the value of [parent][crate::model::ListPatchJobInstanceDetailsRequest::parent].
548        ///
549        /// This is a **required** field for requests.
550        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
551            self.0.request.parent = v.into();
552            self
553        }
554
555        /// Sets the value of [page_size][crate::model::ListPatchJobInstanceDetailsRequest::page_size].
556        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
557            self.0.request.page_size = v.into();
558            self
559        }
560
561        /// Sets the value of [page_token][crate::model::ListPatchJobInstanceDetailsRequest::page_token].
562        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
563            self.0.request.page_token = v.into();
564            self
565        }
566
567        /// Sets the value of [filter][crate::model::ListPatchJobInstanceDetailsRequest::filter].
568        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
569            self.0.request.filter = v.into();
570            self
571        }
572    }
573
574    #[doc(hidden)]
575    impl crate::RequestBuilder for ListPatchJobInstanceDetails {
576        fn request_options(&mut self) -> &mut crate::RequestOptions {
577            &mut self.0.options
578        }
579    }
580
581    /// The request builder for [OsConfigService::create_patch_deployment][crate::client::OsConfigService::create_patch_deployment] calls.
582    ///
583    /// # Example
584    /// ```
585    /// # use google_cloud_osconfig_v1::builder::os_config_service::CreatePatchDeployment;
586    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
587    ///
588    /// let builder = prepare_request_builder();
589    /// let response = builder.send().await?;
590    /// # Ok(()) }
591    ///
592    /// fn prepare_request_builder() -> CreatePatchDeployment {
593    ///   # panic!();
594    ///   // ... details omitted ...
595    /// }
596    /// ```
597    #[derive(Clone, Debug)]
598    pub struct CreatePatchDeployment(RequestBuilder<crate::model::CreatePatchDeploymentRequest>);
599
600    impl CreatePatchDeployment {
601        pub(crate) fn new(
602            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
603        ) -> Self {
604            Self(RequestBuilder::new(stub))
605        }
606
607        /// Sets the full request, replacing any prior values.
608        pub fn with_request<V: Into<crate::model::CreatePatchDeploymentRequest>>(
609            mut self,
610            v: V,
611        ) -> Self {
612            self.0.request = v.into();
613            self
614        }
615
616        /// Sets all the options, replacing any prior values.
617        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
618            self.0.options = v.into();
619            self
620        }
621
622        /// Sends the request.
623        pub async fn send(self) -> Result<crate::model::PatchDeployment> {
624            (*self.0.stub)
625                .create_patch_deployment(self.0.request, self.0.options)
626                .await
627                .map(crate::Response::into_body)
628        }
629
630        /// Sets the value of [parent][crate::model::CreatePatchDeploymentRequest::parent].
631        ///
632        /// This is a **required** field for requests.
633        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
634            self.0.request.parent = v.into();
635            self
636        }
637
638        /// Sets the value of [patch_deployment_id][crate::model::CreatePatchDeploymentRequest::patch_deployment_id].
639        ///
640        /// This is a **required** field for requests.
641        pub fn set_patch_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
642            self.0.request.patch_deployment_id = v.into();
643            self
644        }
645
646        /// Sets the value of [patch_deployment][crate::model::CreatePatchDeploymentRequest::patch_deployment].
647        ///
648        /// This is a **required** field for requests.
649        pub fn set_patch_deployment<T>(mut self, v: T) -> Self
650        where
651            T: std::convert::Into<crate::model::PatchDeployment>,
652        {
653            self.0.request.patch_deployment = std::option::Option::Some(v.into());
654            self
655        }
656
657        /// Sets or clears the value of [patch_deployment][crate::model::CreatePatchDeploymentRequest::patch_deployment].
658        ///
659        /// This is a **required** field for requests.
660        pub fn set_or_clear_patch_deployment<T>(mut self, v: std::option::Option<T>) -> Self
661        where
662            T: std::convert::Into<crate::model::PatchDeployment>,
663        {
664            self.0.request.patch_deployment = v.map(|x| x.into());
665            self
666        }
667    }
668
669    #[doc(hidden)]
670    impl crate::RequestBuilder for CreatePatchDeployment {
671        fn request_options(&mut self) -> &mut crate::RequestOptions {
672            &mut self.0.options
673        }
674    }
675
676    /// The request builder for [OsConfigService::get_patch_deployment][crate::client::OsConfigService::get_patch_deployment] calls.
677    ///
678    /// # Example
679    /// ```
680    /// # use google_cloud_osconfig_v1::builder::os_config_service::GetPatchDeployment;
681    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
682    ///
683    /// let builder = prepare_request_builder();
684    /// let response = builder.send().await?;
685    /// # Ok(()) }
686    ///
687    /// fn prepare_request_builder() -> GetPatchDeployment {
688    ///   # panic!();
689    ///   // ... details omitted ...
690    /// }
691    /// ```
692    #[derive(Clone, Debug)]
693    pub struct GetPatchDeployment(RequestBuilder<crate::model::GetPatchDeploymentRequest>);
694
695    impl GetPatchDeployment {
696        pub(crate) fn new(
697            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
698        ) -> Self {
699            Self(RequestBuilder::new(stub))
700        }
701
702        /// Sets the full request, replacing any prior values.
703        pub fn with_request<V: Into<crate::model::GetPatchDeploymentRequest>>(
704            mut self,
705            v: V,
706        ) -> Self {
707            self.0.request = v.into();
708            self
709        }
710
711        /// Sets all the options, replacing any prior values.
712        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
713            self.0.options = v.into();
714            self
715        }
716
717        /// Sends the request.
718        pub async fn send(self) -> Result<crate::model::PatchDeployment> {
719            (*self.0.stub)
720                .get_patch_deployment(self.0.request, self.0.options)
721                .await
722                .map(crate::Response::into_body)
723        }
724
725        /// Sets the value of [name][crate::model::GetPatchDeploymentRequest::name].
726        ///
727        /// This is a **required** field for requests.
728        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
729            self.0.request.name = v.into();
730            self
731        }
732    }
733
734    #[doc(hidden)]
735    impl crate::RequestBuilder for GetPatchDeployment {
736        fn request_options(&mut self) -> &mut crate::RequestOptions {
737            &mut self.0.options
738        }
739    }
740
741    /// The request builder for [OsConfigService::list_patch_deployments][crate::client::OsConfigService::list_patch_deployments] calls.
742    ///
743    /// # Example
744    /// ```
745    /// # use google_cloud_osconfig_v1::builder::os_config_service::ListPatchDeployments;
746    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
747    /// use google_cloud_gax::paginator::ItemPaginator;
748    ///
749    /// let builder = prepare_request_builder();
750    /// let mut items = builder.by_item();
751    /// while let Some(result) = items.next().await {
752    ///   let item = result?;
753    /// }
754    /// # Ok(()) }
755    ///
756    /// fn prepare_request_builder() -> ListPatchDeployments {
757    ///   # panic!();
758    ///   // ... details omitted ...
759    /// }
760    /// ```
761    #[derive(Clone, Debug)]
762    pub struct ListPatchDeployments(RequestBuilder<crate::model::ListPatchDeploymentsRequest>);
763
764    impl ListPatchDeployments {
765        pub(crate) fn new(
766            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
767        ) -> Self {
768            Self(RequestBuilder::new(stub))
769        }
770
771        /// Sets the full request, replacing any prior values.
772        pub fn with_request<V: Into<crate::model::ListPatchDeploymentsRequest>>(
773            mut self,
774            v: V,
775        ) -> Self {
776            self.0.request = v.into();
777            self
778        }
779
780        /// Sets all the options, replacing any prior values.
781        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
782            self.0.options = v.into();
783            self
784        }
785
786        /// Sends the request.
787        pub async fn send(self) -> Result<crate::model::ListPatchDeploymentsResponse> {
788            (*self.0.stub)
789                .list_patch_deployments(self.0.request, self.0.options)
790                .await
791                .map(crate::Response::into_body)
792        }
793
794        /// Streams each page in the collection.
795        pub fn by_page(
796            self,
797        ) -> impl google_cloud_gax::paginator::Paginator<
798            crate::model::ListPatchDeploymentsResponse,
799            crate::Error,
800        > {
801            use std::clone::Clone;
802            let token = self.0.request.page_token.clone();
803            let execute = move |token: String| {
804                let mut builder = self.clone();
805                builder.0.request = builder.0.request.set_page_token(token);
806                builder.send()
807            };
808            google_cloud_gax::paginator::internal::new_paginator(token, execute)
809        }
810
811        /// Streams each item in the collection.
812        pub fn by_item(
813            self,
814        ) -> impl google_cloud_gax::paginator::ItemPaginator<
815            crate::model::ListPatchDeploymentsResponse,
816            crate::Error,
817        > {
818            use google_cloud_gax::paginator::Paginator;
819            self.by_page().items()
820        }
821
822        /// Sets the value of [parent][crate::model::ListPatchDeploymentsRequest::parent].
823        ///
824        /// This is a **required** field for requests.
825        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
826            self.0.request.parent = v.into();
827            self
828        }
829
830        /// Sets the value of [page_size][crate::model::ListPatchDeploymentsRequest::page_size].
831        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
832            self.0.request.page_size = v.into();
833            self
834        }
835
836        /// Sets the value of [page_token][crate::model::ListPatchDeploymentsRequest::page_token].
837        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
838            self.0.request.page_token = v.into();
839            self
840        }
841    }
842
843    #[doc(hidden)]
844    impl crate::RequestBuilder for ListPatchDeployments {
845        fn request_options(&mut self) -> &mut crate::RequestOptions {
846            &mut self.0.options
847        }
848    }
849
850    /// The request builder for [OsConfigService::delete_patch_deployment][crate::client::OsConfigService::delete_patch_deployment] calls.
851    ///
852    /// # Example
853    /// ```
854    /// # use google_cloud_osconfig_v1::builder::os_config_service::DeletePatchDeployment;
855    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
856    ///
857    /// let builder = prepare_request_builder();
858    /// let response = builder.send().await?;
859    /// # Ok(()) }
860    ///
861    /// fn prepare_request_builder() -> DeletePatchDeployment {
862    ///   # panic!();
863    ///   // ... details omitted ...
864    /// }
865    /// ```
866    #[derive(Clone, Debug)]
867    pub struct DeletePatchDeployment(RequestBuilder<crate::model::DeletePatchDeploymentRequest>);
868
869    impl DeletePatchDeployment {
870        pub(crate) fn new(
871            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
872        ) -> Self {
873            Self(RequestBuilder::new(stub))
874        }
875
876        /// Sets the full request, replacing any prior values.
877        pub fn with_request<V: Into<crate::model::DeletePatchDeploymentRequest>>(
878            mut self,
879            v: V,
880        ) -> Self {
881            self.0.request = v.into();
882            self
883        }
884
885        /// Sets all the options, replacing any prior values.
886        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
887            self.0.options = v.into();
888            self
889        }
890
891        /// Sends the request.
892        pub async fn send(self) -> Result<()> {
893            (*self.0.stub)
894                .delete_patch_deployment(self.0.request, self.0.options)
895                .await
896                .map(crate::Response::into_body)
897        }
898
899        /// Sets the value of [name][crate::model::DeletePatchDeploymentRequest::name].
900        ///
901        /// This is a **required** field for requests.
902        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
903            self.0.request.name = v.into();
904            self
905        }
906    }
907
908    #[doc(hidden)]
909    impl crate::RequestBuilder for DeletePatchDeployment {
910        fn request_options(&mut self) -> &mut crate::RequestOptions {
911            &mut self.0.options
912        }
913    }
914
915    /// The request builder for [OsConfigService::update_patch_deployment][crate::client::OsConfigService::update_patch_deployment] calls.
916    ///
917    /// # Example
918    /// ```
919    /// # use google_cloud_osconfig_v1::builder::os_config_service::UpdatePatchDeployment;
920    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
921    ///
922    /// let builder = prepare_request_builder();
923    /// let response = builder.send().await?;
924    /// # Ok(()) }
925    ///
926    /// fn prepare_request_builder() -> UpdatePatchDeployment {
927    ///   # panic!();
928    ///   // ... details omitted ...
929    /// }
930    /// ```
931    #[derive(Clone, Debug)]
932    pub struct UpdatePatchDeployment(RequestBuilder<crate::model::UpdatePatchDeploymentRequest>);
933
934    impl UpdatePatchDeployment {
935        pub(crate) fn new(
936            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
937        ) -> Self {
938            Self(RequestBuilder::new(stub))
939        }
940
941        /// Sets the full request, replacing any prior values.
942        pub fn with_request<V: Into<crate::model::UpdatePatchDeploymentRequest>>(
943            mut self,
944            v: V,
945        ) -> Self {
946            self.0.request = v.into();
947            self
948        }
949
950        /// Sets all the options, replacing any prior values.
951        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
952            self.0.options = v.into();
953            self
954        }
955
956        /// Sends the request.
957        pub async fn send(self) -> Result<crate::model::PatchDeployment> {
958            (*self.0.stub)
959                .update_patch_deployment(self.0.request, self.0.options)
960                .await
961                .map(crate::Response::into_body)
962        }
963
964        /// Sets the value of [patch_deployment][crate::model::UpdatePatchDeploymentRequest::patch_deployment].
965        ///
966        /// This is a **required** field for requests.
967        pub fn set_patch_deployment<T>(mut self, v: T) -> Self
968        where
969            T: std::convert::Into<crate::model::PatchDeployment>,
970        {
971            self.0.request.patch_deployment = std::option::Option::Some(v.into());
972            self
973        }
974
975        /// Sets or clears the value of [patch_deployment][crate::model::UpdatePatchDeploymentRequest::patch_deployment].
976        ///
977        /// This is a **required** field for requests.
978        pub fn set_or_clear_patch_deployment<T>(mut self, v: std::option::Option<T>) -> Self
979        where
980            T: std::convert::Into<crate::model::PatchDeployment>,
981        {
982            self.0.request.patch_deployment = v.map(|x| x.into());
983            self
984        }
985
986        /// Sets the value of [update_mask][crate::model::UpdatePatchDeploymentRequest::update_mask].
987        pub fn set_update_mask<T>(mut self, v: T) -> Self
988        where
989            T: std::convert::Into<wkt::FieldMask>,
990        {
991            self.0.request.update_mask = std::option::Option::Some(v.into());
992            self
993        }
994
995        /// Sets or clears the value of [update_mask][crate::model::UpdatePatchDeploymentRequest::update_mask].
996        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
997        where
998            T: std::convert::Into<wkt::FieldMask>,
999        {
1000            self.0.request.update_mask = v.map(|x| x.into());
1001            self
1002        }
1003    }
1004
1005    #[doc(hidden)]
1006    impl crate::RequestBuilder for UpdatePatchDeployment {
1007        fn request_options(&mut self) -> &mut crate::RequestOptions {
1008            &mut self.0.options
1009        }
1010    }
1011
1012    /// The request builder for [OsConfigService::pause_patch_deployment][crate::client::OsConfigService::pause_patch_deployment] calls.
1013    ///
1014    /// # Example
1015    /// ```
1016    /// # use google_cloud_osconfig_v1::builder::os_config_service::PausePatchDeployment;
1017    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
1018    ///
1019    /// let builder = prepare_request_builder();
1020    /// let response = builder.send().await?;
1021    /// # Ok(()) }
1022    ///
1023    /// fn prepare_request_builder() -> PausePatchDeployment {
1024    ///   # panic!();
1025    ///   // ... details omitted ...
1026    /// }
1027    /// ```
1028    #[derive(Clone, Debug)]
1029    pub struct PausePatchDeployment(RequestBuilder<crate::model::PausePatchDeploymentRequest>);
1030
1031    impl PausePatchDeployment {
1032        pub(crate) fn new(
1033            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
1034        ) -> Self {
1035            Self(RequestBuilder::new(stub))
1036        }
1037
1038        /// Sets the full request, replacing any prior values.
1039        pub fn with_request<V: Into<crate::model::PausePatchDeploymentRequest>>(
1040            mut self,
1041            v: V,
1042        ) -> Self {
1043            self.0.request = v.into();
1044            self
1045        }
1046
1047        /// Sets all the options, replacing any prior values.
1048        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1049            self.0.options = v.into();
1050            self
1051        }
1052
1053        /// Sends the request.
1054        pub async fn send(self) -> Result<crate::model::PatchDeployment> {
1055            (*self.0.stub)
1056                .pause_patch_deployment(self.0.request, self.0.options)
1057                .await
1058                .map(crate::Response::into_body)
1059        }
1060
1061        /// Sets the value of [name][crate::model::PausePatchDeploymentRequest::name].
1062        ///
1063        /// This is a **required** field for requests.
1064        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1065            self.0.request.name = v.into();
1066            self
1067        }
1068    }
1069
1070    #[doc(hidden)]
1071    impl crate::RequestBuilder for PausePatchDeployment {
1072        fn request_options(&mut self) -> &mut crate::RequestOptions {
1073            &mut self.0.options
1074        }
1075    }
1076
1077    /// The request builder for [OsConfigService::resume_patch_deployment][crate::client::OsConfigService::resume_patch_deployment] calls.
1078    ///
1079    /// # Example
1080    /// ```
1081    /// # use google_cloud_osconfig_v1::builder::os_config_service::ResumePatchDeployment;
1082    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
1083    ///
1084    /// let builder = prepare_request_builder();
1085    /// let response = builder.send().await?;
1086    /// # Ok(()) }
1087    ///
1088    /// fn prepare_request_builder() -> ResumePatchDeployment {
1089    ///   # panic!();
1090    ///   // ... details omitted ...
1091    /// }
1092    /// ```
1093    #[derive(Clone, Debug)]
1094    pub struct ResumePatchDeployment(RequestBuilder<crate::model::ResumePatchDeploymentRequest>);
1095
1096    impl ResumePatchDeployment {
1097        pub(crate) fn new(
1098            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
1099        ) -> Self {
1100            Self(RequestBuilder::new(stub))
1101        }
1102
1103        /// Sets the full request, replacing any prior values.
1104        pub fn with_request<V: Into<crate::model::ResumePatchDeploymentRequest>>(
1105            mut self,
1106            v: V,
1107        ) -> Self {
1108            self.0.request = v.into();
1109            self
1110        }
1111
1112        /// Sets all the options, replacing any prior values.
1113        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1114            self.0.options = v.into();
1115            self
1116        }
1117
1118        /// Sends the request.
1119        pub async fn send(self) -> Result<crate::model::PatchDeployment> {
1120            (*self.0.stub)
1121                .resume_patch_deployment(self.0.request, self.0.options)
1122                .await
1123                .map(crate::Response::into_body)
1124        }
1125
1126        /// Sets the value of [name][crate::model::ResumePatchDeploymentRequest::name].
1127        ///
1128        /// This is a **required** field for requests.
1129        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1130            self.0.request.name = v.into();
1131            self
1132        }
1133    }
1134
1135    #[doc(hidden)]
1136    impl crate::RequestBuilder for ResumePatchDeployment {
1137        fn request_options(&mut self) -> &mut crate::RequestOptions {
1138            &mut self.0.options
1139        }
1140    }
1141
1142    /// The request builder for [OsConfigService::get_operation][crate::client::OsConfigService::get_operation] calls.
1143    ///
1144    /// # Example
1145    /// ```
1146    /// # use google_cloud_osconfig_v1::builder::os_config_service::GetOperation;
1147    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
1148    ///
1149    /// let builder = prepare_request_builder();
1150    /// let response = builder.send().await?;
1151    /// # Ok(()) }
1152    ///
1153    /// fn prepare_request_builder() -> GetOperation {
1154    ///   # panic!();
1155    ///   // ... details omitted ...
1156    /// }
1157    /// ```
1158    #[derive(Clone, Debug)]
1159    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1160
1161    impl GetOperation {
1162        pub(crate) fn new(
1163            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
1164        ) -> Self {
1165            Self(RequestBuilder::new(stub))
1166        }
1167
1168        /// Sets the full request, replacing any prior values.
1169        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1170            mut self,
1171            v: V,
1172        ) -> 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<google_cloud_longrunning::model::Operation> {
1185            (*self.0.stub)
1186                .get_operation(self.0.request, self.0.options)
1187                .await
1188                .map(crate::Response::into_body)
1189        }
1190
1191        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1192        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1193            self.0.request.name = v.into();
1194            self
1195        }
1196    }
1197
1198    #[doc(hidden)]
1199    impl crate::RequestBuilder for GetOperation {
1200        fn request_options(&mut self) -> &mut crate::RequestOptions {
1201            &mut self.0.options
1202        }
1203    }
1204
1205    /// The request builder for [OsConfigService::cancel_operation][crate::client::OsConfigService::cancel_operation] calls.
1206    ///
1207    /// # Example
1208    /// ```
1209    /// # use google_cloud_osconfig_v1::builder::os_config_service::CancelOperation;
1210    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
1211    ///
1212    /// let builder = prepare_request_builder();
1213    /// let response = builder.send().await?;
1214    /// # Ok(()) }
1215    ///
1216    /// fn prepare_request_builder() -> CancelOperation {
1217    ///   # panic!();
1218    ///   // ... details omitted ...
1219    /// }
1220    /// ```
1221    #[derive(Clone, Debug)]
1222    pub struct CancelOperation(
1223        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1224    );
1225
1226    impl CancelOperation {
1227        pub(crate) fn new(
1228            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigService>,
1229        ) -> Self {
1230            Self(RequestBuilder::new(stub))
1231        }
1232
1233        /// Sets the full request, replacing any prior values.
1234        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1235            mut self,
1236            v: V,
1237        ) -> Self {
1238            self.0.request = v.into();
1239            self
1240        }
1241
1242        /// Sets all the options, replacing any prior values.
1243        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1244            self.0.options = v.into();
1245            self
1246        }
1247
1248        /// Sends the request.
1249        pub async fn send(self) -> Result<()> {
1250            (*self.0.stub)
1251                .cancel_operation(self.0.request, self.0.options)
1252                .await
1253                .map(crate::Response::into_body)
1254        }
1255
1256        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1257        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1258            self.0.request.name = v.into();
1259            self
1260        }
1261    }
1262
1263    #[doc(hidden)]
1264    impl crate::RequestBuilder for CancelOperation {
1265        fn request_options(&mut self) -> &mut crate::RequestOptions {
1266            &mut self.0.options
1267        }
1268    }
1269}
1270
1271/// Request and client builders for [OsConfigZonalService][crate::client::OsConfigZonalService].
1272pub mod os_config_zonal_service {
1273    use crate::Result;
1274
1275    /// A builder for [OsConfigZonalService][crate::client::OsConfigZonalService].
1276    ///
1277    /// ```
1278    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1279    /// # use google_cloud_osconfig_v1::*;
1280    /// # use builder::os_config_zonal_service::ClientBuilder;
1281    /// # use client::OsConfigZonalService;
1282    /// let builder : ClientBuilder = OsConfigZonalService::builder();
1283    /// let client = builder
1284    ///     .with_endpoint("https://osconfig.googleapis.com")
1285    ///     .build().await?;
1286    /// # Ok(()) }
1287    /// ```
1288    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1289
1290    pub(crate) mod client {
1291        use super::super::super::client::OsConfigZonalService;
1292        pub struct Factory;
1293        impl crate::ClientFactory for Factory {
1294            type Client = OsConfigZonalService;
1295            type Credentials = gaxi::options::Credentials;
1296            async fn build(
1297                self,
1298                config: gaxi::options::ClientConfig,
1299            ) -> crate::ClientBuilderResult<Self::Client> {
1300                Self::Client::new(config).await
1301            }
1302        }
1303    }
1304
1305    /// Common implementation for [crate::client::OsConfigZonalService] request builders.
1306    #[derive(Clone, Debug)]
1307    pub(crate) struct RequestBuilder<R: std::default::Default> {
1308        stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1309        request: R,
1310        options: crate::RequestOptions,
1311    }
1312
1313    impl<R> RequestBuilder<R>
1314    where
1315        R: std::default::Default,
1316    {
1317        pub(crate) fn new(
1318            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1319        ) -> Self {
1320            Self {
1321                stub,
1322                request: R::default(),
1323                options: crate::RequestOptions::default(),
1324            }
1325        }
1326    }
1327
1328    /// The request builder for [OsConfigZonalService::create_os_policy_assignment][crate::client::OsConfigZonalService::create_os_policy_assignment] calls.
1329    ///
1330    /// # Example
1331    /// ```
1332    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::CreateOSPolicyAssignment;
1333    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
1334    /// use google_cloud_lro::Poller;
1335    ///
1336    /// let builder = prepare_request_builder();
1337    /// let response = builder.poller().until_done().await?;
1338    /// # Ok(()) }
1339    ///
1340    /// fn prepare_request_builder() -> CreateOSPolicyAssignment {
1341    ///   # panic!();
1342    ///   // ... details omitted ...
1343    /// }
1344    /// ```
1345    #[derive(Clone, Debug)]
1346    pub struct CreateOSPolicyAssignment(
1347        RequestBuilder<crate::model::CreateOSPolicyAssignmentRequest>,
1348    );
1349
1350    impl CreateOSPolicyAssignment {
1351        pub(crate) fn new(
1352            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1353        ) -> Self {
1354            Self(RequestBuilder::new(stub))
1355        }
1356
1357        /// Sets the full request, replacing any prior values.
1358        pub fn with_request<V: Into<crate::model::CreateOSPolicyAssignmentRequest>>(
1359            mut self,
1360            v: V,
1361        ) -> Self {
1362            self.0.request = v.into();
1363            self
1364        }
1365
1366        /// Sets all the options, replacing any prior values.
1367        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1368            self.0.options = v.into();
1369            self
1370        }
1371
1372        /// Sends the request.
1373        ///
1374        /// # Long running operations
1375        ///
1376        /// This starts, but does not poll, a longrunning operation. More information
1377        /// on [create_os_policy_assignment][crate::client::OsConfigZonalService::create_os_policy_assignment].
1378        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1379            (*self.0.stub)
1380                .create_os_policy_assignment(self.0.request, self.0.options)
1381                .await
1382                .map(crate::Response::into_body)
1383        }
1384
1385        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_os_policy_assignment`.
1386        pub fn poller(
1387            self,
1388        ) -> impl google_cloud_lro::Poller<
1389            crate::model::OSPolicyAssignment,
1390            crate::model::OSPolicyAssignmentOperationMetadata,
1391        > {
1392            type Operation = google_cloud_lro::internal::Operation<
1393                crate::model::OSPolicyAssignment,
1394                crate::model::OSPolicyAssignmentOperationMetadata,
1395            >;
1396            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1397            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1398            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1399            if let Some(ref mut details) = poller_options.tracing {
1400                details.method_name = "google_cloud_osconfig_v1::client::OsConfigZonalService::create_os_policy_assignment::until_done";
1401            }
1402
1403            let stub = self.0.stub.clone();
1404            let mut options = self.0.options.clone();
1405            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1406            let query = move |name| {
1407                let stub = stub.clone();
1408                let options = options.clone();
1409                async {
1410                    let op = GetOperation::new(stub)
1411                        .set_name(name)
1412                        .with_options(options)
1413                        .send()
1414                        .await?;
1415                    Ok(Operation::new(op))
1416                }
1417            };
1418
1419            let start = move || async {
1420                let op = self.send().await?;
1421                Ok(Operation::new(op))
1422            };
1423
1424            use google_cloud_lro::internal::PollerExt;
1425            {
1426                google_cloud_lro::internal::new_poller(
1427                    polling_error_policy,
1428                    polling_backoff_policy,
1429                    start,
1430                    query,
1431                )
1432            }
1433            .with_options(poller_options)
1434        }
1435
1436        /// Sets the value of [parent][crate::model::CreateOSPolicyAssignmentRequest::parent].
1437        ///
1438        /// This is a **required** field for requests.
1439        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1440            self.0.request.parent = v.into();
1441            self
1442        }
1443
1444        /// Sets the value of [os_policy_assignment][crate::model::CreateOSPolicyAssignmentRequest::os_policy_assignment].
1445        ///
1446        /// This is a **required** field for requests.
1447        pub fn set_os_policy_assignment<T>(mut self, v: T) -> Self
1448        where
1449            T: std::convert::Into<crate::model::OSPolicyAssignment>,
1450        {
1451            self.0.request.os_policy_assignment = std::option::Option::Some(v.into());
1452            self
1453        }
1454
1455        /// Sets or clears the value of [os_policy_assignment][crate::model::CreateOSPolicyAssignmentRequest::os_policy_assignment].
1456        ///
1457        /// This is a **required** field for requests.
1458        pub fn set_or_clear_os_policy_assignment<T>(mut self, v: std::option::Option<T>) -> Self
1459        where
1460            T: std::convert::Into<crate::model::OSPolicyAssignment>,
1461        {
1462            self.0.request.os_policy_assignment = v.map(|x| x.into());
1463            self
1464        }
1465
1466        /// Sets the value of [os_policy_assignment_id][crate::model::CreateOSPolicyAssignmentRequest::os_policy_assignment_id].
1467        ///
1468        /// This is a **required** field for requests.
1469        pub fn set_os_policy_assignment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1470            self.0.request.os_policy_assignment_id = v.into();
1471            self
1472        }
1473    }
1474
1475    #[doc(hidden)]
1476    impl crate::RequestBuilder for CreateOSPolicyAssignment {
1477        fn request_options(&mut self) -> &mut crate::RequestOptions {
1478            &mut self.0.options
1479        }
1480    }
1481
1482    /// The request builder for [OsConfigZonalService::update_os_policy_assignment][crate::client::OsConfigZonalService::update_os_policy_assignment] calls.
1483    ///
1484    /// # Example
1485    /// ```
1486    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::UpdateOSPolicyAssignment;
1487    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
1488    /// use google_cloud_lro::Poller;
1489    ///
1490    /// let builder = prepare_request_builder();
1491    /// let response = builder.poller().until_done().await?;
1492    /// # Ok(()) }
1493    ///
1494    /// fn prepare_request_builder() -> UpdateOSPolicyAssignment {
1495    ///   # panic!();
1496    ///   // ... details omitted ...
1497    /// }
1498    /// ```
1499    #[derive(Clone, Debug)]
1500    pub struct UpdateOSPolicyAssignment(
1501        RequestBuilder<crate::model::UpdateOSPolicyAssignmentRequest>,
1502    );
1503
1504    impl UpdateOSPolicyAssignment {
1505        pub(crate) fn new(
1506            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1507        ) -> Self {
1508            Self(RequestBuilder::new(stub))
1509        }
1510
1511        /// Sets the full request, replacing any prior values.
1512        pub fn with_request<V: Into<crate::model::UpdateOSPolicyAssignmentRequest>>(
1513            mut self,
1514            v: V,
1515        ) -> Self {
1516            self.0.request = v.into();
1517            self
1518        }
1519
1520        /// Sets all the options, replacing any prior values.
1521        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1522            self.0.options = v.into();
1523            self
1524        }
1525
1526        /// Sends the request.
1527        ///
1528        /// # Long running operations
1529        ///
1530        /// This starts, but does not poll, a longrunning operation. More information
1531        /// on [update_os_policy_assignment][crate::client::OsConfigZonalService::update_os_policy_assignment].
1532        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1533            (*self.0.stub)
1534                .update_os_policy_assignment(self.0.request, self.0.options)
1535                .await
1536                .map(crate::Response::into_body)
1537        }
1538
1539        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_os_policy_assignment`.
1540        pub fn poller(
1541            self,
1542        ) -> impl google_cloud_lro::Poller<
1543            crate::model::OSPolicyAssignment,
1544            crate::model::OSPolicyAssignmentOperationMetadata,
1545        > {
1546            type Operation = google_cloud_lro::internal::Operation<
1547                crate::model::OSPolicyAssignment,
1548                crate::model::OSPolicyAssignmentOperationMetadata,
1549            >;
1550            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1551            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1552            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1553            if let Some(ref mut details) = poller_options.tracing {
1554                details.method_name = "google_cloud_osconfig_v1::client::OsConfigZonalService::update_os_policy_assignment::until_done";
1555            }
1556
1557            let stub = self.0.stub.clone();
1558            let mut options = self.0.options.clone();
1559            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1560            let query = move |name| {
1561                let stub = stub.clone();
1562                let options = options.clone();
1563                async {
1564                    let op = GetOperation::new(stub)
1565                        .set_name(name)
1566                        .with_options(options)
1567                        .send()
1568                        .await?;
1569                    Ok(Operation::new(op))
1570                }
1571            };
1572
1573            let start = move || async {
1574                let op = self.send().await?;
1575                Ok(Operation::new(op))
1576            };
1577
1578            use google_cloud_lro::internal::PollerExt;
1579            {
1580                google_cloud_lro::internal::new_poller(
1581                    polling_error_policy,
1582                    polling_backoff_policy,
1583                    start,
1584                    query,
1585                )
1586            }
1587            .with_options(poller_options)
1588        }
1589
1590        /// Sets the value of [os_policy_assignment][crate::model::UpdateOSPolicyAssignmentRequest::os_policy_assignment].
1591        ///
1592        /// This is a **required** field for requests.
1593        pub fn set_os_policy_assignment<T>(mut self, v: T) -> Self
1594        where
1595            T: std::convert::Into<crate::model::OSPolicyAssignment>,
1596        {
1597            self.0.request.os_policy_assignment = std::option::Option::Some(v.into());
1598            self
1599        }
1600
1601        /// Sets or clears the value of [os_policy_assignment][crate::model::UpdateOSPolicyAssignmentRequest::os_policy_assignment].
1602        ///
1603        /// This is a **required** field for requests.
1604        pub fn set_or_clear_os_policy_assignment<T>(mut self, v: std::option::Option<T>) -> Self
1605        where
1606            T: std::convert::Into<crate::model::OSPolicyAssignment>,
1607        {
1608            self.0.request.os_policy_assignment = v.map(|x| x.into());
1609            self
1610        }
1611
1612        /// Sets the value of [update_mask][crate::model::UpdateOSPolicyAssignmentRequest::update_mask].
1613        pub fn set_update_mask<T>(mut self, v: T) -> Self
1614        where
1615            T: std::convert::Into<wkt::FieldMask>,
1616        {
1617            self.0.request.update_mask = std::option::Option::Some(v.into());
1618            self
1619        }
1620
1621        /// Sets or clears the value of [update_mask][crate::model::UpdateOSPolicyAssignmentRequest::update_mask].
1622        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1623        where
1624            T: std::convert::Into<wkt::FieldMask>,
1625        {
1626            self.0.request.update_mask = v.map(|x| x.into());
1627            self
1628        }
1629    }
1630
1631    #[doc(hidden)]
1632    impl crate::RequestBuilder for UpdateOSPolicyAssignment {
1633        fn request_options(&mut self) -> &mut crate::RequestOptions {
1634            &mut self.0.options
1635        }
1636    }
1637
1638    /// The request builder for [OsConfigZonalService::get_os_policy_assignment][crate::client::OsConfigZonalService::get_os_policy_assignment] calls.
1639    ///
1640    /// # Example
1641    /// ```
1642    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::GetOSPolicyAssignment;
1643    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
1644    ///
1645    /// let builder = prepare_request_builder();
1646    /// let response = builder.send().await?;
1647    /// # Ok(()) }
1648    ///
1649    /// fn prepare_request_builder() -> GetOSPolicyAssignment {
1650    ///   # panic!();
1651    ///   // ... details omitted ...
1652    /// }
1653    /// ```
1654    #[derive(Clone, Debug)]
1655    pub struct GetOSPolicyAssignment(RequestBuilder<crate::model::GetOSPolicyAssignmentRequest>);
1656
1657    impl GetOSPolicyAssignment {
1658        pub(crate) fn new(
1659            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1660        ) -> Self {
1661            Self(RequestBuilder::new(stub))
1662        }
1663
1664        /// Sets the full request, replacing any prior values.
1665        pub fn with_request<V: Into<crate::model::GetOSPolicyAssignmentRequest>>(
1666            mut self,
1667            v: V,
1668        ) -> Self {
1669            self.0.request = v.into();
1670            self
1671        }
1672
1673        /// Sets all the options, replacing any prior values.
1674        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1675            self.0.options = v.into();
1676            self
1677        }
1678
1679        /// Sends the request.
1680        pub async fn send(self) -> Result<crate::model::OSPolicyAssignment> {
1681            (*self.0.stub)
1682                .get_os_policy_assignment(self.0.request, self.0.options)
1683                .await
1684                .map(crate::Response::into_body)
1685        }
1686
1687        /// Sets the value of [name][crate::model::GetOSPolicyAssignmentRequest::name].
1688        ///
1689        /// This is a **required** field for requests.
1690        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1691            self.0.request.name = v.into();
1692            self
1693        }
1694    }
1695
1696    #[doc(hidden)]
1697    impl crate::RequestBuilder for GetOSPolicyAssignment {
1698        fn request_options(&mut self) -> &mut crate::RequestOptions {
1699            &mut self.0.options
1700        }
1701    }
1702
1703    /// The request builder for [OsConfigZonalService::list_os_policy_assignments][crate::client::OsConfigZonalService::list_os_policy_assignments] calls.
1704    ///
1705    /// # Example
1706    /// ```
1707    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::ListOSPolicyAssignments;
1708    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
1709    /// use google_cloud_gax::paginator::ItemPaginator;
1710    ///
1711    /// let builder = prepare_request_builder();
1712    /// let mut items = builder.by_item();
1713    /// while let Some(result) = items.next().await {
1714    ///   let item = result?;
1715    /// }
1716    /// # Ok(()) }
1717    ///
1718    /// fn prepare_request_builder() -> ListOSPolicyAssignments {
1719    ///   # panic!();
1720    ///   // ... details omitted ...
1721    /// }
1722    /// ```
1723    #[derive(Clone, Debug)]
1724    pub struct ListOSPolicyAssignments(
1725        RequestBuilder<crate::model::ListOSPolicyAssignmentsRequest>,
1726    );
1727
1728    impl ListOSPolicyAssignments {
1729        pub(crate) fn new(
1730            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1731        ) -> Self {
1732            Self(RequestBuilder::new(stub))
1733        }
1734
1735        /// Sets the full request, replacing any prior values.
1736        pub fn with_request<V: Into<crate::model::ListOSPolicyAssignmentsRequest>>(
1737            mut self,
1738            v: V,
1739        ) -> Self {
1740            self.0.request = v.into();
1741            self
1742        }
1743
1744        /// Sets all the options, replacing any prior values.
1745        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1746            self.0.options = v.into();
1747            self
1748        }
1749
1750        /// Sends the request.
1751        pub async fn send(self) -> Result<crate::model::ListOSPolicyAssignmentsResponse> {
1752            (*self.0.stub)
1753                .list_os_policy_assignments(self.0.request, self.0.options)
1754                .await
1755                .map(crate::Response::into_body)
1756        }
1757
1758        /// Streams each page in the collection.
1759        pub fn by_page(
1760            self,
1761        ) -> impl google_cloud_gax::paginator::Paginator<
1762            crate::model::ListOSPolicyAssignmentsResponse,
1763            crate::Error,
1764        > {
1765            use std::clone::Clone;
1766            let token = self.0.request.page_token.clone();
1767            let execute = move |token: String| {
1768                let mut builder = self.clone();
1769                builder.0.request = builder.0.request.set_page_token(token);
1770                builder.send()
1771            };
1772            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1773        }
1774
1775        /// Streams each item in the collection.
1776        pub fn by_item(
1777            self,
1778        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1779            crate::model::ListOSPolicyAssignmentsResponse,
1780            crate::Error,
1781        > {
1782            use google_cloud_gax::paginator::Paginator;
1783            self.by_page().items()
1784        }
1785
1786        /// Sets the value of [parent][crate::model::ListOSPolicyAssignmentsRequest::parent].
1787        ///
1788        /// This is a **required** field for requests.
1789        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1790            self.0.request.parent = v.into();
1791            self
1792        }
1793
1794        /// Sets the value of [page_size][crate::model::ListOSPolicyAssignmentsRequest::page_size].
1795        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1796            self.0.request.page_size = v.into();
1797            self
1798        }
1799
1800        /// Sets the value of [page_token][crate::model::ListOSPolicyAssignmentsRequest::page_token].
1801        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1802            self.0.request.page_token = v.into();
1803            self
1804        }
1805    }
1806
1807    #[doc(hidden)]
1808    impl crate::RequestBuilder for ListOSPolicyAssignments {
1809        fn request_options(&mut self) -> &mut crate::RequestOptions {
1810            &mut self.0.options
1811        }
1812    }
1813
1814    /// The request builder for [OsConfigZonalService::list_os_policy_assignment_revisions][crate::client::OsConfigZonalService::list_os_policy_assignment_revisions] calls.
1815    ///
1816    /// # Example
1817    /// ```
1818    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::ListOSPolicyAssignmentRevisions;
1819    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
1820    /// use google_cloud_gax::paginator::ItemPaginator;
1821    ///
1822    /// let builder = prepare_request_builder();
1823    /// let mut items = builder.by_item();
1824    /// while let Some(result) = items.next().await {
1825    ///   let item = result?;
1826    /// }
1827    /// # Ok(()) }
1828    ///
1829    /// fn prepare_request_builder() -> ListOSPolicyAssignmentRevisions {
1830    ///   # panic!();
1831    ///   // ... details omitted ...
1832    /// }
1833    /// ```
1834    #[derive(Clone, Debug)]
1835    pub struct ListOSPolicyAssignmentRevisions(
1836        RequestBuilder<crate::model::ListOSPolicyAssignmentRevisionsRequest>,
1837    );
1838
1839    impl ListOSPolicyAssignmentRevisions {
1840        pub(crate) fn new(
1841            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1842        ) -> Self {
1843            Self(RequestBuilder::new(stub))
1844        }
1845
1846        /// Sets the full request, replacing any prior values.
1847        pub fn with_request<V: Into<crate::model::ListOSPolicyAssignmentRevisionsRequest>>(
1848            mut self,
1849            v: V,
1850        ) -> Self {
1851            self.0.request = v.into();
1852            self
1853        }
1854
1855        /// Sets all the options, replacing any prior values.
1856        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1857            self.0.options = v.into();
1858            self
1859        }
1860
1861        /// Sends the request.
1862        pub async fn send(self) -> Result<crate::model::ListOSPolicyAssignmentRevisionsResponse> {
1863            (*self.0.stub)
1864                .list_os_policy_assignment_revisions(self.0.request, self.0.options)
1865                .await
1866                .map(crate::Response::into_body)
1867        }
1868
1869        /// Streams each page in the collection.
1870        pub fn by_page(
1871            self,
1872        ) -> impl google_cloud_gax::paginator::Paginator<
1873            crate::model::ListOSPolicyAssignmentRevisionsResponse,
1874            crate::Error,
1875        > {
1876            use std::clone::Clone;
1877            let token = self.0.request.page_token.clone();
1878            let execute = move |token: String| {
1879                let mut builder = self.clone();
1880                builder.0.request = builder.0.request.set_page_token(token);
1881                builder.send()
1882            };
1883            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1884        }
1885
1886        /// Streams each item in the collection.
1887        pub fn by_item(
1888            self,
1889        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1890            crate::model::ListOSPolicyAssignmentRevisionsResponse,
1891            crate::Error,
1892        > {
1893            use google_cloud_gax::paginator::Paginator;
1894            self.by_page().items()
1895        }
1896
1897        /// Sets the value of [name][crate::model::ListOSPolicyAssignmentRevisionsRequest::name].
1898        ///
1899        /// This is a **required** field for requests.
1900        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1901            self.0.request.name = v.into();
1902            self
1903        }
1904
1905        /// Sets the value of [page_size][crate::model::ListOSPolicyAssignmentRevisionsRequest::page_size].
1906        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1907            self.0.request.page_size = v.into();
1908            self
1909        }
1910
1911        /// Sets the value of [page_token][crate::model::ListOSPolicyAssignmentRevisionsRequest::page_token].
1912        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1913            self.0.request.page_token = v.into();
1914            self
1915        }
1916    }
1917
1918    #[doc(hidden)]
1919    impl crate::RequestBuilder for ListOSPolicyAssignmentRevisions {
1920        fn request_options(&mut self) -> &mut crate::RequestOptions {
1921            &mut self.0.options
1922        }
1923    }
1924
1925    /// The request builder for [OsConfigZonalService::delete_os_policy_assignment][crate::client::OsConfigZonalService::delete_os_policy_assignment] calls.
1926    ///
1927    /// # Example
1928    /// ```
1929    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::DeleteOSPolicyAssignment;
1930    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
1931    /// use google_cloud_lro::Poller;
1932    ///
1933    /// let builder = prepare_request_builder();
1934    /// let response = builder.poller().until_done().await?;
1935    /// # Ok(()) }
1936    ///
1937    /// fn prepare_request_builder() -> DeleteOSPolicyAssignment {
1938    ///   # panic!();
1939    ///   // ... details omitted ...
1940    /// }
1941    /// ```
1942    #[derive(Clone, Debug)]
1943    pub struct DeleteOSPolicyAssignment(
1944        RequestBuilder<crate::model::DeleteOSPolicyAssignmentRequest>,
1945    );
1946
1947    impl DeleteOSPolicyAssignment {
1948        pub(crate) fn new(
1949            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
1950        ) -> Self {
1951            Self(RequestBuilder::new(stub))
1952        }
1953
1954        /// Sets the full request, replacing any prior values.
1955        pub fn with_request<V: Into<crate::model::DeleteOSPolicyAssignmentRequest>>(
1956            mut self,
1957            v: V,
1958        ) -> Self {
1959            self.0.request = v.into();
1960            self
1961        }
1962
1963        /// Sets all the options, replacing any prior values.
1964        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1965            self.0.options = v.into();
1966            self
1967        }
1968
1969        /// Sends the request.
1970        ///
1971        /// # Long running operations
1972        ///
1973        /// This starts, but does not poll, a longrunning operation. More information
1974        /// on [delete_os_policy_assignment][crate::client::OsConfigZonalService::delete_os_policy_assignment].
1975        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1976            (*self.0.stub)
1977                .delete_os_policy_assignment(self.0.request, self.0.options)
1978                .await
1979                .map(crate::Response::into_body)
1980        }
1981
1982        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_os_policy_assignment`.
1983        pub fn poller(
1984            self,
1985        ) -> impl google_cloud_lro::Poller<(), crate::model::OSPolicyAssignmentOperationMetadata>
1986        {
1987            type Operation = google_cloud_lro::internal::Operation<
1988                wkt::Empty,
1989                crate::model::OSPolicyAssignmentOperationMetadata,
1990            >;
1991            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1992            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1993            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1994            if let Some(ref mut details) = poller_options.tracing {
1995                details.method_name = "google_cloud_osconfig_v1::client::OsConfigZonalService::delete_os_policy_assignment::until_done";
1996            }
1997
1998            let stub = self.0.stub.clone();
1999            let mut options = self.0.options.clone();
2000            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2001            let query = move |name| {
2002                let stub = stub.clone();
2003                let options = options.clone();
2004                async {
2005                    let op = GetOperation::new(stub)
2006                        .set_name(name)
2007                        .with_options(options)
2008                        .send()
2009                        .await?;
2010                    Ok(Operation::new(op))
2011                }
2012            };
2013
2014            let start = move || async {
2015                let op = self.send().await?;
2016                Ok(Operation::new(op))
2017            };
2018
2019            use google_cloud_lro::internal::PollerExt;
2020            {
2021                google_cloud_lro::internal::new_unit_response_poller(
2022                    polling_error_policy,
2023                    polling_backoff_policy,
2024                    start,
2025                    query,
2026                )
2027            }
2028            .with_options(poller_options)
2029        }
2030
2031        /// Sets the value of [name][crate::model::DeleteOSPolicyAssignmentRequest::name].
2032        ///
2033        /// This is a **required** field for requests.
2034        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2035            self.0.request.name = v.into();
2036            self
2037        }
2038    }
2039
2040    #[doc(hidden)]
2041    impl crate::RequestBuilder for DeleteOSPolicyAssignment {
2042        fn request_options(&mut self) -> &mut crate::RequestOptions {
2043            &mut self.0.options
2044        }
2045    }
2046
2047    /// The request builder for [OsConfigZonalService::get_os_policy_assignment_report][crate::client::OsConfigZonalService::get_os_policy_assignment_report] calls.
2048    ///
2049    /// # Example
2050    /// ```
2051    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::GetOSPolicyAssignmentReport;
2052    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
2053    ///
2054    /// let builder = prepare_request_builder();
2055    /// let response = builder.send().await?;
2056    /// # Ok(()) }
2057    ///
2058    /// fn prepare_request_builder() -> GetOSPolicyAssignmentReport {
2059    ///   # panic!();
2060    ///   // ... details omitted ...
2061    /// }
2062    /// ```
2063    #[derive(Clone, Debug)]
2064    pub struct GetOSPolicyAssignmentReport(
2065        RequestBuilder<crate::model::GetOSPolicyAssignmentReportRequest>,
2066    );
2067
2068    impl GetOSPolicyAssignmentReport {
2069        pub(crate) fn new(
2070            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2071        ) -> Self {
2072            Self(RequestBuilder::new(stub))
2073        }
2074
2075        /// Sets the full request, replacing any prior values.
2076        pub fn with_request<V: Into<crate::model::GetOSPolicyAssignmentReportRequest>>(
2077            mut self,
2078            v: V,
2079        ) -> Self {
2080            self.0.request = v.into();
2081            self
2082        }
2083
2084        /// Sets all the options, replacing any prior values.
2085        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2086            self.0.options = v.into();
2087            self
2088        }
2089
2090        /// Sends the request.
2091        pub async fn send(self) -> Result<crate::model::OSPolicyAssignmentReport> {
2092            (*self.0.stub)
2093                .get_os_policy_assignment_report(self.0.request, self.0.options)
2094                .await
2095                .map(crate::Response::into_body)
2096        }
2097
2098        /// Sets the value of [name][crate::model::GetOSPolicyAssignmentReportRequest::name].
2099        ///
2100        /// This is a **required** field for requests.
2101        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2102            self.0.request.name = v.into();
2103            self
2104        }
2105    }
2106
2107    #[doc(hidden)]
2108    impl crate::RequestBuilder for GetOSPolicyAssignmentReport {
2109        fn request_options(&mut self) -> &mut crate::RequestOptions {
2110            &mut self.0.options
2111        }
2112    }
2113
2114    /// The request builder for [OsConfigZonalService::list_os_policy_assignment_reports][crate::client::OsConfigZonalService::list_os_policy_assignment_reports] calls.
2115    ///
2116    /// # Example
2117    /// ```
2118    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::ListOSPolicyAssignmentReports;
2119    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
2120    /// use google_cloud_gax::paginator::ItemPaginator;
2121    ///
2122    /// let builder = prepare_request_builder();
2123    /// let mut items = builder.by_item();
2124    /// while let Some(result) = items.next().await {
2125    ///   let item = result?;
2126    /// }
2127    /// # Ok(()) }
2128    ///
2129    /// fn prepare_request_builder() -> ListOSPolicyAssignmentReports {
2130    ///   # panic!();
2131    ///   // ... details omitted ...
2132    /// }
2133    /// ```
2134    #[derive(Clone, Debug)]
2135    pub struct ListOSPolicyAssignmentReports(
2136        RequestBuilder<crate::model::ListOSPolicyAssignmentReportsRequest>,
2137    );
2138
2139    impl ListOSPolicyAssignmentReports {
2140        pub(crate) fn new(
2141            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2142        ) -> Self {
2143            Self(RequestBuilder::new(stub))
2144        }
2145
2146        /// Sets the full request, replacing any prior values.
2147        pub fn with_request<V: Into<crate::model::ListOSPolicyAssignmentReportsRequest>>(
2148            mut self,
2149            v: V,
2150        ) -> Self {
2151            self.0.request = v.into();
2152            self
2153        }
2154
2155        /// Sets all the options, replacing any prior values.
2156        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2157            self.0.options = v.into();
2158            self
2159        }
2160
2161        /// Sends the request.
2162        pub async fn send(self) -> Result<crate::model::ListOSPolicyAssignmentReportsResponse> {
2163            (*self.0.stub)
2164                .list_os_policy_assignment_reports(self.0.request, self.0.options)
2165                .await
2166                .map(crate::Response::into_body)
2167        }
2168
2169        /// Streams each page in the collection.
2170        pub fn by_page(
2171            self,
2172        ) -> impl google_cloud_gax::paginator::Paginator<
2173            crate::model::ListOSPolicyAssignmentReportsResponse,
2174            crate::Error,
2175        > {
2176            use std::clone::Clone;
2177            let token = self.0.request.page_token.clone();
2178            let execute = move |token: String| {
2179                let mut builder = self.clone();
2180                builder.0.request = builder.0.request.set_page_token(token);
2181                builder.send()
2182            };
2183            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2184        }
2185
2186        /// Streams each item in the collection.
2187        pub fn by_item(
2188            self,
2189        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2190            crate::model::ListOSPolicyAssignmentReportsResponse,
2191            crate::Error,
2192        > {
2193            use google_cloud_gax::paginator::Paginator;
2194            self.by_page().items()
2195        }
2196
2197        /// Sets the value of [parent][crate::model::ListOSPolicyAssignmentReportsRequest::parent].
2198        ///
2199        /// This is a **required** field for requests.
2200        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2201            self.0.request.parent = v.into();
2202            self
2203        }
2204
2205        /// Sets the value of [page_size][crate::model::ListOSPolicyAssignmentReportsRequest::page_size].
2206        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2207            self.0.request.page_size = v.into();
2208            self
2209        }
2210
2211        /// Sets the value of [filter][crate::model::ListOSPolicyAssignmentReportsRequest::filter].
2212        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2213            self.0.request.filter = v.into();
2214            self
2215        }
2216
2217        /// Sets the value of [page_token][crate::model::ListOSPolicyAssignmentReportsRequest::page_token].
2218        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2219            self.0.request.page_token = v.into();
2220            self
2221        }
2222    }
2223
2224    #[doc(hidden)]
2225    impl crate::RequestBuilder for ListOSPolicyAssignmentReports {
2226        fn request_options(&mut self) -> &mut crate::RequestOptions {
2227            &mut self.0.options
2228        }
2229    }
2230
2231    /// The request builder for [OsConfigZonalService::get_inventory][crate::client::OsConfigZonalService::get_inventory] calls.
2232    ///
2233    /// # Example
2234    /// ```
2235    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::GetInventory;
2236    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
2237    ///
2238    /// let builder = prepare_request_builder();
2239    /// let response = builder.send().await?;
2240    /// # Ok(()) }
2241    ///
2242    /// fn prepare_request_builder() -> GetInventory {
2243    ///   # panic!();
2244    ///   // ... details omitted ...
2245    /// }
2246    /// ```
2247    #[derive(Clone, Debug)]
2248    pub struct GetInventory(RequestBuilder<crate::model::GetInventoryRequest>);
2249
2250    impl GetInventory {
2251        pub(crate) fn new(
2252            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2253        ) -> Self {
2254            Self(RequestBuilder::new(stub))
2255        }
2256
2257        /// Sets the full request, replacing any prior values.
2258        pub fn with_request<V: Into<crate::model::GetInventoryRequest>>(mut self, v: V) -> Self {
2259            self.0.request = v.into();
2260            self
2261        }
2262
2263        /// Sets all the options, replacing any prior values.
2264        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2265            self.0.options = v.into();
2266            self
2267        }
2268
2269        /// Sends the request.
2270        pub async fn send(self) -> Result<crate::model::Inventory> {
2271            (*self.0.stub)
2272                .get_inventory(self.0.request, self.0.options)
2273                .await
2274                .map(crate::Response::into_body)
2275        }
2276
2277        /// Sets the value of [name][crate::model::GetInventoryRequest::name].
2278        ///
2279        /// This is a **required** field for requests.
2280        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2281            self.0.request.name = v.into();
2282            self
2283        }
2284
2285        /// Sets the value of [view][crate::model::GetInventoryRequest::view].
2286        pub fn set_view<T: Into<crate::model::InventoryView>>(mut self, v: T) -> Self {
2287            self.0.request.view = v.into();
2288            self
2289        }
2290    }
2291
2292    #[doc(hidden)]
2293    impl crate::RequestBuilder for GetInventory {
2294        fn request_options(&mut self) -> &mut crate::RequestOptions {
2295            &mut self.0.options
2296        }
2297    }
2298
2299    /// The request builder for [OsConfigZonalService::list_inventories][crate::client::OsConfigZonalService::list_inventories] calls.
2300    ///
2301    /// # Example
2302    /// ```
2303    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::ListInventories;
2304    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
2305    /// use google_cloud_gax::paginator::ItemPaginator;
2306    ///
2307    /// let builder = prepare_request_builder();
2308    /// let mut items = builder.by_item();
2309    /// while let Some(result) = items.next().await {
2310    ///   let item = result?;
2311    /// }
2312    /// # Ok(()) }
2313    ///
2314    /// fn prepare_request_builder() -> ListInventories {
2315    ///   # panic!();
2316    ///   // ... details omitted ...
2317    /// }
2318    /// ```
2319    #[derive(Clone, Debug)]
2320    pub struct ListInventories(RequestBuilder<crate::model::ListInventoriesRequest>);
2321
2322    impl ListInventories {
2323        pub(crate) fn new(
2324            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2325        ) -> Self {
2326            Self(RequestBuilder::new(stub))
2327        }
2328
2329        /// Sets the full request, replacing any prior values.
2330        pub fn with_request<V: Into<crate::model::ListInventoriesRequest>>(mut self, v: V) -> 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        pub async fn send(self) -> Result<crate::model::ListInventoriesResponse> {
2343            (*self.0.stub)
2344                .list_inventories(self.0.request, self.0.options)
2345                .await
2346                .map(crate::Response::into_body)
2347        }
2348
2349        /// Streams each page in the collection.
2350        pub fn by_page(
2351            self,
2352        ) -> impl google_cloud_gax::paginator::Paginator<
2353            crate::model::ListInventoriesResponse,
2354            crate::Error,
2355        > {
2356            use std::clone::Clone;
2357            let token = self.0.request.page_token.clone();
2358            let execute = move |token: String| {
2359                let mut builder = self.clone();
2360                builder.0.request = builder.0.request.set_page_token(token);
2361                builder.send()
2362            };
2363            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2364        }
2365
2366        /// Streams each item in the collection.
2367        pub fn by_item(
2368            self,
2369        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2370            crate::model::ListInventoriesResponse,
2371            crate::Error,
2372        > {
2373            use google_cloud_gax::paginator::Paginator;
2374            self.by_page().items()
2375        }
2376
2377        /// Sets the value of [parent][crate::model::ListInventoriesRequest::parent].
2378        ///
2379        /// This is a **required** field for requests.
2380        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2381            self.0.request.parent = v.into();
2382            self
2383        }
2384
2385        /// Sets the value of [view][crate::model::ListInventoriesRequest::view].
2386        pub fn set_view<T: Into<crate::model::InventoryView>>(mut self, v: T) -> Self {
2387            self.0.request.view = v.into();
2388            self
2389        }
2390
2391        /// Sets the value of [page_size][crate::model::ListInventoriesRequest::page_size].
2392        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2393            self.0.request.page_size = v.into();
2394            self
2395        }
2396
2397        /// Sets the value of [page_token][crate::model::ListInventoriesRequest::page_token].
2398        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2399            self.0.request.page_token = v.into();
2400            self
2401        }
2402
2403        /// Sets the value of [filter][crate::model::ListInventoriesRequest::filter].
2404        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2405            self.0.request.filter = v.into();
2406            self
2407        }
2408    }
2409
2410    #[doc(hidden)]
2411    impl crate::RequestBuilder for ListInventories {
2412        fn request_options(&mut self) -> &mut crate::RequestOptions {
2413            &mut self.0.options
2414        }
2415    }
2416
2417    /// The request builder for [OsConfigZonalService::get_vulnerability_report][crate::client::OsConfigZonalService::get_vulnerability_report] calls.
2418    ///
2419    /// # Example
2420    /// ```
2421    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::GetVulnerabilityReport;
2422    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
2423    ///
2424    /// let builder = prepare_request_builder();
2425    /// let response = builder.send().await?;
2426    /// # Ok(()) }
2427    ///
2428    /// fn prepare_request_builder() -> GetVulnerabilityReport {
2429    ///   # panic!();
2430    ///   // ... details omitted ...
2431    /// }
2432    /// ```
2433    #[derive(Clone, Debug)]
2434    pub struct GetVulnerabilityReport(RequestBuilder<crate::model::GetVulnerabilityReportRequest>);
2435
2436    impl GetVulnerabilityReport {
2437        pub(crate) fn new(
2438            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2439        ) -> Self {
2440            Self(RequestBuilder::new(stub))
2441        }
2442
2443        /// Sets the full request, replacing any prior values.
2444        pub fn with_request<V: Into<crate::model::GetVulnerabilityReportRequest>>(
2445            mut self,
2446            v: V,
2447        ) -> Self {
2448            self.0.request = v.into();
2449            self
2450        }
2451
2452        /// Sets all the options, replacing any prior values.
2453        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2454            self.0.options = v.into();
2455            self
2456        }
2457
2458        /// Sends the request.
2459        pub async fn send(self) -> Result<crate::model::VulnerabilityReport> {
2460            (*self.0.stub)
2461                .get_vulnerability_report(self.0.request, self.0.options)
2462                .await
2463                .map(crate::Response::into_body)
2464        }
2465
2466        /// Sets the value of [name][crate::model::GetVulnerabilityReportRequest::name].
2467        ///
2468        /// This is a **required** field for requests.
2469        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2470            self.0.request.name = v.into();
2471            self
2472        }
2473    }
2474
2475    #[doc(hidden)]
2476    impl crate::RequestBuilder for GetVulnerabilityReport {
2477        fn request_options(&mut self) -> &mut crate::RequestOptions {
2478            &mut self.0.options
2479        }
2480    }
2481
2482    /// The request builder for [OsConfigZonalService::list_vulnerability_reports][crate::client::OsConfigZonalService::list_vulnerability_reports] calls.
2483    ///
2484    /// # Example
2485    /// ```
2486    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::ListVulnerabilityReports;
2487    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
2488    /// use google_cloud_gax::paginator::ItemPaginator;
2489    ///
2490    /// let builder = prepare_request_builder();
2491    /// let mut items = builder.by_item();
2492    /// while let Some(result) = items.next().await {
2493    ///   let item = result?;
2494    /// }
2495    /// # Ok(()) }
2496    ///
2497    /// fn prepare_request_builder() -> ListVulnerabilityReports {
2498    ///   # panic!();
2499    ///   // ... details omitted ...
2500    /// }
2501    /// ```
2502    #[derive(Clone, Debug)]
2503    pub struct ListVulnerabilityReports(
2504        RequestBuilder<crate::model::ListVulnerabilityReportsRequest>,
2505    );
2506
2507    impl ListVulnerabilityReports {
2508        pub(crate) fn new(
2509            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2510        ) -> Self {
2511            Self(RequestBuilder::new(stub))
2512        }
2513
2514        /// Sets the full request, replacing any prior values.
2515        pub fn with_request<V: Into<crate::model::ListVulnerabilityReportsRequest>>(
2516            mut self,
2517            v: V,
2518        ) -> Self {
2519            self.0.request = v.into();
2520            self
2521        }
2522
2523        /// Sets all the options, replacing any prior values.
2524        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2525            self.0.options = v.into();
2526            self
2527        }
2528
2529        /// Sends the request.
2530        pub async fn send(self) -> Result<crate::model::ListVulnerabilityReportsResponse> {
2531            (*self.0.stub)
2532                .list_vulnerability_reports(self.0.request, self.0.options)
2533                .await
2534                .map(crate::Response::into_body)
2535        }
2536
2537        /// Streams each page in the collection.
2538        pub fn by_page(
2539            self,
2540        ) -> impl google_cloud_gax::paginator::Paginator<
2541            crate::model::ListVulnerabilityReportsResponse,
2542            crate::Error,
2543        > {
2544            use std::clone::Clone;
2545            let token = self.0.request.page_token.clone();
2546            let execute = move |token: String| {
2547                let mut builder = self.clone();
2548                builder.0.request = builder.0.request.set_page_token(token);
2549                builder.send()
2550            };
2551            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2552        }
2553
2554        /// Streams each item in the collection.
2555        pub fn by_item(
2556            self,
2557        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2558            crate::model::ListVulnerabilityReportsResponse,
2559            crate::Error,
2560        > {
2561            use google_cloud_gax::paginator::Paginator;
2562            self.by_page().items()
2563        }
2564
2565        /// Sets the value of [parent][crate::model::ListVulnerabilityReportsRequest::parent].
2566        ///
2567        /// This is a **required** field for requests.
2568        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2569            self.0.request.parent = v.into();
2570            self
2571        }
2572
2573        /// Sets the value of [page_size][crate::model::ListVulnerabilityReportsRequest::page_size].
2574        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2575            self.0.request.page_size = v.into();
2576            self
2577        }
2578
2579        /// Sets the value of [page_token][crate::model::ListVulnerabilityReportsRequest::page_token].
2580        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2581            self.0.request.page_token = v.into();
2582            self
2583        }
2584
2585        /// Sets the value of [filter][crate::model::ListVulnerabilityReportsRequest::filter].
2586        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2587            self.0.request.filter = v.into();
2588            self
2589        }
2590    }
2591
2592    #[doc(hidden)]
2593    impl crate::RequestBuilder for ListVulnerabilityReports {
2594        fn request_options(&mut self) -> &mut crate::RequestOptions {
2595            &mut self.0.options
2596        }
2597    }
2598
2599    /// The request builder for [OsConfigZonalService::get_operation][crate::client::OsConfigZonalService::get_operation] calls.
2600    ///
2601    /// # Example
2602    /// ```
2603    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::GetOperation;
2604    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
2605    ///
2606    /// let builder = prepare_request_builder();
2607    /// let response = builder.send().await?;
2608    /// # Ok(()) }
2609    ///
2610    /// fn prepare_request_builder() -> GetOperation {
2611    ///   # panic!();
2612    ///   // ... details omitted ...
2613    /// }
2614    /// ```
2615    #[derive(Clone, Debug)]
2616    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2617
2618    impl GetOperation {
2619        pub(crate) fn new(
2620            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2621        ) -> Self {
2622            Self(RequestBuilder::new(stub))
2623        }
2624
2625        /// Sets the full request, replacing any prior values.
2626        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2627            mut self,
2628            v: V,
2629        ) -> Self {
2630            self.0.request = v.into();
2631            self
2632        }
2633
2634        /// Sets all the options, replacing any prior values.
2635        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2636            self.0.options = v.into();
2637            self
2638        }
2639
2640        /// Sends the request.
2641        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2642            (*self.0.stub)
2643                .get_operation(self.0.request, self.0.options)
2644                .await
2645                .map(crate::Response::into_body)
2646        }
2647
2648        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2649        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2650            self.0.request.name = v.into();
2651            self
2652        }
2653    }
2654
2655    #[doc(hidden)]
2656    impl crate::RequestBuilder for GetOperation {
2657        fn request_options(&mut self) -> &mut crate::RequestOptions {
2658            &mut self.0.options
2659        }
2660    }
2661
2662    /// The request builder for [OsConfigZonalService::cancel_operation][crate::client::OsConfigZonalService::cancel_operation] calls.
2663    ///
2664    /// # Example
2665    /// ```
2666    /// # use google_cloud_osconfig_v1::builder::os_config_zonal_service::CancelOperation;
2667    /// # async fn sample() -> google_cloud_osconfig_v1::Result<()> {
2668    ///
2669    /// let builder = prepare_request_builder();
2670    /// let response = builder.send().await?;
2671    /// # Ok(()) }
2672    ///
2673    /// fn prepare_request_builder() -> CancelOperation {
2674    ///   # panic!();
2675    ///   // ... details omitted ...
2676    /// }
2677    /// ```
2678    #[derive(Clone, Debug)]
2679    pub struct CancelOperation(
2680        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2681    );
2682
2683    impl CancelOperation {
2684        pub(crate) fn new(
2685            stub: std::sync::Arc<dyn super::super::stub::dynamic::OsConfigZonalService>,
2686        ) -> Self {
2687            Self(RequestBuilder::new(stub))
2688        }
2689
2690        /// Sets the full request, replacing any prior values.
2691        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2692            mut self,
2693            v: V,
2694        ) -> Self {
2695            self.0.request = v.into();
2696            self
2697        }
2698
2699        /// Sets all the options, replacing any prior values.
2700        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2701            self.0.options = v.into();
2702            self
2703        }
2704
2705        /// Sends the request.
2706        pub async fn send(self) -> Result<()> {
2707            (*self.0.stub)
2708                .cancel_operation(self.0.request, self.0.options)
2709                .await
2710                .map(crate::Response::into_body)
2711        }
2712
2713        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2714        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2715            self.0.request.name = v.into();
2716            self
2717        }
2718    }
2719
2720    #[doc(hidden)]
2721    impl crate::RequestBuilder for CancelOperation {
2722        fn request_options(&mut self) -> &mut crate::RequestOptions {
2723            &mut self.0.options
2724        }
2725    }
2726}