Skip to main content

google_cloud_dns_v1/
builder.rs

1// Copyright 2026 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 [Changes][crate::client::Changes].
18pub mod changes {
19    use crate::Result;
20
21    /// A builder for [Changes][crate::client::Changes].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_dns_v1::*;
26    /// # use builder::changes::ClientBuilder;
27    /// # use client::Changes;
28    /// let builder : ClientBuilder = Changes::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://dns.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::Changes;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = Changes;
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::Changes] 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::Changes>,
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(stub: std::sync::Arc<dyn super::super::stub::dynamic::Changes>) -> Self {
64            Self {
65                stub,
66                request: R::default(),
67                options: crate::RequestOptions::default(),
68            }
69        }
70    }
71
72    /// The request builder for [Changes::create][crate::client::Changes::create] calls.
73    ///
74    /// # Example
75    /// ```
76    /// # use google_cloud_dns_v1::builder::changes::Create;
77    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
78    ///
79    /// let builder = prepare_request_builder();
80    /// let response = builder.send().await?;
81    /// # Ok(()) }
82    ///
83    /// fn prepare_request_builder() -> Create {
84    ///   # panic!();
85    ///   // ... details omitted ...
86    /// }
87    /// ```
88    #[derive(Clone, Debug)]
89    pub struct Create(RequestBuilder<crate::model::changes::CreateRequest>);
90
91    impl Create {
92        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Changes>) -> Self {
93            Self(RequestBuilder::new(stub))
94        }
95
96        /// Sets the full request, replacing any prior values.
97        pub fn with_request<V: Into<crate::model::changes::CreateRequest>>(mut self, v: V) -> Self {
98            self.0.request = v.into();
99            self
100        }
101
102        /// Sets all the options, replacing any prior values.
103        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
104            self.0.options = v.into();
105            self
106        }
107
108        /// Sends the request.
109        pub async fn send(self) -> Result<crate::model::Change> {
110            (*self.0.stub)
111                .create(self.0.request, self.0.options)
112                .await
113                .map(crate::Response::into_body)
114        }
115
116        /// Sets the value of [client_operation_id][crate::model::changes::CreateRequest::client_operation_id].
117        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
118        where
119            T: std::convert::Into<std::string::String>,
120        {
121            self.0.request.client_operation_id = std::option::Option::Some(v.into());
122            self
123        }
124
125        /// Sets or clears the value of [client_operation_id][crate::model::changes::CreateRequest::client_operation_id].
126        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
127        where
128            T: std::convert::Into<std::string::String>,
129        {
130            self.0.request.client_operation_id = v.map(|x| x.into());
131            self
132        }
133
134        /// Sets the value of [managed_zone][crate::model::changes::CreateRequest::managed_zone].
135        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
136            self.0.request.managed_zone = v.into();
137            self
138        }
139
140        /// Sets the value of [project][crate::model::changes::CreateRequest::project].
141        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
142            self.0.request.project = v.into();
143            self
144        }
145
146        /// Sets the value of [body][crate::model::changes::CreateRequest::body].
147        pub fn set_body<T>(mut self, v: T) -> Self
148        where
149            T: std::convert::Into<crate::model::Change>,
150        {
151            self.0.request.body = std::option::Option::Some(v.into());
152            self
153        }
154
155        /// Sets or clears the value of [body][crate::model::changes::CreateRequest::body].
156        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
157        where
158            T: std::convert::Into<crate::model::Change>,
159        {
160            self.0.request.body = v.map(|x| x.into());
161            self
162        }
163    }
164
165    #[doc(hidden)]
166    impl crate::RequestBuilder for Create {
167        fn request_options(&mut self) -> &mut crate::RequestOptions {
168            &mut self.0.options
169        }
170    }
171
172    /// The request builder for [Changes::get][crate::client::Changes::get] calls.
173    ///
174    /// # Example
175    /// ```
176    /// # use google_cloud_dns_v1::builder::changes::Get;
177    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
178    ///
179    /// let builder = prepare_request_builder();
180    /// let response = builder.send().await?;
181    /// # Ok(()) }
182    ///
183    /// fn prepare_request_builder() -> Get {
184    ///   # panic!();
185    ///   // ... details omitted ...
186    /// }
187    /// ```
188    #[derive(Clone, Debug)]
189    pub struct Get(RequestBuilder<crate::model::changes::GetRequest>);
190
191    impl Get {
192        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Changes>) -> Self {
193            Self(RequestBuilder::new(stub))
194        }
195
196        /// Sets the full request, replacing any prior values.
197        pub fn with_request<V: Into<crate::model::changes::GetRequest>>(mut self, v: V) -> Self {
198            self.0.request = v.into();
199            self
200        }
201
202        /// Sets all the options, replacing any prior values.
203        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
204            self.0.options = v.into();
205            self
206        }
207
208        /// Sends the request.
209        pub async fn send(self) -> Result<crate::model::Change> {
210            (*self.0.stub)
211                .get(self.0.request, self.0.options)
212                .await
213                .map(crate::Response::into_body)
214        }
215
216        /// Sets the value of [change_id][crate::model::changes::GetRequest::change_id].
217        pub fn set_change_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
218            self.0.request.change_id = v.into();
219            self
220        }
221
222        /// Sets the value of [client_operation_id][crate::model::changes::GetRequest::client_operation_id].
223        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
224        where
225            T: std::convert::Into<std::string::String>,
226        {
227            self.0.request.client_operation_id = std::option::Option::Some(v.into());
228            self
229        }
230
231        /// Sets or clears the value of [client_operation_id][crate::model::changes::GetRequest::client_operation_id].
232        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
233        where
234            T: std::convert::Into<std::string::String>,
235        {
236            self.0.request.client_operation_id = v.map(|x| x.into());
237            self
238        }
239
240        /// Sets the value of [managed_zone][crate::model::changes::GetRequest::managed_zone].
241        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
242            self.0.request.managed_zone = v.into();
243            self
244        }
245
246        /// Sets the value of [project][crate::model::changes::GetRequest::project].
247        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
248            self.0.request.project = v.into();
249            self
250        }
251    }
252
253    #[doc(hidden)]
254    impl crate::RequestBuilder for Get {
255        fn request_options(&mut self) -> &mut crate::RequestOptions {
256            &mut self.0.options
257        }
258    }
259
260    /// The request builder for [Changes::list][crate::client::Changes::list] calls.
261    ///
262    /// # Example
263    /// ```
264    /// # use google_cloud_dns_v1::builder::changes::List;
265    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
266    /// use google_cloud_gax::paginator::ItemPaginator;
267    ///
268    /// let builder = prepare_request_builder();
269    /// let mut items = builder.by_item();
270    /// while let Some(result) = items.next().await {
271    ///   let item = result?;
272    /// }
273    /// # Ok(()) }
274    ///
275    /// fn prepare_request_builder() -> List {
276    ///   # panic!();
277    ///   // ... details omitted ...
278    /// }
279    /// ```
280    #[derive(Clone, Debug)]
281    pub struct List(RequestBuilder<crate::model::changes::ListRequest>);
282
283    impl List {
284        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Changes>) -> Self {
285            Self(RequestBuilder::new(stub))
286        }
287
288        /// Sets the full request, replacing any prior values.
289        pub fn with_request<V: Into<crate::model::changes::ListRequest>>(mut self, v: V) -> Self {
290            self.0.request = v.into();
291            self
292        }
293
294        /// Sets all the options, replacing any prior values.
295        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
296            self.0.options = v.into();
297            self
298        }
299
300        /// Sends the request.
301        pub async fn send(self) -> Result<crate::model::ChangesListResponse> {
302            (*self.0.stub)
303                .list(self.0.request, self.0.options)
304                .await
305                .map(crate::Response::into_body)
306        }
307
308        /// Streams each page in the collection.
309        pub fn by_page(
310            self,
311        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ChangesListResponse, crate::Error>
312        {
313            use std::clone::Clone;
314            let token = self.0.request.page_token.clone().unwrap_or_default();
315            let execute = move |token: String| {
316                let mut builder = self.clone();
317                builder.0.request = builder.0.request.set_page_token(token);
318                builder.send()
319            };
320            google_cloud_gax::paginator::internal::new_paginator(token, execute)
321        }
322
323        /// Streams each item in the collection.
324        pub fn by_item(
325            self,
326        ) -> impl google_cloud_gax::paginator::ItemPaginator<
327            crate::model::ChangesListResponse,
328            crate::Error,
329        > {
330            use google_cloud_gax::paginator::Paginator;
331            self.by_page().items()
332        }
333
334        /// Sets the value of [managed_zone][crate::model::changes::ListRequest::managed_zone].
335        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
336            self.0.request.managed_zone = v.into();
337            self
338        }
339
340        /// Sets the value of [max_results][crate::model::changes::ListRequest::max_results].
341        pub fn set_max_results<T>(mut self, v: T) -> Self
342        where
343            T: std::convert::Into<i32>,
344        {
345            self.0.request.max_results = std::option::Option::Some(v.into());
346            self
347        }
348
349        /// Sets or clears the value of [max_results][crate::model::changes::ListRequest::max_results].
350        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
351        where
352            T: std::convert::Into<i32>,
353        {
354            self.0.request.max_results = v.map(|x| x.into());
355            self
356        }
357
358        /// Sets the value of [page_token][crate::model::changes::ListRequest::page_token].
359        pub fn set_page_token<T>(mut self, v: T) -> Self
360        where
361            T: std::convert::Into<std::string::String>,
362        {
363            self.0.request.page_token = std::option::Option::Some(v.into());
364            self
365        }
366
367        /// Sets or clears the value of [page_token][crate::model::changes::ListRequest::page_token].
368        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
369        where
370            T: std::convert::Into<std::string::String>,
371        {
372            self.0.request.page_token = v.map(|x| x.into());
373            self
374        }
375
376        /// Sets the value of [project][crate::model::changes::ListRequest::project].
377        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
378            self.0.request.project = v.into();
379            self
380        }
381
382        /// Sets the value of [sort_by][crate::model::changes::ListRequest::sort_by].
383        pub fn set_sort_by<T>(mut self, v: T) -> Self
384        where
385            T: std::convert::Into<crate::model::changes::list_request::SortBy>,
386        {
387            self.0.request.sort_by = std::option::Option::Some(v.into());
388            self
389        }
390
391        /// Sets or clears the value of [sort_by][crate::model::changes::ListRequest::sort_by].
392        pub fn set_or_clear_sort_by<T>(mut self, v: std::option::Option<T>) -> Self
393        where
394            T: std::convert::Into<crate::model::changes::list_request::SortBy>,
395        {
396            self.0.request.sort_by = v.map(|x| x.into());
397            self
398        }
399
400        /// Sets the value of [sort_order][crate::model::changes::ListRequest::sort_order].
401        pub fn set_sort_order<T>(mut self, v: T) -> Self
402        where
403            T: std::convert::Into<std::string::String>,
404        {
405            self.0.request.sort_order = std::option::Option::Some(v.into());
406            self
407        }
408
409        /// Sets or clears the value of [sort_order][crate::model::changes::ListRequest::sort_order].
410        pub fn set_or_clear_sort_order<T>(mut self, v: std::option::Option<T>) -> Self
411        where
412            T: std::convert::Into<std::string::String>,
413        {
414            self.0.request.sort_order = v.map(|x| x.into());
415            self
416        }
417    }
418
419    #[doc(hidden)]
420    impl crate::RequestBuilder for List {
421        fn request_options(&mut self) -> &mut crate::RequestOptions {
422            &mut self.0.options
423        }
424    }
425}
426
427/// Request and client builders for [DnsKeys][crate::client::DnsKeys].
428pub mod dns_keys {
429    use crate::Result;
430
431    /// A builder for [DnsKeys][crate::client::DnsKeys].
432    ///
433    /// ```
434    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
435    /// # use google_cloud_dns_v1::*;
436    /// # use builder::dns_keys::ClientBuilder;
437    /// # use client::DnsKeys;
438    /// let builder : ClientBuilder = DnsKeys::builder();
439    /// let client = builder
440    ///     .with_endpoint("https://dns.googleapis.com")
441    ///     .build().await?;
442    /// # Ok(()) }
443    /// ```
444    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
445
446    pub(crate) mod client {
447        use super::super::super::client::DnsKeys;
448        pub struct Factory;
449        impl crate::ClientFactory for Factory {
450            type Client = DnsKeys;
451            type Credentials = gaxi::options::Credentials;
452            async fn build(
453                self,
454                config: gaxi::options::ClientConfig,
455            ) -> crate::ClientBuilderResult<Self::Client> {
456                Self::Client::new(config).await
457            }
458        }
459    }
460
461    /// Common implementation for [crate::client::DnsKeys] request builders.
462    #[derive(Clone, Debug)]
463    pub(crate) struct RequestBuilder<R: std::default::Default> {
464        stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsKeys>,
465        request: R,
466        options: crate::RequestOptions,
467    }
468
469    impl<R> RequestBuilder<R>
470    where
471        R: std::default::Default,
472    {
473        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsKeys>) -> Self {
474            Self {
475                stub,
476                request: R::default(),
477                options: crate::RequestOptions::default(),
478            }
479        }
480    }
481
482    /// The request builder for [DnsKeys::get][crate::client::DnsKeys::get] calls.
483    ///
484    /// # Example
485    /// ```
486    /// # use google_cloud_dns_v1::builder::dns_keys::Get;
487    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
488    ///
489    /// let builder = prepare_request_builder();
490    /// let response = builder.send().await?;
491    /// # Ok(()) }
492    ///
493    /// fn prepare_request_builder() -> Get {
494    ///   # panic!();
495    ///   // ... details omitted ...
496    /// }
497    /// ```
498    #[derive(Clone, Debug)]
499    pub struct Get(RequestBuilder<crate::model::dns_keys::GetRequest>);
500
501    impl Get {
502        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsKeys>) -> Self {
503            Self(RequestBuilder::new(stub))
504        }
505
506        /// Sets the full request, replacing any prior values.
507        pub fn with_request<V: Into<crate::model::dns_keys::GetRequest>>(mut self, v: V) -> Self {
508            self.0.request = v.into();
509            self
510        }
511
512        /// Sets all the options, replacing any prior values.
513        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
514            self.0.options = v.into();
515            self
516        }
517
518        /// Sends the request.
519        pub async fn send(self) -> Result<crate::model::DnsKey> {
520            (*self.0.stub)
521                .get(self.0.request, self.0.options)
522                .await
523                .map(crate::Response::into_body)
524        }
525
526        /// Sets the value of [client_operation_id][crate::model::dns_keys::GetRequest::client_operation_id].
527        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
528        where
529            T: std::convert::Into<std::string::String>,
530        {
531            self.0.request.client_operation_id = std::option::Option::Some(v.into());
532            self
533        }
534
535        /// Sets or clears the value of [client_operation_id][crate::model::dns_keys::GetRequest::client_operation_id].
536        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
537        where
538            T: std::convert::Into<std::string::String>,
539        {
540            self.0.request.client_operation_id = v.map(|x| x.into());
541            self
542        }
543
544        /// Sets the value of [digest_type][crate::model::dns_keys::GetRequest::digest_type].
545        pub fn set_digest_type<T>(mut self, v: T) -> Self
546        where
547            T: std::convert::Into<std::string::String>,
548        {
549            self.0.request.digest_type = std::option::Option::Some(v.into());
550            self
551        }
552
553        /// Sets or clears the value of [digest_type][crate::model::dns_keys::GetRequest::digest_type].
554        pub fn set_or_clear_digest_type<T>(mut self, v: std::option::Option<T>) -> Self
555        where
556            T: std::convert::Into<std::string::String>,
557        {
558            self.0.request.digest_type = v.map(|x| x.into());
559            self
560        }
561
562        /// Sets the value of [dns_key_id][crate::model::dns_keys::GetRequest::dns_key_id].
563        pub fn set_dns_key_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
564            self.0.request.dns_key_id = v.into();
565            self
566        }
567
568        /// Sets the value of [managed_zone][crate::model::dns_keys::GetRequest::managed_zone].
569        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
570            self.0.request.managed_zone = v.into();
571            self
572        }
573
574        /// Sets the value of [project][crate::model::dns_keys::GetRequest::project].
575        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
576            self.0.request.project = v.into();
577            self
578        }
579    }
580
581    #[doc(hidden)]
582    impl crate::RequestBuilder for Get {
583        fn request_options(&mut self) -> &mut crate::RequestOptions {
584            &mut self.0.options
585        }
586    }
587
588    /// The request builder for [DnsKeys::list][crate::client::DnsKeys::list] calls.
589    ///
590    /// # Example
591    /// ```
592    /// # use google_cloud_dns_v1::builder::dns_keys::List;
593    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
594    /// use google_cloud_gax::paginator::ItemPaginator;
595    ///
596    /// let builder = prepare_request_builder();
597    /// let mut items = builder.by_item();
598    /// while let Some(result) = items.next().await {
599    ///   let item = result?;
600    /// }
601    /// # Ok(()) }
602    ///
603    /// fn prepare_request_builder() -> List {
604    ///   # panic!();
605    ///   // ... details omitted ...
606    /// }
607    /// ```
608    #[derive(Clone, Debug)]
609    pub struct List(RequestBuilder<crate::model::dns_keys::ListRequest>);
610
611    impl List {
612        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::DnsKeys>) -> Self {
613            Self(RequestBuilder::new(stub))
614        }
615
616        /// Sets the full request, replacing any prior values.
617        pub fn with_request<V: Into<crate::model::dns_keys::ListRequest>>(mut self, v: V) -> Self {
618            self.0.request = v.into();
619            self
620        }
621
622        /// Sets all the options, replacing any prior values.
623        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
624            self.0.options = v.into();
625            self
626        }
627
628        /// Sends the request.
629        pub async fn send(self) -> Result<crate::model::DnsKeysListResponse> {
630            (*self.0.stub)
631                .list(self.0.request, self.0.options)
632                .await
633                .map(crate::Response::into_body)
634        }
635
636        /// Streams each page in the collection.
637        pub fn by_page(
638            self,
639        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::DnsKeysListResponse, crate::Error>
640        {
641            use std::clone::Clone;
642            let token = self.0.request.page_token.clone().unwrap_or_default();
643            let execute = move |token: String| {
644                let mut builder = self.clone();
645                builder.0.request = builder.0.request.set_page_token(token);
646                builder.send()
647            };
648            google_cloud_gax::paginator::internal::new_paginator(token, execute)
649        }
650
651        /// Streams each item in the collection.
652        pub fn by_item(
653            self,
654        ) -> impl google_cloud_gax::paginator::ItemPaginator<
655            crate::model::DnsKeysListResponse,
656            crate::Error,
657        > {
658            use google_cloud_gax::paginator::Paginator;
659            self.by_page().items()
660        }
661
662        /// Sets the value of [digest_type][crate::model::dns_keys::ListRequest::digest_type].
663        pub fn set_digest_type<T>(mut self, v: T) -> Self
664        where
665            T: std::convert::Into<std::string::String>,
666        {
667            self.0.request.digest_type = std::option::Option::Some(v.into());
668            self
669        }
670
671        /// Sets or clears the value of [digest_type][crate::model::dns_keys::ListRequest::digest_type].
672        pub fn set_or_clear_digest_type<T>(mut self, v: std::option::Option<T>) -> Self
673        where
674            T: std::convert::Into<std::string::String>,
675        {
676            self.0.request.digest_type = v.map(|x| x.into());
677            self
678        }
679
680        /// Sets the value of [managed_zone][crate::model::dns_keys::ListRequest::managed_zone].
681        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
682            self.0.request.managed_zone = v.into();
683            self
684        }
685
686        /// Sets the value of [max_results][crate::model::dns_keys::ListRequest::max_results].
687        pub fn set_max_results<T>(mut self, v: T) -> Self
688        where
689            T: std::convert::Into<i32>,
690        {
691            self.0.request.max_results = std::option::Option::Some(v.into());
692            self
693        }
694
695        /// Sets or clears the value of [max_results][crate::model::dns_keys::ListRequest::max_results].
696        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
697        where
698            T: std::convert::Into<i32>,
699        {
700            self.0.request.max_results = v.map(|x| x.into());
701            self
702        }
703
704        /// Sets the value of [page_token][crate::model::dns_keys::ListRequest::page_token].
705        pub fn set_page_token<T>(mut self, v: T) -> Self
706        where
707            T: std::convert::Into<std::string::String>,
708        {
709            self.0.request.page_token = std::option::Option::Some(v.into());
710            self
711        }
712
713        /// Sets or clears the value of [page_token][crate::model::dns_keys::ListRequest::page_token].
714        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
715        where
716            T: std::convert::Into<std::string::String>,
717        {
718            self.0.request.page_token = v.map(|x| x.into());
719            self
720        }
721
722        /// Sets the value of [project][crate::model::dns_keys::ListRequest::project].
723        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
724            self.0.request.project = v.into();
725            self
726        }
727    }
728
729    #[doc(hidden)]
730    impl crate::RequestBuilder for List {
731        fn request_options(&mut self) -> &mut crate::RequestOptions {
732            &mut self.0.options
733        }
734    }
735}
736
737/// Request and client builders for [ManagedZoneOperations][crate::client::ManagedZoneOperations].
738pub mod managed_zone_operations {
739    use crate::Result;
740
741    /// A builder for [ManagedZoneOperations][crate::client::ManagedZoneOperations].
742    ///
743    /// ```
744    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
745    /// # use google_cloud_dns_v1::*;
746    /// # use builder::managed_zone_operations::ClientBuilder;
747    /// # use client::ManagedZoneOperations;
748    /// let builder : ClientBuilder = ManagedZoneOperations::builder();
749    /// let client = builder
750    ///     .with_endpoint("https://dns.googleapis.com")
751    ///     .build().await?;
752    /// # Ok(()) }
753    /// ```
754    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
755
756    pub(crate) mod client {
757        use super::super::super::client::ManagedZoneOperations;
758        pub struct Factory;
759        impl crate::ClientFactory for Factory {
760            type Client = ManagedZoneOperations;
761            type Credentials = gaxi::options::Credentials;
762            async fn build(
763                self,
764                config: gaxi::options::ClientConfig,
765            ) -> crate::ClientBuilderResult<Self::Client> {
766                Self::Client::new(config).await
767            }
768        }
769    }
770
771    /// Common implementation for [crate::client::ManagedZoneOperations] request builders.
772    #[derive(Clone, Debug)]
773    pub(crate) struct RequestBuilder<R: std::default::Default> {
774        stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZoneOperations>,
775        request: R,
776        options: crate::RequestOptions,
777    }
778
779    impl<R> RequestBuilder<R>
780    where
781        R: std::default::Default,
782    {
783        pub(crate) fn new(
784            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZoneOperations>,
785        ) -> Self {
786            Self {
787                stub,
788                request: R::default(),
789                options: crate::RequestOptions::default(),
790            }
791        }
792    }
793
794    /// The request builder for [ManagedZoneOperations::get][crate::client::ManagedZoneOperations::get] calls.
795    ///
796    /// # Example
797    /// ```
798    /// # use google_cloud_dns_v1::builder::managed_zone_operations::Get;
799    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
800    ///
801    /// let builder = prepare_request_builder();
802    /// let response = builder.send().await?;
803    /// # Ok(()) }
804    ///
805    /// fn prepare_request_builder() -> Get {
806    ///   # panic!();
807    ///   // ... details omitted ...
808    /// }
809    /// ```
810    #[derive(Clone, Debug)]
811    pub struct Get(RequestBuilder<crate::model::managed_zone_operations::GetRequest>);
812
813    impl Get {
814        pub(crate) fn new(
815            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZoneOperations>,
816        ) -> Self {
817            Self(RequestBuilder::new(stub))
818        }
819
820        /// Sets the full request, replacing any prior values.
821        pub fn with_request<V: Into<crate::model::managed_zone_operations::GetRequest>>(
822            mut self,
823            v: V,
824        ) -> Self {
825            self.0.request = v.into();
826            self
827        }
828
829        /// Sets all the options, replacing any prior values.
830        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
831            self.0.options = v.into();
832            self
833        }
834
835        /// Sends the request.
836        pub async fn send(self) -> Result<crate::model::Operation> {
837            (*self.0.stub)
838                .get(self.0.request, self.0.options)
839                .await
840                .map(crate::Response::into_body)
841        }
842
843        /// Sets the value of [client_operation_id][crate::model::managed_zone_operations::GetRequest::client_operation_id].
844        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
845        where
846            T: std::convert::Into<std::string::String>,
847        {
848            self.0.request.client_operation_id = std::option::Option::Some(v.into());
849            self
850        }
851
852        /// Sets or clears the value of [client_operation_id][crate::model::managed_zone_operations::GetRequest::client_operation_id].
853        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
854        where
855            T: std::convert::Into<std::string::String>,
856        {
857            self.0.request.client_operation_id = v.map(|x| x.into());
858            self
859        }
860
861        /// Sets the value of [managed_zone][crate::model::managed_zone_operations::GetRequest::managed_zone].
862        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
863            self.0.request.managed_zone = v.into();
864            self
865        }
866
867        /// Sets the value of [operation][crate::model::managed_zone_operations::GetRequest::operation].
868        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
869            self.0.request.operation = v.into();
870            self
871        }
872
873        /// Sets the value of [project][crate::model::managed_zone_operations::GetRequest::project].
874        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
875            self.0.request.project = v.into();
876            self
877        }
878    }
879
880    #[doc(hidden)]
881    impl crate::RequestBuilder for Get {
882        fn request_options(&mut self) -> &mut crate::RequestOptions {
883            &mut self.0.options
884        }
885    }
886
887    /// The request builder for [ManagedZoneOperations::list][crate::client::ManagedZoneOperations::list] calls.
888    ///
889    /// # Example
890    /// ```
891    /// # use google_cloud_dns_v1::builder::managed_zone_operations::List;
892    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
893    /// use google_cloud_gax::paginator::ItemPaginator;
894    ///
895    /// let builder = prepare_request_builder();
896    /// let mut items = builder.by_item();
897    /// while let Some(result) = items.next().await {
898    ///   let item = result?;
899    /// }
900    /// # Ok(()) }
901    ///
902    /// fn prepare_request_builder() -> List {
903    ///   # panic!();
904    ///   // ... details omitted ...
905    /// }
906    /// ```
907    #[derive(Clone, Debug)]
908    pub struct List(RequestBuilder<crate::model::managed_zone_operations::ListRequest>);
909
910    impl List {
911        pub(crate) fn new(
912            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZoneOperations>,
913        ) -> Self {
914            Self(RequestBuilder::new(stub))
915        }
916
917        /// Sets the full request, replacing any prior values.
918        pub fn with_request<V: Into<crate::model::managed_zone_operations::ListRequest>>(
919            mut self,
920            v: V,
921        ) -> Self {
922            self.0.request = v.into();
923            self
924        }
925
926        /// Sets all the options, replacing any prior values.
927        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
928            self.0.options = v.into();
929            self
930        }
931
932        /// Sends the request.
933        pub async fn send(self) -> Result<crate::model::ManagedZoneOperationsListResponse> {
934            (*self.0.stub)
935                .list(self.0.request, self.0.options)
936                .await
937                .map(crate::Response::into_body)
938        }
939
940        /// Streams each page in the collection.
941        pub fn by_page(
942            self,
943        ) -> impl google_cloud_gax::paginator::Paginator<
944            crate::model::ManagedZoneOperationsListResponse,
945            crate::Error,
946        > {
947            use std::clone::Clone;
948            let token = self.0.request.page_token.clone().unwrap_or_default();
949            let execute = move |token: String| {
950                let mut builder = self.clone();
951                builder.0.request = builder.0.request.set_page_token(token);
952                builder.send()
953            };
954            google_cloud_gax::paginator::internal::new_paginator(token, execute)
955        }
956
957        /// Streams each item in the collection.
958        pub fn by_item(
959            self,
960        ) -> impl google_cloud_gax::paginator::ItemPaginator<
961            crate::model::ManagedZoneOperationsListResponse,
962            crate::Error,
963        > {
964            use google_cloud_gax::paginator::Paginator;
965            self.by_page().items()
966        }
967
968        /// Sets the value of [managed_zone][crate::model::managed_zone_operations::ListRequest::managed_zone].
969        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
970            self.0.request.managed_zone = v.into();
971            self
972        }
973
974        /// Sets the value of [max_results][crate::model::managed_zone_operations::ListRequest::max_results].
975        pub fn set_max_results<T>(mut self, v: T) -> Self
976        where
977            T: std::convert::Into<i32>,
978        {
979            self.0.request.max_results = std::option::Option::Some(v.into());
980            self
981        }
982
983        /// Sets or clears the value of [max_results][crate::model::managed_zone_operations::ListRequest::max_results].
984        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
985        where
986            T: std::convert::Into<i32>,
987        {
988            self.0.request.max_results = v.map(|x| x.into());
989            self
990        }
991
992        /// Sets the value of [page_token][crate::model::managed_zone_operations::ListRequest::page_token].
993        pub fn set_page_token<T>(mut self, v: T) -> Self
994        where
995            T: std::convert::Into<std::string::String>,
996        {
997            self.0.request.page_token = std::option::Option::Some(v.into());
998            self
999        }
1000
1001        /// Sets or clears the value of [page_token][crate::model::managed_zone_operations::ListRequest::page_token].
1002        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
1003        where
1004            T: std::convert::Into<std::string::String>,
1005        {
1006            self.0.request.page_token = v.map(|x| x.into());
1007            self
1008        }
1009
1010        /// Sets the value of [project][crate::model::managed_zone_operations::ListRequest::project].
1011        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1012            self.0.request.project = v.into();
1013            self
1014        }
1015
1016        /// Sets the value of [sort_by][crate::model::managed_zone_operations::ListRequest::sort_by].
1017        pub fn set_sort_by<T>(mut self, v: T) -> Self
1018        where
1019            T: std::convert::Into<crate::model::managed_zone_operations::list_request::SortBy>,
1020        {
1021            self.0.request.sort_by = std::option::Option::Some(v.into());
1022            self
1023        }
1024
1025        /// Sets or clears the value of [sort_by][crate::model::managed_zone_operations::ListRequest::sort_by].
1026        pub fn set_or_clear_sort_by<T>(mut self, v: std::option::Option<T>) -> Self
1027        where
1028            T: std::convert::Into<crate::model::managed_zone_operations::list_request::SortBy>,
1029        {
1030            self.0.request.sort_by = v.map(|x| x.into());
1031            self
1032        }
1033    }
1034
1035    #[doc(hidden)]
1036    impl crate::RequestBuilder for List {
1037        fn request_options(&mut self) -> &mut crate::RequestOptions {
1038            &mut self.0.options
1039        }
1040    }
1041}
1042
1043/// Request and client builders for [ManagedZones][crate::client::ManagedZones].
1044pub mod managed_zones {
1045    use crate::Result;
1046
1047    /// A builder for [ManagedZones][crate::client::ManagedZones].
1048    ///
1049    /// ```
1050    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1051    /// # use google_cloud_dns_v1::*;
1052    /// # use builder::managed_zones::ClientBuilder;
1053    /// # use client::ManagedZones;
1054    /// let builder : ClientBuilder = ManagedZones::builder();
1055    /// let client = builder
1056    ///     .with_endpoint("https://dns.googleapis.com")
1057    ///     .build().await?;
1058    /// # Ok(()) }
1059    /// ```
1060    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1061
1062    pub(crate) mod client {
1063        use super::super::super::client::ManagedZones;
1064        pub struct Factory;
1065        impl crate::ClientFactory for Factory {
1066            type Client = ManagedZones;
1067            type Credentials = gaxi::options::Credentials;
1068            async fn build(
1069                self,
1070                config: gaxi::options::ClientConfig,
1071            ) -> crate::ClientBuilderResult<Self::Client> {
1072                Self::Client::new(config).await
1073            }
1074        }
1075    }
1076
1077    /// Common implementation for [crate::client::ManagedZones] request builders.
1078    #[derive(Clone, Debug)]
1079    pub(crate) struct RequestBuilder<R: std::default::Default> {
1080        stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
1081        request: R,
1082        options: crate::RequestOptions,
1083    }
1084
1085    impl<R> RequestBuilder<R>
1086    where
1087        R: std::default::Default,
1088    {
1089        pub(crate) fn new(
1090            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
1091        ) -> Self {
1092            Self {
1093                stub,
1094                request: R::default(),
1095                options: crate::RequestOptions::default(),
1096            }
1097        }
1098    }
1099
1100    /// The request builder for [ManagedZones::create][crate::client::ManagedZones::create] calls.
1101    ///
1102    /// # Example
1103    /// ```
1104    /// # use google_cloud_dns_v1::builder::managed_zones::Create;
1105    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
1106    ///
1107    /// let builder = prepare_request_builder();
1108    /// let response = builder.send().await?;
1109    /// # Ok(()) }
1110    ///
1111    /// fn prepare_request_builder() -> Create {
1112    ///   # panic!();
1113    ///   // ... details omitted ...
1114    /// }
1115    /// ```
1116    #[derive(Clone, Debug)]
1117    pub struct Create(RequestBuilder<crate::model::managed_zones::CreateRequest>);
1118
1119    impl Create {
1120        pub(crate) fn new(
1121            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
1122        ) -> Self {
1123            Self(RequestBuilder::new(stub))
1124        }
1125
1126        /// Sets the full request, replacing any prior values.
1127        pub fn with_request<V: Into<crate::model::managed_zones::CreateRequest>>(
1128            mut self,
1129            v: V,
1130        ) -> Self {
1131            self.0.request = v.into();
1132            self
1133        }
1134
1135        /// Sets all the options, replacing any prior values.
1136        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1137            self.0.options = v.into();
1138            self
1139        }
1140
1141        /// Sends the request.
1142        pub async fn send(self) -> Result<crate::model::ManagedZone> {
1143            (*self.0.stub)
1144                .create(self.0.request, self.0.options)
1145                .await
1146                .map(crate::Response::into_body)
1147        }
1148
1149        /// Sets the value of [client_operation_id][crate::model::managed_zones::CreateRequest::client_operation_id].
1150        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
1151        where
1152            T: std::convert::Into<std::string::String>,
1153        {
1154            self.0.request.client_operation_id = std::option::Option::Some(v.into());
1155            self
1156        }
1157
1158        /// Sets or clears the value of [client_operation_id][crate::model::managed_zones::CreateRequest::client_operation_id].
1159        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
1160        where
1161            T: std::convert::Into<std::string::String>,
1162        {
1163            self.0.request.client_operation_id = v.map(|x| x.into());
1164            self
1165        }
1166
1167        /// Sets the value of [project][crate::model::managed_zones::CreateRequest::project].
1168        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1169            self.0.request.project = v.into();
1170            self
1171        }
1172
1173        /// Sets the value of [body][crate::model::managed_zones::CreateRequest::body].
1174        pub fn set_body<T>(mut self, v: T) -> Self
1175        where
1176            T: std::convert::Into<crate::model::ManagedZone>,
1177        {
1178            self.0.request.body = std::option::Option::Some(v.into());
1179            self
1180        }
1181
1182        /// Sets or clears the value of [body][crate::model::managed_zones::CreateRequest::body].
1183        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1184        where
1185            T: std::convert::Into<crate::model::ManagedZone>,
1186        {
1187            self.0.request.body = v.map(|x| x.into());
1188            self
1189        }
1190    }
1191
1192    #[doc(hidden)]
1193    impl crate::RequestBuilder for Create {
1194        fn request_options(&mut self) -> &mut crate::RequestOptions {
1195            &mut self.0.options
1196        }
1197    }
1198
1199    /// The request builder for [ManagedZones::delete][crate::client::ManagedZones::delete] calls.
1200    ///
1201    /// # Example
1202    /// ```
1203    /// # use google_cloud_dns_v1::builder::managed_zones::Delete;
1204    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
1205    ///
1206    /// let builder = prepare_request_builder();
1207    /// let response = builder.send().await?;
1208    /// # Ok(()) }
1209    ///
1210    /// fn prepare_request_builder() -> Delete {
1211    ///   # panic!();
1212    ///   // ... details omitted ...
1213    /// }
1214    /// ```
1215    #[derive(Clone, Debug)]
1216    pub struct Delete(RequestBuilder<crate::model::managed_zones::DeleteRequest>);
1217
1218    impl Delete {
1219        pub(crate) fn new(
1220            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
1221        ) -> Self {
1222            Self(RequestBuilder::new(stub))
1223        }
1224
1225        /// Sets the full request, replacing any prior values.
1226        pub fn with_request<V: Into<crate::model::managed_zones::DeleteRequest>>(
1227            mut self,
1228            v: V,
1229        ) -> Self {
1230            self.0.request = v.into();
1231            self
1232        }
1233
1234        /// Sets all the options, replacing any prior values.
1235        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1236            self.0.options = v.into();
1237            self
1238        }
1239
1240        /// Sends the request.
1241        pub async fn send(self) -> Result<()> {
1242            (*self.0.stub)
1243                .delete(self.0.request, self.0.options)
1244                .await
1245                .map(crate::Response::into_body)
1246        }
1247
1248        /// Sets the value of [client_operation_id][crate::model::managed_zones::DeleteRequest::client_operation_id].
1249        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
1250        where
1251            T: std::convert::Into<std::string::String>,
1252        {
1253            self.0.request.client_operation_id = std::option::Option::Some(v.into());
1254            self
1255        }
1256
1257        /// Sets or clears the value of [client_operation_id][crate::model::managed_zones::DeleteRequest::client_operation_id].
1258        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
1259        where
1260            T: std::convert::Into<std::string::String>,
1261        {
1262            self.0.request.client_operation_id = v.map(|x| x.into());
1263            self
1264        }
1265
1266        /// Sets the value of [managed_zone][crate::model::managed_zones::DeleteRequest::managed_zone].
1267        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1268            self.0.request.managed_zone = v.into();
1269            self
1270        }
1271
1272        /// Sets the value of [project][crate::model::managed_zones::DeleteRequest::project].
1273        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1274            self.0.request.project = v.into();
1275            self
1276        }
1277    }
1278
1279    #[doc(hidden)]
1280    impl crate::RequestBuilder for Delete {
1281        fn request_options(&mut self) -> &mut crate::RequestOptions {
1282            &mut self.0.options
1283        }
1284    }
1285
1286    /// The request builder for [ManagedZones::get][crate::client::ManagedZones::get] calls.
1287    ///
1288    /// # Example
1289    /// ```
1290    /// # use google_cloud_dns_v1::builder::managed_zones::Get;
1291    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
1292    ///
1293    /// let builder = prepare_request_builder();
1294    /// let response = builder.send().await?;
1295    /// # Ok(()) }
1296    ///
1297    /// fn prepare_request_builder() -> Get {
1298    ///   # panic!();
1299    ///   // ... details omitted ...
1300    /// }
1301    /// ```
1302    #[derive(Clone, Debug)]
1303    pub struct Get(RequestBuilder<crate::model::managed_zones::GetRequest>);
1304
1305    impl Get {
1306        pub(crate) fn new(
1307            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
1308        ) -> Self {
1309            Self(RequestBuilder::new(stub))
1310        }
1311
1312        /// Sets the full request, replacing any prior values.
1313        pub fn with_request<V: Into<crate::model::managed_zones::GetRequest>>(
1314            mut self,
1315            v: V,
1316        ) -> Self {
1317            self.0.request = v.into();
1318            self
1319        }
1320
1321        /// Sets all the options, replacing any prior values.
1322        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1323            self.0.options = v.into();
1324            self
1325        }
1326
1327        /// Sends the request.
1328        pub async fn send(self) -> Result<crate::model::ManagedZone> {
1329            (*self.0.stub)
1330                .get(self.0.request, self.0.options)
1331                .await
1332                .map(crate::Response::into_body)
1333        }
1334
1335        /// Sets the value of [client_operation_id][crate::model::managed_zones::GetRequest::client_operation_id].
1336        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
1337        where
1338            T: std::convert::Into<std::string::String>,
1339        {
1340            self.0.request.client_operation_id = std::option::Option::Some(v.into());
1341            self
1342        }
1343
1344        /// Sets or clears the value of [client_operation_id][crate::model::managed_zones::GetRequest::client_operation_id].
1345        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
1346        where
1347            T: std::convert::Into<std::string::String>,
1348        {
1349            self.0.request.client_operation_id = v.map(|x| x.into());
1350            self
1351        }
1352
1353        /// Sets the value of [managed_zone][crate::model::managed_zones::GetRequest::managed_zone].
1354        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1355            self.0.request.managed_zone = v.into();
1356            self
1357        }
1358
1359        /// Sets the value of [project][crate::model::managed_zones::GetRequest::project].
1360        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1361            self.0.request.project = v.into();
1362            self
1363        }
1364    }
1365
1366    #[doc(hidden)]
1367    impl crate::RequestBuilder for Get {
1368        fn request_options(&mut self) -> &mut crate::RequestOptions {
1369            &mut self.0.options
1370        }
1371    }
1372
1373    /// The request builder for [ManagedZones::get_iam_policy][crate::client::ManagedZones::get_iam_policy] calls.
1374    ///
1375    /// # Example
1376    /// ```
1377    /// # use google_cloud_dns_v1::builder::managed_zones::GetIamPolicy;
1378    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
1379    ///
1380    /// let builder = prepare_request_builder();
1381    /// let response = builder.send().await?;
1382    /// # Ok(()) }
1383    ///
1384    /// fn prepare_request_builder() -> GetIamPolicy {
1385    ///   # panic!();
1386    ///   // ... details omitted ...
1387    /// }
1388    /// ```
1389    #[derive(Clone, Debug)]
1390    pub struct GetIamPolicy(RequestBuilder<crate::model::managed_zones::GetIamPolicyRequest>);
1391
1392    impl GetIamPolicy {
1393        pub(crate) fn new(
1394            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
1395        ) -> Self {
1396            Self(RequestBuilder::new(stub))
1397        }
1398
1399        /// Sets the full request, replacing any prior values.
1400        pub fn with_request<V: Into<crate::model::managed_zones::GetIamPolicyRequest>>(
1401            mut self,
1402            v: V,
1403        ) -> Self {
1404            self.0.request = v.into();
1405            self
1406        }
1407
1408        /// Sets all the options, replacing any prior values.
1409        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1410            self.0.options = v.into();
1411            self
1412        }
1413
1414        /// Sends the request.
1415        pub async fn send(self) -> Result<crate::model::GoogleIamV1Policy> {
1416            (*self.0.stub)
1417                .get_iam_policy(self.0.request, self.0.options)
1418                .await
1419                .map(crate::Response::into_body)
1420        }
1421
1422        /// Sets the value of [resource][crate::model::managed_zones::GetIamPolicyRequest::resource].
1423        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1424            self.0.request.resource = v.into();
1425            self
1426        }
1427
1428        /// Sets the value of [body][crate::model::managed_zones::GetIamPolicyRequest::body].
1429        pub fn set_body<T>(mut self, v: T) -> Self
1430        where
1431            T: std::convert::Into<crate::model::GoogleIamV1GetIamPolicyRequest>,
1432        {
1433            self.0.request.body = std::option::Option::Some(v.into());
1434            self
1435        }
1436
1437        /// Sets or clears the value of [body][crate::model::managed_zones::GetIamPolicyRequest::body].
1438        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1439        where
1440            T: std::convert::Into<crate::model::GoogleIamV1GetIamPolicyRequest>,
1441        {
1442            self.0.request.body = v.map(|x| x.into());
1443            self
1444        }
1445    }
1446
1447    #[doc(hidden)]
1448    impl crate::RequestBuilder for GetIamPolicy {
1449        fn request_options(&mut self) -> &mut crate::RequestOptions {
1450            &mut self.0.options
1451        }
1452    }
1453
1454    /// The request builder for [ManagedZones::list][crate::client::ManagedZones::list] calls.
1455    ///
1456    /// # Example
1457    /// ```
1458    /// # use google_cloud_dns_v1::builder::managed_zones::List;
1459    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
1460    /// use google_cloud_gax::paginator::ItemPaginator;
1461    ///
1462    /// let builder = prepare_request_builder();
1463    /// let mut items = builder.by_item();
1464    /// while let Some(result) = items.next().await {
1465    ///   let item = result?;
1466    /// }
1467    /// # Ok(()) }
1468    ///
1469    /// fn prepare_request_builder() -> List {
1470    ///   # panic!();
1471    ///   // ... details omitted ...
1472    /// }
1473    /// ```
1474    #[derive(Clone, Debug)]
1475    pub struct List(RequestBuilder<crate::model::managed_zones::ListRequest>);
1476
1477    impl List {
1478        pub(crate) fn new(
1479            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
1480        ) -> Self {
1481            Self(RequestBuilder::new(stub))
1482        }
1483
1484        /// Sets the full request, replacing any prior values.
1485        pub fn with_request<V: Into<crate::model::managed_zones::ListRequest>>(
1486            mut self,
1487            v: V,
1488        ) -> Self {
1489            self.0.request = v.into();
1490            self
1491        }
1492
1493        /// Sets all the options, replacing any prior values.
1494        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1495            self.0.options = v.into();
1496            self
1497        }
1498
1499        /// Sends the request.
1500        pub async fn send(self) -> Result<crate::model::ManagedZonesListResponse> {
1501            (*self.0.stub)
1502                .list(self.0.request, self.0.options)
1503                .await
1504                .map(crate::Response::into_body)
1505        }
1506
1507        /// Streams each page in the collection.
1508        pub fn by_page(
1509            self,
1510        ) -> impl google_cloud_gax::paginator::Paginator<
1511            crate::model::ManagedZonesListResponse,
1512            crate::Error,
1513        > {
1514            use std::clone::Clone;
1515            let token = self.0.request.page_token.clone().unwrap_or_default();
1516            let execute = move |token: String| {
1517                let mut builder = self.clone();
1518                builder.0.request = builder.0.request.set_page_token(token);
1519                builder.send()
1520            };
1521            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1522        }
1523
1524        /// Streams each item in the collection.
1525        pub fn by_item(
1526            self,
1527        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1528            crate::model::ManagedZonesListResponse,
1529            crate::Error,
1530        > {
1531            use google_cloud_gax::paginator::Paginator;
1532            self.by_page().items()
1533        }
1534
1535        /// Sets the value of [dns_name][crate::model::managed_zones::ListRequest::dns_name].
1536        pub fn set_dns_name<T>(mut self, v: T) -> Self
1537        where
1538            T: std::convert::Into<std::string::String>,
1539        {
1540            self.0.request.dns_name = std::option::Option::Some(v.into());
1541            self
1542        }
1543
1544        /// Sets or clears the value of [dns_name][crate::model::managed_zones::ListRequest::dns_name].
1545        pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
1546        where
1547            T: std::convert::Into<std::string::String>,
1548        {
1549            self.0.request.dns_name = v.map(|x| x.into());
1550            self
1551        }
1552
1553        /// Sets the value of [max_results][crate::model::managed_zones::ListRequest::max_results].
1554        pub fn set_max_results<T>(mut self, v: T) -> Self
1555        where
1556            T: std::convert::Into<i32>,
1557        {
1558            self.0.request.max_results = std::option::Option::Some(v.into());
1559            self
1560        }
1561
1562        /// Sets or clears the value of [max_results][crate::model::managed_zones::ListRequest::max_results].
1563        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
1564        where
1565            T: std::convert::Into<i32>,
1566        {
1567            self.0.request.max_results = v.map(|x| x.into());
1568            self
1569        }
1570
1571        /// Sets the value of [page_token][crate::model::managed_zones::ListRequest::page_token].
1572        pub fn set_page_token<T>(mut self, v: T) -> Self
1573        where
1574            T: std::convert::Into<std::string::String>,
1575        {
1576            self.0.request.page_token = std::option::Option::Some(v.into());
1577            self
1578        }
1579
1580        /// Sets or clears the value of [page_token][crate::model::managed_zones::ListRequest::page_token].
1581        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
1582        where
1583            T: std::convert::Into<std::string::String>,
1584        {
1585            self.0.request.page_token = v.map(|x| x.into());
1586            self
1587        }
1588
1589        /// Sets the value of [project][crate::model::managed_zones::ListRequest::project].
1590        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1591            self.0.request.project = v.into();
1592            self
1593        }
1594    }
1595
1596    #[doc(hidden)]
1597    impl crate::RequestBuilder for List {
1598        fn request_options(&mut self) -> &mut crate::RequestOptions {
1599            &mut self.0.options
1600        }
1601    }
1602
1603    /// The request builder for [ManagedZones::patch][crate::client::ManagedZones::patch] calls.
1604    ///
1605    /// # Example
1606    /// ```
1607    /// # use google_cloud_dns_v1::builder::managed_zones::Patch;
1608    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
1609    ///
1610    /// let builder = prepare_request_builder();
1611    /// let response = builder.send().await?;
1612    /// # Ok(()) }
1613    ///
1614    /// fn prepare_request_builder() -> Patch {
1615    ///   # panic!();
1616    ///   // ... details omitted ...
1617    /// }
1618    /// ```
1619    #[derive(Clone, Debug)]
1620    pub struct Patch(RequestBuilder<crate::model::managed_zones::PatchRequest>);
1621
1622    impl Patch {
1623        pub(crate) fn new(
1624            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
1625        ) -> Self {
1626            Self(RequestBuilder::new(stub))
1627        }
1628
1629        /// Sets the full request, replacing any prior values.
1630        pub fn with_request<V: Into<crate::model::managed_zones::PatchRequest>>(
1631            mut self,
1632            v: V,
1633        ) -> Self {
1634            self.0.request = v.into();
1635            self
1636        }
1637
1638        /// Sets all the options, replacing any prior values.
1639        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1640            self.0.options = v.into();
1641            self
1642        }
1643
1644        /// Sends the request.
1645        pub async fn send(self) -> Result<crate::model::Operation> {
1646            (*self.0.stub)
1647                .patch(self.0.request, self.0.options)
1648                .await
1649                .map(crate::Response::into_body)
1650        }
1651
1652        /// Creates a [Poller][google_cloud_lro::Poller] to work with `patch`.
1653        pub fn poller(
1654            self,
1655        ) -> impl google_cloud_lro::Poller<crate::model::Operation, crate::model::Operation>
1656        {
1657            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1658            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1659            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1660            if let Some(ref mut details) = poller_options.tracing {
1661                details.method_name =
1662                    "google_cloud_dns_v1::client::ManagedZones::patch::until_done";
1663            }
1664
1665            let stub = self.0.stub.clone();
1666            let mut options = self.0.options.clone();
1667            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1668            let project = self.0.request.project.clone();
1669            let managed_zone = self.0.request.managed_zone.clone();
1670            let query = move |name| {
1671                let stub = stub.clone();
1672                let options = options.clone();
1673                let project = project.clone();
1674                let managed_zone = managed_zone.clone();
1675                async {
1676                    GetOperation::new(stub)
1677                        .set_project(project)
1678                        .set_managed_zone(managed_zone)
1679                        .set_operation(name)
1680                        .with_options(options)
1681                        .send()
1682                        .await
1683                }
1684            };
1685
1686            let start = move || async { self.send().await };
1687
1688            use google_cloud_lro::internal::PollerExt;
1689            google_cloud_lro::internal::new_discovery_poller(
1690                polling_error_policy,
1691                polling_backoff_policy,
1692                start,
1693                query,
1694            )
1695            .with_options(poller_options)
1696        }
1697
1698        /// Sets the value of [client_operation_id][crate::model::managed_zones::PatchRequest::client_operation_id].
1699        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
1700        where
1701            T: std::convert::Into<std::string::String>,
1702        {
1703            self.0.request.client_operation_id = std::option::Option::Some(v.into());
1704            self
1705        }
1706
1707        /// Sets or clears the value of [client_operation_id][crate::model::managed_zones::PatchRequest::client_operation_id].
1708        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
1709        where
1710            T: std::convert::Into<std::string::String>,
1711        {
1712            self.0.request.client_operation_id = v.map(|x| x.into());
1713            self
1714        }
1715
1716        /// Sets the value of [managed_zone][crate::model::managed_zones::PatchRequest::managed_zone].
1717        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1718            self.0.request.managed_zone = v.into();
1719            self
1720        }
1721
1722        /// Sets the value of [project][crate::model::managed_zones::PatchRequest::project].
1723        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1724            self.0.request.project = v.into();
1725            self
1726        }
1727
1728        /// Sets the value of [body][crate::model::managed_zones::PatchRequest::body].
1729        pub fn set_body<T>(mut self, v: T) -> Self
1730        where
1731            T: std::convert::Into<crate::model::ManagedZone>,
1732        {
1733            self.0.request.body = std::option::Option::Some(v.into());
1734            self
1735        }
1736
1737        /// Sets or clears the value of [body][crate::model::managed_zones::PatchRequest::body].
1738        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1739        where
1740            T: std::convert::Into<crate::model::ManagedZone>,
1741        {
1742            self.0.request.body = v.map(|x| x.into());
1743            self
1744        }
1745    }
1746
1747    #[doc(hidden)]
1748    impl crate::RequestBuilder for Patch {
1749        fn request_options(&mut self) -> &mut crate::RequestOptions {
1750            &mut self.0.options
1751        }
1752    }
1753
1754    /// The request builder for [ManagedZones::set_iam_policy][crate::client::ManagedZones::set_iam_policy] calls.
1755    ///
1756    /// # Example
1757    /// ```
1758    /// # use google_cloud_dns_v1::builder::managed_zones::SetIamPolicy;
1759    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
1760    ///
1761    /// let builder = prepare_request_builder();
1762    /// let response = builder.send().await?;
1763    /// # Ok(()) }
1764    ///
1765    /// fn prepare_request_builder() -> SetIamPolicy {
1766    ///   # panic!();
1767    ///   // ... details omitted ...
1768    /// }
1769    /// ```
1770    #[derive(Clone, Debug)]
1771    pub struct SetIamPolicy(RequestBuilder<crate::model::managed_zones::SetIamPolicyRequest>);
1772
1773    impl SetIamPolicy {
1774        pub(crate) fn new(
1775            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
1776        ) -> Self {
1777            Self(RequestBuilder::new(stub))
1778        }
1779
1780        /// Sets the full request, replacing any prior values.
1781        pub fn with_request<V: Into<crate::model::managed_zones::SetIamPolicyRequest>>(
1782            mut self,
1783            v: V,
1784        ) -> Self {
1785            self.0.request = v.into();
1786            self
1787        }
1788
1789        /// Sets all the options, replacing any prior values.
1790        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1791            self.0.options = v.into();
1792            self
1793        }
1794
1795        /// Sends the request.
1796        pub async fn send(self) -> Result<crate::model::GoogleIamV1Policy> {
1797            (*self.0.stub)
1798                .set_iam_policy(self.0.request, self.0.options)
1799                .await
1800                .map(crate::Response::into_body)
1801        }
1802
1803        /// Sets the value of [resource][crate::model::managed_zones::SetIamPolicyRequest::resource].
1804        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1805            self.0.request.resource = v.into();
1806            self
1807        }
1808
1809        /// Sets the value of [body][crate::model::managed_zones::SetIamPolicyRequest::body].
1810        pub fn set_body<T>(mut self, v: T) -> Self
1811        where
1812            T: std::convert::Into<crate::model::GoogleIamV1SetIamPolicyRequest>,
1813        {
1814            self.0.request.body = std::option::Option::Some(v.into());
1815            self
1816        }
1817
1818        /// Sets or clears the value of [body][crate::model::managed_zones::SetIamPolicyRequest::body].
1819        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1820        where
1821            T: std::convert::Into<crate::model::GoogleIamV1SetIamPolicyRequest>,
1822        {
1823            self.0.request.body = v.map(|x| x.into());
1824            self
1825        }
1826    }
1827
1828    #[doc(hidden)]
1829    impl crate::RequestBuilder for SetIamPolicy {
1830        fn request_options(&mut self) -> &mut crate::RequestOptions {
1831            &mut self.0.options
1832        }
1833    }
1834
1835    /// The request builder for [ManagedZones::test_iam_permissions][crate::client::ManagedZones::test_iam_permissions] calls.
1836    ///
1837    /// # Example
1838    /// ```
1839    /// # use google_cloud_dns_v1::builder::managed_zones::TestIamPermissions;
1840    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
1841    ///
1842    /// let builder = prepare_request_builder();
1843    /// let response = builder.send().await?;
1844    /// # Ok(()) }
1845    ///
1846    /// fn prepare_request_builder() -> TestIamPermissions {
1847    ///   # panic!();
1848    ///   // ... details omitted ...
1849    /// }
1850    /// ```
1851    #[derive(Clone, Debug)]
1852    pub struct TestIamPermissions(
1853        RequestBuilder<crate::model::managed_zones::TestIamPermissionsRequest>,
1854    );
1855
1856    impl TestIamPermissions {
1857        pub(crate) fn new(
1858            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
1859        ) -> Self {
1860            Self(RequestBuilder::new(stub))
1861        }
1862
1863        /// Sets the full request, replacing any prior values.
1864        pub fn with_request<V: Into<crate::model::managed_zones::TestIamPermissionsRequest>>(
1865            mut self,
1866            v: V,
1867        ) -> Self {
1868            self.0.request = v.into();
1869            self
1870        }
1871
1872        /// Sets all the options, replacing any prior values.
1873        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1874            self.0.options = v.into();
1875            self
1876        }
1877
1878        /// Sends the request.
1879        pub async fn send(self) -> Result<crate::model::GoogleIamV1TestIamPermissionsResponse> {
1880            (*self.0.stub)
1881                .test_iam_permissions(self.0.request, self.0.options)
1882                .await
1883                .map(crate::Response::into_body)
1884        }
1885
1886        /// Sets the value of [resource][crate::model::managed_zones::TestIamPermissionsRequest::resource].
1887        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1888            self.0.request.resource = v.into();
1889            self
1890        }
1891
1892        /// Sets the value of [body][crate::model::managed_zones::TestIamPermissionsRequest::body].
1893        pub fn set_body<T>(mut self, v: T) -> Self
1894        where
1895            T: std::convert::Into<crate::model::GoogleIamV1TestIamPermissionsRequest>,
1896        {
1897            self.0.request.body = std::option::Option::Some(v.into());
1898            self
1899        }
1900
1901        /// Sets or clears the value of [body][crate::model::managed_zones::TestIamPermissionsRequest::body].
1902        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1903        where
1904            T: std::convert::Into<crate::model::GoogleIamV1TestIamPermissionsRequest>,
1905        {
1906            self.0.request.body = v.map(|x| x.into());
1907            self
1908        }
1909    }
1910
1911    #[doc(hidden)]
1912    impl crate::RequestBuilder for TestIamPermissions {
1913        fn request_options(&mut self) -> &mut crate::RequestOptions {
1914            &mut self.0.options
1915        }
1916    }
1917
1918    /// The request builder for [ManagedZones::update][crate::client::ManagedZones::update] calls.
1919    ///
1920    /// # Example
1921    /// ```
1922    /// # use google_cloud_dns_v1::builder::managed_zones::Update;
1923    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
1924    ///
1925    /// let builder = prepare_request_builder();
1926    /// let response = builder.send().await?;
1927    /// # Ok(()) }
1928    ///
1929    /// fn prepare_request_builder() -> Update {
1930    ///   # panic!();
1931    ///   // ... details omitted ...
1932    /// }
1933    /// ```
1934    #[derive(Clone, Debug)]
1935    pub struct Update(RequestBuilder<crate::model::managed_zones::UpdateRequest>);
1936
1937    impl Update {
1938        pub(crate) fn new(
1939            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
1940        ) -> Self {
1941            Self(RequestBuilder::new(stub))
1942        }
1943
1944        /// Sets the full request, replacing any prior values.
1945        pub fn with_request<V: Into<crate::model::managed_zones::UpdateRequest>>(
1946            mut self,
1947            v: V,
1948        ) -> Self {
1949            self.0.request = v.into();
1950            self
1951        }
1952
1953        /// Sets all the options, replacing any prior values.
1954        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1955            self.0.options = v.into();
1956            self
1957        }
1958
1959        /// Sends the request.
1960        pub async fn send(self) -> Result<crate::model::Operation> {
1961            (*self.0.stub)
1962                .update(self.0.request, self.0.options)
1963                .await
1964                .map(crate::Response::into_body)
1965        }
1966
1967        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update`.
1968        pub fn poller(
1969            self,
1970        ) -> impl google_cloud_lro::Poller<crate::model::Operation, crate::model::Operation>
1971        {
1972            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1973            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1974            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1975            if let Some(ref mut details) = poller_options.tracing {
1976                details.method_name =
1977                    "google_cloud_dns_v1::client::ManagedZones::update::until_done";
1978            }
1979
1980            let stub = self.0.stub.clone();
1981            let mut options = self.0.options.clone();
1982            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1983            let project = self.0.request.project.clone();
1984            let managed_zone = self.0.request.managed_zone.clone();
1985            let query = move |name| {
1986                let stub = stub.clone();
1987                let options = options.clone();
1988                let project = project.clone();
1989                let managed_zone = managed_zone.clone();
1990                async {
1991                    GetOperation::new(stub)
1992                        .set_project(project)
1993                        .set_managed_zone(managed_zone)
1994                        .set_operation(name)
1995                        .with_options(options)
1996                        .send()
1997                        .await
1998                }
1999            };
2000
2001            let start = move || async { self.send().await };
2002
2003            use google_cloud_lro::internal::PollerExt;
2004            google_cloud_lro::internal::new_discovery_poller(
2005                polling_error_policy,
2006                polling_backoff_policy,
2007                start,
2008                query,
2009            )
2010            .with_options(poller_options)
2011        }
2012
2013        /// Sets the value of [client_operation_id][crate::model::managed_zones::UpdateRequest::client_operation_id].
2014        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
2015        where
2016            T: std::convert::Into<std::string::String>,
2017        {
2018            self.0.request.client_operation_id = std::option::Option::Some(v.into());
2019            self
2020        }
2021
2022        /// Sets or clears the value of [client_operation_id][crate::model::managed_zones::UpdateRequest::client_operation_id].
2023        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
2024        where
2025            T: std::convert::Into<std::string::String>,
2026        {
2027            self.0.request.client_operation_id = v.map(|x| x.into());
2028            self
2029        }
2030
2031        /// Sets the value of [managed_zone][crate::model::managed_zones::UpdateRequest::managed_zone].
2032        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2033            self.0.request.managed_zone = v.into();
2034            self
2035        }
2036
2037        /// Sets the value of [project][crate::model::managed_zones::UpdateRequest::project].
2038        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2039            self.0.request.project = v.into();
2040            self
2041        }
2042
2043        /// Sets the value of [body][crate::model::managed_zones::UpdateRequest::body].
2044        pub fn set_body<T>(mut self, v: T) -> Self
2045        where
2046            T: std::convert::Into<crate::model::ManagedZone>,
2047        {
2048            self.0.request.body = std::option::Option::Some(v.into());
2049            self
2050        }
2051
2052        /// Sets or clears the value of [body][crate::model::managed_zones::UpdateRequest::body].
2053        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2054        where
2055            T: std::convert::Into<crate::model::ManagedZone>,
2056        {
2057            self.0.request.body = v.map(|x| x.into());
2058            self
2059        }
2060    }
2061
2062    #[doc(hidden)]
2063    impl crate::RequestBuilder for Update {
2064        fn request_options(&mut self) -> &mut crate::RequestOptions {
2065            &mut self.0.options
2066        }
2067    }
2068
2069    /// The request builder for [ManagedZones::get_operation][crate::client::ManagedZones::get_operation] calls.
2070    ///
2071    /// # Example
2072    /// ```
2073    /// # use google_cloud_dns_v1::builder::managed_zones::GetOperation;
2074    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
2075    ///
2076    /// let builder = prepare_request_builder();
2077    /// let response = builder.send().await?;
2078    /// # Ok(()) }
2079    ///
2080    /// fn prepare_request_builder() -> GetOperation {
2081    ///   # panic!();
2082    ///   // ... details omitted ...
2083    /// }
2084    /// ```
2085    #[derive(Clone, Debug)]
2086    pub struct GetOperation(RequestBuilder<crate::model::managed_zone_operations::GetRequest>);
2087
2088    impl GetOperation {
2089        pub(crate) fn new(
2090            stub: std::sync::Arc<dyn super::super::stub::dynamic::ManagedZones>,
2091        ) -> Self {
2092            Self(RequestBuilder::new(stub))
2093        }
2094
2095        /// Sets the full request, replacing any prior values.
2096        pub fn with_request<V: Into<crate::model::managed_zone_operations::GetRequest>>(
2097            mut self,
2098            v: V,
2099        ) -> Self {
2100            self.0.request = v.into();
2101            self
2102        }
2103
2104        /// Sets all the options, replacing any prior values.
2105        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2106            self.0.options = v.into();
2107            self
2108        }
2109
2110        /// Sends the request.
2111        pub async fn send(self) -> Result<crate::model::Operation> {
2112            (*self.0.stub)
2113                .get_operation(self.0.request, self.0.options)
2114                .await
2115                .map(crate::Response::into_body)
2116        }
2117
2118        /// Sets the value of [client_operation_id][crate::model::managed_zone_operations::GetRequest::client_operation_id].
2119        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
2120        where
2121            T: std::convert::Into<std::string::String>,
2122        {
2123            self.0.request.client_operation_id = std::option::Option::Some(v.into());
2124            self
2125        }
2126
2127        /// Sets or clears the value of [client_operation_id][crate::model::managed_zone_operations::GetRequest::client_operation_id].
2128        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
2129        where
2130            T: std::convert::Into<std::string::String>,
2131        {
2132            self.0.request.client_operation_id = v.map(|x| x.into());
2133            self
2134        }
2135
2136        /// Sets the value of [managed_zone][crate::model::managed_zone_operations::GetRequest::managed_zone].
2137        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2138            self.0.request.managed_zone = v.into();
2139            self
2140        }
2141
2142        /// Sets the value of [operation][crate::model::managed_zone_operations::GetRequest::operation].
2143        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
2144            self.0.request.operation = v.into();
2145            self
2146        }
2147
2148        /// Sets the value of [project][crate::model::managed_zone_operations::GetRequest::project].
2149        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2150            self.0.request.project = v.into();
2151            self
2152        }
2153    }
2154
2155    #[doc(hidden)]
2156    impl crate::RequestBuilder for GetOperation {
2157        fn request_options(&mut self) -> &mut crate::RequestOptions {
2158            &mut self.0.options
2159        }
2160    }
2161}
2162
2163/// Request and client builders for [Policies][crate::client::Policies].
2164pub mod policies {
2165    use crate::Result;
2166
2167    /// A builder for [Policies][crate::client::Policies].
2168    ///
2169    /// ```
2170    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2171    /// # use google_cloud_dns_v1::*;
2172    /// # use builder::policies::ClientBuilder;
2173    /// # use client::Policies;
2174    /// let builder : ClientBuilder = Policies::builder();
2175    /// let client = builder
2176    ///     .with_endpoint("https://dns.googleapis.com")
2177    ///     .build().await?;
2178    /// # Ok(()) }
2179    /// ```
2180    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2181
2182    pub(crate) mod client {
2183        use super::super::super::client::Policies;
2184        pub struct Factory;
2185        impl crate::ClientFactory for Factory {
2186            type Client = Policies;
2187            type Credentials = gaxi::options::Credentials;
2188            async fn build(
2189                self,
2190                config: gaxi::options::ClientConfig,
2191            ) -> crate::ClientBuilderResult<Self::Client> {
2192                Self::Client::new(config).await
2193            }
2194        }
2195    }
2196
2197    /// Common implementation for [crate::client::Policies] request builders.
2198    #[derive(Clone, Debug)]
2199    pub(crate) struct RequestBuilder<R: std::default::Default> {
2200        stub: std::sync::Arc<dyn super::super::stub::dynamic::Policies>,
2201        request: R,
2202        options: crate::RequestOptions,
2203    }
2204
2205    impl<R> RequestBuilder<R>
2206    where
2207        R: std::default::Default,
2208    {
2209        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Policies>) -> Self {
2210            Self {
2211                stub,
2212                request: R::default(),
2213                options: crate::RequestOptions::default(),
2214            }
2215        }
2216    }
2217
2218    /// The request builder for [Policies::create][crate::client::Policies::create] calls.
2219    ///
2220    /// # Example
2221    /// ```
2222    /// # use google_cloud_dns_v1::builder::policies::Create;
2223    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
2224    ///
2225    /// let builder = prepare_request_builder();
2226    /// let response = builder.send().await?;
2227    /// # Ok(()) }
2228    ///
2229    /// fn prepare_request_builder() -> Create {
2230    ///   # panic!();
2231    ///   // ... details omitted ...
2232    /// }
2233    /// ```
2234    #[derive(Clone, Debug)]
2235    pub struct Create(RequestBuilder<crate::model::policies::CreateRequest>);
2236
2237    impl Create {
2238        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Policies>) -> Self {
2239            Self(RequestBuilder::new(stub))
2240        }
2241
2242        /// Sets the full request, replacing any prior values.
2243        pub fn with_request<V: Into<crate::model::policies::CreateRequest>>(
2244            mut self,
2245            v: V,
2246        ) -> Self {
2247            self.0.request = v.into();
2248            self
2249        }
2250
2251        /// Sets all the options, replacing any prior values.
2252        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2253            self.0.options = v.into();
2254            self
2255        }
2256
2257        /// Sends the request.
2258        pub async fn send(self) -> Result<crate::model::Policy> {
2259            (*self.0.stub)
2260                .create(self.0.request, self.0.options)
2261                .await
2262                .map(crate::Response::into_body)
2263        }
2264
2265        /// Sets the value of [client_operation_id][crate::model::policies::CreateRequest::client_operation_id].
2266        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
2267        where
2268            T: std::convert::Into<std::string::String>,
2269        {
2270            self.0.request.client_operation_id = std::option::Option::Some(v.into());
2271            self
2272        }
2273
2274        /// Sets or clears the value of [client_operation_id][crate::model::policies::CreateRequest::client_operation_id].
2275        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
2276        where
2277            T: std::convert::Into<std::string::String>,
2278        {
2279            self.0.request.client_operation_id = v.map(|x| x.into());
2280            self
2281        }
2282
2283        /// Sets the value of [project][crate::model::policies::CreateRequest::project].
2284        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2285            self.0.request.project = v.into();
2286            self
2287        }
2288
2289        /// Sets the value of [body][crate::model::policies::CreateRequest::body].
2290        pub fn set_body<T>(mut self, v: T) -> Self
2291        where
2292            T: std::convert::Into<crate::model::Policy>,
2293        {
2294            self.0.request.body = std::option::Option::Some(v.into());
2295            self
2296        }
2297
2298        /// Sets or clears the value of [body][crate::model::policies::CreateRequest::body].
2299        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2300        where
2301            T: std::convert::Into<crate::model::Policy>,
2302        {
2303            self.0.request.body = v.map(|x| x.into());
2304            self
2305        }
2306    }
2307
2308    #[doc(hidden)]
2309    impl crate::RequestBuilder for Create {
2310        fn request_options(&mut self) -> &mut crate::RequestOptions {
2311            &mut self.0.options
2312        }
2313    }
2314
2315    /// The request builder for [Policies::delete][crate::client::Policies::delete] calls.
2316    ///
2317    /// # Example
2318    /// ```
2319    /// # use google_cloud_dns_v1::builder::policies::Delete;
2320    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
2321    ///
2322    /// let builder = prepare_request_builder();
2323    /// let response = builder.send().await?;
2324    /// # Ok(()) }
2325    ///
2326    /// fn prepare_request_builder() -> Delete {
2327    ///   # panic!();
2328    ///   // ... details omitted ...
2329    /// }
2330    /// ```
2331    #[derive(Clone, Debug)]
2332    pub struct Delete(RequestBuilder<crate::model::policies::DeleteRequest>);
2333
2334    impl Delete {
2335        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Policies>) -> Self {
2336            Self(RequestBuilder::new(stub))
2337        }
2338
2339        /// Sets the full request, replacing any prior values.
2340        pub fn with_request<V: Into<crate::model::policies::DeleteRequest>>(
2341            mut self,
2342            v: V,
2343        ) -> Self {
2344            self.0.request = v.into();
2345            self
2346        }
2347
2348        /// Sets all the options, replacing any prior values.
2349        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2350            self.0.options = v.into();
2351            self
2352        }
2353
2354        /// Sends the request.
2355        pub async fn send(self) -> Result<()> {
2356            (*self.0.stub)
2357                .delete(self.0.request, self.0.options)
2358                .await
2359                .map(crate::Response::into_body)
2360        }
2361
2362        /// Sets the value of [client_operation_id][crate::model::policies::DeleteRequest::client_operation_id].
2363        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
2364        where
2365            T: std::convert::Into<std::string::String>,
2366        {
2367            self.0.request.client_operation_id = std::option::Option::Some(v.into());
2368            self
2369        }
2370
2371        /// Sets or clears the value of [client_operation_id][crate::model::policies::DeleteRequest::client_operation_id].
2372        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
2373        where
2374            T: std::convert::Into<std::string::String>,
2375        {
2376            self.0.request.client_operation_id = v.map(|x| x.into());
2377            self
2378        }
2379
2380        /// Sets the value of [policy][crate::model::policies::DeleteRequest::policy].
2381        pub fn set_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
2382            self.0.request.policy = v.into();
2383            self
2384        }
2385
2386        /// Sets the value of [project][crate::model::policies::DeleteRequest::project].
2387        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2388            self.0.request.project = v.into();
2389            self
2390        }
2391    }
2392
2393    #[doc(hidden)]
2394    impl crate::RequestBuilder for Delete {
2395        fn request_options(&mut self) -> &mut crate::RequestOptions {
2396            &mut self.0.options
2397        }
2398    }
2399
2400    /// The request builder for [Policies::get][crate::client::Policies::get] calls.
2401    ///
2402    /// # Example
2403    /// ```
2404    /// # use google_cloud_dns_v1::builder::policies::Get;
2405    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
2406    ///
2407    /// let builder = prepare_request_builder();
2408    /// let response = builder.send().await?;
2409    /// # Ok(()) }
2410    ///
2411    /// fn prepare_request_builder() -> Get {
2412    ///   # panic!();
2413    ///   // ... details omitted ...
2414    /// }
2415    /// ```
2416    #[derive(Clone, Debug)]
2417    pub struct Get(RequestBuilder<crate::model::policies::GetRequest>);
2418
2419    impl Get {
2420        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Policies>) -> Self {
2421            Self(RequestBuilder::new(stub))
2422        }
2423
2424        /// Sets the full request, replacing any prior values.
2425        pub fn with_request<V: Into<crate::model::policies::GetRequest>>(mut self, v: V) -> Self {
2426            self.0.request = v.into();
2427            self
2428        }
2429
2430        /// Sets all the options, replacing any prior values.
2431        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2432            self.0.options = v.into();
2433            self
2434        }
2435
2436        /// Sends the request.
2437        pub async fn send(self) -> Result<crate::model::Policy> {
2438            (*self.0.stub)
2439                .get(self.0.request, self.0.options)
2440                .await
2441                .map(crate::Response::into_body)
2442        }
2443
2444        /// Sets the value of [client_operation_id][crate::model::policies::GetRequest::client_operation_id].
2445        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
2446        where
2447            T: std::convert::Into<std::string::String>,
2448        {
2449            self.0.request.client_operation_id = std::option::Option::Some(v.into());
2450            self
2451        }
2452
2453        /// Sets or clears the value of [client_operation_id][crate::model::policies::GetRequest::client_operation_id].
2454        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
2455        where
2456            T: std::convert::Into<std::string::String>,
2457        {
2458            self.0.request.client_operation_id = v.map(|x| x.into());
2459            self
2460        }
2461
2462        /// Sets the value of [policy][crate::model::policies::GetRequest::policy].
2463        pub fn set_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
2464            self.0.request.policy = v.into();
2465            self
2466        }
2467
2468        /// Sets the value of [project][crate::model::policies::GetRequest::project].
2469        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2470            self.0.request.project = v.into();
2471            self
2472        }
2473    }
2474
2475    #[doc(hidden)]
2476    impl crate::RequestBuilder for Get {
2477        fn request_options(&mut self) -> &mut crate::RequestOptions {
2478            &mut self.0.options
2479        }
2480    }
2481
2482    /// The request builder for [Policies::list][crate::client::Policies::list] calls.
2483    ///
2484    /// # Example
2485    /// ```
2486    /// # use google_cloud_dns_v1::builder::policies::List;
2487    /// # async fn sample() -> google_cloud_dns_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() -> List {
2498    ///   # panic!();
2499    ///   // ... details omitted ...
2500    /// }
2501    /// ```
2502    #[derive(Clone, Debug)]
2503    pub struct List(RequestBuilder<crate::model::policies::ListRequest>);
2504
2505    impl List {
2506        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Policies>) -> Self {
2507            Self(RequestBuilder::new(stub))
2508        }
2509
2510        /// Sets the full request, replacing any prior values.
2511        pub fn with_request<V: Into<crate::model::policies::ListRequest>>(mut self, v: V) -> Self {
2512            self.0.request = v.into();
2513            self
2514        }
2515
2516        /// Sets all the options, replacing any prior values.
2517        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2518            self.0.options = v.into();
2519            self
2520        }
2521
2522        /// Sends the request.
2523        pub async fn send(self) -> Result<crate::model::PoliciesListResponse> {
2524            (*self.0.stub)
2525                .list(self.0.request, self.0.options)
2526                .await
2527                .map(crate::Response::into_body)
2528        }
2529
2530        /// Streams each page in the collection.
2531        pub fn by_page(
2532            self,
2533        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::PoliciesListResponse, crate::Error>
2534        {
2535            use std::clone::Clone;
2536            let token = self.0.request.page_token.clone().unwrap_or_default();
2537            let execute = move |token: String| {
2538                let mut builder = self.clone();
2539                builder.0.request = builder.0.request.set_page_token(token);
2540                builder.send()
2541            };
2542            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2543        }
2544
2545        /// Streams each item in the collection.
2546        pub fn by_item(
2547            self,
2548        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2549            crate::model::PoliciesListResponse,
2550            crate::Error,
2551        > {
2552            use google_cloud_gax::paginator::Paginator;
2553            self.by_page().items()
2554        }
2555
2556        /// Sets the value of [max_results][crate::model::policies::ListRequest::max_results].
2557        pub fn set_max_results<T>(mut self, v: T) -> Self
2558        where
2559            T: std::convert::Into<i32>,
2560        {
2561            self.0.request.max_results = std::option::Option::Some(v.into());
2562            self
2563        }
2564
2565        /// Sets or clears the value of [max_results][crate::model::policies::ListRequest::max_results].
2566        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
2567        where
2568            T: std::convert::Into<i32>,
2569        {
2570            self.0.request.max_results = v.map(|x| x.into());
2571            self
2572        }
2573
2574        /// Sets the value of [page_token][crate::model::policies::ListRequest::page_token].
2575        pub fn set_page_token<T>(mut self, v: T) -> Self
2576        where
2577            T: std::convert::Into<std::string::String>,
2578        {
2579            self.0.request.page_token = std::option::Option::Some(v.into());
2580            self
2581        }
2582
2583        /// Sets or clears the value of [page_token][crate::model::policies::ListRequest::page_token].
2584        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
2585        where
2586            T: std::convert::Into<std::string::String>,
2587        {
2588            self.0.request.page_token = v.map(|x| x.into());
2589            self
2590        }
2591
2592        /// Sets the value of [project][crate::model::policies::ListRequest::project].
2593        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2594            self.0.request.project = v.into();
2595            self
2596        }
2597    }
2598
2599    #[doc(hidden)]
2600    impl crate::RequestBuilder for List {
2601        fn request_options(&mut self) -> &mut crate::RequestOptions {
2602            &mut self.0.options
2603        }
2604    }
2605
2606    /// The request builder for [Policies::patch][crate::client::Policies::patch] calls.
2607    ///
2608    /// # Example
2609    /// ```
2610    /// # use google_cloud_dns_v1::builder::policies::Patch;
2611    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
2612    ///
2613    /// let builder = prepare_request_builder();
2614    /// let response = builder.send().await?;
2615    /// # Ok(()) }
2616    ///
2617    /// fn prepare_request_builder() -> Patch {
2618    ///   # panic!();
2619    ///   // ... details omitted ...
2620    /// }
2621    /// ```
2622    #[derive(Clone, Debug)]
2623    pub struct Patch(RequestBuilder<crate::model::policies::PatchRequest>);
2624
2625    impl Patch {
2626        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Policies>) -> Self {
2627            Self(RequestBuilder::new(stub))
2628        }
2629
2630        /// Sets the full request, replacing any prior values.
2631        pub fn with_request<V: Into<crate::model::policies::PatchRequest>>(mut self, v: V) -> Self {
2632            self.0.request = v.into();
2633            self
2634        }
2635
2636        /// Sets all the options, replacing any prior values.
2637        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2638            self.0.options = v.into();
2639            self
2640        }
2641
2642        /// Sends the request.
2643        pub async fn send(self) -> Result<crate::model::PoliciesPatchResponse> {
2644            (*self.0.stub)
2645                .patch(self.0.request, self.0.options)
2646                .await
2647                .map(crate::Response::into_body)
2648        }
2649
2650        /// Sets the value of [client_operation_id][crate::model::policies::PatchRequest::client_operation_id].
2651        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
2652        where
2653            T: std::convert::Into<std::string::String>,
2654        {
2655            self.0.request.client_operation_id = std::option::Option::Some(v.into());
2656            self
2657        }
2658
2659        /// Sets or clears the value of [client_operation_id][crate::model::policies::PatchRequest::client_operation_id].
2660        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
2661        where
2662            T: std::convert::Into<std::string::String>,
2663        {
2664            self.0.request.client_operation_id = v.map(|x| x.into());
2665            self
2666        }
2667
2668        /// Sets the value of [policy][crate::model::policies::PatchRequest::policy].
2669        pub fn set_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
2670            self.0.request.policy = v.into();
2671            self
2672        }
2673
2674        /// Sets the value of [project][crate::model::policies::PatchRequest::project].
2675        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2676            self.0.request.project = v.into();
2677            self
2678        }
2679
2680        /// Sets the value of [body][crate::model::policies::PatchRequest::body].
2681        pub fn set_body<T>(mut self, v: T) -> Self
2682        where
2683            T: std::convert::Into<crate::model::Policy>,
2684        {
2685            self.0.request.body = std::option::Option::Some(v.into());
2686            self
2687        }
2688
2689        /// Sets or clears the value of [body][crate::model::policies::PatchRequest::body].
2690        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2691        where
2692            T: std::convert::Into<crate::model::Policy>,
2693        {
2694            self.0.request.body = v.map(|x| x.into());
2695            self
2696        }
2697    }
2698
2699    #[doc(hidden)]
2700    impl crate::RequestBuilder for Patch {
2701        fn request_options(&mut self) -> &mut crate::RequestOptions {
2702            &mut self.0.options
2703        }
2704    }
2705
2706    /// The request builder for [Policies::update][crate::client::Policies::update] calls.
2707    ///
2708    /// # Example
2709    /// ```
2710    /// # use google_cloud_dns_v1::builder::policies::Update;
2711    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
2712    ///
2713    /// let builder = prepare_request_builder();
2714    /// let response = builder.send().await?;
2715    /// # Ok(()) }
2716    ///
2717    /// fn prepare_request_builder() -> Update {
2718    ///   # panic!();
2719    ///   // ... details omitted ...
2720    /// }
2721    /// ```
2722    #[derive(Clone, Debug)]
2723    pub struct Update(RequestBuilder<crate::model::policies::UpdateRequest>);
2724
2725    impl Update {
2726        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Policies>) -> Self {
2727            Self(RequestBuilder::new(stub))
2728        }
2729
2730        /// Sets the full request, replacing any prior values.
2731        pub fn with_request<V: Into<crate::model::policies::UpdateRequest>>(
2732            mut self,
2733            v: V,
2734        ) -> Self {
2735            self.0.request = v.into();
2736            self
2737        }
2738
2739        /// Sets all the options, replacing any prior values.
2740        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2741            self.0.options = v.into();
2742            self
2743        }
2744
2745        /// Sends the request.
2746        pub async fn send(self) -> Result<crate::model::PoliciesUpdateResponse> {
2747            (*self.0.stub)
2748                .update(self.0.request, self.0.options)
2749                .await
2750                .map(crate::Response::into_body)
2751        }
2752
2753        /// Sets the value of [client_operation_id][crate::model::policies::UpdateRequest::client_operation_id].
2754        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
2755        where
2756            T: std::convert::Into<std::string::String>,
2757        {
2758            self.0.request.client_operation_id = std::option::Option::Some(v.into());
2759            self
2760        }
2761
2762        /// Sets or clears the value of [client_operation_id][crate::model::policies::UpdateRequest::client_operation_id].
2763        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
2764        where
2765            T: std::convert::Into<std::string::String>,
2766        {
2767            self.0.request.client_operation_id = v.map(|x| x.into());
2768            self
2769        }
2770
2771        /// Sets the value of [policy][crate::model::policies::UpdateRequest::policy].
2772        pub fn set_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
2773            self.0.request.policy = v.into();
2774            self
2775        }
2776
2777        /// Sets the value of [project][crate::model::policies::UpdateRequest::project].
2778        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2779            self.0.request.project = v.into();
2780            self
2781        }
2782
2783        /// Sets the value of [body][crate::model::policies::UpdateRequest::body].
2784        pub fn set_body<T>(mut self, v: T) -> Self
2785        where
2786            T: std::convert::Into<crate::model::Policy>,
2787        {
2788            self.0.request.body = std::option::Option::Some(v.into());
2789            self
2790        }
2791
2792        /// Sets or clears the value of [body][crate::model::policies::UpdateRequest::body].
2793        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2794        where
2795            T: std::convert::Into<crate::model::Policy>,
2796        {
2797            self.0.request.body = v.map(|x| x.into());
2798            self
2799        }
2800    }
2801
2802    #[doc(hidden)]
2803    impl crate::RequestBuilder for Update {
2804        fn request_options(&mut self) -> &mut crate::RequestOptions {
2805            &mut self.0.options
2806        }
2807    }
2808}
2809
2810/// Request and client builders for [Projects][crate::client::Projects].
2811pub mod projects {
2812    use crate::Result;
2813
2814    /// A builder for [Projects][crate::client::Projects].
2815    ///
2816    /// ```
2817    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2818    /// # use google_cloud_dns_v1::*;
2819    /// # use builder::projects::ClientBuilder;
2820    /// # use client::Projects;
2821    /// let builder : ClientBuilder = Projects::builder();
2822    /// let client = builder
2823    ///     .with_endpoint("https://dns.googleapis.com")
2824    ///     .build().await?;
2825    /// # Ok(()) }
2826    /// ```
2827    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2828
2829    pub(crate) mod client {
2830        use super::super::super::client::Projects;
2831        pub struct Factory;
2832        impl crate::ClientFactory for Factory {
2833            type Client = Projects;
2834            type Credentials = gaxi::options::Credentials;
2835            async fn build(
2836                self,
2837                config: gaxi::options::ClientConfig,
2838            ) -> crate::ClientBuilderResult<Self::Client> {
2839                Self::Client::new(config).await
2840            }
2841        }
2842    }
2843
2844    /// Common implementation for [crate::client::Projects] request builders.
2845    #[derive(Clone, Debug)]
2846    pub(crate) struct RequestBuilder<R: std::default::Default> {
2847        stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>,
2848        request: R,
2849        options: crate::RequestOptions,
2850    }
2851
2852    impl<R> RequestBuilder<R>
2853    where
2854        R: std::default::Default,
2855    {
2856        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2857            Self {
2858                stub,
2859                request: R::default(),
2860                options: crate::RequestOptions::default(),
2861            }
2862        }
2863    }
2864
2865    /// The request builder for [Projects::get][crate::client::Projects::get] calls.
2866    ///
2867    /// # Example
2868    /// ```
2869    /// # use google_cloud_dns_v1::builder::projects::Get;
2870    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
2871    ///
2872    /// let builder = prepare_request_builder();
2873    /// let response = builder.send().await?;
2874    /// # Ok(()) }
2875    ///
2876    /// fn prepare_request_builder() -> Get {
2877    ///   # panic!();
2878    ///   // ... details omitted ...
2879    /// }
2880    /// ```
2881    #[derive(Clone, Debug)]
2882    pub struct Get(RequestBuilder<crate::model::projects::GetRequest>);
2883
2884    impl Get {
2885        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2886            Self(RequestBuilder::new(stub))
2887        }
2888
2889        /// Sets the full request, replacing any prior values.
2890        pub fn with_request<V: Into<crate::model::projects::GetRequest>>(mut self, v: V) -> Self {
2891            self.0.request = v.into();
2892            self
2893        }
2894
2895        /// Sets all the options, replacing any prior values.
2896        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2897            self.0.options = v.into();
2898            self
2899        }
2900
2901        /// Sends the request.
2902        pub async fn send(self) -> Result<crate::model::Project> {
2903            (*self.0.stub)
2904                .get(self.0.request, self.0.options)
2905                .await
2906                .map(crate::Response::into_body)
2907        }
2908
2909        /// Sets the value of [project][crate::model::projects::GetRequest::project].
2910        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2911            self.0.request.project = v.into();
2912            self
2913        }
2914    }
2915
2916    #[doc(hidden)]
2917    impl crate::RequestBuilder for Get {
2918        fn request_options(&mut self) -> &mut crate::RequestOptions {
2919            &mut self.0.options
2920        }
2921    }
2922}
2923
2924/// Request and client builders for [ResourceRecordSets][crate::client::ResourceRecordSets].
2925pub mod resource_record_sets {
2926    use crate::Result;
2927
2928    /// A builder for [ResourceRecordSets][crate::client::ResourceRecordSets].
2929    ///
2930    /// ```
2931    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2932    /// # use google_cloud_dns_v1::*;
2933    /// # use builder::resource_record_sets::ClientBuilder;
2934    /// # use client::ResourceRecordSets;
2935    /// let builder : ClientBuilder = ResourceRecordSets::builder();
2936    /// let client = builder
2937    ///     .with_endpoint("https://dns.googleapis.com")
2938    ///     .build().await?;
2939    /// # Ok(()) }
2940    /// ```
2941    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2942
2943    pub(crate) mod client {
2944        use super::super::super::client::ResourceRecordSets;
2945        pub struct Factory;
2946        impl crate::ClientFactory for Factory {
2947            type Client = ResourceRecordSets;
2948            type Credentials = gaxi::options::Credentials;
2949            async fn build(
2950                self,
2951                config: gaxi::options::ClientConfig,
2952            ) -> crate::ClientBuilderResult<Self::Client> {
2953                Self::Client::new(config).await
2954            }
2955        }
2956    }
2957
2958    /// Common implementation for [crate::client::ResourceRecordSets] request builders.
2959    #[derive(Clone, Debug)]
2960    pub(crate) struct RequestBuilder<R: std::default::Default> {
2961        stub: std::sync::Arc<dyn super::super::stub::dynamic::ResourceRecordSets>,
2962        request: R,
2963        options: crate::RequestOptions,
2964    }
2965
2966    impl<R> RequestBuilder<R>
2967    where
2968        R: std::default::Default,
2969    {
2970        pub(crate) fn new(
2971            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResourceRecordSets>,
2972        ) -> Self {
2973            Self {
2974                stub,
2975                request: R::default(),
2976                options: crate::RequestOptions::default(),
2977            }
2978        }
2979    }
2980
2981    /// The request builder for [ResourceRecordSets::create][crate::client::ResourceRecordSets::create] calls.
2982    ///
2983    /// # Example
2984    /// ```
2985    /// # use google_cloud_dns_v1::builder::resource_record_sets::Create;
2986    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
2987    ///
2988    /// let builder = prepare_request_builder();
2989    /// let response = builder.send().await?;
2990    /// # Ok(()) }
2991    ///
2992    /// fn prepare_request_builder() -> Create {
2993    ///   # panic!();
2994    ///   // ... details omitted ...
2995    /// }
2996    /// ```
2997    #[derive(Clone, Debug)]
2998    pub struct Create(RequestBuilder<crate::model::resource_record_sets::CreateRequest>);
2999
3000    impl Create {
3001        pub(crate) fn new(
3002            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResourceRecordSets>,
3003        ) -> Self {
3004            Self(RequestBuilder::new(stub))
3005        }
3006
3007        /// Sets the full request, replacing any prior values.
3008        pub fn with_request<V: Into<crate::model::resource_record_sets::CreateRequest>>(
3009            mut self,
3010            v: V,
3011        ) -> Self {
3012            self.0.request = v.into();
3013            self
3014        }
3015
3016        /// Sets all the options, replacing any prior values.
3017        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3018            self.0.options = v.into();
3019            self
3020        }
3021
3022        /// Sends the request.
3023        pub async fn send(self) -> Result<crate::model::ResourceRecordSet> {
3024            (*self.0.stub)
3025                .create(self.0.request, self.0.options)
3026                .await
3027                .map(crate::Response::into_body)
3028        }
3029
3030        /// Sets the value of [client_operation_id][crate::model::resource_record_sets::CreateRequest::client_operation_id].
3031        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
3032        where
3033            T: std::convert::Into<std::string::String>,
3034        {
3035            self.0.request.client_operation_id = std::option::Option::Some(v.into());
3036            self
3037        }
3038
3039        /// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::CreateRequest::client_operation_id].
3040        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
3041        where
3042            T: std::convert::Into<std::string::String>,
3043        {
3044            self.0.request.client_operation_id = v.map(|x| x.into());
3045            self
3046        }
3047
3048        /// Sets the value of [managed_zone][crate::model::resource_record_sets::CreateRequest::managed_zone].
3049        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3050            self.0.request.managed_zone = v.into();
3051            self
3052        }
3053
3054        /// Sets the value of [project][crate::model::resource_record_sets::CreateRequest::project].
3055        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3056            self.0.request.project = v.into();
3057            self
3058        }
3059
3060        /// Sets the value of [body][crate::model::resource_record_sets::CreateRequest::body].
3061        pub fn set_body<T>(mut self, v: T) -> Self
3062        where
3063            T: std::convert::Into<crate::model::ResourceRecordSet>,
3064        {
3065            self.0.request.body = std::option::Option::Some(v.into());
3066            self
3067        }
3068
3069        /// Sets or clears the value of [body][crate::model::resource_record_sets::CreateRequest::body].
3070        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3071        where
3072            T: std::convert::Into<crate::model::ResourceRecordSet>,
3073        {
3074            self.0.request.body = v.map(|x| x.into());
3075            self
3076        }
3077    }
3078
3079    #[doc(hidden)]
3080    impl crate::RequestBuilder for Create {
3081        fn request_options(&mut self) -> &mut crate::RequestOptions {
3082            &mut self.0.options
3083        }
3084    }
3085
3086    /// The request builder for [ResourceRecordSets::delete][crate::client::ResourceRecordSets::delete] calls.
3087    ///
3088    /// # Example
3089    /// ```
3090    /// # use google_cloud_dns_v1::builder::resource_record_sets::Delete;
3091    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
3092    ///
3093    /// let builder = prepare_request_builder();
3094    /// let response = builder.send().await?;
3095    /// # Ok(()) }
3096    ///
3097    /// fn prepare_request_builder() -> Delete {
3098    ///   # panic!();
3099    ///   // ... details omitted ...
3100    /// }
3101    /// ```
3102    #[derive(Clone, Debug)]
3103    pub struct Delete(RequestBuilder<crate::model::resource_record_sets::DeleteRequest>);
3104
3105    impl Delete {
3106        pub(crate) fn new(
3107            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResourceRecordSets>,
3108        ) -> Self {
3109            Self(RequestBuilder::new(stub))
3110        }
3111
3112        /// Sets the full request, replacing any prior values.
3113        pub fn with_request<V: Into<crate::model::resource_record_sets::DeleteRequest>>(
3114            mut self,
3115            v: V,
3116        ) -> Self {
3117            self.0.request = v.into();
3118            self
3119        }
3120
3121        /// Sets all the options, replacing any prior values.
3122        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3123            self.0.options = v.into();
3124            self
3125        }
3126
3127        /// Sends the request.
3128        pub async fn send(self) -> Result<crate::model::ResourceRecordSetsDeleteResponse> {
3129            (*self.0.stub)
3130                .delete(self.0.request, self.0.options)
3131                .await
3132                .map(crate::Response::into_body)
3133        }
3134
3135        /// Sets the value of [client_operation_id][crate::model::resource_record_sets::DeleteRequest::client_operation_id].
3136        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
3137        where
3138            T: std::convert::Into<std::string::String>,
3139        {
3140            self.0.request.client_operation_id = std::option::Option::Some(v.into());
3141            self
3142        }
3143
3144        /// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::DeleteRequest::client_operation_id].
3145        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
3146        where
3147            T: std::convert::Into<std::string::String>,
3148        {
3149            self.0.request.client_operation_id = v.map(|x| x.into());
3150            self
3151        }
3152
3153        /// Sets the value of [managed_zone][crate::model::resource_record_sets::DeleteRequest::managed_zone].
3154        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3155            self.0.request.managed_zone = v.into();
3156            self
3157        }
3158
3159        /// Sets the value of [name][crate::model::resource_record_sets::DeleteRequest::name].
3160        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3161            self.0.request.name = v.into();
3162            self
3163        }
3164
3165        /// Sets the value of [project][crate::model::resource_record_sets::DeleteRequest::project].
3166        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3167            self.0.request.project = v.into();
3168            self
3169        }
3170
3171        /// Sets the value of [r#type][crate::model::resource_record_sets::DeleteRequest::type].
3172        pub fn set_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
3173            self.0.request.r#type = v.into();
3174            self
3175        }
3176    }
3177
3178    #[doc(hidden)]
3179    impl crate::RequestBuilder for Delete {
3180        fn request_options(&mut self) -> &mut crate::RequestOptions {
3181            &mut self.0.options
3182        }
3183    }
3184
3185    /// The request builder for [ResourceRecordSets::get][crate::client::ResourceRecordSets::get] calls.
3186    ///
3187    /// # Example
3188    /// ```
3189    /// # use google_cloud_dns_v1::builder::resource_record_sets::Get;
3190    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
3191    ///
3192    /// let builder = prepare_request_builder();
3193    /// let response = builder.send().await?;
3194    /// # Ok(()) }
3195    ///
3196    /// fn prepare_request_builder() -> Get {
3197    ///   # panic!();
3198    ///   // ... details omitted ...
3199    /// }
3200    /// ```
3201    #[derive(Clone, Debug)]
3202    pub struct Get(RequestBuilder<crate::model::resource_record_sets::GetRequest>);
3203
3204    impl Get {
3205        pub(crate) fn new(
3206            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResourceRecordSets>,
3207        ) -> Self {
3208            Self(RequestBuilder::new(stub))
3209        }
3210
3211        /// Sets the full request, replacing any prior values.
3212        pub fn with_request<V: Into<crate::model::resource_record_sets::GetRequest>>(
3213            mut self,
3214            v: V,
3215        ) -> Self {
3216            self.0.request = v.into();
3217            self
3218        }
3219
3220        /// Sets all the options, replacing any prior values.
3221        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3222            self.0.options = v.into();
3223            self
3224        }
3225
3226        /// Sends the request.
3227        pub async fn send(self) -> Result<crate::model::ResourceRecordSet> {
3228            (*self.0.stub)
3229                .get(self.0.request, self.0.options)
3230                .await
3231                .map(crate::Response::into_body)
3232        }
3233
3234        /// Sets the value of [client_operation_id][crate::model::resource_record_sets::GetRequest::client_operation_id].
3235        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
3236        where
3237            T: std::convert::Into<std::string::String>,
3238        {
3239            self.0.request.client_operation_id = std::option::Option::Some(v.into());
3240            self
3241        }
3242
3243        /// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::GetRequest::client_operation_id].
3244        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
3245        where
3246            T: std::convert::Into<std::string::String>,
3247        {
3248            self.0.request.client_operation_id = v.map(|x| x.into());
3249            self
3250        }
3251
3252        /// Sets the value of [managed_zone][crate::model::resource_record_sets::GetRequest::managed_zone].
3253        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3254            self.0.request.managed_zone = v.into();
3255            self
3256        }
3257
3258        /// Sets the value of [name][crate::model::resource_record_sets::GetRequest::name].
3259        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3260            self.0.request.name = v.into();
3261            self
3262        }
3263
3264        /// Sets the value of [project][crate::model::resource_record_sets::GetRequest::project].
3265        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3266            self.0.request.project = v.into();
3267            self
3268        }
3269
3270        /// Sets the value of [r#type][crate::model::resource_record_sets::GetRequest::type].
3271        pub fn set_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
3272            self.0.request.r#type = v.into();
3273            self
3274        }
3275    }
3276
3277    #[doc(hidden)]
3278    impl crate::RequestBuilder for Get {
3279        fn request_options(&mut self) -> &mut crate::RequestOptions {
3280            &mut self.0.options
3281        }
3282    }
3283
3284    /// The request builder for [ResourceRecordSets::list][crate::client::ResourceRecordSets::list] calls.
3285    ///
3286    /// # Example
3287    /// ```
3288    /// # use google_cloud_dns_v1::builder::resource_record_sets::List;
3289    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
3290    /// use google_cloud_gax::paginator::ItemPaginator;
3291    ///
3292    /// let builder = prepare_request_builder();
3293    /// let mut items = builder.by_item();
3294    /// while let Some(result) = items.next().await {
3295    ///   let item = result?;
3296    /// }
3297    /// # Ok(()) }
3298    ///
3299    /// fn prepare_request_builder() -> List {
3300    ///   # panic!();
3301    ///   // ... details omitted ...
3302    /// }
3303    /// ```
3304    #[derive(Clone, Debug)]
3305    pub struct List(RequestBuilder<crate::model::resource_record_sets::ListRequest>);
3306
3307    impl List {
3308        pub(crate) fn new(
3309            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResourceRecordSets>,
3310        ) -> Self {
3311            Self(RequestBuilder::new(stub))
3312        }
3313
3314        /// Sets the full request, replacing any prior values.
3315        pub fn with_request<V: Into<crate::model::resource_record_sets::ListRequest>>(
3316            mut self,
3317            v: V,
3318        ) -> Self {
3319            self.0.request = v.into();
3320            self
3321        }
3322
3323        /// Sets all the options, replacing any prior values.
3324        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3325            self.0.options = v.into();
3326            self
3327        }
3328
3329        /// Sends the request.
3330        pub async fn send(self) -> Result<crate::model::ResourceRecordSetsListResponse> {
3331            (*self.0.stub)
3332                .list(self.0.request, self.0.options)
3333                .await
3334                .map(crate::Response::into_body)
3335        }
3336
3337        /// Streams each page in the collection.
3338        pub fn by_page(
3339            self,
3340        ) -> impl google_cloud_gax::paginator::Paginator<
3341            crate::model::ResourceRecordSetsListResponse,
3342            crate::Error,
3343        > {
3344            use std::clone::Clone;
3345            let token = self.0.request.page_token.clone().unwrap_or_default();
3346            let execute = move |token: String| {
3347                let mut builder = self.clone();
3348                builder.0.request = builder.0.request.set_page_token(token);
3349                builder.send()
3350            };
3351            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3352        }
3353
3354        /// Streams each item in the collection.
3355        pub fn by_item(
3356            self,
3357        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3358            crate::model::ResourceRecordSetsListResponse,
3359            crate::Error,
3360        > {
3361            use google_cloud_gax::paginator::Paginator;
3362            self.by_page().items()
3363        }
3364
3365        /// Sets the value of [filter][crate::model::resource_record_sets::ListRequest::filter].
3366        pub fn set_filter<T>(mut self, v: T) -> Self
3367        where
3368            T: std::convert::Into<std::string::String>,
3369        {
3370            self.0.request.filter = std::option::Option::Some(v.into());
3371            self
3372        }
3373
3374        /// Sets or clears the value of [filter][crate::model::resource_record_sets::ListRequest::filter].
3375        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3376        where
3377            T: std::convert::Into<std::string::String>,
3378        {
3379            self.0.request.filter = v.map(|x| x.into());
3380            self
3381        }
3382
3383        /// Sets the value of [managed_zone][crate::model::resource_record_sets::ListRequest::managed_zone].
3384        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3385            self.0.request.managed_zone = v.into();
3386            self
3387        }
3388
3389        /// Sets the value of [max_results][crate::model::resource_record_sets::ListRequest::max_results].
3390        pub fn set_max_results<T>(mut self, v: T) -> Self
3391        where
3392            T: std::convert::Into<i32>,
3393        {
3394            self.0.request.max_results = std::option::Option::Some(v.into());
3395            self
3396        }
3397
3398        /// Sets or clears the value of [max_results][crate::model::resource_record_sets::ListRequest::max_results].
3399        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
3400        where
3401            T: std::convert::Into<i32>,
3402        {
3403            self.0.request.max_results = v.map(|x| x.into());
3404            self
3405        }
3406
3407        /// Sets the value of [name][crate::model::resource_record_sets::ListRequest::name].
3408        pub fn set_name<T>(mut self, v: T) -> Self
3409        where
3410            T: std::convert::Into<std::string::String>,
3411        {
3412            self.0.request.name = std::option::Option::Some(v.into());
3413            self
3414        }
3415
3416        /// Sets or clears the value of [name][crate::model::resource_record_sets::ListRequest::name].
3417        pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
3418        where
3419            T: std::convert::Into<std::string::String>,
3420        {
3421            self.0.request.name = v.map(|x| x.into());
3422            self
3423        }
3424
3425        /// Sets the value of [page_token][crate::model::resource_record_sets::ListRequest::page_token].
3426        pub fn set_page_token<T>(mut self, v: T) -> Self
3427        where
3428            T: std::convert::Into<std::string::String>,
3429        {
3430            self.0.request.page_token = std::option::Option::Some(v.into());
3431            self
3432        }
3433
3434        /// Sets or clears the value of [page_token][crate::model::resource_record_sets::ListRequest::page_token].
3435        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
3436        where
3437            T: std::convert::Into<std::string::String>,
3438        {
3439            self.0.request.page_token = v.map(|x| x.into());
3440            self
3441        }
3442
3443        /// Sets the value of [project][crate::model::resource_record_sets::ListRequest::project].
3444        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3445            self.0.request.project = v.into();
3446            self
3447        }
3448
3449        /// Sets the value of [r#type][crate::model::resource_record_sets::ListRequest::type].
3450        pub fn set_type<T>(mut self, v: T) -> Self
3451        where
3452            T: std::convert::Into<std::string::String>,
3453        {
3454            self.0.request.r#type = std::option::Option::Some(v.into());
3455            self
3456        }
3457
3458        /// Sets or clears the value of [r#type][crate::model::resource_record_sets::ListRequest::type].
3459        pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
3460        where
3461            T: std::convert::Into<std::string::String>,
3462        {
3463            self.0.request.r#type = v.map(|x| x.into());
3464            self
3465        }
3466    }
3467
3468    #[doc(hidden)]
3469    impl crate::RequestBuilder for List {
3470        fn request_options(&mut self) -> &mut crate::RequestOptions {
3471            &mut self.0.options
3472        }
3473    }
3474
3475    /// The request builder for [ResourceRecordSets::patch][crate::client::ResourceRecordSets::patch] calls.
3476    ///
3477    /// # Example
3478    /// ```
3479    /// # use google_cloud_dns_v1::builder::resource_record_sets::Patch;
3480    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
3481    ///
3482    /// let builder = prepare_request_builder();
3483    /// let response = builder.send().await?;
3484    /// # Ok(()) }
3485    ///
3486    /// fn prepare_request_builder() -> Patch {
3487    ///   # panic!();
3488    ///   // ... details omitted ...
3489    /// }
3490    /// ```
3491    #[derive(Clone, Debug)]
3492    pub struct Patch(RequestBuilder<crate::model::resource_record_sets::PatchRequest>);
3493
3494    impl Patch {
3495        pub(crate) fn new(
3496            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResourceRecordSets>,
3497        ) -> Self {
3498            Self(RequestBuilder::new(stub))
3499        }
3500
3501        /// Sets the full request, replacing any prior values.
3502        pub fn with_request<V: Into<crate::model::resource_record_sets::PatchRequest>>(
3503            mut self,
3504            v: V,
3505        ) -> Self {
3506            self.0.request = v.into();
3507            self
3508        }
3509
3510        /// Sets all the options, replacing any prior values.
3511        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3512            self.0.options = v.into();
3513            self
3514        }
3515
3516        /// Sends the request.
3517        pub async fn send(self) -> Result<crate::model::ResourceRecordSet> {
3518            (*self.0.stub)
3519                .patch(self.0.request, self.0.options)
3520                .await
3521                .map(crate::Response::into_body)
3522        }
3523
3524        /// Sets the value of [client_operation_id][crate::model::resource_record_sets::PatchRequest::client_operation_id].
3525        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
3526        where
3527            T: std::convert::Into<std::string::String>,
3528        {
3529            self.0.request.client_operation_id = std::option::Option::Some(v.into());
3530            self
3531        }
3532
3533        /// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::PatchRequest::client_operation_id].
3534        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
3535        where
3536            T: std::convert::Into<std::string::String>,
3537        {
3538            self.0.request.client_operation_id = v.map(|x| x.into());
3539            self
3540        }
3541
3542        /// Sets the value of [managed_zone][crate::model::resource_record_sets::PatchRequest::managed_zone].
3543        pub fn set_managed_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3544            self.0.request.managed_zone = v.into();
3545            self
3546        }
3547
3548        /// Sets the value of [name][crate::model::resource_record_sets::PatchRequest::name].
3549        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3550            self.0.request.name = v.into();
3551            self
3552        }
3553
3554        /// Sets the value of [project][crate::model::resource_record_sets::PatchRequest::project].
3555        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3556            self.0.request.project = v.into();
3557            self
3558        }
3559
3560        /// Sets the value of [r#type][crate::model::resource_record_sets::PatchRequest::type].
3561        pub fn set_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
3562            self.0.request.r#type = v.into();
3563            self
3564        }
3565
3566        /// Sets the value of [body][crate::model::resource_record_sets::PatchRequest::body].
3567        pub fn set_body<T>(mut self, v: T) -> Self
3568        where
3569            T: std::convert::Into<crate::model::ResourceRecordSet>,
3570        {
3571            self.0.request.body = std::option::Option::Some(v.into());
3572            self
3573        }
3574
3575        /// Sets or clears the value of [body][crate::model::resource_record_sets::PatchRequest::body].
3576        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3577        where
3578            T: std::convert::Into<crate::model::ResourceRecordSet>,
3579        {
3580            self.0.request.body = v.map(|x| x.into());
3581            self
3582        }
3583    }
3584
3585    #[doc(hidden)]
3586    impl crate::RequestBuilder for Patch {
3587        fn request_options(&mut self) -> &mut crate::RequestOptions {
3588            &mut self.0.options
3589        }
3590    }
3591}
3592
3593/// Request and client builders for [ResponsePolicies][crate::client::ResponsePolicies].
3594pub mod response_policies {
3595    use crate::Result;
3596
3597    /// A builder for [ResponsePolicies][crate::client::ResponsePolicies].
3598    ///
3599    /// ```
3600    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3601    /// # use google_cloud_dns_v1::*;
3602    /// # use builder::response_policies::ClientBuilder;
3603    /// # use client::ResponsePolicies;
3604    /// let builder : ClientBuilder = ResponsePolicies::builder();
3605    /// let client = builder
3606    ///     .with_endpoint("https://dns.googleapis.com")
3607    ///     .build().await?;
3608    /// # Ok(()) }
3609    /// ```
3610    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3611
3612    pub(crate) mod client {
3613        use super::super::super::client::ResponsePolicies;
3614        pub struct Factory;
3615        impl crate::ClientFactory for Factory {
3616            type Client = ResponsePolicies;
3617            type Credentials = gaxi::options::Credentials;
3618            async fn build(
3619                self,
3620                config: gaxi::options::ClientConfig,
3621            ) -> crate::ClientBuilderResult<Self::Client> {
3622                Self::Client::new(config).await
3623            }
3624        }
3625    }
3626
3627    /// Common implementation for [crate::client::ResponsePolicies] request builders.
3628    #[derive(Clone, Debug)]
3629    pub(crate) struct RequestBuilder<R: std::default::Default> {
3630        stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicies>,
3631        request: R,
3632        options: crate::RequestOptions,
3633    }
3634
3635    impl<R> RequestBuilder<R>
3636    where
3637        R: std::default::Default,
3638    {
3639        pub(crate) fn new(
3640            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicies>,
3641        ) -> Self {
3642            Self {
3643                stub,
3644                request: R::default(),
3645                options: crate::RequestOptions::default(),
3646            }
3647        }
3648    }
3649
3650    /// The request builder for [ResponsePolicies::create][crate::client::ResponsePolicies::create] calls.
3651    ///
3652    /// # Example
3653    /// ```
3654    /// # use google_cloud_dns_v1::builder::response_policies::Create;
3655    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
3656    ///
3657    /// let builder = prepare_request_builder();
3658    /// let response = builder.send().await?;
3659    /// # Ok(()) }
3660    ///
3661    /// fn prepare_request_builder() -> Create {
3662    ///   # panic!();
3663    ///   // ... details omitted ...
3664    /// }
3665    /// ```
3666    #[derive(Clone, Debug)]
3667    pub struct Create(RequestBuilder<crate::model::response_policies::CreateRequest>);
3668
3669    impl Create {
3670        pub(crate) fn new(
3671            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicies>,
3672        ) -> Self {
3673            Self(RequestBuilder::new(stub))
3674        }
3675
3676        /// Sets the full request, replacing any prior values.
3677        pub fn with_request<V: Into<crate::model::response_policies::CreateRequest>>(
3678            mut self,
3679            v: V,
3680        ) -> Self {
3681            self.0.request = v.into();
3682            self
3683        }
3684
3685        /// Sets all the options, replacing any prior values.
3686        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3687            self.0.options = v.into();
3688            self
3689        }
3690
3691        /// Sends the request.
3692        pub async fn send(self) -> Result<crate::model::ResponsePolicy> {
3693            (*self.0.stub)
3694                .create(self.0.request, self.0.options)
3695                .await
3696                .map(crate::Response::into_body)
3697        }
3698
3699        /// Sets the value of [client_operation_id][crate::model::response_policies::CreateRequest::client_operation_id].
3700        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
3701        where
3702            T: std::convert::Into<std::string::String>,
3703        {
3704            self.0.request.client_operation_id = std::option::Option::Some(v.into());
3705            self
3706        }
3707
3708        /// Sets or clears the value of [client_operation_id][crate::model::response_policies::CreateRequest::client_operation_id].
3709        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
3710        where
3711            T: std::convert::Into<std::string::String>,
3712        {
3713            self.0.request.client_operation_id = v.map(|x| x.into());
3714            self
3715        }
3716
3717        /// Sets the value of [project][crate::model::response_policies::CreateRequest::project].
3718        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3719            self.0.request.project = v.into();
3720            self
3721        }
3722
3723        /// Sets the value of [body][crate::model::response_policies::CreateRequest::body].
3724        pub fn set_body<T>(mut self, v: T) -> Self
3725        where
3726            T: std::convert::Into<crate::model::ResponsePolicy>,
3727        {
3728            self.0.request.body = std::option::Option::Some(v.into());
3729            self
3730        }
3731
3732        /// Sets or clears the value of [body][crate::model::response_policies::CreateRequest::body].
3733        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3734        where
3735            T: std::convert::Into<crate::model::ResponsePolicy>,
3736        {
3737            self.0.request.body = v.map(|x| x.into());
3738            self
3739        }
3740    }
3741
3742    #[doc(hidden)]
3743    impl crate::RequestBuilder for Create {
3744        fn request_options(&mut self) -> &mut crate::RequestOptions {
3745            &mut self.0.options
3746        }
3747    }
3748
3749    /// The request builder for [ResponsePolicies::delete][crate::client::ResponsePolicies::delete] calls.
3750    ///
3751    /// # Example
3752    /// ```
3753    /// # use google_cloud_dns_v1::builder::response_policies::Delete;
3754    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
3755    ///
3756    /// let builder = prepare_request_builder();
3757    /// let response = builder.send().await?;
3758    /// # Ok(()) }
3759    ///
3760    /// fn prepare_request_builder() -> Delete {
3761    ///   # panic!();
3762    ///   // ... details omitted ...
3763    /// }
3764    /// ```
3765    #[derive(Clone, Debug)]
3766    pub struct Delete(RequestBuilder<crate::model::response_policies::DeleteRequest>);
3767
3768    impl Delete {
3769        pub(crate) fn new(
3770            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicies>,
3771        ) -> Self {
3772            Self(RequestBuilder::new(stub))
3773        }
3774
3775        /// Sets the full request, replacing any prior values.
3776        pub fn with_request<V: Into<crate::model::response_policies::DeleteRequest>>(
3777            mut self,
3778            v: V,
3779        ) -> Self {
3780            self.0.request = v.into();
3781            self
3782        }
3783
3784        /// Sets all the options, replacing any prior values.
3785        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3786            self.0.options = v.into();
3787            self
3788        }
3789
3790        /// Sends the request.
3791        pub async fn send(self) -> Result<()> {
3792            (*self.0.stub)
3793                .delete(self.0.request, self.0.options)
3794                .await
3795                .map(crate::Response::into_body)
3796        }
3797
3798        /// Sets the value of [client_operation_id][crate::model::response_policies::DeleteRequest::client_operation_id].
3799        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
3800        where
3801            T: std::convert::Into<std::string::String>,
3802        {
3803            self.0.request.client_operation_id = std::option::Option::Some(v.into());
3804            self
3805        }
3806
3807        /// Sets or clears the value of [client_operation_id][crate::model::response_policies::DeleteRequest::client_operation_id].
3808        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
3809        where
3810            T: std::convert::Into<std::string::String>,
3811        {
3812            self.0.request.client_operation_id = v.map(|x| x.into());
3813            self
3814        }
3815
3816        /// Sets the value of [project][crate::model::response_policies::DeleteRequest::project].
3817        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3818            self.0.request.project = v.into();
3819            self
3820        }
3821
3822        /// Sets the value of [response_policy][crate::model::response_policies::DeleteRequest::response_policy].
3823        pub fn set_response_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
3824            self.0.request.response_policy = v.into();
3825            self
3826        }
3827    }
3828
3829    #[doc(hidden)]
3830    impl crate::RequestBuilder for Delete {
3831        fn request_options(&mut self) -> &mut crate::RequestOptions {
3832            &mut self.0.options
3833        }
3834    }
3835
3836    /// The request builder for [ResponsePolicies::get][crate::client::ResponsePolicies::get] calls.
3837    ///
3838    /// # Example
3839    /// ```
3840    /// # use google_cloud_dns_v1::builder::response_policies::Get;
3841    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
3842    ///
3843    /// let builder = prepare_request_builder();
3844    /// let response = builder.send().await?;
3845    /// # Ok(()) }
3846    ///
3847    /// fn prepare_request_builder() -> Get {
3848    ///   # panic!();
3849    ///   // ... details omitted ...
3850    /// }
3851    /// ```
3852    #[derive(Clone, Debug)]
3853    pub struct Get(RequestBuilder<crate::model::response_policies::GetRequest>);
3854
3855    impl Get {
3856        pub(crate) fn new(
3857            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicies>,
3858        ) -> Self {
3859            Self(RequestBuilder::new(stub))
3860        }
3861
3862        /// Sets the full request, replacing any prior values.
3863        pub fn with_request<V: Into<crate::model::response_policies::GetRequest>>(
3864            mut self,
3865            v: V,
3866        ) -> Self {
3867            self.0.request = v.into();
3868            self
3869        }
3870
3871        /// Sets all the options, replacing any prior values.
3872        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3873            self.0.options = v.into();
3874            self
3875        }
3876
3877        /// Sends the request.
3878        pub async fn send(self) -> Result<crate::model::ResponsePolicy> {
3879            (*self.0.stub)
3880                .get(self.0.request, self.0.options)
3881                .await
3882                .map(crate::Response::into_body)
3883        }
3884
3885        /// Sets the value of [client_operation_id][crate::model::response_policies::GetRequest::client_operation_id].
3886        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
3887        where
3888            T: std::convert::Into<std::string::String>,
3889        {
3890            self.0.request.client_operation_id = std::option::Option::Some(v.into());
3891            self
3892        }
3893
3894        /// Sets or clears the value of [client_operation_id][crate::model::response_policies::GetRequest::client_operation_id].
3895        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
3896        where
3897            T: std::convert::Into<std::string::String>,
3898        {
3899            self.0.request.client_operation_id = v.map(|x| x.into());
3900            self
3901        }
3902
3903        /// Sets the value of [project][crate::model::response_policies::GetRequest::project].
3904        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3905            self.0.request.project = v.into();
3906            self
3907        }
3908
3909        /// Sets the value of [response_policy][crate::model::response_policies::GetRequest::response_policy].
3910        pub fn set_response_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
3911            self.0.request.response_policy = v.into();
3912            self
3913        }
3914    }
3915
3916    #[doc(hidden)]
3917    impl crate::RequestBuilder for Get {
3918        fn request_options(&mut self) -> &mut crate::RequestOptions {
3919            &mut self.0.options
3920        }
3921    }
3922
3923    /// The request builder for [ResponsePolicies::list][crate::client::ResponsePolicies::list] calls.
3924    ///
3925    /// # Example
3926    /// ```
3927    /// # use google_cloud_dns_v1::builder::response_policies::List;
3928    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
3929    /// use google_cloud_gax::paginator::ItemPaginator;
3930    ///
3931    /// let builder = prepare_request_builder();
3932    /// let mut items = builder.by_item();
3933    /// while let Some(result) = items.next().await {
3934    ///   let item = result?;
3935    /// }
3936    /// # Ok(()) }
3937    ///
3938    /// fn prepare_request_builder() -> List {
3939    ///   # panic!();
3940    ///   // ... details omitted ...
3941    /// }
3942    /// ```
3943    #[derive(Clone, Debug)]
3944    pub struct List(RequestBuilder<crate::model::response_policies::ListRequest>);
3945
3946    impl List {
3947        pub(crate) fn new(
3948            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicies>,
3949        ) -> Self {
3950            Self(RequestBuilder::new(stub))
3951        }
3952
3953        /// Sets the full request, replacing any prior values.
3954        pub fn with_request<V: Into<crate::model::response_policies::ListRequest>>(
3955            mut self,
3956            v: V,
3957        ) -> Self {
3958            self.0.request = v.into();
3959            self
3960        }
3961
3962        /// Sets all the options, replacing any prior values.
3963        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3964            self.0.options = v.into();
3965            self
3966        }
3967
3968        /// Sends the request.
3969        pub async fn send(self) -> Result<crate::model::ResponsePoliciesListResponse> {
3970            (*self.0.stub)
3971                .list(self.0.request, self.0.options)
3972                .await
3973                .map(crate::Response::into_body)
3974        }
3975
3976        /// Streams each page in the collection.
3977        pub fn by_page(
3978            self,
3979        ) -> impl google_cloud_gax::paginator::Paginator<
3980            crate::model::ResponsePoliciesListResponse,
3981            crate::Error,
3982        > {
3983            use std::clone::Clone;
3984            let token = self.0.request.page_token.clone().unwrap_or_default();
3985            let execute = move |token: String| {
3986                let mut builder = self.clone();
3987                builder.0.request = builder.0.request.set_page_token(token);
3988                builder.send()
3989            };
3990            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3991        }
3992
3993        /// Streams each item in the collection.
3994        pub fn by_item(
3995            self,
3996        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3997            crate::model::ResponsePoliciesListResponse,
3998            crate::Error,
3999        > {
4000            use google_cloud_gax::paginator::Paginator;
4001            self.by_page().items()
4002        }
4003
4004        /// Sets the value of [max_results][crate::model::response_policies::ListRequest::max_results].
4005        pub fn set_max_results<T>(mut self, v: T) -> Self
4006        where
4007            T: std::convert::Into<i32>,
4008        {
4009            self.0.request.max_results = std::option::Option::Some(v.into());
4010            self
4011        }
4012
4013        /// Sets or clears the value of [max_results][crate::model::response_policies::ListRequest::max_results].
4014        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
4015        where
4016            T: std::convert::Into<i32>,
4017        {
4018            self.0.request.max_results = v.map(|x| x.into());
4019            self
4020        }
4021
4022        /// Sets the value of [page_token][crate::model::response_policies::ListRequest::page_token].
4023        pub fn set_page_token<T>(mut self, v: T) -> Self
4024        where
4025            T: std::convert::Into<std::string::String>,
4026        {
4027            self.0.request.page_token = std::option::Option::Some(v.into());
4028            self
4029        }
4030
4031        /// Sets or clears the value of [page_token][crate::model::response_policies::ListRequest::page_token].
4032        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
4033        where
4034            T: std::convert::Into<std::string::String>,
4035        {
4036            self.0.request.page_token = v.map(|x| x.into());
4037            self
4038        }
4039
4040        /// Sets the value of [project][crate::model::response_policies::ListRequest::project].
4041        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4042            self.0.request.project = v.into();
4043            self
4044        }
4045    }
4046
4047    #[doc(hidden)]
4048    impl crate::RequestBuilder for List {
4049        fn request_options(&mut self) -> &mut crate::RequestOptions {
4050            &mut self.0.options
4051        }
4052    }
4053
4054    /// The request builder for [ResponsePolicies::patch][crate::client::ResponsePolicies::patch] calls.
4055    ///
4056    /// # Example
4057    /// ```
4058    /// # use google_cloud_dns_v1::builder::response_policies::Patch;
4059    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
4060    ///
4061    /// let builder = prepare_request_builder();
4062    /// let response = builder.send().await?;
4063    /// # Ok(()) }
4064    ///
4065    /// fn prepare_request_builder() -> Patch {
4066    ///   # panic!();
4067    ///   // ... details omitted ...
4068    /// }
4069    /// ```
4070    #[derive(Clone, Debug)]
4071    pub struct Patch(RequestBuilder<crate::model::response_policies::PatchRequest>);
4072
4073    impl Patch {
4074        pub(crate) fn new(
4075            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicies>,
4076        ) -> Self {
4077            Self(RequestBuilder::new(stub))
4078        }
4079
4080        /// Sets the full request, replacing any prior values.
4081        pub fn with_request<V: Into<crate::model::response_policies::PatchRequest>>(
4082            mut self,
4083            v: V,
4084        ) -> Self {
4085            self.0.request = v.into();
4086            self
4087        }
4088
4089        /// Sets all the options, replacing any prior values.
4090        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4091            self.0.options = v.into();
4092            self
4093        }
4094
4095        /// Sends the request.
4096        pub async fn send(self) -> Result<crate::model::ResponsePoliciesPatchResponse> {
4097            (*self.0.stub)
4098                .patch(self.0.request, self.0.options)
4099                .await
4100                .map(crate::Response::into_body)
4101        }
4102
4103        /// Sets the value of [client_operation_id][crate::model::response_policies::PatchRequest::client_operation_id].
4104        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
4105        where
4106            T: std::convert::Into<std::string::String>,
4107        {
4108            self.0.request.client_operation_id = std::option::Option::Some(v.into());
4109            self
4110        }
4111
4112        /// Sets or clears the value of [client_operation_id][crate::model::response_policies::PatchRequest::client_operation_id].
4113        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
4114        where
4115            T: std::convert::Into<std::string::String>,
4116        {
4117            self.0.request.client_operation_id = v.map(|x| x.into());
4118            self
4119        }
4120
4121        /// Sets the value of [project][crate::model::response_policies::PatchRequest::project].
4122        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4123            self.0.request.project = v.into();
4124            self
4125        }
4126
4127        /// Sets the value of [response_policy][crate::model::response_policies::PatchRequest::response_policy].
4128        pub fn set_response_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
4129            self.0.request.response_policy = v.into();
4130            self
4131        }
4132
4133        /// Sets the value of [body][crate::model::response_policies::PatchRequest::body].
4134        pub fn set_body<T>(mut self, v: T) -> Self
4135        where
4136            T: std::convert::Into<crate::model::ResponsePolicy>,
4137        {
4138            self.0.request.body = std::option::Option::Some(v.into());
4139            self
4140        }
4141
4142        /// Sets or clears the value of [body][crate::model::response_policies::PatchRequest::body].
4143        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4144        where
4145            T: std::convert::Into<crate::model::ResponsePolicy>,
4146        {
4147            self.0.request.body = v.map(|x| x.into());
4148            self
4149        }
4150    }
4151
4152    #[doc(hidden)]
4153    impl crate::RequestBuilder for Patch {
4154        fn request_options(&mut self) -> &mut crate::RequestOptions {
4155            &mut self.0.options
4156        }
4157    }
4158
4159    /// The request builder for [ResponsePolicies::update][crate::client::ResponsePolicies::update] calls.
4160    ///
4161    /// # Example
4162    /// ```
4163    /// # use google_cloud_dns_v1::builder::response_policies::Update;
4164    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
4165    ///
4166    /// let builder = prepare_request_builder();
4167    /// let response = builder.send().await?;
4168    /// # Ok(()) }
4169    ///
4170    /// fn prepare_request_builder() -> Update {
4171    ///   # panic!();
4172    ///   // ... details omitted ...
4173    /// }
4174    /// ```
4175    #[derive(Clone, Debug)]
4176    pub struct Update(RequestBuilder<crate::model::response_policies::UpdateRequest>);
4177
4178    impl Update {
4179        pub(crate) fn new(
4180            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicies>,
4181        ) -> Self {
4182            Self(RequestBuilder::new(stub))
4183        }
4184
4185        /// Sets the full request, replacing any prior values.
4186        pub fn with_request<V: Into<crate::model::response_policies::UpdateRequest>>(
4187            mut self,
4188            v: V,
4189        ) -> Self {
4190            self.0.request = v.into();
4191            self
4192        }
4193
4194        /// Sets all the options, replacing any prior values.
4195        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4196            self.0.options = v.into();
4197            self
4198        }
4199
4200        /// Sends the request.
4201        pub async fn send(self) -> Result<crate::model::ResponsePoliciesUpdateResponse> {
4202            (*self.0.stub)
4203                .update(self.0.request, self.0.options)
4204                .await
4205                .map(crate::Response::into_body)
4206        }
4207
4208        /// Sets the value of [client_operation_id][crate::model::response_policies::UpdateRequest::client_operation_id].
4209        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
4210        where
4211            T: std::convert::Into<std::string::String>,
4212        {
4213            self.0.request.client_operation_id = std::option::Option::Some(v.into());
4214            self
4215        }
4216
4217        /// Sets or clears the value of [client_operation_id][crate::model::response_policies::UpdateRequest::client_operation_id].
4218        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
4219        where
4220            T: std::convert::Into<std::string::String>,
4221        {
4222            self.0.request.client_operation_id = v.map(|x| x.into());
4223            self
4224        }
4225
4226        /// Sets the value of [project][crate::model::response_policies::UpdateRequest::project].
4227        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4228            self.0.request.project = v.into();
4229            self
4230        }
4231
4232        /// Sets the value of [response_policy][crate::model::response_policies::UpdateRequest::response_policy].
4233        pub fn set_response_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
4234            self.0.request.response_policy = v.into();
4235            self
4236        }
4237
4238        /// Sets the value of [body][crate::model::response_policies::UpdateRequest::body].
4239        pub fn set_body<T>(mut self, v: T) -> Self
4240        where
4241            T: std::convert::Into<crate::model::ResponsePolicy>,
4242        {
4243            self.0.request.body = std::option::Option::Some(v.into());
4244            self
4245        }
4246
4247        /// Sets or clears the value of [body][crate::model::response_policies::UpdateRequest::body].
4248        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4249        where
4250            T: std::convert::Into<crate::model::ResponsePolicy>,
4251        {
4252            self.0.request.body = v.map(|x| x.into());
4253            self
4254        }
4255    }
4256
4257    #[doc(hidden)]
4258    impl crate::RequestBuilder for Update {
4259        fn request_options(&mut self) -> &mut crate::RequestOptions {
4260            &mut self.0.options
4261        }
4262    }
4263}
4264
4265/// Request and client builders for [ResponsePolicyRules][crate::client::ResponsePolicyRules].
4266pub mod response_policy_rules {
4267    use crate::Result;
4268
4269    /// A builder for [ResponsePolicyRules][crate::client::ResponsePolicyRules].
4270    ///
4271    /// ```
4272    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4273    /// # use google_cloud_dns_v1::*;
4274    /// # use builder::response_policy_rules::ClientBuilder;
4275    /// # use client::ResponsePolicyRules;
4276    /// let builder : ClientBuilder = ResponsePolicyRules::builder();
4277    /// let client = builder
4278    ///     .with_endpoint("https://dns.googleapis.com")
4279    ///     .build().await?;
4280    /// # Ok(()) }
4281    /// ```
4282    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4283
4284    pub(crate) mod client {
4285        use super::super::super::client::ResponsePolicyRules;
4286        pub struct Factory;
4287        impl crate::ClientFactory for Factory {
4288            type Client = ResponsePolicyRules;
4289            type Credentials = gaxi::options::Credentials;
4290            async fn build(
4291                self,
4292                config: gaxi::options::ClientConfig,
4293            ) -> crate::ClientBuilderResult<Self::Client> {
4294                Self::Client::new(config).await
4295            }
4296        }
4297    }
4298
4299    /// Common implementation for [crate::client::ResponsePolicyRules] request builders.
4300    #[derive(Clone, Debug)]
4301    pub(crate) struct RequestBuilder<R: std::default::Default> {
4302        stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicyRules>,
4303        request: R,
4304        options: crate::RequestOptions,
4305    }
4306
4307    impl<R> RequestBuilder<R>
4308    where
4309        R: std::default::Default,
4310    {
4311        pub(crate) fn new(
4312            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicyRules>,
4313        ) -> Self {
4314            Self {
4315                stub,
4316                request: R::default(),
4317                options: crate::RequestOptions::default(),
4318            }
4319        }
4320    }
4321
4322    /// The request builder for [ResponsePolicyRules::create][crate::client::ResponsePolicyRules::create] calls.
4323    ///
4324    /// # Example
4325    /// ```
4326    /// # use google_cloud_dns_v1::builder::response_policy_rules::Create;
4327    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
4328    ///
4329    /// let builder = prepare_request_builder();
4330    /// let response = builder.send().await?;
4331    /// # Ok(()) }
4332    ///
4333    /// fn prepare_request_builder() -> Create {
4334    ///   # panic!();
4335    ///   // ... details omitted ...
4336    /// }
4337    /// ```
4338    #[derive(Clone, Debug)]
4339    pub struct Create(RequestBuilder<crate::model::response_policy_rules::CreateRequest>);
4340
4341    impl Create {
4342        pub(crate) fn new(
4343            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicyRules>,
4344        ) -> Self {
4345            Self(RequestBuilder::new(stub))
4346        }
4347
4348        /// Sets the full request, replacing any prior values.
4349        pub fn with_request<V: Into<crate::model::response_policy_rules::CreateRequest>>(
4350            mut self,
4351            v: V,
4352        ) -> Self {
4353            self.0.request = v.into();
4354            self
4355        }
4356
4357        /// Sets all the options, replacing any prior values.
4358        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4359            self.0.options = v.into();
4360            self
4361        }
4362
4363        /// Sends the request.
4364        pub async fn send(self) -> Result<crate::model::ResponsePolicyRule> {
4365            (*self.0.stub)
4366                .create(self.0.request, self.0.options)
4367                .await
4368                .map(crate::Response::into_body)
4369        }
4370
4371        /// Sets the value of [client_operation_id][crate::model::response_policy_rules::CreateRequest::client_operation_id].
4372        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
4373        where
4374            T: std::convert::Into<std::string::String>,
4375        {
4376            self.0.request.client_operation_id = std::option::Option::Some(v.into());
4377            self
4378        }
4379
4380        /// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::CreateRequest::client_operation_id].
4381        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
4382        where
4383            T: std::convert::Into<std::string::String>,
4384        {
4385            self.0.request.client_operation_id = v.map(|x| x.into());
4386            self
4387        }
4388
4389        /// Sets the value of [project][crate::model::response_policy_rules::CreateRequest::project].
4390        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4391            self.0.request.project = v.into();
4392            self
4393        }
4394
4395        /// Sets the value of [response_policy][crate::model::response_policy_rules::CreateRequest::response_policy].
4396        pub fn set_response_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
4397            self.0.request.response_policy = v.into();
4398            self
4399        }
4400
4401        /// Sets the value of [body][crate::model::response_policy_rules::CreateRequest::body].
4402        pub fn set_body<T>(mut self, v: T) -> Self
4403        where
4404            T: std::convert::Into<crate::model::ResponsePolicyRule>,
4405        {
4406            self.0.request.body = std::option::Option::Some(v.into());
4407            self
4408        }
4409
4410        /// Sets or clears the value of [body][crate::model::response_policy_rules::CreateRequest::body].
4411        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4412        where
4413            T: std::convert::Into<crate::model::ResponsePolicyRule>,
4414        {
4415            self.0.request.body = v.map(|x| x.into());
4416            self
4417        }
4418    }
4419
4420    #[doc(hidden)]
4421    impl crate::RequestBuilder for Create {
4422        fn request_options(&mut self) -> &mut crate::RequestOptions {
4423            &mut self.0.options
4424        }
4425    }
4426
4427    /// The request builder for [ResponsePolicyRules::delete][crate::client::ResponsePolicyRules::delete] calls.
4428    ///
4429    /// # Example
4430    /// ```
4431    /// # use google_cloud_dns_v1::builder::response_policy_rules::Delete;
4432    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
4433    ///
4434    /// let builder = prepare_request_builder();
4435    /// let response = builder.send().await?;
4436    /// # Ok(()) }
4437    ///
4438    /// fn prepare_request_builder() -> Delete {
4439    ///   # panic!();
4440    ///   // ... details omitted ...
4441    /// }
4442    /// ```
4443    #[derive(Clone, Debug)]
4444    pub struct Delete(RequestBuilder<crate::model::response_policy_rules::DeleteRequest>);
4445
4446    impl Delete {
4447        pub(crate) fn new(
4448            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicyRules>,
4449        ) -> Self {
4450            Self(RequestBuilder::new(stub))
4451        }
4452
4453        /// Sets the full request, replacing any prior values.
4454        pub fn with_request<V: Into<crate::model::response_policy_rules::DeleteRequest>>(
4455            mut self,
4456            v: V,
4457        ) -> Self {
4458            self.0.request = v.into();
4459            self
4460        }
4461
4462        /// Sets all the options, replacing any prior values.
4463        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4464            self.0.options = v.into();
4465            self
4466        }
4467
4468        /// Sends the request.
4469        pub async fn send(self) -> Result<()> {
4470            (*self.0.stub)
4471                .delete(self.0.request, self.0.options)
4472                .await
4473                .map(crate::Response::into_body)
4474        }
4475
4476        /// Sets the value of [client_operation_id][crate::model::response_policy_rules::DeleteRequest::client_operation_id].
4477        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
4478        where
4479            T: std::convert::Into<std::string::String>,
4480        {
4481            self.0.request.client_operation_id = std::option::Option::Some(v.into());
4482            self
4483        }
4484
4485        /// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::DeleteRequest::client_operation_id].
4486        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
4487        where
4488            T: std::convert::Into<std::string::String>,
4489        {
4490            self.0.request.client_operation_id = v.map(|x| x.into());
4491            self
4492        }
4493
4494        /// Sets the value of [project][crate::model::response_policy_rules::DeleteRequest::project].
4495        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4496            self.0.request.project = v.into();
4497            self
4498        }
4499
4500        /// Sets the value of [response_policy][crate::model::response_policy_rules::DeleteRequest::response_policy].
4501        pub fn set_response_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
4502            self.0.request.response_policy = v.into();
4503            self
4504        }
4505
4506        /// Sets the value of [response_policy_rule][crate::model::response_policy_rules::DeleteRequest::response_policy_rule].
4507        pub fn set_response_policy_rule<T: Into<std::string::String>>(mut self, v: T) -> Self {
4508            self.0.request.response_policy_rule = v.into();
4509            self
4510        }
4511    }
4512
4513    #[doc(hidden)]
4514    impl crate::RequestBuilder for Delete {
4515        fn request_options(&mut self) -> &mut crate::RequestOptions {
4516            &mut self.0.options
4517        }
4518    }
4519
4520    /// The request builder for [ResponsePolicyRules::get][crate::client::ResponsePolicyRules::get] calls.
4521    ///
4522    /// # Example
4523    /// ```
4524    /// # use google_cloud_dns_v1::builder::response_policy_rules::Get;
4525    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
4526    ///
4527    /// let builder = prepare_request_builder();
4528    /// let response = builder.send().await?;
4529    /// # Ok(()) }
4530    ///
4531    /// fn prepare_request_builder() -> Get {
4532    ///   # panic!();
4533    ///   // ... details omitted ...
4534    /// }
4535    /// ```
4536    #[derive(Clone, Debug)]
4537    pub struct Get(RequestBuilder<crate::model::response_policy_rules::GetRequest>);
4538
4539    impl Get {
4540        pub(crate) fn new(
4541            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicyRules>,
4542        ) -> Self {
4543            Self(RequestBuilder::new(stub))
4544        }
4545
4546        /// Sets the full request, replacing any prior values.
4547        pub fn with_request<V: Into<crate::model::response_policy_rules::GetRequest>>(
4548            mut self,
4549            v: V,
4550        ) -> Self {
4551            self.0.request = v.into();
4552            self
4553        }
4554
4555        /// Sets all the options, replacing any prior values.
4556        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4557            self.0.options = v.into();
4558            self
4559        }
4560
4561        /// Sends the request.
4562        pub async fn send(self) -> Result<crate::model::ResponsePolicyRule> {
4563            (*self.0.stub)
4564                .get(self.0.request, self.0.options)
4565                .await
4566                .map(crate::Response::into_body)
4567        }
4568
4569        /// Sets the value of [client_operation_id][crate::model::response_policy_rules::GetRequest::client_operation_id].
4570        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
4571        where
4572            T: std::convert::Into<std::string::String>,
4573        {
4574            self.0.request.client_operation_id = std::option::Option::Some(v.into());
4575            self
4576        }
4577
4578        /// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::GetRequest::client_operation_id].
4579        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
4580        where
4581            T: std::convert::Into<std::string::String>,
4582        {
4583            self.0.request.client_operation_id = v.map(|x| x.into());
4584            self
4585        }
4586
4587        /// Sets the value of [project][crate::model::response_policy_rules::GetRequest::project].
4588        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4589            self.0.request.project = v.into();
4590            self
4591        }
4592
4593        /// Sets the value of [response_policy][crate::model::response_policy_rules::GetRequest::response_policy].
4594        pub fn set_response_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
4595            self.0.request.response_policy = v.into();
4596            self
4597        }
4598
4599        /// Sets the value of [response_policy_rule][crate::model::response_policy_rules::GetRequest::response_policy_rule].
4600        pub fn set_response_policy_rule<T: Into<std::string::String>>(mut self, v: T) -> Self {
4601            self.0.request.response_policy_rule = v.into();
4602            self
4603        }
4604    }
4605
4606    #[doc(hidden)]
4607    impl crate::RequestBuilder for Get {
4608        fn request_options(&mut self) -> &mut crate::RequestOptions {
4609            &mut self.0.options
4610        }
4611    }
4612
4613    /// The request builder for [ResponsePolicyRules::list][crate::client::ResponsePolicyRules::list] calls.
4614    ///
4615    /// # Example
4616    /// ```
4617    /// # use google_cloud_dns_v1::builder::response_policy_rules::List;
4618    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
4619    /// use google_cloud_gax::paginator::ItemPaginator;
4620    ///
4621    /// let builder = prepare_request_builder();
4622    /// let mut items = builder.by_item();
4623    /// while let Some(result) = items.next().await {
4624    ///   let item = result?;
4625    /// }
4626    /// # Ok(()) }
4627    ///
4628    /// fn prepare_request_builder() -> List {
4629    ///   # panic!();
4630    ///   // ... details omitted ...
4631    /// }
4632    /// ```
4633    #[derive(Clone, Debug)]
4634    pub struct List(RequestBuilder<crate::model::response_policy_rules::ListRequest>);
4635
4636    impl List {
4637        pub(crate) fn new(
4638            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicyRules>,
4639        ) -> Self {
4640            Self(RequestBuilder::new(stub))
4641        }
4642
4643        /// Sets the full request, replacing any prior values.
4644        pub fn with_request<V: Into<crate::model::response_policy_rules::ListRequest>>(
4645            mut self,
4646            v: V,
4647        ) -> Self {
4648            self.0.request = v.into();
4649            self
4650        }
4651
4652        /// Sets all the options, replacing any prior values.
4653        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4654            self.0.options = v.into();
4655            self
4656        }
4657
4658        /// Sends the request.
4659        pub async fn send(self) -> Result<crate::model::ResponsePolicyRulesListResponse> {
4660            (*self.0.stub)
4661                .list(self.0.request, self.0.options)
4662                .await
4663                .map(crate::Response::into_body)
4664        }
4665
4666        /// Streams each page in the collection.
4667        pub fn by_page(
4668            self,
4669        ) -> impl google_cloud_gax::paginator::Paginator<
4670            crate::model::ResponsePolicyRulesListResponse,
4671            crate::Error,
4672        > {
4673            use std::clone::Clone;
4674            let token = self.0.request.page_token.clone().unwrap_or_default();
4675            let execute = move |token: String| {
4676                let mut builder = self.clone();
4677                builder.0.request = builder.0.request.set_page_token(token);
4678                builder.send()
4679            };
4680            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4681        }
4682
4683        /// Streams each item in the collection.
4684        pub fn by_item(
4685            self,
4686        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4687            crate::model::ResponsePolicyRulesListResponse,
4688            crate::Error,
4689        > {
4690            use google_cloud_gax::paginator::Paginator;
4691            self.by_page().items()
4692        }
4693
4694        /// Sets the value of [max_results][crate::model::response_policy_rules::ListRequest::max_results].
4695        pub fn set_max_results<T>(mut self, v: T) -> Self
4696        where
4697            T: std::convert::Into<i32>,
4698        {
4699            self.0.request.max_results = std::option::Option::Some(v.into());
4700            self
4701        }
4702
4703        /// Sets or clears the value of [max_results][crate::model::response_policy_rules::ListRequest::max_results].
4704        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
4705        where
4706            T: std::convert::Into<i32>,
4707        {
4708            self.0.request.max_results = v.map(|x| x.into());
4709            self
4710        }
4711
4712        /// Sets the value of [page_token][crate::model::response_policy_rules::ListRequest::page_token].
4713        pub fn set_page_token<T>(mut self, v: T) -> Self
4714        where
4715            T: std::convert::Into<std::string::String>,
4716        {
4717            self.0.request.page_token = std::option::Option::Some(v.into());
4718            self
4719        }
4720
4721        /// Sets or clears the value of [page_token][crate::model::response_policy_rules::ListRequest::page_token].
4722        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
4723        where
4724            T: std::convert::Into<std::string::String>,
4725        {
4726            self.0.request.page_token = v.map(|x| x.into());
4727            self
4728        }
4729
4730        /// Sets the value of [project][crate::model::response_policy_rules::ListRequest::project].
4731        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4732            self.0.request.project = v.into();
4733            self
4734        }
4735
4736        /// Sets the value of [response_policy][crate::model::response_policy_rules::ListRequest::response_policy].
4737        pub fn set_response_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
4738            self.0.request.response_policy = v.into();
4739            self
4740        }
4741    }
4742
4743    #[doc(hidden)]
4744    impl crate::RequestBuilder for List {
4745        fn request_options(&mut self) -> &mut crate::RequestOptions {
4746            &mut self.0.options
4747        }
4748    }
4749
4750    /// The request builder for [ResponsePolicyRules::patch][crate::client::ResponsePolicyRules::patch] calls.
4751    ///
4752    /// # Example
4753    /// ```
4754    /// # use google_cloud_dns_v1::builder::response_policy_rules::Patch;
4755    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
4756    ///
4757    /// let builder = prepare_request_builder();
4758    /// let response = builder.send().await?;
4759    /// # Ok(()) }
4760    ///
4761    /// fn prepare_request_builder() -> Patch {
4762    ///   # panic!();
4763    ///   // ... details omitted ...
4764    /// }
4765    /// ```
4766    #[derive(Clone, Debug)]
4767    pub struct Patch(RequestBuilder<crate::model::response_policy_rules::PatchRequest>);
4768
4769    impl Patch {
4770        pub(crate) fn new(
4771            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicyRules>,
4772        ) -> Self {
4773            Self(RequestBuilder::new(stub))
4774        }
4775
4776        /// Sets the full request, replacing any prior values.
4777        pub fn with_request<V: Into<crate::model::response_policy_rules::PatchRequest>>(
4778            mut self,
4779            v: V,
4780        ) -> Self {
4781            self.0.request = v.into();
4782            self
4783        }
4784
4785        /// Sets all the options, replacing any prior values.
4786        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4787            self.0.options = v.into();
4788            self
4789        }
4790
4791        /// Sends the request.
4792        pub async fn send(self) -> Result<crate::model::ResponsePolicyRulesPatchResponse> {
4793            (*self.0.stub)
4794                .patch(self.0.request, self.0.options)
4795                .await
4796                .map(crate::Response::into_body)
4797        }
4798
4799        /// Sets the value of [client_operation_id][crate::model::response_policy_rules::PatchRequest::client_operation_id].
4800        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
4801        where
4802            T: std::convert::Into<std::string::String>,
4803        {
4804            self.0.request.client_operation_id = std::option::Option::Some(v.into());
4805            self
4806        }
4807
4808        /// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::PatchRequest::client_operation_id].
4809        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
4810        where
4811            T: std::convert::Into<std::string::String>,
4812        {
4813            self.0.request.client_operation_id = v.map(|x| x.into());
4814            self
4815        }
4816
4817        /// Sets the value of [project][crate::model::response_policy_rules::PatchRequest::project].
4818        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4819            self.0.request.project = v.into();
4820            self
4821        }
4822
4823        /// Sets the value of [response_policy][crate::model::response_policy_rules::PatchRequest::response_policy].
4824        pub fn set_response_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
4825            self.0.request.response_policy = v.into();
4826            self
4827        }
4828
4829        /// Sets the value of [response_policy_rule][crate::model::response_policy_rules::PatchRequest::response_policy_rule].
4830        pub fn set_response_policy_rule<T: Into<std::string::String>>(mut self, v: T) -> Self {
4831            self.0.request.response_policy_rule = v.into();
4832            self
4833        }
4834
4835        /// Sets the value of [body][crate::model::response_policy_rules::PatchRequest::body].
4836        pub fn set_body<T>(mut self, v: T) -> Self
4837        where
4838            T: std::convert::Into<crate::model::ResponsePolicyRule>,
4839        {
4840            self.0.request.body = std::option::Option::Some(v.into());
4841            self
4842        }
4843
4844        /// Sets or clears the value of [body][crate::model::response_policy_rules::PatchRequest::body].
4845        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4846        where
4847            T: std::convert::Into<crate::model::ResponsePolicyRule>,
4848        {
4849            self.0.request.body = v.map(|x| x.into());
4850            self
4851        }
4852    }
4853
4854    #[doc(hidden)]
4855    impl crate::RequestBuilder for Patch {
4856        fn request_options(&mut self) -> &mut crate::RequestOptions {
4857            &mut self.0.options
4858        }
4859    }
4860
4861    /// The request builder for [ResponsePolicyRules::update][crate::client::ResponsePolicyRules::update] calls.
4862    ///
4863    /// # Example
4864    /// ```
4865    /// # use google_cloud_dns_v1::builder::response_policy_rules::Update;
4866    /// # async fn sample() -> google_cloud_dns_v1::Result<()> {
4867    ///
4868    /// let builder = prepare_request_builder();
4869    /// let response = builder.send().await?;
4870    /// # Ok(()) }
4871    ///
4872    /// fn prepare_request_builder() -> Update {
4873    ///   # panic!();
4874    ///   // ... details omitted ...
4875    /// }
4876    /// ```
4877    #[derive(Clone, Debug)]
4878    pub struct Update(RequestBuilder<crate::model::response_policy_rules::UpdateRequest>);
4879
4880    impl Update {
4881        pub(crate) fn new(
4882            stub: std::sync::Arc<dyn super::super::stub::dynamic::ResponsePolicyRules>,
4883        ) -> Self {
4884            Self(RequestBuilder::new(stub))
4885        }
4886
4887        /// Sets the full request, replacing any prior values.
4888        pub fn with_request<V: Into<crate::model::response_policy_rules::UpdateRequest>>(
4889            mut self,
4890            v: V,
4891        ) -> Self {
4892            self.0.request = v.into();
4893            self
4894        }
4895
4896        /// Sets all the options, replacing any prior values.
4897        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4898            self.0.options = v.into();
4899            self
4900        }
4901
4902        /// Sends the request.
4903        pub async fn send(self) -> Result<crate::model::ResponsePolicyRulesUpdateResponse> {
4904            (*self.0.stub)
4905                .update(self.0.request, self.0.options)
4906                .await
4907                .map(crate::Response::into_body)
4908        }
4909
4910        /// Sets the value of [client_operation_id][crate::model::response_policy_rules::UpdateRequest::client_operation_id].
4911        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
4912        where
4913            T: std::convert::Into<std::string::String>,
4914        {
4915            self.0.request.client_operation_id = std::option::Option::Some(v.into());
4916            self
4917        }
4918
4919        /// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::UpdateRequest::client_operation_id].
4920        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
4921        where
4922            T: std::convert::Into<std::string::String>,
4923        {
4924            self.0.request.client_operation_id = v.map(|x| x.into());
4925            self
4926        }
4927
4928        /// Sets the value of [project][crate::model::response_policy_rules::UpdateRequest::project].
4929        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4930            self.0.request.project = v.into();
4931            self
4932        }
4933
4934        /// Sets the value of [response_policy][crate::model::response_policy_rules::UpdateRequest::response_policy].
4935        pub fn set_response_policy<T: Into<std::string::String>>(mut self, v: T) -> Self {
4936            self.0.request.response_policy = v.into();
4937            self
4938        }
4939
4940        /// Sets the value of [response_policy_rule][crate::model::response_policy_rules::UpdateRequest::response_policy_rule].
4941        pub fn set_response_policy_rule<T: Into<std::string::String>>(mut self, v: T) -> Self {
4942            self.0.request.response_policy_rule = v.into();
4943            self
4944        }
4945
4946        /// Sets the value of [body][crate::model::response_policy_rules::UpdateRequest::body].
4947        pub fn set_body<T>(mut self, v: T) -> Self
4948        where
4949            T: std::convert::Into<crate::model::ResponsePolicyRule>,
4950        {
4951            self.0.request.body = std::option::Option::Some(v.into());
4952            self
4953        }
4954
4955        /// Sets or clears the value of [body][crate::model::response_policy_rules::UpdateRequest::body].
4956        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4957        where
4958            T: std::convert::Into<crate::model::ResponsePolicyRule>,
4959        {
4960            self.0.request.body = v.map(|x| x.into());
4961            self
4962        }
4963    }
4964
4965    #[doc(hidden)]
4966    impl crate::RequestBuilder for Update {
4967        fn request_options(&mut self) -> &mut crate::RequestOptions {
4968            &mut self.0.options
4969        }
4970    }
4971}