Skip to main content

google_cloud_dns_v1/
model.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#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// A Change represents a set of `ResourceRecordSet` additions and deletions applied atomically to a ManagedZone. ResourceRecordSets within a ManagedZone are modified by creating a new Change element in the Changes collection. In turn the Changes collection also records the past modifications to the `ResourceRecordSets` in a `ManagedZone`. The current state of the `ManagedZone` is the sum effect of applying all `Change` elements in the `Changes` collection in sequence.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct Change {
42    /// Which ResourceRecordSets to add?
43    pub additions: std::vec::Vec<crate::model::ResourceRecordSet>,
44
45    /// Which ResourceRecordSets to remove? Must match existing data exactly.
46    pub deletions: std::vec::Vec<crate::model::ResourceRecordSet>,
47
48    /// Unique identifier for the resource; defined by the server (output only).
49    pub id: std::option::Option<std::string::String>,
50
51    /// If the DNS queries for the zone will be served.
52    pub is_serving: std::option::Option<bool>,
53
54    #[allow(missing_docs)]
55    pub kind: std::option::Option<std::string::String>,
56
57    /// The time that this operation was started by the server (output only). This is in RFC3339 text format.
58    pub start_time: std::option::Option<std::string::String>,
59
60    /// Status of the operation (output only). A status of "done" means that the request to update the authoritative servers has been sent, but the servers might not be updated yet.
61    pub status: std::option::Option<crate::model::change::Status>,
62
63    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
64}
65
66impl Change {
67    /// Creates a new default instance.
68    pub fn new() -> Self {
69        std::default::Default::default()
70    }
71
72    /// Sets the value of [additions][crate::model::Change::additions].
73    ///
74    /// # Example
75    /// ```ignore,no_run
76    /// # use google_cloud_dns_v1::model::Change;
77    /// use google_cloud_dns_v1::model::ResourceRecordSet;
78    /// let x = Change::new()
79    ///     .set_additions([
80    ///         ResourceRecordSet::default()/* use setters */,
81    ///         ResourceRecordSet::default()/* use (different) setters */,
82    ///     ]);
83    /// ```
84    pub fn set_additions<T, V>(mut self, v: T) -> Self
85    where
86        T: std::iter::IntoIterator<Item = V>,
87        V: std::convert::Into<crate::model::ResourceRecordSet>,
88    {
89        use std::iter::Iterator;
90        self.additions = v.into_iter().map(|i| i.into()).collect();
91        self
92    }
93
94    /// Sets the value of [deletions][crate::model::Change::deletions].
95    ///
96    /// # Example
97    /// ```ignore,no_run
98    /// # use google_cloud_dns_v1::model::Change;
99    /// use google_cloud_dns_v1::model::ResourceRecordSet;
100    /// let x = Change::new()
101    ///     .set_deletions([
102    ///         ResourceRecordSet::default()/* use setters */,
103    ///         ResourceRecordSet::default()/* use (different) setters */,
104    ///     ]);
105    /// ```
106    pub fn set_deletions<T, V>(mut self, v: T) -> Self
107    where
108        T: std::iter::IntoIterator<Item = V>,
109        V: std::convert::Into<crate::model::ResourceRecordSet>,
110    {
111        use std::iter::Iterator;
112        self.deletions = v.into_iter().map(|i| i.into()).collect();
113        self
114    }
115
116    /// Sets the value of [id][crate::model::Change::id].
117    ///
118    /// # Example
119    /// ```ignore,no_run
120    /// # use google_cloud_dns_v1::model::Change;
121    /// let x = Change::new().set_id("example");
122    /// ```
123    pub fn set_id<T>(mut self, v: T) -> Self
124    where
125        T: std::convert::Into<std::string::String>,
126    {
127        self.id = std::option::Option::Some(v.into());
128        self
129    }
130
131    /// Sets or clears the value of [id][crate::model::Change::id].
132    ///
133    /// # Example
134    /// ```ignore,no_run
135    /// # use google_cloud_dns_v1::model::Change;
136    /// let x = Change::new().set_or_clear_id(Some("example"));
137    /// let x = Change::new().set_or_clear_id(None::<String>);
138    /// ```
139    pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
140    where
141        T: std::convert::Into<std::string::String>,
142    {
143        self.id = v.map(|x| x.into());
144        self
145    }
146
147    /// Sets the value of [is_serving][crate::model::Change::is_serving].
148    ///
149    /// # Example
150    /// ```ignore,no_run
151    /// # use google_cloud_dns_v1::model::Change;
152    /// let x = Change::new().set_is_serving(true);
153    /// ```
154    pub fn set_is_serving<T>(mut self, v: T) -> Self
155    where
156        T: std::convert::Into<bool>,
157    {
158        self.is_serving = std::option::Option::Some(v.into());
159        self
160    }
161
162    /// Sets or clears the value of [is_serving][crate::model::Change::is_serving].
163    ///
164    /// # Example
165    /// ```ignore,no_run
166    /// # use google_cloud_dns_v1::model::Change;
167    /// let x = Change::new().set_or_clear_is_serving(Some(false));
168    /// let x = Change::new().set_or_clear_is_serving(None::<bool>);
169    /// ```
170    pub fn set_or_clear_is_serving<T>(mut self, v: std::option::Option<T>) -> Self
171    where
172        T: std::convert::Into<bool>,
173    {
174        self.is_serving = v.map(|x| x.into());
175        self
176    }
177
178    /// Sets the value of [kind][crate::model::Change::kind].
179    ///
180    /// # Example
181    /// ```ignore,no_run
182    /// # use google_cloud_dns_v1::model::Change;
183    /// let x = Change::new().set_kind("example");
184    /// ```
185    pub fn set_kind<T>(mut self, v: T) -> Self
186    where
187        T: std::convert::Into<std::string::String>,
188    {
189        self.kind = std::option::Option::Some(v.into());
190        self
191    }
192
193    /// Sets or clears the value of [kind][crate::model::Change::kind].
194    ///
195    /// # Example
196    /// ```ignore,no_run
197    /// # use google_cloud_dns_v1::model::Change;
198    /// let x = Change::new().set_or_clear_kind(Some("example"));
199    /// let x = Change::new().set_or_clear_kind(None::<String>);
200    /// ```
201    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
202    where
203        T: std::convert::Into<std::string::String>,
204    {
205        self.kind = v.map(|x| x.into());
206        self
207    }
208
209    /// Sets the value of [start_time][crate::model::Change::start_time].
210    ///
211    /// # Example
212    /// ```ignore,no_run
213    /// # use google_cloud_dns_v1::model::Change;
214    /// let x = Change::new().set_start_time("example");
215    /// ```
216    pub fn set_start_time<T>(mut self, v: T) -> Self
217    where
218        T: std::convert::Into<std::string::String>,
219    {
220        self.start_time = std::option::Option::Some(v.into());
221        self
222    }
223
224    /// Sets or clears the value of [start_time][crate::model::Change::start_time].
225    ///
226    /// # Example
227    /// ```ignore,no_run
228    /// # use google_cloud_dns_v1::model::Change;
229    /// let x = Change::new().set_or_clear_start_time(Some("example"));
230    /// let x = Change::new().set_or_clear_start_time(None::<String>);
231    /// ```
232    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
233    where
234        T: std::convert::Into<std::string::String>,
235    {
236        self.start_time = v.map(|x| x.into());
237        self
238    }
239
240    /// Sets the value of [status][crate::model::Change::status].
241    ///
242    /// # Example
243    /// ```ignore,no_run
244    /// # use google_cloud_dns_v1::model::Change;
245    /// use google_cloud_dns_v1::model::change::Status;
246    /// let x0 = Change::new().set_status(Status::Done);
247    /// ```
248    pub fn set_status<T>(mut self, v: T) -> Self
249    where
250        T: std::convert::Into<crate::model::change::Status>,
251    {
252        self.status = std::option::Option::Some(v.into());
253        self
254    }
255
256    /// Sets or clears the value of [status][crate::model::Change::status].
257    ///
258    /// # Example
259    /// ```ignore,no_run
260    /// # use google_cloud_dns_v1::model::Change;
261    /// use google_cloud_dns_v1::model::change::Status;
262    /// let x0 = Change::new().set_or_clear_status(Some(Status::Done));
263    /// let x_none = Change::new().set_or_clear_status(None::<Status>);
264    /// ```
265    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
266    where
267        T: std::convert::Into<crate::model::change::Status>,
268    {
269        self.status = v.map(|x| x.into());
270        self
271    }
272}
273
274impl wkt::message::Message for Change {
275    fn typename() -> &'static str {
276        "type.googleapis.com/.Change"
277    }
278}
279
280/// Defines additional types related to [Change].
281pub mod change {
282    #[allow(unused_imports)]
283    use super::*;
284
285    /// The enumerated type for the [status][.Change.status] field.
286    ///
287    /// # Working with unknown values
288    ///
289    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
290    /// additional enum variants at any time. Adding new variants is not considered
291    /// a breaking change. Applications should write their code in anticipation of:
292    ///
293    /// - New values appearing in future releases of the client library, **and**
294    /// - New values received dynamically, without application changes.
295    ///
296    /// Please consult the [Working with enums] section in the user guide for some
297    /// guidelines.
298    ///
299    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
300    #[derive(Clone, Debug, PartialEq)]
301    #[non_exhaustive]
302    pub enum Status {
303        #[allow(missing_docs)]
304        Pending,
305        #[allow(missing_docs)]
306        Done,
307        /// If set, the enum was initialized with an unknown value.
308        ///
309        /// Applications can examine the value using [Status::name].
310        UnknownValue(status::UnknownValue),
311    }
312
313    #[doc(hidden)]
314    pub mod status {
315        #[allow(unused_imports)]
316        use super::*;
317        #[derive(Clone, Debug, PartialEq)]
318        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
319    }
320
321    impl Status {
322        /// Gets the enum value as a string.
323        pub fn name(&self) -> std::option::Option<&str> {
324            match self {
325                Self::Pending => std::option::Option::Some("pending"),
326                Self::Done => std::option::Option::Some("done"),
327                Self::UnknownValue(u) => u.0.name(),
328            }
329        }
330    }
331
332    impl std::fmt::Display for Status {
333        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
334            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
335        }
336    }
337
338    impl std::convert::From<&str> for Status {
339        fn from(value: &str) -> Self {
340            use std::string::ToString;
341            match value {
342                "pending" => Self::Pending,
343                "done" => Self::Done,
344                _ => Self::UnknownValue(status::UnknownValue(
345                    wkt::internal::UnknownEnumValue::String(value.to_string()),
346                )),
347            }
348        }
349    }
350
351    impl serde::ser::Serialize for Status {
352        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
353        where
354            S: serde::Serializer,
355        {
356            match self {
357                Self::Pending => serializer.serialize_str("pending"),
358                Self::Done => serializer.serialize_str("done"),
359                Self::UnknownValue(u) => u.0.serialize(serializer),
360            }
361        }
362    }
363
364    impl<'de> serde::de::Deserialize<'de> for Status {
365        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
366        where
367            D: serde::Deserializer<'de>,
368        {
369            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<Status>::new(
370                "..Change.status",
371            ))
372        }
373    }
374}
375
376/// The response to a request to enumerate Changes to a ResourceRecordSets collection.
377#[derive(Clone, Default, PartialEq)]
378#[non_exhaustive]
379pub struct ChangesListResponse {
380    /// The requested changes.
381    pub changes: std::vec::Vec<crate::model::Change>,
382
383    /// Output only. Type of resource.
384    pub kind: std::option::Option<std::string::String>,
385
386    /// This field indicates that more results are available beyond the last page displayed. To fetch the results, make another list request and use this value as your page token. This lets you retrieve the complete contents of a very large collection one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned are an inconsistent view of the collection. You can't retrieve a consistent snapshot of a collection larger than the maximum page size.
387    pub next_page_token: std::option::Option<std::string::String>,
388
389    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
390}
391
392impl ChangesListResponse {
393    /// Creates a new default instance.
394    pub fn new() -> Self {
395        std::default::Default::default()
396    }
397
398    /// Sets the value of [changes][crate::model::ChangesListResponse::changes].
399    ///
400    /// # Example
401    /// ```ignore,no_run
402    /// # use google_cloud_dns_v1::model::ChangesListResponse;
403    /// use google_cloud_dns_v1::model::Change;
404    /// let x = ChangesListResponse::new()
405    ///     .set_changes([
406    ///         Change::default()/* use setters */,
407    ///         Change::default()/* use (different) setters */,
408    ///     ]);
409    /// ```
410    pub fn set_changes<T, V>(mut self, v: T) -> Self
411    where
412        T: std::iter::IntoIterator<Item = V>,
413        V: std::convert::Into<crate::model::Change>,
414    {
415        use std::iter::Iterator;
416        self.changes = v.into_iter().map(|i| i.into()).collect();
417        self
418    }
419
420    /// Sets the value of [kind][crate::model::ChangesListResponse::kind].
421    ///
422    /// # Example
423    /// ```ignore,no_run
424    /// # use google_cloud_dns_v1::model::ChangesListResponse;
425    /// let x = ChangesListResponse::new().set_kind("example");
426    /// ```
427    pub fn set_kind<T>(mut self, v: T) -> Self
428    where
429        T: std::convert::Into<std::string::String>,
430    {
431        self.kind = std::option::Option::Some(v.into());
432        self
433    }
434
435    /// Sets or clears the value of [kind][crate::model::ChangesListResponse::kind].
436    ///
437    /// # Example
438    /// ```ignore,no_run
439    /// # use google_cloud_dns_v1::model::ChangesListResponse;
440    /// let x = ChangesListResponse::new().set_or_clear_kind(Some("example"));
441    /// let x = ChangesListResponse::new().set_or_clear_kind(None::<String>);
442    /// ```
443    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
444    where
445        T: std::convert::Into<std::string::String>,
446    {
447        self.kind = v.map(|x| x.into());
448        self
449    }
450
451    /// Sets the value of [next_page_token][crate::model::ChangesListResponse::next_page_token].
452    ///
453    /// # Example
454    /// ```ignore,no_run
455    /// # use google_cloud_dns_v1::model::ChangesListResponse;
456    /// let x = ChangesListResponse::new().set_next_page_token("example");
457    /// ```
458    pub fn set_next_page_token<T>(mut self, v: T) -> Self
459    where
460        T: std::convert::Into<std::string::String>,
461    {
462        self.next_page_token = std::option::Option::Some(v.into());
463        self
464    }
465
466    /// Sets or clears the value of [next_page_token][crate::model::ChangesListResponse::next_page_token].
467    ///
468    /// # Example
469    /// ```ignore,no_run
470    /// # use google_cloud_dns_v1::model::ChangesListResponse;
471    /// let x = ChangesListResponse::new().set_or_clear_next_page_token(Some("example"));
472    /// let x = ChangesListResponse::new().set_or_clear_next_page_token(None::<String>);
473    /// ```
474    pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
475    where
476        T: std::convert::Into<std::string::String>,
477    {
478        self.next_page_token = v.map(|x| x.into());
479        self
480    }
481}
482
483impl wkt::message::Message for ChangesListResponse {
484    fn typename() -> &'static str {
485        "type.googleapis.com/.ChangesListResponse"
486    }
487}
488
489#[doc(hidden)]
490impl google_cloud_gax::paginator::internal::PageableResponse for ChangesListResponse {
491    type PageItem = crate::model::Change;
492
493    fn items(self) -> std::vec::Vec<Self::PageItem> {
494        self.changes
495    }
496
497    fn next_page_token(&self) -> std::string::String {
498        use std::clone::Clone;
499        self.next_page_token.clone().unwrap_or_default()
500    }
501}
502
503/// A DNSSEC key pair.
504#[derive(Clone, Default, PartialEq)]
505#[non_exhaustive]
506pub struct DnsKey {
507    /// String mnemonic specifying the DNSSEC algorithm of this key. Immutable after creation time.
508    pub algorithm: std::option::Option<crate::model::dns_key::Algorithm>,
509
510    /// The time that this resource was created in the control plane. This is in RFC3339 text format. Output only.
511    pub creation_time: std::option::Option<std::string::String>,
512
513    /// A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the resource's function.
514    pub description: std::option::Option<std::string::String>,
515
516    /// Cryptographic hashes of the DNSKEY resource record associated with this DnsKey. These digests are needed to construct a DS record that points at this DNS key. Output only.
517    pub digests: std::vec::Vec<crate::model::DnsKeyDigest>,
518
519    /// Unique identifier for the resource; defined by the server (output only).
520    pub id: std::option::Option<std::string::String>,
521
522    /// Active keys are used to sign subsequent changes to the ManagedZone. Inactive keys are still present as DNSKEY Resource Records for the use of resolvers validating existing signatures.
523    pub is_active: std::option::Option<bool>,
524
525    /// Length of the key in bits. Specified at creation time, and then immutable.
526    pub key_length: std::option::Option<u32>,
527
528    /// The key tag is a non-cryptographic hash of the a DNSKEY resource record associated with this DnsKey. The key tag can be used to identify a DNSKEY more quickly (but it is not a unique identifier). In particular, the key tag is used in a parent zone's DS record to point at the DNSKEY in this child ManagedZone. The key tag is a number in the range [0, 65535] and the algorithm to calculate it is specified in RFC4034 Appendix B. Output only.
529    pub key_tag: std::option::Option<i32>,
530
531    #[allow(missing_docs)]
532    pub kind: std::option::Option<std::string::String>,
533
534    /// Base64 encoded public half of this key. Output only.
535    pub public_key: std::option::Option<std::string::String>,
536
537    /// One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type KEY_SIGNING have the Secure Entry Point flag set and, when active, are used to sign only resource record sets of type DNSKEY. Otherwise, the Secure Entry Point flag is cleared, and this key is used to sign only resource record sets of other types. Immutable after creation time.
538    pub r#type: std::option::Option<crate::model::dns_key::Type>,
539
540    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
541}
542
543impl DnsKey {
544    /// Creates a new default instance.
545    pub fn new() -> Self {
546        std::default::Default::default()
547    }
548
549    /// Sets the value of [algorithm][crate::model::DnsKey::algorithm].
550    ///
551    /// # Example
552    /// ```ignore,no_run
553    /// # use google_cloud_dns_v1::model::DnsKey;
554    /// use google_cloud_dns_v1::model::dns_key::Algorithm;
555    /// let x0 = DnsKey::new().set_algorithm(Algorithm::Rsasha256);
556    /// let x1 = DnsKey::new().set_algorithm(Algorithm::Rsasha512);
557    /// let x2 = DnsKey::new().set_algorithm(Algorithm::Ecdsap256Sha256);
558    /// ```
559    pub fn set_algorithm<T>(mut self, v: T) -> Self
560    where
561        T: std::convert::Into<crate::model::dns_key::Algorithm>,
562    {
563        self.algorithm = std::option::Option::Some(v.into());
564        self
565    }
566
567    /// Sets or clears the value of [algorithm][crate::model::DnsKey::algorithm].
568    ///
569    /// # Example
570    /// ```ignore,no_run
571    /// # use google_cloud_dns_v1::model::DnsKey;
572    /// use google_cloud_dns_v1::model::dns_key::Algorithm;
573    /// let x0 = DnsKey::new().set_or_clear_algorithm(Some(Algorithm::Rsasha256));
574    /// let x1 = DnsKey::new().set_or_clear_algorithm(Some(Algorithm::Rsasha512));
575    /// let x2 = DnsKey::new().set_or_clear_algorithm(Some(Algorithm::Ecdsap256Sha256));
576    /// let x_none = DnsKey::new().set_or_clear_algorithm(None::<Algorithm>);
577    /// ```
578    pub fn set_or_clear_algorithm<T>(mut self, v: std::option::Option<T>) -> Self
579    where
580        T: std::convert::Into<crate::model::dns_key::Algorithm>,
581    {
582        self.algorithm = v.map(|x| x.into());
583        self
584    }
585
586    /// Sets the value of [creation_time][crate::model::DnsKey::creation_time].
587    ///
588    /// # Example
589    /// ```ignore,no_run
590    /// # use google_cloud_dns_v1::model::DnsKey;
591    /// let x = DnsKey::new().set_creation_time("example");
592    /// ```
593    pub fn set_creation_time<T>(mut self, v: T) -> Self
594    where
595        T: std::convert::Into<std::string::String>,
596    {
597        self.creation_time = std::option::Option::Some(v.into());
598        self
599    }
600
601    /// Sets or clears the value of [creation_time][crate::model::DnsKey::creation_time].
602    ///
603    /// # Example
604    /// ```ignore,no_run
605    /// # use google_cloud_dns_v1::model::DnsKey;
606    /// let x = DnsKey::new().set_or_clear_creation_time(Some("example"));
607    /// let x = DnsKey::new().set_or_clear_creation_time(None::<String>);
608    /// ```
609    pub fn set_or_clear_creation_time<T>(mut self, v: std::option::Option<T>) -> Self
610    where
611        T: std::convert::Into<std::string::String>,
612    {
613        self.creation_time = v.map(|x| x.into());
614        self
615    }
616
617    /// Sets the value of [description][crate::model::DnsKey::description].
618    ///
619    /// # Example
620    /// ```ignore,no_run
621    /// # use google_cloud_dns_v1::model::DnsKey;
622    /// let x = DnsKey::new().set_description("example");
623    /// ```
624    pub fn set_description<T>(mut self, v: T) -> Self
625    where
626        T: std::convert::Into<std::string::String>,
627    {
628        self.description = std::option::Option::Some(v.into());
629        self
630    }
631
632    /// Sets or clears the value of [description][crate::model::DnsKey::description].
633    ///
634    /// # Example
635    /// ```ignore,no_run
636    /// # use google_cloud_dns_v1::model::DnsKey;
637    /// let x = DnsKey::new().set_or_clear_description(Some("example"));
638    /// let x = DnsKey::new().set_or_clear_description(None::<String>);
639    /// ```
640    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
641    where
642        T: std::convert::Into<std::string::String>,
643    {
644        self.description = v.map(|x| x.into());
645        self
646    }
647
648    /// Sets the value of [digests][crate::model::DnsKey::digests].
649    ///
650    /// # Example
651    /// ```ignore,no_run
652    /// # use google_cloud_dns_v1::model::DnsKey;
653    /// use google_cloud_dns_v1::model::DnsKeyDigest;
654    /// let x = DnsKey::new()
655    ///     .set_digests([
656    ///         DnsKeyDigest::default()/* use setters */,
657    ///         DnsKeyDigest::default()/* use (different) setters */,
658    ///     ]);
659    /// ```
660    pub fn set_digests<T, V>(mut self, v: T) -> Self
661    where
662        T: std::iter::IntoIterator<Item = V>,
663        V: std::convert::Into<crate::model::DnsKeyDigest>,
664    {
665        use std::iter::Iterator;
666        self.digests = v.into_iter().map(|i| i.into()).collect();
667        self
668    }
669
670    /// Sets the value of [id][crate::model::DnsKey::id].
671    ///
672    /// # Example
673    /// ```ignore,no_run
674    /// # use google_cloud_dns_v1::model::DnsKey;
675    /// let x = DnsKey::new().set_id("example");
676    /// ```
677    pub fn set_id<T>(mut self, v: T) -> Self
678    where
679        T: std::convert::Into<std::string::String>,
680    {
681        self.id = std::option::Option::Some(v.into());
682        self
683    }
684
685    /// Sets or clears the value of [id][crate::model::DnsKey::id].
686    ///
687    /// # Example
688    /// ```ignore,no_run
689    /// # use google_cloud_dns_v1::model::DnsKey;
690    /// let x = DnsKey::new().set_or_clear_id(Some("example"));
691    /// let x = DnsKey::new().set_or_clear_id(None::<String>);
692    /// ```
693    pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
694    where
695        T: std::convert::Into<std::string::String>,
696    {
697        self.id = v.map(|x| x.into());
698        self
699    }
700
701    /// Sets the value of [is_active][crate::model::DnsKey::is_active].
702    ///
703    /// # Example
704    /// ```ignore,no_run
705    /// # use google_cloud_dns_v1::model::DnsKey;
706    /// let x = DnsKey::new().set_is_active(true);
707    /// ```
708    pub fn set_is_active<T>(mut self, v: T) -> Self
709    where
710        T: std::convert::Into<bool>,
711    {
712        self.is_active = std::option::Option::Some(v.into());
713        self
714    }
715
716    /// Sets or clears the value of [is_active][crate::model::DnsKey::is_active].
717    ///
718    /// # Example
719    /// ```ignore,no_run
720    /// # use google_cloud_dns_v1::model::DnsKey;
721    /// let x = DnsKey::new().set_or_clear_is_active(Some(false));
722    /// let x = DnsKey::new().set_or_clear_is_active(None::<bool>);
723    /// ```
724    pub fn set_or_clear_is_active<T>(mut self, v: std::option::Option<T>) -> Self
725    where
726        T: std::convert::Into<bool>,
727    {
728        self.is_active = v.map(|x| x.into());
729        self
730    }
731
732    /// Sets the value of [key_length][crate::model::DnsKey::key_length].
733    ///
734    /// # Example
735    /// ```ignore,no_run
736    /// # use google_cloud_dns_v1::model::DnsKey;
737    /// let x = DnsKey::new().set_key_length(42_u32);
738    /// ```
739    pub fn set_key_length<T>(mut self, v: T) -> Self
740    where
741        T: std::convert::Into<u32>,
742    {
743        self.key_length = std::option::Option::Some(v.into());
744        self
745    }
746
747    /// Sets or clears the value of [key_length][crate::model::DnsKey::key_length].
748    ///
749    /// # Example
750    /// ```ignore,no_run
751    /// # use google_cloud_dns_v1::model::DnsKey;
752    /// let x = DnsKey::new().set_or_clear_key_length(Some(42_u32));
753    /// let x = DnsKey::new().set_or_clear_key_length(None::<u32>);
754    /// ```
755    pub fn set_or_clear_key_length<T>(mut self, v: std::option::Option<T>) -> Self
756    where
757        T: std::convert::Into<u32>,
758    {
759        self.key_length = v.map(|x| x.into());
760        self
761    }
762
763    /// Sets the value of [key_tag][crate::model::DnsKey::key_tag].
764    ///
765    /// # Example
766    /// ```ignore,no_run
767    /// # use google_cloud_dns_v1::model::DnsKey;
768    /// let x = DnsKey::new().set_key_tag(42);
769    /// ```
770    pub fn set_key_tag<T>(mut self, v: T) -> Self
771    where
772        T: std::convert::Into<i32>,
773    {
774        self.key_tag = std::option::Option::Some(v.into());
775        self
776    }
777
778    /// Sets or clears the value of [key_tag][crate::model::DnsKey::key_tag].
779    ///
780    /// # Example
781    /// ```ignore,no_run
782    /// # use google_cloud_dns_v1::model::DnsKey;
783    /// let x = DnsKey::new().set_or_clear_key_tag(Some(42));
784    /// let x = DnsKey::new().set_or_clear_key_tag(None::<i32>);
785    /// ```
786    pub fn set_or_clear_key_tag<T>(mut self, v: std::option::Option<T>) -> Self
787    where
788        T: std::convert::Into<i32>,
789    {
790        self.key_tag = v.map(|x| x.into());
791        self
792    }
793
794    /// Sets the value of [kind][crate::model::DnsKey::kind].
795    ///
796    /// # Example
797    /// ```ignore,no_run
798    /// # use google_cloud_dns_v1::model::DnsKey;
799    /// let x = DnsKey::new().set_kind("example");
800    /// ```
801    pub fn set_kind<T>(mut self, v: T) -> Self
802    where
803        T: std::convert::Into<std::string::String>,
804    {
805        self.kind = std::option::Option::Some(v.into());
806        self
807    }
808
809    /// Sets or clears the value of [kind][crate::model::DnsKey::kind].
810    ///
811    /// # Example
812    /// ```ignore,no_run
813    /// # use google_cloud_dns_v1::model::DnsKey;
814    /// let x = DnsKey::new().set_or_clear_kind(Some("example"));
815    /// let x = DnsKey::new().set_or_clear_kind(None::<String>);
816    /// ```
817    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
818    where
819        T: std::convert::Into<std::string::String>,
820    {
821        self.kind = v.map(|x| x.into());
822        self
823    }
824
825    /// Sets the value of [public_key][crate::model::DnsKey::public_key].
826    ///
827    /// # Example
828    /// ```ignore,no_run
829    /// # use google_cloud_dns_v1::model::DnsKey;
830    /// let x = DnsKey::new().set_public_key("example");
831    /// ```
832    pub fn set_public_key<T>(mut self, v: T) -> Self
833    where
834        T: std::convert::Into<std::string::String>,
835    {
836        self.public_key = std::option::Option::Some(v.into());
837        self
838    }
839
840    /// Sets or clears the value of [public_key][crate::model::DnsKey::public_key].
841    ///
842    /// # Example
843    /// ```ignore,no_run
844    /// # use google_cloud_dns_v1::model::DnsKey;
845    /// let x = DnsKey::new().set_or_clear_public_key(Some("example"));
846    /// let x = DnsKey::new().set_or_clear_public_key(None::<String>);
847    /// ```
848    pub fn set_or_clear_public_key<T>(mut self, v: std::option::Option<T>) -> Self
849    where
850        T: std::convert::Into<std::string::String>,
851    {
852        self.public_key = v.map(|x| x.into());
853        self
854    }
855
856    /// Sets the value of [r#type][crate::model::DnsKey::type].
857    ///
858    /// # Example
859    /// ```ignore,no_run
860    /// # use google_cloud_dns_v1::model::DnsKey;
861    /// use google_cloud_dns_v1::model::dns_key::Type;
862    /// let x0 = DnsKey::new().set_type(Type::ZoneSigning);
863    /// ```
864    pub fn set_type<T>(mut self, v: T) -> Self
865    where
866        T: std::convert::Into<crate::model::dns_key::Type>,
867    {
868        self.r#type = std::option::Option::Some(v.into());
869        self
870    }
871
872    /// Sets or clears the value of [r#type][crate::model::DnsKey::type].
873    ///
874    /// # Example
875    /// ```ignore,no_run
876    /// # use google_cloud_dns_v1::model::DnsKey;
877    /// use google_cloud_dns_v1::model::dns_key::Type;
878    /// let x0 = DnsKey::new().set_or_clear_type(Some(Type::ZoneSigning));
879    /// let x_none = DnsKey::new().set_or_clear_type(None::<Type>);
880    /// ```
881    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
882    where
883        T: std::convert::Into<crate::model::dns_key::Type>,
884    {
885        self.r#type = v.map(|x| x.into());
886        self
887    }
888}
889
890impl wkt::message::Message for DnsKey {
891    fn typename() -> &'static str {
892        "type.googleapis.com/.DnsKey"
893    }
894}
895
896/// Defines additional types related to [DnsKey].
897pub mod dns_key {
898    #[allow(unused_imports)]
899    use super::*;
900
901    /// The enumerated type for the [algorithm][.DnsKey.algorithm] field.
902    ///
903    /// # Working with unknown values
904    ///
905    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
906    /// additional enum variants at any time. Adding new variants is not considered
907    /// a breaking change. Applications should write their code in anticipation of:
908    ///
909    /// - New values appearing in future releases of the client library, **and**
910    /// - New values received dynamically, without application changes.
911    ///
912    /// Please consult the [Working with enums] section in the user guide for some
913    /// guidelines.
914    ///
915    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
916    #[derive(Clone, Debug, PartialEq)]
917    #[non_exhaustive]
918    pub enum Algorithm {
919        #[allow(missing_docs)]
920        Rsasha1,
921        #[allow(missing_docs)]
922        Rsasha256,
923        #[allow(missing_docs)]
924        Rsasha512,
925        #[allow(missing_docs)]
926        Ecdsap256Sha256,
927        #[allow(missing_docs)]
928        Ecdsap384Sha384,
929        /// If set, the enum was initialized with an unknown value.
930        ///
931        /// Applications can examine the value using [Algorithm::name].
932        UnknownValue(algorithm::UnknownValue),
933    }
934
935    #[doc(hidden)]
936    pub mod algorithm {
937        #[allow(unused_imports)]
938        use super::*;
939        #[derive(Clone, Debug, PartialEq)]
940        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
941    }
942
943    impl Algorithm {
944        /// Gets the enum value as a string.
945        pub fn name(&self) -> std::option::Option<&str> {
946            match self {
947                Self::Rsasha1 => std::option::Option::Some("rsasha1"),
948                Self::Rsasha256 => std::option::Option::Some("rsasha256"),
949                Self::Rsasha512 => std::option::Option::Some("rsasha512"),
950                Self::Ecdsap256Sha256 => std::option::Option::Some("ecdsap256sha256"),
951                Self::Ecdsap384Sha384 => std::option::Option::Some("ecdsap384sha384"),
952                Self::UnknownValue(u) => u.0.name(),
953            }
954        }
955    }
956
957    impl std::fmt::Display for Algorithm {
958        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
959            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
960        }
961    }
962
963    impl std::convert::From<&str> for Algorithm {
964        fn from(value: &str) -> Self {
965            use std::string::ToString;
966            match value {
967                "rsasha1" => Self::Rsasha1,
968                "rsasha256" => Self::Rsasha256,
969                "rsasha512" => Self::Rsasha512,
970                "ecdsap256sha256" => Self::Ecdsap256Sha256,
971                "ecdsap384sha384" => Self::Ecdsap384Sha384,
972                _ => Self::UnknownValue(algorithm::UnknownValue(
973                    wkt::internal::UnknownEnumValue::String(value.to_string()),
974                )),
975            }
976        }
977    }
978
979    impl serde::ser::Serialize for Algorithm {
980        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
981        where
982            S: serde::Serializer,
983        {
984            match self {
985                Self::Rsasha1 => serializer.serialize_str("rsasha1"),
986                Self::Rsasha256 => serializer.serialize_str("rsasha256"),
987                Self::Rsasha512 => serializer.serialize_str("rsasha512"),
988                Self::Ecdsap256Sha256 => serializer.serialize_str("ecdsap256sha256"),
989                Self::Ecdsap384Sha384 => serializer.serialize_str("ecdsap384sha384"),
990                Self::UnknownValue(u) => u.0.serialize(serializer),
991            }
992        }
993    }
994
995    impl<'de> serde::de::Deserialize<'de> for Algorithm {
996        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
997        where
998            D: serde::Deserializer<'de>,
999        {
1000            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<Algorithm>::new(
1001                "..DnsKey.algorithm",
1002            ))
1003        }
1004    }
1005
1006    /// The enumerated type for the [type][.DnsKey.type] field.
1007    ///
1008    /// # Working with unknown values
1009    ///
1010    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1011    /// additional enum variants at any time. Adding new variants is not considered
1012    /// a breaking change. Applications should write their code in anticipation of:
1013    ///
1014    /// - New values appearing in future releases of the client library, **and**
1015    /// - New values received dynamically, without application changes.
1016    ///
1017    /// Please consult the [Working with enums] section in the user guide for some
1018    /// guidelines.
1019    ///
1020    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1021    #[derive(Clone, Debug, PartialEq)]
1022    #[non_exhaustive]
1023    pub enum Type {
1024        #[allow(missing_docs)]
1025        KeySigning,
1026        #[allow(missing_docs)]
1027        ZoneSigning,
1028        /// If set, the enum was initialized with an unknown value.
1029        ///
1030        /// Applications can examine the value using [Type::name].
1031        UnknownValue(r#type::UnknownValue),
1032    }
1033
1034    #[doc(hidden)]
1035    pub mod r#type {
1036        #[allow(unused_imports)]
1037        use super::*;
1038        #[derive(Clone, Debug, PartialEq)]
1039        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1040    }
1041
1042    impl Type {
1043        /// Gets the enum value as a string.
1044        pub fn name(&self) -> std::option::Option<&str> {
1045            match self {
1046                Self::KeySigning => std::option::Option::Some("keySigning"),
1047                Self::ZoneSigning => std::option::Option::Some("zoneSigning"),
1048                Self::UnknownValue(u) => u.0.name(),
1049            }
1050        }
1051    }
1052
1053    impl std::fmt::Display for Type {
1054        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1055            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
1056        }
1057    }
1058
1059    impl std::convert::From<&str> for Type {
1060        fn from(value: &str) -> Self {
1061            use std::string::ToString;
1062            match value {
1063                "keySigning" => Self::KeySigning,
1064                "zoneSigning" => Self::ZoneSigning,
1065                _ => Self::UnknownValue(r#type::UnknownValue(
1066                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1067                )),
1068            }
1069        }
1070    }
1071
1072    impl serde::ser::Serialize for Type {
1073        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1074        where
1075            S: serde::Serializer,
1076        {
1077            match self {
1078                Self::KeySigning => serializer.serialize_str("keySigning"),
1079                Self::ZoneSigning => serializer.serialize_str("zoneSigning"),
1080                Self::UnknownValue(u) => u.0.serialize(serializer),
1081            }
1082        }
1083    }
1084
1085    impl<'de> serde::de::Deserialize<'de> for Type {
1086        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1087        where
1088            D: serde::Deserializer<'de>,
1089        {
1090            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<Type>::new(
1091                "..DnsKey.type",
1092            ))
1093        }
1094    }
1095}
1096
1097#[allow(missing_docs)]
1098#[derive(Clone, Default, PartialEq)]
1099#[non_exhaustive]
1100pub struct DnsKeyDigest {
1101    /// The base-16 encoded bytes of this digest. Suitable for use in a DS resource record.
1102    pub digest: std::option::Option<std::string::String>,
1103
1104    /// Specifies the algorithm used to calculate this digest.
1105    pub r#type: std::option::Option<crate::model::dns_key_digest::Type>,
1106
1107    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1108}
1109
1110impl DnsKeyDigest {
1111    /// Creates a new default instance.
1112    pub fn new() -> Self {
1113        std::default::Default::default()
1114    }
1115
1116    /// Sets the value of [digest][crate::model::DnsKeyDigest::digest].
1117    ///
1118    /// # Example
1119    /// ```ignore,no_run
1120    /// # use google_cloud_dns_v1::model::DnsKeyDigest;
1121    /// let x = DnsKeyDigest::new().set_digest("example");
1122    /// ```
1123    pub fn set_digest<T>(mut self, v: T) -> Self
1124    where
1125        T: std::convert::Into<std::string::String>,
1126    {
1127        self.digest = std::option::Option::Some(v.into());
1128        self
1129    }
1130
1131    /// Sets or clears the value of [digest][crate::model::DnsKeyDigest::digest].
1132    ///
1133    /// # Example
1134    /// ```ignore,no_run
1135    /// # use google_cloud_dns_v1::model::DnsKeyDigest;
1136    /// let x = DnsKeyDigest::new().set_or_clear_digest(Some("example"));
1137    /// let x = DnsKeyDigest::new().set_or_clear_digest(None::<String>);
1138    /// ```
1139    pub fn set_or_clear_digest<T>(mut self, v: std::option::Option<T>) -> Self
1140    where
1141        T: std::convert::Into<std::string::String>,
1142    {
1143        self.digest = v.map(|x| x.into());
1144        self
1145    }
1146
1147    /// Sets the value of [r#type][crate::model::DnsKeyDigest::type].
1148    ///
1149    /// # Example
1150    /// ```ignore,no_run
1151    /// # use google_cloud_dns_v1::model::DnsKeyDigest;
1152    /// use google_cloud_dns_v1::model::dns_key_digest::Type;
1153    /// let x0 = DnsKeyDigest::new().set_type(Type::Sha256);
1154    /// let x1 = DnsKeyDigest::new().set_type(Type::Sha384);
1155    /// ```
1156    pub fn set_type<T>(mut self, v: T) -> Self
1157    where
1158        T: std::convert::Into<crate::model::dns_key_digest::Type>,
1159    {
1160        self.r#type = std::option::Option::Some(v.into());
1161        self
1162    }
1163
1164    /// Sets or clears the value of [r#type][crate::model::DnsKeyDigest::type].
1165    ///
1166    /// # Example
1167    /// ```ignore,no_run
1168    /// # use google_cloud_dns_v1::model::DnsKeyDigest;
1169    /// use google_cloud_dns_v1::model::dns_key_digest::Type;
1170    /// let x0 = DnsKeyDigest::new().set_or_clear_type(Some(Type::Sha256));
1171    /// let x1 = DnsKeyDigest::new().set_or_clear_type(Some(Type::Sha384));
1172    /// let x_none = DnsKeyDigest::new().set_or_clear_type(None::<Type>);
1173    /// ```
1174    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
1175    where
1176        T: std::convert::Into<crate::model::dns_key_digest::Type>,
1177    {
1178        self.r#type = v.map(|x| x.into());
1179        self
1180    }
1181}
1182
1183impl wkt::message::Message for DnsKeyDigest {
1184    fn typename() -> &'static str {
1185        "type.googleapis.com/.DnsKeyDigest"
1186    }
1187}
1188
1189/// Defines additional types related to [DnsKeyDigest].
1190pub mod dns_key_digest {
1191    #[allow(unused_imports)]
1192    use super::*;
1193
1194    /// The enumerated type for the [type][.DnsKeyDigest.type] field.
1195    ///
1196    /// # Working with unknown values
1197    ///
1198    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1199    /// additional enum variants at any time. Adding new variants is not considered
1200    /// a breaking change. Applications should write their code in anticipation of:
1201    ///
1202    /// - New values appearing in future releases of the client library, **and**
1203    /// - New values received dynamically, without application changes.
1204    ///
1205    /// Please consult the [Working with enums] section in the user guide for some
1206    /// guidelines.
1207    ///
1208    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1209    #[derive(Clone, Debug, PartialEq)]
1210    #[non_exhaustive]
1211    pub enum Type {
1212        #[allow(missing_docs)]
1213        Sha1,
1214        #[allow(missing_docs)]
1215        Sha256,
1216        #[allow(missing_docs)]
1217        Sha384,
1218        /// If set, the enum was initialized with an unknown value.
1219        ///
1220        /// Applications can examine the value using [Type::name].
1221        UnknownValue(r#type::UnknownValue),
1222    }
1223
1224    #[doc(hidden)]
1225    pub mod r#type {
1226        #[allow(unused_imports)]
1227        use super::*;
1228        #[derive(Clone, Debug, PartialEq)]
1229        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1230    }
1231
1232    impl Type {
1233        /// Gets the enum value as a string.
1234        pub fn name(&self) -> std::option::Option<&str> {
1235            match self {
1236                Self::Sha1 => std::option::Option::Some("sha1"),
1237                Self::Sha256 => std::option::Option::Some("sha256"),
1238                Self::Sha384 => std::option::Option::Some("sha384"),
1239                Self::UnknownValue(u) => u.0.name(),
1240            }
1241        }
1242    }
1243
1244    impl std::fmt::Display for Type {
1245        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1246            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
1247        }
1248    }
1249
1250    impl std::convert::From<&str> for Type {
1251        fn from(value: &str) -> Self {
1252            use std::string::ToString;
1253            match value {
1254                "sha1" => Self::Sha1,
1255                "sha256" => Self::Sha256,
1256                "sha384" => Self::Sha384,
1257                _ => Self::UnknownValue(r#type::UnknownValue(
1258                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1259                )),
1260            }
1261        }
1262    }
1263
1264    impl serde::ser::Serialize for Type {
1265        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1266        where
1267            S: serde::Serializer,
1268        {
1269            match self {
1270                Self::Sha1 => serializer.serialize_str("sha1"),
1271                Self::Sha256 => serializer.serialize_str("sha256"),
1272                Self::Sha384 => serializer.serialize_str("sha384"),
1273                Self::UnknownValue(u) => u.0.serialize(serializer),
1274            }
1275        }
1276    }
1277
1278    impl<'de> serde::de::Deserialize<'de> for Type {
1279        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1280        where
1281            D: serde::Deserializer<'de>,
1282        {
1283            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<Type>::new(
1284                "..DnsKeyDigest.type",
1285            ))
1286        }
1287    }
1288}
1289
1290/// Parameters for DnsKey key generation. Used for generating initial keys for a new ManagedZone and as default when adding a new DnsKey.
1291#[derive(Clone, Default, PartialEq)]
1292#[non_exhaustive]
1293pub struct DnsKeySpec {
1294    /// String mnemonic specifying the DNSSEC algorithm of this key.
1295    pub algorithm: std::option::Option<crate::model::dns_key_spec::Algorithm>,
1296
1297    /// Length of the keys in bits.
1298    pub key_length: std::option::Option<u32>,
1299
1300    /// Specifies whether this is a key signing key (KSK) or a zone signing key (ZSK). Key signing keys have the Secure Entry Point flag set and, when active, are only used to sign resource record sets of type DNSKEY. Zone signing keys do not have the Secure Entry Point flag set and are used to sign all other types of resource record sets.
1301    pub key_type: std::option::Option<crate::model::dns_key_spec::KeyType>,
1302
1303    #[allow(missing_docs)]
1304    pub kind: std::option::Option<std::string::String>,
1305
1306    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1307}
1308
1309impl DnsKeySpec {
1310    /// Creates a new default instance.
1311    pub fn new() -> Self {
1312        std::default::Default::default()
1313    }
1314
1315    /// Sets the value of [algorithm][crate::model::DnsKeySpec::algorithm].
1316    ///
1317    /// # Example
1318    /// ```ignore,no_run
1319    /// # use google_cloud_dns_v1::model::DnsKeySpec;
1320    /// use google_cloud_dns_v1::model::dns_key_spec::Algorithm;
1321    /// let x0 = DnsKeySpec::new().set_algorithm(Algorithm::Rsasha256);
1322    /// let x1 = DnsKeySpec::new().set_algorithm(Algorithm::Rsasha512);
1323    /// let x2 = DnsKeySpec::new().set_algorithm(Algorithm::Ecdsap256Sha256);
1324    /// ```
1325    pub fn set_algorithm<T>(mut self, v: T) -> Self
1326    where
1327        T: std::convert::Into<crate::model::dns_key_spec::Algorithm>,
1328    {
1329        self.algorithm = std::option::Option::Some(v.into());
1330        self
1331    }
1332
1333    /// Sets or clears the value of [algorithm][crate::model::DnsKeySpec::algorithm].
1334    ///
1335    /// # Example
1336    /// ```ignore,no_run
1337    /// # use google_cloud_dns_v1::model::DnsKeySpec;
1338    /// use google_cloud_dns_v1::model::dns_key_spec::Algorithm;
1339    /// let x0 = DnsKeySpec::new().set_or_clear_algorithm(Some(Algorithm::Rsasha256));
1340    /// let x1 = DnsKeySpec::new().set_or_clear_algorithm(Some(Algorithm::Rsasha512));
1341    /// let x2 = DnsKeySpec::new().set_or_clear_algorithm(Some(Algorithm::Ecdsap256Sha256));
1342    /// let x_none = DnsKeySpec::new().set_or_clear_algorithm(None::<Algorithm>);
1343    /// ```
1344    pub fn set_or_clear_algorithm<T>(mut self, v: std::option::Option<T>) -> Self
1345    where
1346        T: std::convert::Into<crate::model::dns_key_spec::Algorithm>,
1347    {
1348        self.algorithm = v.map(|x| x.into());
1349        self
1350    }
1351
1352    /// Sets the value of [key_length][crate::model::DnsKeySpec::key_length].
1353    ///
1354    /// # Example
1355    /// ```ignore,no_run
1356    /// # use google_cloud_dns_v1::model::DnsKeySpec;
1357    /// let x = DnsKeySpec::new().set_key_length(42_u32);
1358    /// ```
1359    pub fn set_key_length<T>(mut self, v: T) -> Self
1360    where
1361        T: std::convert::Into<u32>,
1362    {
1363        self.key_length = std::option::Option::Some(v.into());
1364        self
1365    }
1366
1367    /// Sets or clears the value of [key_length][crate::model::DnsKeySpec::key_length].
1368    ///
1369    /// # Example
1370    /// ```ignore,no_run
1371    /// # use google_cloud_dns_v1::model::DnsKeySpec;
1372    /// let x = DnsKeySpec::new().set_or_clear_key_length(Some(42_u32));
1373    /// let x = DnsKeySpec::new().set_or_clear_key_length(None::<u32>);
1374    /// ```
1375    pub fn set_or_clear_key_length<T>(mut self, v: std::option::Option<T>) -> Self
1376    where
1377        T: std::convert::Into<u32>,
1378    {
1379        self.key_length = v.map(|x| x.into());
1380        self
1381    }
1382
1383    /// Sets the value of [key_type][crate::model::DnsKeySpec::key_type].
1384    ///
1385    /// # Example
1386    /// ```ignore,no_run
1387    /// # use google_cloud_dns_v1::model::DnsKeySpec;
1388    /// use google_cloud_dns_v1::model::dns_key_spec::KeyType;
1389    /// let x0 = DnsKeySpec::new().set_key_type(KeyType::ZoneSigning);
1390    /// ```
1391    pub fn set_key_type<T>(mut self, v: T) -> Self
1392    where
1393        T: std::convert::Into<crate::model::dns_key_spec::KeyType>,
1394    {
1395        self.key_type = std::option::Option::Some(v.into());
1396        self
1397    }
1398
1399    /// Sets or clears the value of [key_type][crate::model::DnsKeySpec::key_type].
1400    ///
1401    /// # Example
1402    /// ```ignore,no_run
1403    /// # use google_cloud_dns_v1::model::DnsKeySpec;
1404    /// use google_cloud_dns_v1::model::dns_key_spec::KeyType;
1405    /// let x0 = DnsKeySpec::new().set_or_clear_key_type(Some(KeyType::ZoneSigning));
1406    /// let x_none = DnsKeySpec::new().set_or_clear_key_type(None::<KeyType>);
1407    /// ```
1408    pub fn set_or_clear_key_type<T>(mut self, v: std::option::Option<T>) -> Self
1409    where
1410        T: std::convert::Into<crate::model::dns_key_spec::KeyType>,
1411    {
1412        self.key_type = v.map(|x| x.into());
1413        self
1414    }
1415
1416    /// Sets the value of [kind][crate::model::DnsKeySpec::kind].
1417    ///
1418    /// # Example
1419    /// ```ignore,no_run
1420    /// # use google_cloud_dns_v1::model::DnsKeySpec;
1421    /// let x = DnsKeySpec::new().set_kind("example");
1422    /// ```
1423    pub fn set_kind<T>(mut self, v: T) -> Self
1424    where
1425        T: std::convert::Into<std::string::String>,
1426    {
1427        self.kind = std::option::Option::Some(v.into());
1428        self
1429    }
1430
1431    /// Sets or clears the value of [kind][crate::model::DnsKeySpec::kind].
1432    ///
1433    /// # Example
1434    /// ```ignore,no_run
1435    /// # use google_cloud_dns_v1::model::DnsKeySpec;
1436    /// let x = DnsKeySpec::new().set_or_clear_kind(Some("example"));
1437    /// let x = DnsKeySpec::new().set_or_clear_kind(None::<String>);
1438    /// ```
1439    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
1440    where
1441        T: std::convert::Into<std::string::String>,
1442    {
1443        self.kind = v.map(|x| x.into());
1444        self
1445    }
1446}
1447
1448impl wkt::message::Message for DnsKeySpec {
1449    fn typename() -> &'static str {
1450        "type.googleapis.com/.DnsKeySpec"
1451    }
1452}
1453
1454/// Defines additional types related to [DnsKeySpec].
1455pub mod dns_key_spec {
1456    #[allow(unused_imports)]
1457    use super::*;
1458
1459    /// The enumerated type for the [algorithm][.DnsKeySpec.algorithm] field.
1460    ///
1461    /// # Working with unknown values
1462    ///
1463    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1464    /// additional enum variants at any time. Adding new variants is not considered
1465    /// a breaking change. Applications should write their code in anticipation of:
1466    ///
1467    /// - New values appearing in future releases of the client library, **and**
1468    /// - New values received dynamically, without application changes.
1469    ///
1470    /// Please consult the [Working with enums] section in the user guide for some
1471    /// guidelines.
1472    ///
1473    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1474    #[derive(Clone, Debug, PartialEq)]
1475    #[non_exhaustive]
1476    pub enum Algorithm {
1477        #[allow(missing_docs)]
1478        Rsasha1,
1479        #[allow(missing_docs)]
1480        Rsasha256,
1481        #[allow(missing_docs)]
1482        Rsasha512,
1483        #[allow(missing_docs)]
1484        Ecdsap256Sha256,
1485        #[allow(missing_docs)]
1486        Ecdsap384Sha384,
1487        /// If set, the enum was initialized with an unknown value.
1488        ///
1489        /// Applications can examine the value using [Algorithm::name].
1490        UnknownValue(algorithm::UnknownValue),
1491    }
1492
1493    #[doc(hidden)]
1494    pub mod algorithm {
1495        #[allow(unused_imports)]
1496        use super::*;
1497        #[derive(Clone, Debug, PartialEq)]
1498        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1499    }
1500
1501    impl Algorithm {
1502        /// Gets the enum value as a string.
1503        pub fn name(&self) -> std::option::Option<&str> {
1504            match self {
1505                Self::Rsasha1 => std::option::Option::Some("rsasha1"),
1506                Self::Rsasha256 => std::option::Option::Some("rsasha256"),
1507                Self::Rsasha512 => std::option::Option::Some("rsasha512"),
1508                Self::Ecdsap256Sha256 => std::option::Option::Some("ecdsap256sha256"),
1509                Self::Ecdsap384Sha384 => std::option::Option::Some("ecdsap384sha384"),
1510                Self::UnknownValue(u) => u.0.name(),
1511            }
1512        }
1513    }
1514
1515    impl std::fmt::Display for Algorithm {
1516        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1517            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
1518        }
1519    }
1520
1521    impl std::convert::From<&str> for Algorithm {
1522        fn from(value: &str) -> Self {
1523            use std::string::ToString;
1524            match value {
1525                "rsasha1" => Self::Rsasha1,
1526                "rsasha256" => Self::Rsasha256,
1527                "rsasha512" => Self::Rsasha512,
1528                "ecdsap256sha256" => Self::Ecdsap256Sha256,
1529                "ecdsap384sha384" => Self::Ecdsap384Sha384,
1530                _ => Self::UnknownValue(algorithm::UnknownValue(
1531                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1532                )),
1533            }
1534        }
1535    }
1536
1537    impl serde::ser::Serialize for Algorithm {
1538        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1539        where
1540            S: serde::Serializer,
1541        {
1542            match self {
1543                Self::Rsasha1 => serializer.serialize_str("rsasha1"),
1544                Self::Rsasha256 => serializer.serialize_str("rsasha256"),
1545                Self::Rsasha512 => serializer.serialize_str("rsasha512"),
1546                Self::Ecdsap256Sha256 => serializer.serialize_str("ecdsap256sha256"),
1547                Self::Ecdsap384Sha384 => serializer.serialize_str("ecdsap384sha384"),
1548                Self::UnknownValue(u) => u.0.serialize(serializer),
1549            }
1550        }
1551    }
1552
1553    impl<'de> serde::de::Deserialize<'de> for Algorithm {
1554        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1555        where
1556            D: serde::Deserializer<'de>,
1557        {
1558            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<Algorithm>::new(
1559                "..DnsKeySpec.algorithm",
1560            ))
1561        }
1562    }
1563
1564    /// The enumerated type for the [keyType][.DnsKeySpec.keyType] field.
1565    ///
1566    /// # Working with unknown values
1567    ///
1568    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1569    /// additional enum variants at any time. Adding new variants is not considered
1570    /// a breaking change. Applications should write their code in anticipation of:
1571    ///
1572    /// - New values appearing in future releases of the client library, **and**
1573    /// - New values received dynamically, without application changes.
1574    ///
1575    /// Please consult the [Working with enums] section in the user guide for some
1576    /// guidelines.
1577    ///
1578    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1579    #[derive(Clone, Debug, PartialEq)]
1580    #[non_exhaustive]
1581    pub enum KeyType {
1582        #[allow(missing_docs)]
1583        KeySigning,
1584        #[allow(missing_docs)]
1585        ZoneSigning,
1586        /// If set, the enum was initialized with an unknown value.
1587        ///
1588        /// Applications can examine the value using [KeyType::name].
1589        UnknownValue(key_type::UnknownValue),
1590    }
1591
1592    #[doc(hidden)]
1593    pub mod key_type {
1594        #[allow(unused_imports)]
1595        use super::*;
1596        #[derive(Clone, Debug, PartialEq)]
1597        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1598    }
1599
1600    impl KeyType {
1601        /// Gets the enum value as a string.
1602        pub fn name(&self) -> std::option::Option<&str> {
1603            match self {
1604                Self::KeySigning => std::option::Option::Some("keySigning"),
1605                Self::ZoneSigning => std::option::Option::Some("zoneSigning"),
1606                Self::UnknownValue(u) => u.0.name(),
1607            }
1608        }
1609    }
1610
1611    impl std::fmt::Display for KeyType {
1612        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1613            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
1614        }
1615    }
1616
1617    impl std::convert::From<&str> for KeyType {
1618        fn from(value: &str) -> Self {
1619            use std::string::ToString;
1620            match value {
1621                "keySigning" => Self::KeySigning,
1622                "zoneSigning" => Self::ZoneSigning,
1623                _ => Self::UnknownValue(key_type::UnknownValue(
1624                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1625                )),
1626            }
1627        }
1628    }
1629
1630    impl serde::ser::Serialize for KeyType {
1631        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1632        where
1633            S: serde::Serializer,
1634        {
1635            match self {
1636                Self::KeySigning => serializer.serialize_str("keySigning"),
1637                Self::ZoneSigning => serializer.serialize_str("zoneSigning"),
1638                Self::UnknownValue(u) => u.0.serialize(serializer),
1639            }
1640        }
1641    }
1642
1643    impl<'de> serde::de::Deserialize<'de> for KeyType {
1644        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1645        where
1646            D: serde::Deserializer<'de>,
1647        {
1648            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<KeyType>::new(
1649                "..DnsKeySpec.keyType",
1650            ))
1651        }
1652    }
1653}
1654
1655/// The response to a request to enumerate DnsKeys in a ManagedZone.
1656#[derive(Clone, Default, PartialEq)]
1657#[non_exhaustive]
1658pub struct DnsKeysListResponse {
1659    /// The requested resources.
1660    pub dns_keys: std::vec::Vec<crate::model::DnsKey>,
1661
1662    /// Output only. Type of resource.
1663    pub kind: std::option::Option<std::string::String>,
1664
1665    /// This field indicates that more results are available beyond the last page displayed. To fetch the results, make another list request and use this value as your page token. This lets you retrieve the complete contents of a very large collection one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned are an inconsistent view of the collection. You can't retrieve a consistent snapshot of a collection larger than the maximum page size.
1666    pub next_page_token: std::option::Option<std::string::String>,
1667
1668    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1669}
1670
1671impl DnsKeysListResponse {
1672    /// Creates a new default instance.
1673    pub fn new() -> Self {
1674        std::default::Default::default()
1675    }
1676
1677    /// Sets the value of [dns_keys][crate::model::DnsKeysListResponse::dns_keys].
1678    ///
1679    /// # Example
1680    /// ```ignore,no_run
1681    /// # use google_cloud_dns_v1::model::DnsKeysListResponse;
1682    /// use google_cloud_dns_v1::model::DnsKey;
1683    /// let x = DnsKeysListResponse::new()
1684    ///     .set_dns_keys([
1685    ///         DnsKey::default()/* use setters */,
1686    ///         DnsKey::default()/* use (different) setters */,
1687    ///     ]);
1688    /// ```
1689    pub fn set_dns_keys<T, V>(mut self, v: T) -> Self
1690    where
1691        T: std::iter::IntoIterator<Item = V>,
1692        V: std::convert::Into<crate::model::DnsKey>,
1693    {
1694        use std::iter::Iterator;
1695        self.dns_keys = v.into_iter().map(|i| i.into()).collect();
1696        self
1697    }
1698
1699    /// Sets the value of [kind][crate::model::DnsKeysListResponse::kind].
1700    ///
1701    /// # Example
1702    /// ```ignore,no_run
1703    /// # use google_cloud_dns_v1::model::DnsKeysListResponse;
1704    /// let x = DnsKeysListResponse::new().set_kind("example");
1705    /// ```
1706    pub fn set_kind<T>(mut self, v: T) -> Self
1707    where
1708        T: std::convert::Into<std::string::String>,
1709    {
1710        self.kind = std::option::Option::Some(v.into());
1711        self
1712    }
1713
1714    /// Sets or clears the value of [kind][crate::model::DnsKeysListResponse::kind].
1715    ///
1716    /// # Example
1717    /// ```ignore,no_run
1718    /// # use google_cloud_dns_v1::model::DnsKeysListResponse;
1719    /// let x = DnsKeysListResponse::new().set_or_clear_kind(Some("example"));
1720    /// let x = DnsKeysListResponse::new().set_or_clear_kind(None::<String>);
1721    /// ```
1722    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
1723    where
1724        T: std::convert::Into<std::string::String>,
1725    {
1726        self.kind = v.map(|x| x.into());
1727        self
1728    }
1729
1730    /// Sets the value of [next_page_token][crate::model::DnsKeysListResponse::next_page_token].
1731    ///
1732    /// # Example
1733    /// ```ignore,no_run
1734    /// # use google_cloud_dns_v1::model::DnsKeysListResponse;
1735    /// let x = DnsKeysListResponse::new().set_next_page_token("example");
1736    /// ```
1737    pub fn set_next_page_token<T>(mut self, v: T) -> Self
1738    where
1739        T: std::convert::Into<std::string::String>,
1740    {
1741        self.next_page_token = std::option::Option::Some(v.into());
1742        self
1743    }
1744
1745    /// Sets or clears the value of [next_page_token][crate::model::DnsKeysListResponse::next_page_token].
1746    ///
1747    /// # Example
1748    /// ```ignore,no_run
1749    /// # use google_cloud_dns_v1::model::DnsKeysListResponse;
1750    /// let x = DnsKeysListResponse::new().set_or_clear_next_page_token(Some("example"));
1751    /// let x = DnsKeysListResponse::new().set_or_clear_next_page_token(None::<String>);
1752    /// ```
1753    pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
1754    where
1755        T: std::convert::Into<std::string::String>,
1756    {
1757        self.next_page_token = v.map(|x| x.into());
1758        self
1759    }
1760}
1761
1762impl wkt::message::Message for DnsKeysListResponse {
1763    fn typename() -> &'static str {
1764        "type.googleapis.com/.DnsKeysListResponse"
1765    }
1766}
1767
1768#[doc(hidden)]
1769impl google_cloud_gax::paginator::internal::PageableResponse for DnsKeysListResponse {
1770    type PageItem = crate::model::DnsKey;
1771
1772    fn items(self) -> std::vec::Vec<Self::PageItem> {
1773        self.dns_keys
1774    }
1775
1776    fn next_page_token(&self) -> std::string::String {
1777        use std::clone::Clone;
1778        self.next_page_token.clone().unwrap_or_default()
1779    }
1780}
1781
1782/// Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at <https://github.com/google/cel-spec>. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1783#[derive(Clone, Default, PartialEq)]
1784#[non_exhaustive]
1785pub struct Expr {
1786    /// Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1787    pub description: std::option::Option<std::string::String>,
1788
1789    /// Textual representation of an expression in Common Expression Language syntax.
1790    pub expression: std::option::Option<std::string::String>,
1791
1792    /// Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1793    pub location: std::option::Option<std::string::String>,
1794
1795    /// Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
1796    pub title: std::option::Option<std::string::String>,
1797
1798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1799}
1800
1801impl Expr {
1802    /// Creates a new default instance.
1803    pub fn new() -> Self {
1804        std::default::Default::default()
1805    }
1806
1807    /// Sets the value of [description][crate::model::Expr::description].
1808    ///
1809    /// # Example
1810    /// ```ignore,no_run
1811    /// # use google_cloud_dns_v1::model::Expr;
1812    /// let x = Expr::new().set_description("example");
1813    /// ```
1814    pub fn set_description<T>(mut self, v: T) -> Self
1815    where
1816        T: std::convert::Into<std::string::String>,
1817    {
1818        self.description = std::option::Option::Some(v.into());
1819        self
1820    }
1821
1822    /// Sets or clears the value of [description][crate::model::Expr::description].
1823    ///
1824    /// # Example
1825    /// ```ignore,no_run
1826    /// # use google_cloud_dns_v1::model::Expr;
1827    /// let x = Expr::new().set_or_clear_description(Some("example"));
1828    /// let x = Expr::new().set_or_clear_description(None::<String>);
1829    /// ```
1830    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
1831    where
1832        T: std::convert::Into<std::string::String>,
1833    {
1834        self.description = v.map(|x| x.into());
1835        self
1836    }
1837
1838    /// Sets the value of [expression][crate::model::Expr::expression].
1839    ///
1840    /// # Example
1841    /// ```ignore,no_run
1842    /// # use google_cloud_dns_v1::model::Expr;
1843    /// let x = Expr::new().set_expression("example");
1844    /// ```
1845    pub fn set_expression<T>(mut self, v: T) -> Self
1846    where
1847        T: std::convert::Into<std::string::String>,
1848    {
1849        self.expression = std::option::Option::Some(v.into());
1850        self
1851    }
1852
1853    /// Sets or clears the value of [expression][crate::model::Expr::expression].
1854    ///
1855    /// # Example
1856    /// ```ignore,no_run
1857    /// # use google_cloud_dns_v1::model::Expr;
1858    /// let x = Expr::new().set_or_clear_expression(Some("example"));
1859    /// let x = Expr::new().set_or_clear_expression(None::<String>);
1860    /// ```
1861    pub fn set_or_clear_expression<T>(mut self, v: std::option::Option<T>) -> Self
1862    where
1863        T: std::convert::Into<std::string::String>,
1864    {
1865        self.expression = v.map(|x| x.into());
1866        self
1867    }
1868
1869    /// Sets the value of [location][crate::model::Expr::location].
1870    ///
1871    /// # Example
1872    /// ```ignore,no_run
1873    /// # use google_cloud_dns_v1::model::Expr;
1874    /// let x = Expr::new().set_location("example");
1875    /// ```
1876    pub fn set_location<T>(mut self, v: T) -> Self
1877    where
1878        T: std::convert::Into<std::string::String>,
1879    {
1880        self.location = std::option::Option::Some(v.into());
1881        self
1882    }
1883
1884    /// Sets or clears the value of [location][crate::model::Expr::location].
1885    ///
1886    /// # Example
1887    /// ```ignore,no_run
1888    /// # use google_cloud_dns_v1::model::Expr;
1889    /// let x = Expr::new().set_or_clear_location(Some("example"));
1890    /// let x = Expr::new().set_or_clear_location(None::<String>);
1891    /// ```
1892    pub fn set_or_clear_location<T>(mut self, v: std::option::Option<T>) -> Self
1893    where
1894        T: std::convert::Into<std::string::String>,
1895    {
1896        self.location = v.map(|x| x.into());
1897        self
1898    }
1899
1900    /// Sets the value of [title][crate::model::Expr::title].
1901    ///
1902    /// # Example
1903    /// ```ignore,no_run
1904    /// # use google_cloud_dns_v1::model::Expr;
1905    /// let x = Expr::new().set_title("example");
1906    /// ```
1907    pub fn set_title<T>(mut self, v: T) -> Self
1908    where
1909        T: std::convert::Into<std::string::String>,
1910    {
1911        self.title = std::option::Option::Some(v.into());
1912        self
1913    }
1914
1915    /// Sets or clears the value of [title][crate::model::Expr::title].
1916    ///
1917    /// # Example
1918    /// ```ignore,no_run
1919    /// # use google_cloud_dns_v1::model::Expr;
1920    /// let x = Expr::new().set_or_clear_title(Some("example"));
1921    /// let x = Expr::new().set_or_clear_title(None::<String>);
1922    /// ```
1923    pub fn set_or_clear_title<T>(mut self, v: std::option::Option<T>) -> Self
1924    where
1925        T: std::convert::Into<std::string::String>,
1926    {
1927        self.title = v.map(|x| x.into());
1928        self
1929    }
1930}
1931
1932impl wkt::message::Message for Expr {
1933    fn typename() -> &'static str {
1934        "type.googleapis.com/.Expr"
1935    }
1936}
1937
1938/// Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.
1939#[derive(Clone, Default, PartialEq)]
1940#[non_exhaustive]
1941pub struct GoogleIamV1AuditConfig {
1942    /// The configuration for logging of each type of permission.
1943    pub audit_log_configs: std::vec::Vec<crate::model::GoogleIamV1AuditLogConfig>,
1944
1945    /// Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
1946    pub service: std::option::Option<std::string::String>,
1947
1948    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1949}
1950
1951impl GoogleIamV1AuditConfig {
1952    /// Creates a new default instance.
1953    pub fn new() -> Self {
1954        std::default::Default::default()
1955    }
1956
1957    /// Sets the value of [audit_log_configs][crate::model::GoogleIamV1AuditConfig::audit_log_configs].
1958    ///
1959    /// # Example
1960    /// ```ignore,no_run
1961    /// # use google_cloud_dns_v1::model::GoogleIamV1AuditConfig;
1962    /// use google_cloud_dns_v1::model::GoogleIamV1AuditLogConfig;
1963    /// let x = GoogleIamV1AuditConfig::new()
1964    ///     .set_audit_log_configs([
1965    ///         GoogleIamV1AuditLogConfig::default()/* use setters */,
1966    ///         GoogleIamV1AuditLogConfig::default()/* use (different) setters */,
1967    ///     ]);
1968    /// ```
1969    pub fn set_audit_log_configs<T, V>(mut self, v: T) -> Self
1970    where
1971        T: std::iter::IntoIterator<Item = V>,
1972        V: std::convert::Into<crate::model::GoogleIamV1AuditLogConfig>,
1973    {
1974        use std::iter::Iterator;
1975        self.audit_log_configs = v.into_iter().map(|i| i.into()).collect();
1976        self
1977    }
1978
1979    /// Sets the value of [service][crate::model::GoogleIamV1AuditConfig::service].
1980    ///
1981    /// # Example
1982    /// ```ignore,no_run
1983    /// # use google_cloud_dns_v1::model::GoogleIamV1AuditConfig;
1984    /// let x = GoogleIamV1AuditConfig::new().set_service("example");
1985    /// ```
1986    pub fn set_service<T>(mut self, v: T) -> Self
1987    where
1988        T: std::convert::Into<std::string::String>,
1989    {
1990        self.service = std::option::Option::Some(v.into());
1991        self
1992    }
1993
1994    /// Sets or clears the value of [service][crate::model::GoogleIamV1AuditConfig::service].
1995    ///
1996    /// # Example
1997    /// ```ignore,no_run
1998    /// # use google_cloud_dns_v1::model::GoogleIamV1AuditConfig;
1999    /// let x = GoogleIamV1AuditConfig::new().set_or_clear_service(Some("example"));
2000    /// let x = GoogleIamV1AuditConfig::new().set_or_clear_service(None::<String>);
2001    /// ```
2002    pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
2003    where
2004        T: std::convert::Into<std::string::String>,
2005    {
2006        self.service = v.map(|x| x.into());
2007        self
2008    }
2009}
2010
2011impl wkt::message::Message for GoogleIamV1AuditConfig {
2012    fn typename() -> &'static str {
2013        "type.googleapis.com/.GoogleIamV1AuditConfig"
2014    }
2015}
2016
2017/// Provides the configuration for logging a type of permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
2018#[derive(Clone, Default, PartialEq)]
2019#[non_exhaustive]
2020pub struct GoogleIamV1AuditLogConfig {
2021    /// Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.
2022    pub exempted_members: std::vec::Vec<std::string::String>,
2023
2024    /// The log type that this config enables.
2025    pub log_type: std::option::Option<crate::model::google_iam_v_1_audit_log_config::LogType>,
2026
2027    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2028}
2029
2030impl GoogleIamV1AuditLogConfig {
2031    /// Creates a new default instance.
2032    pub fn new() -> Self {
2033        std::default::Default::default()
2034    }
2035
2036    /// Sets the value of [exempted_members][crate::model::GoogleIamV1AuditLogConfig::exempted_members].
2037    ///
2038    /// # Example
2039    /// ```ignore,no_run
2040    /// # use google_cloud_dns_v1::model::GoogleIamV1AuditLogConfig;
2041    /// let x = GoogleIamV1AuditLogConfig::new().set_exempted_members(["a", "b", "c"]);
2042    /// ```
2043    pub fn set_exempted_members<T, V>(mut self, v: T) -> Self
2044    where
2045        T: std::iter::IntoIterator<Item = V>,
2046        V: std::convert::Into<std::string::String>,
2047    {
2048        use std::iter::Iterator;
2049        self.exempted_members = v.into_iter().map(|i| i.into()).collect();
2050        self
2051    }
2052
2053    /// Sets the value of [log_type][crate::model::GoogleIamV1AuditLogConfig::log_type].
2054    ///
2055    /// # Example
2056    /// ```ignore,no_run
2057    /// # use google_cloud_dns_v1::model::GoogleIamV1AuditLogConfig;
2058    /// use google_cloud_dns_v1::model::google_iam_v_1_audit_log_config::LogType;
2059    /// let x0 = GoogleIamV1AuditLogConfig::new().set_log_type(LogType::AdminRead);
2060    /// let x1 = GoogleIamV1AuditLogConfig::new().set_log_type(LogType::DataWrite);
2061    /// let x2 = GoogleIamV1AuditLogConfig::new().set_log_type(LogType::DataRead);
2062    /// ```
2063    pub fn set_log_type<T>(mut self, v: T) -> Self
2064    where
2065        T: std::convert::Into<crate::model::google_iam_v_1_audit_log_config::LogType>,
2066    {
2067        self.log_type = std::option::Option::Some(v.into());
2068        self
2069    }
2070
2071    /// Sets or clears the value of [log_type][crate::model::GoogleIamV1AuditLogConfig::log_type].
2072    ///
2073    /// # Example
2074    /// ```ignore,no_run
2075    /// # use google_cloud_dns_v1::model::GoogleIamV1AuditLogConfig;
2076    /// use google_cloud_dns_v1::model::google_iam_v_1_audit_log_config::LogType;
2077    /// let x0 = GoogleIamV1AuditLogConfig::new().set_or_clear_log_type(Some(LogType::AdminRead));
2078    /// let x1 = GoogleIamV1AuditLogConfig::new().set_or_clear_log_type(Some(LogType::DataWrite));
2079    /// let x2 = GoogleIamV1AuditLogConfig::new().set_or_clear_log_type(Some(LogType::DataRead));
2080    /// let x_none = GoogleIamV1AuditLogConfig::new().set_or_clear_log_type(None::<LogType>);
2081    /// ```
2082    pub fn set_or_clear_log_type<T>(mut self, v: std::option::Option<T>) -> Self
2083    where
2084        T: std::convert::Into<crate::model::google_iam_v_1_audit_log_config::LogType>,
2085    {
2086        self.log_type = v.map(|x| x.into());
2087        self
2088    }
2089}
2090
2091impl wkt::message::Message for GoogleIamV1AuditLogConfig {
2092    fn typename() -> &'static str {
2093        "type.googleapis.com/.GoogleIamV1AuditLogConfig"
2094    }
2095}
2096
2097/// Defines additional types related to [GoogleIamV1AuditLogConfig].
2098pub mod google_iam_v_1_audit_log_config {
2099    #[allow(unused_imports)]
2100    use super::*;
2101
2102    /// The enumerated type for the [logType][.GoogleIamV1AuditLogConfig.logType] field.
2103    ///
2104    /// # Working with unknown values
2105    ///
2106    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2107    /// additional enum variants at any time. Adding new variants is not considered
2108    /// a breaking change. Applications should write their code in anticipation of:
2109    ///
2110    /// - New values appearing in future releases of the client library, **and**
2111    /// - New values received dynamically, without application changes.
2112    ///
2113    /// Please consult the [Working with enums] section in the user guide for some
2114    /// guidelines.
2115    ///
2116    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2117    #[derive(Clone, Debug, PartialEq)]
2118    #[non_exhaustive]
2119    pub enum LogType {
2120        /// Default case. Should never be this.
2121        Unspecified,
2122        /// Admin reads. Example: CloudIAM getIamPolicy
2123        AdminRead,
2124        /// Data writes. Example: CloudSQL Users create
2125        DataWrite,
2126        /// Data reads. Example: CloudSQL Users list
2127        DataRead,
2128        /// If set, the enum was initialized with an unknown value.
2129        ///
2130        /// Applications can examine the value using [LogType::name].
2131        UnknownValue(log_type::UnknownValue),
2132    }
2133
2134    #[doc(hidden)]
2135    pub mod log_type {
2136        #[allow(unused_imports)]
2137        use super::*;
2138        #[derive(Clone, Debug, PartialEq)]
2139        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2140    }
2141
2142    impl LogType {
2143        /// Gets the enum value as a string.
2144        pub fn name(&self) -> std::option::Option<&str> {
2145            match self {
2146                Self::Unspecified => std::option::Option::Some("LOG_TYPE_UNSPECIFIED"),
2147                Self::AdminRead => std::option::Option::Some("ADMIN_READ"),
2148                Self::DataWrite => std::option::Option::Some("DATA_WRITE"),
2149                Self::DataRead => std::option::Option::Some("DATA_READ"),
2150                Self::UnknownValue(u) => u.0.name(),
2151            }
2152        }
2153    }
2154
2155    impl std::fmt::Display for LogType {
2156        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2157            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
2158        }
2159    }
2160
2161    impl std::convert::From<&str> for LogType {
2162        fn from(value: &str) -> Self {
2163            use std::string::ToString;
2164            match value {
2165                "LOG_TYPE_UNSPECIFIED" => Self::Unspecified,
2166                "ADMIN_READ" => Self::AdminRead,
2167                "DATA_WRITE" => Self::DataWrite,
2168                "DATA_READ" => Self::DataRead,
2169                _ => Self::UnknownValue(log_type::UnknownValue(
2170                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2171                )),
2172            }
2173        }
2174    }
2175
2176    impl serde::ser::Serialize for LogType {
2177        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2178        where
2179            S: serde::Serializer,
2180        {
2181            match self {
2182                Self::Unspecified => serializer.serialize_str("LOG_TYPE_UNSPECIFIED"),
2183                Self::AdminRead => serializer.serialize_str("ADMIN_READ"),
2184                Self::DataWrite => serializer.serialize_str("DATA_WRITE"),
2185                Self::DataRead => serializer.serialize_str("DATA_READ"),
2186                Self::UnknownValue(u) => u.0.serialize(serializer),
2187            }
2188        }
2189    }
2190
2191    impl<'de> serde::de::Deserialize<'de> for LogType {
2192        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2193        where
2194            D: serde::Deserializer<'de>,
2195        {
2196            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<LogType>::new(
2197                "..GoogleIamV1AuditLogConfig.logType",
2198            ))
2199        }
2200    }
2201}
2202
2203/// Associates `members`, or principals, with a `role`.
2204#[derive(Clone, Default, PartialEq)]
2205#[non_exhaustive]
2206pub struct GoogleIamV1Binding {
2207    /// The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
2208    pub condition: std::option::Option<crate::model::Expr>,
2209
2210    /// Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`.
2211    pub members: std::vec::Vec<std::string::String>,
2212
2213    /// Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles).
2214    pub role: std::option::Option<std::string::String>,
2215
2216    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2217}
2218
2219impl GoogleIamV1Binding {
2220    /// Creates a new default instance.
2221    pub fn new() -> Self {
2222        std::default::Default::default()
2223    }
2224
2225    /// Sets the value of [condition][crate::model::GoogleIamV1Binding::condition].
2226    ///
2227    /// # Example
2228    /// ```ignore,no_run
2229    /// # use google_cloud_dns_v1::model::GoogleIamV1Binding;
2230    /// use google_cloud_dns_v1::model::Expr;
2231    /// let x = GoogleIamV1Binding::new().set_condition(Expr::default()/* use setters */);
2232    /// ```
2233    pub fn set_condition<T>(mut self, v: T) -> Self
2234    where
2235        T: std::convert::Into<crate::model::Expr>,
2236    {
2237        self.condition = std::option::Option::Some(v.into());
2238        self
2239    }
2240
2241    /// Sets or clears the value of [condition][crate::model::GoogleIamV1Binding::condition].
2242    ///
2243    /// # Example
2244    /// ```ignore,no_run
2245    /// # use google_cloud_dns_v1::model::GoogleIamV1Binding;
2246    /// use google_cloud_dns_v1::model::Expr;
2247    /// let x = GoogleIamV1Binding::new().set_or_clear_condition(Some(Expr::default()/* use setters */));
2248    /// let x = GoogleIamV1Binding::new().set_or_clear_condition(None::<Expr>);
2249    /// ```
2250    pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
2251    where
2252        T: std::convert::Into<crate::model::Expr>,
2253    {
2254        self.condition = v.map(|x| x.into());
2255        self
2256    }
2257
2258    /// Sets the value of [members][crate::model::GoogleIamV1Binding::members].
2259    ///
2260    /// # Example
2261    /// ```ignore,no_run
2262    /// # use google_cloud_dns_v1::model::GoogleIamV1Binding;
2263    /// let x = GoogleIamV1Binding::new().set_members(["a", "b", "c"]);
2264    /// ```
2265    pub fn set_members<T, V>(mut self, v: T) -> Self
2266    where
2267        T: std::iter::IntoIterator<Item = V>,
2268        V: std::convert::Into<std::string::String>,
2269    {
2270        use std::iter::Iterator;
2271        self.members = v.into_iter().map(|i| i.into()).collect();
2272        self
2273    }
2274
2275    /// Sets the value of [role][crate::model::GoogleIamV1Binding::role].
2276    ///
2277    /// # Example
2278    /// ```ignore,no_run
2279    /// # use google_cloud_dns_v1::model::GoogleIamV1Binding;
2280    /// let x = GoogleIamV1Binding::new().set_role("example");
2281    /// ```
2282    pub fn set_role<T>(mut self, v: T) -> Self
2283    where
2284        T: std::convert::Into<std::string::String>,
2285    {
2286        self.role = std::option::Option::Some(v.into());
2287        self
2288    }
2289
2290    /// Sets or clears the value of [role][crate::model::GoogleIamV1Binding::role].
2291    ///
2292    /// # Example
2293    /// ```ignore,no_run
2294    /// # use google_cloud_dns_v1::model::GoogleIamV1Binding;
2295    /// let x = GoogleIamV1Binding::new().set_or_clear_role(Some("example"));
2296    /// let x = GoogleIamV1Binding::new().set_or_clear_role(None::<String>);
2297    /// ```
2298    pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
2299    where
2300        T: std::convert::Into<std::string::String>,
2301    {
2302        self.role = v.map(|x| x.into());
2303        self
2304    }
2305}
2306
2307impl wkt::message::Message for GoogleIamV1Binding {
2308    fn typename() -> &'static str {
2309        "type.googleapis.com/.GoogleIamV1Binding"
2310    }
2311}
2312
2313/// Request message for `GetIamPolicy` method.
2314#[derive(Clone, Default, PartialEq)]
2315#[non_exhaustive]
2316pub struct GoogleIamV1GetIamPolicyRequest {
2317    /// OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`.
2318    pub options: std::option::Option<crate::model::GoogleIamV1GetPolicyOptions>,
2319
2320    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2321}
2322
2323impl GoogleIamV1GetIamPolicyRequest {
2324    /// Creates a new default instance.
2325    pub fn new() -> Self {
2326        std::default::Default::default()
2327    }
2328
2329    /// Sets the value of [options][crate::model::GoogleIamV1GetIamPolicyRequest::options].
2330    ///
2331    /// # Example
2332    /// ```ignore,no_run
2333    /// # use google_cloud_dns_v1::model::GoogleIamV1GetIamPolicyRequest;
2334    /// use google_cloud_dns_v1::model::GoogleIamV1GetPolicyOptions;
2335    /// let x = GoogleIamV1GetIamPolicyRequest::new().set_options(GoogleIamV1GetPolicyOptions::default()/* use setters */);
2336    /// ```
2337    pub fn set_options<T>(mut self, v: T) -> Self
2338    where
2339        T: std::convert::Into<crate::model::GoogleIamV1GetPolicyOptions>,
2340    {
2341        self.options = std::option::Option::Some(v.into());
2342        self
2343    }
2344
2345    /// Sets or clears the value of [options][crate::model::GoogleIamV1GetIamPolicyRequest::options].
2346    ///
2347    /// # Example
2348    /// ```ignore,no_run
2349    /// # use google_cloud_dns_v1::model::GoogleIamV1GetIamPolicyRequest;
2350    /// use google_cloud_dns_v1::model::GoogleIamV1GetPolicyOptions;
2351    /// let x = GoogleIamV1GetIamPolicyRequest::new().set_or_clear_options(Some(GoogleIamV1GetPolicyOptions::default()/* use setters */));
2352    /// let x = GoogleIamV1GetIamPolicyRequest::new().set_or_clear_options(None::<GoogleIamV1GetPolicyOptions>);
2353    /// ```
2354    pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2355    where
2356        T: std::convert::Into<crate::model::GoogleIamV1GetPolicyOptions>,
2357    {
2358        self.options = v.map(|x| x.into());
2359        self
2360    }
2361}
2362
2363impl wkt::message::Message for GoogleIamV1GetIamPolicyRequest {
2364    fn typename() -> &'static str {
2365        "type.googleapis.com/.GoogleIamV1GetIamPolicyRequest"
2366    }
2367}
2368
2369/// Encapsulates settings provided to GetIamPolicy.
2370#[derive(Clone, Default, PartialEq)]
2371#[non_exhaustive]
2372pub struct GoogleIamV1GetPolicyOptions {
2373    /// Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
2374    pub requested_policy_version: std::option::Option<i32>,
2375
2376    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2377}
2378
2379impl GoogleIamV1GetPolicyOptions {
2380    /// Creates a new default instance.
2381    pub fn new() -> Self {
2382        std::default::Default::default()
2383    }
2384
2385    /// Sets the value of [requested_policy_version][crate::model::GoogleIamV1GetPolicyOptions::requested_policy_version].
2386    ///
2387    /// # Example
2388    /// ```ignore,no_run
2389    /// # use google_cloud_dns_v1::model::GoogleIamV1GetPolicyOptions;
2390    /// let x = GoogleIamV1GetPolicyOptions::new().set_requested_policy_version(42);
2391    /// ```
2392    pub fn set_requested_policy_version<T>(mut self, v: T) -> Self
2393    where
2394        T: std::convert::Into<i32>,
2395    {
2396        self.requested_policy_version = std::option::Option::Some(v.into());
2397        self
2398    }
2399
2400    /// Sets or clears the value of [requested_policy_version][crate::model::GoogleIamV1GetPolicyOptions::requested_policy_version].
2401    ///
2402    /// # Example
2403    /// ```ignore,no_run
2404    /// # use google_cloud_dns_v1::model::GoogleIamV1GetPolicyOptions;
2405    /// let x = GoogleIamV1GetPolicyOptions::new().set_or_clear_requested_policy_version(Some(42));
2406    /// let x = GoogleIamV1GetPolicyOptions::new().set_or_clear_requested_policy_version(None::<i32>);
2407    /// ```
2408    pub fn set_or_clear_requested_policy_version<T>(mut self, v: std::option::Option<T>) -> Self
2409    where
2410        T: std::convert::Into<i32>,
2411    {
2412        self.requested_policy_version = v.map(|x| x.into());
2413        self
2414    }
2415}
2416
2417impl wkt::message::Message for GoogleIamV1GetPolicyOptions {
2418    fn typename() -> &'static str {
2419        "type.googleapis.com/.GoogleIamV1GetPolicyOptions"
2420    }
2421}
2422
2423/// An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** ``` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
2424#[derive(Clone, Default, PartialEq)]
2425#[non_exhaustive]
2426pub struct GoogleIamV1Policy {
2427    /// Specifies cloud audit logging configuration for this policy.
2428    pub audit_configs: std::vec::Vec<crate::model::GoogleIamV1AuditConfig>,
2429
2430    /// Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`.
2431    pub bindings: std::vec::Vec<crate::model::GoogleIamV1Binding>,
2432
2433    /// `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
2434    pub etag: std::option::Option<::bytes::Bytes>,
2435
2436    /// Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
2437    pub version: std::option::Option<i32>,
2438
2439    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2440}
2441
2442impl GoogleIamV1Policy {
2443    /// Creates a new default instance.
2444    pub fn new() -> Self {
2445        std::default::Default::default()
2446    }
2447
2448    /// Sets the value of [audit_configs][crate::model::GoogleIamV1Policy::audit_configs].
2449    ///
2450    /// # Example
2451    /// ```ignore,no_run
2452    /// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
2453    /// use google_cloud_dns_v1::model::GoogleIamV1AuditConfig;
2454    /// let x = GoogleIamV1Policy::new()
2455    ///     .set_audit_configs([
2456    ///         GoogleIamV1AuditConfig::default()/* use setters */,
2457    ///         GoogleIamV1AuditConfig::default()/* use (different) setters */,
2458    ///     ]);
2459    /// ```
2460    pub fn set_audit_configs<T, V>(mut self, v: T) -> Self
2461    where
2462        T: std::iter::IntoIterator<Item = V>,
2463        V: std::convert::Into<crate::model::GoogleIamV1AuditConfig>,
2464    {
2465        use std::iter::Iterator;
2466        self.audit_configs = v.into_iter().map(|i| i.into()).collect();
2467        self
2468    }
2469
2470    /// Sets the value of [bindings][crate::model::GoogleIamV1Policy::bindings].
2471    ///
2472    /// # Example
2473    /// ```ignore,no_run
2474    /// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
2475    /// use google_cloud_dns_v1::model::GoogleIamV1Binding;
2476    /// let x = GoogleIamV1Policy::new()
2477    ///     .set_bindings([
2478    ///         GoogleIamV1Binding::default()/* use setters */,
2479    ///         GoogleIamV1Binding::default()/* use (different) setters */,
2480    ///     ]);
2481    /// ```
2482    pub fn set_bindings<T, V>(mut self, v: T) -> Self
2483    where
2484        T: std::iter::IntoIterator<Item = V>,
2485        V: std::convert::Into<crate::model::GoogleIamV1Binding>,
2486    {
2487        use std::iter::Iterator;
2488        self.bindings = v.into_iter().map(|i| i.into()).collect();
2489        self
2490    }
2491
2492    /// Sets the value of [etag][crate::model::GoogleIamV1Policy::etag].
2493    ///
2494    /// # Example
2495    /// ```ignore,no_run
2496    /// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
2497    /// let x = GoogleIamV1Policy::new().set_etag(bytes::Bytes::from_static(b"example"));
2498    /// ```
2499    pub fn set_etag<T>(mut self, v: T) -> Self
2500    where
2501        T: std::convert::Into<::bytes::Bytes>,
2502    {
2503        self.etag = std::option::Option::Some(v.into());
2504        self
2505    }
2506
2507    /// Sets or clears the value of [etag][crate::model::GoogleIamV1Policy::etag].
2508    ///
2509    /// # Example
2510    /// ```ignore,no_run
2511    /// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
2512    /// let x = GoogleIamV1Policy::new().set_or_clear_etag(Some(bytes::Bytes::from_static(b"example")));
2513    /// let x = GoogleIamV1Policy::new().set_or_clear_etag(None::<bytes::Bytes>);
2514    /// ```
2515    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2516    where
2517        T: std::convert::Into<::bytes::Bytes>,
2518    {
2519        self.etag = v.map(|x| x.into());
2520        self
2521    }
2522
2523    /// Sets the value of [version][crate::model::GoogleIamV1Policy::version].
2524    ///
2525    /// # Example
2526    /// ```ignore,no_run
2527    /// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
2528    /// let x = GoogleIamV1Policy::new().set_version(42);
2529    /// ```
2530    pub fn set_version<T>(mut self, v: T) -> Self
2531    where
2532        T: std::convert::Into<i32>,
2533    {
2534        self.version = std::option::Option::Some(v.into());
2535        self
2536    }
2537
2538    /// Sets or clears the value of [version][crate::model::GoogleIamV1Policy::version].
2539    ///
2540    /// # Example
2541    /// ```ignore,no_run
2542    /// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
2543    /// let x = GoogleIamV1Policy::new().set_or_clear_version(Some(42));
2544    /// let x = GoogleIamV1Policy::new().set_or_clear_version(None::<i32>);
2545    /// ```
2546    pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
2547    where
2548        T: std::convert::Into<i32>,
2549    {
2550        self.version = v.map(|x| x.into());
2551        self
2552    }
2553}
2554
2555impl wkt::message::Message for GoogleIamV1Policy {
2556    fn typename() -> &'static str {
2557        "type.googleapis.com/.GoogleIamV1Policy"
2558    }
2559}
2560
2561/// Request message for `SetIamPolicy` method.
2562#[derive(Clone, Default, PartialEq)]
2563#[non_exhaustive]
2564pub struct GoogleIamV1SetIamPolicyRequest {
2565    /// REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Google Cloud services (such as Projects) might reject them.
2566    pub policy: std::option::Option<crate::model::GoogleIamV1Policy>,
2567
2568    /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: `paths: "bindings, etag"`
2569    pub update_mask: std::option::Option<wkt::FieldMask>,
2570
2571    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2572}
2573
2574impl GoogleIamV1SetIamPolicyRequest {
2575    /// Creates a new default instance.
2576    pub fn new() -> Self {
2577        std::default::Default::default()
2578    }
2579
2580    /// Sets the value of [policy][crate::model::GoogleIamV1SetIamPolicyRequest::policy].
2581    ///
2582    /// # Example
2583    /// ```ignore,no_run
2584    /// # use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
2585    /// use google_cloud_dns_v1::model::GoogleIamV1Policy;
2586    /// let x = GoogleIamV1SetIamPolicyRequest::new().set_policy(GoogleIamV1Policy::default()/* use setters */);
2587    /// ```
2588    pub fn set_policy<T>(mut self, v: T) -> Self
2589    where
2590        T: std::convert::Into<crate::model::GoogleIamV1Policy>,
2591    {
2592        self.policy = std::option::Option::Some(v.into());
2593        self
2594    }
2595
2596    /// Sets or clears the value of [policy][crate::model::GoogleIamV1SetIamPolicyRequest::policy].
2597    ///
2598    /// # Example
2599    /// ```ignore,no_run
2600    /// # use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
2601    /// use google_cloud_dns_v1::model::GoogleIamV1Policy;
2602    /// let x = GoogleIamV1SetIamPolicyRequest::new().set_or_clear_policy(Some(GoogleIamV1Policy::default()/* use setters */));
2603    /// let x = GoogleIamV1SetIamPolicyRequest::new().set_or_clear_policy(None::<GoogleIamV1Policy>);
2604    /// ```
2605    pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2606    where
2607        T: std::convert::Into<crate::model::GoogleIamV1Policy>,
2608    {
2609        self.policy = v.map(|x| x.into());
2610        self
2611    }
2612
2613    /// Sets the value of [update_mask][crate::model::GoogleIamV1SetIamPolicyRequest::update_mask].
2614    ///
2615    /// # Example
2616    /// ```ignore,no_run
2617    /// # use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
2618    /// use wkt::FieldMask;
2619    /// let x = GoogleIamV1SetIamPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2620    /// ```
2621    pub fn set_update_mask<T>(mut self, v: T) -> Self
2622    where
2623        T: std::convert::Into<wkt::FieldMask>,
2624    {
2625        self.update_mask = std::option::Option::Some(v.into());
2626        self
2627    }
2628
2629    /// Sets or clears the value of [update_mask][crate::model::GoogleIamV1SetIamPolicyRequest::update_mask].
2630    ///
2631    /// # Example
2632    /// ```ignore,no_run
2633    /// # use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
2634    /// use wkt::FieldMask;
2635    /// let x = GoogleIamV1SetIamPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2636    /// let x = GoogleIamV1SetIamPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2637    /// ```
2638    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2639    where
2640        T: std::convert::Into<wkt::FieldMask>,
2641    {
2642        self.update_mask = v.map(|x| x.into());
2643        self
2644    }
2645}
2646
2647impl wkt::message::Message for GoogleIamV1SetIamPolicyRequest {
2648    fn typename() -> &'static str {
2649        "type.googleapis.com/.GoogleIamV1SetIamPolicyRequest"
2650    }
2651}
2652
2653/// Request message for `TestIamPermissions` method.
2654#[derive(Clone, Default, PartialEq)]
2655#[non_exhaustive]
2656pub struct GoogleIamV1TestIamPermissionsRequest {
2657    /// The set of permissions to check for the `resource`. Permissions with wildcards (such as `*` or `storage.*`) are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
2658    pub permissions: std::vec::Vec<std::string::String>,
2659
2660    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2661}
2662
2663impl GoogleIamV1TestIamPermissionsRequest {
2664    /// Creates a new default instance.
2665    pub fn new() -> Self {
2666        std::default::Default::default()
2667    }
2668
2669    /// Sets the value of [permissions][crate::model::GoogleIamV1TestIamPermissionsRequest::permissions].
2670    ///
2671    /// # Example
2672    /// ```ignore,no_run
2673    /// # use google_cloud_dns_v1::model::GoogleIamV1TestIamPermissionsRequest;
2674    /// let x = GoogleIamV1TestIamPermissionsRequest::new().set_permissions(["a", "b", "c"]);
2675    /// ```
2676    pub fn set_permissions<T, V>(mut self, v: T) -> Self
2677    where
2678        T: std::iter::IntoIterator<Item = V>,
2679        V: std::convert::Into<std::string::String>,
2680    {
2681        use std::iter::Iterator;
2682        self.permissions = v.into_iter().map(|i| i.into()).collect();
2683        self
2684    }
2685}
2686
2687impl wkt::message::Message for GoogleIamV1TestIamPermissionsRequest {
2688    fn typename() -> &'static str {
2689        "type.googleapis.com/.GoogleIamV1TestIamPermissionsRequest"
2690    }
2691}
2692
2693/// Response message for `TestIamPermissions` method.
2694#[derive(Clone, Default, PartialEq)]
2695#[non_exhaustive]
2696pub struct GoogleIamV1TestIamPermissionsResponse {
2697    /// A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
2698    pub permissions: std::vec::Vec<std::string::String>,
2699
2700    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2701}
2702
2703impl GoogleIamV1TestIamPermissionsResponse {
2704    /// Creates a new default instance.
2705    pub fn new() -> Self {
2706        std::default::Default::default()
2707    }
2708
2709    /// Sets the value of [permissions][crate::model::GoogleIamV1TestIamPermissionsResponse::permissions].
2710    ///
2711    /// # Example
2712    /// ```ignore,no_run
2713    /// # use google_cloud_dns_v1::model::GoogleIamV1TestIamPermissionsResponse;
2714    /// let x = GoogleIamV1TestIamPermissionsResponse::new().set_permissions(["a", "b", "c"]);
2715    /// ```
2716    pub fn set_permissions<T, V>(mut self, v: T) -> Self
2717    where
2718        T: std::iter::IntoIterator<Item = V>,
2719        V: std::convert::Into<std::string::String>,
2720    {
2721        use std::iter::Iterator;
2722        self.permissions = v.into_iter().map(|i| i.into()).collect();
2723        self
2724    }
2725}
2726
2727impl wkt::message::Message for GoogleIamV1TestIamPermissionsResponse {
2728    fn typename() -> &'static str {
2729        "type.googleapis.com/.GoogleIamV1TestIamPermissionsResponse"
2730    }
2731}
2732
2733/// This resource represents a long-running operation that is the result of a network API call.
2734#[derive(Clone, Default, PartialEq)]
2735#[non_exhaustive]
2736pub struct GoogleLongrunningOperation {
2737    /// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
2738    pub done: std::option::Option<bool>,
2739
2740    /// The error result of the operation in case of failure or cancellation.
2741    pub error: std::option::Option<crate::model::Status>,
2742
2743    /// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
2744    pub metadata: std::option::Option<wkt::Any>,
2745
2746    /// The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
2747    pub name: std::option::Option<std::string::String>,
2748
2749    /// The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
2750    pub response: std::option::Option<wkt::Any>,
2751
2752    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2753}
2754
2755impl GoogleLongrunningOperation {
2756    /// Creates a new default instance.
2757    pub fn new() -> Self {
2758        std::default::Default::default()
2759    }
2760
2761    /// Sets the value of [done][crate::model::GoogleLongrunningOperation::done].
2762    ///
2763    /// # Example
2764    /// ```ignore,no_run
2765    /// # use google_cloud_dns_v1::model::GoogleLongrunningOperation;
2766    /// let x = GoogleLongrunningOperation::new().set_done(true);
2767    /// ```
2768    pub fn set_done<T>(mut self, v: T) -> Self
2769    where
2770        T: std::convert::Into<bool>,
2771    {
2772        self.done = std::option::Option::Some(v.into());
2773        self
2774    }
2775
2776    /// Sets or clears the value of [done][crate::model::GoogleLongrunningOperation::done].
2777    ///
2778    /// # Example
2779    /// ```ignore,no_run
2780    /// # use google_cloud_dns_v1::model::GoogleLongrunningOperation;
2781    /// let x = GoogleLongrunningOperation::new().set_or_clear_done(Some(false));
2782    /// let x = GoogleLongrunningOperation::new().set_or_clear_done(None::<bool>);
2783    /// ```
2784    pub fn set_or_clear_done<T>(mut self, v: std::option::Option<T>) -> Self
2785    where
2786        T: std::convert::Into<bool>,
2787    {
2788        self.done = v.map(|x| x.into());
2789        self
2790    }
2791
2792    /// Sets the value of [error][crate::model::GoogleLongrunningOperation::error].
2793    ///
2794    /// # Example
2795    /// ```ignore,no_run
2796    /// # use google_cloud_dns_v1::model::GoogleLongrunningOperation;
2797    /// use google_cloud_dns_v1::model::Status;
2798    /// let x = GoogleLongrunningOperation::new().set_error(Status::default()/* use setters */);
2799    /// ```
2800    pub fn set_error<T>(mut self, v: T) -> Self
2801    where
2802        T: std::convert::Into<crate::model::Status>,
2803    {
2804        self.error = std::option::Option::Some(v.into());
2805        self
2806    }
2807
2808    /// Sets or clears the value of [error][crate::model::GoogleLongrunningOperation::error].
2809    ///
2810    /// # Example
2811    /// ```ignore,no_run
2812    /// # use google_cloud_dns_v1::model::GoogleLongrunningOperation;
2813    /// use google_cloud_dns_v1::model::Status;
2814    /// let x = GoogleLongrunningOperation::new().set_or_clear_error(Some(Status::default()/* use setters */));
2815    /// let x = GoogleLongrunningOperation::new().set_or_clear_error(None::<Status>);
2816    /// ```
2817    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2818    where
2819        T: std::convert::Into<crate::model::Status>,
2820    {
2821        self.error = v.map(|x| x.into());
2822        self
2823    }
2824
2825    /// Sets the value of [metadata][crate::model::GoogleLongrunningOperation::metadata].
2826    ///
2827    /// # Example
2828    /// ```ignore,no_run
2829    /// # use google_cloud_dns_v1::model::GoogleLongrunningOperation;
2830    /// use wkt::Any;
2831    /// let x = GoogleLongrunningOperation::new().set_metadata(Any::default()/* use setters */);
2832    /// ```
2833    pub fn set_metadata<T>(mut self, v: T) -> Self
2834    where
2835        T: std::convert::Into<wkt::Any>,
2836    {
2837        self.metadata = std::option::Option::Some(v.into());
2838        self
2839    }
2840
2841    /// Sets or clears the value of [metadata][crate::model::GoogleLongrunningOperation::metadata].
2842    ///
2843    /// # Example
2844    /// ```ignore,no_run
2845    /// # use google_cloud_dns_v1::model::GoogleLongrunningOperation;
2846    /// use wkt::Any;
2847    /// let x = GoogleLongrunningOperation::new().set_or_clear_metadata(Some(Any::default()/* use setters */));
2848    /// let x = GoogleLongrunningOperation::new().set_or_clear_metadata(None::<Any>);
2849    /// ```
2850    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2851    where
2852        T: std::convert::Into<wkt::Any>,
2853    {
2854        self.metadata = v.map(|x| x.into());
2855        self
2856    }
2857
2858    /// Sets the value of [name][crate::model::GoogleLongrunningOperation::name].
2859    ///
2860    /// # Example
2861    /// ```ignore,no_run
2862    /// # use google_cloud_dns_v1::model::GoogleLongrunningOperation;
2863    /// let x = GoogleLongrunningOperation::new().set_name("example");
2864    /// ```
2865    pub fn set_name<T>(mut self, v: T) -> Self
2866    where
2867        T: std::convert::Into<std::string::String>,
2868    {
2869        self.name = std::option::Option::Some(v.into());
2870        self
2871    }
2872
2873    /// Sets or clears the value of [name][crate::model::GoogleLongrunningOperation::name].
2874    ///
2875    /// # Example
2876    /// ```ignore,no_run
2877    /// # use google_cloud_dns_v1::model::GoogleLongrunningOperation;
2878    /// let x = GoogleLongrunningOperation::new().set_or_clear_name(Some("example"));
2879    /// let x = GoogleLongrunningOperation::new().set_or_clear_name(None::<String>);
2880    /// ```
2881    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
2882    where
2883        T: std::convert::Into<std::string::String>,
2884    {
2885        self.name = v.map(|x| x.into());
2886        self
2887    }
2888
2889    /// Sets the value of [response][crate::model::GoogleLongrunningOperation::response].
2890    ///
2891    /// # Example
2892    /// ```ignore,no_run
2893    /// # use google_cloud_dns_v1::model::GoogleLongrunningOperation;
2894    /// use wkt::Any;
2895    /// let x = GoogleLongrunningOperation::new().set_response(Any::default()/* use setters */);
2896    /// ```
2897    pub fn set_response<T>(mut self, v: T) -> Self
2898    where
2899        T: std::convert::Into<wkt::Any>,
2900    {
2901        self.response = std::option::Option::Some(v.into());
2902        self
2903    }
2904
2905    /// Sets or clears the value of [response][crate::model::GoogleLongrunningOperation::response].
2906    ///
2907    /// # Example
2908    /// ```ignore,no_run
2909    /// # use google_cloud_dns_v1::model::GoogleLongrunningOperation;
2910    /// use wkt::Any;
2911    /// let x = GoogleLongrunningOperation::new().set_or_clear_response(Some(Any::default()/* use setters */));
2912    /// let x = GoogleLongrunningOperation::new().set_or_clear_response(None::<Any>);
2913    /// ```
2914    pub fn set_or_clear_response<T>(mut self, v: std::option::Option<T>) -> Self
2915    where
2916        T: std::convert::Into<wkt::Any>,
2917    {
2918        self.response = v.map(|x| x.into());
2919        self
2920    }
2921}
2922
2923impl wkt::message::Message for GoogleLongrunningOperation {
2924    fn typename() -> &'static str {
2925        "type.googleapis.com/.GoogleLongrunningOperation"
2926    }
2927}
2928
2929/// A zone is a subtree of the DNS namespace under one administrative responsibility. A ManagedZone is a resource that represents a DNS zone hosted by the Cloud DNS service.
2930#[derive(Clone, Default, PartialEq)]
2931#[non_exhaustive]
2932pub struct ManagedZone {
2933    #[allow(missing_docs)]
2934    pub cloud_logging_config: std::option::Option<crate::model::ManagedZoneCloudLoggingConfig>,
2935
2936    /// The time that this resource was created on the server. This is in RFC3339 text format. Output only.
2937    pub creation_time: std::option::Option<std::string::String>,
2938
2939    /// A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the managed zone's function.
2940    pub description: std::option::Option<std::string::String>,
2941
2942    /// The DNS name of this managed zone, for instance "example.com.".
2943    pub dns_name: std::option::Option<std::string::String>,
2944
2945    /// DNSSEC configuration.
2946    pub dnssec_config: std::option::Option<crate::model::ManagedZoneDnsSecConfig>,
2947
2948    /// The presence for this field indicates that outbound forwarding is enabled for this zone. The value of this field contains the set of destinations to forward to.
2949    pub forwarding_config: std::option::Option<crate::model::ManagedZoneForwardingConfig>,
2950
2951    /// Unique identifier for the resource; defined by the server (output only)
2952    pub id: std::option::Option<u64>,
2953
2954    #[allow(missing_docs)]
2955    pub kind: std::option::Option<std::string::String>,
2956
2957    /// User labels.
2958    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2959
2960    /// User assigned name for this resource. Must be unique within the project. The name must be 1-63 characters long, must begin with a letter, end with a letter or digit, and only contain lowercase letters, digits or dashes.
2961    pub name: std::option::Option<std::string::String>,
2962
2963    /// Optionally specifies the NameServerSet for this ManagedZone. A NameServerSet is a set of DNS name servers that all host the same ManagedZones. Most users leave this field unset. If you need to use this field, contact your account team.
2964    pub name_server_set: std::option::Option<std::string::String>,
2965
2966    /// Delegate your managed_zone to these virtual name servers; defined by the server (output only)
2967    pub name_servers: std::vec::Vec<std::string::String>,
2968
2969    /// The presence of this field indicates that DNS Peering is enabled for this zone. The value of this field contains the network to peer with.
2970    pub peering_config: std::option::Option<crate::model::ManagedZonePeeringConfig>,
2971
2972    /// For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from.
2973    pub private_visibility_config:
2974        std::option::Option<crate::model::ManagedZonePrivateVisibilityConfig>,
2975
2976    /// The presence of this field indicates that this is a managed reverse lookup zone and Cloud DNS resolves reverse lookup queries using automatically configured records for VPC resources. This only applies to networks listed under private_visibility_config.
2977    pub reverse_lookup_config: std::option::Option<crate::model::ManagedZoneReverseLookupConfig>,
2978
2979    /// This field links to the associated service directory namespace. Do not set this field for public zones or forwarding zones.
2980    pub service_directory_config:
2981        std::option::Option<crate::model::ManagedZoneServiceDirectoryConfig>,
2982
2983    /// The zone's visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.
2984    pub visibility: std::option::Option<crate::model::managed_zone::Visibility>,
2985
2986    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2987}
2988
2989impl ManagedZone {
2990    /// Creates a new default instance.
2991    pub fn new() -> Self {
2992        std::default::Default::default()
2993    }
2994
2995    /// Sets the value of [cloud_logging_config][crate::model::ManagedZone::cloud_logging_config].
2996    ///
2997    /// # Example
2998    /// ```ignore,no_run
2999    /// # use google_cloud_dns_v1::model::ManagedZone;
3000    /// use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
3001    /// let x = ManagedZone::new().set_cloud_logging_config(ManagedZoneCloudLoggingConfig::default()/* use setters */);
3002    /// ```
3003    pub fn set_cloud_logging_config<T>(mut self, v: T) -> Self
3004    where
3005        T: std::convert::Into<crate::model::ManagedZoneCloudLoggingConfig>,
3006    {
3007        self.cloud_logging_config = std::option::Option::Some(v.into());
3008        self
3009    }
3010
3011    /// Sets or clears the value of [cloud_logging_config][crate::model::ManagedZone::cloud_logging_config].
3012    ///
3013    /// # Example
3014    /// ```ignore,no_run
3015    /// # use google_cloud_dns_v1::model::ManagedZone;
3016    /// use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
3017    /// let x = ManagedZone::new().set_or_clear_cloud_logging_config(Some(ManagedZoneCloudLoggingConfig::default()/* use setters */));
3018    /// let x = ManagedZone::new().set_or_clear_cloud_logging_config(None::<ManagedZoneCloudLoggingConfig>);
3019    /// ```
3020    pub fn set_or_clear_cloud_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
3021    where
3022        T: std::convert::Into<crate::model::ManagedZoneCloudLoggingConfig>,
3023    {
3024        self.cloud_logging_config = v.map(|x| x.into());
3025        self
3026    }
3027
3028    /// Sets the value of [creation_time][crate::model::ManagedZone::creation_time].
3029    ///
3030    /// # Example
3031    /// ```ignore,no_run
3032    /// # use google_cloud_dns_v1::model::ManagedZone;
3033    /// let x = ManagedZone::new().set_creation_time("example");
3034    /// ```
3035    pub fn set_creation_time<T>(mut self, v: T) -> Self
3036    where
3037        T: std::convert::Into<std::string::String>,
3038    {
3039        self.creation_time = std::option::Option::Some(v.into());
3040        self
3041    }
3042
3043    /// Sets or clears the value of [creation_time][crate::model::ManagedZone::creation_time].
3044    ///
3045    /// # Example
3046    /// ```ignore,no_run
3047    /// # use google_cloud_dns_v1::model::ManagedZone;
3048    /// let x = ManagedZone::new().set_or_clear_creation_time(Some("example"));
3049    /// let x = ManagedZone::new().set_or_clear_creation_time(None::<String>);
3050    /// ```
3051    pub fn set_or_clear_creation_time<T>(mut self, v: std::option::Option<T>) -> Self
3052    where
3053        T: std::convert::Into<std::string::String>,
3054    {
3055        self.creation_time = v.map(|x| x.into());
3056        self
3057    }
3058
3059    /// Sets the value of [description][crate::model::ManagedZone::description].
3060    ///
3061    /// # Example
3062    /// ```ignore,no_run
3063    /// # use google_cloud_dns_v1::model::ManagedZone;
3064    /// let x = ManagedZone::new().set_description("example");
3065    /// ```
3066    pub fn set_description<T>(mut self, v: T) -> Self
3067    where
3068        T: std::convert::Into<std::string::String>,
3069    {
3070        self.description = std::option::Option::Some(v.into());
3071        self
3072    }
3073
3074    /// Sets or clears the value of [description][crate::model::ManagedZone::description].
3075    ///
3076    /// # Example
3077    /// ```ignore,no_run
3078    /// # use google_cloud_dns_v1::model::ManagedZone;
3079    /// let x = ManagedZone::new().set_or_clear_description(Some("example"));
3080    /// let x = ManagedZone::new().set_or_clear_description(None::<String>);
3081    /// ```
3082    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
3083    where
3084        T: std::convert::Into<std::string::String>,
3085    {
3086        self.description = v.map(|x| x.into());
3087        self
3088    }
3089
3090    /// Sets the value of [dns_name][crate::model::ManagedZone::dns_name].
3091    ///
3092    /// # Example
3093    /// ```ignore,no_run
3094    /// # use google_cloud_dns_v1::model::ManagedZone;
3095    /// let x = ManagedZone::new().set_dns_name("example");
3096    /// ```
3097    pub fn set_dns_name<T>(mut self, v: T) -> Self
3098    where
3099        T: std::convert::Into<std::string::String>,
3100    {
3101        self.dns_name = std::option::Option::Some(v.into());
3102        self
3103    }
3104
3105    /// Sets or clears the value of [dns_name][crate::model::ManagedZone::dns_name].
3106    ///
3107    /// # Example
3108    /// ```ignore,no_run
3109    /// # use google_cloud_dns_v1::model::ManagedZone;
3110    /// let x = ManagedZone::new().set_or_clear_dns_name(Some("example"));
3111    /// let x = ManagedZone::new().set_or_clear_dns_name(None::<String>);
3112    /// ```
3113    pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
3114    where
3115        T: std::convert::Into<std::string::String>,
3116    {
3117        self.dns_name = v.map(|x| x.into());
3118        self
3119    }
3120
3121    /// Sets the value of [dnssec_config][crate::model::ManagedZone::dnssec_config].
3122    ///
3123    /// # Example
3124    /// ```ignore,no_run
3125    /// # use google_cloud_dns_v1::model::ManagedZone;
3126    /// use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
3127    /// let x = ManagedZone::new().set_dnssec_config(ManagedZoneDnsSecConfig::default()/* use setters */);
3128    /// ```
3129    pub fn set_dnssec_config<T>(mut self, v: T) -> Self
3130    where
3131        T: std::convert::Into<crate::model::ManagedZoneDnsSecConfig>,
3132    {
3133        self.dnssec_config = std::option::Option::Some(v.into());
3134        self
3135    }
3136
3137    /// Sets or clears the value of [dnssec_config][crate::model::ManagedZone::dnssec_config].
3138    ///
3139    /// # Example
3140    /// ```ignore,no_run
3141    /// # use google_cloud_dns_v1::model::ManagedZone;
3142    /// use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
3143    /// let x = ManagedZone::new().set_or_clear_dnssec_config(Some(ManagedZoneDnsSecConfig::default()/* use setters */));
3144    /// let x = ManagedZone::new().set_or_clear_dnssec_config(None::<ManagedZoneDnsSecConfig>);
3145    /// ```
3146    pub fn set_or_clear_dnssec_config<T>(mut self, v: std::option::Option<T>) -> Self
3147    where
3148        T: std::convert::Into<crate::model::ManagedZoneDnsSecConfig>,
3149    {
3150        self.dnssec_config = v.map(|x| x.into());
3151        self
3152    }
3153
3154    /// Sets the value of [forwarding_config][crate::model::ManagedZone::forwarding_config].
3155    ///
3156    /// # Example
3157    /// ```ignore,no_run
3158    /// # use google_cloud_dns_v1::model::ManagedZone;
3159    /// use google_cloud_dns_v1::model::ManagedZoneForwardingConfig;
3160    /// let x = ManagedZone::new().set_forwarding_config(ManagedZoneForwardingConfig::default()/* use setters */);
3161    /// ```
3162    pub fn set_forwarding_config<T>(mut self, v: T) -> Self
3163    where
3164        T: std::convert::Into<crate::model::ManagedZoneForwardingConfig>,
3165    {
3166        self.forwarding_config = std::option::Option::Some(v.into());
3167        self
3168    }
3169
3170    /// Sets or clears the value of [forwarding_config][crate::model::ManagedZone::forwarding_config].
3171    ///
3172    /// # Example
3173    /// ```ignore,no_run
3174    /// # use google_cloud_dns_v1::model::ManagedZone;
3175    /// use google_cloud_dns_v1::model::ManagedZoneForwardingConfig;
3176    /// let x = ManagedZone::new().set_or_clear_forwarding_config(Some(ManagedZoneForwardingConfig::default()/* use setters */));
3177    /// let x = ManagedZone::new().set_or_clear_forwarding_config(None::<ManagedZoneForwardingConfig>);
3178    /// ```
3179    pub fn set_or_clear_forwarding_config<T>(mut self, v: std::option::Option<T>) -> Self
3180    where
3181        T: std::convert::Into<crate::model::ManagedZoneForwardingConfig>,
3182    {
3183        self.forwarding_config = v.map(|x| x.into());
3184        self
3185    }
3186
3187    /// Sets the value of [id][crate::model::ManagedZone::id].
3188    ///
3189    /// # Example
3190    /// ```ignore,no_run
3191    /// # use google_cloud_dns_v1::model::ManagedZone;
3192    /// let x = ManagedZone::new().set_id(42_u32);
3193    /// ```
3194    pub fn set_id<T>(mut self, v: T) -> Self
3195    where
3196        T: std::convert::Into<u64>,
3197    {
3198        self.id = std::option::Option::Some(v.into());
3199        self
3200    }
3201
3202    /// Sets or clears the value of [id][crate::model::ManagedZone::id].
3203    ///
3204    /// # Example
3205    /// ```ignore,no_run
3206    /// # use google_cloud_dns_v1::model::ManagedZone;
3207    /// let x = ManagedZone::new().set_or_clear_id(Some(42_u32));
3208    /// let x = ManagedZone::new().set_or_clear_id(None::<u32>);
3209    /// ```
3210    pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
3211    where
3212        T: std::convert::Into<u64>,
3213    {
3214        self.id = v.map(|x| x.into());
3215        self
3216    }
3217
3218    /// Sets the value of [kind][crate::model::ManagedZone::kind].
3219    ///
3220    /// # Example
3221    /// ```ignore,no_run
3222    /// # use google_cloud_dns_v1::model::ManagedZone;
3223    /// let x = ManagedZone::new().set_kind("example");
3224    /// ```
3225    pub fn set_kind<T>(mut self, v: T) -> Self
3226    where
3227        T: std::convert::Into<std::string::String>,
3228    {
3229        self.kind = std::option::Option::Some(v.into());
3230        self
3231    }
3232
3233    /// Sets or clears the value of [kind][crate::model::ManagedZone::kind].
3234    ///
3235    /// # Example
3236    /// ```ignore,no_run
3237    /// # use google_cloud_dns_v1::model::ManagedZone;
3238    /// let x = ManagedZone::new().set_or_clear_kind(Some("example"));
3239    /// let x = ManagedZone::new().set_or_clear_kind(None::<String>);
3240    /// ```
3241    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
3242    where
3243        T: std::convert::Into<std::string::String>,
3244    {
3245        self.kind = v.map(|x| x.into());
3246        self
3247    }
3248
3249    /// Sets the value of [labels][crate::model::ManagedZone::labels].
3250    ///
3251    /// # Example
3252    /// ```ignore,no_run
3253    /// # use google_cloud_dns_v1::model::ManagedZone;
3254    /// let x = ManagedZone::new().set_labels([
3255    ///     ("key0", "abc"),
3256    ///     ("key1", "xyz"),
3257    /// ]);
3258    /// ```
3259    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3260    where
3261        T: std::iter::IntoIterator<Item = (K, V)>,
3262        K: std::convert::Into<std::string::String>,
3263        V: std::convert::Into<std::string::String>,
3264    {
3265        use std::iter::Iterator;
3266        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3267        self
3268    }
3269
3270    /// Sets the value of [name][crate::model::ManagedZone::name].
3271    ///
3272    /// # Example
3273    /// ```ignore,no_run
3274    /// # use google_cloud_dns_v1::model::ManagedZone;
3275    /// let x = ManagedZone::new().set_name("example");
3276    /// ```
3277    pub fn set_name<T>(mut self, v: T) -> Self
3278    where
3279        T: std::convert::Into<std::string::String>,
3280    {
3281        self.name = std::option::Option::Some(v.into());
3282        self
3283    }
3284
3285    /// Sets or clears the value of [name][crate::model::ManagedZone::name].
3286    ///
3287    /// # Example
3288    /// ```ignore,no_run
3289    /// # use google_cloud_dns_v1::model::ManagedZone;
3290    /// let x = ManagedZone::new().set_or_clear_name(Some("example"));
3291    /// let x = ManagedZone::new().set_or_clear_name(None::<String>);
3292    /// ```
3293    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
3294    where
3295        T: std::convert::Into<std::string::String>,
3296    {
3297        self.name = v.map(|x| x.into());
3298        self
3299    }
3300
3301    /// Sets the value of [name_server_set][crate::model::ManagedZone::name_server_set].
3302    ///
3303    /// # Example
3304    /// ```ignore,no_run
3305    /// # use google_cloud_dns_v1::model::ManagedZone;
3306    /// let x = ManagedZone::new().set_name_server_set("example");
3307    /// ```
3308    pub fn set_name_server_set<T>(mut self, v: T) -> Self
3309    where
3310        T: std::convert::Into<std::string::String>,
3311    {
3312        self.name_server_set = std::option::Option::Some(v.into());
3313        self
3314    }
3315
3316    /// Sets or clears the value of [name_server_set][crate::model::ManagedZone::name_server_set].
3317    ///
3318    /// # Example
3319    /// ```ignore,no_run
3320    /// # use google_cloud_dns_v1::model::ManagedZone;
3321    /// let x = ManagedZone::new().set_or_clear_name_server_set(Some("example"));
3322    /// let x = ManagedZone::new().set_or_clear_name_server_set(None::<String>);
3323    /// ```
3324    pub fn set_or_clear_name_server_set<T>(mut self, v: std::option::Option<T>) -> Self
3325    where
3326        T: std::convert::Into<std::string::String>,
3327    {
3328        self.name_server_set = v.map(|x| x.into());
3329        self
3330    }
3331
3332    /// Sets the value of [name_servers][crate::model::ManagedZone::name_servers].
3333    ///
3334    /// # Example
3335    /// ```ignore,no_run
3336    /// # use google_cloud_dns_v1::model::ManagedZone;
3337    /// let x = ManagedZone::new().set_name_servers(["a", "b", "c"]);
3338    /// ```
3339    pub fn set_name_servers<T, V>(mut self, v: T) -> Self
3340    where
3341        T: std::iter::IntoIterator<Item = V>,
3342        V: std::convert::Into<std::string::String>,
3343    {
3344        use std::iter::Iterator;
3345        self.name_servers = v.into_iter().map(|i| i.into()).collect();
3346        self
3347    }
3348
3349    /// Sets the value of [peering_config][crate::model::ManagedZone::peering_config].
3350    ///
3351    /// # Example
3352    /// ```ignore,no_run
3353    /// # use google_cloud_dns_v1::model::ManagedZone;
3354    /// use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
3355    /// let x = ManagedZone::new().set_peering_config(ManagedZonePeeringConfig::default()/* use setters */);
3356    /// ```
3357    pub fn set_peering_config<T>(mut self, v: T) -> Self
3358    where
3359        T: std::convert::Into<crate::model::ManagedZonePeeringConfig>,
3360    {
3361        self.peering_config = std::option::Option::Some(v.into());
3362        self
3363    }
3364
3365    /// Sets or clears the value of [peering_config][crate::model::ManagedZone::peering_config].
3366    ///
3367    /// # Example
3368    /// ```ignore,no_run
3369    /// # use google_cloud_dns_v1::model::ManagedZone;
3370    /// use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
3371    /// let x = ManagedZone::new().set_or_clear_peering_config(Some(ManagedZonePeeringConfig::default()/* use setters */));
3372    /// let x = ManagedZone::new().set_or_clear_peering_config(None::<ManagedZonePeeringConfig>);
3373    /// ```
3374    pub fn set_or_clear_peering_config<T>(mut self, v: std::option::Option<T>) -> Self
3375    where
3376        T: std::convert::Into<crate::model::ManagedZonePeeringConfig>,
3377    {
3378        self.peering_config = v.map(|x| x.into());
3379        self
3380    }
3381
3382    /// Sets the value of [private_visibility_config][crate::model::ManagedZone::private_visibility_config].
3383    ///
3384    /// # Example
3385    /// ```ignore,no_run
3386    /// # use google_cloud_dns_v1::model::ManagedZone;
3387    /// use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
3388    /// let x = ManagedZone::new().set_private_visibility_config(ManagedZonePrivateVisibilityConfig::default()/* use setters */);
3389    /// ```
3390    pub fn set_private_visibility_config<T>(mut self, v: T) -> Self
3391    where
3392        T: std::convert::Into<crate::model::ManagedZonePrivateVisibilityConfig>,
3393    {
3394        self.private_visibility_config = std::option::Option::Some(v.into());
3395        self
3396    }
3397
3398    /// Sets or clears the value of [private_visibility_config][crate::model::ManagedZone::private_visibility_config].
3399    ///
3400    /// # Example
3401    /// ```ignore,no_run
3402    /// # use google_cloud_dns_v1::model::ManagedZone;
3403    /// use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
3404    /// let x = ManagedZone::new().set_or_clear_private_visibility_config(Some(ManagedZonePrivateVisibilityConfig::default()/* use setters */));
3405    /// let x = ManagedZone::new().set_or_clear_private_visibility_config(None::<ManagedZonePrivateVisibilityConfig>);
3406    /// ```
3407    pub fn set_or_clear_private_visibility_config<T>(mut self, v: std::option::Option<T>) -> Self
3408    where
3409        T: std::convert::Into<crate::model::ManagedZonePrivateVisibilityConfig>,
3410    {
3411        self.private_visibility_config = v.map(|x| x.into());
3412        self
3413    }
3414
3415    /// Sets the value of [reverse_lookup_config][crate::model::ManagedZone::reverse_lookup_config].
3416    ///
3417    /// # Example
3418    /// ```ignore,no_run
3419    /// # use google_cloud_dns_v1::model::ManagedZone;
3420    /// use google_cloud_dns_v1::model::ManagedZoneReverseLookupConfig;
3421    /// let x = ManagedZone::new().set_reverse_lookup_config(ManagedZoneReverseLookupConfig::default()/* use setters */);
3422    /// ```
3423    pub fn set_reverse_lookup_config<T>(mut self, v: T) -> Self
3424    where
3425        T: std::convert::Into<crate::model::ManagedZoneReverseLookupConfig>,
3426    {
3427        self.reverse_lookup_config = std::option::Option::Some(v.into());
3428        self
3429    }
3430
3431    /// Sets or clears the value of [reverse_lookup_config][crate::model::ManagedZone::reverse_lookup_config].
3432    ///
3433    /// # Example
3434    /// ```ignore,no_run
3435    /// # use google_cloud_dns_v1::model::ManagedZone;
3436    /// use google_cloud_dns_v1::model::ManagedZoneReverseLookupConfig;
3437    /// let x = ManagedZone::new().set_or_clear_reverse_lookup_config(Some(ManagedZoneReverseLookupConfig::default()/* use setters */));
3438    /// let x = ManagedZone::new().set_or_clear_reverse_lookup_config(None::<ManagedZoneReverseLookupConfig>);
3439    /// ```
3440    pub fn set_or_clear_reverse_lookup_config<T>(mut self, v: std::option::Option<T>) -> Self
3441    where
3442        T: std::convert::Into<crate::model::ManagedZoneReverseLookupConfig>,
3443    {
3444        self.reverse_lookup_config = v.map(|x| x.into());
3445        self
3446    }
3447
3448    /// Sets the value of [service_directory_config][crate::model::ManagedZone::service_directory_config].
3449    ///
3450    /// # Example
3451    /// ```ignore,no_run
3452    /// # use google_cloud_dns_v1::model::ManagedZone;
3453    /// use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
3454    /// let x = ManagedZone::new().set_service_directory_config(ManagedZoneServiceDirectoryConfig::default()/* use setters */);
3455    /// ```
3456    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
3457    where
3458        T: std::convert::Into<crate::model::ManagedZoneServiceDirectoryConfig>,
3459    {
3460        self.service_directory_config = std::option::Option::Some(v.into());
3461        self
3462    }
3463
3464    /// Sets or clears the value of [service_directory_config][crate::model::ManagedZone::service_directory_config].
3465    ///
3466    /// # Example
3467    /// ```ignore,no_run
3468    /// # use google_cloud_dns_v1::model::ManagedZone;
3469    /// use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
3470    /// let x = ManagedZone::new().set_or_clear_service_directory_config(Some(ManagedZoneServiceDirectoryConfig::default()/* use setters */));
3471    /// let x = ManagedZone::new().set_or_clear_service_directory_config(None::<ManagedZoneServiceDirectoryConfig>);
3472    /// ```
3473    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
3474    where
3475        T: std::convert::Into<crate::model::ManagedZoneServiceDirectoryConfig>,
3476    {
3477        self.service_directory_config = v.map(|x| x.into());
3478        self
3479    }
3480
3481    /// Sets the value of [visibility][crate::model::ManagedZone::visibility].
3482    ///
3483    /// # Example
3484    /// ```ignore,no_run
3485    /// # use google_cloud_dns_v1::model::ManagedZone;
3486    /// use google_cloud_dns_v1::model::managed_zone::Visibility;
3487    /// let x0 = ManagedZone::new().set_visibility(Visibility::Private);
3488    /// ```
3489    pub fn set_visibility<T>(mut self, v: T) -> Self
3490    where
3491        T: std::convert::Into<crate::model::managed_zone::Visibility>,
3492    {
3493        self.visibility = std::option::Option::Some(v.into());
3494        self
3495    }
3496
3497    /// Sets or clears the value of [visibility][crate::model::ManagedZone::visibility].
3498    ///
3499    /// # Example
3500    /// ```ignore,no_run
3501    /// # use google_cloud_dns_v1::model::ManagedZone;
3502    /// use google_cloud_dns_v1::model::managed_zone::Visibility;
3503    /// let x0 = ManagedZone::new().set_or_clear_visibility(Some(Visibility::Private));
3504    /// let x_none = ManagedZone::new().set_or_clear_visibility(None::<Visibility>);
3505    /// ```
3506    pub fn set_or_clear_visibility<T>(mut self, v: std::option::Option<T>) -> Self
3507    where
3508        T: std::convert::Into<crate::model::managed_zone::Visibility>,
3509    {
3510        self.visibility = v.map(|x| x.into());
3511        self
3512    }
3513}
3514
3515impl wkt::message::Message for ManagedZone {
3516    fn typename() -> &'static str {
3517        "type.googleapis.com/.ManagedZone"
3518    }
3519}
3520
3521/// Defines additional types related to [ManagedZone].
3522pub mod managed_zone {
3523    #[allow(unused_imports)]
3524    use super::*;
3525
3526    /// The enumerated type for the [visibility][.ManagedZone.visibility] field.
3527    ///
3528    /// # Working with unknown values
3529    ///
3530    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3531    /// additional enum variants at any time. Adding new variants is not considered
3532    /// a breaking change. Applications should write their code in anticipation of:
3533    ///
3534    /// - New values appearing in future releases of the client library, **and**
3535    /// - New values received dynamically, without application changes.
3536    ///
3537    /// Please consult the [Working with enums] section in the user guide for some
3538    /// guidelines.
3539    ///
3540    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3541    #[derive(Clone, Debug, PartialEq)]
3542    #[non_exhaustive]
3543    pub enum Visibility {
3544        /// Indicates that records in this zone can be queried from the public internet.
3545        Public,
3546        /// Indicates that records in this zone cannot be queried from the public internet. Access to private zones depends on the zone configuration.
3547        Private,
3548        /// If set, the enum was initialized with an unknown value.
3549        ///
3550        /// Applications can examine the value using [Visibility::name].
3551        UnknownValue(visibility::UnknownValue),
3552    }
3553
3554    #[doc(hidden)]
3555    pub mod visibility {
3556        #[allow(unused_imports)]
3557        use super::*;
3558        #[derive(Clone, Debug, PartialEq)]
3559        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3560    }
3561
3562    impl Visibility {
3563        /// Gets the enum value as a string.
3564        pub fn name(&self) -> std::option::Option<&str> {
3565            match self {
3566                Self::Public => std::option::Option::Some("public"),
3567                Self::Private => std::option::Option::Some("private"),
3568                Self::UnknownValue(u) => u.0.name(),
3569            }
3570        }
3571    }
3572
3573    impl std::fmt::Display for Visibility {
3574        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3575            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
3576        }
3577    }
3578
3579    impl std::convert::From<&str> for Visibility {
3580        fn from(value: &str) -> Self {
3581            use std::string::ToString;
3582            match value {
3583                "public" => Self::Public,
3584                "private" => Self::Private,
3585                _ => Self::UnknownValue(visibility::UnknownValue(
3586                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3587                )),
3588            }
3589        }
3590    }
3591
3592    impl serde::ser::Serialize for Visibility {
3593        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3594        where
3595            S: serde::Serializer,
3596        {
3597            match self {
3598                Self::Public => serializer.serialize_str("public"),
3599                Self::Private => serializer.serialize_str("private"),
3600                Self::UnknownValue(u) => u.0.serialize(serializer),
3601            }
3602        }
3603    }
3604
3605    impl<'de> serde::de::Deserialize<'de> for Visibility {
3606        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3607        where
3608            D: serde::Deserializer<'de>,
3609        {
3610            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<Visibility>::new(
3611                "..ManagedZone.visibility",
3612            ))
3613        }
3614    }
3615}
3616
3617/// Cloud Logging configurations for publicly visible zones.
3618#[derive(Clone, Default, PartialEq)]
3619#[non_exhaustive]
3620pub struct ManagedZoneCloudLoggingConfig {
3621    /// If set, enable query logging for this ManagedZone. False by default, making logging opt-in.
3622    pub enable_logging: std::option::Option<bool>,
3623
3624    #[allow(missing_docs)]
3625    pub kind: std::option::Option<std::string::String>,
3626
3627    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3628}
3629
3630impl ManagedZoneCloudLoggingConfig {
3631    /// Creates a new default instance.
3632    pub fn new() -> Self {
3633        std::default::Default::default()
3634    }
3635
3636    /// Sets the value of [enable_logging][crate::model::ManagedZoneCloudLoggingConfig::enable_logging].
3637    ///
3638    /// # Example
3639    /// ```ignore,no_run
3640    /// # use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
3641    /// let x = ManagedZoneCloudLoggingConfig::new().set_enable_logging(true);
3642    /// ```
3643    pub fn set_enable_logging<T>(mut self, v: T) -> Self
3644    where
3645        T: std::convert::Into<bool>,
3646    {
3647        self.enable_logging = std::option::Option::Some(v.into());
3648        self
3649    }
3650
3651    /// Sets or clears the value of [enable_logging][crate::model::ManagedZoneCloudLoggingConfig::enable_logging].
3652    ///
3653    /// # Example
3654    /// ```ignore,no_run
3655    /// # use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
3656    /// let x = ManagedZoneCloudLoggingConfig::new().set_or_clear_enable_logging(Some(false));
3657    /// let x = ManagedZoneCloudLoggingConfig::new().set_or_clear_enable_logging(None::<bool>);
3658    /// ```
3659    pub fn set_or_clear_enable_logging<T>(mut self, v: std::option::Option<T>) -> Self
3660    where
3661        T: std::convert::Into<bool>,
3662    {
3663        self.enable_logging = v.map(|x| x.into());
3664        self
3665    }
3666
3667    /// Sets the value of [kind][crate::model::ManagedZoneCloudLoggingConfig::kind].
3668    ///
3669    /// # Example
3670    /// ```ignore,no_run
3671    /// # use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
3672    /// let x = ManagedZoneCloudLoggingConfig::new().set_kind("example");
3673    /// ```
3674    pub fn set_kind<T>(mut self, v: T) -> Self
3675    where
3676        T: std::convert::Into<std::string::String>,
3677    {
3678        self.kind = std::option::Option::Some(v.into());
3679        self
3680    }
3681
3682    /// Sets or clears the value of [kind][crate::model::ManagedZoneCloudLoggingConfig::kind].
3683    ///
3684    /// # Example
3685    /// ```ignore,no_run
3686    /// # use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
3687    /// let x = ManagedZoneCloudLoggingConfig::new().set_or_clear_kind(Some("example"));
3688    /// let x = ManagedZoneCloudLoggingConfig::new().set_or_clear_kind(None::<String>);
3689    /// ```
3690    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
3691    where
3692        T: std::convert::Into<std::string::String>,
3693    {
3694        self.kind = v.map(|x| x.into());
3695        self
3696    }
3697}
3698
3699impl wkt::message::Message for ManagedZoneCloudLoggingConfig {
3700    fn typename() -> &'static str {
3701        "type.googleapis.com/.ManagedZoneCloudLoggingConfig"
3702    }
3703}
3704
3705#[allow(missing_docs)]
3706#[derive(Clone, Default, PartialEq)]
3707#[non_exhaustive]
3708pub struct ManagedZoneDnsSecConfig {
3709    /// Specifies parameters for generating initial DnsKeys for this ManagedZone. Can only be changed while the state is OFF.
3710    pub default_key_specs: std::vec::Vec<crate::model::DnsKeySpec>,
3711
3712    #[allow(missing_docs)]
3713    pub kind: std::option::Option<std::string::String>,
3714
3715    /// Specifies the mechanism for authenticated denial-of-existence responses. Can only be changed while the state is OFF.
3716    pub non_existence: std::option::Option<crate::model::managed_zone_dns_sec_config::NonExistence>,
3717
3718    /// Specifies whether DNSSEC is enabled, and what mode it is in.
3719    pub state: std::option::Option<crate::model::managed_zone_dns_sec_config::State>,
3720
3721    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3722}
3723
3724impl ManagedZoneDnsSecConfig {
3725    /// Creates a new default instance.
3726    pub fn new() -> Self {
3727        std::default::Default::default()
3728    }
3729
3730    /// Sets the value of [default_key_specs][crate::model::ManagedZoneDnsSecConfig::default_key_specs].
3731    ///
3732    /// # Example
3733    /// ```ignore,no_run
3734    /// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
3735    /// use google_cloud_dns_v1::model::DnsKeySpec;
3736    /// let x = ManagedZoneDnsSecConfig::new()
3737    ///     .set_default_key_specs([
3738    ///         DnsKeySpec::default()/* use setters */,
3739    ///         DnsKeySpec::default()/* use (different) setters */,
3740    ///     ]);
3741    /// ```
3742    pub fn set_default_key_specs<T, V>(mut self, v: T) -> Self
3743    where
3744        T: std::iter::IntoIterator<Item = V>,
3745        V: std::convert::Into<crate::model::DnsKeySpec>,
3746    {
3747        use std::iter::Iterator;
3748        self.default_key_specs = v.into_iter().map(|i| i.into()).collect();
3749        self
3750    }
3751
3752    /// Sets the value of [kind][crate::model::ManagedZoneDnsSecConfig::kind].
3753    ///
3754    /// # Example
3755    /// ```ignore,no_run
3756    /// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
3757    /// let x = ManagedZoneDnsSecConfig::new().set_kind("example");
3758    /// ```
3759    pub fn set_kind<T>(mut self, v: T) -> Self
3760    where
3761        T: std::convert::Into<std::string::String>,
3762    {
3763        self.kind = std::option::Option::Some(v.into());
3764        self
3765    }
3766
3767    /// Sets or clears the value of [kind][crate::model::ManagedZoneDnsSecConfig::kind].
3768    ///
3769    /// # Example
3770    /// ```ignore,no_run
3771    /// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
3772    /// let x = ManagedZoneDnsSecConfig::new().set_or_clear_kind(Some("example"));
3773    /// let x = ManagedZoneDnsSecConfig::new().set_or_clear_kind(None::<String>);
3774    /// ```
3775    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
3776    where
3777        T: std::convert::Into<std::string::String>,
3778    {
3779        self.kind = v.map(|x| x.into());
3780        self
3781    }
3782
3783    /// Sets the value of [non_existence][crate::model::ManagedZoneDnsSecConfig::non_existence].
3784    ///
3785    /// # Example
3786    /// ```ignore,no_run
3787    /// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
3788    /// use google_cloud_dns_v1::model::managed_zone_dns_sec_config::NonExistence;
3789    /// let x0 = ManagedZoneDnsSecConfig::new().set_non_existence(NonExistence::Nsec3);
3790    /// ```
3791    pub fn set_non_existence<T>(mut self, v: T) -> Self
3792    where
3793        T: std::convert::Into<crate::model::managed_zone_dns_sec_config::NonExistence>,
3794    {
3795        self.non_existence = std::option::Option::Some(v.into());
3796        self
3797    }
3798
3799    /// Sets or clears the value of [non_existence][crate::model::ManagedZoneDnsSecConfig::non_existence].
3800    ///
3801    /// # Example
3802    /// ```ignore,no_run
3803    /// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
3804    /// use google_cloud_dns_v1::model::managed_zone_dns_sec_config::NonExistence;
3805    /// let x0 = ManagedZoneDnsSecConfig::new().set_or_clear_non_existence(Some(NonExistence::Nsec3));
3806    /// let x_none = ManagedZoneDnsSecConfig::new().set_or_clear_non_existence(None::<NonExistence>);
3807    /// ```
3808    pub fn set_or_clear_non_existence<T>(mut self, v: std::option::Option<T>) -> Self
3809    where
3810        T: std::convert::Into<crate::model::managed_zone_dns_sec_config::NonExistence>,
3811    {
3812        self.non_existence = v.map(|x| x.into());
3813        self
3814    }
3815
3816    /// Sets the value of [state][crate::model::ManagedZoneDnsSecConfig::state].
3817    ///
3818    /// # Example
3819    /// ```ignore,no_run
3820    /// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
3821    /// use google_cloud_dns_v1::model::managed_zone_dns_sec_config::State;
3822    /// let x0 = ManagedZoneDnsSecConfig::new().set_state(State::On);
3823    /// let x1 = ManagedZoneDnsSecConfig::new().set_state(State::Transfer);
3824    /// ```
3825    pub fn set_state<T>(mut self, v: T) -> Self
3826    where
3827        T: std::convert::Into<crate::model::managed_zone_dns_sec_config::State>,
3828    {
3829        self.state = std::option::Option::Some(v.into());
3830        self
3831    }
3832
3833    /// Sets or clears the value of [state][crate::model::ManagedZoneDnsSecConfig::state].
3834    ///
3835    /// # Example
3836    /// ```ignore,no_run
3837    /// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
3838    /// use google_cloud_dns_v1::model::managed_zone_dns_sec_config::State;
3839    /// let x0 = ManagedZoneDnsSecConfig::new().set_or_clear_state(Some(State::On));
3840    /// let x1 = ManagedZoneDnsSecConfig::new().set_or_clear_state(Some(State::Transfer));
3841    /// let x_none = ManagedZoneDnsSecConfig::new().set_or_clear_state(None::<State>);
3842    /// ```
3843    pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
3844    where
3845        T: std::convert::Into<crate::model::managed_zone_dns_sec_config::State>,
3846    {
3847        self.state = v.map(|x| x.into());
3848        self
3849    }
3850}
3851
3852impl wkt::message::Message for ManagedZoneDnsSecConfig {
3853    fn typename() -> &'static str {
3854        "type.googleapis.com/.ManagedZoneDnsSecConfig"
3855    }
3856}
3857
3858/// Defines additional types related to [ManagedZoneDnsSecConfig].
3859pub mod managed_zone_dns_sec_config {
3860    #[allow(unused_imports)]
3861    use super::*;
3862
3863    /// The enumerated type for the [nonExistence][.ManagedZoneDnsSecConfig.nonExistence] field.
3864    ///
3865    /// # Working with unknown values
3866    ///
3867    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3868    /// additional enum variants at any time. Adding new variants is not considered
3869    /// a breaking change. Applications should write their code in anticipation of:
3870    ///
3871    /// - New values appearing in future releases of the client library, **and**
3872    /// - New values received dynamically, without application changes.
3873    ///
3874    /// Please consult the [Working with enums] section in the user guide for some
3875    /// guidelines.
3876    ///
3877    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3878    #[derive(Clone, Debug, PartialEq)]
3879    #[non_exhaustive]
3880    pub enum NonExistence {
3881        /// Indicates that Cloud DNS will sign records in the managed zone according to RFC 4034 and respond with NSEC records for names that do not exist.
3882        Nsec,
3883        /// Indicates that Cloud DNS will sign records in the managed zone according to RFC 5155 and respond with NSEC3 records for names that do not exist.
3884        Nsec3,
3885        /// If set, the enum was initialized with an unknown value.
3886        ///
3887        /// Applications can examine the value using [NonExistence::name].
3888        UnknownValue(non_existence::UnknownValue),
3889    }
3890
3891    #[doc(hidden)]
3892    pub mod non_existence {
3893        #[allow(unused_imports)]
3894        use super::*;
3895        #[derive(Clone, Debug, PartialEq)]
3896        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3897    }
3898
3899    impl NonExistence {
3900        /// Gets the enum value as a string.
3901        pub fn name(&self) -> std::option::Option<&str> {
3902            match self {
3903                Self::Nsec => std::option::Option::Some("nsec"),
3904                Self::Nsec3 => std::option::Option::Some("nsec3"),
3905                Self::UnknownValue(u) => u.0.name(),
3906            }
3907        }
3908    }
3909
3910    impl std::fmt::Display for NonExistence {
3911        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3912            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
3913        }
3914    }
3915
3916    impl std::convert::From<&str> for NonExistence {
3917        fn from(value: &str) -> Self {
3918            use std::string::ToString;
3919            match value {
3920                "nsec" => Self::Nsec,
3921                "nsec3" => Self::Nsec3,
3922                _ => Self::UnknownValue(non_existence::UnknownValue(
3923                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3924                )),
3925            }
3926        }
3927    }
3928
3929    impl serde::ser::Serialize for NonExistence {
3930        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3931        where
3932            S: serde::Serializer,
3933        {
3934            match self {
3935                Self::Nsec => serializer.serialize_str("nsec"),
3936                Self::Nsec3 => serializer.serialize_str("nsec3"),
3937                Self::UnknownValue(u) => u.0.serialize(serializer),
3938            }
3939        }
3940    }
3941
3942    impl<'de> serde::de::Deserialize<'de> for NonExistence {
3943        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3944        where
3945            D: serde::Deserializer<'de>,
3946        {
3947            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<NonExistence>::new(
3948                "..ManagedZoneDnsSecConfig.nonExistence",
3949            ))
3950        }
3951    }
3952
3953    /// The enumerated type for the [state][.ManagedZoneDnsSecConfig.state] field.
3954    ///
3955    /// # Working with unknown values
3956    ///
3957    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3958    /// additional enum variants at any time. Adding new variants is not considered
3959    /// a breaking change. Applications should write their code in anticipation of:
3960    ///
3961    /// - New values appearing in future releases of the client library, **and**
3962    /// - New values received dynamically, without application changes.
3963    ///
3964    /// Please consult the [Working with enums] section in the user guide for some
3965    /// guidelines.
3966    ///
3967    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3968    #[derive(Clone, Debug, PartialEq)]
3969    #[non_exhaustive]
3970    pub enum State {
3971        /// DNSSEC is disabled; the zone is not signed.
3972        Off,
3973        /// DNSSEC is enabled; the zone is signed and fully managed.
3974        On,
3975        /// DNSSEC is enabled, but in a "transfer" mode.
3976        Transfer,
3977        /// If set, the enum was initialized with an unknown value.
3978        ///
3979        /// Applications can examine the value using [State::name].
3980        UnknownValue(state::UnknownValue),
3981    }
3982
3983    #[doc(hidden)]
3984    pub mod state {
3985        #[allow(unused_imports)]
3986        use super::*;
3987        #[derive(Clone, Debug, PartialEq)]
3988        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3989    }
3990
3991    impl State {
3992        /// Gets the enum value as a string.
3993        pub fn name(&self) -> std::option::Option<&str> {
3994            match self {
3995                Self::Off => std::option::Option::Some("off"),
3996                Self::On => std::option::Option::Some("on"),
3997                Self::Transfer => std::option::Option::Some("transfer"),
3998                Self::UnknownValue(u) => u.0.name(),
3999            }
4000        }
4001    }
4002
4003    impl std::fmt::Display for State {
4004        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4005            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
4006        }
4007    }
4008
4009    impl std::convert::From<&str> for State {
4010        fn from(value: &str) -> Self {
4011            use std::string::ToString;
4012            match value {
4013                "off" => Self::Off,
4014                "on" => Self::On,
4015                "transfer" => Self::Transfer,
4016                _ => Self::UnknownValue(state::UnknownValue(
4017                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4018                )),
4019            }
4020        }
4021    }
4022
4023    impl serde::ser::Serialize for State {
4024        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4025        where
4026            S: serde::Serializer,
4027        {
4028            match self {
4029                Self::Off => serializer.serialize_str("off"),
4030                Self::On => serializer.serialize_str("on"),
4031                Self::Transfer => serializer.serialize_str("transfer"),
4032                Self::UnknownValue(u) => u.0.serialize(serializer),
4033            }
4034        }
4035    }
4036
4037    impl<'de> serde::de::Deserialize<'de> for State {
4038        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4039        where
4040            D: serde::Deserializer<'de>,
4041        {
4042            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<State>::new(
4043                "..ManagedZoneDnsSecConfig.state",
4044            ))
4045        }
4046    }
4047}
4048
4049#[allow(missing_docs)]
4050#[derive(Clone, Default, PartialEq)]
4051#[non_exhaustive]
4052pub struct ManagedZoneForwardingConfig {
4053    #[allow(missing_docs)]
4054    pub kind: std::option::Option<std::string::String>,
4055
4056    /// List of target name servers to forward to. Cloud DNS selects the best available name server if more than one target is given.
4057    pub target_name_servers:
4058        std::vec::Vec<crate::model::ManagedZoneForwardingConfigNameServerTarget>,
4059
4060    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4061}
4062
4063impl ManagedZoneForwardingConfig {
4064    /// Creates a new default instance.
4065    pub fn new() -> Self {
4066        std::default::Default::default()
4067    }
4068
4069    /// Sets the value of [kind][crate::model::ManagedZoneForwardingConfig::kind].
4070    ///
4071    /// # Example
4072    /// ```ignore,no_run
4073    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfig;
4074    /// let x = ManagedZoneForwardingConfig::new().set_kind("example");
4075    /// ```
4076    pub fn set_kind<T>(mut self, v: T) -> Self
4077    where
4078        T: std::convert::Into<std::string::String>,
4079    {
4080        self.kind = std::option::Option::Some(v.into());
4081        self
4082    }
4083
4084    /// Sets or clears the value of [kind][crate::model::ManagedZoneForwardingConfig::kind].
4085    ///
4086    /// # Example
4087    /// ```ignore,no_run
4088    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfig;
4089    /// let x = ManagedZoneForwardingConfig::new().set_or_clear_kind(Some("example"));
4090    /// let x = ManagedZoneForwardingConfig::new().set_or_clear_kind(None::<String>);
4091    /// ```
4092    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
4093    where
4094        T: std::convert::Into<std::string::String>,
4095    {
4096        self.kind = v.map(|x| x.into());
4097        self
4098    }
4099
4100    /// Sets the value of [target_name_servers][crate::model::ManagedZoneForwardingConfig::target_name_servers].
4101    ///
4102    /// # Example
4103    /// ```ignore,no_run
4104    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfig;
4105    /// use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
4106    /// let x = ManagedZoneForwardingConfig::new()
4107    ///     .set_target_name_servers([
4108    ///         ManagedZoneForwardingConfigNameServerTarget::default()/* use setters */,
4109    ///         ManagedZoneForwardingConfigNameServerTarget::default()/* use (different) setters */,
4110    ///     ]);
4111    /// ```
4112    pub fn set_target_name_servers<T, V>(mut self, v: T) -> Self
4113    where
4114        T: std::iter::IntoIterator<Item = V>,
4115        V: std::convert::Into<crate::model::ManagedZoneForwardingConfigNameServerTarget>,
4116    {
4117        use std::iter::Iterator;
4118        self.target_name_servers = v.into_iter().map(|i| i.into()).collect();
4119        self
4120    }
4121}
4122
4123impl wkt::message::Message for ManagedZoneForwardingConfig {
4124    fn typename() -> &'static str {
4125        "type.googleapis.com/.ManagedZoneForwardingConfig"
4126    }
4127}
4128
4129#[allow(missing_docs)]
4130#[derive(Clone, Default, PartialEq)]
4131#[non_exhaustive]
4132pub struct ManagedZoneForwardingConfigNameServerTarget {
4133    /// Fully qualified domain name for the forwarding target.
4134    pub domain_name: std::option::Option<std::string::String>,
4135
4136    /// Forwarding path for this NameServerTarget. If unset or set to DEFAULT, Cloud DNS makes forwarding decisions based on IP address ranges; that is, RFC1918 addresses go to the VPC network, non-RFC1918 addresses go to the internet. When set to PRIVATE, Cloud DNS always sends queries through the VPC network for this target.
4137    pub forwarding_path: std::option::Option<
4138        crate::model::managed_zone_forwarding_config_name_server_target::ForwardingPath,
4139    >,
4140
4141    /// IPv4 address of a target name server.
4142    pub ipv_4_address: std::option::Option<std::string::String>,
4143
4144    /// IPv6 address of a target name server. Does not accept both fields (ipv4 & ipv6) being populated. Public preview as of November 2022.
4145    pub ipv_6_address: std::option::Option<std::string::String>,
4146
4147    #[allow(missing_docs)]
4148    pub kind: std::option::Option<std::string::String>,
4149
4150    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4151}
4152
4153impl ManagedZoneForwardingConfigNameServerTarget {
4154    /// Creates a new default instance.
4155    pub fn new() -> Self {
4156        std::default::Default::default()
4157    }
4158
4159    /// Sets the value of [domain_name][crate::model::ManagedZoneForwardingConfigNameServerTarget::domain_name].
4160    ///
4161    /// # Example
4162    /// ```ignore,no_run
4163    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
4164    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_domain_name("example");
4165    /// ```
4166    pub fn set_domain_name<T>(mut self, v: T) -> Self
4167    where
4168        T: std::convert::Into<std::string::String>,
4169    {
4170        self.domain_name = std::option::Option::Some(v.into());
4171        self
4172    }
4173
4174    /// Sets or clears the value of [domain_name][crate::model::ManagedZoneForwardingConfigNameServerTarget::domain_name].
4175    ///
4176    /// # Example
4177    /// ```ignore,no_run
4178    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
4179    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_domain_name(Some("example"));
4180    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_domain_name(None::<String>);
4181    /// ```
4182    pub fn set_or_clear_domain_name<T>(mut self, v: std::option::Option<T>) -> Self
4183    where
4184        T: std::convert::Into<std::string::String>,
4185    {
4186        self.domain_name = v.map(|x| x.into());
4187        self
4188    }
4189
4190    /// Sets the value of [forwarding_path][crate::model::ManagedZoneForwardingConfigNameServerTarget::forwarding_path].
4191    ///
4192    /// # Example
4193    /// ```ignore,no_run
4194    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
4195    /// use google_cloud_dns_v1::model::managed_zone_forwarding_config_name_server_target::ForwardingPath;
4196    /// let x0 = ManagedZoneForwardingConfigNameServerTarget::new().set_forwarding_path(ForwardingPath::Private);
4197    /// ```
4198    pub fn set_forwarding_path<T>(mut self, v: T) -> Self
4199    where
4200        T: std::convert::Into<
4201                crate::model::managed_zone_forwarding_config_name_server_target::ForwardingPath,
4202            >,
4203    {
4204        self.forwarding_path = std::option::Option::Some(v.into());
4205        self
4206    }
4207
4208    /// Sets or clears the value of [forwarding_path][crate::model::ManagedZoneForwardingConfigNameServerTarget::forwarding_path].
4209    ///
4210    /// # Example
4211    /// ```ignore,no_run
4212    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
4213    /// use google_cloud_dns_v1::model::managed_zone_forwarding_config_name_server_target::ForwardingPath;
4214    /// let x0 = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_forwarding_path(Some(ForwardingPath::Private));
4215    /// let x_none = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_forwarding_path(None::<ForwardingPath>);
4216    /// ```
4217    pub fn set_or_clear_forwarding_path<T>(mut self, v: std::option::Option<T>) -> Self
4218    where
4219        T: std::convert::Into<
4220                crate::model::managed_zone_forwarding_config_name_server_target::ForwardingPath,
4221            >,
4222    {
4223        self.forwarding_path = v.map(|x| x.into());
4224        self
4225    }
4226
4227    /// Sets the value of [ipv_4_address][crate::model::ManagedZoneForwardingConfigNameServerTarget::ipv_4_address].
4228    ///
4229    /// # Example
4230    /// ```ignore,no_run
4231    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
4232    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_ipv_4_address("example");
4233    /// ```
4234    pub fn set_ipv_4_address<T>(mut self, v: T) -> Self
4235    where
4236        T: std::convert::Into<std::string::String>,
4237    {
4238        self.ipv_4_address = std::option::Option::Some(v.into());
4239        self
4240    }
4241
4242    /// Sets or clears the value of [ipv_4_address][crate::model::ManagedZoneForwardingConfigNameServerTarget::ipv_4_address].
4243    ///
4244    /// # Example
4245    /// ```ignore,no_run
4246    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
4247    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_ipv_4_address(Some("example"));
4248    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_ipv_4_address(None::<String>);
4249    /// ```
4250    pub fn set_or_clear_ipv_4_address<T>(mut self, v: std::option::Option<T>) -> Self
4251    where
4252        T: std::convert::Into<std::string::String>,
4253    {
4254        self.ipv_4_address = v.map(|x| x.into());
4255        self
4256    }
4257
4258    /// Sets the value of [ipv_6_address][crate::model::ManagedZoneForwardingConfigNameServerTarget::ipv_6_address].
4259    ///
4260    /// # Example
4261    /// ```ignore,no_run
4262    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
4263    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_ipv_6_address("example");
4264    /// ```
4265    pub fn set_ipv_6_address<T>(mut self, v: T) -> Self
4266    where
4267        T: std::convert::Into<std::string::String>,
4268    {
4269        self.ipv_6_address = std::option::Option::Some(v.into());
4270        self
4271    }
4272
4273    /// Sets or clears the value of [ipv_6_address][crate::model::ManagedZoneForwardingConfigNameServerTarget::ipv_6_address].
4274    ///
4275    /// # Example
4276    /// ```ignore,no_run
4277    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
4278    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_ipv_6_address(Some("example"));
4279    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_ipv_6_address(None::<String>);
4280    /// ```
4281    pub fn set_or_clear_ipv_6_address<T>(mut self, v: std::option::Option<T>) -> Self
4282    where
4283        T: std::convert::Into<std::string::String>,
4284    {
4285        self.ipv_6_address = v.map(|x| x.into());
4286        self
4287    }
4288
4289    /// Sets the value of [kind][crate::model::ManagedZoneForwardingConfigNameServerTarget::kind].
4290    ///
4291    /// # Example
4292    /// ```ignore,no_run
4293    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
4294    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_kind("example");
4295    /// ```
4296    pub fn set_kind<T>(mut self, v: T) -> Self
4297    where
4298        T: std::convert::Into<std::string::String>,
4299    {
4300        self.kind = std::option::Option::Some(v.into());
4301        self
4302    }
4303
4304    /// Sets or clears the value of [kind][crate::model::ManagedZoneForwardingConfigNameServerTarget::kind].
4305    ///
4306    /// # Example
4307    /// ```ignore,no_run
4308    /// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
4309    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_kind(Some("example"));
4310    /// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_kind(None::<String>);
4311    /// ```
4312    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
4313    where
4314        T: std::convert::Into<std::string::String>,
4315    {
4316        self.kind = v.map(|x| x.into());
4317        self
4318    }
4319}
4320
4321impl wkt::message::Message for ManagedZoneForwardingConfigNameServerTarget {
4322    fn typename() -> &'static str {
4323        "type.googleapis.com/.ManagedZoneForwardingConfigNameServerTarget"
4324    }
4325}
4326
4327/// Defines additional types related to [ManagedZoneForwardingConfigNameServerTarget].
4328pub mod managed_zone_forwarding_config_name_server_target {
4329    #[allow(unused_imports)]
4330    use super::*;
4331
4332    /// The enumerated type for the [forwardingPath][.ManagedZoneForwardingConfigNameServerTarget.forwardingPath] field.
4333    ///
4334    /// # Working with unknown values
4335    ///
4336    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4337    /// additional enum variants at any time. Adding new variants is not considered
4338    /// a breaking change. Applications should write their code in anticipation of:
4339    ///
4340    /// - New values appearing in future releases of the client library, **and**
4341    /// - New values received dynamically, without application changes.
4342    ///
4343    /// Please consult the [Working with enums] section in the user guide for some
4344    /// guidelines.
4345    ///
4346    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4347    #[derive(Clone, Debug, PartialEq)]
4348    #[non_exhaustive]
4349    pub enum ForwardingPath {
4350        /// Cloud DNS makes forwarding decisions based on address ranges; that is, RFC1918 addresses forward to the target through the VPC and non-RFC1918 addresses forward to the target through the internet
4351        Default,
4352        /// Cloud DNS always forwards to this target through the VPC.
4353        Private,
4354        /// If set, the enum was initialized with an unknown value.
4355        ///
4356        /// Applications can examine the value using [ForwardingPath::name].
4357        UnknownValue(forwarding_path::UnknownValue),
4358    }
4359
4360    #[doc(hidden)]
4361    pub mod forwarding_path {
4362        #[allow(unused_imports)]
4363        use super::*;
4364        #[derive(Clone, Debug, PartialEq)]
4365        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4366    }
4367
4368    impl ForwardingPath {
4369        /// Gets the enum value as a string.
4370        pub fn name(&self) -> std::option::Option<&str> {
4371            match self {
4372                Self::Default => std::option::Option::Some("default"),
4373                Self::Private => std::option::Option::Some("private"),
4374                Self::UnknownValue(u) => u.0.name(),
4375            }
4376        }
4377    }
4378
4379    impl std::fmt::Display for ForwardingPath {
4380        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4381            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
4382        }
4383    }
4384
4385    impl std::convert::From<&str> for ForwardingPath {
4386        fn from(value: &str) -> Self {
4387            use std::string::ToString;
4388            match value {
4389                "default" => Self::Default,
4390                "private" => Self::Private,
4391                _ => Self::UnknownValue(forwarding_path::UnknownValue(
4392                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4393                )),
4394            }
4395        }
4396    }
4397
4398    impl serde::ser::Serialize for ForwardingPath {
4399        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4400        where
4401            S: serde::Serializer,
4402        {
4403            match self {
4404                Self::Default => serializer.serialize_str("default"),
4405                Self::Private => serializer.serialize_str("private"),
4406                Self::UnknownValue(u) => u.0.serialize(serializer),
4407            }
4408        }
4409    }
4410
4411    impl<'de> serde::de::Deserialize<'de> for ForwardingPath {
4412        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4413        where
4414            D: serde::Deserializer<'de>,
4415        {
4416            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<ForwardingPath>::new(
4417                "..ManagedZoneForwardingConfigNameServerTarget.forwardingPath",
4418            ))
4419        }
4420    }
4421}
4422
4423#[allow(missing_docs)]
4424#[derive(Clone, Default, PartialEq)]
4425#[non_exhaustive]
4426pub struct ManagedZoneOperationsListResponse {
4427    /// Output only. Type of resource.
4428    pub kind: std::option::Option<std::string::String>,
4429
4430    /// This field indicates that more results are available beyond the last page displayed. To fetch the results, make another list request and use this value as your page token. This lets you retrieve the complete contents of a very large collection one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned are an inconsistent view of the collection. You can't retrieve a consistent snapshot of a collection larger than the maximum page size.
4431    pub next_page_token: std::option::Option<std::string::String>,
4432
4433    /// The operation resources.
4434    pub operations: std::vec::Vec<crate::model::Operation>,
4435
4436    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4437}
4438
4439impl ManagedZoneOperationsListResponse {
4440    /// Creates a new default instance.
4441    pub fn new() -> Self {
4442        std::default::Default::default()
4443    }
4444
4445    /// Sets the value of [kind][crate::model::ManagedZoneOperationsListResponse::kind].
4446    ///
4447    /// # Example
4448    /// ```ignore,no_run
4449    /// # use google_cloud_dns_v1::model::ManagedZoneOperationsListResponse;
4450    /// let x = ManagedZoneOperationsListResponse::new().set_kind("example");
4451    /// ```
4452    pub fn set_kind<T>(mut self, v: T) -> Self
4453    where
4454        T: std::convert::Into<std::string::String>,
4455    {
4456        self.kind = std::option::Option::Some(v.into());
4457        self
4458    }
4459
4460    /// Sets or clears the value of [kind][crate::model::ManagedZoneOperationsListResponse::kind].
4461    ///
4462    /// # Example
4463    /// ```ignore,no_run
4464    /// # use google_cloud_dns_v1::model::ManagedZoneOperationsListResponse;
4465    /// let x = ManagedZoneOperationsListResponse::new().set_or_clear_kind(Some("example"));
4466    /// let x = ManagedZoneOperationsListResponse::new().set_or_clear_kind(None::<String>);
4467    /// ```
4468    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
4469    where
4470        T: std::convert::Into<std::string::String>,
4471    {
4472        self.kind = v.map(|x| x.into());
4473        self
4474    }
4475
4476    /// Sets the value of [next_page_token][crate::model::ManagedZoneOperationsListResponse::next_page_token].
4477    ///
4478    /// # Example
4479    /// ```ignore,no_run
4480    /// # use google_cloud_dns_v1::model::ManagedZoneOperationsListResponse;
4481    /// let x = ManagedZoneOperationsListResponse::new().set_next_page_token("example");
4482    /// ```
4483    pub fn set_next_page_token<T>(mut self, v: T) -> Self
4484    where
4485        T: std::convert::Into<std::string::String>,
4486    {
4487        self.next_page_token = std::option::Option::Some(v.into());
4488        self
4489    }
4490
4491    /// Sets or clears the value of [next_page_token][crate::model::ManagedZoneOperationsListResponse::next_page_token].
4492    ///
4493    /// # Example
4494    /// ```ignore,no_run
4495    /// # use google_cloud_dns_v1::model::ManagedZoneOperationsListResponse;
4496    /// let x = ManagedZoneOperationsListResponse::new().set_or_clear_next_page_token(Some("example"));
4497    /// let x = ManagedZoneOperationsListResponse::new().set_or_clear_next_page_token(None::<String>);
4498    /// ```
4499    pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
4500    where
4501        T: std::convert::Into<std::string::String>,
4502    {
4503        self.next_page_token = v.map(|x| x.into());
4504        self
4505    }
4506
4507    /// Sets the value of [operations][crate::model::ManagedZoneOperationsListResponse::operations].
4508    ///
4509    /// # Example
4510    /// ```ignore,no_run
4511    /// # use google_cloud_dns_v1::model::ManagedZoneOperationsListResponse;
4512    /// use google_cloud_dns_v1::model::Operation;
4513    /// let x = ManagedZoneOperationsListResponse::new()
4514    ///     .set_operations([
4515    ///         Operation::default()/* use setters */,
4516    ///         Operation::default()/* use (different) setters */,
4517    ///     ]);
4518    /// ```
4519    pub fn set_operations<T, V>(mut self, v: T) -> Self
4520    where
4521        T: std::iter::IntoIterator<Item = V>,
4522        V: std::convert::Into<crate::model::Operation>,
4523    {
4524        use std::iter::Iterator;
4525        self.operations = v.into_iter().map(|i| i.into()).collect();
4526        self
4527    }
4528}
4529
4530impl wkt::message::Message for ManagedZoneOperationsListResponse {
4531    fn typename() -> &'static str {
4532        "type.googleapis.com/.ManagedZoneOperationsListResponse"
4533    }
4534}
4535
4536#[doc(hidden)]
4537impl google_cloud_gax::paginator::internal::PageableResponse for ManagedZoneOperationsListResponse {
4538    type PageItem = crate::model::Operation;
4539
4540    fn items(self) -> std::vec::Vec<Self::PageItem> {
4541        self.operations
4542    }
4543
4544    fn next_page_token(&self) -> std::string::String {
4545        use std::clone::Clone;
4546        self.next_page_token.clone().unwrap_or_default()
4547    }
4548}
4549
4550#[allow(missing_docs)]
4551#[derive(Clone, Default, PartialEq)]
4552#[non_exhaustive]
4553pub struct ManagedZonePeeringConfig {
4554    #[allow(missing_docs)]
4555    pub kind: std::option::Option<std::string::String>,
4556
4557    /// The network with which to peer.
4558    pub target_network: std::option::Option<crate::model::ManagedZonePeeringConfigTargetNetwork>,
4559
4560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4561}
4562
4563impl ManagedZonePeeringConfig {
4564    /// Creates a new default instance.
4565    pub fn new() -> Self {
4566        std::default::Default::default()
4567    }
4568
4569    /// Sets the value of [kind][crate::model::ManagedZonePeeringConfig::kind].
4570    ///
4571    /// # Example
4572    /// ```ignore,no_run
4573    /// # use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
4574    /// let x = ManagedZonePeeringConfig::new().set_kind("example");
4575    /// ```
4576    pub fn set_kind<T>(mut self, v: T) -> Self
4577    where
4578        T: std::convert::Into<std::string::String>,
4579    {
4580        self.kind = std::option::Option::Some(v.into());
4581        self
4582    }
4583
4584    /// Sets or clears the value of [kind][crate::model::ManagedZonePeeringConfig::kind].
4585    ///
4586    /// # Example
4587    /// ```ignore,no_run
4588    /// # use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
4589    /// let x = ManagedZonePeeringConfig::new().set_or_clear_kind(Some("example"));
4590    /// let x = ManagedZonePeeringConfig::new().set_or_clear_kind(None::<String>);
4591    /// ```
4592    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
4593    where
4594        T: std::convert::Into<std::string::String>,
4595    {
4596        self.kind = v.map(|x| x.into());
4597        self
4598    }
4599
4600    /// Sets the value of [target_network][crate::model::ManagedZonePeeringConfig::target_network].
4601    ///
4602    /// # Example
4603    /// ```ignore,no_run
4604    /// # use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
4605    /// use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
4606    /// let x = ManagedZonePeeringConfig::new().set_target_network(ManagedZonePeeringConfigTargetNetwork::default()/* use setters */);
4607    /// ```
4608    pub fn set_target_network<T>(mut self, v: T) -> Self
4609    where
4610        T: std::convert::Into<crate::model::ManagedZonePeeringConfigTargetNetwork>,
4611    {
4612        self.target_network = std::option::Option::Some(v.into());
4613        self
4614    }
4615
4616    /// Sets or clears the value of [target_network][crate::model::ManagedZonePeeringConfig::target_network].
4617    ///
4618    /// # Example
4619    /// ```ignore,no_run
4620    /// # use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
4621    /// use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
4622    /// let x = ManagedZonePeeringConfig::new().set_or_clear_target_network(Some(ManagedZonePeeringConfigTargetNetwork::default()/* use setters */));
4623    /// let x = ManagedZonePeeringConfig::new().set_or_clear_target_network(None::<ManagedZonePeeringConfigTargetNetwork>);
4624    /// ```
4625    pub fn set_or_clear_target_network<T>(mut self, v: std::option::Option<T>) -> Self
4626    where
4627        T: std::convert::Into<crate::model::ManagedZonePeeringConfigTargetNetwork>,
4628    {
4629        self.target_network = v.map(|x| x.into());
4630        self
4631    }
4632}
4633
4634impl wkt::message::Message for ManagedZonePeeringConfig {
4635    fn typename() -> &'static str {
4636        "type.googleapis.com/.ManagedZonePeeringConfig"
4637    }
4638}
4639
4640#[allow(missing_docs)]
4641#[derive(Clone, Default, PartialEq)]
4642#[non_exhaustive]
4643pub struct ManagedZonePeeringConfigTargetNetwork {
4644    /// The time at which the zone was deactivated, in RFC 3339 date-time format. An empty string indicates that the peering connection is active. The producer network can deactivate a zone. The zone is automatically deactivated if the producer network that the zone targeted is deleted. Output only.
4645    pub deactivate_time: std::option::Option<std::string::String>,
4646
4647    #[allow(missing_docs)]
4648    pub kind: std::option::Option<std::string::String>,
4649
4650    /// The fully qualified URL of the VPC network to forward queries to. This should be formatted like `<https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}>`
4651    pub network_url: std::option::Option<std::string::String>,
4652
4653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4654}
4655
4656impl ManagedZonePeeringConfigTargetNetwork {
4657    /// Creates a new default instance.
4658    pub fn new() -> Self {
4659        std::default::Default::default()
4660    }
4661
4662    /// Sets the value of [deactivate_time][crate::model::ManagedZonePeeringConfigTargetNetwork::deactivate_time].
4663    ///
4664    /// # Example
4665    /// ```ignore,no_run
4666    /// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
4667    /// let x = ManagedZonePeeringConfigTargetNetwork::new().set_deactivate_time("example");
4668    /// ```
4669    pub fn set_deactivate_time<T>(mut self, v: T) -> Self
4670    where
4671        T: std::convert::Into<std::string::String>,
4672    {
4673        self.deactivate_time = std::option::Option::Some(v.into());
4674        self
4675    }
4676
4677    /// Sets or clears the value of [deactivate_time][crate::model::ManagedZonePeeringConfigTargetNetwork::deactivate_time].
4678    ///
4679    /// # Example
4680    /// ```ignore,no_run
4681    /// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
4682    /// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_deactivate_time(Some("example"));
4683    /// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_deactivate_time(None::<String>);
4684    /// ```
4685    pub fn set_or_clear_deactivate_time<T>(mut self, v: std::option::Option<T>) -> Self
4686    where
4687        T: std::convert::Into<std::string::String>,
4688    {
4689        self.deactivate_time = v.map(|x| x.into());
4690        self
4691    }
4692
4693    /// Sets the value of [kind][crate::model::ManagedZonePeeringConfigTargetNetwork::kind].
4694    ///
4695    /// # Example
4696    /// ```ignore,no_run
4697    /// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
4698    /// let x = ManagedZonePeeringConfigTargetNetwork::new().set_kind("example");
4699    /// ```
4700    pub fn set_kind<T>(mut self, v: T) -> Self
4701    where
4702        T: std::convert::Into<std::string::String>,
4703    {
4704        self.kind = std::option::Option::Some(v.into());
4705        self
4706    }
4707
4708    /// Sets or clears the value of [kind][crate::model::ManagedZonePeeringConfigTargetNetwork::kind].
4709    ///
4710    /// # Example
4711    /// ```ignore,no_run
4712    /// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
4713    /// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_kind(Some("example"));
4714    /// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_kind(None::<String>);
4715    /// ```
4716    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
4717    where
4718        T: std::convert::Into<std::string::String>,
4719    {
4720        self.kind = v.map(|x| x.into());
4721        self
4722    }
4723
4724    /// Sets the value of [network_url][crate::model::ManagedZonePeeringConfigTargetNetwork::network_url].
4725    ///
4726    /// # Example
4727    /// ```ignore,no_run
4728    /// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
4729    /// let x = ManagedZonePeeringConfigTargetNetwork::new().set_network_url("example");
4730    /// ```
4731    pub fn set_network_url<T>(mut self, v: T) -> Self
4732    where
4733        T: std::convert::Into<std::string::String>,
4734    {
4735        self.network_url = std::option::Option::Some(v.into());
4736        self
4737    }
4738
4739    /// Sets or clears the value of [network_url][crate::model::ManagedZonePeeringConfigTargetNetwork::network_url].
4740    ///
4741    /// # Example
4742    /// ```ignore,no_run
4743    /// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
4744    /// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_network_url(Some("example"));
4745    /// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_network_url(None::<String>);
4746    /// ```
4747    pub fn set_or_clear_network_url<T>(mut self, v: std::option::Option<T>) -> Self
4748    where
4749        T: std::convert::Into<std::string::String>,
4750    {
4751        self.network_url = v.map(|x| x.into());
4752        self
4753    }
4754}
4755
4756impl wkt::message::Message for ManagedZonePeeringConfigTargetNetwork {
4757    fn typename() -> &'static str {
4758        "type.googleapis.com/.ManagedZonePeeringConfigTargetNetwork"
4759    }
4760}
4761
4762#[allow(missing_docs)]
4763#[derive(Clone, Default, PartialEq)]
4764#[non_exhaustive]
4765pub struct ManagedZonePrivateVisibilityConfig {
4766    /// The list of Google Kubernetes Engine clusters that can see this zone.
4767    pub gke_clusters: std::vec::Vec<crate::model::ManagedZonePrivateVisibilityConfigGKECluster>,
4768
4769    #[allow(missing_docs)]
4770    pub kind: std::option::Option<std::string::String>,
4771
4772    /// The list of VPC networks that can see this zone.
4773    pub networks: std::vec::Vec<crate::model::ManagedZonePrivateVisibilityConfigNetwork>,
4774
4775    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4776}
4777
4778impl ManagedZonePrivateVisibilityConfig {
4779    /// Creates a new default instance.
4780    pub fn new() -> Self {
4781        std::default::Default::default()
4782    }
4783
4784    /// Sets the value of [gke_clusters][crate::model::ManagedZonePrivateVisibilityConfig::gke_clusters].
4785    ///
4786    /// # Example
4787    /// ```ignore,no_run
4788    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
4789    /// use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigGKECluster;
4790    /// let x = ManagedZonePrivateVisibilityConfig::new()
4791    ///     .set_gke_clusters([
4792    ///         ManagedZonePrivateVisibilityConfigGKECluster::default()/* use setters */,
4793    ///         ManagedZonePrivateVisibilityConfigGKECluster::default()/* use (different) setters */,
4794    ///     ]);
4795    /// ```
4796    pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
4797    where
4798        T: std::iter::IntoIterator<Item = V>,
4799        V: std::convert::Into<crate::model::ManagedZonePrivateVisibilityConfigGKECluster>,
4800    {
4801        use std::iter::Iterator;
4802        self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
4803        self
4804    }
4805
4806    /// Sets the value of [kind][crate::model::ManagedZonePrivateVisibilityConfig::kind].
4807    ///
4808    /// # Example
4809    /// ```ignore,no_run
4810    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
4811    /// let x = ManagedZonePrivateVisibilityConfig::new().set_kind("example");
4812    /// ```
4813    pub fn set_kind<T>(mut self, v: T) -> Self
4814    where
4815        T: std::convert::Into<std::string::String>,
4816    {
4817        self.kind = std::option::Option::Some(v.into());
4818        self
4819    }
4820
4821    /// Sets or clears the value of [kind][crate::model::ManagedZonePrivateVisibilityConfig::kind].
4822    ///
4823    /// # Example
4824    /// ```ignore,no_run
4825    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
4826    /// let x = ManagedZonePrivateVisibilityConfig::new().set_or_clear_kind(Some("example"));
4827    /// let x = ManagedZonePrivateVisibilityConfig::new().set_or_clear_kind(None::<String>);
4828    /// ```
4829    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
4830    where
4831        T: std::convert::Into<std::string::String>,
4832    {
4833        self.kind = v.map(|x| x.into());
4834        self
4835    }
4836
4837    /// Sets the value of [networks][crate::model::ManagedZonePrivateVisibilityConfig::networks].
4838    ///
4839    /// # Example
4840    /// ```ignore,no_run
4841    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
4842    /// use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigNetwork;
4843    /// let x = ManagedZonePrivateVisibilityConfig::new()
4844    ///     .set_networks([
4845    ///         ManagedZonePrivateVisibilityConfigNetwork::default()/* use setters */,
4846    ///         ManagedZonePrivateVisibilityConfigNetwork::default()/* use (different) setters */,
4847    ///     ]);
4848    /// ```
4849    pub fn set_networks<T, V>(mut self, v: T) -> Self
4850    where
4851        T: std::iter::IntoIterator<Item = V>,
4852        V: std::convert::Into<crate::model::ManagedZonePrivateVisibilityConfigNetwork>,
4853    {
4854        use std::iter::Iterator;
4855        self.networks = v.into_iter().map(|i| i.into()).collect();
4856        self
4857    }
4858}
4859
4860impl wkt::message::Message for ManagedZonePrivateVisibilityConfig {
4861    fn typename() -> &'static str {
4862        "type.googleapis.com/.ManagedZonePrivateVisibilityConfig"
4863    }
4864}
4865
4866#[allow(missing_docs)]
4867#[derive(Clone, Default, PartialEq)]
4868#[non_exhaustive]
4869pub struct ManagedZonePrivateVisibilityConfigGKECluster {
4870    /// The resource name of the cluster to bind this ManagedZone to. This should be specified in the format like: projects/*/locations/*/clusters/*. This is referenced from GKE projects.locations.clusters.get API: <https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/get>
4871    pub gke_cluster_name: std::option::Option<std::string::String>,
4872
4873    #[allow(missing_docs)]
4874    pub kind: std::option::Option<std::string::String>,
4875
4876    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4877}
4878
4879impl ManagedZonePrivateVisibilityConfigGKECluster {
4880    /// Creates a new default instance.
4881    pub fn new() -> Self {
4882        std::default::Default::default()
4883    }
4884
4885    /// Sets the value of [gke_cluster_name][crate::model::ManagedZonePrivateVisibilityConfigGKECluster::gke_cluster_name].
4886    ///
4887    /// # Example
4888    /// ```ignore,no_run
4889    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigGKECluster;
4890    /// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_gke_cluster_name("example");
4891    /// ```
4892    pub fn set_gke_cluster_name<T>(mut self, v: T) -> Self
4893    where
4894        T: std::convert::Into<std::string::String>,
4895    {
4896        self.gke_cluster_name = std::option::Option::Some(v.into());
4897        self
4898    }
4899
4900    /// Sets or clears the value of [gke_cluster_name][crate::model::ManagedZonePrivateVisibilityConfigGKECluster::gke_cluster_name].
4901    ///
4902    /// # Example
4903    /// ```ignore,no_run
4904    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigGKECluster;
4905    /// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_or_clear_gke_cluster_name(Some("example"));
4906    /// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_or_clear_gke_cluster_name(None::<String>);
4907    /// ```
4908    pub fn set_or_clear_gke_cluster_name<T>(mut self, v: std::option::Option<T>) -> Self
4909    where
4910        T: std::convert::Into<std::string::String>,
4911    {
4912        self.gke_cluster_name = v.map(|x| x.into());
4913        self
4914    }
4915
4916    /// Sets the value of [kind][crate::model::ManagedZonePrivateVisibilityConfigGKECluster::kind].
4917    ///
4918    /// # Example
4919    /// ```ignore,no_run
4920    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigGKECluster;
4921    /// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_kind("example");
4922    /// ```
4923    pub fn set_kind<T>(mut self, v: T) -> Self
4924    where
4925        T: std::convert::Into<std::string::String>,
4926    {
4927        self.kind = std::option::Option::Some(v.into());
4928        self
4929    }
4930
4931    /// Sets or clears the value of [kind][crate::model::ManagedZonePrivateVisibilityConfigGKECluster::kind].
4932    ///
4933    /// # Example
4934    /// ```ignore,no_run
4935    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigGKECluster;
4936    /// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_or_clear_kind(Some("example"));
4937    /// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_or_clear_kind(None::<String>);
4938    /// ```
4939    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
4940    where
4941        T: std::convert::Into<std::string::String>,
4942    {
4943        self.kind = v.map(|x| x.into());
4944        self
4945    }
4946}
4947
4948impl wkt::message::Message for ManagedZonePrivateVisibilityConfigGKECluster {
4949    fn typename() -> &'static str {
4950        "type.googleapis.com/.ManagedZonePrivateVisibilityConfigGKECluster"
4951    }
4952}
4953
4954#[allow(missing_docs)]
4955#[derive(Clone, Default, PartialEq)]
4956#[non_exhaustive]
4957pub struct ManagedZonePrivateVisibilityConfigNetwork {
4958    #[allow(missing_docs)]
4959    pub kind: std::option::Option<std::string::String>,
4960
4961    /// The fully qualified URL of the VPC network to bind to. Format this URL like `<https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}>`
4962    pub network_url: std::option::Option<std::string::String>,
4963
4964    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4965}
4966
4967impl ManagedZonePrivateVisibilityConfigNetwork {
4968    /// Creates a new default instance.
4969    pub fn new() -> Self {
4970        std::default::Default::default()
4971    }
4972
4973    /// Sets the value of [kind][crate::model::ManagedZonePrivateVisibilityConfigNetwork::kind].
4974    ///
4975    /// # Example
4976    /// ```ignore,no_run
4977    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigNetwork;
4978    /// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_kind("example");
4979    /// ```
4980    pub fn set_kind<T>(mut self, v: T) -> Self
4981    where
4982        T: std::convert::Into<std::string::String>,
4983    {
4984        self.kind = std::option::Option::Some(v.into());
4985        self
4986    }
4987
4988    /// Sets or clears the value of [kind][crate::model::ManagedZonePrivateVisibilityConfigNetwork::kind].
4989    ///
4990    /// # Example
4991    /// ```ignore,no_run
4992    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigNetwork;
4993    /// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_or_clear_kind(Some("example"));
4994    /// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_or_clear_kind(None::<String>);
4995    /// ```
4996    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
4997    where
4998        T: std::convert::Into<std::string::String>,
4999    {
5000        self.kind = v.map(|x| x.into());
5001        self
5002    }
5003
5004    /// Sets the value of [network_url][crate::model::ManagedZonePrivateVisibilityConfigNetwork::network_url].
5005    ///
5006    /// # Example
5007    /// ```ignore,no_run
5008    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigNetwork;
5009    /// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_network_url("example");
5010    /// ```
5011    pub fn set_network_url<T>(mut self, v: T) -> Self
5012    where
5013        T: std::convert::Into<std::string::String>,
5014    {
5015        self.network_url = std::option::Option::Some(v.into());
5016        self
5017    }
5018
5019    /// Sets or clears the value of [network_url][crate::model::ManagedZonePrivateVisibilityConfigNetwork::network_url].
5020    ///
5021    /// # Example
5022    /// ```ignore,no_run
5023    /// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigNetwork;
5024    /// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_or_clear_network_url(Some("example"));
5025    /// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_or_clear_network_url(None::<String>);
5026    /// ```
5027    pub fn set_or_clear_network_url<T>(mut self, v: std::option::Option<T>) -> Self
5028    where
5029        T: std::convert::Into<std::string::String>,
5030    {
5031        self.network_url = v.map(|x| x.into());
5032        self
5033    }
5034}
5035
5036impl wkt::message::Message for ManagedZonePrivateVisibilityConfigNetwork {
5037    fn typename() -> &'static str {
5038        "type.googleapis.com/.ManagedZonePrivateVisibilityConfigNetwork"
5039    }
5040}
5041
5042#[allow(missing_docs)]
5043#[derive(Clone, Default, PartialEq)]
5044#[non_exhaustive]
5045pub struct ManagedZoneReverseLookupConfig {
5046    #[allow(missing_docs)]
5047    pub kind: std::option::Option<std::string::String>,
5048
5049    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5050}
5051
5052impl ManagedZoneReverseLookupConfig {
5053    /// Creates a new default instance.
5054    pub fn new() -> Self {
5055        std::default::Default::default()
5056    }
5057
5058    /// Sets the value of [kind][crate::model::ManagedZoneReverseLookupConfig::kind].
5059    ///
5060    /// # Example
5061    /// ```ignore,no_run
5062    /// # use google_cloud_dns_v1::model::ManagedZoneReverseLookupConfig;
5063    /// let x = ManagedZoneReverseLookupConfig::new().set_kind("example");
5064    /// ```
5065    pub fn set_kind<T>(mut self, v: T) -> Self
5066    where
5067        T: std::convert::Into<std::string::String>,
5068    {
5069        self.kind = std::option::Option::Some(v.into());
5070        self
5071    }
5072
5073    /// Sets or clears the value of [kind][crate::model::ManagedZoneReverseLookupConfig::kind].
5074    ///
5075    /// # Example
5076    /// ```ignore,no_run
5077    /// # use google_cloud_dns_v1::model::ManagedZoneReverseLookupConfig;
5078    /// let x = ManagedZoneReverseLookupConfig::new().set_or_clear_kind(Some("example"));
5079    /// let x = ManagedZoneReverseLookupConfig::new().set_or_clear_kind(None::<String>);
5080    /// ```
5081    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
5082    where
5083        T: std::convert::Into<std::string::String>,
5084    {
5085        self.kind = v.map(|x| x.into());
5086        self
5087    }
5088}
5089
5090impl wkt::message::Message for ManagedZoneReverseLookupConfig {
5091    fn typename() -> &'static str {
5092        "type.googleapis.com/.ManagedZoneReverseLookupConfig"
5093    }
5094}
5095
5096/// Contains information about Service Directory-backed zones.
5097#[derive(Clone, Default, PartialEq)]
5098#[non_exhaustive]
5099pub struct ManagedZoneServiceDirectoryConfig {
5100    #[allow(missing_docs)]
5101    pub kind: std::option::Option<std::string::String>,
5102
5103    /// Contains information about the namespace associated with the zone.
5104    pub namespace: std::option::Option<crate::model::ManagedZoneServiceDirectoryConfigNamespace>,
5105
5106    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5107}
5108
5109impl ManagedZoneServiceDirectoryConfig {
5110    /// Creates a new default instance.
5111    pub fn new() -> Self {
5112        std::default::Default::default()
5113    }
5114
5115    /// Sets the value of [kind][crate::model::ManagedZoneServiceDirectoryConfig::kind].
5116    ///
5117    /// # Example
5118    /// ```ignore,no_run
5119    /// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
5120    /// let x = ManagedZoneServiceDirectoryConfig::new().set_kind("example");
5121    /// ```
5122    pub fn set_kind<T>(mut self, v: T) -> Self
5123    where
5124        T: std::convert::Into<std::string::String>,
5125    {
5126        self.kind = std::option::Option::Some(v.into());
5127        self
5128    }
5129
5130    /// Sets or clears the value of [kind][crate::model::ManagedZoneServiceDirectoryConfig::kind].
5131    ///
5132    /// # Example
5133    /// ```ignore,no_run
5134    /// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
5135    /// let x = ManagedZoneServiceDirectoryConfig::new().set_or_clear_kind(Some("example"));
5136    /// let x = ManagedZoneServiceDirectoryConfig::new().set_or_clear_kind(None::<String>);
5137    /// ```
5138    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
5139    where
5140        T: std::convert::Into<std::string::String>,
5141    {
5142        self.kind = v.map(|x| x.into());
5143        self
5144    }
5145
5146    /// Sets the value of [namespace][crate::model::ManagedZoneServiceDirectoryConfig::namespace].
5147    ///
5148    /// # Example
5149    /// ```ignore,no_run
5150    /// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
5151    /// use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
5152    /// let x = ManagedZoneServiceDirectoryConfig::new().set_namespace(ManagedZoneServiceDirectoryConfigNamespace::default()/* use setters */);
5153    /// ```
5154    pub fn set_namespace<T>(mut self, v: T) -> Self
5155    where
5156        T: std::convert::Into<crate::model::ManagedZoneServiceDirectoryConfigNamespace>,
5157    {
5158        self.namespace = std::option::Option::Some(v.into());
5159        self
5160    }
5161
5162    /// Sets or clears the value of [namespace][crate::model::ManagedZoneServiceDirectoryConfig::namespace].
5163    ///
5164    /// # Example
5165    /// ```ignore,no_run
5166    /// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
5167    /// use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
5168    /// let x = ManagedZoneServiceDirectoryConfig::new().set_or_clear_namespace(Some(ManagedZoneServiceDirectoryConfigNamespace::default()/* use setters */));
5169    /// let x = ManagedZoneServiceDirectoryConfig::new().set_or_clear_namespace(None::<ManagedZoneServiceDirectoryConfigNamespace>);
5170    /// ```
5171    pub fn set_or_clear_namespace<T>(mut self, v: std::option::Option<T>) -> Self
5172    where
5173        T: std::convert::Into<crate::model::ManagedZoneServiceDirectoryConfigNamespace>,
5174    {
5175        self.namespace = v.map(|x| x.into());
5176        self
5177    }
5178}
5179
5180impl wkt::message::Message for ManagedZoneServiceDirectoryConfig {
5181    fn typename() -> &'static str {
5182        "type.googleapis.com/.ManagedZoneServiceDirectoryConfig"
5183    }
5184}
5185
5186#[allow(missing_docs)]
5187#[derive(Clone, Default, PartialEq)]
5188#[non_exhaustive]
5189pub struct ManagedZoneServiceDirectoryConfigNamespace {
5190    /// The time that the namespace backing this zone was deleted; an empty string if it still exists. This is in RFC3339 text format. Output only.
5191    pub deletion_time: std::option::Option<std::string::String>,
5192
5193    #[allow(missing_docs)]
5194    pub kind: std::option::Option<std::string::String>,
5195
5196    /// The fully qualified URL of the namespace associated with the zone. Format must be `<https://servicedirectory.googleapis.com/v1/projects/{project}/locations/{location}/namespaces/{namespace}>`
5197    pub namespace_url: std::option::Option<std::string::String>,
5198
5199    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5200}
5201
5202impl ManagedZoneServiceDirectoryConfigNamespace {
5203    /// Creates a new default instance.
5204    pub fn new() -> Self {
5205        std::default::Default::default()
5206    }
5207
5208    /// Sets the value of [deletion_time][crate::model::ManagedZoneServiceDirectoryConfigNamespace::deletion_time].
5209    ///
5210    /// # Example
5211    /// ```ignore,no_run
5212    /// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
5213    /// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_deletion_time("example");
5214    /// ```
5215    pub fn set_deletion_time<T>(mut self, v: T) -> Self
5216    where
5217        T: std::convert::Into<std::string::String>,
5218    {
5219        self.deletion_time = std::option::Option::Some(v.into());
5220        self
5221    }
5222
5223    /// Sets or clears the value of [deletion_time][crate::model::ManagedZoneServiceDirectoryConfigNamespace::deletion_time].
5224    ///
5225    /// # Example
5226    /// ```ignore,no_run
5227    /// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
5228    /// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_deletion_time(Some("example"));
5229    /// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_deletion_time(None::<String>);
5230    /// ```
5231    pub fn set_or_clear_deletion_time<T>(mut self, v: std::option::Option<T>) -> Self
5232    where
5233        T: std::convert::Into<std::string::String>,
5234    {
5235        self.deletion_time = v.map(|x| x.into());
5236        self
5237    }
5238
5239    /// Sets the value of [kind][crate::model::ManagedZoneServiceDirectoryConfigNamespace::kind].
5240    ///
5241    /// # Example
5242    /// ```ignore,no_run
5243    /// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
5244    /// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_kind("example");
5245    /// ```
5246    pub fn set_kind<T>(mut self, v: T) -> Self
5247    where
5248        T: std::convert::Into<std::string::String>,
5249    {
5250        self.kind = std::option::Option::Some(v.into());
5251        self
5252    }
5253
5254    /// Sets or clears the value of [kind][crate::model::ManagedZoneServiceDirectoryConfigNamespace::kind].
5255    ///
5256    /// # Example
5257    /// ```ignore,no_run
5258    /// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
5259    /// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_kind(Some("example"));
5260    /// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_kind(None::<String>);
5261    /// ```
5262    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
5263    where
5264        T: std::convert::Into<std::string::String>,
5265    {
5266        self.kind = v.map(|x| x.into());
5267        self
5268    }
5269
5270    /// Sets the value of [namespace_url][crate::model::ManagedZoneServiceDirectoryConfigNamespace::namespace_url].
5271    ///
5272    /// # Example
5273    /// ```ignore,no_run
5274    /// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
5275    /// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_namespace_url("example");
5276    /// ```
5277    pub fn set_namespace_url<T>(mut self, v: T) -> Self
5278    where
5279        T: std::convert::Into<std::string::String>,
5280    {
5281        self.namespace_url = std::option::Option::Some(v.into());
5282        self
5283    }
5284
5285    /// Sets or clears the value of [namespace_url][crate::model::ManagedZoneServiceDirectoryConfigNamespace::namespace_url].
5286    ///
5287    /// # Example
5288    /// ```ignore,no_run
5289    /// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
5290    /// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_namespace_url(Some("example"));
5291    /// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_namespace_url(None::<String>);
5292    /// ```
5293    pub fn set_or_clear_namespace_url<T>(mut self, v: std::option::Option<T>) -> Self
5294    where
5295        T: std::convert::Into<std::string::String>,
5296    {
5297        self.namespace_url = v.map(|x| x.into());
5298        self
5299    }
5300}
5301
5302impl wkt::message::Message for ManagedZoneServiceDirectoryConfigNamespace {
5303    fn typename() -> &'static str {
5304        "type.googleapis.com/.ManagedZoneServiceDirectoryConfigNamespace"
5305    }
5306}
5307
5308#[allow(missing_docs)]
5309#[derive(Clone, Default, PartialEq)]
5310#[non_exhaustive]
5311pub struct ManagedZonesListResponse {
5312    /// Output only. Type of resource.
5313    pub kind: std::option::Option<std::string::String>,
5314
5315    /// The managed zone resources.
5316    pub managed_zones: std::vec::Vec<crate::model::ManagedZone>,
5317
5318    /// This field indicates that more results are available beyond the last page displayed. To fetch the results, make another list request and use this value as your page token. This lets you retrieve the complete contents of a very large collection one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned are an inconsistent view of the collection. You can't retrieve a consistent snapshot of a collection larger than the maximum page size.
5319    pub next_page_token: std::option::Option<std::string::String>,
5320
5321    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5322}
5323
5324impl ManagedZonesListResponse {
5325    /// Creates a new default instance.
5326    pub fn new() -> Self {
5327        std::default::Default::default()
5328    }
5329
5330    /// Sets the value of [kind][crate::model::ManagedZonesListResponse::kind].
5331    ///
5332    /// # Example
5333    /// ```ignore,no_run
5334    /// # use google_cloud_dns_v1::model::ManagedZonesListResponse;
5335    /// let x = ManagedZonesListResponse::new().set_kind("example");
5336    /// ```
5337    pub fn set_kind<T>(mut self, v: T) -> Self
5338    where
5339        T: std::convert::Into<std::string::String>,
5340    {
5341        self.kind = std::option::Option::Some(v.into());
5342        self
5343    }
5344
5345    /// Sets or clears the value of [kind][crate::model::ManagedZonesListResponse::kind].
5346    ///
5347    /// # Example
5348    /// ```ignore,no_run
5349    /// # use google_cloud_dns_v1::model::ManagedZonesListResponse;
5350    /// let x = ManagedZonesListResponse::new().set_or_clear_kind(Some("example"));
5351    /// let x = ManagedZonesListResponse::new().set_or_clear_kind(None::<String>);
5352    /// ```
5353    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
5354    where
5355        T: std::convert::Into<std::string::String>,
5356    {
5357        self.kind = v.map(|x| x.into());
5358        self
5359    }
5360
5361    /// Sets the value of [managed_zones][crate::model::ManagedZonesListResponse::managed_zones].
5362    ///
5363    /// # Example
5364    /// ```ignore,no_run
5365    /// # use google_cloud_dns_v1::model::ManagedZonesListResponse;
5366    /// use google_cloud_dns_v1::model::ManagedZone;
5367    /// let x = ManagedZonesListResponse::new()
5368    ///     .set_managed_zones([
5369    ///         ManagedZone::default()/* use setters */,
5370    ///         ManagedZone::default()/* use (different) setters */,
5371    ///     ]);
5372    /// ```
5373    pub fn set_managed_zones<T, V>(mut self, v: T) -> Self
5374    where
5375        T: std::iter::IntoIterator<Item = V>,
5376        V: std::convert::Into<crate::model::ManagedZone>,
5377    {
5378        use std::iter::Iterator;
5379        self.managed_zones = v.into_iter().map(|i| i.into()).collect();
5380        self
5381    }
5382
5383    /// Sets the value of [next_page_token][crate::model::ManagedZonesListResponse::next_page_token].
5384    ///
5385    /// # Example
5386    /// ```ignore,no_run
5387    /// # use google_cloud_dns_v1::model::ManagedZonesListResponse;
5388    /// let x = ManagedZonesListResponse::new().set_next_page_token("example");
5389    /// ```
5390    pub fn set_next_page_token<T>(mut self, v: T) -> Self
5391    where
5392        T: std::convert::Into<std::string::String>,
5393    {
5394        self.next_page_token = std::option::Option::Some(v.into());
5395        self
5396    }
5397
5398    /// Sets or clears the value of [next_page_token][crate::model::ManagedZonesListResponse::next_page_token].
5399    ///
5400    /// # Example
5401    /// ```ignore,no_run
5402    /// # use google_cloud_dns_v1::model::ManagedZonesListResponse;
5403    /// let x = ManagedZonesListResponse::new().set_or_clear_next_page_token(Some("example"));
5404    /// let x = ManagedZonesListResponse::new().set_or_clear_next_page_token(None::<String>);
5405    /// ```
5406    pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
5407    where
5408        T: std::convert::Into<std::string::String>,
5409    {
5410        self.next_page_token = v.map(|x| x.into());
5411        self
5412    }
5413}
5414
5415impl wkt::message::Message for ManagedZonesListResponse {
5416    fn typename() -> &'static str {
5417        "type.googleapis.com/.ManagedZonesListResponse"
5418    }
5419}
5420
5421#[doc(hidden)]
5422impl google_cloud_gax::paginator::internal::PageableResponse for ManagedZonesListResponse {
5423    type PageItem = crate::model::ManagedZone;
5424
5425    fn items(self) -> std::vec::Vec<Self::PageItem> {
5426        self.managed_zones
5427    }
5428
5429    fn next_page_token(&self) -> std::string::String {
5430        use std::clone::Clone;
5431        self.next_page_token.clone().unwrap_or_default()
5432    }
5433}
5434
5435/// An operation represents a successful mutation performed on a Cloud DNS resource. Operations provide: - An audit log of server resource mutations. - A way to recover/retry API calls in the case where the response is never received by the caller. Use the caller specified client_operation_id.
5436#[derive(Clone, Default, PartialEq)]
5437#[non_exhaustive]
5438pub struct Operation {
5439    /// Only populated if the operation targeted a DnsKey (output only).
5440    pub dns_key_context: std::option::Option<crate::model::OperationDnsKeyContext>,
5441
5442    /// Unique identifier for the resource. This is the client_operation_id if the client specified it when the mutation was initiated, otherwise, it is generated by the server. The name must be 1-63 characters long and match the regular expression [-a-z0-9]? (output only)
5443    pub id: std::option::Option<std::string::String>,
5444
5445    #[allow(missing_docs)]
5446    pub kind: std::option::Option<std::string::String>,
5447
5448    /// The time that this operation was started by the server. This is in RFC3339 text format (output only).
5449    pub start_time: std::option::Option<std::string::String>,
5450
5451    /// Status of the operation. Can be one of the following: "PENDING" or "DONE" (output only). A status of "DONE" means that the request to update the authoritative servers has been sent, but the servers might not be updated yet.
5452    pub status: std::option::Option<crate::model::operation::Status>,
5453
5454    /// Type of the operation. Operations include insert, update, and delete (output only).
5455    pub r#type: std::option::Option<std::string::String>,
5456
5457    /// User who requested the operation, for example: user@example.com. cloud-dns-system for operations automatically done by the system. (output only)
5458    pub user: std::option::Option<std::string::String>,
5459
5460    /// Only populated if the operation targeted a ManagedZone (output only).
5461    pub zone_context: std::option::Option<crate::model::OperationManagedZoneContext>,
5462
5463    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5464}
5465
5466impl Operation {
5467    /// Creates a new default instance.
5468    pub fn new() -> Self {
5469        std::default::Default::default()
5470    }
5471
5472    /// Sets the value of [dns_key_context][crate::model::Operation::dns_key_context].
5473    ///
5474    /// # Example
5475    /// ```ignore,no_run
5476    /// # use google_cloud_dns_v1::model::Operation;
5477    /// use google_cloud_dns_v1::model::OperationDnsKeyContext;
5478    /// let x = Operation::new().set_dns_key_context(OperationDnsKeyContext::default()/* use setters */);
5479    /// ```
5480    pub fn set_dns_key_context<T>(mut self, v: T) -> Self
5481    where
5482        T: std::convert::Into<crate::model::OperationDnsKeyContext>,
5483    {
5484        self.dns_key_context = std::option::Option::Some(v.into());
5485        self
5486    }
5487
5488    /// Sets or clears the value of [dns_key_context][crate::model::Operation::dns_key_context].
5489    ///
5490    /// # Example
5491    /// ```ignore,no_run
5492    /// # use google_cloud_dns_v1::model::Operation;
5493    /// use google_cloud_dns_v1::model::OperationDnsKeyContext;
5494    /// let x = Operation::new().set_or_clear_dns_key_context(Some(OperationDnsKeyContext::default()/* use setters */));
5495    /// let x = Operation::new().set_or_clear_dns_key_context(None::<OperationDnsKeyContext>);
5496    /// ```
5497    pub fn set_or_clear_dns_key_context<T>(mut self, v: std::option::Option<T>) -> Self
5498    where
5499        T: std::convert::Into<crate::model::OperationDnsKeyContext>,
5500    {
5501        self.dns_key_context = v.map(|x| x.into());
5502        self
5503    }
5504
5505    /// Sets the value of [id][crate::model::Operation::id].
5506    ///
5507    /// # Example
5508    /// ```ignore,no_run
5509    /// # use google_cloud_dns_v1::model::Operation;
5510    /// let x = Operation::new().set_id("example");
5511    /// ```
5512    pub fn set_id<T>(mut self, v: T) -> Self
5513    where
5514        T: std::convert::Into<std::string::String>,
5515    {
5516        self.id = std::option::Option::Some(v.into());
5517        self
5518    }
5519
5520    /// Sets or clears the value of [id][crate::model::Operation::id].
5521    ///
5522    /// # Example
5523    /// ```ignore,no_run
5524    /// # use google_cloud_dns_v1::model::Operation;
5525    /// let x = Operation::new().set_or_clear_id(Some("example"));
5526    /// let x = Operation::new().set_or_clear_id(None::<String>);
5527    /// ```
5528    pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
5529    where
5530        T: std::convert::Into<std::string::String>,
5531    {
5532        self.id = v.map(|x| x.into());
5533        self
5534    }
5535
5536    /// Sets the value of [kind][crate::model::Operation::kind].
5537    ///
5538    /// # Example
5539    /// ```ignore,no_run
5540    /// # use google_cloud_dns_v1::model::Operation;
5541    /// let x = Operation::new().set_kind("example");
5542    /// ```
5543    pub fn set_kind<T>(mut self, v: T) -> Self
5544    where
5545        T: std::convert::Into<std::string::String>,
5546    {
5547        self.kind = std::option::Option::Some(v.into());
5548        self
5549    }
5550
5551    /// Sets or clears the value of [kind][crate::model::Operation::kind].
5552    ///
5553    /// # Example
5554    /// ```ignore,no_run
5555    /// # use google_cloud_dns_v1::model::Operation;
5556    /// let x = Operation::new().set_or_clear_kind(Some("example"));
5557    /// let x = Operation::new().set_or_clear_kind(None::<String>);
5558    /// ```
5559    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
5560    where
5561        T: std::convert::Into<std::string::String>,
5562    {
5563        self.kind = v.map(|x| x.into());
5564        self
5565    }
5566
5567    /// Sets the value of [start_time][crate::model::Operation::start_time].
5568    ///
5569    /// # Example
5570    /// ```ignore,no_run
5571    /// # use google_cloud_dns_v1::model::Operation;
5572    /// let x = Operation::new().set_start_time("example");
5573    /// ```
5574    pub fn set_start_time<T>(mut self, v: T) -> Self
5575    where
5576        T: std::convert::Into<std::string::String>,
5577    {
5578        self.start_time = std::option::Option::Some(v.into());
5579        self
5580    }
5581
5582    /// Sets or clears the value of [start_time][crate::model::Operation::start_time].
5583    ///
5584    /// # Example
5585    /// ```ignore,no_run
5586    /// # use google_cloud_dns_v1::model::Operation;
5587    /// let x = Operation::new().set_or_clear_start_time(Some("example"));
5588    /// let x = Operation::new().set_or_clear_start_time(None::<String>);
5589    /// ```
5590    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5591    where
5592        T: std::convert::Into<std::string::String>,
5593    {
5594        self.start_time = v.map(|x| x.into());
5595        self
5596    }
5597
5598    /// Sets the value of [status][crate::model::Operation::status].
5599    ///
5600    /// # Example
5601    /// ```ignore,no_run
5602    /// # use google_cloud_dns_v1::model::Operation;
5603    /// use google_cloud_dns_v1::model::operation::Status;
5604    /// let x0 = Operation::new().set_status(Status::Done);
5605    /// ```
5606    pub fn set_status<T>(mut self, v: T) -> Self
5607    where
5608        T: std::convert::Into<crate::model::operation::Status>,
5609    {
5610        self.status = std::option::Option::Some(v.into());
5611        self
5612    }
5613
5614    /// Sets or clears the value of [status][crate::model::Operation::status].
5615    ///
5616    /// # Example
5617    /// ```ignore,no_run
5618    /// # use google_cloud_dns_v1::model::Operation;
5619    /// use google_cloud_dns_v1::model::operation::Status;
5620    /// let x0 = Operation::new().set_or_clear_status(Some(Status::Done));
5621    /// let x_none = Operation::new().set_or_clear_status(None::<Status>);
5622    /// ```
5623    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
5624    where
5625        T: std::convert::Into<crate::model::operation::Status>,
5626    {
5627        self.status = v.map(|x| x.into());
5628        self
5629    }
5630
5631    /// Sets the value of [r#type][crate::model::Operation::type].
5632    ///
5633    /// # Example
5634    /// ```ignore,no_run
5635    /// # use google_cloud_dns_v1::model::Operation;
5636    /// let x = Operation::new().set_type("example");
5637    /// ```
5638    pub fn set_type<T>(mut self, v: T) -> Self
5639    where
5640        T: std::convert::Into<std::string::String>,
5641    {
5642        self.r#type = std::option::Option::Some(v.into());
5643        self
5644    }
5645
5646    /// Sets or clears the value of [r#type][crate::model::Operation::type].
5647    ///
5648    /// # Example
5649    /// ```ignore,no_run
5650    /// # use google_cloud_dns_v1::model::Operation;
5651    /// let x = Operation::new().set_or_clear_type(Some("example"));
5652    /// let x = Operation::new().set_or_clear_type(None::<String>);
5653    /// ```
5654    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
5655    where
5656        T: std::convert::Into<std::string::String>,
5657    {
5658        self.r#type = v.map(|x| x.into());
5659        self
5660    }
5661
5662    /// Sets the value of [user][crate::model::Operation::user].
5663    ///
5664    /// # Example
5665    /// ```ignore,no_run
5666    /// # use google_cloud_dns_v1::model::Operation;
5667    /// let x = Operation::new().set_user("example");
5668    /// ```
5669    pub fn set_user<T>(mut self, v: T) -> Self
5670    where
5671        T: std::convert::Into<std::string::String>,
5672    {
5673        self.user = std::option::Option::Some(v.into());
5674        self
5675    }
5676
5677    /// Sets or clears the value of [user][crate::model::Operation::user].
5678    ///
5679    /// # Example
5680    /// ```ignore,no_run
5681    /// # use google_cloud_dns_v1::model::Operation;
5682    /// let x = Operation::new().set_or_clear_user(Some("example"));
5683    /// let x = Operation::new().set_or_clear_user(None::<String>);
5684    /// ```
5685    pub fn set_or_clear_user<T>(mut self, v: std::option::Option<T>) -> Self
5686    where
5687        T: std::convert::Into<std::string::String>,
5688    {
5689        self.user = v.map(|x| x.into());
5690        self
5691    }
5692
5693    /// Sets the value of [zone_context][crate::model::Operation::zone_context].
5694    ///
5695    /// # Example
5696    /// ```ignore,no_run
5697    /// # use google_cloud_dns_v1::model::Operation;
5698    /// use google_cloud_dns_v1::model::OperationManagedZoneContext;
5699    /// let x = Operation::new().set_zone_context(OperationManagedZoneContext::default()/* use setters */);
5700    /// ```
5701    pub fn set_zone_context<T>(mut self, v: T) -> Self
5702    where
5703        T: std::convert::Into<crate::model::OperationManagedZoneContext>,
5704    {
5705        self.zone_context = std::option::Option::Some(v.into());
5706        self
5707    }
5708
5709    /// Sets or clears the value of [zone_context][crate::model::Operation::zone_context].
5710    ///
5711    /// # Example
5712    /// ```ignore,no_run
5713    /// # use google_cloud_dns_v1::model::Operation;
5714    /// use google_cloud_dns_v1::model::OperationManagedZoneContext;
5715    /// let x = Operation::new().set_or_clear_zone_context(Some(OperationManagedZoneContext::default()/* use setters */));
5716    /// let x = Operation::new().set_or_clear_zone_context(None::<OperationManagedZoneContext>);
5717    /// ```
5718    pub fn set_or_clear_zone_context<T>(mut self, v: std::option::Option<T>) -> Self
5719    where
5720        T: std::convert::Into<crate::model::OperationManagedZoneContext>,
5721    {
5722        self.zone_context = v.map(|x| x.into());
5723        self
5724    }
5725}
5726
5727impl wkt::message::Message for Operation {
5728    fn typename() -> &'static str {
5729        "type.googleapis.com/.Operation"
5730    }
5731}
5732
5733/// Defines additional types related to [Operation].
5734pub mod operation {
5735    #[allow(unused_imports)]
5736    use super::*;
5737
5738    /// The enumerated type for the [status][.Operation.status] field.
5739    ///
5740    /// # Working with unknown values
5741    ///
5742    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5743    /// additional enum variants at any time. Adding new variants is not considered
5744    /// a breaking change. Applications should write their code in anticipation of:
5745    ///
5746    /// - New values appearing in future releases of the client library, **and**
5747    /// - New values received dynamically, without application changes.
5748    ///
5749    /// Please consult the [Working with enums] section in the user guide for some
5750    /// guidelines.
5751    ///
5752    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5753    #[derive(Clone, Debug, PartialEq)]
5754    #[non_exhaustive]
5755    pub enum Status {
5756        #[allow(missing_docs)]
5757        Pending,
5758        #[allow(missing_docs)]
5759        Done,
5760        /// If set, the enum was initialized with an unknown value.
5761        ///
5762        /// Applications can examine the value using [Status::name].
5763        UnknownValue(status::UnknownValue),
5764    }
5765
5766    #[doc(hidden)]
5767    pub mod status {
5768        #[allow(unused_imports)]
5769        use super::*;
5770        #[derive(Clone, Debug, PartialEq)]
5771        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5772    }
5773
5774    impl Status {
5775        /// Gets the enum value as a string.
5776        pub fn name(&self) -> std::option::Option<&str> {
5777            match self {
5778                Self::Pending => std::option::Option::Some("pending"),
5779                Self::Done => std::option::Option::Some("done"),
5780                Self::UnknownValue(u) => u.0.name(),
5781            }
5782        }
5783    }
5784
5785    impl std::fmt::Display for Status {
5786        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5787            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
5788        }
5789    }
5790
5791    impl std::convert::From<&str> for Status {
5792        fn from(value: &str) -> Self {
5793            use std::string::ToString;
5794            match value {
5795                "pending" => Self::Pending,
5796                "done" => Self::Done,
5797                _ => Self::UnknownValue(status::UnknownValue(
5798                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5799                )),
5800            }
5801        }
5802    }
5803
5804    impl serde::ser::Serialize for Status {
5805        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5806        where
5807            S: serde::Serializer,
5808        {
5809            match self {
5810                Self::Pending => serializer.serialize_str("pending"),
5811                Self::Done => serializer.serialize_str("done"),
5812                Self::UnknownValue(u) => u.0.serialize(serializer),
5813            }
5814        }
5815    }
5816
5817    impl<'de> serde::de::Deserialize<'de> for Status {
5818        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5819        where
5820            D: serde::Deserializer<'de>,
5821        {
5822            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<Status>::new(
5823                "..Operation.status",
5824            ))
5825        }
5826    }
5827}
5828
5829#[allow(missing_docs)]
5830#[derive(Clone, Default, PartialEq)]
5831#[non_exhaustive]
5832pub struct OperationDnsKeyContext {
5833    /// The post-operation DnsKey resource.
5834    pub new_value: std::option::Option<crate::model::DnsKey>,
5835
5836    /// The pre-operation DnsKey resource.
5837    pub old_value: std::option::Option<crate::model::DnsKey>,
5838
5839    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5840}
5841
5842impl OperationDnsKeyContext {
5843    /// Creates a new default instance.
5844    pub fn new() -> Self {
5845        std::default::Default::default()
5846    }
5847
5848    /// Sets the value of [new_value][crate::model::OperationDnsKeyContext::new_value].
5849    ///
5850    /// # Example
5851    /// ```ignore,no_run
5852    /// # use google_cloud_dns_v1::model::OperationDnsKeyContext;
5853    /// use google_cloud_dns_v1::model::DnsKey;
5854    /// let x = OperationDnsKeyContext::new().set_new_value(DnsKey::default()/* use setters */);
5855    /// ```
5856    pub fn set_new_value<T>(mut self, v: T) -> Self
5857    where
5858        T: std::convert::Into<crate::model::DnsKey>,
5859    {
5860        self.new_value = std::option::Option::Some(v.into());
5861        self
5862    }
5863
5864    /// Sets or clears the value of [new_value][crate::model::OperationDnsKeyContext::new_value].
5865    ///
5866    /// # Example
5867    /// ```ignore,no_run
5868    /// # use google_cloud_dns_v1::model::OperationDnsKeyContext;
5869    /// use google_cloud_dns_v1::model::DnsKey;
5870    /// let x = OperationDnsKeyContext::new().set_or_clear_new_value(Some(DnsKey::default()/* use setters */));
5871    /// let x = OperationDnsKeyContext::new().set_or_clear_new_value(None::<DnsKey>);
5872    /// ```
5873    pub fn set_or_clear_new_value<T>(mut self, v: std::option::Option<T>) -> Self
5874    where
5875        T: std::convert::Into<crate::model::DnsKey>,
5876    {
5877        self.new_value = v.map(|x| x.into());
5878        self
5879    }
5880
5881    /// Sets the value of [old_value][crate::model::OperationDnsKeyContext::old_value].
5882    ///
5883    /// # Example
5884    /// ```ignore,no_run
5885    /// # use google_cloud_dns_v1::model::OperationDnsKeyContext;
5886    /// use google_cloud_dns_v1::model::DnsKey;
5887    /// let x = OperationDnsKeyContext::new().set_old_value(DnsKey::default()/* use setters */);
5888    /// ```
5889    pub fn set_old_value<T>(mut self, v: T) -> Self
5890    where
5891        T: std::convert::Into<crate::model::DnsKey>,
5892    {
5893        self.old_value = std::option::Option::Some(v.into());
5894        self
5895    }
5896
5897    /// Sets or clears the value of [old_value][crate::model::OperationDnsKeyContext::old_value].
5898    ///
5899    /// # Example
5900    /// ```ignore,no_run
5901    /// # use google_cloud_dns_v1::model::OperationDnsKeyContext;
5902    /// use google_cloud_dns_v1::model::DnsKey;
5903    /// let x = OperationDnsKeyContext::new().set_or_clear_old_value(Some(DnsKey::default()/* use setters */));
5904    /// let x = OperationDnsKeyContext::new().set_or_clear_old_value(None::<DnsKey>);
5905    /// ```
5906    pub fn set_or_clear_old_value<T>(mut self, v: std::option::Option<T>) -> Self
5907    where
5908        T: std::convert::Into<crate::model::DnsKey>,
5909    {
5910        self.old_value = v.map(|x| x.into());
5911        self
5912    }
5913}
5914
5915impl wkt::message::Message for OperationDnsKeyContext {
5916    fn typename() -> &'static str {
5917        "type.googleapis.com/.OperationDnsKeyContext"
5918    }
5919}
5920
5921#[allow(missing_docs)]
5922#[derive(Clone, Default, PartialEq)]
5923#[non_exhaustive]
5924pub struct OperationManagedZoneContext {
5925    /// The post-operation ManagedZone resource.
5926    pub new_value: std::option::Option<crate::model::ManagedZone>,
5927
5928    /// The pre-operation ManagedZone resource.
5929    pub old_value: std::option::Option<crate::model::ManagedZone>,
5930
5931    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5932}
5933
5934impl OperationManagedZoneContext {
5935    /// Creates a new default instance.
5936    pub fn new() -> Self {
5937        std::default::Default::default()
5938    }
5939
5940    /// Sets the value of [new_value][crate::model::OperationManagedZoneContext::new_value].
5941    ///
5942    /// # Example
5943    /// ```ignore,no_run
5944    /// # use google_cloud_dns_v1::model::OperationManagedZoneContext;
5945    /// use google_cloud_dns_v1::model::ManagedZone;
5946    /// let x = OperationManagedZoneContext::new().set_new_value(ManagedZone::default()/* use setters */);
5947    /// ```
5948    pub fn set_new_value<T>(mut self, v: T) -> Self
5949    where
5950        T: std::convert::Into<crate::model::ManagedZone>,
5951    {
5952        self.new_value = std::option::Option::Some(v.into());
5953        self
5954    }
5955
5956    /// Sets or clears the value of [new_value][crate::model::OperationManagedZoneContext::new_value].
5957    ///
5958    /// # Example
5959    /// ```ignore,no_run
5960    /// # use google_cloud_dns_v1::model::OperationManagedZoneContext;
5961    /// use google_cloud_dns_v1::model::ManagedZone;
5962    /// let x = OperationManagedZoneContext::new().set_or_clear_new_value(Some(ManagedZone::default()/* use setters */));
5963    /// let x = OperationManagedZoneContext::new().set_or_clear_new_value(None::<ManagedZone>);
5964    /// ```
5965    pub fn set_or_clear_new_value<T>(mut self, v: std::option::Option<T>) -> Self
5966    where
5967        T: std::convert::Into<crate::model::ManagedZone>,
5968    {
5969        self.new_value = v.map(|x| x.into());
5970        self
5971    }
5972
5973    /// Sets the value of [old_value][crate::model::OperationManagedZoneContext::old_value].
5974    ///
5975    /// # Example
5976    /// ```ignore,no_run
5977    /// # use google_cloud_dns_v1::model::OperationManagedZoneContext;
5978    /// use google_cloud_dns_v1::model::ManagedZone;
5979    /// let x = OperationManagedZoneContext::new().set_old_value(ManagedZone::default()/* use setters */);
5980    /// ```
5981    pub fn set_old_value<T>(mut self, v: T) -> Self
5982    where
5983        T: std::convert::Into<crate::model::ManagedZone>,
5984    {
5985        self.old_value = std::option::Option::Some(v.into());
5986        self
5987    }
5988
5989    /// Sets or clears the value of [old_value][crate::model::OperationManagedZoneContext::old_value].
5990    ///
5991    /// # Example
5992    /// ```ignore,no_run
5993    /// # use google_cloud_dns_v1::model::OperationManagedZoneContext;
5994    /// use google_cloud_dns_v1::model::ManagedZone;
5995    /// let x = OperationManagedZoneContext::new().set_or_clear_old_value(Some(ManagedZone::default()/* use setters */));
5996    /// let x = OperationManagedZoneContext::new().set_or_clear_old_value(None::<ManagedZone>);
5997    /// ```
5998    pub fn set_or_clear_old_value<T>(mut self, v: std::option::Option<T>) -> Self
5999    where
6000        T: std::convert::Into<crate::model::ManagedZone>,
6001    {
6002        self.old_value = v.map(|x| x.into());
6003        self
6004    }
6005}
6006
6007impl wkt::message::Message for OperationManagedZoneContext {
6008    fn typename() -> &'static str {
6009        "type.googleapis.com/.OperationManagedZoneContext"
6010    }
6011}
6012
6013#[allow(missing_docs)]
6014#[derive(Clone, Default, PartialEq)]
6015#[non_exhaustive]
6016pub struct PoliciesListResponse {
6017    /// Output only. Type of resource.
6018    pub kind: std::option::Option<std::string::String>,
6019
6020    /// This field indicates that more results are available beyond the last page displayed. To fetch the results, make another list request and use this value as your page token. This lets you retrieve the complete contents of a very large collection one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned are an inconsistent view of the collection. You can't retrieve a consistent snapshot of a collection larger than the maximum page size.
6021    pub next_page_token: std::option::Option<std::string::String>,
6022
6023    /// The policy resources.
6024    pub policies: std::vec::Vec<crate::model::Policy>,
6025
6026    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6027}
6028
6029impl PoliciesListResponse {
6030    /// Creates a new default instance.
6031    pub fn new() -> Self {
6032        std::default::Default::default()
6033    }
6034
6035    /// Sets the value of [kind][crate::model::PoliciesListResponse::kind].
6036    ///
6037    /// # Example
6038    /// ```ignore,no_run
6039    /// # use google_cloud_dns_v1::model::PoliciesListResponse;
6040    /// let x = PoliciesListResponse::new().set_kind("example");
6041    /// ```
6042    pub fn set_kind<T>(mut self, v: T) -> Self
6043    where
6044        T: std::convert::Into<std::string::String>,
6045    {
6046        self.kind = std::option::Option::Some(v.into());
6047        self
6048    }
6049
6050    /// Sets or clears the value of [kind][crate::model::PoliciesListResponse::kind].
6051    ///
6052    /// # Example
6053    /// ```ignore,no_run
6054    /// # use google_cloud_dns_v1::model::PoliciesListResponse;
6055    /// let x = PoliciesListResponse::new().set_or_clear_kind(Some("example"));
6056    /// let x = PoliciesListResponse::new().set_or_clear_kind(None::<String>);
6057    /// ```
6058    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
6059    where
6060        T: std::convert::Into<std::string::String>,
6061    {
6062        self.kind = v.map(|x| x.into());
6063        self
6064    }
6065
6066    /// Sets the value of [next_page_token][crate::model::PoliciesListResponse::next_page_token].
6067    ///
6068    /// # Example
6069    /// ```ignore,no_run
6070    /// # use google_cloud_dns_v1::model::PoliciesListResponse;
6071    /// let x = PoliciesListResponse::new().set_next_page_token("example");
6072    /// ```
6073    pub fn set_next_page_token<T>(mut self, v: T) -> Self
6074    where
6075        T: std::convert::Into<std::string::String>,
6076    {
6077        self.next_page_token = std::option::Option::Some(v.into());
6078        self
6079    }
6080
6081    /// Sets or clears the value of [next_page_token][crate::model::PoliciesListResponse::next_page_token].
6082    ///
6083    /// # Example
6084    /// ```ignore,no_run
6085    /// # use google_cloud_dns_v1::model::PoliciesListResponse;
6086    /// let x = PoliciesListResponse::new().set_or_clear_next_page_token(Some("example"));
6087    /// let x = PoliciesListResponse::new().set_or_clear_next_page_token(None::<String>);
6088    /// ```
6089    pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
6090    where
6091        T: std::convert::Into<std::string::String>,
6092    {
6093        self.next_page_token = v.map(|x| x.into());
6094        self
6095    }
6096
6097    /// Sets the value of [policies][crate::model::PoliciesListResponse::policies].
6098    ///
6099    /// # Example
6100    /// ```ignore,no_run
6101    /// # use google_cloud_dns_v1::model::PoliciesListResponse;
6102    /// use google_cloud_dns_v1::model::Policy;
6103    /// let x = PoliciesListResponse::new()
6104    ///     .set_policies([
6105    ///         Policy::default()/* use setters */,
6106    ///         Policy::default()/* use (different) setters */,
6107    ///     ]);
6108    /// ```
6109    pub fn set_policies<T, V>(mut self, v: T) -> Self
6110    where
6111        T: std::iter::IntoIterator<Item = V>,
6112        V: std::convert::Into<crate::model::Policy>,
6113    {
6114        use std::iter::Iterator;
6115        self.policies = v.into_iter().map(|i| i.into()).collect();
6116        self
6117    }
6118}
6119
6120impl wkt::message::Message for PoliciesListResponse {
6121    fn typename() -> &'static str {
6122        "type.googleapis.com/.PoliciesListResponse"
6123    }
6124}
6125
6126#[doc(hidden)]
6127impl google_cloud_gax::paginator::internal::PageableResponse for PoliciesListResponse {
6128    type PageItem = crate::model::Policy;
6129
6130    fn items(self) -> std::vec::Vec<Self::PageItem> {
6131        self.policies
6132    }
6133
6134    fn next_page_token(&self) -> std::string::String {
6135        use std::clone::Clone;
6136        self.next_page_token.clone().unwrap_or_default()
6137    }
6138}
6139
6140#[allow(missing_docs)]
6141#[derive(Clone, Default, PartialEq)]
6142#[non_exhaustive]
6143pub struct PoliciesPatchResponse {
6144    #[allow(missing_docs)]
6145    pub policy: std::option::Option<crate::model::Policy>,
6146
6147    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6148}
6149
6150impl PoliciesPatchResponse {
6151    /// Creates a new default instance.
6152    pub fn new() -> Self {
6153        std::default::Default::default()
6154    }
6155
6156    /// Sets the value of [policy][crate::model::PoliciesPatchResponse::policy].
6157    ///
6158    /// # Example
6159    /// ```ignore,no_run
6160    /// # use google_cloud_dns_v1::model::PoliciesPatchResponse;
6161    /// use google_cloud_dns_v1::model::Policy;
6162    /// let x = PoliciesPatchResponse::new().set_policy(Policy::default()/* use setters */);
6163    /// ```
6164    pub fn set_policy<T>(mut self, v: T) -> Self
6165    where
6166        T: std::convert::Into<crate::model::Policy>,
6167    {
6168        self.policy = std::option::Option::Some(v.into());
6169        self
6170    }
6171
6172    /// Sets or clears the value of [policy][crate::model::PoliciesPatchResponse::policy].
6173    ///
6174    /// # Example
6175    /// ```ignore,no_run
6176    /// # use google_cloud_dns_v1::model::PoliciesPatchResponse;
6177    /// use google_cloud_dns_v1::model::Policy;
6178    /// let x = PoliciesPatchResponse::new().set_or_clear_policy(Some(Policy::default()/* use setters */));
6179    /// let x = PoliciesPatchResponse::new().set_or_clear_policy(None::<Policy>);
6180    /// ```
6181    pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6182    where
6183        T: std::convert::Into<crate::model::Policy>,
6184    {
6185        self.policy = v.map(|x| x.into());
6186        self
6187    }
6188}
6189
6190impl wkt::message::Message for PoliciesPatchResponse {
6191    fn typename() -> &'static str {
6192        "type.googleapis.com/.PoliciesPatchResponse"
6193    }
6194}
6195
6196#[allow(missing_docs)]
6197#[derive(Clone, Default, PartialEq)]
6198#[non_exhaustive]
6199pub struct PoliciesUpdateResponse {
6200    #[allow(missing_docs)]
6201    pub policy: std::option::Option<crate::model::Policy>,
6202
6203    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6204}
6205
6206impl PoliciesUpdateResponse {
6207    /// Creates a new default instance.
6208    pub fn new() -> Self {
6209        std::default::Default::default()
6210    }
6211
6212    /// Sets the value of [policy][crate::model::PoliciesUpdateResponse::policy].
6213    ///
6214    /// # Example
6215    /// ```ignore,no_run
6216    /// # use google_cloud_dns_v1::model::PoliciesUpdateResponse;
6217    /// use google_cloud_dns_v1::model::Policy;
6218    /// let x = PoliciesUpdateResponse::new().set_policy(Policy::default()/* use setters */);
6219    /// ```
6220    pub fn set_policy<T>(mut self, v: T) -> Self
6221    where
6222        T: std::convert::Into<crate::model::Policy>,
6223    {
6224        self.policy = std::option::Option::Some(v.into());
6225        self
6226    }
6227
6228    /// Sets or clears the value of [policy][crate::model::PoliciesUpdateResponse::policy].
6229    ///
6230    /// # Example
6231    /// ```ignore,no_run
6232    /// # use google_cloud_dns_v1::model::PoliciesUpdateResponse;
6233    /// use google_cloud_dns_v1::model::Policy;
6234    /// let x = PoliciesUpdateResponse::new().set_or_clear_policy(Some(Policy::default()/* use setters */));
6235    /// let x = PoliciesUpdateResponse::new().set_or_clear_policy(None::<Policy>);
6236    /// ```
6237    pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6238    where
6239        T: std::convert::Into<crate::model::Policy>,
6240    {
6241        self.policy = v.map(|x| x.into());
6242        self
6243    }
6244}
6245
6246impl wkt::message::Message for PoliciesUpdateResponse {
6247    fn typename() -> &'static str {
6248        "type.googleapis.com/.PoliciesUpdateResponse"
6249    }
6250}
6251
6252/// A policy is a collection of DNS rules applied to one or more Virtual Private Cloud resources.
6253#[derive(Clone, Default, PartialEq)]
6254#[non_exhaustive]
6255pub struct Policy {
6256    /// Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified.
6257    pub alternative_name_server_config:
6258        std::option::Option<crate::model::PolicyAlternativeNameServerConfig>,
6259
6260    /// A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the policy's function.
6261    pub description: std::option::Option<std::string::String>,
6262
6263    /// Configurations related to DNS64 for this policy.
6264    pub dns_64_config: std::option::Option<crate::model::PolicyDns64Config>,
6265
6266    /// Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address is allocated from each of the subnetworks that are bound to this policy.
6267    pub enable_inbound_forwarding: std::option::Option<bool>,
6268
6269    /// Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.
6270    pub enable_logging: std::option::Option<bool>,
6271
6272    /// Unique identifier for the resource; defined by the server (output only).
6273    pub id: std::option::Option<u64>,
6274
6275    #[allow(missing_docs)]
6276    pub kind: std::option::Option<std::string::String>,
6277
6278    /// User-assigned name for this policy.
6279    pub name: std::option::Option<std::string::String>,
6280
6281    /// List of network names specifying networks to which this policy is applied.
6282    pub networks: std::vec::Vec<crate::model::PolicyNetwork>,
6283
6284    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6285}
6286
6287impl Policy {
6288    /// Creates a new default instance.
6289    pub fn new() -> Self {
6290        std::default::Default::default()
6291    }
6292
6293    /// Sets the value of [alternative_name_server_config][crate::model::Policy::alternative_name_server_config].
6294    ///
6295    /// # Example
6296    /// ```ignore,no_run
6297    /// # use google_cloud_dns_v1::model::Policy;
6298    /// use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfig;
6299    /// let x = Policy::new().set_alternative_name_server_config(PolicyAlternativeNameServerConfig::default()/* use setters */);
6300    /// ```
6301    pub fn set_alternative_name_server_config<T>(mut self, v: T) -> Self
6302    where
6303        T: std::convert::Into<crate::model::PolicyAlternativeNameServerConfig>,
6304    {
6305        self.alternative_name_server_config = std::option::Option::Some(v.into());
6306        self
6307    }
6308
6309    /// Sets or clears the value of [alternative_name_server_config][crate::model::Policy::alternative_name_server_config].
6310    ///
6311    /// # Example
6312    /// ```ignore,no_run
6313    /// # use google_cloud_dns_v1::model::Policy;
6314    /// use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfig;
6315    /// let x = Policy::new().set_or_clear_alternative_name_server_config(Some(PolicyAlternativeNameServerConfig::default()/* use setters */));
6316    /// let x = Policy::new().set_or_clear_alternative_name_server_config(None::<PolicyAlternativeNameServerConfig>);
6317    /// ```
6318    pub fn set_or_clear_alternative_name_server_config<T>(
6319        mut self,
6320        v: std::option::Option<T>,
6321    ) -> Self
6322    where
6323        T: std::convert::Into<crate::model::PolicyAlternativeNameServerConfig>,
6324    {
6325        self.alternative_name_server_config = v.map(|x| x.into());
6326        self
6327    }
6328
6329    /// Sets the value of [description][crate::model::Policy::description].
6330    ///
6331    /// # Example
6332    /// ```ignore,no_run
6333    /// # use google_cloud_dns_v1::model::Policy;
6334    /// let x = Policy::new().set_description("example");
6335    /// ```
6336    pub fn set_description<T>(mut self, v: T) -> Self
6337    where
6338        T: std::convert::Into<std::string::String>,
6339    {
6340        self.description = std::option::Option::Some(v.into());
6341        self
6342    }
6343
6344    /// Sets or clears the value of [description][crate::model::Policy::description].
6345    ///
6346    /// # Example
6347    /// ```ignore,no_run
6348    /// # use google_cloud_dns_v1::model::Policy;
6349    /// let x = Policy::new().set_or_clear_description(Some("example"));
6350    /// let x = Policy::new().set_or_clear_description(None::<String>);
6351    /// ```
6352    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
6353    where
6354        T: std::convert::Into<std::string::String>,
6355    {
6356        self.description = v.map(|x| x.into());
6357        self
6358    }
6359
6360    /// Sets the value of [dns_64_config][crate::model::Policy::dns_64_config].
6361    ///
6362    /// # Example
6363    /// ```ignore,no_run
6364    /// # use google_cloud_dns_v1::model::Policy;
6365    /// use google_cloud_dns_v1::model::PolicyDns64Config;
6366    /// let x = Policy::new().set_dns_64_config(PolicyDns64Config::default()/* use setters */);
6367    /// ```
6368    pub fn set_dns_64_config<T>(mut self, v: T) -> Self
6369    where
6370        T: std::convert::Into<crate::model::PolicyDns64Config>,
6371    {
6372        self.dns_64_config = std::option::Option::Some(v.into());
6373        self
6374    }
6375
6376    /// Sets or clears the value of [dns_64_config][crate::model::Policy::dns_64_config].
6377    ///
6378    /// # Example
6379    /// ```ignore,no_run
6380    /// # use google_cloud_dns_v1::model::Policy;
6381    /// use google_cloud_dns_v1::model::PolicyDns64Config;
6382    /// let x = Policy::new().set_or_clear_dns_64_config(Some(PolicyDns64Config::default()/* use setters */));
6383    /// let x = Policy::new().set_or_clear_dns_64_config(None::<PolicyDns64Config>);
6384    /// ```
6385    pub fn set_or_clear_dns_64_config<T>(mut self, v: std::option::Option<T>) -> Self
6386    where
6387        T: std::convert::Into<crate::model::PolicyDns64Config>,
6388    {
6389        self.dns_64_config = v.map(|x| x.into());
6390        self
6391    }
6392
6393    /// Sets the value of [enable_inbound_forwarding][crate::model::Policy::enable_inbound_forwarding].
6394    ///
6395    /// # Example
6396    /// ```ignore,no_run
6397    /// # use google_cloud_dns_v1::model::Policy;
6398    /// let x = Policy::new().set_enable_inbound_forwarding(true);
6399    /// ```
6400    pub fn set_enable_inbound_forwarding<T>(mut self, v: T) -> Self
6401    where
6402        T: std::convert::Into<bool>,
6403    {
6404        self.enable_inbound_forwarding = std::option::Option::Some(v.into());
6405        self
6406    }
6407
6408    /// Sets or clears the value of [enable_inbound_forwarding][crate::model::Policy::enable_inbound_forwarding].
6409    ///
6410    /// # Example
6411    /// ```ignore,no_run
6412    /// # use google_cloud_dns_v1::model::Policy;
6413    /// let x = Policy::new().set_or_clear_enable_inbound_forwarding(Some(false));
6414    /// let x = Policy::new().set_or_clear_enable_inbound_forwarding(None::<bool>);
6415    /// ```
6416    pub fn set_or_clear_enable_inbound_forwarding<T>(mut self, v: std::option::Option<T>) -> Self
6417    where
6418        T: std::convert::Into<bool>,
6419    {
6420        self.enable_inbound_forwarding = v.map(|x| x.into());
6421        self
6422    }
6423
6424    /// Sets the value of [enable_logging][crate::model::Policy::enable_logging].
6425    ///
6426    /// # Example
6427    /// ```ignore,no_run
6428    /// # use google_cloud_dns_v1::model::Policy;
6429    /// let x = Policy::new().set_enable_logging(true);
6430    /// ```
6431    pub fn set_enable_logging<T>(mut self, v: T) -> Self
6432    where
6433        T: std::convert::Into<bool>,
6434    {
6435        self.enable_logging = std::option::Option::Some(v.into());
6436        self
6437    }
6438
6439    /// Sets or clears the value of [enable_logging][crate::model::Policy::enable_logging].
6440    ///
6441    /// # Example
6442    /// ```ignore,no_run
6443    /// # use google_cloud_dns_v1::model::Policy;
6444    /// let x = Policy::new().set_or_clear_enable_logging(Some(false));
6445    /// let x = Policy::new().set_or_clear_enable_logging(None::<bool>);
6446    /// ```
6447    pub fn set_or_clear_enable_logging<T>(mut self, v: std::option::Option<T>) -> Self
6448    where
6449        T: std::convert::Into<bool>,
6450    {
6451        self.enable_logging = v.map(|x| x.into());
6452        self
6453    }
6454
6455    /// Sets the value of [id][crate::model::Policy::id].
6456    ///
6457    /// # Example
6458    /// ```ignore,no_run
6459    /// # use google_cloud_dns_v1::model::Policy;
6460    /// let x = Policy::new().set_id(42_u32);
6461    /// ```
6462    pub fn set_id<T>(mut self, v: T) -> Self
6463    where
6464        T: std::convert::Into<u64>,
6465    {
6466        self.id = std::option::Option::Some(v.into());
6467        self
6468    }
6469
6470    /// Sets or clears the value of [id][crate::model::Policy::id].
6471    ///
6472    /// # Example
6473    /// ```ignore,no_run
6474    /// # use google_cloud_dns_v1::model::Policy;
6475    /// let x = Policy::new().set_or_clear_id(Some(42_u32));
6476    /// let x = Policy::new().set_or_clear_id(None::<u32>);
6477    /// ```
6478    pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
6479    where
6480        T: std::convert::Into<u64>,
6481    {
6482        self.id = v.map(|x| x.into());
6483        self
6484    }
6485
6486    /// Sets the value of [kind][crate::model::Policy::kind].
6487    ///
6488    /// # Example
6489    /// ```ignore,no_run
6490    /// # use google_cloud_dns_v1::model::Policy;
6491    /// let x = Policy::new().set_kind("example");
6492    /// ```
6493    pub fn set_kind<T>(mut self, v: T) -> Self
6494    where
6495        T: std::convert::Into<std::string::String>,
6496    {
6497        self.kind = std::option::Option::Some(v.into());
6498        self
6499    }
6500
6501    /// Sets or clears the value of [kind][crate::model::Policy::kind].
6502    ///
6503    /// # Example
6504    /// ```ignore,no_run
6505    /// # use google_cloud_dns_v1::model::Policy;
6506    /// let x = Policy::new().set_or_clear_kind(Some("example"));
6507    /// let x = Policy::new().set_or_clear_kind(None::<String>);
6508    /// ```
6509    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
6510    where
6511        T: std::convert::Into<std::string::String>,
6512    {
6513        self.kind = v.map(|x| x.into());
6514        self
6515    }
6516
6517    /// Sets the value of [name][crate::model::Policy::name].
6518    ///
6519    /// # Example
6520    /// ```ignore,no_run
6521    /// # use google_cloud_dns_v1::model::Policy;
6522    /// let x = Policy::new().set_name("example");
6523    /// ```
6524    pub fn set_name<T>(mut self, v: T) -> Self
6525    where
6526        T: std::convert::Into<std::string::String>,
6527    {
6528        self.name = std::option::Option::Some(v.into());
6529        self
6530    }
6531
6532    /// Sets or clears the value of [name][crate::model::Policy::name].
6533    ///
6534    /// # Example
6535    /// ```ignore,no_run
6536    /// # use google_cloud_dns_v1::model::Policy;
6537    /// let x = Policy::new().set_or_clear_name(Some("example"));
6538    /// let x = Policy::new().set_or_clear_name(None::<String>);
6539    /// ```
6540    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
6541    where
6542        T: std::convert::Into<std::string::String>,
6543    {
6544        self.name = v.map(|x| x.into());
6545        self
6546    }
6547
6548    /// Sets the value of [networks][crate::model::Policy::networks].
6549    ///
6550    /// # Example
6551    /// ```ignore,no_run
6552    /// # use google_cloud_dns_v1::model::Policy;
6553    /// use google_cloud_dns_v1::model::PolicyNetwork;
6554    /// let x = Policy::new()
6555    ///     .set_networks([
6556    ///         PolicyNetwork::default()/* use setters */,
6557    ///         PolicyNetwork::default()/* use (different) setters */,
6558    ///     ]);
6559    /// ```
6560    pub fn set_networks<T, V>(mut self, v: T) -> Self
6561    where
6562        T: std::iter::IntoIterator<Item = V>,
6563        V: std::convert::Into<crate::model::PolicyNetwork>,
6564    {
6565        use std::iter::Iterator;
6566        self.networks = v.into_iter().map(|i| i.into()).collect();
6567        self
6568    }
6569}
6570
6571impl wkt::message::Message for Policy {
6572    fn typename() -> &'static str {
6573        "type.googleapis.com/.Policy"
6574    }
6575}
6576
6577#[allow(missing_docs)]
6578#[derive(Clone, Default, PartialEq)]
6579#[non_exhaustive]
6580pub struct PolicyAlternativeNameServerConfig {
6581    #[allow(missing_docs)]
6582    pub kind: std::option::Option<std::string::String>,
6583
6584    /// Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified.
6585    pub target_name_servers:
6586        std::vec::Vec<crate::model::PolicyAlternativeNameServerConfigTargetNameServer>,
6587
6588    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6589}
6590
6591impl PolicyAlternativeNameServerConfig {
6592    /// Creates a new default instance.
6593    pub fn new() -> Self {
6594        std::default::Default::default()
6595    }
6596
6597    /// Sets the value of [kind][crate::model::PolicyAlternativeNameServerConfig::kind].
6598    ///
6599    /// # Example
6600    /// ```ignore,no_run
6601    /// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfig;
6602    /// let x = PolicyAlternativeNameServerConfig::new().set_kind("example");
6603    /// ```
6604    pub fn set_kind<T>(mut self, v: T) -> Self
6605    where
6606        T: std::convert::Into<std::string::String>,
6607    {
6608        self.kind = std::option::Option::Some(v.into());
6609        self
6610    }
6611
6612    /// Sets or clears the value of [kind][crate::model::PolicyAlternativeNameServerConfig::kind].
6613    ///
6614    /// # Example
6615    /// ```ignore,no_run
6616    /// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfig;
6617    /// let x = PolicyAlternativeNameServerConfig::new().set_or_clear_kind(Some("example"));
6618    /// let x = PolicyAlternativeNameServerConfig::new().set_or_clear_kind(None::<String>);
6619    /// ```
6620    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
6621    where
6622        T: std::convert::Into<std::string::String>,
6623    {
6624        self.kind = v.map(|x| x.into());
6625        self
6626    }
6627
6628    /// Sets the value of [target_name_servers][crate::model::PolicyAlternativeNameServerConfig::target_name_servers].
6629    ///
6630    /// # Example
6631    /// ```ignore,no_run
6632    /// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfig;
6633    /// use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
6634    /// let x = PolicyAlternativeNameServerConfig::new()
6635    ///     .set_target_name_servers([
6636    ///         PolicyAlternativeNameServerConfigTargetNameServer::default()/* use setters */,
6637    ///         PolicyAlternativeNameServerConfigTargetNameServer::default()/* use (different) setters */,
6638    ///     ]);
6639    /// ```
6640    pub fn set_target_name_servers<T, V>(mut self, v: T) -> Self
6641    where
6642        T: std::iter::IntoIterator<Item = V>,
6643        V: std::convert::Into<crate::model::PolicyAlternativeNameServerConfigTargetNameServer>,
6644    {
6645        use std::iter::Iterator;
6646        self.target_name_servers = v.into_iter().map(|i| i.into()).collect();
6647        self
6648    }
6649}
6650
6651impl wkt::message::Message for PolicyAlternativeNameServerConfig {
6652    fn typename() -> &'static str {
6653        "type.googleapis.com/.PolicyAlternativeNameServerConfig"
6654    }
6655}
6656
6657#[allow(missing_docs)]
6658#[derive(Clone, Default, PartialEq)]
6659#[non_exhaustive]
6660pub struct PolicyAlternativeNameServerConfigTargetNameServer {
6661    /// Forwarding path for this TargetNameServer. If unset or set to DEFAULT, Cloud DNS makes forwarding decisions based on address ranges; that is, RFC1918 addresses go to the VPC network, non-RFC1918 addresses go to the internet. When set to PRIVATE, Cloud DNS always sends queries through the VPC network for this target.
6662    pub forwarding_path: std::option::Option<
6663        crate::model::policy_alternative_name_server_config_target_name_server::ForwardingPath,
6664    >,
6665
6666    /// IPv4 address to forward queries to.
6667    pub ipv_4_address: std::option::Option<std::string::String>,
6668
6669    /// IPv6 address to forward to. Does not accept both fields (ipv4 & ipv6) being populated. Public preview as of November 2022.
6670    pub ipv_6_address: std::option::Option<std::string::String>,
6671
6672    #[allow(missing_docs)]
6673    pub kind: std::option::Option<std::string::String>,
6674
6675    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6676}
6677
6678impl PolicyAlternativeNameServerConfigTargetNameServer {
6679    /// Creates a new default instance.
6680    pub fn new() -> Self {
6681        std::default::Default::default()
6682    }
6683
6684    /// Sets the value of [forwarding_path][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::forwarding_path].
6685    ///
6686    /// # Example
6687    /// ```ignore,no_run
6688    /// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
6689    /// use google_cloud_dns_v1::model::policy_alternative_name_server_config_target_name_server::ForwardingPath;
6690    /// let x0 = PolicyAlternativeNameServerConfigTargetNameServer::new().set_forwarding_path(ForwardingPath::Private);
6691    /// ```
6692    pub fn set_forwarding_path<T>(mut self, v: T) -> Self
6693    where T: std::convert::Into<crate::model::policy_alternative_name_server_config_target_name_server::ForwardingPath>
6694    {
6695        self.forwarding_path = std::option::Option::Some(v.into());
6696        self
6697    }
6698
6699    /// Sets or clears the value of [forwarding_path][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::forwarding_path].
6700    ///
6701    /// # Example
6702    /// ```ignore,no_run
6703    /// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
6704    /// use google_cloud_dns_v1::model::policy_alternative_name_server_config_target_name_server::ForwardingPath;
6705    /// let x0 = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_forwarding_path(Some(ForwardingPath::Private));
6706    /// let x_none = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_forwarding_path(None::<ForwardingPath>);
6707    /// ```
6708    pub fn set_or_clear_forwarding_path<T>(mut self, v: std::option::Option<T>) -> Self
6709    where T: std::convert::Into<crate::model::policy_alternative_name_server_config_target_name_server::ForwardingPath>
6710    {
6711        self.forwarding_path = v.map(|x| x.into());
6712        self
6713    }
6714
6715    /// Sets the value of [ipv_4_address][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::ipv_4_address].
6716    ///
6717    /// # Example
6718    /// ```ignore,no_run
6719    /// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
6720    /// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_ipv_4_address("example");
6721    /// ```
6722    pub fn set_ipv_4_address<T>(mut self, v: T) -> Self
6723    where
6724        T: std::convert::Into<std::string::String>,
6725    {
6726        self.ipv_4_address = std::option::Option::Some(v.into());
6727        self
6728    }
6729
6730    /// Sets or clears the value of [ipv_4_address][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::ipv_4_address].
6731    ///
6732    /// # Example
6733    /// ```ignore,no_run
6734    /// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
6735    /// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_ipv_4_address(Some("example"));
6736    /// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_ipv_4_address(None::<String>);
6737    /// ```
6738    pub fn set_or_clear_ipv_4_address<T>(mut self, v: std::option::Option<T>) -> Self
6739    where
6740        T: std::convert::Into<std::string::String>,
6741    {
6742        self.ipv_4_address = v.map(|x| x.into());
6743        self
6744    }
6745
6746    /// Sets the value of [ipv_6_address][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::ipv_6_address].
6747    ///
6748    /// # Example
6749    /// ```ignore,no_run
6750    /// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
6751    /// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_ipv_6_address("example");
6752    /// ```
6753    pub fn set_ipv_6_address<T>(mut self, v: T) -> Self
6754    where
6755        T: std::convert::Into<std::string::String>,
6756    {
6757        self.ipv_6_address = std::option::Option::Some(v.into());
6758        self
6759    }
6760
6761    /// Sets or clears the value of [ipv_6_address][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::ipv_6_address].
6762    ///
6763    /// # Example
6764    /// ```ignore,no_run
6765    /// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
6766    /// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_ipv_6_address(Some("example"));
6767    /// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_ipv_6_address(None::<String>);
6768    /// ```
6769    pub fn set_or_clear_ipv_6_address<T>(mut self, v: std::option::Option<T>) -> Self
6770    where
6771        T: std::convert::Into<std::string::String>,
6772    {
6773        self.ipv_6_address = v.map(|x| x.into());
6774        self
6775    }
6776
6777    /// Sets the value of [kind][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::kind].
6778    ///
6779    /// # Example
6780    /// ```ignore,no_run
6781    /// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
6782    /// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_kind("example");
6783    /// ```
6784    pub fn set_kind<T>(mut self, v: T) -> Self
6785    where
6786        T: std::convert::Into<std::string::String>,
6787    {
6788        self.kind = std::option::Option::Some(v.into());
6789        self
6790    }
6791
6792    /// Sets or clears the value of [kind][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::kind].
6793    ///
6794    /// # Example
6795    /// ```ignore,no_run
6796    /// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
6797    /// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_kind(Some("example"));
6798    /// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_kind(None::<String>);
6799    /// ```
6800    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
6801    where
6802        T: std::convert::Into<std::string::String>,
6803    {
6804        self.kind = v.map(|x| x.into());
6805        self
6806    }
6807}
6808
6809impl wkt::message::Message for PolicyAlternativeNameServerConfigTargetNameServer {
6810    fn typename() -> &'static str {
6811        "type.googleapis.com/.PolicyAlternativeNameServerConfigTargetNameServer"
6812    }
6813}
6814
6815/// Defines additional types related to [PolicyAlternativeNameServerConfigTargetNameServer].
6816pub mod policy_alternative_name_server_config_target_name_server {
6817    #[allow(unused_imports)]
6818    use super::*;
6819
6820    /// The enumerated type for the [forwardingPath][.PolicyAlternativeNameServerConfigTargetNameServer.forwardingPath] field.
6821    ///
6822    /// # Working with unknown values
6823    ///
6824    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6825    /// additional enum variants at any time. Adding new variants is not considered
6826    /// a breaking change. Applications should write their code in anticipation of:
6827    ///
6828    /// - New values appearing in future releases of the client library, **and**
6829    /// - New values received dynamically, without application changes.
6830    ///
6831    /// Please consult the [Working with enums] section in the user guide for some
6832    /// guidelines.
6833    ///
6834    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6835    #[derive(Clone, Debug, PartialEq)]
6836    #[non_exhaustive]
6837    pub enum ForwardingPath {
6838        /// Cloud DNS makes forwarding decision based on IP address ranges; that is, RFC1918 addresses forward to the target through the VPC and non-RFC1918 addresses forward to the target through the internet
6839        Default,
6840        /// Cloud DNS always forwards to this target through the VPC.
6841        Private,
6842        /// If set, the enum was initialized with an unknown value.
6843        ///
6844        /// Applications can examine the value using [ForwardingPath::name].
6845        UnknownValue(forwarding_path::UnknownValue),
6846    }
6847
6848    #[doc(hidden)]
6849    pub mod forwarding_path {
6850        #[allow(unused_imports)]
6851        use super::*;
6852        #[derive(Clone, Debug, PartialEq)]
6853        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6854    }
6855
6856    impl ForwardingPath {
6857        /// Gets the enum value as a string.
6858        pub fn name(&self) -> std::option::Option<&str> {
6859            match self {
6860                Self::Default => std::option::Option::Some("default"),
6861                Self::Private => std::option::Option::Some("private"),
6862                Self::UnknownValue(u) => u.0.name(),
6863            }
6864        }
6865    }
6866
6867    impl std::fmt::Display for ForwardingPath {
6868        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6869            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
6870        }
6871    }
6872
6873    impl std::convert::From<&str> for ForwardingPath {
6874        fn from(value: &str) -> Self {
6875            use std::string::ToString;
6876            match value {
6877                "default" => Self::Default,
6878                "private" => Self::Private,
6879                _ => Self::UnknownValue(forwarding_path::UnknownValue(
6880                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6881                )),
6882            }
6883        }
6884    }
6885
6886    impl serde::ser::Serialize for ForwardingPath {
6887        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6888        where
6889            S: serde::Serializer,
6890        {
6891            match self {
6892                Self::Default => serializer.serialize_str("default"),
6893                Self::Private => serializer.serialize_str("private"),
6894                Self::UnknownValue(u) => u.0.serialize(serializer),
6895            }
6896        }
6897    }
6898
6899    impl<'de> serde::de::Deserialize<'de> for ForwardingPath {
6900        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6901        where
6902            D: serde::Deserializer<'de>,
6903        {
6904            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<ForwardingPath>::new(
6905                "..PolicyAlternativeNameServerConfigTargetNameServer.forwardingPath",
6906            ))
6907        }
6908    }
6909}
6910
6911/// DNS64 policies
6912#[derive(Clone, Default, PartialEq)]
6913#[non_exhaustive]
6914pub struct PolicyDns64Config {
6915    #[allow(missing_docs)]
6916    pub kind: std::option::Option<std::string::String>,
6917
6918    /// The scope to which DNS64 config will be applied to.
6919    pub scope: std::option::Option<crate::model::PolicyDns64ConfigScope>,
6920
6921    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6922}
6923
6924impl PolicyDns64Config {
6925    /// Creates a new default instance.
6926    pub fn new() -> Self {
6927        std::default::Default::default()
6928    }
6929
6930    /// Sets the value of [kind][crate::model::PolicyDns64Config::kind].
6931    ///
6932    /// # Example
6933    /// ```ignore,no_run
6934    /// # use google_cloud_dns_v1::model::PolicyDns64Config;
6935    /// let x = PolicyDns64Config::new().set_kind("example");
6936    /// ```
6937    pub fn set_kind<T>(mut self, v: T) -> Self
6938    where
6939        T: std::convert::Into<std::string::String>,
6940    {
6941        self.kind = std::option::Option::Some(v.into());
6942        self
6943    }
6944
6945    /// Sets or clears the value of [kind][crate::model::PolicyDns64Config::kind].
6946    ///
6947    /// # Example
6948    /// ```ignore,no_run
6949    /// # use google_cloud_dns_v1::model::PolicyDns64Config;
6950    /// let x = PolicyDns64Config::new().set_or_clear_kind(Some("example"));
6951    /// let x = PolicyDns64Config::new().set_or_clear_kind(None::<String>);
6952    /// ```
6953    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
6954    where
6955        T: std::convert::Into<std::string::String>,
6956    {
6957        self.kind = v.map(|x| x.into());
6958        self
6959    }
6960
6961    /// Sets the value of [scope][crate::model::PolicyDns64Config::scope].
6962    ///
6963    /// # Example
6964    /// ```ignore,no_run
6965    /// # use google_cloud_dns_v1::model::PolicyDns64Config;
6966    /// use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
6967    /// let x = PolicyDns64Config::new().set_scope(PolicyDns64ConfigScope::default()/* use setters */);
6968    /// ```
6969    pub fn set_scope<T>(mut self, v: T) -> Self
6970    where
6971        T: std::convert::Into<crate::model::PolicyDns64ConfigScope>,
6972    {
6973        self.scope = std::option::Option::Some(v.into());
6974        self
6975    }
6976
6977    /// Sets or clears the value of [scope][crate::model::PolicyDns64Config::scope].
6978    ///
6979    /// # Example
6980    /// ```ignore,no_run
6981    /// # use google_cloud_dns_v1::model::PolicyDns64Config;
6982    /// use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
6983    /// let x = PolicyDns64Config::new().set_or_clear_scope(Some(PolicyDns64ConfigScope::default()/* use setters */));
6984    /// let x = PolicyDns64Config::new().set_or_clear_scope(None::<PolicyDns64ConfigScope>);
6985    /// ```
6986    pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
6987    where
6988        T: std::convert::Into<crate::model::PolicyDns64ConfigScope>,
6989    {
6990        self.scope = v.map(|x| x.into());
6991        self
6992    }
6993}
6994
6995impl wkt::message::Message for PolicyDns64Config {
6996    fn typename() -> &'static str {
6997        "type.googleapis.com/.PolicyDns64Config"
6998    }
6999}
7000
7001#[allow(missing_docs)]
7002#[derive(Clone, Default, PartialEq)]
7003#[non_exhaustive]
7004pub struct PolicyDns64ConfigScope {
7005    /// Controls whether DNS64 is enabled globally for all networks bound to the policy.
7006    pub all_queries: std::option::Option<bool>,
7007
7008    #[allow(missing_docs)]
7009    pub kind: std::option::Option<std::string::String>,
7010
7011    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7012}
7013
7014impl PolicyDns64ConfigScope {
7015    /// Creates a new default instance.
7016    pub fn new() -> Self {
7017        std::default::Default::default()
7018    }
7019
7020    /// Sets the value of [all_queries][crate::model::PolicyDns64ConfigScope::all_queries].
7021    ///
7022    /// # Example
7023    /// ```ignore,no_run
7024    /// # use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
7025    /// let x = PolicyDns64ConfigScope::new().set_all_queries(true);
7026    /// ```
7027    pub fn set_all_queries<T>(mut self, v: T) -> Self
7028    where
7029        T: std::convert::Into<bool>,
7030    {
7031        self.all_queries = std::option::Option::Some(v.into());
7032        self
7033    }
7034
7035    /// Sets or clears the value of [all_queries][crate::model::PolicyDns64ConfigScope::all_queries].
7036    ///
7037    /// # Example
7038    /// ```ignore,no_run
7039    /// # use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
7040    /// let x = PolicyDns64ConfigScope::new().set_or_clear_all_queries(Some(false));
7041    /// let x = PolicyDns64ConfigScope::new().set_or_clear_all_queries(None::<bool>);
7042    /// ```
7043    pub fn set_or_clear_all_queries<T>(mut self, v: std::option::Option<T>) -> Self
7044    where
7045        T: std::convert::Into<bool>,
7046    {
7047        self.all_queries = v.map(|x| x.into());
7048        self
7049    }
7050
7051    /// Sets the value of [kind][crate::model::PolicyDns64ConfigScope::kind].
7052    ///
7053    /// # Example
7054    /// ```ignore,no_run
7055    /// # use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
7056    /// let x = PolicyDns64ConfigScope::new().set_kind("example");
7057    /// ```
7058    pub fn set_kind<T>(mut self, v: T) -> Self
7059    where
7060        T: std::convert::Into<std::string::String>,
7061    {
7062        self.kind = std::option::Option::Some(v.into());
7063        self
7064    }
7065
7066    /// Sets or clears the value of [kind][crate::model::PolicyDns64ConfigScope::kind].
7067    ///
7068    /// # Example
7069    /// ```ignore,no_run
7070    /// # use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
7071    /// let x = PolicyDns64ConfigScope::new().set_or_clear_kind(Some("example"));
7072    /// let x = PolicyDns64ConfigScope::new().set_or_clear_kind(None::<String>);
7073    /// ```
7074    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
7075    where
7076        T: std::convert::Into<std::string::String>,
7077    {
7078        self.kind = v.map(|x| x.into());
7079        self
7080    }
7081}
7082
7083impl wkt::message::Message for PolicyDns64ConfigScope {
7084    fn typename() -> &'static str {
7085        "type.googleapis.com/.PolicyDns64ConfigScope"
7086    }
7087}
7088
7089#[allow(missing_docs)]
7090#[derive(Clone, Default, PartialEq)]
7091#[non_exhaustive]
7092pub struct PolicyNetwork {
7093    #[allow(missing_docs)]
7094    pub kind: std::option::Option<std::string::String>,
7095
7096    /// The fully qualified URL of the VPC network to bind to. This should be formatted like <https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}>
7097    pub network_url: std::option::Option<std::string::String>,
7098
7099    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7100}
7101
7102impl PolicyNetwork {
7103    /// Creates a new default instance.
7104    pub fn new() -> Self {
7105        std::default::Default::default()
7106    }
7107
7108    /// Sets the value of [kind][crate::model::PolicyNetwork::kind].
7109    ///
7110    /// # Example
7111    /// ```ignore,no_run
7112    /// # use google_cloud_dns_v1::model::PolicyNetwork;
7113    /// let x = PolicyNetwork::new().set_kind("example");
7114    /// ```
7115    pub fn set_kind<T>(mut self, v: T) -> Self
7116    where
7117        T: std::convert::Into<std::string::String>,
7118    {
7119        self.kind = std::option::Option::Some(v.into());
7120        self
7121    }
7122
7123    /// Sets or clears the value of [kind][crate::model::PolicyNetwork::kind].
7124    ///
7125    /// # Example
7126    /// ```ignore,no_run
7127    /// # use google_cloud_dns_v1::model::PolicyNetwork;
7128    /// let x = PolicyNetwork::new().set_or_clear_kind(Some("example"));
7129    /// let x = PolicyNetwork::new().set_or_clear_kind(None::<String>);
7130    /// ```
7131    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
7132    where
7133        T: std::convert::Into<std::string::String>,
7134    {
7135        self.kind = v.map(|x| x.into());
7136        self
7137    }
7138
7139    /// Sets the value of [network_url][crate::model::PolicyNetwork::network_url].
7140    ///
7141    /// # Example
7142    /// ```ignore,no_run
7143    /// # use google_cloud_dns_v1::model::PolicyNetwork;
7144    /// let x = PolicyNetwork::new().set_network_url("example");
7145    /// ```
7146    pub fn set_network_url<T>(mut self, v: T) -> Self
7147    where
7148        T: std::convert::Into<std::string::String>,
7149    {
7150        self.network_url = std::option::Option::Some(v.into());
7151        self
7152    }
7153
7154    /// Sets or clears the value of [network_url][crate::model::PolicyNetwork::network_url].
7155    ///
7156    /// # Example
7157    /// ```ignore,no_run
7158    /// # use google_cloud_dns_v1::model::PolicyNetwork;
7159    /// let x = PolicyNetwork::new().set_or_clear_network_url(Some("example"));
7160    /// let x = PolicyNetwork::new().set_or_clear_network_url(None::<String>);
7161    /// ```
7162    pub fn set_or_clear_network_url<T>(mut self, v: std::option::Option<T>) -> Self
7163    where
7164        T: std::convert::Into<std::string::String>,
7165    {
7166        self.network_url = v.map(|x| x.into());
7167        self
7168    }
7169}
7170
7171impl wkt::message::Message for PolicyNetwork {
7172    fn typename() -> &'static str {
7173        "type.googleapis.com/.PolicyNetwork"
7174    }
7175}
7176
7177/// A project resource. The project is a top level container for resources including Cloud DNS ManagedZones. Projects can be created only in the APIs console.
7178#[derive(Clone, Default, PartialEq)]
7179#[non_exhaustive]
7180pub struct Project {
7181    /// User assigned unique identifier for the resource (output only).
7182    pub id: std::option::Option<std::string::String>,
7183
7184    #[allow(missing_docs)]
7185    pub kind: std::option::Option<std::string::String>,
7186
7187    /// Unique numeric identifier for the resource; defined by the server (output only).
7188    pub number: std::option::Option<u64>,
7189
7190    /// Quotas assigned to this project (output only).
7191    pub quota: std::option::Option<crate::model::Quota>,
7192
7193    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7194}
7195
7196impl Project {
7197    /// Creates a new default instance.
7198    pub fn new() -> Self {
7199        std::default::Default::default()
7200    }
7201
7202    /// Sets the value of [id][crate::model::Project::id].
7203    ///
7204    /// # Example
7205    /// ```ignore,no_run
7206    /// # use google_cloud_dns_v1::model::Project;
7207    /// let x = Project::new().set_id("example");
7208    /// ```
7209    pub fn set_id<T>(mut self, v: T) -> Self
7210    where
7211        T: std::convert::Into<std::string::String>,
7212    {
7213        self.id = std::option::Option::Some(v.into());
7214        self
7215    }
7216
7217    /// Sets or clears the value of [id][crate::model::Project::id].
7218    ///
7219    /// # Example
7220    /// ```ignore,no_run
7221    /// # use google_cloud_dns_v1::model::Project;
7222    /// let x = Project::new().set_or_clear_id(Some("example"));
7223    /// let x = Project::new().set_or_clear_id(None::<String>);
7224    /// ```
7225    pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
7226    where
7227        T: std::convert::Into<std::string::String>,
7228    {
7229        self.id = v.map(|x| x.into());
7230        self
7231    }
7232
7233    /// Sets the value of [kind][crate::model::Project::kind].
7234    ///
7235    /// # Example
7236    /// ```ignore,no_run
7237    /// # use google_cloud_dns_v1::model::Project;
7238    /// let x = Project::new().set_kind("example");
7239    /// ```
7240    pub fn set_kind<T>(mut self, v: T) -> Self
7241    where
7242        T: std::convert::Into<std::string::String>,
7243    {
7244        self.kind = std::option::Option::Some(v.into());
7245        self
7246    }
7247
7248    /// Sets or clears the value of [kind][crate::model::Project::kind].
7249    ///
7250    /// # Example
7251    /// ```ignore,no_run
7252    /// # use google_cloud_dns_v1::model::Project;
7253    /// let x = Project::new().set_or_clear_kind(Some("example"));
7254    /// let x = Project::new().set_or_clear_kind(None::<String>);
7255    /// ```
7256    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
7257    where
7258        T: std::convert::Into<std::string::String>,
7259    {
7260        self.kind = v.map(|x| x.into());
7261        self
7262    }
7263
7264    /// Sets the value of [number][crate::model::Project::number].
7265    ///
7266    /// # Example
7267    /// ```ignore,no_run
7268    /// # use google_cloud_dns_v1::model::Project;
7269    /// let x = Project::new().set_number(42_u32);
7270    /// ```
7271    pub fn set_number<T>(mut self, v: T) -> Self
7272    where
7273        T: std::convert::Into<u64>,
7274    {
7275        self.number = std::option::Option::Some(v.into());
7276        self
7277    }
7278
7279    /// Sets or clears the value of [number][crate::model::Project::number].
7280    ///
7281    /// # Example
7282    /// ```ignore,no_run
7283    /// # use google_cloud_dns_v1::model::Project;
7284    /// let x = Project::new().set_or_clear_number(Some(42_u32));
7285    /// let x = Project::new().set_or_clear_number(None::<u32>);
7286    /// ```
7287    pub fn set_or_clear_number<T>(mut self, v: std::option::Option<T>) -> Self
7288    where
7289        T: std::convert::Into<u64>,
7290    {
7291        self.number = v.map(|x| x.into());
7292        self
7293    }
7294
7295    /// Sets the value of [quota][crate::model::Project::quota].
7296    ///
7297    /// # Example
7298    /// ```ignore,no_run
7299    /// # use google_cloud_dns_v1::model::Project;
7300    /// use google_cloud_dns_v1::model::Quota;
7301    /// let x = Project::new().set_quota(Quota::default()/* use setters */);
7302    /// ```
7303    pub fn set_quota<T>(mut self, v: T) -> Self
7304    where
7305        T: std::convert::Into<crate::model::Quota>,
7306    {
7307        self.quota = std::option::Option::Some(v.into());
7308        self
7309    }
7310
7311    /// Sets or clears the value of [quota][crate::model::Project::quota].
7312    ///
7313    /// # Example
7314    /// ```ignore,no_run
7315    /// # use google_cloud_dns_v1::model::Project;
7316    /// use google_cloud_dns_v1::model::Quota;
7317    /// let x = Project::new().set_or_clear_quota(Some(Quota::default()/* use setters */));
7318    /// let x = Project::new().set_or_clear_quota(None::<Quota>);
7319    /// ```
7320    pub fn set_or_clear_quota<T>(mut self, v: std::option::Option<T>) -> Self
7321    where
7322        T: std::convert::Into<crate::model::Quota>,
7323    {
7324        self.quota = v.map(|x| x.into());
7325        self
7326    }
7327}
7328
7329impl wkt::message::Message for Project {
7330    fn typename() -> &'static str {
7331        "type.googleapis.com/.Project"
7332    }
7333}
7334
7335/// Limits associated with a Project.
7336#[derive(Clone, Default, PartialEq)]
7337#[non_exhaustive]
7338pub struct Quota {
7339    /// Maximum allowed number of DnsKeys per ManagedZone.
7340    pub dns_keys_per_managed_zone: std::option::Option<i32>,
7341
7342    /// Maximum allowed number of GKE clusters to which a privately scoped zone can be attached.
7343    pub gke_clusters_per_managed_zone: std::option::Option<i32>,
7344
7345    /// Maximum allowed number of GKE clusters per policy.
7346    pub gke_clusters_per_policy: std::option::Option<i32>,
7347
7348    /// Maximum allowed number of GKE clusters per response policy.
7349    pub gke_clusters_per_response_policy: std::option::Option<i32>,
7350
7351    #[allow(missing_docs)]
7352    pub internet_health_checks_per_managed_zone: std::option::Option<i32>,
7353
7354    /// Maximum allowed number of items per routing policy.
7355    pub items_per_routing_policy: std::option::Option<i32>,
7356
7357    #[allow(missing_docs)]
7358    pub kind: std::option::Option<std::string::String>,
7359
7360    /// Maximum allowed number of managed zones in the project.
7361    pub managed_zones: std::option::Option<i32>,
7362
7363    /// Maximum allowed number of managed zones which can be attached to a GKE cluster.
7364    pub managed_zones_per_gke_cluster: std::option::Option<i32>,
7365
7366    /// Maximum allowed number of managed zones which can be attached to a network.
7367    pub managed_zones_per_network: std::option::Option<i32>,
7368
7369    /// Maximum number of nameservers per delegation, meant to prevent abuse
7370    pub nameservers_per_delegation: std::option::Option<i32>,
7371
7372    /// Maximum allowed number of networks to which a privately scoped zone can be attached.
7373    pub networks_per_managed_zone: std::option::Option<i32>,
7374
7375    /// Maximum allowed number of networks per policy.
7376    pub networks_per_policy: std::option::Option<i32>,
7377
7378    /// Maximum allowed number of networks per response policy.
7379    pub networks_per_response_policy: std::option::Option<i32>,
7380
7381    /// Maximum allowed number of consumer peering zones per target network owned by this producer project
7382    pub peering_zones_per_target_network: std::option::Option<i32>,
7383
7384    /// Maximum allowed number of policies per project.
7385    pub policies: std::option::Option<i32>,
7386
7387    /// Maximum allowed number of ResourceRecords per ResourceRecordSet.
7388    pub resource_records_per_rrset: std::option::Option<i32>,
7389
7390    /// Maximum allowed number of response policies per project.
7391    pub response_policies: std::option::Option<i32>,
7392
7393    /// Maximum allowed number of rules per response policy.
7394    pub response_policy_rules_per_response_policy: std::option::Option<i32>,
7395
7396    /// Maximum allowed number of ResourceRecordSets to add per ChangesCreateRequest.
7397    pub rrset_additions_per_change: std::option::Option<i32>,
7398
7399    /// Maximum allowed number of ResourceRecordSets to delete per ChangesCreateRequest.
7400    pub rrset_deletions_per_change: std::option::Option<i32>,
7401
7402    /// Maximum allowed number of ResourceRecordSets per zone in the project.
7403    pub rrsets_per_managed_zone: std::option::Option<i32>,
7404
7405    /// Maximum allowed number of target name servers per managed forwarding zone.
7406    pub target_name_servers_per_managed_zone: std::option::Option<i32>,
7407
7408    /// Maximum allowed number of alternative target name servers per policy.
7409    pub target_name_servers_per_policy: std::option::Option<i32>,
7410
7411    /// Maximum allowed size for total rrdata in one ChangesCreateRequest in bytes.
7412    pub total_rrdata_size_per_change: std::option::Option<i32>,
7413
7414    /// DNSSEC algorithm and key length types that can be used for DnsKeys.
7415    pub whitelisted_key_specs: std::vec::Vec<crate::model::DnsKeySpec>,
7416
7417    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7418}
7419
7420impl Quota {
7421    /// Creates a new default instance.
7422    pub fn new() -> Self {
7423        std::default::Default::default()
7424    }
7425
7426    /// Sets the value of [dns_keys_per_managed_zone][crate::model::Quota::dns_keys_per_managed_zone].
7427    ///
7428    /// # Example
7429    /// ```ignore,no_run
7430    /// # use google_cloud_dns_v1::model::Quota;
7431    /// let x = Quota::new().set_dns_keys_per_managed_zone(42);
7432    /// ```
7433    pub fn set_dns_keys_per_managed_zone<T>(mut self, v: T) -> Self
7434    where
7435        T: std::convert::Into<i32>,
7436    {
7437        self.dns_keys_per_managed_zone = std::option::Option::Some(v.into());
7438        self
7439    }
7440
7441    /// Sets or clears the value of [dns_keys_per_managed_zone][crate::model::Quota::dns_keys_per_managed_zone].
7442    ///
7443    /// # Example
7444    /// ```ignore,no_run
7445    /// # use google_cloud_dns_v1::model::Quota;
7446    /// let x = Quota::new().set_or_clear_dns_keys_per_managed_zone(Some(42));
7447    /// let x = Quota::new().set_or_clear_dns_keys_per_managed_zone(None::<i32>);
7448    /// ```
7449    pub fn set_or_clear_dns_keys_per_managed_zone<T>(mut self, v: std::option::Option<T>) -> Self
7450    where
7451        T: std::convert::Into<i32>,
7452    {
7453        self.dns_keys_per_managed_zone = v.map(|x| x.into());
7454        self
7455    }
7456
7457    /// Sets the value of [gke_clusters_per_managed_zone][crate::model::Quota::gke_clusters_per_managed_zone].
7458    ///
7459    /// # Example
7460    /// ```ignore,no_run
7461    /// # use google_cloud_dns_v1::model::Quota;
7462    /// let x = Quota::new().set_gke_clusters_per_managed_zone(42);
7463    /// ```
7464    pub fn set_gke_clusters_per_managed_zone<T>(mut self, v: T) -> Self
7465    where
7466        T: std::convert::Into<i32>,
7467    {
7468        self.gke_clusters_per_managed_zone = std::option::Option::Some(v.into());
7469        self
7470    }
7471
7472    /// Sets or clears the value of [gke_clusters_per_managed_zone][crate::model::Quota::gke_clusters_per_managed_zone].
7473    ///
7474    /// # Example
7475    /// ```ignore,no_run
7476    /// # use google_cloud_dns_v1::model::Quota;
7477    /// let x = Quota::new().set_or_clear_gke_clusters_per_managed_zone(Some(42));
7478    /// let x = Quota::new().set_or_clear_gke_clusters_per_managed_zone(None::<i32>);
7479    /// ```
7480    pub fn set_or_clear_gke_clusters_per_managed_zone<T>(
7481        mut self,
7482        v: std::option::Option<T>,
7483    ) -> Self
7484    where
7485        T: std::convert::Into<i32>,
7486    {
7487        self.gke_clusters_per_managed_zone = v.map(|x| x.into());
7488        self
7489    }
7490
7491    /// Sets the value of [gke_clusters_per_policy][crate::model::Quota::gke_clusters_per_policy].
7492    ///
7493    /// # Example
7494    /// ```ignore,no_run
7495    /// # use google_cloud_dns_v1::model::Quota;
7496    /// let x = Quota::new().set_gke_clusters_per_policy(42);
7497    /// ```
7498    pub fn set_gke_clusters_per_policy<T>(mut self, v: T) -> Self
7499    where
7500        T: std::convert::Into<i32>,
7501    {
7502        self.gke_clusters_per_policy = std::option::Option::Some(v.into());
7503        self
7504    }
7505
7506    /// Sets or clears the value of [gke_clusters_per_policy][crate::model::Quota::gke_clusters_per_policy].
7507    ///
7508    /// # Example
7509    /// ```ignore,no_run
7510    /// # use google_cloud_dns_v1::model::Quota;
7511    /// let x = Quota::new().set_or_clear_gke_clusters_per_policy(Some(42));
7512    /// let x = Quota::new().set_or_clear_gke_clusters_per_policy(None::<i32>);
7513    /// ```
7514    pub fn set_or_clear_gke_clusters_per_policy<T>(mut self, v: std::option::Option<T>) -> Self
7515    where
7516        T: std::convert::Into<i32>,
7517    {
7518        self.gke_clusters_per_policy = v.map(|x| x.into());
7519        self
7520    }
7521
7522    /// Sets the value of [gke_clusters_per_response_policy][crate::model::Quota::gke_clusters_per_response_policy].
7523    ///
7524    /// # Example
7525    /// ```ignore,no_run
7526    /// # use google_cloud_dns_v1::model::Quota;
7527    /// let x = Quota::new().set_gke_clusters_per_response_policy(42);
7528    /// ```
7529    pub fn set_gke_clusters_per_response_policy<T>(mut self, v: T) -> Self
7530    where
7531        T: std::convert::Into<i32>,
7532    {
7533        self.gke_clusters_per_response_policy = std::option::Option::Some(v.into());
7534        self
7535    }
7536
7537    /// Sets or clears the value of [gke_clusters_per_response_policy][crate::model::Quota::gke_clusters_per_response_policy].
7538    ///
7539    /// # Example
7540    /// ```ignore,no_run
7541    /// # use google_cloud_dns_v1::model::Quota;
7542    /// let x = Quota::new().set_or_clear_gke_clusters_per_response_policy(Some(42));
7543    /// let x = Quota::new().set_or_clear_gke_clusters_per_response_policy(None::<i32>);
7544    /// ```
7545    pub fn set_or_clear_gke_clusters_per_response_policy<T>(
7546        mut self,
7547        v: std::option::Option<T>,
7548    ) -> Self
7549    where
7550        T: std::convert::Into<i32>,
7551    {
7552        self.gke_clusters_per_response_policy = v.map(|x| x.into());
7553        self
7554    }
7555
7556    /// Sets the value of [internet_health_checks_per_managed_zone][crate::model::Quota::internet_health_checks_per_managed_zone].
7557    ///
7558    /// # Example
7559    /// ```ignore,no_run
7560    /// # use google_cloud_dns_v1::model::Quota;
7561    /// let x = Quota::new().set_internet_health_checks_per_managed_zone(42);
7562    /// ```
7563    pub fn set_internet_health_checks_per_managed_zone<T>(mut self, v: T) -> Self
7564    where
7565        T: std::convert::Into<i32>,
7566    {
7567        self.internet_health_checks_per_managed_zone = std::option::Option::Some(v.into());
7568        self
7569    }
7570
7571    /// Sets or clears the value of [internet_health_checks_per_managed_zone][crate::model::Quota::internet_health_checks_per_managed_zone].
7572    ///
7573    /// # Example
7574    /// ```ignore,no_run
7575    /// # use google_cloud_dns_v1::model::Quota;
7576    /// let x = Quota::new().set_or_clear_internet_health_checks_per_managed_zone(Some(42));
7577    /// let x = Quota::new().set_or_clear_internet_health_checks_per_managed_zone(None::<i32>);
7578    /// ```
7579    pub fn set_or_clear_internet_health_checks_per_managed_zone<T>(
7580        mut self,
7581        v: std::option::Option<T>,
7582    ) -> Self
7583    where
7584        T: std::convert::Into<i32>,
7585    {
7586        self.internet_health_checks_per_managed_zone = v.map(|x| x.into());
7587        self
7588    }
7589
7590    /// Sets the value of [items_per_routing_policy][crate::model::Quota::items_per_routing_policy].
7591    ///
7592    /// # Example
7593    /// ```ignore,no_run
7594    /// # use google_cloud_dns_v1::model::Quota;
7595    /// let x = Quota::new().set_items_per_routing_policy(42);
7596    /// ```
7597    pub fn set_items_per_routing_policy<T>(mut self, v: T) -> Self
7598    where
7599        T: std::convert::Into<i32>,
7600    {
7601        self.items_per_routing_policy = std::option::Option::Some(v.into());
7602        self
7603    }
7604
7605    /// Sets or clears the value of [items_per_routing_policy][crate::model::Quota::items_per_routing_policy].
7606    ///
7607    /// # Example
7608    /// ```ignore,no_run
7609    /// # use google_cloud_dns_v1::model::Quota;
7610    /// let x = Quota::new().set_or_clear_items_per_routing_policy(Some(42));
7611    /// let x = Quota::new().set_or_clear_items_per_routing_policy(None::<i32>);
7612    /// ```
7613    pub fn set_or_clear_items_per_routing_policy<T>(mut self, v: std::option::Option<T>) -> Self
7614    where
7615        T: std::convert::Into<i32>,
7616    {
7617        self.items_per_routing_policy = v.map(|x| x.into());
7618        self
7619    }
7620
7621    /// Sets the value of [kind][crate::model::Quota::kind].
7622    ///
7623    /// # Example
7624    /// ```ignore,no_run
7625    /// # use google_cloud_dns_v1::model::Quota;
7626    /// let x = Quota::new().set_kind("example");
7627    /// ```
7628    pub fn set_kind<T>(mut self, v: T) -> Self
7629    where
7630        T: std::convert::Into<std::string::String>,
7631    {
7632        self.kind = std::option::Option::Some(v.into());
7633        self
7634    }
7635
7636    /// Sets or clears the value of [kind][crate::model::Quota::kind].
7637    ///
7638    /// # Example
7639    /// ```ignore,no_run
7640    /// # use google_cloud_dns_v1::model::Quota;
7641    /// let x = Quota::new().set_or_clear_kind(Some("example"));
7642    /// let x = Quota::new().set_or_clear_kind(None::<String>);
7643    /// ```
7644    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
7645    where
7646        T: std::convert::Into<std::string::String>,
7647    {
7648        self.kind = v.map(|x| x.into());
7649        self
7650    }
7651
7652    /// Sets the value of [managed_zones][crate::model::Quota::managed_zones].
7653    ///
7654    /// # Example
7655    /// ```ignore,no_run
7656    /// # use google_cloud_dns_v1::model::Quota;
7657    /// let x = Quota::new().set_managed_zones(42);
7658    /// ```
7659    pub fn set_managed_zones<T>(mut self, v: T) -> Self
7660    where
7661        T: std::convert::Into<i32>,
7662    {
7663        self.managed_zones = std::option::Option::Some(v.into());
7664        self
7665    }
7666
7667    /// Sets or clears the value of [managed_zones][crate::model::Quota::managed_zones].
7668    ///
7669    /// # Example
7670    /// ```ignore,no_run
7671    /// # use google_cloud_dns_v1::model::Quota;
7672    /// let x = Quota::new().set_or_clear_managed_zones(Some(42));
7673    /// let x = Quota::new().set_or_clear_managed_zones(None::<i32>);
7674    /// ```
7675    pub fn set_or_clear_managed_zones<T>(mut self, v: std::option::Option<T>) -> Self
7676    where
7677        T: std::convert::Into<i32>,
7678    {
7679        self.managed_zones = v.map(|x| x.into());
7680        self
7681    }
7682
7683    /// Sets the value of [managed_zones_per_gke_cluster][crate::model::Quota::managed_zones_per_gke_cluster].
7684    ///
7685    /// # Example
7686    /// ```ignore,no_run
7687    /// # use google_cloud_dns_v1::model::Quota;
7688    /// let x = Quota::new().set_managed_zones_per_gke_cluster(42);
7689    /// ```
7690    pub fn set_managed_zones_per_gke_cluster<T>(mut self, v: T) -> Self
7691    where
7692        T: std::convert::Into<i32>,
7693    {
7694        self.managed_zones_per_gke_cluster = std::option::Option::Some(v.into());
7695        self
7696    }
7697
7698    /// Sets or clears the value of [managed_zones_per_gke_cluster][crate::model::Quota::managed_zones_per_gke_cluster].
7699    ///
7700    /// # Example
7701    /// ```ignore,no_run
7702    /// # use google_cloud_dns_v1::model::Quota;
7703    /// let x = Quota::new().set_or_clear_managed_zones_per_gke_cluster(Some(42));
7704    /// let x = Quota::new().set_or_clear_managed_zones_per_gke_cluster(None::<i32>);
7705    /// ```
7706    pub fn set_or_clear_managed_zones_per_gke_cluster<T>(
7707        mut self,
7708        v: std::option::Option<T>,
7709    ) -> Self
7710    where
7711        T: std::convert::Into<i32>,
7712    {
7713        self.managed_zones_per_gke_cluster = v.map(|x| x.into());
7714        self
7715    }
7716
7717    /// Sets the value of [managed_zones_per_network][crate::model::Quota::managed_zones_per_network].
7718    ///
7719    /// # Example
7720    /// ```ignore,no_run
7721    /// # use google_cloud_dns_v1::model::Quota;
7722    /// let x = Quota::new().set_managed_zones_per_network(42);
7723    /// ```
7724    pub fn set_managed_zones_per_network<T>(mut self, v: T) -> Self
7725    where
7726        T: std::convert::Into<i32>,
7727    {
7728        self.managed_zones_per_network = std::option::Option::Some(v.into());
7729        self
7730    }
7731
7732    /// Sets or clears the value of [managed_zones_per_network][crate::model::Quota::managed_zones_per_network].
7733    ///
7734    /// # Example
7735    /// ```ignore,no_run
7736    /// # use google_cloud_dns_v1::model::Quota;
7737    /// let x = Quota::new().set_or_clear_managed_zones_per_network(Some(42));
7738    /// let x = Quota::new().set_or_clear_managed_zones_per_network(None::<i32>);
7739    /// ```
7740    pub fn set_or_clear_managed_zones_per_network<T>(mut self, v: std::option::Option<T>) -> Self
7741    where
7742        T: std::convert::Into<i32>,
7743    {
7744        self.managed_zones_per_network = v.map(|x| x.into());
7745        self
7746    }
7747
7748    /// Sets the value of [nameservers_per_delegation][crate::model::Quota::nameservers_per_delegation].
7749    ///
7750    /// # Example
7751    /// ```ignore,no_run
7752    /// # use google_cloud_dns_v1::model::Quota;
7753    /// let x = Quota::new().set_nameservers_per_delegation(42);
7754    /// ```
7755    pub fn set_nameservers_per_delegation<T>(mut self, v: T) -> Self
7756    where
7757        T: std::convert::Into<i32>,
7758    {
7759        self.nameservers_per_delegation = std::option::Option::Some(v.into());
7760        self
7761    }
7762
7763    /// Sets or clears the value of [nameservers_per_delegation][crate::model::Quota::nameservers_per_delegation].
7764    ///
7765    /// # Example
7766    /// ```ignore,no_run
7767    /// # use google_cloud_dns_v1::model::Quota;
7768    /// let x = Quota::new().set_or_clear_nameservers_per_delegation(Some(42));
7769    /// let x = Quota::new().set_or_clear_nameservers_per_delegation(None::<i32>);
7770    /// ```
7771    pub fn set_or_clear_nameservers_per_delegation<T>(mut self, v: std::option::Option<T>) -> Self
7772    where
7773        T: std::convert::Into<i32>,
7774    {
7775        self.nameservers_per_delegation = v.map(|x| x.into());
7776        self
7777    }
7778
7779    /// Sets the value of [networks_per_managed_zone][crate::model::Quota::networks_per_managed_zone].
7780    ///
7781    /// # Example
7782    /// ```ignore,no_run
7783    /// # use google_cloud_dns_v1::model::Quota;
7784    /// let x = Quota::new().set_networks_per_managed_zone(42);
7785    /// ```
7786    pub fn set_networks_per_managed_zone<T>(mut self, v: T) -> Self
7787    where
7788        T: std::convert::Into<i32>,
7789    {
7790        self.networks_per_managed_zone = std::option::Option::Some(v.into());
7791        self
7792    }
7793
7794    /// Sets or clears the value of [networks_per_managed_zone][crate::model::Quota::networks_per_managed_zone].
7795    ///
7796    /// # Example
7797    /// ```ignore,no_run
7798    /// # use google_cloud_dns_v1::model::Quota;
7799    /// let x = Quota::new().set_or_clear_networks_per_managed_zone(Some(42));
7800    /// let x = Quota::new().set_or_clear_networks_per_managed_zone(None::<i32>);
7801    /// ```
7802    pub fn set_or_clear_networks_per_managed_zone<T>(mut self, v: std::option::Option<T>) -> Self
7803    where
7804        T: std::convert::Into<i32>,
7805    {
7806        self.networks_per_managed_zone = v.map(|x| x.into());
7807        self
7808    }
7809
7810    /// Sets the value of [networks_per_policy][crate::model::Quota::networks_per_policy].
7811    ///
7812    /// # Example
7813    /// ```ignore,no_run
7814    /// # use google_cloud_dns_v1::model::Quota;
7815    /// let x = Quota::new().set_networks_per_policy(42);
7816    /// ```
7817    pub fn set_networks_per_policy<T>(mut self, v: T) -> Self
7818    where
7819        T: std::convert::Into<i32>,
7820    {
7821        self.networks_per_policy = std::option::Option::Some(v.into());
7822        self
7823    }
7824
7825    /// Sets or clears the value of [networks_per_policy][crate::model::Quota::networks_per_policy].
7826    ///
7827    /// # Example
7828    /// ```ignore,no_run
7829    /// # use google_cloud_dns_v1::model::Quota;
7830    /// let x = Quota::new().set_or_clear_networks_per_policy(Some(42));
7831    /// let x = Quota::new().set_or_clear_networks_per_policy(None::<i32>);
7832    /// ```
7833    pub fn set_or_clear_networks_per_policy<T>(mut self, v: std::option::Option<T>) -> Self
7834    where
7835        T: std::convert::Into<i32>,
7836    {
7837        self.networks_per_policy = v.map(|x| x.into());
7838        self
7839    }
7840
7841    /// Sets the value of [networks_per_response_policy][crate::model::Quota::networks_per_response_policy].
7842    ///
7843    /// # Example
7844    /// ```ignore,no_run
7845    /// # use google_cloud_dns_v1::model::Quota;
7846    /// let x = Quota::new().set_networks_per_response_policy(42);
7847    /// ```
7848    pub fn set_networks_per_response_policy<T>(mut self, v: T) -> Self
7849    where
7850        T: std::convert::Into<i32>,
7851    {
7852        self.networks_per_response_policy = std::option::Option::Some(v.into());
7853        self
7854    }
7855
7856    /// Sets or clears the value of [networks_per_response_policy][crate::model::Quota::networks_per_response_policy].
7857    ///
7858    /// # Example
7859    /// ```ignore,no_run
7860    /// # use google_cloud_dns_v1::model::Quota;
7861    /// let x = Quota::new().set_or_clear_networks_per_response_policy(Some(42));
7862    /// let x = Quota::new().set_or_clear_networks_per_response_policy(None::<i32>);
7863    /// ```
7864    pub fn set_or_clear_networks_per_response_policy<T>(mut self, v: std::option::Option<T>) -> Self
7865    where
7866        T: std::convert::Into<i32>,
7867    {
7868        self.networks_per_response_policy = v.map(|x| x.into());
7869        self
7870    }
7871
7872    /// Sets the value of [peering_zones_per_target_network][crate::model::Quota::peering_zones_per_target_network].
7873    ///
7874    /// # Example
7875    /// ```ignore,no_run
7876    /// # use google_cloud_dns_v1::model::Quota;
7877    /// let x = Quota::new().set_peering_zones_per_target_network(42);
7878    /// ```
7879    pub fn set_peering_zones_per_target_network<T>(mut self, v: T) -> Self
7880    where
7881        T: std::convert::Into<i32>,
7882    {
7883        self.peering_zones_per_target_network = std::option::Option::Some(v.into());
7884        self
7885    }
7886
7887    /// Sets or clears the value of [peering_zones_per_target_network][crate::model::Quota::peering_zones_per_target_network].
7888    ///
7889    /// # Example
7890    /// ```ignore,no_run
7891    /// # use google_cloud_dns_v1::model::Quota;
7892    /// let x = Quota::new().set_or_clear_peering_zones_per_target_network(Some(42));
7893    /// let x = Quota::new().set_or_clear_peering_zones_per_target_network(None::<i32>);
7894    /// ```
7895    pub fn set_or_clear_peering_zones_per_target_network<T>(
7896        mut self,
7897        v: std::option::Option<T>,
7898    ) -> Self
7899    where
7900        T: std::convert::Into<i32>,
7901    {
7902        self.peering_zones_per_target_network = v.map(|x| x.into());
7903        self
7904    }
7905
7906    /// Sets the value of [policies][crate::model::Quota::policies].
7907    ///
7908    /// # Example
7909    /// ```ignore,no_run
7910    /// # use google_cloud_dns_v1::model::Quota;
7911    /// let x = Quota::new().set_policies(42);
7912    /// ```
7913    pub fn set_policies<T>(mut self, v: T) -> Self
7914    where
7915        T: std::convert::Into<i32>,
7916    {
7917        self.policies = std::option::Option::Some(v.into());
7918        self
7919    }
7920
7921    /// Sets or clears the value of [policies][crate::model::Quota::policies].
7922    ///
7923    /// # Example
7924    /// ```ignore,no_run
7925    /// # use google_cloud_dns_v1::model::Quota;
7926    /// let x = Quota::new().set_or_clear_policies(Some(42));
7927    /// let x = Quota::new().set_or_clear_policies(None::<i32>);
7928    /// ```
7929    pub fn set_or_clear_policies<T>(mut self, v: std::option::Option<T>) -> Self
7930    where
7931        T: std::convert::Into<i32>,
7932    {
7933        self.policies = v.map(|x| x.into());
7934        self
7935    }
7936
7937    /// Sets the value of [resource_records_per_rrset][crate::model::Quota::resource_records_per_rrset].
7938    ///
7939    /// # Example
7940    /// ```ignore,no_run
7941    /// # use google_cloud_dns_v1::model::Quota;
7942    /// let x = Quota::new().set_resource_records_per_rrset(42);
7943    /// ```
7944    pub fn set_resource_records_per_rrset<T>(mut self, v: T) -> Self
7945    where
7946        T: std::convert::Into<i32>,
7947    {
7948        self.resource_records_per_rrset = std::option::Option::Some(v.into());
7949        self
7950    }
7951
7952    /// Sets or clears the value of [resource_records_per_rrset][crate::model::Quota::resource_records_per_rrset].
7953    ///
7954    /// # Example
7955    /// ```ignore,no_run
7956    /// # use google_cloud_dns_v1::model::Quota;
7957    /// let x = Quota::new().set_or_clear_resource_records_per_rrset(Some(42));
7958    /// let x = Quota::new().set_or_clear_resource_records_per_rrset(None::<i32>);
7959    /// ```
7960    pub fn set_or_clear_resource_records_per_rrset<T>(mut self, v: std::option::Option<T>) -> Self
7961    where
7962        T: std::convert::Into<i32>,
7963    {
7964        self.resource_records_per_rrset = v.map(|x| x.into());
7965        self
7966    }
7967
7968    /// Sets the value of [response_policies][crate::model::Quota::response_policies].
7969    ///
7970    /// # Example
7971    /// ```ignore,no_run
7972    /// # use google_cloud_dns_v1::model::Quota;
7973    /// let x = Quota::new().set_response_policies(42);
7974    /// ```
7975    pub fn set_response_policies<T>(mut self, v: T) -> Self
7976    where
7977        T: std::convert::Into<i32>,
7978    {
7979        self.response_policies = std::option::Option::Some(v.into());
7980        self
7981    }
7982
7983    /// Sets or clears the value of [response_policies][crate::model::Quota::response_policies].
7984    ///
7985    /// # Example
7986    /// ```ignore,no_run
7987    /// # use google_cloud_dns_v1::model::Quota;
7988    /// let x = Quota::new().set_or_clear_response_policies(Some(42));
7989    /// let x = Quota::new().set_or_clear_response_policies(None::<i32>);
7990    /// ```
7991    pub fn set_or_clear_response_policies<T>(mut self, v: std::option::Option<T>) -> Self
7992    where
7993        T: std::convert::Into<i32>,
7994    {
7995        self.response_policies = v.map(|x| x.into());
7996        self
7997    }
7998
7999    /// Sets the value of [response_policy_rules_per_response_policy][crate::model::Quota::response_policy_rules_per_response_policy].
8000    ///
8001    /// # Example
8002    /// ```ignore,no_run
8003    /// # use google_cloud_dns_v1::model::Quota;
8004    /// let x = Quota::new().set_response_policy_rules_per_response_policy(42);
8005    /// ```
8006    pub fn set_response_policy_rules_per_response_policy<T>(mut self, v: T) -> Self
8007    where
8008        T: std::convert::Into<i32>,
8009    {
8010        self.response_policy_rules_per_response_policy = std::option::Option::Some(v.into());
8011        self
8012    }
8013
8014    /// Sets or clears the value of [response_policy_rules_per_response_policy][crate::model::Quota::response_policy_rules_per_response_policy].
8015    ///
8016    /// # Example
8017    /// ```ignore,no_run
8018    /// # use google_cloud_dns_v1::model::Quota;
8019    /// let x = Quota::new().set_or_clear_response_policy_rules_per_response_policy(Some(42));
8020    /// let x = Quota::new().set_or_clear_response_policy_rules_per_response_policy(None::<i32>);
8021    /// ```
8022    pub fn set_or_clear_response_policy_rules_per_response_policy<T>(
8023        mut self,
8024        v: std::option::Option<T>,
8025    ) -> Self
8026    where
8027        T: std::convert::Into<i32>,
8028    {
8029        self.response_policy_rules_per_response_policy = v.map(|x| x.into());
8030        self
8031    }
8032
8033    /// Sets the value of [rrset_additions_per_change][crate::model::Quota::rrset_additions_per_change].
8034    ///
8035    /// # Example
8036    /// ```ignore,no_run
8037    /// # use google_cloud_dns_v1::model::Quota;
8038    /// let x = Quota::new().set_rrset_additions_per_change(42);
8039    /// ```
8040    pub fn set_rrset_additions_per_change<T>(mut self, v: T) -> Self
8041    where
8042        T: std::convert::Into<i32>,
8043    {
8044        self.rrset_additions_per_change = std::option::Option::Some(v.into());
8045        self
8046    }
8047
8048    /// Sets or clears the value of [rrset_additions_per_change][crate::model::Quota::rrset_additions_per_change].
8049    ///
8050    /// # Example
8051    /// ```ignore,no_run
8052    /// # use google_cloud_dns_v1::model::Quota;
8053    /// let x = Quota::new().set_or_clear_rrset_additions_per_change(Some(42));
8054    /// let x = Quota::new().set_or_clear_rrset_additions_per_change(None::<i32>);
8055    /// ```
8056    pub fn set_or_clear_rrset_additions_per_change<T>(mut self, v: std::option::Option<T>) -> Self
8057    where
8058        T: std::convert::Into<i32>,
8059    {
8060        self.rrset_additions_per_change = v.map(|x| x.into());
8061        self
8062    }
8063
8064    /// Sets the value of [rrset_deletions_per_change][crate::model::Quota::rrset_deletions_per_change].
8065    ///
8066    /// # Example
8067    /// ```ignore,no_run
8068    /// # use google_cloud_dns_v1::model::Quota;
8069    /// let x = Quota::new().set_rrset_deletions_per_change(42);
8070    /// ```
8071    pub fn set_rrset_deletions_per_change<T>(mut self, v: T) -> Self
8072    where
8073        T: std::convert::Into<i32>,
8074    {
8075        self.rrset_deletions_per_change = std::option::Option::Some(v.into());
8076        self
8077    }
8078
8079    /// Sets or clears the value of [rrset_deletions_per_change][crate::model::Quota::rrset_deletions_per_change].
8080    ///
8081    /// # Example
8082    /// ```ignore,no_run
8083    /// # use google_cloud_dns_v1::model::Quota;
8084    /// let x = Quota::new().set_or_clear_rrset_deletions_per_change(Some(42));
8085    /// let x = Quota::new().set_or_clear_rrset_deletions_per_change(None::<i32>);
8086    /// ```
8087    pub fn set_or_clear_rrset_deletions_per_change<T>(mut self, v: std::option::Option<T>) -> Self
8088    where
8089        T: std::convert::Into<i32>,
8090    {
8091        self.rrset_deletions_per_change = v.map(|x| x.into());
8092        self
8093    }
8094
8095    /// Sets the value of [rrsets_per_managed_zone][crate::model::Quota::rrsets_per_managed_zone].
8096    ///
8097    /// # Example
8098    /// ```ignore,no_run
8099    /// # use google_cloud_dns_v1::model::Quota;
8100    /// let x = Quota::new().set_rrsets_per_managed_zone(42);
8101    /// ```
8102    pub fn set_rrsets_per_managed_zone<T>(mut self, v: T) -> Self
8103    where
8104        T: std::convert::Into<i32>,
8105    {
8106        self.rrsets_per_managed_zone = std::option::Option::Some(v.into());
8107        self
8108    }
8109
8110    /// Sets or clears the value of [rrsets_per_managed_zone][crate::model::Quota::rrsets_per_managed_zone].
8111    ///
8112    /// # Example
8113    /// ```ignore,no_run
8114    /// # use google_cloud_dns_v1::model::Quota;
8115    /// let x = Quota::new().set_or_clear_rrsets_per_managed_zone(Some(42));
8116    /// let x = Quota::new().set_or_clear_rrsets_per_managed_zone(None::<i32>);
8117    /// ```
8118    pub fn set_or_clear_rrsets_per_managed_zone<T>(mut self, v: std::option::Option<T>) -> Self
8119    where
8120        T: std::convert::Into<i32>,
8121    {
8122        self.rrsets_per_managed_zone = v.map(|x| x.into());
8123        self
8124    }
8125
8126    /// Sets the value of [target_name_servers_per_managed_zone][crate::model::Quota::target_name_servers_per_managed_zone].
8127    ///
8128    /// # Example
8129    /// ```ignore,no_run
8130    /// # use google_cloud_dns_v1::model::Quota;
8131    /// let x = Quota::new().set_target_name_servers_per_managed_zone(42);
8132    /// ```
8133    pub fn set_target_name_servers_per_managed_zone<T>(mut self, v: T) -> Self
8134    where
8135        T: std::convert::Into<i32>,
8136    {
8137        self.target_name_servers_per_managed_zone = std::option::Option::Some(v.into());
8138        self
8139    }
8140
8141    /// Sets or clears the value of [target_name_servers_per_managed_zone][crate::model::Quota::target_name_servers_per_managed_zone].
8142    ///
8143    /// # Example
8144    /// ```ignore,no_run
8145    /// # use google_cloud_dns_v1::model::Quota;
8146    /// let x = Quota::new().set_or_clear_target_name_servers_per_managed_zone(Some(42));
8147    /// let x = Quota::new().set_or_clear_target_name_servers_per_managed_zone(None::<i32>);
8148    /// ```
8149    pub fn set_or_clear_target_name_servers_per_managed_zone<T>(
8150        mut self,
8151        v: std::option::Option<T>,
8152    ) -> Self
8153    where
8154        T: std::convert::Into<i32>,
8155    {
8156        self.target_name_servers_per_managed_zone = v.map(|x| x.into());
8157        self
8158    }
8159
8160    /// Sets the value of [target_name_servers_per_policy][crate::model::Quota::target_name_servers_per_policy].
8161    ///
8162    /// # Example
8163    /// ```ignore,no_run
8164    /// # use google_cloud_dns_v1::model::Quota;
8165    /// let x = Quota::new().set_target_name_servers_per_policy(42);
8166    /// ```
8167    pub fn set_target_name_servers_per_policy<T>(mut self, v: T) -> Self
8168    where
8169        T: std::convert::Into<i32>,
8170    {
8171        self.target_name_servers_per_policy = std::option::Option::Some(v.into());
8172        self
8173    }
8174
8175    /// Sets or clears the value of [target_name_servers_per_policy][crate::model::Quota::target_name_servers_per_policy].
8176    ///
8177    /// # Example
8178    /// ```ignore,no_run
8179    /// # use google_cloud_dns_v1::model::Quota;
8180    /// let x = Quota::new().set_or_clear_target_name_servers_per_policy(Some(42));
8181    /// let x = Quota::new().set_or_clear_target_name_servers_per_policy(None::<i32>);
8182    /// ```
8183    pub fn set_or_clear_target_name_servers_per_policy<T>(
8184        mut self,
8185        v: std::option::Option<T>,
8186    ) -> Self
8187    where
8188        T: std::convert::Into<i32>,
8189    {
8190        self.target_name_servers_per_policy = v.map(|x| x.into());
8191        self
8192    }
8193
8194    /// Sets the value of [total_rrdata_size_per_change][crate::model::Quota::total_rrdata_size_per_change].
8195    ///
8196    /// # Example
8197    /// ```ignore,no_run
8198    /// # use google_cloud_dns_v1::model::Quota;
8199    /// let x = Quota::new().set_total_rrdata_size_per_change(42);
8200    /// ```
8201    pub fn set_total_rrdata_size_per_change<T>(mut self, v: T) -> Self
8202    where
8203        T: std::convert::Into<i32>,
8204    {
8205        self.total_rrdata_size_per_change = std::option::Option::Some(v.into());
8206        self
8207    }
8208
8209    /// Sets or clears the value of [total_rrdata_size_per_change][crate::model::Quota::total_rrdata_size_per_change].
8210    ///
8211    /// # Example
8212    /// ```ignore,no_run
8213    /// # use google_cloud_dns_v1::model::Quota;
8214    /// let x = Quota::new().set_or_clear_total_rrdata_size_per_change(Some(42));
8215    /// let x = Quota::new().set_or_clear_total_rrdata_size_per_change(None::<i32>);
8216    /// ```
8217    pub fn set_or_clear_total_rrdata_size_per_change<T>(mut self, v: std::option::Option<T>) -> Self
8218    where
8219        T: std::convert::Into<i32>,
8220    {
8221        self.total_rrdata_size_per_change = v.map(|x| x.into());
8222        self
8223    }
8224
8225    /// Sets the value of [whitelisted_key_specs][crate::model::Quota::whitelisted_key_specs].
8226    ///
8227    /// # Example
8228    /// ```ignore,no_run
8229    /// # use google_cloud_dns_v1::model::Quota;
8230    /// use google_cloud_dns_v1::model::DnsKeySpec;
8231    /// let x = Quota::new()
8232    ///     .set_whitelisted_key_specs([
8233    ///         DnsKeySpec::default()/* use setters */,
8234    ///         DnsKeySpec::default()/* use (different) setters */,
8235    ///     ]);
8236    /// ```
8237    pub fn set_whitelisted_key_specs<T, V>(mut self, v: T) -> Self
8238    where
8239        T: std::iter::IntoIterator<Item = V>,
8240        V: std::convert::Into<crate::model::DnsKeySpec>,
8241    {
8242        use std::iter::Iterator;
8243        self.whitelisted_key_specs = v.into_iter().map(|i| i.into()).collect();
8244        self
8245    }
8246}
8247
8248impl wkt::message::Message for Quota {
8249    fn typename() -> &'static str {
8250        "type.googleapis.com/.Quota"
8251    }
8252}
8253
8254/// A RRSetRoutingPolicy represents ResourceRecordSet data that is returned dynamically with the response varying based on configured properties such as geolocation or by weighted random selection.
8255#[derive(Clone, Default, PartialEq)]
8256#[non_exhaustive]
8257pub struct RRSetRoutingPolicy {
8258    #[allow(missing_docs)]
8259    pub geo: std::option::Option<crate::model::RRSetRoutingPolicyGeoPolicy>,
8260
8261    /// The fully qualified URL of the HealthCheck to use for this RRSetRoutingPolicy. Format this URL like `<https://www.googleapis.com/compute/v1/projects/{project}/global/healthChecks/{healthCheck}>`. <https://cloud.google.com/compute/docs/reference/rest/v1/healthChecks>
8262    pub health_check: std::option::Option<std::string::String>,
8263
8264    #[allow(missing_docs)]
8265    pub kind: std::option::Option<std::string::String>,
8266
8267    #[allow(missing_docs)]
8268    pub primary_backup: std::option::Option<crate::model::RRSetRoutingPolicyPrimaryBackupPolicy>,
8269
8270    #[allow(missing_docs)]
8271    pub wrr: std::option::Option<crate::model::RRSetRoutingPolicyWrrPolicy>,
8272
8273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8274}
8275
8276impl RRSetRoutingPolicy {
8277    /// Creates a new default instance.
8278    pub fn new() -> Self {
8279        std::default::Default::default()
8280    }
8281
8282    /// Sets the value of [geo][crate::model::RRSetRoutingPolicy::geo].
8283    ///
8284    /// # Example
8285    /// ```ignore,no_run
8286    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
8287    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
8288    /// let x = RRSetRoutingPolicy::new().set_geo(RRSetRoutingPolicyGeoPolicy::default()/* use setters */);
8289    /// ```
8290    pub fn set_geo<T>(mut self, v: T) -> Self
8291    where
8292        T: std::convert::Into<crate::model::RRSetRoutingPolicyGeoPolicy>,
8293    {
8294        self.geo = std::option::Option::Some(v.into());
8295        self
8296    }
8297
8298    /// Sets or clears the value of [geo][crate::model::RRSetRoutingPolicy::geo].
8299    ///
8300    /// # Example
8301    /// ```ignore,no_run
8302    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
8303    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
8304    /// let x = RRSetRoutingPolicy::new().set_or_clear_geo(Some(RRSetRoutingPolicyGeoPolicy::default()/* use setters */));
8305    /// let x = RRSetRoutingPolicy::new().set_or_clear_geo(None::<RRSetRoutingPolicyGeoPolicy>);
8306    /// ```
8307    pub fn set_or_clear_geo<T>(mut self, v: std::option::Option<T>) -> Self
8308    where
8309        T: std::convert::Into<crate::model::RRSetRoutingPolicyGeoPolicy>,
8310    {
8311        self.geo = v.map(|x| x.into());
8312        self
8313    }
8314
8315    /// Sets the value of [health_check][crate::model::RRSetRoutingPolicy::health_check].
8316    ///
8317    /// # Example
8318    /// ```ignore,no_run
8319    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
8320    /// let x = RRSetRoutingPolicy::new().set_health_check("example");
8321    /// ```
8322    pub fn set_health_check<T>(mut self, v: T) -> Self
8323    where
8324        T: std::convert::Into<std::string::String>,
8325    {
8326        self.health_check = std::option::Option::Some(v.into());
8327        self
8328    }
8329
8330    /// Sets or clears the value of [health_check][crate::model::RRSetRoutingPolicy::health_check].
8331    ///
8332    /// # Example
8333    /// ```ignore,no_run
8334    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
8335    /// let x = RRSetRoutingPolicy::new().set_or_clear_health_check(Some("example"));
8336    /// let x = RRSetRoutingPolicy::new().set_or_clear_health_check(None::<String>);
8337    /// ```
8338    pub fn set_or_clear_health_check<T>(mut self, v: std::option::Option<T>) -> Self
8339    where
8340        T: std::convert::Into<std::string::String>,
8341    {
8342        self.health_check = v.map(|x| x.into());
8343        self
8344    }
8345
8346    /// Sets the value of [kind][crate::model::RRSetRoutingPolicy::kind].
8347    ///
8348    /// # Example
8349    /// ```ignore,no_run
8350    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
8351    /// let x = RRSetRoutingPolicy::new().set_kind("example");
8352    /// ```
8353    pub fn set_kind<T>(mut self, v: T) -> Self
8354    where
8355        T: std::convert::Into<std::string::String>,
8356    {
8357        self.kind = std::option::Option::Some(v.into());
8358        self
8359    }
8360
8361    /// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicy::kind].
8362    ///
8363    /// # Example
8364    /// ```ignore,no_run
8365    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
8366    /// let x = RRSetRoutingPolicy::new().set_or_clear_kind(Some("example"));
8367    /// let x = RRSetRoutingPolicy::new().set_or_clear_kind(None::<String>);
8368    /// ```
8369    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
8370    where
8371        T: std::convert::Into<std::string::String>,
8372    {
8373        self.kind = v.map(|x| x.into());
8374        self
8375    }
8376
8377    /// Sets the value of [primary_backup][crate::model::RRSetRoutingPolicy::primary_backup].
8378    ///
8379    /// # Example
8380    /// ```ignore,no_run
8381    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
8382    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
8383    /// let x = RRSetRoutingPolicy::new().set_primary_backup(RRSetRoutingPolicyPrimaryBackupPolicy::default()/* use setters */);
8384    /// ```
8385    pub fn set_primary_backup<T>(mut self, v: T) -> Self
8386    where
8387        T: std::convert::Into<crate::model::RRSetRoutingPolicyPrimaryBackupPolicy>,
8388    {
8389        self.primary_backup = std::option::Option::Some(v.into());
8390        self
8391    }
8392
8393    /// Sets or clears the value of [primary_backup][crate::model::RRSetRoutingPolicy::primary_backup].
8394    ///
8395    /// # Example
8396    /// ```ignore,no_run
8397    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
8398    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
8399    /// let x = RRSetRoutingPolicy::new().set_or_clear_primary_backup(Some(RRSetRoutingPolicyPrimaryBackupPolicy::default()/* use setters */));
8400    /// let x = RRSetRoutingPolicy::new().set_or_clear_primary_backup(None::<RRSetRoutingPolicyPrimaryBackupPolicy>);
8401    /// ```
8402    pub fn set_or_clear_primary_backup<T>(mut self, v: std::option::Option<T>) -> Self
8403    where
8404        T: std::convert::Into<crate::model::RRSetRoutingPolicyPrimaryBackupPolicy>,
8405    {
8406        self.primary_backup = v.map(|x| x.into());
8407        self
8408    }
8409
8410    /// Sets the value of [wrr][crate::model::RRSetRoutingPolicy::wrr].
8411    ///
8412    /// # Example
8413    /// ```ignore,no_run
8414    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
8415    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicy;
8416    /// let x = RRSetRoutingPolicy::new().set_wrr(RRSetRoutingPolicyWrrPolicy::default()/* use setters */);
8417    /// ```
8418    pub fn set_wrr<T>(mut self, v: T) -> Self
8419    where
8420        T: std::convert::Into<crate::model::RRSetRoutingPolicyWrrPolicy>,
8421    {
8422        self.wrr = std::option::Option::Some(v.into());
8423        self
8424    }
8425
8426    /// Sets or clears the value of [wrr][crate::model::RRSetRoutingPolicy::wrr].
8427    ///
8428    /// # Example
8429    /// ```ignore,no_run
8430    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
8431    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicy;
8432    /// let x = RRSetRoutingPolicy::new().set_or_clear_wrr(Some(RRSetRoutingPolicyWrrPolicy::default()/* use setters */));
8433    /// let x = RRSetRoutingPolicy::new().set_or_clear_wrr(None::<RRSetRoutingPolicyWrrPolicy>);
8434    /// ```
8435    pub fn set_or_clear_wrr<T>(mut self, v: std::option::Option<T>) -> Self
8436    where
8437        T: std::convert::Into<crate::model::RRSetRoutingPolicyWrrPolicy>,
8438    {
8439        self.wrr = v.map(|x| x.into());
8440        self
8441    }
8442}
8443
8444impl wkt::message::Message for RRSetRoutingPolicy {
8445    fn typename() -> &'static str {
8446        "type.googleapis.com/.RRSetRoutingPolicy"
8447    }
8448}
8449
8450/// Configures a `RRSetRoutingPolicy` that routes based on the geo location of the querying user.
8451#[derive(Clone, Default, PartialEq)]
8452#[non_exhaustive]
8453pub struct RRSetRoutingPolicyGeoPolicy {
8454    /// Without fencing, if health check fails for all configured items in the current geo bucket, we failover to the next nearest geo bucket. With fencing, if health checking is enabled, as long as some targets in the current geo bucket are healthy, we return only the healthy targets. However, if all targets are unhealthy, we don't failover to the next nearest bucket; instead, we return all the items in the current bucket even when all targets are unhealthy.
8455    pub enable_fencing: std::option::Option<bool>,
8456
8457    /// The primary geo routing configuration. If there are multiple items with the same location, an error is returned instead.
8458    pub items: std::vec::Vec<crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem>,
8459
8460    #[allow(missing_docs)]
8461    pub kind: std::option::Option<std::string::String>,
8462
8463    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8464}
8465
8466impl RRSetRoutingPolicyGeoPolicy {
8467    /// Creates a new default instance.
8468    pub fn new() -> Self {
8469        std::default::Default::default()
8470    }
8471
8472    /// Sets the value of [enable_fencing][crate::model::RRSetRoutingPolicyGeoPolicy::enable_fencing].
8473    ///
8474    /// # Example
8475    /// ```ignore,no_run
8476    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
8477    /// let x = RRSetRoutingPolicyGeoPolicy::new().set_enable_fencing(true);
8478    /// ```
8479    pub fn set_enable_fencing<T>(mut self, v: T) -> Self
8480    where
8481        T: std::convert::Into<bool>,
8482    {
8483        self.enable_fencing = std::option::Option::Some(v.into());
8484        self
8485    }
8486
8487    /// Sets or clears the value of [enable_fencing][crate::model::RRSetRoutingPolicyGeoPolicy::enable_fencing].
8488    ///
8489    /// # Example
8490    /// ```ignore,no_run
8491    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
8492    /// let x = RRSetRoutingPolicyGeoPolicy::new().set_or_clear_enable_fencing(Some(false));
8493    /// let x = RRSetRoutingPolicyGeoPolicy::new().set_or_clear_enable_fencing(None::<bool>);
8494    /// ```
8495    pub fn set_or_clear_enable_fencing<T>(mut self, v: std::option::Option<T>) -> Self
8496    where
8497        T: std::convert::Into<bool>,
8498    {
8499        self.enable_fencing = v.map(|x| x.into());
8500        self
8501    }
8502
8503    /// Sets the value of [items][crate::model::RRSetRoutingPolicyGeoPolicy::items].
8504    ///
8505    /// # Example
8506    /// ```ignore,no_run
8507    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
8508    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
8509    /// let x = RRSetRoutingPolicyGeoPolicy::new()
8510    ///     .set_items([
8511    ///         RRSetRoutingPolicyGeoPolicyGeoPolicyItem::default()/* use setters */,
8512    ///         RRSetRoutingPolicyGeoPolicyGeoPolicyItem::default()/* use (different) setters */,
8513    ///     ]);
8514    /// ```
8515    pub fn set_items<T, V>(mut self, v: T) -> Self
8516    where
8517        T: std::iter::IntoIterator<Item = V>,
8518        V: std::convert::Into<crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem>,
8519    {
8520        use std::iter::Iterator;
8521        self.items = v.into_iter().map(|i| i.into()).collect();
8522        self
8523    }
8524
8525    /// Sets the value of [kind][crate::model::RRSetRoutingPolicyGeoPolicy::kind].
8526    ///
8527    /// # Example
8528    /// ```ignore,no_run
8529    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
8530    /// let x = RRSetRoutingPolicyGeoPolicy::new().set_kind("example");
8531    /// ```
8532    pub fn set_kind<T>(mut self, v: T) -> Self
8533    where
8534        T: std::convert::Into<std::string::String>,
8535    {
8536        self.kind = std::option::Option::Some(v.into());
8537        self
8538    }
8539
8540    /// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyGeoPolicy::kind].
8541    ///
8542    /// # Example
8543    /// ```ignore,no_run
8544    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
8545    /// let x = RRSetRoutingPolicyGeoPolicy::new().set_or_clear_kind(Some("example"));
8546    /// let x = RRSetRoutingPolicyGeoPolicy::new().set_or_clear_kind(None::<String>);
8547    /// ```
8548    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
8549    where
8550        T: std::convert::Into<std::string::String>,
8551    {
8552        self.kind = v.map(|x| x.into());
8553        self
8554    }
8555}
8556
8557impl wkt::message::Message for RRSetRoutingPolicyGeoPolicy {
8558    fn typename() -> &'static str {
8559        "type.googleapis.com/.RRSetRoutingPolicyGeoPolicy"
8560    }
8561}
8562
8563/// ResourceRecordSet data for one geo location.
8564#[derive(Clone, Default, PartialEq)]
8565#[non_exhaustive]
8566pub struct RRSetRoutingPolicyGeoPolicyGeoPolicyItem {
8567    /// For A and AAAA types only. Endpoints to return in the query result only if they are healthy. These can be specified along with `rrdata` within this item.
8568    pub health_checked_targets:
8569        std::option::Option<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
8570
8571    #[allow(missing_docs)]
8572    pub kind: std::option::Option<std::string::String>,
8573
8574    /// The geo-location granularity is a GCP region. This location string should correspond to a GCP region. e.g. "us-east1", "southamerica-east1", "asia-east1", etc.
8575    pub location: std::option::Option<std::string::String>,
8576
8577    #[allow(missing_docs)]
8578    pub rrdatas: std::vec::Vec<std::string::String>,
8579
8580    /// DNSSEC generated signatures for all the `rrdata` within this item. When using health-checked targets for DNSSEC-enabled zones, you can only use at most one health-checked IP address per item.
8581    pub signature_rrdatas: std::vec::Vec<std::string::String>,
8582
8583    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8584}
8585
8586impl RRSetRoutingPolicyGeoPolicyGeoPolicyItem {
8587    /// Creates a new default instance.
8588    pub fn new() -> Self {
8589        std::default::Default::default()
8590    }
8591
8592    /// Sets the value of [health_checked_targets][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::health_checked_targets].
8593    ///
8594    /// # Example
8595    /// ```ignore,no_run
8596    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
8597    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
8598    /// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_health_checked_targets(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */);
8599    /// ```
8600    pub fn set_health_checked_targets<T>(mut self, v: T) -> Self
8601    where
8602        T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
8603    {
8604        self.health_checked_targets = std::option::Option::Some(v.into());
8605        self
8606    }
8607
8608    /// Sets or clears the value of [health_checked_targets][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::health_checked_targets].
8609    ///
8610    /// # Example
8611    /// ```ignore,no_run
8612    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
8613    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
8614    /// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_health_checked_targets(Some(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */));
8615    /// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_health_checked_targets(None::<RRSetRoutingPolicyHealthCheckTargets>);
8616    /// ```
8617    pub fn set_or_clear_health_checked_targets<T>(mut self, v: std::option::Option<T>) -> Self
8618    where
8619        T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
8620    {
8621        self.health_checked_targets = v.map(|x| x.into());
8622        self
8623    }
8624
8625    /// Sets the value of [kind][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::kind].
8626    ///
8627    /// # Example
8628    /// ```ignore,no_run
8629    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
8630    /// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_kind("example");
8631    /// ```
8632    pub fn set_kind<T>(mut self, v: T) -> Self
8633    where
8634        T: std::convert::Into<std::string::String>,
8635    {
8636        self.kind = std::option::Option::Some(v.into());
8637        self
8638    }
8639
8640    /// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::kind].
8641    ///
8642    /// # Example
8643    /// ```ignore,no_run
8644    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
8645    /// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_kind(Some("example"));
8646    /// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_kind(None::<String>);
8647    /// ```
8648    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
8649    where
8650        T: std::convert::Into<std::string::String>,
8651    {
8652        self.kind = v.map(|x| x.into());
8653        self
8654    }
8655
8656    /// Sets the value of [location][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::location].
8657    ///
8658    /// # Example
8659    /// ```ignore,no_run
8660    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
8661    /// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_location("example");
8662    /// ```
8663    pub fn set_location<T>(mut self, v: T) -> Self
8664    where
8665        T: std::convert::Into<std::string::String>,
8666    {
8667        self.location = std::option::Option::Some(v.into());
8668        self
8669    }
8670
8671    /// Sets or clears the value of [location][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::location].
8672    ///
8673    /// # Example
8674    /// ```ignore,no_run
8675    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
8676    /// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_location(Some("example"));
8677    /// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_location(None::<String>);
8678    /// ```
8679    pub fn set_or_clear_location<T>(mut self, v: std::option::Option<T>) -> Self
8680    where
8681        T: std::convert::Into<std::string::String>,
8682    {
8683        self.location = v.map(|x| x.into());
8684        self
8685    }
8686
8687    /// Sets the value of [rrdatas][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::rrdatas].
8688    ///
8689    /// # Example
8690    /// ```ignore,no_run
8691    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
8692    /// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_rrdatas(["a", "b", "c"]);
8693    /// ```
8694    pub fn set_rrdatas<T, V>(mut self, v: T) -> Self
8695    where
8696        T: std::iter::IntoIterator<Item = V>,
8697        V: std::convert::Into<std::string::String>,
8698    {
8699        use std::iter::Iterator;
8700        self.rrdatas = v.into_iter().map(|i| i.into()).collect();
8701        self
8702    }
8703
8704    /// Sets the value of [signature_rrdatas][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::signature_rrdatas].
8705    ///
8706    /// # Example
8707    /// ```ignore,no_run
8708    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
8709    /// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_signature_rrdatas(["a", "b", "c"]);
8710    /// ```
8711    pub fn set_signature_rrdatas<T, V>(mut self, v: T) -> Self
8712    where
8713        T: std::iter::IntoIterator<Item = V>,
8714        V: std::convert::Into<std::string::String>,
8715    {
8716        use std::iter::Iterator;
8717        self.signature_rrdatas = v.into_iter().map(|i| i.into()).collect();
8718        self
8719    }
8720}
8721
8722impl wkt::message::Message for RRSetRoutingPolicyGeoPolicyGeoPolicyItem {
8723    fn typename() -> &'static str {
8724        "type.googleapis.com/.RRSetRoutingPolicyGeoPolicyGeoPolicyItem"
8725    }
8726}
8727
8728/// HealthCheckTargets describes endpoints to health-check when responding to Routing Policy queries. Only the healthy endpoints will be included in the response. Set either `internal_load_balancer` or `external_endpoints`. Do not set both.
8729#[derive(Clone, Default, PartialEq)]
8730#[non_exhaustive]
8731pub struct RRSetRoutingPolicyHealthCheckTargets {
8732    /// The Internet IP addresses to be health checked. The format matches the format of ResourceRecordSet.rrdata as defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1)
8733    pub external_endpoints: std::vec::Vec<std::string::String>,
8734
8735    /// Configuration for internal load balancers to be health checked.
8736    pub internal_load_balancers: std::vec::Vec<crate::model::RRSetRoutingPolicyLoadBalancerTarget>,
8737
8738    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8739}
8740
8741impl RRSetRoutingPolicyHealthCheckTargets {
8742    /// Creates a new default instance.
8743    pub fn new() -> Self {
8744        std::default::Default::default()
8745    }
8746
8747    /// Sets the value of [external_endpoints][crate::model::RRSetRoutingPolicyHealthCheckTargets::external_endpoints].
8748    ///
8749    /// # Example
8750    /// ```ignore,no_run
8751    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
8752    /// let x = RRSetRoutingPolicyHealthCheckTargets::new().set_external_endpoints(["a", "b", "c"]);
8753    /// ```
8754    pub fn set_external_endpoints<T, V>(mut self, v: T) -> Self
8755    where
8756        T: std::iter::IntoIterator<Item = V>,
8757        V: std::convert::Into<std::string::String>,
8758    {
8759        use std::iter::Iterator;
8760        self.external_endpoints = v.into_iter().map(|i| i.into()).collect();
8761        self
8762    }
8763
8764    /// Sets the value of [internal_load_balancers][crate::model::RRSetRoutingPolicyHealthCheckTargets::internal_load_balancers].
8765    ///
8766    /// # Example
8767    /// ```ignore,no_run
8768    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
8769    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
8770    /// let x = RRSetRoutingPolicyHealthCheckTargets::new()
8771    ///     .set_internal_load_balancers([
8772    ///         RRSetRoutingPolicyLoadBalancerTarget::default()/* use setters */,
8773    ///         RRSetRoutingPolicyLoadBalancerTarget::default()/* use (different) setters */,
8774    ///     ]);
8775    /// ```
8776    pub fn set_internal_load_balancers<T, V>(mut self, v: T) -> Self
8777    where
8778        T: std::iter::IntoIterator<Item = V>,
8779        V: std::convert::Into<crate::model::RRSetRoutingPolicyLoadBalancerTarget>,
8780    {
8781        use std::iter::Iterator;
8782        self.internal_load_balancers = v.into_iter().map(|i| i.into()).collect();
8783        self
8784    }
8785}
8786
8787impl wkt::message::Message for RRSetRoutingPolicyHealthCheckTargets {
8788    fn typename() -> &'static str {
8789        "type.googleapis.com/.RRSetRoutingPolicyHealthCheckTargets"
8790    }
8791}
8792
8793/// The configuration for an individual load balancer to health check.
8794#[derive(Clone, Default, PartialEq)]
8795#[non_exhaustive]
8796pub struct RRSetRoutingPolicyLoadBalancerTarget {
8797    /// The frontend IP address of the load balancer to health check.
8798    pub ip_address: std::option::Option<std::string::String>,
8799
8800    /// The protocol of the load balancer to health check.
8801    pub ip_protocol:
8802        std::option::Option<crate::model::rr_set_routing_policy_load_balancer_target::IpProtocol>,
8803
8804    #[allow(missing_docs)]
8805    pub kind: std::option::Option<std::string::String>,
8806
8807    /// The type of load balancer specified by this target. This value must match the configuration of the load balancer located at the LoadBalancerTarget's IP address, port, and region. Use the following: - *regionalL4ilb*: for a regional internal passthrough Network Load Balancer. - *regionalL7ilb*: for a regional internal Application Load Balancer. - *globalL7ilb*: for a global internal Application Load Balancer.
8808    pub load_balancer_type: std::option::Option<
8809        crate::model::rr_set_routing_policy_load_balancer_target::LoadBalancerType,
8810    >,
8811
8812    /// The fully qualified URL of the network that the load balancer is attached to. This should be formatted like `<https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}>`.
8813    pub network_url: std::option::Option<std::string::String>,
8814
8815    /// The configured port of the load balancer.
8816    pub port: std::option::Option<std::string::String>,
8817
8818    /// The project ID in which the load balancer is located.
8819    pub project: std::option::Option<std::string::String>,
8820
8821    /// The region in which the load balancer is located.
8822    pub region: std::option::Option<std::string::String>,
8823
8824    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8825}
8826
8827impl RRSetRoutingPolicyLoadBalancerTarget {
8828    /// Creates a new default instance.
8829    pub fn new() -> Self {
8830        std::default::Default::default()
8831    }
8832
8833    /// Sets the value of [ip_address][crate::model::RRSetRoutingPolicyLoadBalancerTarget::ip_address].
8834    ///
8835    /// # Example
8836    /// ```ignore,no_run
8837    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
8838    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_ip_address("example");
8839    /// ```
8840    pub fn set_ip_address<T>(mut self, v: T) -> Self
8841    where
8842        T: std::convert::Into<std::string::String>,
8843    {
8844        self.ip_address = std::option::Option::Some(v.into());
8845        self
8846    }
8847
8848    /// Sets or clears the value of [ip_address][crate::model::RRSetRoutingPolicyLoadBalancerTarget::ip_address].
8849    ///
8850    /// # Example
8851    /// ```ignore,no_run
8852    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
8853    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_ip_address(Some("example"));
8854    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_ip_address(None::<String>);
8855    /// ```
8856    pub fn set_or_clear_ip_address<T>(mut self, v: std::option::Option<T>) -> Self
8857    where
8858        T: std::convert::Into<std::string::String>,
8859    {
8860        self.ip_address = v.map(|x| x.into());
8861        self
8862    }
8863
8864    /// Sets the value of [ip_protocol][crate::model::RRSetRoutingPolicyLoadBalancerTarget::ip_protocol].
8865    ///
8866    /// # Example
8867    /// ```ignore,no_run
8868    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
8869    /// use google_cloud_dns_v1::model::rr_set_routing_policy_load_balancer_target::IpProtocol;
8870    /// let x0 = RRSetRoutingPolicyLoadBalancerTarget::new().set_ip_protocol(IpProtocol::Tcp);
8871    /// let x1 = RRSetRoutingPolicyLoadBalancerTarget::new().set_ip_protocol(IpProtocol::Udp);
8872    /// ```
8873    pub fn set_ip_protocol<T>(mut self, v: T) -> Self
8874    where
8875        T: std::convert::Into<crate::model::rr_set_routing_policy_load_balancer_target::IpProtocol>,
8876    {
8877        self.ip_protocol = std::option::Option::Some(v.into());
8878        self
8879    }
8880
8881    /// Sets or clears the value of [ip_protocol][crate::model::RRSetRoutingPolicyLoadBalancerTarget::ip_protocol].
8882    ///
8883    /// # Example
8884    /// ```ignore,no_run
8885    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
8886    /// use google_cloud_dns_v1::model::rr_set_routing_policy_load_balancer_target::IpProtocol;
8887    /// let x0 = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_ip_protocol(Some(IpProtocol::Tcp));
8888    /// let x1 = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_ip_protocol(Some(IpProtocol::Udp));
8889    /// let x_none = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_ip_protocol(None::<IpProtocol>);
8890    /// ```
8891    pub fn set_or_clear_ip_protocol<T>(mut self, v: std::option::Option<T>) -> Self
8892    where
8893        T: std::convert::Into<crate::model::rr_set_routing_policy_load_balancer_target::IpProtocol>,
8894    {
8895        self.ip_protocol = v.map(|x| x.into());
8896        self
8897    }
8898
8899    /// Sets the value of [kind][crate::model::RRSetRoutingPolicyLoadBalancerTarget::kind].
8900    ///
8901    /// # Example
8902    /// ```ignore,no_run
8903    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
8904    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_kind("example");
8905    /// ```
8906    pub fn set_kind<T>(mut self, v: T) -> Self
8907    where
8908        T: std::convert::Into<std::string::String>,
8909    {
8910        self.kind = std::option::Option::Some(v.into());
8911        self
8912    }
8913
8914    /// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyLoadBalancerTarget::kind].
8915    ///
8916    /// # Example
8917    /// ```ignore,no_run
8918    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
8919    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_kind(Some("example"));
8920    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_kind(None::<String>);
8921    /// ```
8922    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
8923    where
8924        T: std::convert::Into<std::string::String>,
8925    {
8926        self.kind = v.map(|x| x.into());
8927        self
8928    }
8929
8930    /// Sets the value of [load_balancer_type][crate::model::RRSetRoutingPolicyLoadBalancerTarget::load_balancer_type].
8931    ///
8932    /// # Example
8933    /// ```ignore,no_run
8934    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
8935    /// use google_cloud_dns_v1::model::rr_set_routing_policy_load_balancer_target::LoadBalancerType;
8936    /// let x0 = RRSetRoutingPolicyLoadBalancerTarget::new().set_load_balancer_type(LoadBalancerType::GlobalL7Ilb);
8937    /// let x1 = RRSetRoutingPolicyLoadBalancerTarget::new().set_load_balancer_type(LoadBalancerType::RegionalL4Ilb);
8938    /// let x2 = RRSetRoutingPolicyLoadBalancerTarget::new().set_load_balancer_type(LoadBalancerType::RegionalL7Ilb);
8939    /// ```
8940    pub fn set_load_balancer_type<T>(mut self, v: T) -> Self
8941    where
8942        T: std::convert::Into<
8943                crate::model::rr_set_routing_policy_load_balancer_target::LoadBalancerType,
8944            >,
8945    {
8946        self.load_balancer_type = std::option::Option::Some(v.into());
8947        self
8948    }
8949
8950    /// Sets or clears the value of [load_balancer_type][crate::model::RRSetRoutingPolicyLoadBalancerTarget::load_balancer_type].
8951    ///
8952    /// # Example
8953    /// ```ignore,no_run
8954    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
8955    /// use google_cloud_dns_v1::model::rr_set_routing_policy_load_balancer_target::LoadBalancerType;
8956    /// let x0 = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::GlobalL7Ilb));
8957    /// let x1 = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::RegionalL4Ilb));
8958    /// let x2 = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::RegionalL7Ilb));
8959    /// let x_none = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_load_balancer_type(None::<LoadBalancerType>);
8960    /// ```
8961    pub fn set_or_clear_load_balancer_type<T>(mut self, v: std::option::Option<T>) -> Self
8962    where
8963        T: std::convert::Into<
8964                crate::model::rr_set_routing_policy_load_balancer_target::LoadBalancerType,
8965            >,
8966    {
8967        self.load_balancer_type = v.map(|x| x.into());
8968        self
8969    }
8970
8971    /// Sets the value of [network_url][crate::model::RRSetRoutingPolicyLoadBalancerTarget::network_url].
8972    ///
8973    /// # Example
8974    /// ```ignore,no_run
8975    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
8976    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_network_url("example");
8977    /// ```
8978    pub fn set_network_url<T>(mut self, v: T) -> Self
8979    where
8980        T: std::convert::Into<std::string::String>,
8981    {
8982        self.network_url = std::option::Option::Some(v.into());
8983        self
8984    }
8985
8986    /// Sets or clears the value of [network_url][crate::model::RRSetRoutingPolicyLoadBalancerTarget::network_url].
8987    ///
8988    /// # Example
8989    /// ```ignore,no_run
8990    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
8991    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_network_url(Some("example"));
8992    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_network_url(None::<String>);
8993    /// ```
8994    pub fn set_or_clear_network_url<T>(mut self, v: std::option::Option<T>) -> Self
8995    where
8996        T: std::convert::Into<std::string::String>,
8997    {
8998        self.network_url = v.map(|x| x.into());
8999        self
9000    }
9001
9002    /// Sets the value of [port][crate::model::RRSetRoutingPolicyLoadBalancerTarget::port].
9003    ///
9004    /// # Example
9005    /// ```ignore,no_run
9006    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
9007    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_port("example");
9008    /// ```
9009    pub fn set_port<T>(mut self, v: T) -> Self
9010    where
9011        T: std::convert::Into<std::string::String>,
9012    {
9013        self.port = std::option::Option::Some(v.into());
9014        self
9015    }
9016
9017    /// Sets or clears the value of [port][crate::model::RRSetRoutingPolicyLoadBalancerTarget::port].
9018    ///
9019    /// # Example
9020    /// ```ignore,no_run
9021    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
9022    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_port(Some("example"));
9023    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_port(None::<String>);
9024    /// ```
9025    pub fn set_or_clear_port<T>(mut self, v: std::option::Option<T>) -> Self
9026    where
9027        T: std::convert::Into<std::string::String>,
9028    {
9029        self.port = v.map(|x| x.into());
9030        self
9031    }
9032
9033    /// Sets the value of [project][crate::model::RRSetRoutingPolicyLoadBalancerTarget::project].
9034    ///
9035    /// # Example
9036    /// ```ignore,no_run
9037    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
9038    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_project("example");
9039    /// ```
9040    pub fn set_project<T>(mut self, v: T) -> Self
9041    where
9042        T: std::convert::Into<std::string::String>,
9043    {
9044        self.project = std::option::Option::Some(v.into());
9045        self
9046    }
9047
9048    /// Sets or clears the value of [project][crate::model::RRSetRoutingPolicyLoadBalancerTarget::project].
9049    ///
9050    /// # Example
9051    /// ```ignore,no_run
9052    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
9053    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_project(Some("example"));
9054    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_project(None::<String>);
9055    /// ```
9056    pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
9057    where
9058        T: std::convert::Into<std::string::String>,
9059    {
9060        self.project = v.map(|x| x.into());
9061        self
9062    }
9063
9064    /// Sets the value of [region][crate::model::RRSetRoutingPolicyLoadBalancerTarget::region].
9065    ///
9066    /// # Example
9067    /// ```ignore,no_run
9068    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
9069    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_region("example");
9070    /// ```
9071    pub fn set_region<T>(mut self, v: T) -> Self
9072    where
9073        T: std::convert::Into<std::string::String>,
9074    {
9075        self.region = std::option::Option::Some(v.into());
9076        self
9077    }
9078
9079    /// Sets or clears the value of [region][crate::model::RRSetRoutingPolicyLoadBalancerTarget::region].
9080    ///
9081    /// # Example
9082    /// ```ignore,no_run
9083    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
9084    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_region(Some("example"));
9085    /// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_region(None::<String>);
9086    /// ```
9087    pub fn set_or_clear_region<T>(mut self, v: std::option::Option<T>) -> Self
9088    where
9089        T: std::convert::Into<std::string::String>,
9090    {
9091        self.region = v.map(|x| x.into());
9092        self
9093    }
9094}
9095
9096impl wkt::message::Message for RRSetRoutingPolicyLoadBalancerTarget {
9097    fn typename() -> &'static str {
9098        "type.googleapis.com/.RRSetRoutingPolicyLoadBalancerTarget"
9099    }
9100}
9101
9102/// Defines additional types related to [RRSetRoutingPolicyLoadBalancerTarget].
9103pub mod rr_set_routing_policy_load_balancer_target {
9104    #[allow(unused_imports)]
9105    use super::*;
9106
9107    /// The enumerated type for the [ipProtocol][.RRSetRoutingPolicyLoadBalancerTarget.ipProtocol] field.
9108    ///
9109    /// # Working with unknown values
9110    ///
9111    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9112    /// additional enum variants at any time. Adding new variants is not considered
9113    /// a breaking change. Applications should write their code in anticipation of:
9114    ///
9115    /// - New values appearing in future releases of the client library, **and**
9116    /// - New values received dynamically, without application changes.
9117    ///
9118    /// Please consult the [Working with enums] section in the user guide for some
9119    /// guidelines.
9120    ///
9121    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9122    #[derive(Clone, Debug, PartialEq)]
9123    #[non_exhaustive]
9124    pub enum IpProtocol {
9125        #[allow(missing_docs)]
9126        Undefined,
9127        /// Indicates the load balancer is accessible via TCP.
9128        Tcp,
9129        /// Indicates the load balancer is accessible via UDP.
9130        Udp,
9131        /// If set, the enum was initialized with an unknown value.
9132        ///
9133        /// Applications can examine the value using [IpProtocol::name].
9134        UnknownValue(ip_protocol::UnknownValue),
9135    }
9136
9137    #[doc(hidden)]
9138    pub mod ip_protocol {
9139        #[allow(unused_imports)]
9140        use super::*;
9141        #[derive(Clone, Debug, PartialEq)]
9142        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9143    }
9144
9145    impl IpProtocol {
9146        /// Gets the enum value as a string.
9147        pub fn name(&self) -> std::option::Option<&str> {
9148            match self {
9149                Self::Undefined => std::option::Option::Some("undefined"),
9150                Self::Tcp => std::option::Option::Some("tcp"),
9151                Self::Udp => std::option::Option::Some("udp"),
9152                Self::UnknownValue(u) => u.0.name(),
9153            }
9154        }
9155    }
9156
9157    impl std::fmt::Display for IpProtocol {
9158        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9159            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
9160        }
9161    }
9162
9163    impl std::convert::From<&str> for IpProtocol {
9164        fn from(value: &str) -> Self {
9165            use std::string::ToString;
9166            match value {
9167                "undefined" => Self::Undefined,
9168                "tcp" => Self::Tcp,
9169                "udp" => Self::Udp,
9170                _ => Self::UnknownValue(ip_protocol::UnknownValue(
9171                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9172                )),
9173            }
9174        }
9175    }
9176
9177    impl serde::ser::Serialize for IpProtocol {
9178        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9179        where
9180            S: serde::Serializer,
9181        {
9182            match self {
9183                Self::Undefined => serializer.serialize_str("undefined"),
9184                Self::Tcp => serializer.serialize_str("tcp"),
9185                Self::Udp => serializer.serialize_str("udp"),
9186                Self::UnknownValue(u) => u.0.serialize(serializer),
9187            }
9188        }
9189    }
9190
9191    impl<'de> serde::de::Deserialize<'de> for IpProtocol {
9192        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9193        where
9194            D: serde::Deserializer<'de>,
9195        {
9196            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<IpProtocol>::new(
9197                "..RRSetRoutingPolicyLoadBalancerTarget.ipProtocol",
9198            ))
9199        }
9200    }
9201
9202    /// The enumerated type for the [loadBalancerType][.RRSetRoutingPolicyLoadBalancerTarget.loadBalancerType] field.
9203    ///
9204    /// # Working with unknown values
9205    ///
9206    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9207    /// additional enum variants at any time. Adding new variants is not considered
9208    /// a breaking change. Applications should write their code in anticipation of:
9209    ///
9210    /// - New values appearing in future releases of the client library, **and**
9211    /// - New values received dynamically, without application changes.
9212    ///
9213    /// Please consult the [Working with enums] section in the user guide for some
9214    /// guidelines.
9215    ///
9216    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9217    #[derive(Clone, Debug, PartialEq)]
9218    #[non_exhaustive]
9219    pub enum LoadBalancerType {
9220        #[allow(missing_docs)]
9221        None,
9222        /// Indicates the load balancer is a Cross-Region Application Load Balancer.
9223        GlobalL7Ilb,
9224        /// Indicates the load balancer is a Regional Network Passthrough Load Balancer.
9225        RegionalL4Ilb,
9226        /// Indicates the load balancer is a Regional Application Load Balancer.
9227        RegionalL7Ilb,
9228        /// If set, the enum was initialized with an unknown value.
9229        ///
9230        /// Applications can examine the value using [LoadBalancerType::name].
9231        UnknownValue(load_balancer_type::UnknownValue),
9232    }
9233
9234    #[doc(hidden)]
9235    pub mod load_balancer_type {
9236        #[allow(unused_imports)]
9237        use super::*;
9238        #[derive(Clone, Debug, PartialEq)]
9239        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9240    }
9241
9242    impl LoadBalancerType {
9243        /// Gets the enum value as a string.
9244        pub fn name(&self) -> std::option::Option<&str> {
9245            match self {
9246                Self::None => std::option::Option::Some("none"),
9247                Self::GlobalL7Ilb => std::option::Option::Some("globalL7ilb"),
9248                Self::RegionalL4Ilb => std::option::Option::Some("regionalL4ilb"),
9249                Self::RegionalL7Ilb => std::option::Option::Some("regionalL7ilb"),
9250                Self::UnknownValue(u) => u.0.name(),
9251            }
9252        }
9253    }
9254
9255    impl std::fmt::Display for LoadBalancerType {
9256        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9257            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
9258        }
9259    }
9260
9261    impl std::convert::From<&str> for LoadBalancerType {
9262        fn from(value: &str) -> Self {
9263            use std::string::ToString;
9264            match value {
9265                "none" => Self::None,
9266                "globalL7ilb" => Self::GlobalL7Ilb,
9267                "regionalL4ilb" => Self::RegionalL4Ilb,
9268                "regionalL7ilb" => Self::RegionalL7Ilb,
9269                _ => Self::UnknownValue(load_balancer_type::UnknownValue(
9270                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9271                )),
9272            }
9273        }
9274    }
9275
9276    impl serde::ser::Serialize for LoadBalancerType {
9277        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9278        where
9279            S: serde::Serializer,
9280        {
9281            match self {
9282                Self::None => serializer.serialize_str("none"),
9283                Self::GlobalL7Ilb => serializer.serialize_str("globalL7ilb"),
9284                Self::RegionalL4Ilb => serializer.serialize_str("regionalL4ilb"),
9285                Self::RegionalL7Ilb => serializer.serialize_str("regionalL7ilb"),
9286                Self::UnknownValue(u) => u.0.serialize(serializer),
9287            }
9288        }
9289    }
9290
9291    impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
9292        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9293        where
9294            D: serde::Deserializer<'de>,
9295        {
9296            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<LoadBalancerType>::new(
9297                "..RRSetRoutingPolicyLoadBalancerTarget.loadBalancerType",
9298            ))
9299        }
9300    }
9301}
9302
9303/// Configures a RRSetRoutingPolicy such that all queries are responded with the primary_targets if they are healthy. And if all of them are unhealthy, then we fallback to a geo localized policy.
9304#[derive(Clone, Default, PartialEq)]
9305#[non_exhaustive]
9306pub struct RRSetRoutingPolicyPrimaryBackupPolicy {
9307    /// Backup targets provide a regional failover policy for the otherwise global primary targets. If serving state is set to `BACKUP`, this policy essentially becomes a geo routing policy.
9308    pub backup_geo_targets: std::option::Option<crate::model::RRSetRoutingPolicyGeoPolicy>,
9309
9310    #[allow(missing_docs)]
9311    pub kind: std::option::Option<std::string::String>,
9312
9313    /// Endpoints that are health checked before making the routing decision. Unhealthy endpoints are omitted from the results. If all endpoints are unhealthy, we serve a response based on the `backup_geo_targets`.
9314    pub primary_targets: std::option::Option<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
9315
9316    /// When serving state is `PRIMARY`, this field provides the option of sending a small percentage of the traffic to the backup targets.
9317    pub trickle_traffic: std::option::Option<f64>,
9318
9319    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9320}
9321
9322impl RRSetRoutingPolicyPrimaryBackupPolicy {
9323    /// Creates a new default instance.
9324    pub fn new() -> Self {
9325        std::default::Default::default()
9326    }
9327
9328    /// Sets the value of [backup_geo_targets][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::backup_geo_targets].
9329    ///
9330    /// # Example
9331    /// ```ignore,no_run
9332    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
9333    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
9334    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_backup_geo_targets(RRSetRoutingPolicyGeoPolicy::default()/* use setters */);
9335    /// ```
9336    pub fn set_backup_geo_targets<T>(mut self, v: T) -> Self
9337    where
9338        T: std::convert::Into<crate::model::RRSetRoutingPolicyGeoPolicy>,
9339    {
9340        self.backup_geo_targets = std::option::Option::Some(v.into());
9341        self
9342    }
9343
9344    /// Sets or clears the value of [backup_geo_targets][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::backup_geo_targets].
9345    ///
9346    /// # Example
9347    /// ```ignore,no_run
9348    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
9349    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
9350    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_backup_geo_targets(Some(RRSetRoutingPolicyGeoPolicy::default()/* use setters */));
9351    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_backup_geo_targets(None::<RRSetRoutingPolicyGeoPolicy>);
9352    /// ```
9353    pub fn set_or_clear_backup_geo_targets<T>(mut self, v: std::option::Option<T>) -> Self
9354    where
9355        T: std::convert::Into<crate::model::RRSetRoutingPolicyGeoPolicy>,
9356    {
9357        self.backup_geo_targets = v.map(|x| x.into());
9358        self
9359    }
9360
9361    /// Sets the value of [kind][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::kind].
9362    ///
9363    /// # Example
9364    /// ```ignore,no_run
9365    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
9366    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_kind("example");
9367    /// ```
9368    pub fn set_kind<T>(mut self, v: T) -> Self
9369    where
9370        T: std::convert::Into<std::string::String>,
9371    {
9372        self.kind = std::option::Option::Some(v.into());
9373        self
9374    }
9375
9376    /// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::kind].
9377    ///
9378    /// # Example
9379    /// ```ignore,no_run
9380    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
9381    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_kind(Some("example"));
9382    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_kind(None::<String>);
9383    /// ```
9384    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
9385    where
9386        T: std::convert::Into<std::string::String>,
9387    {
9388        self.kind = v.map(|x| x.into());
9389        self
9390    }
9391
9392    /// Sets the value of [primary_targets][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::primary_targets].
9393    ///
9394    /// # Example
9395    /// ```ignore,no_run
9396    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
9397    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
9398    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_primary_targets(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */);
9399    /// ```
9400    pub fn set_primary_targets<T>(mut self, v: T) -> Self
9401    where
9402        T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
9403    {
9404        self.primary_targets = std::option::Option::Some(v.into());
9405        self
9406    }
9407
9408    /// Sets or clears the value of [primary_targets][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::primary_targets].
9409    ///
9410    /// # Example
9411    /// ```ignore,no_run
9412    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
9413    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
9414    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_primary_targets(Some(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */));
9415    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_primary_targets(None::<RRSetRoutingPolicyHealthCheckTargets>);
9416    /// ```
9417    pub fn set_or_clear_primary_targets<T>(mut self, v: std::option::Option<T>) -> Self
9418    where
9419        T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
9420    {
9421        self.primary_targets = v.map(|x| x.into());
9422        self
9423    }
9424
9425    /// Sets the value of [trickle_traffic][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::trickle_traffic].
9426    ///
9427    /// # Example
9428    /// ```ignore,no_run
9429    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
9430    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_trickle_traffic(42.0);
9431    /// ```
9432    pub fn set_trickle_traffic<T>(mut self, v: T) -> Self
9433    where
9434        T: std::convert::Into<f64>,
9435    {
9436        self.trickle_traffic = std::option::Option::Some(v.into());
9437        self
9438    }
9439
9440    /// Sets or clears the value of [trickle_traffic][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::trickle_traffic].
9441    ///
9442    /// # Example
9443    /// ```ignore,no_run
9444    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
9445    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_trickle_traffic(Some(42.0));
9446    /// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_trickle_traffic(None::<f32>);
9447    /// ```
9448    pub fn set_or_clear_trickle_traffic<T>(mut self, v: std::option::Option<T>) -> Self
9449    where
9450        T: std::convert::Into<f64>,
9451    {
9452        self.trickle_traffic = v.map(|x| x.into());
9453        self
9454    }
9455}
9456
9457impl wkt::message::Message for RRSetRoutingPolicyPrimaryBackupPolicy {
9458    fn typename() -> &'static str {
9459        "type.googleapis.com/.RRSetRoutingPolicyPrimaryBackupPolicy"
9460    }
9461}
9462
9463/// Configures a RRSetRoutingPolicy that routes in a weighted round robin fashion.
9464#[derive(Clone, Default, PartialEq)]
9465#[non_exhaustive]
9466pub struct RRSetRoutingPolicyWrrPolicy {
9467    #[allow(missing_docs)]
9468    pub items: std::vec::Vec<crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem>,
9469
9470    #[allow(missing_docs)]
9471    pub kind: std::option::Option<std::string::String>,
9472
9473    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9474}
9475
9476impl RRSetRoutingPolicyWrrPolicy {
9477    /// Creates a new default instance.
9478    pub fn new() -> Self {
9479        std::default::Default::default()
9480    }
9481
9482    /// Sets the value of [items][crate::model::RRSetRoutingPolicyWrrPolicy::items].
9483    ///
9484    /// # Example
9485    /// ```ignore,no_run
9486    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicy;
9487    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
9488    /// let x = RRSetRoutingPolicyWrrPolicy::new()
9489    ///     .set_items([
9490    ///         RRSetRoutingPolicyWrrPolicyWrrPolicyItem::default()/* use setters */,
9491    ///         RRSetRoutingPolicyWrrPolicyWrrPolicyItem::default()/* use (different) setters */,
9492    ///     ]);
9493    /// ```
9494    pub fn set_items<T, V>(mut self, v: T) -> Self
9495    where
9496        T: std::iter::IntoIterator<Item = V>,
9497        V: std::convert::Into<crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem>,
9498    {
9499        use std::iter::Iterator;
9500        self.items = v.into_iter().map(|i| i.into()).collect();
9501        self
9502    }
9503
9504    /// Sets the value of [kind][crate::model::RRSetRoutingPolicyWrrPolicy::kind].
9505    ///
9506    /// # Example
9507    /// ```ignore,no_run
9508    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicy;
9509    /// let x = RRSetRoutingPolicyWrrPolicy::new().set_kind("example");
9510    /// ```
9511    pub fn set_kind<T>(mut self, v: T) -> Self
9512    where
9513        T: std::convert::Into<std::string::String>,
9514    {
9515        self.kind = std::option::Option::Some(v.into());
9516        self
9517    }
9518
9519    /// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyWrrPolicy::kind].
9520    ///
9521    /// # Example
9522    /// ```ignore,no_run
9523    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicy;
9524    /// let x = RRSetRoutingPolicyWrrPolicy::new().set_or_clear_kind(Some("example"));
9525    /// let x = RRSetRoutingPolicyWrrPolicy::new().set_or_clear_kind(None::<String>);
9526    /// ```
9527    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
9528    where
9529        T: std::convert::Into<std::string::String>,
9530    {
9531        self.kind = v.map(|x| x.into());
9532        self
9533    }
9534}
9535
9536impl wkt::message::Message for RRSetRoutingPolicyWrrPolicy {
9537    fn typename() -> &'static str {
9538        "type.googleapis.com/.RRSetRoutingPolicyWrrPolicy"
9539    }
9540}
9541
9542/// A routing block which contains the routing information for one WRR item.
9543#[derive(Clone, Default, PartialEq)]
9544#[non_exhaustive]
9545pub struct RRSetRoutingPolicyWrrPolicyWrrPolicyItem {
9546    /// Endpoints that are health checked before making the routing decision. The unhealthy endpoints are omitted from the result. If all endpoints within a bucket are unhealthy, we choose a different bucket (sampled with respect to its weight) for responding. If DNSSEC is enabled for this zone, only one of `rrdata` or `health_checked_targets` can be set.
9547    pub health_checked_targets:
9548        std::option::Option<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
9549
9550    #[allow(missing_docs)]
9551    pub kind: std::option::Option<std::string::String>,
9552
9553    #[allow(missing_docs)]
9554    pub rrdatas: std::vec::Vec<std::string::String>,
9555
9556    /// DNSSEC generated signatures for all the `rrdata` within this item. When using health-checked targets for DNSSEC-enabled zones, you can only use at most one health-checked IP address per item.
9557    pub signature_rrdatas: std::vec::Vec<std::string::String>,
9558
9559    /// The weight corresponding to this `WrrPolicyItem` object. When multiple `WrrPolicyItem` objects are configured, the probability of returning an `WrrPolicyItem` object's data is proportional to its weight relative to the sum of weights configured for all items. This weight must be non-negative.
9560    pub weight: std::option::Option<f64>,
9561
9562    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9563}
9564
9565impl RRSetRoutingPolicyWrrPolicyWrrPolicyItem {
9566    /// Creates a new default instance.
9567    pub fn new() -> Self {
9568        std::default::Default::default()
9569    }
9570
9571    /// Sets the value of [health_checked_targets][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::health_checked_targets].
9572    ///
9573    /// # Example
9574    /// ```ignore,no_run
9575    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
9576    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
9577    /// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_health_checked_targets(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */);
9578    /// ```
9579    pub fn set_health_checked_targets<T>(mut self, v: T) -> Self
9580    where
9581        T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
9582    {
9583        self.health_checked_targets = std::option::Option::Some(v.into());
9584        self
9585    }
9586
9587    /// Sets or clears the value of [health_checked_targets][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::health_checked_targets].
9588    ///
9589    /// # Example
9590    /// ```ignore,no_run
9591    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
9592    /// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
9593    /// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_health_checked_targets(Some(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */));
9594    /// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_health_checked_targets(None::<RRSetRoutingPolicyHealthCheckTargets>);
9595    /// ```
9596    pub fn set_or_clear_health_checked_targets<T>(mut self, v: std::option::Option<T>) -> Self
9597    where
9598        T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
9599    {
9600        self.health_checked_targets = v.map(|x| x.into());
9601        self
9602    }
9603
9604    /// Sets the value of [kind][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::kind].
9605    ///
9606    /// # Example
9607    /// ```ignore,no_run
9608    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
9609    /// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_kind("example");
9610    /// ```
9611    pub fn set_kind<T>(mut self, v: T) -> Self
9612    where
9613        T: std::convert::Into<std::string::String>,
9614    {
9615        self.kind = std::option::Option::Some(v.into());
9616        self
9617    }
9618
9619    /// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::kind].
9620    ///
9621    /// # Example
9622    /// ```ignore,no_run
9623    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
9624    /// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_kind(Some("example"));
9625    /// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_kind(None::<String>);
9626    /// ```
9627    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
9628    where
9629        T: std::convert::Into<std::string::String>,
9630    {
9631        self.kind = v.map(|x| x.into());
9632        self
9633    }
9634
9635    /// Sets the value of [rrdatas][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::rrdatas].
9636    ///
9637    /// # Example
9638    /// ```ignore,no_run
9639    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
9640    /// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_rrdatas(["a", "b", "c"]);
9641    /// ```
9642    pub fn set_rrdatas<T, V>(mut self, v: T) -> Self
9643    where
9644        T: std::iter::IntoIterator<Item = V>,
9645        V: std::convert::Into<std::string::String>,
9646    {
9647        use std::iter::Iterator;
9648        self.rrdatas = v.into_iter().map(|i| i.into()).collect();
9649        self
9650    }
9651
9652    /// Sets the value of [signature_rrdatas][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::signature_rrdatas].
9653    ///
9654    /// # Example
9655    /// ```ignore,no_run
9656    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
9657    /// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_signature_rrdatas(["a", "b", "c"]);
9658    /// ```
9659    pub fn set_signature_rrdatas<T, V>(mut self, v: T) -> Self
9660    where
9661        T: std::iter::IntoIterator<Item = V>,
9662        V: std::convert::Into<std::string::String>,
9663    {
9664        use std::iter::Iterator;
9665        self.signature_rrdatas = v.into_iter().map(|i| i.into()).collect();
9666        self
9667    }
9668
9669    /// Sets the value of [weight][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::weight].
9670    ///
9671    /// # Example
9672    /// ```ignore,no_run
9673    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
9674    /// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_weight(42.0);
9675    /// ```
9676    pub fn set_weight<T>(mut self, v: T) -> Self
9677    where
9678        T: std::convert::Into<f64>,
9679    {
9680        self.weight = std::option::Option::Some(v.into());
9681        self
9682    }
9683
9684    /// Sets or clears the value of [weight][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::weight].
9685    ///
9686    /// # Example
9687    /// ```ignore,no_run
9688    /// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
9689    /// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_weight(Some(42.0));
9690    /// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_weight(None::<f32>);
9691    /// ```
9692    pub fn set_or_clear_weight<T>(mut self, v: std::option::Option<T>) -> Self
9693    where
9694        T: std::convert::Into<f64>,
9695    {
9696        self.weight = v.map(|x| x.into());
9697        self
9698    }
9699}
9700
9701impl wkt::message::Message for RRSetRoutingPolicyWrrPolicyWrrPolicyItem {
9702    fn typename() -> &'static str {
9703        "type.googleapis.com/.RRSetRoutingPolicyWrrPolicyWrrPolicyItem"
9704    }
9705}
9706
9707/// A unit of data that is returned by the DNS servers.
9708#[derive(Clone, Default, PartialEq)]
9709#[non_exhaustive]
9710pub struct ResourceRecordSet {
9711    #[allow(missing_docs)]
9712    pub kind: std::option::Option<std::string::String>,
9713
9714    /// For example, www.example.com.
9715    pub name: std::option::Option<std::string::String>,
9716
9717    /// Configures dynamic query responses based on either the geo location of the querying user or a weighted round robin based routing policy. A valid `ResourceRecordSet` contains only `rrdata` (for static resolution) or a `routing_policy` (for dynamic resolution).
9718    pub routing_policy: std::option::Option<crate::model::RRSetRoutingPolicy>,
9719
9720    /// As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- see examples.
9721    pub rrdatas: std::vec::Vec<std::string::String>,
9722
9723    #[allow(missing_docs)]
9724    pub signature_rrdatas: std::vec::Vec<std::string::String>,
9725
9726    /// Number of seconds that this `ResourceRecordSet` can be cached by resolvers.
9727    pub ttl: std::option::Option<i32>,
9728
9729    /// The identifier of a supported record type. See the list of Supported DNS record types.
9730    pub r#type: std::option::Option<std::string::String>,
9731
9732    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9733}
9734
9735impl ResourceRecordSet {
9736    /// Creates a new default instance.
9737    pub fn new() -> Self {
9738        std::default::Default::default()
9739    }
9740
9741    /// Sets the value of [kind][crate::model::ResourceRecordSet::kind].
9742    ///
9743    /// # Example
9744    /// ```ignore,no_run
9745    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9746    /// let x = ResourceRecordSet::new().set_kind("example");
9747    /// ```
9748    pub fn set_kind<T>(mut self, v: T) -> Self
9749    where
9750        T: std::convert::Into<std::string::String>,
9751    {
9752        self.kind = std::option::Option::Some(v.into());
9753        self
9754    }
9755
9756    /// Sets or clears the value of [kind][crate::model::ResourceRecordSet::kind].
9757    ///
9758    /// # Example
9759    /// ```ignore,no_run
9760    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9761    /// let x = ResourceRecordSet::new().set_or_clear_kind(Some("example"));
9762    /// let x = ResourceRecordSet::new().set_or_clear_kind(None::<String>);
9763    /// ```
9764    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
9765    where
9766        T: std::convert::Into<std::string::String>,
9767    {
9768        self.kind = v.map(|x| x.into());
9769        self
9770    }
9771
9772    /// Sets the value of [name][crate::model::ResourceRecordSet::name].
9773    ///
9774    /// # Example
9775    /// ```ignore,no_run
9776    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9777    /// let x = ResourceRecordSet::new().set_name("example");
9778    /// ```
9779    pub fn set_name<T>(mut self, v: T) -> Self
9780    where
9781        T: std::convert::Into<std::string::String>,
9782    {
9783        self.name = std::option::Option::Some(v.into());
9784        self
9785    }
9786
9787    /// Sets or clears the value of [name][crate::model::ResourceRecordSet::name].
9788    ///
9789    /// # Example
9790    /// ```ignore,no_run
9791    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9792    /// let x = ResourceRecordSet::new().set_or_clear_name(Some("example"));
9793    /// let x = ResourceRecordSet::new().set_or_clear_name(None::<String>);
9794    /// ```
9795    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
9796    where
9797        T: std::convert::Into<std::string::String>,
9798    {
9799        self.name = v.map(|x| x.into());
9800        self
9801    }
9802
9803    /// Sets the value of [routing_policy][crate::model::ResourceRecordSet::routing_policy].
9804    ///
9805    /// # Example
9806    /// ```ignore,no_run
9807    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9808    /// use google_cloud_dns_v1::model::RRSetRoutingPolicy;
9809    /// let x = ResourceRecordSet::new().set_routing_policy(RRSetRoutingPolicy::default()/* use setters */);
9810    /// ```
9811    pub fn set_routing_policy<T>(mut self, v: T) -> Self
9812    where
9813        T: std::convert::Into<crate::model::RRSetRoutingPolicy>,
9814    {
9815        self.routing_policy = std::option::Option::Some(v.into());
9816        self
9817    }
9818
9819    /// Sets or clears the value of [routing_policy][crate::model::ResourceRecordSet::routing_policy].
9820    ///
9821    /// # Example
9822    /// ```ignore,no_run
9823    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9824    /// use google_cloud_dns_v1::model::RRSetRoutingPolicy;
9825    /// let x = ResourceRecordSet::new().set_or_clear_routing_policy(Some(RRSetRoutingPolicy::default()/* use setters */));
9826    /// let x = ResourceRecordSet::new().set_or_clear_routing_policy(None::<RRSetRoutingPolicy>);
9827    /// ```
9828    pub fn set_or_clear_routing_policy<T>(mut self, v: std::option::Option<T>) -> Self
9829    where
9830        T: std::convert::Into<crate::model::RRSetRoutingPolicy>,
9831    {
9832        self.routing_policy = v.map(|x| x.into());
9833        self
9834    }
9835
9836    /// Sets the value of [rrdatas][crate::model::ResourceRecordSet::rrdatas].
9837    ///
9838    /// # Example
9839    /// ```ignore,no_run
9840    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9841    /// let x = ResourceRecordSet::new().set_rrdatas(["a", "b", "c"]);
9842    /// ```
9843    pub fn set_rrdatas<T, V>(mut self, v: T) -> Self
9844    where
9845        T: std::iter::IntoIterator<Item = V>,
9846        V: std::convert::Into<std::string::String>,
9847    {
9848        use std::iter::Iterator;
9849        self.rrdatas = v.into_iter().map(|i| i.into()).collect();
9850        self
9851    }
9852
9853    /// Sets the value of [signature_rrdatas][crate::model::ResourceRecordSet::signature_rrdatas].
9854    ///
9855    /// # Example
9856    /// ```ignore,no_run
9857    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9858    /// let x = ResourceRecordSet::new().set_signature_rrdatas(["a", "b", "c"]);
9859    /// ```
9860    pub fn set_signature_rrdatas<T, V>(mut self, v: T) -> Self
9861    where
9862        T: std::iter::IntoIterator<Item = V>,
9863        V: std::convert::Into<std::string::String>,
9864    {
9865        use std::iter::Iterator;
9866        self.signature_rrdatas = v.into_iter().map(|i| i.into()).collect();
9867        self
9868    }
9869
9870    /// Sets the value of [ttl][crate::model::ResourceRecordSet::ttl].
9871    ///
9872    /// # Example
9873    /// ```ignore,no_run
9874    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9875    /// let x = ResourceRecordSet::new().set_ttl(42);
9876    /// ```
9877    pub fn set_ttl<T>(mut self, v: T) -> Self
9878    where
9879        T: std::convert::Into<i32>,
9880    {
9881        self.ttl = std::option::Option::Some(v.into());
9882        self
9883    }
9884
9885    /// Sets or clears the value of [ttl][crate::model::ResourceRecordSet::ttl].
9886    ///
9887    /// # Example
9888    /// ```ignore,no_run
9889    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9890    /// let x = ResourceRecordSet::new().set_or_clear_ttl(Some(42));
9891    /// let x = ResourceRecordSet::new().set_or_clear_ttl(None::<i32>);
9892    /// ```
9893    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
9894    where
9895        T: std::convert::Into<i32>,
9896    {
9897        self.ttl = v.map(|x| x.into());
9898        self
9899    }
9900
9901    /// Sets the value of [r#type][crate::model::ResourceRecordSet::type].
9902    ///
9903    /// # Example
9904    /// ```ignore,no_run
9905    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9906    /// let x = ResourceRecordSet::new().set_type("example");
9907    /// ```
9908    pub fn set_type<T>(mut self, v: T) -> Self
9909    where
9910        T: std::convert::Into<std::string::String>,
9911    {
9912        self.r#type = std::option::Option::Some(v.into());
9913        self
9914    }
9915
9916    /// Sets or clears the value of [r#type][crate::model::ResourceRecordSet::type].
9917    ///
9918    /// # Example
9919    /// ```ignore,no_run
9920    /// # use google_cloud_dns_v1::model::ResourceRecordSet;
9921    /// let x = ResourceRecordSet::new().set_or_clear_type(Some("example"));
9922    /// let x = ResourceRecordSet::new().set_or_clear_type(None::<String>);
9923    /// ```
9924    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
9925    where
9926        T: std::convert::Into<std::string::String>,
9927    {
9928        self.r#type = v.map(|x| x.into());
9929        self
9930    }
9931}
9932
9933impl wkt::message::Message for ResourceRecordSet {
9934    fn typename() -> &'static str {
9935        "type.googleapis.com/.ResourceRecordSet"
9936    }
9937}
9938
9939#[allow(missing_docs)]
9940#[derive(Clone, Default, PartialEq)]
9941#[non_exhaustive]
9942pub struct ResourceRecordSetsDeleteResponse {
9943    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9944}
9945
9946impl ResourceRecordSetsDeleteResponse {
9947    /// Creates a new default instance.
9948    pub fn new() -> Self {
9949        std::default::Default::default()
9950    }
9951}
9952
9953impl wkt::message::Message for ResourceRecordSetsDeleteResponse {
9954    fn typename() -> &'static str {
9955        "type.googleapis.com/.ResourceRecordSetsDeleteResponse"
9956    }
9957}
9958
9959#[allow(missing_docs)]
9960#[derive(Clone, Default, PartialEq)]
9961#[non_exhaustive]
9962pub struct ResourceRecordSetsListResponse {
9963    /// Output only. Type of resource.
9964    pub kind: std::option::Option<std::string::String>,
9965
9966    /// This field indicates that more results are available beyond the last page displayed. To fetch the results, make another list request and use this value as your page token. This lets you retrieve the complete contents of a very large collection one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned are an inconsistent view of the collection. You can't retrieve a consistent snapshot of a collection larger than the maximum page size.
9967    pub next_page_token: std::option::Option<std::string::String>,
9968
9969    /// The resource record set resources.
9970    pub rrsets: std::vec::Vec<crate::model::ResourceRecordSet>,
9971
9972    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9973}
9974
9975impl ResourceRecordSetsListResponse {
9976    /// Creates a new default instance.
9977    pub fn new() -> Self {
9978        std::default::Default::default()
9979    }
9980
9981    /// Sets the value of [kind][crate::model::ResourceRecordSetsListResponse::kind].
9982    ///
9983    /// # Example
9984    /// ```ignore,no_run
9985    /// # use google_cloud_dns_v1::model::ResourceRecordSetsListResponse;
9986    /// let x = ResourceRecordSetsListResponse::new().set_kind("example");
9987    /// ```
9988    pub fn set_kind<T>(mut self, v: T) -> Self
9989    where
9990        T: std::convert::Into<std::string::String>,
9991    {
9992        self.kind = std::option::Option::Some(v.into());
9993        self
9994    }
9995
9996    /// Sets or clears the value of [kind][crate::model::ResourceRecordSetsListResponse::kind].
9997    ///
9998    /// # Example
9999    /// ```ignore,no_run
10000    /// # use google_cloud_dns_v1::model::ResourceRecordSetsListResponse;
10001    /// let x = ResourceRecordSetsListResponse::new().set_or_clear_kind(Some("example"));
10002    /// let x = ResourceRecordSetsListResponse::new().set_or_clear_kind(None::<String>);
10003    /// ```
10004    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
10005    where
10006        T: std::convert::Into<std::string::String>,
10007    {
10008        self.kind = v.map(|x| x.into());
10009        self
10010    }
10011
10012    /// Sets the value of [next_page_token][crate::model::ResourceRecordSetsListResponse::next_page_token].
10013    ///
10014    /// # Example
10015    /// ```ignore,no_run
10016    /// # use google_cloud_dns_v1::model::ResourceRecordSetsListResponse;
10017    /// let x = ResourceRecordSetsListResponse::new().set_next_page_token("example");
10018    /// ```
10019    pub fn set_next_page_token<T>(mut self, v: T) -> Self
10020    where
10021        T: std::convert::Into<std::string::String>,
10022    {
10023        self.next_page_token = std::option::Option::Some(v.into());
10024        self
10025    }
10026
10027    /// Sets or clears the value of [next_page_token][crate::model::ResourceRecordSetsListResponse::next_page_token].
10028    ///
10029    /// # Example
10030    /// ```ignore,no_run
10031    /// # use google_cloud_dns_v1::model::ResourceRecordSetsListResponse;
10032    /// let x = ResourceRecordSetsListResponse::new().set_or_clear_next_page_token(Some("example"));
10033    /// let x = ResourceRecordSetsListResponse::new().set_or_clear_next_page_token(None::<String>);
10034    /// ```
10035    pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
10036    where
10037        T: std::convert::Into<std::string::String>,
10038    {
10039        self.next_page_token = v.map(|x| x.into());
10040        self
10041    }
10042
10043    /// Sets the value of [rrsets][crate::model::ResourceRecordSetsListResponse::rrsets].
10044    ///
10045    /// # Example
10046    /// ```ignore,no_run
10047    /// # use google_cloud_dns_v1::model::ResourceRecordSetsListResponse;
10048    /// use google_cloud_dns_v1::model::ResourceRecordSet;
10049    /// let x = ResourceRecordSetsListResponse::new()
10050    ///     .set_rrsets([
10051    ///         ResourceRecordSet::default()/* use setters */,
10052    ///         ResourceRecordSet::default()/* use (different) setters */,
10053    ///     ]);
10054    /// ```
10055    pub fn set_rrsets<T, V>(mut self, v: T) -> Self
10056    where
10057        T: std::iter::IntoIterator<Item = V>,
10058        V: std::convert::Into<crate::model::ResourceRecordSet>,
10059    {
10060        use std::iter::Iterator;
10061        self.rrsets = v.into_iter().map(|i| i.into()).collect();
10062        self
10063    }
10064}
10065
10066impl wkt::message::Message for ResourceRecordSetsListResponse {
10067    fn typename() -> &'static str {
10068        "type.googleapis.com/.ResourceRecordSetsListResponse"
10069    }
10070}
10071
10072#[doc(hidden)]
10073impl google_cloud_gax::paginator::internal::PageableResponse for ResourceRecordSetsListResponse {
10074    type PageItem = crate::model::ResourceRecordSet;
10075
10076    fn items(self) -> std::vec::Vec<Self::PageItem> {
10077        self.rrsets
10078    }
10079
10080    fn next_page_token(&self) -> std::string::String {
10081        use std::clone::Clone;
10082        self.next_page_token.clone().unwrap_or_default()
10083    }
10084}
10085
10086#[allow(missing_docs)]
10087#[derive(Clone, Default, PartialEq)]
10088#[non_exhaustive]
10089pub struct ResponsePoliciesListResponse {
10090    /// This field indicates that more results are available beyond the last page displayed. To fetch the results, make another list request and use this value as your page token. This lets you retrieve the complete contents of a very large collection one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned are an inconsistent view of the collection. You can't retrieve a consistent snapshot of a collection larger than the maximum page size.
10091    pub next_page_token: std::option::Option<std::string::String>,
10092
10093    /// The Response Policy resources.
10094    pub response_policies: std::vec::Vec<crate::model::ResponsePolicy>,
10095
10096    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10097}
10098
10099impl ResponsePoliciesListResponse {
10100    /// Creates a new default instance.
10101    pub fn new() -> Self {
10102        std::default::Default::default()
10103    }
10104
10105    /// Sets the value of [next_page_token][crate::model::ResponsePoliciesListResponse::next_page_token].
10106    ///
10107    /// # Example
10108    /// ```ignore,no_run
10109    /// # use google_cloud_dns_v1::model::ResponsePoliciesListResponse;
10110    /// let x = ResponsePoliciesListResponse::new().set_next_page_token("example");
10111    /// ```
10112    pub fn set_next_page_token<T>(mut self, v: T) -> Self
10113    where
10114        T: std::convert::Into<std::string::String>,
10115    {
10116        self.next_page_token = std::option::Option::Some(v.into());
10117        self
10118    }
10119
10120    /// Sets or clears the value of [next_page_token][crate::model::ResponsePoliciesListResponse::next_page_token].
10121    ///
10122    /// # Example
10123    /// ```ignore,no_run
10124    /// # use google_cloud_dns_v1::model::ResponsePoliciesListResponse;
10125    /// let x = ResponsePoliciesListResponse::new().set_or_clear_next_page_token(Some("example"));
10126    /// let x = ResponsePoliciesListResponse::new().set_or_clear_next_page_token(None::<String>);
10127    /// ```
10128    pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
10129    where
10130        T: std::convert::Into<std::string::String>,
10131    {
10132        self.next_page_token = v.map(|x| x.into());
10133        self
10134    }
10135
10136    /// Sets the value of [response_policies][crate::model::ResponsePoliciesListResponse::response_policies].
10137    ///
10138    /// # Example
10139    /// ```ignore,no_run
10140    /// # use google_cloud_dns_v1::model::ResponsePoliciesListResponse;
10141    /// use google_cloud_dns_v1::model::ResponsePolicy;
10142    /// let x = ResponsePoliciesListResponse::new()
10143    ///     .set_response_policies([
10144    ///         ResponsePolicy::default()/* use setters */,
10145    ///         ResponsePolicy::default()/* use (different) setters */,
10146    ///     ]);
10147    /// ```
10148    pub fn set_response_policies<T, V>(mut self, v: T) -> Self
10149    where
10150        T: std::iter::IntoIterator<Item = V>,
10151        V: std::convert::Into<crate::model::ResponsePolicy>,
10152    {
10153        use std::iter::Iterator;
10154        self.response_policies = v.into_iter().map(|i| i.into()).collect();
10155        self
10156    }
10157}
10158
10159impl wkt::message::Message for ResponsePoliciesListResponse {
10160    fn typename() -> &'static str {
10161        "type.googleapis.com/.ResponsePoliciesListResponse"
10162    }
10163}
10164
10165#[doc(hidden)]
10166impl google_cloud_gax::paginator::internal::PageableResponse for ResponsePoliciesListResponse {
10167    type PageItem = crate::model::ResponsePolicy;
10168
10169    fn items(self) -> std::vec::Vec<Self::PageItem> {
10170        self.response_policies
10171    }
10172
10173    fn next_page_token(&self) -> std::string::String {
10174        use std::clone::Clone;
10175        self.next_page_token.clone().unwrap_or_default()
10176    }
10177}
10178
10179#[allow(missing_docs)]
10180#[derive(Clone, Default, PartialEq)]
10181#[non_exhaustive]
10182pub struct ResponsePoliciesPatchResponse {
10183    #[allow(missing_docs)]
10184    pub response_policy: std::option::Option<crate::model::ResponsePolicy>,
10185
10186    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10187}
10188
10189impl ResponsePoliciesPatchResponse {
10190    /// Creates a new default instance.
10191    pub fn new() -> Self {
10192        std::default::Default::default()
10193    }
10194
10195    /// Sets the value of [response_policy][crate::model::ResponsePoliciesPatchResponse::response_policy].
10196    ///
10197    /// # Example
10198    /// ```ignore,no_run
10199    /// # use google_cloud_dns_v1::model::ResponsePoliciesPatchResponse;
10200    /// use google_cloud_dns_v1::model::ResponsePolicy;
10201    /// let x = ResponsePoliciesPatchResponse::new().set_response_policy(ResponsePolicy::default()/* use setters */);
10202    /// ```
10203    pub fn set_response_policy<T>(mut self, v: T) -> Self
10204    where
10205        T: std::convert::Into<crate::model::ResponsePolicy>,
10206    {
10207        self.response_policy = std::option::Option::Some(v.into());
10208        self
10209    }
10210
10211    /// Sets or clears the value of [response_policy][crate::model::ResponsePoliciesPatchResponse::response_policy].
10212    ///
10213    /// # Example
10214    /// ```ignore,no_run
10215    /// # use google_cloud_dns_v1::model::ResponsePoliciesPatchResponse;
10216    /// use google_cloud_dns_v1::model::ResponsePolicy;
10217    /// let x = ResponsePoliciesPatchResponse::new().set_or_clear_response_policy(Some(ResponsePolicy::default()/* use setters */));
10218    /// let x = ResponsePoliciesPatchResponse::new().set_or_clear_response_policy(None::<ResponsePolicy>);
10219    /// ```
10220    pub fn set_or_clear_response_policy<T>(mut self, v: std::option::Option<T>) -> Self
10221    where
10222        T: std::convert::Into<crate::model::ResponsePolicy>,
10223    {
10224        self.response_policy = v.map(|x| x.into());
10225        self
10226    }
10227}
10228
10229impl wkt::message::Message for ResponsePoliciesPatchResponse {
10230    fn typename() -> &'static str {
10231        "type.googleapis.com/.ResponsePoliciesPatchResponse"
10232    }
10233}
10234
10235#[allow(missing_docs)]
10236#[derive(Clone, Default, PartialEq)]
10237#[non_exhaustive]
10238pub struct ResponsePoliciesUpdateResponse {
10239    #[allow(missing_docs)]
10240    pub response_policy: std::option::Option<crate::model::ResponsePolicy>,
10241
10242    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10243}
10244
10245impl ResponsePoliciesUpdateResponse {
10246    /// Creates a new default instance.
10247    pub fn new() -> Self {
10248        std::default::Default::default()
10249    }
10250
10251    /// Sets the value of [response_policy][crate::model::ResponsePoliciesUpdateResponse::response_policy].
10252    ///
10253    /// # Example
10254    /// ```ignore,no_run
10255    /// # use google_cloud_dns_v1::model::ResponsePoliciesUpdateResponse;
10256    /// use google_cloud_dns_v1::model::ResponsePolicy;
10257    /// let x = ResponsePoliciesUpdateResponse::new().set_response_policy(ResponsePolicy::default()/* use setters */);
10258    /// ```
10259    pub fn set_response_policy<T>(mut self, v: T) -> Self
10260    where
10261        T: std::convert::Into<crate::model::ResponsePolicy>,
10262    {
10263        self.response_policy = std::option::Option::Some(v.into());
10264        self
10265    }
10266
10267    /// Sets or clears the value of [response_policy][crate::model::ResponsePoliciesUpdateResponse::response_policy].
10268    ///
10269    /// # Example
10270    /// ```ignore,no_run
10271    /// # use google_cloud_dns_v1::model::ResponsePoliciesUpdateResponse;
10272    /// use google_cloud_dns_v1::model::ResponsePolicy;
10273    /// let x = ResponsePoliciesUpdateResponse::new().set_or_clear_response_policy(Some(ResponsePolicy::default()/* use setters */));
10274    /// let x = ResponsePoliciesUpdateResponse::new().set_or_clear_response_policy(None::<ResponsePolicy>);
10275    /// ```
10276    pub fn set_or_clear_response_policy<T>(mut self, v: std::option::Option<T>) -> Self
10277    where
10278        T: std::convert::Into<crate::model::ResponsePolicy>,
10279    {
10280        self.response_policy = v.map(|x| x.into());
10281        self
10282    }
10283}
10284
10285impl wkt::message::Message for ResponsePoliciesUpdateResponse {
10286    fn typename() -> &'static str {
10287        "type.googleapis.com/.ResponsePoliciesUpdateResponse"
10288    }
10289}
10290
10291/// A Response Policy is a collection of selectors that apply to queries made against one or more Virtual Private Cloud networks.
10292#[derive(Clone, Default, PartialEq)]
10293#[non_exhaustive]
10294pub struct ResponsePolicy {
10295    /// User-provided description for this Response Policy.
10296    pub description: std::option::Option<std::string::String>,
10297
10298    /// The list of Google Kubernetes Engine clusters to which this response policy is applied.
10299    pub gke_clusters: std::vec::Vec<crate::model::ResponsePolicyGKECluster>,
10300
10301    /// Unique identifier for the resource; defined by the server (output only).
10302    pub id: std::option::Option<i64>,
10303
10304    #[allow(missing_docs)]
10305    pub kind: std::option::Option<std::string::String>,
10306
10307    /// User labels.
10308    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10309
10310    /// List of network names specifying networks to which this policy is applied.
10311    pub networks: std::vec::Vec<crate::model::ResponsePolicyNetwork>,
10312
10313    /// User assigned name for this Response Policy.
10314    pub response_policy_name: std::option::Option<std::string::String>,
10315
10316    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10317}
10318
10319impl ResponsePolicy {
10320    /// Creates a new default instance.
10321    pub fn new() -> Self {
10322        std::default::Default::default()
10323    }
10324
10325    /// Sets the value of [description][crate::model::ResponsePolicy::description].
10326    ///
10327    /// # Example
10328    /// ```ignore,no_run
10329    /// # use google_cloud_dns_v1::model::ResponsePolicy;
10330    /// let x = ResponsePolicy::new().set_description("example");
10331    /// ```
10332    pub fn set_description<T>(mut self, v: T) -> Self
10333    where
10334        T: std::convert::Into<std::string::String>,
10335    {
10336        self.description = std::option::Option::Some(v.into());
10337        self
10338    }
10339
10340    /// Sets or clears the value of [description][crate::model::ResponsePolicy::description].
10341    ///
10342    /// # Example
10343    /// ```ignore,no_run
10344    /// # use google_cloud_dns_v1::model::ResponsePolicy;
10345    /// let x = ResponsePolicy::new().set_or_clear_description(Some("example"));
10346    /// let x = ResponsePolicy::new().set_or_clear_description(None::<String>);
10347    /// ```
10348    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
10349    where
10350        T: std::convert::Into<std::string::String>,
10351    {
10352        self.description = v.map(|x| x.into());
10353        self
10354    }
10355
10356    /// Sets the value of [gke_clusters][crate::model::ResponsePolicy::gke_clusters].
10357    ///
10358    /// # Example
10359    /// ```ignore,no_run
10360    /// # use google_cloud_dns_v1::model::ResponsePolicy;
10361    /// use google_cloud_dns_v1::model::ResponsePolicyGKECluster;
10362    /// let x = ResponsePolicy::new()
10363    ///     .set_gke_clusters([
10364    ///         ResponsePolicyGKECluster::default()/* use setters */,
10365    ///         ResponsePolicyGKECluster::default()/* use (different) setters */,
10366    ///     ]);
10367    /// ```
10368    pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
10369    where
10370        T: std::iter::IntoIterator<Item = V>,
10371        V: std::convert::Into<crate::model::ResponsePolicyGKECluster>,
10372    {
10373        use std::iter::Iterator;
10374        self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
10375        self
10376    }
10377
10378    /// Sets the value of [id][crate::model::ResponsePolicy::id].
10379    ///
10380    /// # Example
10381    /// ```ignore,no_run
10382    /// # use google_cloud_dns_v1::model::ResponsePolicy;
10383    /// let x = ResponsePolicy::new().set_id(42);
10384    /// ```
10385    pub fn set_id<T>(mut self, v: T) -> Self
10386    where
10387        T: std::convert::Into<i64>,
10388    {
10389        self.id = std::option::Option::Some(v.into());
10390        self
10391    }
10392
10393    /// Sets or clears the value of [id][crate::model::ResponsePolicy::id].
10394    ///
10395    /// # Example
10396    /// ```ignore,no_run
10397    /// # use google_cloud_dns_v1::model::ResponsePolicy;
10398    /// let x = ResponsePolicy::new().set_or_clear_id(Some(42));
10399    /// let x = ResponsePolicy::new().set_or_clear_id(None::<i32>);
10400    /// ```
10401    pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
10402    where
10403        T: std::convert::Into<i64>,
10404    {
10405        self.id = v.map(|x| x.into());
10406        self
10407    }
10408
10409    /// Sets the value of [kind][crate::model::ResponsePolicy::kind].
10410    ///
10411    /// # Example
10412    /// ```ignore,no_run
10413    /// # use google_cloud_dns_v1::model::ResponsePolicy;
10414    /// let x = ResponsePolicy::new().set_kind("example");
10415    /// ```
10416    pub fn set_kind<T>(mut self, v: T) -> Self
10417    where
10418        T: std::convert::Into<std::string::String>,
10419    {
10420        self.kind = std::option::Option::Some(v.into());
10421        self
10422    }
10423
10424    /// Sets or clears the value of [kind][crate::model::ResponsePolicy::kind].
10425    ///
10426    /// # Example
10427    /// ```ignore,no_run
10428    /// # use google_cloud_dns_v1::model::ResponsePolicy;
10429    /// let x = ResponsePolicy::new().set_or_clear_kind(Some("example"));
10430    /// let x = ResponsePolicy::new().set_or_clear_kind(None::<String>);
10431    /// ```
10432    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
10433    where
10434        T: std::convert::Into<std::string::String>,
10435    {
10436        self.kind = v.map(|x| x.into());
10437        self
10438    }
10439
10440    /// Sets the value of [labels][crate::model::ResponsePolicy::labels].
10441    ///
10442    /// # Example
10443    /// ```ignore,no_run
10444    /// # use google_cloud_dns_v1::model::ResponsePolicy;
10445    /// let x = ResponsePolicy::new().set_labels([
10446    ///     ("key0", "abc"),
10447    ///     ("key1", "xyz"),
10448    /// ]);
10449    /// ```
10450    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10451    where
10452        T: std::iter::IntoIterator<Item = (K, V)>,
10453        K: std::convert::Into<std::string::String>,
10454        V: std::convert::Into<std::string::String>,
10455    {
10456        use std::iter::Iterator;
10457        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10458        self
10459    }
10460
10461    /// Sets the value of [networks][crate::model::ResponsePolicy::networks].
10462    ///
10463    /// # Example
10464    /// ```ignore,no_run
10465    /// # use google_cloud_dns_v1::model::ResponsePolicy;
10466    /// use google_cloud_dns_v1::model::ResponsePolicyNetwork;
10467    /// let x = ResponsePolicy::new()
10468    ///     .set_networks([
10469    ///         ResponsePolicyNetwork::default()/* use setters */,
10470    ///         ResponsePolicyNetwork::default()/* use (different) setters */,
10471    ///     ]);
10472    /// ```
10473    pub fn set_networks<T, V>(mut self, v: T) -> Self
10474    where
10475        T: std::iter::IntoIterator<Item = V>,
10476        V: std::convert::Into<crate::model::ResponsePolicyNetwork>,
10477    {
10478        use std::iter::Iterator;
10479        self.networks = v.into_iter().map(|i| i.into()).collect();
10480        self
10481    }
10482
10483    /// Sets the value of [response_policy_name][crate::model::ResponsePolicy::response_policy_name].
10484    ///
10485    /// # Example
10486    /// ```ignore,no_run
10487    /// # use google_cloud_dns_v1::model::ResponsePolicy;
10488    /// let x = ResponsePolicy::new().set_response_policy_name("example");
10489    /// ```
10490    pub fn set_response_policy_name<T>(mut self, v: T) -> Self
10491    where
10492        T: std::convert::Into<std::string::String>,
10493    {
10494        self.response_policy_name = std::option::Option::Some(v.into());
10495        self
10496    }
10497
10498    /// Sets or clears the value of [response_policy_name][crate::model::ResponsePolicy::response_policy_name].
10499    ///
10500    /// # Example
10501    /// ```ignore,no_run
10502    /// # use google_cloud_dns_v1::model::ResponsePolicy;
10503    /// let x = ResponsePolicy::new().set_or_clear_response_policy_name(Some("example"));
10504    /// let x = ResponsePolicy::new().set_or_clear_response_policy_name(None::<String>);
10505    /// ```
10506    pub fn set_or_clear_response_policy_name<T>(mut self, v: std::option::Option<T>) -> Self
10507    where
10508        T: std::convert::Into<std::string::String>,
10509    {
10510        self.response_policy_name = v.map(|x| x.into());
10511        self
10512    }
10513}
10514
10515impl wkt::message::Message for ResponsePolicy {
10516    fn typename() -> &'static str {
10517        "type.googleapis.com/.ResponsePolicy"
10518    }
10519}
10520
10521#[allow(missing_docs)]
10522#[derive(Clone, Default, PartialEq)]
10523#[non_exhaustive]
10524pub struct ResponsePolicyGKECluster {
10525    /// The resource name of the cluster to bind this response policy to. This should be specified in the format like: projects/*/locations/*/clusters/*. This is referenced from GKE projects.locations.clusters.get API: <https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/get>
10526    pub gke_cluster_name: std::option::Option<std::string::String>,
10527
10528    #[allow(missing_docs)]
10529    pub kind: std::option::Option<std::string::String>,
10530
10531    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10532}
10533
10534impl ResponsePolicyGKECluster {
10535    /// Creates a new default instance.
10536    pub fn new() -> Self {
10537        std::default::Default::default()
10538    }
10539
10540    /// Sets the value of [gke_cluster_name][crate::model::ResponsePolicyGKECluster::gke_cluster_name].
10541    ///
10542    /// # Example
10543    /// ```ignore,no_run
10544    /// # use google_cloud_dns_v1::model::ResponsePolicyGKECluster;
10545    /// let x = ResponsePolicyGKECluster::new().set_gke_cluster_name("example");
10546    /// ```
10547    pub fn set_gke_cluster_name<T>(mut self, v: T) -> Self
10548    where
10549        T: std::convert::Into<std::string::String>,
10550    {
10551        self.gke_cluster_name = std::option::Option::Some(v.into());
10552        self
10553    }
10554
10555    /// Sets or clears the value of [gke_cluster_name][crate::model::ResponsePolicyGKECluster::gke_cluster_name].
10556    ///
10557    /// # Example
10558    /// ```ignore,no_run
10559    /// # use google_cloud_dns_v1::model::ResponsePolicyGKECluster;
10560    /// let x = ResponsePolicyGKECluster::new().set_or_clear_gke_cluster_name(Some("example"));
10561    /// let x = ResponsePolicyGKECluster::new().set_or_clear_gke_cluster_name(None::<String>);
10562    /// ```
10563    pub fn set_or_clear_gke_cluster_name<T>(mut self, v: std::option::Option<T>) -> Self
10564    where
10565        T: std::convert::Into<std::string::String>,
10566    {
10567        self.gke_cluster_name = v.map(|x| x.into());
10568        self
10569    }
10570
10571    /// Sets the value of [kind][crate::model::ResponsePolicyGKECluster::kind].
10572    ///
10573    /// # Example
10574    /// ```ignore,no_run
10575    /// # use google_cloud_dns_v1::model::ResponsePolicyGKECluster;
10576    /// let x = ResponsePolicyGKECluster::new().set_kind("example");
10577    /// ```
10578    pub fn set_kind<T>(mut self, v: T) -> Self
10579    where
10580        T: std::convert::Into<std::string::String>,
10581    {
10582        self.kind = std::option::Option::Some(v.into());
10583        self
10584    }
10585
10586    /// Sets or clears the value of [kind][crate::model::ResponsePolicyGKECluster::kind].
10587    ///
10588    /// # Example
10589    /// ```ignore,no_run
10590    /// # use google_cloud_dns_v1::model::ResponsePolicyGKECluster;
10591    /// let x = ResponsePolicyGKECluster::new().set_or_clear_kind(Some("example"));
10592    /// let x = ResponsePolicyGKECluster::new().set_or_clear_kind(None::<String>);
10593    /// ```
10594    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
10595    where
10596        T: std::convert::Into<std::string::String>,
10597    {
10598        self.kind = v.map(|x| x.into());
10599        self
10600    }
10601}
10602
10603impl wkt::message::Message for ResponsePolicyGKECluster {
10604    fn typename() -> &'static str {
10605        "type.googleapis.com/.ResponsePolicyGKECluster"
10606    }
10607}
10608
10609#[allow(missing_docs)]
10610#[derive(Clone, Default, PartialEq)]
10611#[non_exhaustive]
10612pub struct ResponsePolicyNetwork {
10613    #[allow(missing_docs)]
10614    pub kind: std::option::Option<std::string::String>,
10615
10616    /// The fully qualified URL of the VPC network to bind to. This should be formatted like `<https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}>`
10617    pub network_url: std::option::Option<std::string::String>,
10618
10619    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10620}
10621
10622impl ResponsePolicyNetwork {
10623    /// Creates a new default instance.
10624    pub fn new() -> Self {
10625        std::default::Default::default()
10626    }
10627
10628    /// Sets the value of [kind][crate::model::ResponsePolicyNetwork::kind].
10629    ///
10630    /// # Example
10631    /// ```ignore,no_run
10632    /// # use google_cloud_dns_v1::model::ResponsePolicyNetwork;
10633    /// let x = ResponsePolicyNetwork::new().set_kind("example");
10634    /// ```
10635    pub fn set_kind<T>(mut self, v: T) -> Self
10636    where
10637        T: std::convert::Into<std::string::String>,
10638    {
10639        self.kind = std::option::Option::Some(v.into());
10640        self
10641    }
10642
10643    /// Sets or clears the value of [kind][crate::model::ResponsePolicyNetwork::kind].
10644    ///
10645    /// # Example
10646    /// ```ignore,no_run
10647    /// # use google_cloud_dns_v1::model::ResponsePolicyNetwork;
10648    /// let x = ResponsePolicyNetwork::new().set_or_clear_kind(Some("example"));
10649    /// let x = ResponsePolicyNetwork::new().set_or_clear_kind(None::<String>);
10650    /// ```
10651    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
10652    where
10653        T: std::convert::Into<std::string::String>,
10654    {
10655        self.kind = v.map(|x| x.into());
10656        self
10657    }
10658
10659    /// Sets the value of [network_url][crate::model::ResponsePolicyNetwork::network_url].
10660    ///
10661    /// # Example
10662    /// ```ignore,no_run
10663    /// # use google_cloud_dns_v1::model::ResponsePolicyNetwork;
10664    /// let x = ResponsePolicyNetwork::new().set_network_url("example");
10665    /// ```
10666    pub fn set_network_url<T>(mut self, v: T) -> Self
10667    where
10668        T: std::convert::Into<std::string::String>,
10669    {
10670        self.network_url = std::option::Option::Some(v.into());
10671        self
10672    }
10673
10674    /// Sets or clears the value of [network_url][crate::model::ResponsePolicyNetwork::network_url].
10675    ///
10676    /// # Example
10677    /// ```ignore,no_run
10678    /// # use google_cloud_dns_v1::model::ResponsePolicyNetwork;
10679    /// let x = ResponsePolicyNetwork::new().set_or_clear_network_url(Some("example"));
10680    /// let x = ResponsePolicyNetwork::new().set_or_clear_network_url(None::<String>);
10681    /// ```
10682    pub fn set_or_clear_network_url<T>(mut self, v: std::option::Option<T>) -> Self
10683    where
10684        T: std::convert::Into<std::string::String>,
10685    {
10686        self.network_url = v.map(|x| x.into());
10687        self
10688    }
10689}
10690
10691impl wkt::message::Message for ResponsePolicyNetwork {
10692    fn typename() -> &'static str {
10693        "type.googleapis.com/.ResponsePolicyNetwork"
10694    }
10695}
10696
10697/// A Response Policy Rule is a selector that applies its behavior to queries that match the selector. Selectors are DNS names, which may be wildcards or exact matches. Each DNS query subject to a Response Policy matches at most one ResponsePolicyRule, as identified by the dns_name field with the longest matching suffix.
10698#[derive(Clone, Default, PartialEq)]
10699#[non_exhaustive]
10700pub struct ResponsePolicyRule {
10701    /// Answer this query with a behavior rather than DNS data.
10702    pub behavior: std::option::Option<crate::model::response_policy_rule::Behavior>,
10703
10704    /// The DNS name (wildcard or exact) to apply this rule to. Must be unique within the Response Policy Rule.
10705    pub dns_name: std::option::Option<std::string::String>,
10706
10707    #[allow(missing_docs)]
10708    pub kind: std::option::Option<std::string::String>,
10709
10710    /// Answer this query directly with DNS data. These ResourceRecordSets override any other DNS behavior for the matched name; in particular they override private zones, the public internet, and GCP internal DNS. No SOA nor NS types are allowed.
10711    pub local_data: std::option::Option<crate::model::ResponsePolicyRuleLocalData>,
10712
10713    /// An identifier for this rule. Must be unique with the ResponsePolicy.
10714    pub rule_name: std::option::Option<std::string::String>,
10715
10716    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10717}
10718
10719impl ResponsePolicyRule {
10720    /// Creates a new default instance.
10721    pub fn new() -> Self {
10722        std::default::Default::default()
10723    }
10724
10725    /// Sets the value of [behavior][crate::model::ResponsePolicyRule::behavior].
10726    ///
10727    /// # Example
10728    /// ```ignore,no_run
10729    /// # use google_cloud_dns_v1::model::ResponsePolicyRule;
10730    /// use google_cloud_dns_v1::model::response_policy_rule::Behavior;
10731    /// let x0 = ResponsePolicyRule::new().set_behavior(Behavior::BypassResponsePolicy);
10732    /// ```
10733    pub fn set_behavior<T>(mut self, v: T) -> Self
10734    where
10735        T: std::convert::Into<crate::model::response_policy_rule::Behavior>,
10736    {
10737        self.behavior = std::option::Option::Some(v.into());
10738        self
10739    }
10740
10741    /// Sets or clears the value of [behavior][crate::model::ResponsePolicyRule::behavior].
10742    ///
10743    /// # Example
10744    /// ```ignore,no_run
10745    /// # use google_cloud_dns_v1::model::ResponsePolicyRule;
10746    /// use google_cloud_dns_v1::model::response_policy_rule::Behavior;
10747    /// let x0 = ResponsePolicyRule::new().set_or_clear_behavior(Some(Behavior::BypassResponsePolicy));
10748    /// let x_none = ResponsePolicyRule::new().set_or_clear_behavior(None::<Behavior>);
10749    /// ```
10750    pub fn set_or_clear_behavior<T>(mut self, v: std::option::Option<T>) -> Self
10751    where
10752        T: std::convert::Into<crate::model::response_policy_rule::Behavior>,
10753    {
10754        self.behavior = v.map(|x| x.into());
10755        self
10756    }
10757
10758    /// Sets the value of [dns_name][crate::model::ResponsePolicyRule::dns_name].
10759    ///
10760    /// # Example
10761    /// ```ignore,no_run
10762    /// # use google_cloud_dns_v1::model::ResponsePolicyRule;
10763    /// let x = ResponsePolicyRule::new().set_dns_name("example");
10764    /// ```
10765    pub fn set_dns_name<T>(mut self, v: T) -> Self
10766    where
10767        T: std::convert::Into<std::string::String>,
10768    {
10769        self.dns_name = std::option::Option::Some(v.into());
10770        self
10771    }
10772
10773    /// Sets or clears the value of [dns_name][crate::model::ResponsePolicyRule::dns_name].
10774    ///
10775    /// # Example
10776    /// ```ignore,no_run
10777    /// # use google_cloud_dns_v1::model::ResponsePolicyRule;
10778    /// let x = ResponsePolicyRule::new().set_or_clear_dns_name(Some("example"));
10779    /// let x = ResponsePolicyRule::new().set_or_clear_dns_name(None::<String>);
10780    /// ```
10781    pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
10782    where
10783        T: std::convert::Into<std::string::String>,
10784    {
10785        self.dns_name = v.map(|x| x.into());
10786        self
10787    }
10788
10789    /// Sets the value of [kind][crate::model::ResponsePolicyRule::kind].
10790    ///
10791    /// # Example
10792    /// ```ignore,no_run
10793    /// # use google_cloud_dns_v1::model::ResponsePolicyRule;
10794    /// let x = ResponsePolicyRule::new().set_kind("example");
10795    /// ```
10796    pub fn set_kind<T>(mut self, v: T) -> Self
10797    where
10798        T: std::convert::Into<std::string::String>,
10799    {
10800        self.kind = std::option::Option::Some(v.into());
10801        self
10802    }
10803
10804    /// Sets or clears the value of [kind][crate::model::ResponsePolicyRule::kind].
10805    ///
10806    /// # Example
10807    /// ```ignore,no_run
10808    /// # use google_cloud_dns_v1::model::ResponsePolicyRule;
10809    /// let x = ResponsePolicyRule::new().set_or_clear_kind(Some("example"));
10810    /// let x = ResponsePolicyRule::new().set_or_clear_kind(None::<String>);
10811    /// ```
10812    pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
10813    where
10814        T: std::convert::Into<std::string::String>,
10815    {
10816        self.kind = v.map(|x| x.into());
10817        self
10818    }
10819
10820    /// Sets the value of [local_data][crate::model::ResponsePolicyRule::local_data].
10821    ///
10822    /// # Example
10823    /// ```ignore,no_run
10824    /// # use google_cloud_dns_v1::model::ResponsePolicyRule;
10825    /// use google_cloud_dns_v1::model::ResponsePolicyRuleLocalData;
10826    /// let x = ResponsePolicyRule::new().set_local_data(ResponsePolicyRuleLocalData::default()/* use setters */);
10827    /// ```
10828    pub fn set_local_data<T>(mut self, v: T) -> Self
10829    where
10830        T: std::convert::Into<crate::model::ResponsePolicyRuleLocalData>,
10831    {
10832        self.local_data = std::option::Option::Some(v.into());
10833        self
10834    }
10835
10836    /// Sets or clears the value of [local_data][crate::model::ResponsePolicyRule::local_data].
10837    ///
10838    /// # Example
10839    /// ```ignore,no_run
10840    /// # use google_cloud_dns_v1::model::ResponsePolicyRule;
10841    /// use google_cloud_dns_v1::model::ResponsePolicyRuleLocalData;
10842    /// let x = ResponsePolicyRule::new().set_or_clear_local_data(Some(ResponsePolicyRuleLocalData::default()/* use setters */));
10843    /// let x = ResponsePolicyRule::new().set_or_clear_local_data(None::<ResponsePolicyRuleLocalData>);
10844    /// ```
10845    pub fn set_or_clear_local_data<T>(mut self, v: std::option::Option<T>) -> Self
10846    where
10847        T: std::convert::Into<crate::model::ResponsePolicyRuleLocalData>,
10848    {
10849        self.local_data = v.map(|x| x.into());
10850        self
10851    }
10852
10853    /// Sets the value of [rule_name][crate::model::ResponsePolicyRule::rule_name].
10854    ///
10855    /// # Example
10856    /// ```ignore,no_run
10857    /// # use google_cloud_dns_v1::model::ResponsePolicyRule;
10858    /// let x = ResponsePolicyRule::new().set_rule_name("example");
10859    /// ```
10860    pub fn set_rule_name<T>(mut self, v: T) -> Self
10861    where
10862        T: std::convert::Into<std::string::String>,
10863    {
10864        self.rule_name = std::option::Option::Some(v.into());
10865        self
10866    }
10867
10868    /// Sets or clears the value of [rule_name][crate::model::ResponsePolicyRule::rule_name].
10869    ///
10870    /// # Example
10871    /// ```ignore,no_run
10872    /// # use google_cloud_dns_v1::model::ResponsePolicyRule;
10873    /// let x = ResponsePolicyRule::new().set_or_clear_rule_name(Some("example"));
10874    /// let x = ResponsePolicyRule::new().set_or_clear_rule_name(None::<String>);
10875    /// ```
10876    pub fn set_or_clear_rule_name<T>(mut self, v: std::option::Option<T>) -> Self
10877    where
10878        T: std::convert::Into<std::string::String>,
10879    {
10880        self.rule_name = v.map(|x| x.into());
10881        self
10882    }
10883}
10884
10885impl wkt::message::Message for ResponsePolicyRule {
10886    fn typename() -> &'static str {
10887        "type.googleapis.com/.ResponsePolicyRule"
10888    }
10889}
10890
10891/// Defines additional types related to [ResponsePolicyRule].
10892pub mod response_policy_rule {
10893    #[allow(unused_imports)]
10894    use super::*;
10895
10896    /// The enumerated type for the [behavior][.ResponsePolicyRule.behavior] field.
10897    ///
10898    /// # Working with unknown values
10899    ///
10900    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10901    /// additional enum variants at any time. Adding new variants is not considered
10902    /// a breaking change. Applications should write their code in anticipation of:
10903    ///
10904    /// - New values appearing in future releases of the client library, **and**
10905    /// - New values received dynamically, without application changes.
10906    ///
10907    /// Please consult the [Working with enums] section in the user guide for some
10908    /// guidelines.
10909    ///
10910    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10911    #[derive(Clone, Debug, PartialEq)]
10912    #[non_exhaustive]
10913    pub enum Behavior {
10914        #[allow(missing_docs)]
10915        BehaviorUnspecified,
10916        /// Skip a less-specific Response Policy Rule and let the query logic continue. This mechanism, when used with wildcard selectors, lets you exempt specific subdomains from a broader Response Policy Rule and direct the queries to the public internet instead. For example, if the following rules exist: ``` *.example.com -> LocalData 1.2.3.4 foo.example.com -> Behavior 'passthrough' ``` A query for foo.example.com skips the wildcard rule. This functionality also facilitates allowlisting. Response Policy Zones (RPZs) can be applied at multiple levels within the hierarchy: for example, an organization, a folder, a project, or a VPC network. If an RPZ rule is applied at a higher level, adding a `passthrough` rule at a lower level will override it. Queries from affected virtual machines (VMs) to that domain bypass the RPZ and proceed with normal resolution.
10917        BypassResponsePolicy,
10918        /// If set, the enum was initialized with an unknown value.
10919        ///
10920        /// Applications can examine the value using [Behavior::name].
10921        UnknownValue(behavior::UnknownValue),
10922    }
10923
10924    #[doc(hidden)]
10925    pub mod behavior {
10926        #[allow(unused_imports)]
10927        use super::*;
10928        #[derive(Clone, Debug, PartialEq)]
10929        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10930    }
10931
10932    impl Behavior {
10933        /// Gets the enum value as a string.
10934        pub fn name(&self) -> std::option::Option<&str> {
10935            match self {
10936                Self::BehaviorUnspecified => std::option::Option::Some("behaviorUnspecified"),
10937                Self::BypassResponsePolicy => std::option::Option::Some("bypassResponsePolicy"),
10938                Self::UnknownValue(u) => u.0.name(),
10939            }
10940        }
10941    }
10942
10943    impl std::fmt::Display for Behavior {
10944        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10945            wkt::internal::display_enum(f, self.name(), std::option::Option::None)
10946        }
10947    }
10948
10949    impl std::convert::From<&str> for Behavior {
10950        fn from(value: &str) -> Self {
10951            use std::string::ToString;
10952            match value {
10953                "behaviorUnspecified" => Self::BehaviorUnspecified,
10954                "bypassResponsePolicy" => Self::BypassResponsePolicy,
10955                _ => Self::UnknownValue(behavior::UnknownValue(
10956                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10957                )),
10958            }
10959        }
10960    }
10961
10962    impl serde::ser::Serialize for Behavior {
10963        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10964        where
10965            S: serde::Serializer,
10966        {
10967            match self {
10968                Self::BehaviorUnspecified => serializer.serialize_str("behaviorUnspecified"),
10969                Self::BypassResponsePolicy => serializer.serialize_str("bypassResponsePolicy"),
10970                Self::UnknownValue(u) => u.0.serialize(serializer),
10971            }
10972        }
10973    }
10974
10975    impl<'de> serde::de::Deserialize<'de> for Behavior {
10976        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10977        where
10978            D: serde::Deserializer<'de>,
10979        {
10980            deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<Behavior>::new(
10981                "..ResponsePolicyRule.behavior",
10982            ))
10983        }
10984    }
10985}
10986
10987#[allow(missing_docs)]
10988#[derive(Clone, Default, PartialEq)]
10989#[non_exhaustive]
10990pub struct ResponsePolicyRuleLocalData {
10991    /// All resource record sets for this selector, one per resource record type. The name must match the dns_name.
10992    pub local_datas: std::vec::Vec<crate::model::ResourceRecordSet>,
10993
10994    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10995}
10996
10997impl ResponsePolicyRuleLocalData {
10998    /// Creates a new default instance.
10999    pub fn new() -> Self {
11000        std::default::Default::default()
11001    }
11002
11003    /// Sets the value of [local_datas][crate::model::ResponsePolicyRuleLocalData::local_datas].
11004    ///
11005    /// # Example
11006    /// ```ignore,no_run
11007    /// # use google_cloud_dns_v1::model::ResponsePolicyRuleLocalData;
11008    /// use google_cloud_dns_v1::model::ResourceRecordSet;
11009    /// let x = ResponsePolicyRuleLocalData::new()
11010    ///     .set_local_datas([
11011    ///         ResourceRecordSet::default()/* use setters */,
11012    ///         ResourceRecordSet::default()/* use (different) setters */,
11013    ///     ]);
11014    /// ```
11015    pub fn set_local_datas<T, V>(mut self, v: T) -> Self
11016    where
11017        T: std::iter::IntoIterator<Item = V>,
11018        V: std::convert::Into<crate::model::ResourceRecordSet>,
11019    {
11020        use std::iter::Iterator;
11021        self.local_datas = v.into_iter().map(|i| i.into()).collect();
11022        self
11023    }
11024}
11025
11026impl wkt::message::Message for ResponsePolicyRuleLocalData {
11027    fn typename() -> &'static str {
11028        "type.googleapis.com/.ResponsePolicyRuleLocalData"
11029    }
11030}
11031
11032#[allow(missing_docs)]
11033#[derive(Clone, Default, PartialEq)]
11034#[non_exhaustive]
11035pub struct ResponsePolicyRulesListResponse {
11036    /// This field indicates that more results are available beyond the last page displayed. To fetch the results, make another list request and use this value as your page token. This lets you retrieve the complete contents of a very large collection one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned are an inconsistent view of the collection. You can't retrieve a consistent snapshot of a collection larger than the maximum page size.
11037    pub next_page_token: std::option::Option<std::string::String>,
11038
11039    /// The Response Policy Rule resources.
11040    pub response_policy_rules: std::vec::Vec<crate::model::ResponsePolicyRule>,
11041
11042    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11043}
11044
11045impl ResponsePolicyRulesListResponse {
11046    /// Creates a new default instance.
11047    pub fn new() -> Self {
11048        std::default::Default::default()
11049    }
11050
11051    /// Sets the value of [next_page_token][crate::model::ResponsePolicyRulesListResponse::next_page_token].
11052    ///
11053    /// # Example
11054    /// ```ignore,no_run
11055    /// # use google_cloud_dns_v1::model::ResponsePolicyRulesListResponse;
11056    /// let x = ResponsePolicyRulesListResponse::new().set_next_page_token("example");
11057    /// ```
11058    pub fn set_next_page_token<T>(mut self, v: T) -> Self
11059    where
11060        T: std::convert::Into<std::string::String>,
11061    {
11062        self.next_page_token = std::option::Option::Some(v.into());
11063        self
11064    }
11065
11066    /// Sets or clears the value of [next_page_token][crate::model::ResponsePolicyRulesListResponse::next_page_token].
11067    ///
11068    /// # Example
11069    /// ```ignore,no_run
11070    /// # use google_cloud_dns_v1::model::ResponsePolicyRulesListResponse;
11071    /// let x = ResponsePolicyRulesListResponse::new().set_or_clear_next_page_token(Some("example"));
11072    /// let x = ResponsePolicyRulesListResponse::new().set_or_clear_next_page_token(None::<String>);
11073    /// ```
11074    pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
11075    where
11076        T: std::convert::Into<std::string::String>,
11077    {
11078        self.next_page_token = v.map(|x| x.into());
11079        self
11080    }
11081
11082    /// Sets the value of [response_policy_rules][crate::model::ResponsePolicyRulesListResponse::response_policy_rules].
11083    ///
11084    /// # Example
11085    /// ```ignore,no_run
11086    /// # use google_cloud_dns_v1::model::ResponsePolicyRulesListResponse;
11087    /// use google_cloud_dns_v1::model::ResponsePolicyRule;
11088    /// let x = ResponsePolicyRulesListResponse::new()
11089    ///     .set_response_policy_rules([
11090    ///         ResponsePolicyRule::default()/* use setters */,
11091    ///         ResponsePolicyRule::default()/* use (different) setters */,
11092    ///     ]);
11093    /// ```
11094    pub fn set_response_policy_rules<T, V>(mut self, v: T) -> Self
11095    where
11096        T: std::iter::IntoIterator<Item = V>,
11097        V: std::convert::Into<crate::model::ResponsePolicyRule>,
11098    {
11099        use std::iter::Iterator;
11100        self.response_policy_rules = v.into_iter().map(|i| i.into()).collect();
11101        self
11102    }
11103}
11104
11105impl wkt::message::Message for ResponsePolicyRulesListResponse {
11106    fn typename() -> &'static str {
11107        "type.googleapis.com/.ResponsePolicyRulesListResponse"
11108    }
11109}
11110
11111#[doc(hidden)]
11112impl google_cloud_gax::paginator::internal::PageableResponse for ResponsePolicyRulesListResponse {
11113    type PageItem = crate::model::ResponsePolicyRule;
11114
11115    fn items(self) -> std::vec::Vec<Self::PageItem> {
11116        self.response_policy_rules
11117    }
11118
11119    fn next_page_token(&self) -> std::string::String {
11120        use std::clone::Clone;
11121        self.next_page_token.clone().unwrap_or_default()
11122    }
11123}
11124
11125#[allow(missing_docs)]
11126#[derive(Clone, Default, PartialEq)]
11127#[non_exhaustive]
11128pub struct ResponsePolicyRulesPatchResponse {
11129    #[allow(missing_docs)]
11130    pub response_policy_rule: std::option::Option<crate::model::ResponsePolicyRule>,
11131
11132    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11133}
11134
11135impl ResponsePolicyRulesPatchResponse {
11136    /// Creates a new default instance.
11137    pub fn new() -> Self {
11138        std::default::Default::default()
11139    }
11140
11141    /// Sets the value of [response_policy_rule][crate::model::ResponsePolicyRulesPatchResponse::response_policy_rule].
11142    ///
11143    /// # Example
11144    /// ```ignore,no_run
11145    /// # use google_cloud_dns_v1::model::ResponsePolicyRulesPatchResponse;
11146    /// use google_cloud_dns_v1::model::ResponsePolicyRule;
11147    /// let x = ResponsePolicyRulesPatchResponse::new().set_response_policy_rule(ResponsePolicyRule::default()/* use setters */);
11148    /// ```
11149    pub fn set_response_policy_rule<T>(mut self, v: T) -> Self
11150    where
11151        T: std::convert::Into<crate::model::ResponsePolicyRule>,
11152    {
11153        self.response_policy_rule = std::option::Option::Some(v.into());
11154        self
11155    }
11156
11157    /// Sets or clears the value of [response_policy_rule][crate::model::ResponsePolicyRulesPatchResponse::response_policy_rule].
11158    ///
11159    /// # Example
11160    /// ```ignore,no_run
11161    /// # use google_cloud_dns_v1::model::ResponsePolicyRulesPatchResponse;
11162    /// use google_cloud_dns_v1::model::ResponsePolicyRule;
11163    /// let x = ResponsePolicyRulesPatchResponse::new().set_or_clear_response_policy_rule(Some(ResponsePolicyRule::default()/* use setters */));
11164    /// let x = ResponsePolicyRulesPatchResponse::new().set_or_clear_response_policy_rule(None::<ResponsePolicyRule>);
11165    /// ```
11166    pub fn set_or_clear_response_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
11167    where
11168        T: std::convert::Into<crate::model::ResponsePolicyRule>,
11169    {
11170        self.response_policy_rule = v.map(|x| x.into());
11171        self
11172    }
11173}
11174
11175impl wkt::message::Message for ResponsePolicyRulesPatchResponse {
11176    fn typename() -> &'static str {
11177        "type.googleapis.com/.ResponsePolicyRulesPatchResponse"
11178    }
11179}
11180
11181#[allow(missing_docs)]
11182#[derive(Clone, Default, PartialEq)]
11183#[non_exhaustive]
11184pub struct ResponsePolicyRulesUpdateResponse {
11185    #[allow(missing_docs)]
11186    pub response_policy_rule: std::option::Option<crate::model::ResponsePolicyRule>,
11187
11188    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11189}
11190
11191impl ResponsePolicyRulesUpdateResponse {
11192    /// Creates a new default instance.
11193    pub fn new() -> Self {
11194        std::default::Default::default()
11195    }
11196
11197    /// Sets the value of [response_policy_rule][crate::model::ResponsePolicyRulesUpdateResponse::response_policy_rule].
11198    ///
11199    /// # Example
11200    /// ```ignore,no_run
11201    /// # use google_cloud_dns_v1::model::ResponsePolicyRulesUpdateResponse;
11202    /// use google_cloud_dns_v1::model::ResponsePolicyRule;
11203    /// let x = ResponsePolicyRulesUpdateResponse::new().set_response_policy_rule(ResponsePolicyRule::default()/* use setters */);
11204    /// ```
11205    pub fn set_response_policy_rule<T>(mut self, v: T) -> Self
11206    where
11207        T: std::convert::Into<crate::model::ResponsePolicyRule>,
11208    {
11209        self.response_policy_rule = std::option::Option::Some(v.into());
11210        self
11211    }
11212
11213    /// Sets or clears the value of [response_policy_rule][crate::model::ResponsePolicyRulesUpdateResponse::response_policy_rule].
11214    ///
11215    /// # Example
11216    /// ```ignore,no_run
11217    /// # use google_cloud_dns_v1::model::ResponsePolicyRulesUpdateResponse;
11218    /// use google_cloud_dns_v1::model::ResponsePolicyRule;
11219    /// let x = ResponsePolicyRulesUpdateResponse::new().set_or_clear_response_policy_rule(Some(ResponsePolicyRule::default()/* use setters */));
11220    /// let x = ResponsePolicyRulesUpdateResponse::new().set_or_clear_response_policy_rule(None::<ResponsePolicyRule>);
11221    /// ```
11222    pub fn set_or_clear_response_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
11223    where
11224        T: std::convert::Into<crate::model::ResponsePolicyRule>,
11225    {
11226        self.response_policy_rule = v.map(|x| x.into());
11227        self
11228    }
11229}
11230
11231impl wkt::message::Message for ResponsePolicyRulesUpdateResponse {
11232    fn typename() -> &'static str {
11233        "type.googleapis.com/.ResponsePolicyRulesUpdateResponse"
11234    }
11235}
11236
11237/// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
11238#[derive(Clone, Default, PartialEq)]
11239#[non_exhaustive]
11240pub struct Status {
11241    /// The status code, which should be an enum value of google.rpc.Code.
11242    pub code: std::option::Option<i32>,
11243
11244    /// A list of messages that carry the error details. There is a common set of message types for APIs to use.
11245    pub details: std::vec::Vec<wkt::Any>,
11246
11247    /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
11248    pub message: std::option::Option<std::string::String>,
11249
11250    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11251}
11252
11253impl Status {
11254    /// Creates a new default instance.
11255    pub fn new() -> Self {
11256        std::default::Default::default()
11257    }
11258
11259    /// Sets the value of [code][crate::model::Status::code].
11260    ///
11261    /// # Example
11262    /// ```ignore,no_run
11263    /// # use google_cloud_dns_v1::model::Status;
11264    /// let x = Status::new().set_code(42);
11265    /// ```
11266    pub fn set_code<T>(mut self, v: T) -> Self
11267    where
11268        T: std::convert::Into<i32>,
11269    {
11270        self.code = std::option::Option::Some(v.into());
11271        self
11272    }
11273
11274    /// Sets or clears the value of [code][crate::model::Status::code].
11275    ///
11276    /// # Example
11277    /// ```ignore,no_run
11278    /// # use google_cloud_dns_v1::model::Status;
11279    /// let x = Status::new().set_or_clear_code(Some(42));
11280    /// let x = Status::new().set_or_clear_code(None::<i32>);
11281    /// ```
11282    pub fn set_or_clear_code<T>(mut self, v: std::option::Option<T>) -> Self
11283    where
11284        T: std::convert::Into<i32>,
11285    {
11286        self.code = v.map(|x| x.into());
11287        self
11288    }
11289
11290    /// Sets the value of [details][crate::model::Status::details].
11291    ///
11292    /// # Example
11293    /// ```ignore,no_run
11294    /// # use google_cloud_dns_v1::model::Status;
11295    /// use wkt::Any;
11296    /// let x = Status::new()
11297    ///     .set_details([
11298    ///         Any::default()/* use setters */,
11299    ///         Any::default()/* use (different) setters */,
11300    ///     ]);
11301    /// ```
11302    pub fn set_details<T, V>(mut self, v: T) -> Self
11303    where
11304        T: std::iter::IntoIterator<Item = V>,
11305        V: std::convert::Into<wkt::Any>,
11306    {
11307        use std::iter::Iterator;
11308        self.details = v.into_iter().map(|i| i.into()).collect();
11309        self
11310    }
11311
11312    /// Sets the value of [message][crate::model::Status::message].
11313    ///
11314    /// # Example
11315    /// ```ignore,no_run
11316    /// # use google_cloud_dns_v1::model::Status;
11317    /// let x = Status::new().set_message("example");
11318    /// ```
11319    pub fn set_message<T>(mut self, v: T) -> Self
11320    where
11321        T: std::convert::Into<std::string::String>,
11322    {
11323        self.message = std::option::Option::Some(v.into());
11324        self
11325    }
11326
11327    /// Sets or clears the value of [message][crate::model::Status::message].
11328    ///
11329    /// # Example
11330    /// ```ignore,no_run
11331    /// # use google_cloud_dns_v1::model::Status;
11332    /// let x = Status::new().set_or_clear_message(Some("example"));
11333    /// let x = Status::new().set_or_clear_message(None::<String>);
11334    /// ```
11335    pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
11336    where
11337        T: std::convert::Into<std::string::String>,
11338    {
11339        self.message = v.map(|x| x.into());
11340        self
11341    }
11342}
11343
11344impl wkt::message::Message for Status {
11345    fn typename() -> &'static str {
11346        "type.googleapis.com/.Status"
11347    }
11348}
11349
11350/// Synthetic messages for the [changes][.changes] service
11351pub mod changes {
11352    #[allow(unused_imports)]
11353    use super::*;
11354
11355    /// Synthetic request message for the [create()][.changes.create] method.
11356    #[derive(Clone, Default, PartialEq)]
11357    #[non_exhaustive]
11358    pub struct CreateRequest {
11359        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
11360        pub client_operation_id: std::option::Option<std::string::String>,
11361
11362        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
11363        pub managed_zone: std::string::String,
11364
11365        /// Identifies the project addressed by this request.
11366        pub project: std::string::String,
11367
11368        /// Synthetic request body field for the [create()][.changes.create] method.
11369        pub body: std::option::Option<crate::model::Change>,
11370
11371        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11372    }
11373
11374    impl CreateRequest {
11375        /// Creates a new default instance.
11376        pub fn new() -> Self {
11377            std::default::Default::default()
11378        }
11379
11380        /// Sets the value of [client_operation_id][crate::model::changes::CreateRequest::client_operation_id].
11381        ///
11382        /// # Example
11383        /// ```ignore,no_run
11384        /// # use google_cloud_dns_v1::model::changes::CreateRequest;
11385        /// let x = CreateRequest::new().set_client_operation_id("example");
11386        /// ```
11387        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
11388        where
11389            T: std::convert::Into<std::string::String>,
11390        {
11391            self.client_operation_id = std::option::Option::Some(v.into());
11392            self
11393        }
11394
11395        /// Sets or clears the value of [client_operation_id][crate::model::changes::CreateRequest::client_operation_id].
11396        ///
11397        /// # Example
11398        /// ```ignore,no_run
11399        /// # use google_cloud_dns_v1::model::changes::CreateRequest;
11400        /// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
11401        /// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
11402        /// ```
11403        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
11404        where
11405            T: std::convert::Into<std::string::String>,
11406        {
11407            self.client_operation_id = v.map(|x| x.into());
11408            self
11409        }
11410
11411        /// Sets the value of [managed_zone][crate::model::changes::CreateRequest::managed_zone].
11412        ///
11413        /// # Example
11414        /// ```ignore,no_run
11415        /// # use google_cloud_dns_v1::model::changes::CreateRequest;
11416        /// let x = CreateRequest::new().set_managed_zone("example");
11417        /// ```
11418        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
11419            mut self,
11420            v: T,
11421        ) -> Self {
11422            self.managed_zone = v.into();
11423            self
11424        }
11425
11426        /// Sets the value of [project][crate::model::changes::CreateRequest::project].
11427        ///
11428        /// # Example
11429        /// ```ignore,no_run
11430        /// # use google_cloud_dns_v1::model::changes::CreateRequest;
11431        /// let x = CreateRequest::new().set_project("example");
11432        /// ```
11433        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11434            self.project = v.into();
11435            self
11436        }
11437
11438        /// Sets the value of [body][crate::model::changes::CreateRequest::body].
11439        ///
11440        /// # Example
11441        /// ```ignore,no_run
11442        /// # use google_cloud_dns_v1::model::changes::CreateRequest;
11443        /// use google_cloud_dns_v1::model::Change;
11444        /// let x = CreateRequest::new().set_body(Change::default()/* use setters */);
11445        /// ```
11446        pub fn set_body<T>(mut self, v: T) -> Self
11447        where
11448            T: std::convert::Into<crate::model::Change>,
11449        {
11450            self.body = std::option::Option::Some(v.into());
11451            self
11452        }
11453
11454        /// Sets or clears the value of [body][crate::model::changes::CreateRequest::body].
11455        ///
11456        /// # Example
11457        /// ```ignore,no_run
11458        /// # use google_cloud_dns_v1::model::changes::CreateRequest;
11459        /// use google_cloud_dns_v1::model::Change;
11460        /// let x = CreateRequest::new().set_or_clear_body(Some(Change::default()/* use setters */));
11461        /// let x = CreateRequest::new().set_or_clear_body(None::<Change>);
11462        /// ```
11463        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11464        where
11465            T: std::convert::Into<crate::model::Change>,
11466        {
11467            self.body = v.map(|x| x.into());
11468            self
11469        }
11470    }
11471
11472    /// Synthetic request message for the [get()][.changes.get] method.
11473    #[derive(Clone, Default, PartialEq)]
11474    #[non_exhaustive]
11475    pub struct GetRequest {
11476        /// The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.
11477        pub change_id: std::string::String,
11478
11479        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
11480        pub client_operation_id: std::option::Option<std::string::String>,
11481
11482        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
11483        pub managed_zone: std::string::String,
11484
11485        /// Identifies the project addressed by this request.
11486        pub project: std::string::String,
11487
11488        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11489    }
11490
11491    impl GetRequest {
11492        /// Creates a new default instance.
11493        pub fn new() -> Self {
11494            std::default::Default::default()
11495        }
11496
11497        /// Sets the value of [change_id][crate::model::changes::GetRequest::change_id].
11498        ///
11499        /// # Example
11500        /// ```ignore,no_run
11501        /// # use google_cloud_dns_v1::model::changes::GetRequest;
11502        /// let x = GetRequest::new().set_change_id("example");
11503        /// ```
11504        pub fn set_change_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11505            self.change_id = v.into();
11506            self
11507        }
11508
11509        /// Sets the value of [client_operation_id][crate::model::changes::GetRequest::client_operation_id].
11510        ///
11511        /// # Example
11512        /// ```ignore,no_run
11513        /// # use google_cloud_dns_v1::model::changes::GetRequest;
11514        /// let x = GetRequest::new().set_client_operation_id("example");
11515        /// ```
11516        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
11517        where
11518            T: std::convert::Into<std::string::String>,
11519        {
11520            self.client_operation_id = std::option::Option::Some(v.into());
11521            self
11522        }
11523
11524        /// Sets or clears the value of [client_operation_id][crate::model::changes::GetRequest::client_operation_id].
11525        ///
11526        /// # Example
11527        /// ```ignore,no_run
11528        /// # use google_cloud_dns_v1::model::changes::GetRequest;
11529        /// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
11530        /// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
11531        /// ```
11532        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
11533        where
11534            T: std::convert::Into<std::string::String>,
11535        {
11536            self.client_operation_id = v.map(|x| x.into());
11537            self
11538        }
11539
11540        /// Sets the value of [managed_zone][crate::model::changes::GetRequest::managed_zone].
11541        ///
11542        /// # Example
11543        /// ```ignore,no_run
11544        /// # use google_cloud_dns_v1::model::changes::GetRequest;
11545        /// let x = GetRequest::new().set_managed_zone("example");
11546        /// ```
11547        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
11548            mut self,
11549            v: T,
11550        ) -> Self {
11551            self.managed_zone = v.into();
11552            self
11553        }
11554
11555        /// Sets the value of [project][crate::model::changes::GetRequest::project].
11556        ///
11557        /// # Example
11558        /// ```ignore,no_run
11559        /// # use google_cloud_dns_v1::model::changes::GetRequest;
11560        /// let x = GetRequest::new().set_project("example");
11561        /// ```
11562        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11563            self.project = v.into();
11564            self
11565        }
11566    }
11567
11568    /// Synthetic request message for the [list()][.changes.list] method.
11569    #[derive(Clone, Default, PartialEq)]
11570    #[non_exhaustive]
11571    pub struct ListRequest {
11572        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
11573        pub managed_zone: std::string::String,
11574
11575        /// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
11576        pub max_results: std::option::Option<i32>,
11577
11578        /// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
11579        pub page_token: std::option::Option<std::string::String>,
11580
11581        /// Identifies the project addressed by this request.
11582        pub project: std::string::String,
11583
11584        /// Sorting criterion. The only supported value is change sequence.
11585        pub sort_by: std::option::Option<crate::model::changes::list_request::SortBy>,
11586
11587        /// Sorting order direction: 'ascending' or 'descending'.
11588        pub sort_order: std::option::Option<std::string::String>,
11589
11590        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11591    }
11592
11593    impl ListRequest {
11594        /// Creates a new default instance.
11595        pub fn new() -> Self {
11596            std::default::Default::default()
11597        }
11598
11599        /// Sets the value of [managed_zone][crate::model::changes::ListRequest::managed_zone].
11600        ///
11601        /// # Example
11602        /// ```ignore,no_run
11603        /// # use google_cloud_dns_v1::model::changes::ListRequest;
11604        /// let x = ListRequest::new().set_managed_zone("example");
11605        /// ```
11606        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
11607            mut self,
11608            v: T,
11609        ) -> Self {
11610            self.managed_zone = v.into();
11611            self
11612        }
11613
11614        /// Sets the value of [max_results][crate::model::changes::ListRequest::max_results].
11615        ///
11616        /// # Example
11617        /// ```ignore,no_run
11618        /// # use google_cloud_dns_v1::model::changes::ListRequest;
11619        /// let x = ListRequest::new().set_max_results(42);
11620        /// ```
11621        pub fn set_max_results<T>(mut self, v: T) -> Self
11622        where
11623            T: std::convert::Into<i32>,
11624        {
11625            self.max_results = std::option::Option::Some(v.into());
11626            self
11627        }
11628
11629        /// Sets or clears the value of [max_results][crate::model::changes::ListRequest::max_results].
11630        ///
11631        /// # Example
11632        /// ```ignore,no_run
11633        /// # use google_cloud_dns_v1::model::changes::ListRequest;
11634        /// let x = ListRequest::new().set_or_clear_max_results(Some(42));
11635        /// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
11636        /// ```
11637        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
11638        where
11639            T: std::convert::Into<i32>,
11640        {
11641            self.max_results = v.map(|x| x.into());
11642            self
11643        }
11644
11645        /// Sets the value of [page_token][crate::model::changes::ListRequest::page_token].
11646        ///
11647        /// # Example
11648        /// ```ignore,no_run
11649        /// # use google_cloud_dns_v1::model::changes::ListRequest;
11650        /// let x = ListRequest::new().set_page_token("example");
11651        /// ```
11652        pub fn set_page_token<T>(mut self, v: T) -> Self
11653        where
11654            T: std::convert::Into<std::string::String>,
11655        {
11656            self.page_token = std::option::Option::Some(v.into());
11657            self
11658        }
11659
11660        /// Sets or clears the value of [page_token][crate::model::changes::ListRequest::page_token].
11661        ///
11662        /// # Example
11663        /// ```ignore,no_run
11664        /// # use google_cloud_dns_v1::model::changes::ListRequest;
11665        /// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
11666        /// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
11667        /// ```
11668        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
11669        where
11670            T: std::convert::Into<std::string::String>,
11671        {
11672            self.page_token = v.map(|x| x.into());
11673            self
11674        }
11675
11676        /// Sets the value of [project][crate::model::changes::ListRequest::project].
11677        ///
11678        /// # Example
11679        /// ```ignore,no_run
11680        /// # use google_cloud_dns_v1::model::changes::ListRequest;
11681        /// let x = ListRequest::new().set_project("example");
11682        /// ```
11683        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11684            self.project = v.into();
11685            self
11686        }
11687
11688        /// Sets the value of [sort_by][crate::model::changes::ListRequest::sort_by].
11689        ///
11690        /// # Example
11691        /// ```ignore,no_run
11692        /// # use google_cloud_dns_v1::model::changes::ListRequest;
11693        /// use google_cloud_dns_v1::model::changes::list_request::SortBy;
11694        /// let x0 = ListRequest::new().set_sort_by(SortBy::ChangeSequence);
11695        /// ```
11696        pub fn set_sort_by<T>(mut self, v: T) -> Self
11697        where
11698            T: std::convert::Into<crate::model::changes::list_request::SortBy>,
11699        {
11700            self.sort_by = std::option::Option::Some(v.into());
11701            self
11702        }
11703
11704        /// Sets or clears the value of [sort_by][crate::model::changes::ListRequest::sort_by].
11705        ///
11706        /// # Example
11707        /// ```ignore,no_run
11708        /// # use google_cloud_dns_v1::model::changes::ListRequest;
11709        /// use google_cloud_dns_v1::model::changes::list_request::SortBy;
11710        /// let x0 = ListRequest::new().set_or_clear_sort_by(Some(SortBy::ChangeSequence));
11711        /// let x_none = ListRequest::new().set_or_clear_sort_by(None::<SortBy>);
11712        /// ```
11713        pub fn set_or_clear_sort_by<T>(mut self, v: std::option::Option<T>) -> Self
11714        where
11715            T: std::convert::Into<crate::model::changes::list_request::SortBy>,
11716        {
11717            self.sort_by = v.map(|x| x.into());
11718            self
11719        }
11720
11721        /// Sets the value of [sort_order][crate::model::changes::ListRequest::sort_order].
11722        ///
11723        /// # Example
11724        /// ```ignore,no_run
11725        /// # use google_cloud_dns_v1::model::changes::ListRequest;
11726        /// let x = ListRequest::new().set_sort_order("example");
11727        /// ```
11728        pub fn set_sort_order<T>(mut self, v: T) -> Self
11729        where
11730            T: std::convert::Into<std::string::String>,
11731        {
11732            self.sort_order = std::option::Option::Some(v.into());
11733            self
11734        }
11735
11736        /// Sets or clears the value of [sort_order][crate::model::changes::ListRequest::sort_order].
11737        ///
11738        /// # Example
11739        /// ```ignore,no_run
11740        /// # use google_cloud_dns_v1::model::changes::ListRequest;
11741        /// let x = ListRequest::new().set_or_clear_sort_order(Some("example"));
11742        /// let x = ListRequest::new().set_or_clear_sort_order(None::<String>);
11743        /// ```
11744        pub fn set_or_clear_sort_order<T>(mut self, v: std::option::Option<T>) -> Self
11745        where
11746            T: std::convert::Into<std::string::String>,
11747        {
11748            self.sort_order = v.map(|x| x.into());
11749            self
11750        }
11751    }
11752
11753    /// Defines additional types related to [ListRequest].
11754    pub mod list_request {
11755        #[allow(unused_imports)]
11756        use super::*;
11757
11758        /// The enumerated type for the [sortBy][.changes.listRequest.sortBy] field.
11759        ///
11760        /// # Working with unknown values
11761        ///
11762        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11763        /// additional enum variants at any time. Adding new variants is not considered
11764        /// a breaking change. Applications should write their code in anticipation of:
11765        ///
11766        /// - New values appearing in future releases of the client library, **and**
11767        /// - New values received dynamically, without application changes.
11768        ///
11769        /// Please consult the [Working with enums] section in the user guide for some
11770        /// guidelines.
11771        ///
11772        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11773        #[derive(Clone, Debug, PartialEq)]
11774        #[non_exhaustive]
11775        pub enum SortBy {
11776            #[allow(missing_docs)]
11777            ChangeSequence,
11778            /// If set, the enum was initialized with an unknown value.
11779            ///
11780            /// Applications can examine the value using [SortBy::name].
11781            UnknownValue(sort_by::UnknownValue),
11782        }
11783
11784        #[doc(hidden)]
11785        pub mod sort_by {
11786            #[allow(unused_imports)]
11787            use super::*;
11788            #[derive(Clone, Debug, PartialEq)]
11789            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11790        }
11791
11792        impl SortBy {
11793            /// Gets the enum value as a string.
11794            pub fn name(&self) -> std::option::Option<&str> {
11795                match self {
11796                    Self::ChangeSequence => std::option::Option::Some("changeSequence"),
11797                    Self::UnknownValue(u) => u.0.name(),
11798                }
11799            }
11800        }
11801
11802        impl std::fmt::Display for SortBy {
11803            fn fmt(
11804                &self,
11805                f: &mut std::fmt::Formatter<'_>,
11806            ) -> std::result::Result<(), std::fmt::Error> {
11807                wkt::internal::display_enum(f, self.name(), std::option::Option::None)
11808            }
11809        }
11810
11811        impl std::convert::From<&str> for SortBy {
11812            fn from(value: &str) -> Self {
11813                use std::string::ToString;
11814                match value {
11815                    "changeSequence" => Self::ChangeSequence,
11816                    _ => Self::UnknownValue(sort_by::UnknownValue(
11817                        wkt::internal::UnknownEnumValue::String(value.to_string()),
11818                    )),
11819                }
11820            }
11821        }
11822
11823        impl serde::ser::Serialize for SortBy {
11824            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11825            where
11826                S: serde::Serializer,
11827            {
11828                match self {
11829                    Self::ChangeSequence => serializer.serialize_str("changeSequence"),
11830                    Self::UnknownValue(u) => u.0.serialize(serializer),
11831                }
11832            }
11833        }
11834
11835        impl<'de> serde::de::Deserialize<'de> for SortBy {
11836            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11837            where
11838                D: serde::Deserializer<'de>,
11839            {
11840                deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<SortBy>::new(
11841                    "..changes.listRequest.sortBy",
11842                ))
11843            }
11844        }
11845    }
11846}
11847
11848/// Synthetic messages for the [dnsKeys][.dnsKeys] service
11849pub mod dns_keys {
11850    #[allow(unused_imports)]
11851    use super::*;
11852
11853    /// Synthetic request message for the [get()][.dnsKeys.get] method.
11854    #[derive(Clone, Default, PartialEq)]
11855    #[non_exhaustive]
11856    pub struct GetRequest {
11857        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
11858        pub client_operation_id: std::option::Option<std::string::String>,
11859
11860        /// An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type is computed and displayed.
11861        pub digest_type: std::option::Option<std::string::String>,
11862
11863        /// The identifier of the requested DnsKey.
11864        pub dns_key_id: std::string::String,
11865
11866        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
11867        pub managed_zone: std::string::String,
11868
11869        /// Identifies the project addressed by this request.
11870        pub project: std::string::String,
11871
11872        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11873    }
11874
11875    impl GetRequest {
11876        /// Creates a new default instance.
11877        pub fn new() -> Self {
11878            std::default::Default::default()
11879        }
11880
11881        /// Sets the value of [client_operation_id][crate::model::dns_keys::GetRequest::client_operation_id].
11882        ///
11883        /// # Example
11884        /// ```ignore,no_run
11885        /// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
11886        /// let x = GetRequest::new().set_client_operation_id("example");
11887        /// ```
11888        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
11889        where
11890            T: std::convert::Into<std::string::String>,
11891        {
11892            self.client_operation_id = std::option::Option::Some(v.into());
11893            self
11894        }
11895
11896        /// Sets or clears the value of [client_operation_id][crate::model::dns_keys::GetRequest::client_operation_id].
11897        ///
11898        /// # Example
11899        /// ```ignore,no_run
11900        /// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
11901        /// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
11902        /// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
11903        /// ```
11904        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
11905        where
11906            T: std::convert::Into<std::string::String>,
11907        {
11908            self.client_operation_id = v.map(|x| x.into());
11909            self
11910        }
11911
11912        /// Sets the value of [digest_type][crate::model::dns_keys::GetRequest::digest_type].
11913        ///
11914        /// # Example
11915        /// ```ignore,no_run
11916        /// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
11917        /// let x = GetRequest::new().set_digest_type("example");
11918        /// ```
11919        pub fn set_digest_type<T>(mut self, v: T) -> Self
11920        where
11921            T: std::convert::Into<std::string::String>,
11922        {
11923            self.digest_type = std::option::Option::Some(v.into());
11924            self
11925        }
11926
11927        /// Sets or clears the value of [digest_type][crate::model::dns_keys::GetRequest::digest_type].
11928        ///
11929        /// # Example
11930        /// ```ignore,no_run
11931        /// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
11932        /// let x = GetRequest::new().set_or_clear_digest_type(Some("example"));
11933        /// let x = GetRequest::new().set_or_clear_digest_type(None::<String>);
11934        /// ```
11935        pub fn set_or_clear_digest_type<T>(mut self, v: std::option::Option<T>) -> Self
11936        where
11937            T: std::convert::Into<std::string::String>,
11938        {
11939            self.digest_type = v.map(|x| x.into());
11940            self
11941        }
11942
11943        /// Sets the value of [dns_key_id][crate::model::dns_keys::GetRequest::dns_key_id].
11944        ///
11945        /// # Example
11946        /// ```ignore,no_run
11947        /// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
11948        /// let x = GetRequest::new().set_dns_key_id("example");
11949        /// ```
11950        pub fn set_dns_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11951            self.dns_key_id = v.into();
11952            self
11953        }
11954
11955        /// Sets the value of [managed_zone][crate::model::dns_keys::GetRequest::managed_zone].
11956        ///
11957        /// # Example
11958        /// ```ignore,no_run
11959        /// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
11960        /// let x = GetRequest::new().set_managed_zone("example");
11961        /// ```
11962        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
11963            mut self,
11964            v: T,
11965        ) -> Self {
11966            self.managed_zone = v.into();
11967            self
11968        }
11969
11970        /// Sets the value of [project][crate::model::dns_keys::GetRequest::project].
11971        ///
11972        /// # Example
11973        /// ```ignore,no_run
11974        /// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
11975        /// let x = GetRequest::new().set_project("example");
11976        /// ```
11977        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11978            self.project = v.into();
11979            self
11980        }
11981    }
11982
11983    /// Synthetic request message for the [list()][.dnsKeys.list] method.
11984    #[derive(Clone, Default, PartialEq)]
11985    #[non_exhaustive]
11986    pub struct ListRequest {
11987        /// An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type is computed and displayed.
11988        pub digest_type: std::option::Option<std::string::String>,
11989
11990        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
11991        pub managed_zone: std::string::String,
11992
11993        /// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
11994        pub max_results: std::option::Option<i32>,
11995
11996        /// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
11997        pub page_token: std::option::Option<std::string::String>,
11998
11999        /// Identifies the project addressed by this request.
12000        pub project: std::string::String,
12001
12002        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12003    }
12004
12005    impl ListRequest {
12006        /// Creates a new default instance.
12007        pub fn new() -> Self {
12008            std::default::Default::default()
12009        }
12010
12011        /// Sets the value of [digest_type][crate::model::dns_keys::ListRequest::digest_type].
12012        ///
12013        /// # Example
12014        /// ```ignore,no_run
12015        /// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
12016        /// let x = ListRequest::new().set_digest_type("example");
12017        /// ```
12018        pub fn set_digest_type<T>(mut self, v: T) -> Self
12019        where
12020            T: std::convert::Into<std::string::String>,
12021        {
12022            self.digest_type = std::option::Option::Some(v.into());
12023            self
12024        }
12025
12026        /// Sets or clears the value of [digest_type][crate::model::dns_keys::ListRequest::digest_type].
12027        ///
12028        /// # Example
12029        /// ```ignore,no_run
12030        /// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
12031        /// let x = ListRequest::new().set_or_clear_digest_type(Some("example"));
12032        /// let x = ListRequest::new().set_or_clear_digest_type(None::<String>);
12033        /// ```
12034        pub fn set_or_clear_digest_type<T>(mut self, v: std::option::Option<T>) -> Self
12035        where
12036            T: std::convert::Into<std::string::String>,
12037        {
12038            self.digest_type = v.map(|x| x.into());
12039            self
12040        }
12041
12042        /// Sets the value of [managed_zone][crate::model::dns_keys::ListRequest::managed_zone].
12043        ///
12044        /// # Example
12045        /// ```ignore,no_run
12046        /// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
12047        /// let x = ListRequest::new().set_managed_zone("example");
12048        /// ```
12049        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
12050            mut self,
12051            v: T,
12052        ) -> Self {
12053            self.managed_zone = v.into();
12054            self
12055        }
12056
12057        /// Sets the value of [max_results][crate::model::dns_keys::ListRequest::max_results].
12058        ///
12059        /// # Example
12060        /// ```ignore,no_run
12061        /// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
12062        /// let x = ListRequest::new().set_max_results(42);
12063        /// ```
12064        pub fn set_max_results<T>(mut self, v: T) -> Self
12065        where
12066            T: std::convert::Into<i32>,
12067        {
12068            self.max_results = std::option::Option::Some(v.into());
12069            self
12070        }
12071
12072        /// Sets or clears the value of [max_results][crate::model::dns_keys::ListRequest::max_results].
12073        ///
12074        /// # Example
12075        /// ```ignore,no_run
12076        /// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
12077        /// let x = ListRequest::new().set_or_clear_max_results(Some(42));
12078        /// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
12079        /// ```
12080        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
12081        where
12082            T: std::convert::Into<i32>,
12083        {
12084            self.max_results = v.map(|x| x.into());
12085            self
12086        }
12087
12088        /// Sets the value of [page_token][crate::model::dns_keys::ListRequest::page_token].
12089        ///
12090        /// # Example
12091        /// ```ignore,no_run
12092        /// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
12093        /// let x = ListRequest::new().set_page_token("example");
12094        /// ```
12095        pub fn set_page_token<T>(mut self, v: T) -> Self
12096        where
12097            T: std::convert::Into<std::string::String>,
12098        {
12099            self.page_token = std::option::Option::Some(v.into());
12100            self
12101        }
12102
12103        /// Sets or clears the value of [page_token][crate::model::dns_keys::ListRequest::page_token].
12104        ///
12105        /// # Example
12106        /// ```ignore,no_run
12107        /// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
12108        /// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
12109        /// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
12110        /// ```
12111        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
12112        where
12113            T: std::convert::Into<std::string::String>,
12114        {
12115            self.page_token = v.map(|x| x.into());
12116            self
12117        }
12118
12119        /// Sets the value of [project][crate::model::dns_keys::ListRequest::project].
12120        ///
12121        /// # Example
12122        /// ```ignore,no_run
12123        /// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
12124        /// let x = ListRequest::new().set_project("example");
12125        /// ```
12126        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12127            self.project = v.into();
12128            self
12129        }
12130    }
12131}
12132
12133/// Synthetic messages for the [managedZoneOperations][.managedZoneOperations] service
12134pub mod managed_zone_operations {
12135    #[allow(unused_imports)]
12136    use super::*;
12137
12138    /// Synthetic request message for the [get()][.managedZoneOperations.get] method.
12139    #[derive(Clone, Default, PartialEq)]
12140    #[non_exhaustive]
12141    pub struct GetRequest {
12142        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
12143        pub client_operation_id: std::option::Option<std::string::String>,
12144
12145        /// Identifies the managed zone addressed by this request.
12146        pub managed_zone: std::string::String,
12147
12148        /// Identifies the operation addressed by this request (ID of the operation).
12149        pub operation: std::string::String,
12150
12151        /// Identifies the project addressed by this request.
12152        pub project: std::string::String,
12153
12154        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12155    }
12156
12157    impl GetRequest {
12158        /// Creates a new default instance.
12159        pub fn new() -> Self {
12160            std::default::Default::default()
12161        }
12162
12163        /// Sets the value of [client_operation_id][crate::model::managed_zone_operations::GetRequest::client_operation_id].
12164        ///
12165        /// # Example
12166        /// ```ignore,no_run
12167        /// # use google_cloud_dns_v1::model::managed_zone_operations::GetRequest;
12168        /// let x = GetRequest::new().set_client_operation_id("example");
12169        /// ```
12170        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
12171        where
12172            T: std::convert::Into<std::string::String>,
12173        {
12174            self.client_operation_id = std::option::Option::Some(v.into());
12175            self
12176        }
12177
12178        /// Sets or clears the value of [client_operation_id][crate::model::managed_zone_operations::GetRequest::client_operation_id].
12179        ///
12180        /// # Example
12181        /// ```ignore,no_run
12182        /// # use google_cloud_dns_v1::model::managed_zone_operations::GetRequest;
12183        /// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
12184        /// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
12185        /// ```
12186        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
12187        where
12188            T: std::convert::Into<std::string::String>,
12189        {
12190            self.client_operation_id = v.map(|x| x.into());
12191            self
12192        }
12193
12194        /// Sets the value of [managed_zone][crate::model::managed_zone_operations::GetRequest::managed_zone].
12195        ///
12196        /// # Example
12197        /// ```ignore,no_run
12198        /// # use google_cloud_dns_v1::model::managed_zone_operations::GetRequest;
12199        /// let x = GetRequest::new().set_managed_zone("example");
12200        /// ```
12201        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
12202            mut self,
12203            v: T,
12204        ) -> Self {
12205            self.managed_zone = v.into();
12206            self
12207        }
12208
12209        /// Sets the value of [operation][crate::model::managed_zone_operations::GetRequest::operation].
12210        ///
12211        /// # Example
12212        /// ```ignore,no_run
12213        /// # use google_cloud_dns_v1::model::managed_zone_operations::GetRequest;
12214        /// let x = GetRequest::new().set_operation("example");
12215        /// ```
12216        pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12217            self.operation = v.into();
12218            self
12219        }
12220
12221        /// Sets the value of [project][crate::model::managed_zone_operations::GetRequest::project].
12222        ///
12223        /// # Example
12224        /// ```ignore,no_run
12225        /// # use google_cloud_dns_v1::model::managed_zone_operations::GetRequest;
12226        /// let x = GetRequest::new().set_project("example");
12227        /// ```
12228        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12229            self.project = v.into();
12230            self
12231        }
12232    }
12233
12234    /// Synthetic request message for the [list()][.managedZoneOperations.list] method.
12235    #[derive(Clone, Default, PartialEq)]
12236    #[non_exhaustive]
12237    pub struct ListRequest {
12238        /// Identifies the managed zone addressed by this request.
12239        pub managed_zone: std::string::String,
12240
12241        /// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
12242        pub max_results: std::option::Option<i32>,
12243
12244        /// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
12245        pub page_token: std::option::Option<std::string::String>,
12246
12247        /// Identifies the project addressed by this request.
12248        pub project: std::string::String,
12249
12250        /// Sorting criterion. The only supported values are START_TIME and ID.
12251        pub sort_by:
12252            std::option::Option<crate::model::managed_zone_operations::list_request::SortBy>,
12253
12254        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12255    }
12256
12257    impl ListRequest {
12258        /// Creates a new default instance.
12259        pub fn new() -> Self {
12260            std::default::Default::default()
12261        }
12262
12263        /// Sets the value of [managed_zone][crate::model::managed_zone_operations::ListRequest::managed_zone].
12264        ///
12265        /// # Example
12266        /// ```ignore,no_run
12267        /// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
12268        /// let x = ListRequest::new().set_managed_zone("example");
12269        /// ```
12270        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
12271            mut self,
12272            v: T,
12273        ) -> Self {
12274            self.managed_zone = v.into();
12275            self
12276        }
12277
12278        /// Sets the value of [max_results][crate::model::managed_zone_operations::ListRequest::max_results].
12279        ///
12280        /// # Example
12281        /// ```ignore,no_run
12282        /// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
12283        /// let x = ListRequest::new().set_max_results(42);
12284        /// ```
12285        pub fn set_max_results<T>(mut self, v: T) -> Self
12286        where
12287            T: std::convert::Into<i32>,
12288        {
12289            self.max_results = std::option::Option::Some(v.into());
12290            self
12291        }
12292
12293        /// Sets or clears the value of [max_results][crate::model::managed_zone_operations::ListRequest::max_results].
12294        ///
12295        /// # Example
12296        /// ```ignore,no_run
12297        /// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
12298        /// let x = ListRequest::new().set_or_clear_max_results(Some(42));
12299        /// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
12300        /// ```
12301        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
12302        where
12303            T: std::convert::Into<i32>,
12304        {
12305            self.max_results = v.map(|x| x.into());
12306            self
12307        }
12308
12309        /// Sets the value of [page_token][crate::model::managed_zone_operations::ListRequest::page_token].
12310        ///
12311        /// # Example
12312        /// ```ignore,no_run
12313        /// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
12314        /// let x = ListRequest::new().set_page_token("example");
12315        /// ```
12316        pub fn set_page_token<T>(mut self, v: T) -> Self
12317        where
12318            T: std::convert::Into<std::string::String>,
12319        {
12320            self.page_token = std::option::Option::Some(v.into());
12321            self
12322        }
12323
12324        /// Sets or clears the value of [page_token][crate::model::managed_zone_operations::ListRequest::page_token].
12325        ///
12326        /// # Example
12327        /// ```ignore,no_run
12328        /// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
12329        /// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
12330        /// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
12331        /// ```
12332        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
12333        where
12334            T: std::convert::Into<std::string::String>,
12335        {
12336            self.page_token = v.map(|x| x.into());
12337            self
12338        }
12339
12340        /// Sets the value of [project][crate::model::managed_zone_operations::ListRequest::project].
12341        ///
12342        /// # Example
12343        /// ```ignore,no_run
12344        /// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
12345        /// let x = ListRequest::new().set_project("example");
12346        /// ```
12347        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12348            self.project = v.into();
12349            self
12350        }
12351
12352        /// Sets the value of [sort_by][crate::model::managed_zone_operations::ListRequest::sort_by].
12353        ///
12354        /// # Example
12355        /// ```ignore,no_run
12356        /// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
12357        /// use google_cloud_dns_v1::model::managed_zone_operations::list_request::SortBy;
12358        /// let x0 = ListRequest::new().set_sort_by(SortBy::Id);
12359        /// ```
12360        pub fn set_sort_by<T>(mut self, v: T) -> Self
12361        where
12362            T: std::convert::Into<crate::model::managed_zone_operations::list_request::SortBy>,
12363        {
12364            self.sort_by = std::option::Option::Some(v.into());
12365            self
12366        }
12367
12368        /// Sets or clears the value of [sort_by][crate::model::managed_zone_operations::ListRequest::sort_by].
12369        ///
12370        /// # Example
12371        /// ```ignore,no_run
12372        /// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
12373        /// use google_cloud_dns_v1::model::managed_zone_operations::list_request::SortBy;
12374        /// let x0 = ListRequest::new().set_or_clear_sort_by(Some(SortBy::Id));
12375        /// let x_none = ListRequest::new().set_or_clear_sort_by(None::<SortBy>);
12376        /// ```
12377        pub fn set_or_clear_sort_by<T>(mut self, v: std::option::Option<T>) -> Self
12378        where
12379            T: std::convert::Into<crate::model::managed_zone_operations::list_request::SortBy>,
12380        {
12381            self.sort_by = v.map(|x| x.into());
12382            self
12383        }
12384    }
12385
12386    /// Defines additional types related to [ListRequest].
12387    pub mod list_request {
12388        #[allow(unused_imports)]
12389        use super::*;
12390
12391        /// The enumerated type for the [sortBy][.managedZoneOperations.listRequest.sortBy] field.
12392        ///
12393        /// # Working with unknown values
12394        ///
12395        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12396        /// additional enum variants at any time. Adding new variants is not considered
12397        /// a breaking change. Applications should write their code in anticipation of:
12398        ///
12399        /// - New values appearing in future releases of the client library, **and**
12400        /// - New values received dynamically, without application changes.
12401        ///
12402        /// Please consult the [Working with enums] section in the user guide for some
12403        /// guidelines.
12404        ///
12405        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12406        #[derive(Clone, Debug, PartialEq)]
12407        #[non_exhaustive]
12408        pub enum SortBy {
12409            #[allow(missing_docs)]
12410            StartTime,
12411            #[allow(missing_docs)]
12412            Id,
12413            /// If set, the enum was initialized with an unknown value.
12414            ///
12415            /// Applications can examine the value using [SortBy::name].
12416            UnknownValue(sort_by::UnknownValue),
12417        }
12418
12419        #[doc(hidden)]
12420        pub mod sort_by {
12421            #[allow(unused_imports)]
12422            use super::*;
12423            #[derive(Clone, Debug, PartialEq)]
12424            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12425        }
12426
12427        impl SortBy {
12428            /// Gets the enum value as a string.
12429            pub fn name(&self) -> std::option::Option<&str> {
12430                match self {
12431                    Self::StartTime => std::option::Option::Some("startTime"),
12432                    Self::Id => std::option::Option::Some("id"),
12433                    Self::UnknownValue(u) => u.0.name(),
12434                }
12435            }
12436        }
12437
12438        impl std::fmt::Display for SortBy {
12439            fn fmt(
12440                &self,
12441                f: &mut std::fmt::Formatter<'_>,
12442            ) -> std::result::Result<(), std::fmt::Error> {
12443                wkt::internal::display_enum(f, self.name(), std::option::Option::None)
12444            }
12445        }
12446
12447        impl std::convert::From<&str> for SortBy {
12448            fn from(value: &str) -> Self {
12449                use std::string::ToString;
12450                match value {
12451                    "startTime" => Self::StartTime,
12452                    "id" => Self::Id,
12453                    _ => Self::UnknownValue(sort_by::UnknownValue(
12454                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12455                    )),
12456                }
12457            }
12458        }
12459
12460        impl serde::ser::Serialize for SortBy {
12461            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12462            where
12463                S: serde::Serializer,
12464            {
12465                match self {
12466                    Self::StartTime => serializer.serialize_str("startTime"),
12467                    Self::Id => serializer.serialize_str("id"),
12468                    Self::UnknownValue(u) => u.0.serialize(serializer),
12469                }
12470            }
12471        }
12472
12473        impl<'de> serde::de::Deserialize<'de> for SortBy {
12474            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12475            where
12476                D: serde::Deserializer<'de>,
12477            {
12478                deserializer.deserialize_str(wkt::internal::StringEnumVisitor::<SortBy>::new(
12479                    "..managedZoneOperations.listRequest.sortBy",
12480                ))
12481            }
12482        }
12483    }
12484}
12485
12486/// Synthetic messages for the [managedZones][.managedZones] service
12487pub mod managed_zones {
12488    #[allow(unused_imports)]
12489    use super::*;
12490
12491    /// Synthetic request message for the [create()][.managedZones.create] method.
12492    #[derive(Clone, Default, PartialEq)]
12493    #[non_exhaustive]
12494    pub struct CreateRequest {
12495        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
12496        pub client_operation_id: std::option::Option<std::string::String>,
12497
12498        /// Identifies the project addressed by this request.
12499        pub project: std::string::String,
12500
12501        /// Synthetic request body field for the [create()][.managedZones.create] method.
12502        pub body: std::option::Option<crate::model::ManagedZone>,
12503
12504        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12505    }
12506
12507    impl CreateRequest {
12508        /// Creates a new default instance.
12509        pub fn new() -> Self {
12510            std::default::Default::default()
12511        }
12512
12513        /// Sets the value of [client_operation_id][crate::model::managed_zones::CreateRequest::client_operation_id].
12514        ///
12515        /// # Example
12516        /// ```ignore,no_run
12517        /// # use google_cloud_dns_v1::model::managed_zones::CreateRequest;
12518        /// let x = CreateRequest::new().set_client_operation_id("example");
12519        /// ```
12520        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
12521        where
12522            T: std::convert::Into<std::string::String>,
12523        {
12524            self.client_operation_id = std::option::Option::Some(v.into());
12525            self
12526        }
12527
12528        /// Sets or clears the value of [client_operation_id][crate::model::managed_zones::CreateRequest::client_operation_id].
12529        ///
12530        /// # Example
12531        /// ```ignore,no_run
12532        /// # use google_cloud_dns_v1::model::managed_zones::CreateRequest;
12533        /// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
12534        /// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
12535        /// ```
12536        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
12537        where
12538            T: std::convert::Into<std::string::String>,
12539        {
12540            self.client_operation_id = v.map(|x| x.into());
12541            self
12542        }
12543
12544        /// Sets the value of [project][crate::model::managed_zones::CreateRequest::project].
12545        ///
12546        /// # Example
12547        /// ```ignore,no_run
12548        /// # use google_cloud_dns_v1::model::managed_zones::CreateRequest;
12549        /// let x = CreateRequest::new().set_project("example");
12550        /// ```
12551        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12552            self.project = v.into();
12553            self
12554        }
12555
12556        /// Sets the value of [body][crate::model::managed_zones::CreateRequest::body].
12557        ///
12558        /// # Example
12559        /// ```ignore,no_run
12560        /// # use google_cloud_dns_v1::model::managed_zones::CreateRequest;
12561        /// use google_cloud_dns_v1::model::ManagedZone;
12562        /// let x = CreateRequest::new().set_body(ManagedZone::default()/* use setters */);
12563        /// ```
12564        pub fn set_body<T>(mut self, v: T) -> Self
12565        where
12566            T: std::convert::Into<crate::model::ManagedZone>,
12567        {
12568            self.body = std::option::Option::Some(v.into());
12569            self
12570        }
12571
12572        /// Sets or clears the value of [body][crate::model::managed_zones::CreateRequest::body].
12573        ///
12574        /// # Example
12575        /// ```ignore,no_run
12576        /// # use google_cloud_dns_v1::model::managed_zones::CreateRequest;
12577        /// use google_cloud_dns_v1::model::ManagedZone;
12578        /// let x = CreateRequest::new().set_or_clear_body(Some(ManagedZone::default()/* use setters */));
12579        /// let x = CreateRequest::new().set_or_clear_body(None::<ManagedZone>);
12580        /// ```
12581        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
12582        where
12583            T: std::convert::Into<crate::model::ManagedZone>,
12584        {
12585            self.body = v.map(|x| x.into());
12586            self
12587        }
12588    }
12589
12590    /// Synthetic request message for the [delete()][.managedZones.delete] method.
12591    #[derive(Clone, Default, PartialEq)]
12592    #[non_exhaustive]
12593    pub struct DeleteRequest {
12594        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
12595        pub client_operation_id: std::option::Option<std::string::String>,
12596
12597        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
12598        pub managed_zone: std::string::String,
12599
12600        /// Identifies the project addressed by this request.
12601        pub project: std::string::String,
12602
12603        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12604    }
12605
12606    impl DeleteRequest {
12607        /// Creates a new default instance.
12608        pub fn new() -> Self {
12609            std::default::Default::default()
12610        }
12611
12612        /// Sets the value of [client_operation_id][crate::model::managed_zones::DeleteRequest::client_operation_id].
12613        ///
12614        /// # Example
12615        /// ```ignore,no_run
12616        /// # use google_cloud_dns_v1::model::managed_zones::DeleteRequest;
12617        /// let x = DeleteRequest::new().set_client_operation_id("example");
12618        /// ```
12619        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
12620        where
12621            T: std::convert::Into<std::string::String>,
12622        {
12623            self.client_operation_id = std::option::Option::Some(v.into());
12624            self
12625        }
12626
12627        /// Sets or clears the value of [client_operation_id][crate::model::managed_zones::DeleteRequest::client_operation_id].
12628        ///
12629        /// # Example
12630        /// ```ignore,no_run
12631        /// # use google_cloud_dns_v1::model::managed_zones::DeleteRequest;
12632        /// let x = DeleteRequest::new().set_or_clear_client_operation_id(Some("example"));
12633        /// let x = DeleteRequest::new().set_or_clear_client_operation_id(None::<String>);
12634        /// ```
12635        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
12636        where
12637            T: std::convert::Into<std::string::String>,
12638        {
12639            self.client_operation_id = v.map(|x| x.into());
12640            self
12641        }
12642
12643        /// Sets the value of [managed_zone][crate::model::managed_zones::DeleteRequest::managed_zone].
12644        ///
12645        /// # Example
12646        /// ```ignore,no_run
12647        /// # use google_cloud_dns_v1::model::managed_zones::DeleteRequest;
12648        /// let x = DeleteRequest::new().set_managed_zone("example");
12649        /// ```
12650        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
12651            mut self,
12652            v: T,
12653        ) -> Self {
12654            self.managed_zone = v.into();
12655            self
12656        }
12657
12658        /// Sets the value of [project][crate::model::managed_zones::DeleteRequest::project].
12659        ///
12660        /// # Example
12661        /// ```ignore,no_run
12662        /// # use google_cloud_dns_v1::model::managed_zones::DeleteRequest;
12663        /// let x = DeleteRequest::new().set_project("example");
12664        /// ```
12665        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12666            self.project = v.into();
12667            self
12668        }
12669    }
12670
12671    /// Synthetic request message for the [get()][.managedZones.get] method.
12672    #[derive(Clone, Default, PartialEq)]
12673    #[non_exhaustive]
12674    pub struct GetRequest {
12675        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
12676        pub client_operation_id: std::option::Option<std::string::String>,
12677
12678        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
12679        pub managed_zone: std::string::String,
12680
12681        /// Identifies the project addressed by this request.
12682        pub project: std::string::String,
12683
12684        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12685    }
12686
12687    impl GetRequest {
12688        /// Creates a new default instance.
12689        pub fn new() -> Self {
12690            std::default::Default::default()
12691        }
12692
12693        /// Sets the value of [client_operation_id][crate::model::managed_zones::GetRequest::client_operation_id].
12694        ///
12695        /// # Example
12696        /// ```ignore,no_run
12697        /// # use google_cloud_dns_v1::model::managed_zones::GetRequest;
12698        /// let x = GetRequest::new().set_client_operation_id("example");
12699        /// ```
12700        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
12701        where
12702            T: std::convert::Into<std::string::String>,
12703        {
12704            self.client_operation_id = std::option::Option::Some(v.into());
12705            self
12706        }
12707
12708        /// Sets or clears the value of [client_operation_id][crate::model::managed_zones::GetRequest::client_operation_id].
12709        ///
12710        /// # Example
12711        /// ```ignore,no_run
12712        /// # use google_cloud_dns_v1::model::managed_zones::GetRequest;
12713        /// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
12714        /// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
12715        /// ```
12716        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
12717        where
12718            T: std::convert::Into<std::string::String>,
12719        {
12720            self.client_operation_id = v.map(|x| x.into());
12721            self
12722        }
12723
12724        /// Sets the value of [managed_zone][crate::model::managed_zones::GetRequest::managed_zone].
12725        ///
12726        /// # Example
12727        /// ```ignore,no_run
12728        /// # use google_cloud_dns_v1::model::managed_zones::GetRequest;
12729        /// let x = GetRequest::new().set_managed_zone("example");
12730        /// ```
12731        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
12732            mut self,
12733            v: T,
12734        ) -> Self {
12735            self.managed_zone = v.into();
12736            self
12737        }
12738
12739        /// Sets the value of [project][crate::model::managed_zones::GetRequest::project].
12740        ///
12741        /// # Example
12742        /// ```ignore,no_run
12743        /// # use google_cloud_dns_v1::model::managed_zones::GetRequest;
12744        /// let x = GetRequest::new().set_project("example");
12745        /// ```
12746        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12747            self.project = v.into();
12748            self
12749        }
12750    }
12751
12752    /// Synthetic request message for the [getIamPolicy()][.managedZones.getIamPolicy] method.
12753    #[derive(Clone, Default, PartialEq)]
12754    #[non_exhaustive]
12755    pub struct GetIamPolicyRequest {
12756        /// REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
12757        pub resource: std::string::String,
12758
12759        /// Synthetic request body field for the [getIamPolicy()][.managedZones.getIamPolicy] method.
12760        pub body: std::option::Option<crate::model::GoogleIamV1GetIamPolicyRequest>,
12761
12762        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12763    }
12764
12765    impl GetIamPolicyRequest {
12766        /// Creates a new default instance.
12767        pub fn new() -> Self {
12768            std::default::Default::default()
12769        }
12770
12771        /// Sets the value of [resource][crate::model::managed_zones::GetIamPolicyRequest::resource].
12772        ///
12773        /// # Example
12774        /// ```ignore,no_run
12775        /// # use google_cloud_dns_v1::model::managed_zones::GetIamPolicyRequest;
12776        /// let x = GetIamPolicyRequest::new().set_resource("example");
12777        /// ```
12778        pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12779            self.resource = v.into();
12780            self
12781        }
12782
12783        /// Sets the value of [body][crate::model::managed_zones::GetIamPolicyRequest::body].
12784        ///
12785        /// # Example
12786        /// ```ignore,no_run
12787        /// # use google_cloud_dns_v1::model::managed_zones::GetIamPolicyRequest;
12788        /// use google_cloud_dns_v1::model::GoogleIamV1GetIamPolicyRequest;
12789        /// let x = GetIamPolicyRequest::new().set_body(GoogleIamV1GetIamPolicyRequest::default()/* use setters */);
12790        /// ```
12791        pub fn set_body<T>(mut self, v: T) -> Self
12792        where
12793            T: std::convert::Into<crate::model::GoogleIamV1GetIamPolicyRequest>,
12794        {
12795            self.body = std::option::Option::Some(v.into());
12796            self
12797        }
12798
12799        /// Sets or clears the value of [body][crate::model::managed_zones::GetIamPolicyRequest::body].
12800        ///
12801        /// # Example
12802        /// ```ignore,no_run
12803        /// # use google_cloud_dns_v1::model::managed_zones::GetIamPolicyRequest;
12804        /// use google_cloud_dns_v1::model::GoogleIamV1GetIamPolicyRequest;
12805        /// let x = GetIamPolicyRequest::new().set_or_clear_body(Some(GoogleIamV1GetIamPolicyRequest::default()/* use setters */));
12806        /// let x = GetIamPolicyRequest::new().set_or_clear_body(None::<GoogleIamV1GetIamPolicyRequest>);
12807        /// ```
12808        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
12809        where
12810            T: std::convert::Into<crate::model::GoogleIamV1GetIamPolicyRequest>,
12811        {
12812            self.body = v.map(|x| x.into());
12813            self
12814        }
12815    }
12816
12817    /// Synthetic request message for the [list()][.managedZones.list] method.
12818    #[derive(Clone, Default, PartialEq)]
12819    #[non_exhaustive]
12820    pub struct ListRequest {
12821        /// Restricts the list to return only zones with this domain name.
12822        pub dns_name: std::option::Option<std::string::String>,
12823
12824        /// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
12825        pub max_results: std::option::Option<i32>,
12826
12827        /// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
12828        pub page_token: std::option::Option<std::string::String>,
12829
12830        /// Identifies the project addressed by this request.
12831        pub project: std::string::String,
12832
12833        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12834    }
12835
12836    impl ListRequest {
12837        /// Creates a new default instance.
12838        pub fn new() -> Self {
12839            std::default::Default::default()
12840        }
12841
12842        /// Sets the value of [dns_name][crate::model::managed_zones::ListRequest::dns_name].
12843        ///
12844        /// # Example
12845        /// ```ignore,no_run
12846        /// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
12847        /// let x = ListRequest::new().set_dns_name("example");
12848        /// ```
12849        pub fn set_dns_name<T>(mut self, v: T) -> Self
12850        where
12851            T: std::convert::Into<std::string::String>,
12852        {
12853            self.dns_name = std::option::Option::Some(v.into());
12854            self
12855        }
12856
12857        /// Sets or clears the value of [dns_name][crate::model::managed_zones::ListRequest::dns_name].
12858        ///
12859        /// # Example
12860        /// ```ignore,no_run
12861        /// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
12862        /// let x = ListRequest::new().set_or_clear_dns_name(Some("example"));
12863        /// let x = ListRequest::new().set_or_clear_dns_name(None::<String>);
12864        /// ```
12865        pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12866        where
12867            T: std::convert::Into<std::string::String>,
12868        {
12869            self.dns_name = v.map(|x| x.into());
12870            self
12871        }
12872
12873        /// Sets the value of [max_results][crate::model::managed_zones::ListRequest::max_results].
12874        ///
12875        /// # Example
12876        /// ```ignore,no_run
12877        /// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
12878        /// let x = ListRequest::new().set_max_results(42);
12879        /// ```
12880        pub fn set_max_results<T>(mut self, v: T) -> Self
12881        where
12882            T: std::convert::Into<i32>,
12883        {
12884            self.max_results = std::option::Option::Some(v.into());
12885            self
12886        }
12887
12888        /// Sets or clears the value of [max_results][crate::model::managed_zones::ListRequest::max_results].
12889        ///
12890        /// # Example
12891        /// ```ignore,no_run
12892        /// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
12893        /// let x = ListRequest::new().set_or_clear_max_results(Some(42));
12894        /// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
12895        /// ```
12896        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
12897        where
12898            T: std::convert::Into<i32>,
12899        {
12900            self.max_results = v.map(|x| x.into());
12901            self
12902        }
12903
12904        /// Sets the value of [page_token][crate::model::managed_zones::ListRequest::page_token].
12905        ///
12906        /// # Example
12907        /// ```ignore,no_run
12908        /// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
12909        /// let x = ListRequest::new().set_page_token("example");
12910        /// ```
12911        pub fn set_page_token<T>(mut self, v: T) -> Self
12912        where
12913            T: std::convert::Into<std::string::String>,
12914        {
12915            self.page_token = std::option::Option::Some(v.into());
12916            self
12917        }
12918
12919        /// Sets or clears the value of [page_token][crate::model::managed_zones::ListRequest::page_token].
12920        ///
12921        /// # Example
12922        /// ```ignore,no_run
12923        /// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
12924        /// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
12925        /// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
12926        /// ```
12927        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
12928        where
12929            T: std::convert::Into<std::string::String>,
12930        {
12931            self.page_token = v.map(|x| x.into());
12932            self
12933        }
12934
12935        /// Sets the value of [project][crate::model::managed_zones::ListRequest::project].
12936        ///
12937        /// # Example
12938        /// ```ignore,no_run
12939        /// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
12940        /// let x = ListRequest::new().set_project("example");
12941        /// ```
12942        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12943            self.project = v.into();
12944            self
12945        }
12946    }
12947
12948    /// Synthetic request message for the [patch()][.managedZones.patch] method.
12949    #[derive(Clone, Default, PartialEq)]
12950    #[non_exhaustive]
12951    pub struct PatchRequest {
12952        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
12953        pub client_operation_id: std::option::Option<std::string::String>,
12954
12955        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
12956        pub managed_zone: std::string::String,
12957
12958        /// Identifies the project addressed by this request.
12959        pub project: std::string::String,
12960
12961        /// Synthetic request body field for the [patch()][.managedZones.patch] method.
12962        pub body: std::option::Option<crate::model::ManagedZone>,
12963
12964        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12965    }
12966
12967    impl PatchRequest {
12968        /// Creates a new default instance.
12969        pub fn new() -> Self {
12970            std::default::Default::default()
12971        }
12972
12973        /// Sets the value of [client_operation_id][crate::model::managed_zones::PatchRequest::client_operation_id].
12974        ///
12975        /// # Example
12976        /// ```ignore,no_run
12977        /// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
12978        /// let x = PatchRequest::new().set_client_operation_id("example");
12979        /// ```
12980        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
12981        where
12982            T: std::convert::Into<std::string::String>,
12983        {
12984            self.client_operation_id = std::option::Option::Some(v.into());
12985            self
12986        }
12987
12988        /// Sets or clears the value of [client_operation_id][crate::model::managed_zones::PatchRequest::client_operation_id].
12989        ///
12990        /// # Example
12991        /// ```ignore,no_run
12992        /// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
12993        /// let x = PatchRequest::new().set_or_clear_client_operation_id(Some("example"));
12994        /// let x = PatchRequest::new().set_or_clear_client_operation_id(None::<String>);
12995        /// ```
12996        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
12997        where
12998            T: std::convert::Into<std::string::String>,
12999        {
13000            self.client_operation_id = v.map(|x| x.into());
13001            self
13002        }
13003
13004        /// Sets the value of [managed_zone][crate::model::managed_zones::PatchRequest::managed_zone].
13005        ///
13006        /// # Example
13007        /// ```ignore,no_run
13008        /// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
13009        /// let x = PatchRequest::new().set_managed_zone("example");
13010        /// ```
13011        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
13012            mut self,
13013            v: T,
13014        ) -> Self {
13015            self.managed_zone = v.into();
13016            self
13017        }
13018
13019        /// Sets the value of [project][crate::model::managed_zones::PatchRequest::project].
13020        ///
13021        /// # Example
13022        /// ```ignore,no_run
13023        /// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
13024        /// let x = PatchRequest::new().set_project("example");
13025        /// ```
13026        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13027            self.project = v.into();
13028            self
13029        }
13030
13031        /// Sets the value of [body][crate::model::managed_zones::PatchRequest::body].
13032        ///
13033        /// # Example
13034        /// ```ignore,no_run
13035        /// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
13036        /// use google_cloud_dns_v1::model::ManagedZone;
13037        /// let x = PatchRequest::new().set_body(ManagedZone::default()/* use setters */);
13038        /// ```
13039        pub fn set_body<T>(mut self, v: T) -> Self
13040        where
13041            T: std::convert::Into<crate::model::ManagedZone>,
13042        {
13043            self.body = std::option::Option::Some(v.into());
13044            self
13045        }
13046
13047        /// Sets or clears the value of [body][crate::model::managed_zones::PatchRequest::body].
13048        ///
13049        /// # Example
13050        /// ```ignore,no_run
13051        /// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
13052        /// use google_cloud_dns_v1::model::ManagedZone;
13053        /// let x = PatchRequest::new().set_or_clear_body(Some(ManagedZone::default()/* use setters */));
13054        /// let x = PatchRequest::new().set_or_clear_body(None::<ManagedZone>);
13055        /// ```
13056        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13057        where
13058            T: std::convert::Into<crate::model::ManagedZone>,
13059        {
13060            self.body = v.map(|x| x.into());
13061            self
13062        }
13063    }
13064
13065    /// Synthetic request message for the [setIamPolicy()][.managedZones.setIamPolicy] method.
13066    #[derive(Clone, Default, PartialEq)]
13067    #[non_exhaustive]
13068    pub struct SetIamPolicyRequest {
13069        /// REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
13070        pub resource: std::string::String,
13071
13072        /// Synthetic request body field for the [setIamPolicy()][.managedZones.setIamPolicy] method.
13073        pub body: std::option::Option<crate::model::GoogleIamV1SetIamPolicyRequest>,
13074
13075        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13076    }
13077
13078    impl SetIamPolicyRequest {
13079        /// Creates a new default instance.
13080        pub fn new() -> Self {
13081            std::default::Default::default()
13082        }
13083
13084        /// Sets the value of [resource][crate::model::managed_zones::SetIamPolicyRequest::resource].
13085        ///
13086        /// # Example
13087        /// ```ignore,no_run
13088        /// # use google_cloud_dns_v1::model::managed_zones::SetIamPolicyRequest;
13089        /// let x = SetIamPolicyRequest::new().set_resource("example");
13090        /// ```
13091        pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13092            self.resource = v.into();
13093            self
13094        }
13095
13096        /// Sets the value of [body][crate::model::managed_zones::SetIamPolicyRequest::body].
13097        ///
13098        /// # Example
13099        /// ```ignore,no_run
13100        /// # use google_cloud_dns_v1::model::managed_zones::SetIamPolicyRequest;
13101        /// use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
13102        /// let x = SetIamPolicyRequest::new().set_body(GoogleIamV1SetIamPolicyRequest::default()/* use setters */);
13103        /// ```
13104        pub fn set_body<T>(mut self, v: T) -> Self
13105        where
13106            T: std::convert::Into<crate::model::GoogleIamV1SetIamPolicyRequest>,
13107        {
13108            self.body = std::option::Option::Some(v.into());
13109            self
13110        }
13111
13112        /// Sets or clears the value of [body][crate::model::managed_zones::SetIamPolicyRequest::body].
13113        ///
13114        /// # Example
13115        /// ```ignore,no_run
13116        /// # use google_cloud_dns_v1::model::managed_zones::SetIamPolicyRequest;
13117        /// use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
13118        /// let x = SetIamPolicyRequest::new().set_or_clear_body(Some(GoogleIamV1SetIamPolicyRequest::default()/* use setters */));
13119        /// let x = SetIamPolicyRequest::new().set_or_clear_body(None::<GoogleIamV1SetIamPolicyRequest>);
13120        /// ```
13121        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13122        where
13123            T: std::convert::Into<crate::model::GoogleIamV1SetIamPolicyRequest>,
13124        {
13125            self.body = v.map(|x| x.into());
13126            self
13127        }
13128    }
13129
13130    /// Synthetic request message for the [testIamPermissions()][.managedZones.testIamPermissions] method.
13131    #[derive(Clone, Default, PartialEq)]
13132    #[non_exhaustive]
13133    pub struct TestIamPermissionsRequest {
13134        /// REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
13135        pub resource: std::string::String,
13136
13137        /// Synthetic request body field for the [testIamPermissions()][.managedZones.testIamPermissions] method.
13138        pub body: std::option::Option<crate::model::GoogleIamV1TestIamPermissionsRequest>,
13139
13140        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13141    }
13142
13143    impl TestIamPermissionsRequest {
13144        /// Creates a new default instance.
13145        pub fn new() -> Self {
13146            std::default::Default::default()
13147        }
13148
13149        /// Sets the value of [resource][crate::model::managed_zones::TestIamPermissionsRequest::resource].
13150        ///
13151        /// # Example
13152        /// ```ignore,no_run
13153        /// # use google_cloud_dns_v1::model::managed_zones::TestIamPermissionsRequest;
13154        /// let x = TestIamPermissionsRequest::new().set_resource("example");
13155        /// ```
13156        pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13157            self.resource = v.into();
13158            self
13159        }
13160
13161        /// Sets the value of [body][crate::model::managed_zones::TestIamPermissionsRequest::body].
13162        ///
13163        /// # Example
13164        /// ```ignore,no_run
13165        /// # use google_cloud_dns_v1::model::managed_zones::TestIamPermissionsRequest;
13166        /// use google_cloud_dns_v1::model::GoogleIamV1TestIamPermissionsRequest;
13167        /// let x = TestIamPermissionsRequest::new().set_body(GoogleIamV1TestIamPermissionsRequest::default()/* use setters */);
13168        /// ```
13169        pub fn set_body<T>(mut self, v: T) -> Self
13170        where
13171            T: std::convert::Into<crate::model::GoogleIamV1TestIamPermissionsRequest>,
13172        {
13173            self.body = std::option::Option::Some(v.into());
13174            self
13175        }
13176
13177        /// Sets or clears the value of [body][crate::model::managed_zones::TestIamPermissionsRequest::body].
13178        ///
13179        /// # Example
13180        /// ```ignore,no_run
13181        /// # use google_cloud_dns_v1::model::managed_zones::TestIamPermissionsRequest;
13182        /// use google_cloud_dns_v1::model::GoogleIamV1TestIamPermissionsRequest;
13183        /// let x = TestIamPermissionsRequest::new().set_or_clear_body(Some(GoogleIamV1TestIamPermissionsRequest::default()/* use setters */));
13184        /// let x = TestIamPermissionsRequest::new().set_or_clear_body(None::<GoogleIamV1TestIamPermissionsRequest>);
13185        /// ```
13186        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13187        where
13188            T: std::convert::Into<crate::model::GoogleIamV1TestIamPermissionsRequest>,
13189        {
13190            self.body = v.map(|x| x.into());
13191            self
13192        }
13193    }
13194
13195    /// Synthetic request message for the [update()][.managedZones.update] method.
13196    #[derive(Clone, Default, PartialEq)]
13197    #[non_exhaustive]
13198    pub struct UpdateRequest {
13199        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
13200        pub client_operation_id: std::option::Option<std::string::String>,
13201
13202        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
13203        pub managed_zone: std::string::String,
13204
13205        /// Identifies the project addressed by this request.
13206        pub project: std::string::String,
13207
13208        /// Synthetic request body field for the [update()][.managedZones.update] method.
13209        pub body: std::option::Option<crate::model::ManagedZone>,
13210
13211        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13212    }
13213
13214    impl UpdateRequest {
13215        /// Creates a new default instance.
13216        pub fn new() -> Self {
13217            std::default::Default::default()
13218        }
13219
13220        /// Sets the value of [client_operation_id][crate::model::managed_zones::UpdateRequest::client_operation_id].
13221        ///
13222        /// # Example
13223        /// ```ignore,no_run
13224        /// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
13225        /// let x = UpdateRequest::new().set_client_operation_id("example");
13226        /// ```
13227        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
13228        where
13229            T: std::convert::Into<std::string::String>,
13230        {
13231            self.client_operation_id = std::option::Option::Some(v.into());
13232            self
13233        }
13234
13235        /// Sets or clears the value of [client_operation_id][crate::model::managed_zones::UpdateRequest::client_operation_id].
13236        ///
13237        /// # Example
13238        /// ```ignore,no_run
13239        /// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
13240        /// let x = UpdateRequest::new().set_or_clear_client_operation_id(Some("example"));
13241        /// let x = UpdateRequest::new().set_or_clear_client_operation_id(None::<String>);
13242        /// ```
13243        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
13244        where
13245            T: std::convert::Into<std::string::String>,
13246        {
13247            self.client_operation_id = v.map(|x| x.into());
13248            self
13249        }
13250
13251        /// Sets the value of [managed_zone][crate::model::managed_zones::UpdateRequest::managed_zone].
13252        ///
13253        /// # Example
13254        /// ```ignore,no_run
13255        /// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
13256        /// let x = UpdateRequest::new().set_managed_zone("example");
13257        /// ```
13258        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
13259            mut self,
13260            v: T,
13261        ) -> Self {
13262            self.managed_zone = v.into();
13263            self
13264        }
13265
13266        /// Sets the value of [project][crate::model::managed_zones::UpdateRequest::project].
13267        ///
13268        /// # Example
13269        /// ```ignore,no_run
13270        /// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
13271        /// let x = UpdateRequest::new().set_project("example");
13272        /// ```
13273        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13274            self.project = v.into();
13275            self
13276        }
13277
13278        /// Sets the value of [body][crate::model::managed_zones::UpdateRequest::body].
13279        ///
13280        /// # Example
13281        /// ```ignore,no_run
13282        /// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
13283        /// use google_cloud_dns_v1::model::ManagedZone;
13284        /// let x = UpdateRequest::new().set_body(ManagedZone::default()/* use setters */);
13285        /// ```
13286        pub fn set_body<T>(mut self, v: T) -> Self
13287        where
13288            T: std::convert::Into<crate::model::ManagedZone>,
13289        {
13290            self.body = std::option::Option::Some(v.into());
13291            self
13292        }
13293
13294        /// Sets or clears the value of [body][crate::model::managed_zones::UpdateRequest::body].
13295        ///
13296        /// # Example
13297        /// ```ignore,no_run
13298        /// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
13299        /// use google_cloud_dns_v1::model::ManagedZone;
13300        /// let x = UpdateRequest::new().set_or_clear_body(Some(ManagedZone::default()/* use setters */));
13301        /// let x = UpdateRequest::new().set_or_clear_body(None::<ManagedZone>);
13302        /// ```
13303        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13304        where
13305            T: std::convert::Into<crate::model::ManagedZone>,
13306        {
13307            self.body = v.map(|x| x.into());
13308            self
13309        }
13310    }
13311}
13312
13313/// Synthetic messages for the [policies][.policies] service
13314pub mod policies {
13315    #[allow(unused_imports)]
13316    use super::*;
13317
13318    /// Synthetic request message for the [create()][.policies.create] method.
13319    #[derive(Clone, Default, PartialEq)]
13320    #[non_exhaustive]
13321    pub struct CreateRequest {
13322        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
13323        pub client_operation_id: std::option::Option<std::string::String>,
13324
13325        /// Identifies the project addressed by this request.
13326        pub project: std::string::String,
13327
13328        /// Synthetic request body field for the [create()][.policies.create] method.
13329        pub body: std::option::Option<crate::model::Policy>,
13330
13331        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13332    }
13333
13334    impl CreateRequest {
13335        /// Creates a new default instance.
13336        pub fn new() -> Self {
13337            std::default::Default::default()
13338        }
13339
13340        /// Sets the value of [client_operation_id][crate::model::policies::CreateRequest::client_operation_id].
13341        ///
13342        /// # Example
13343        /// ```ignore,no_run
13344        /// # use google_cloud_dns_v1::model::policies::CreateRequest;
13345        /// let x = CreateRequest::new().set_client_operation_id("example");
13346        /// ```
13347        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
13348        where
13349            T: std::convert::Into<std::string::String>,
13350        {
13351            self.client_operation_id = std::option::Option::Some(v.into());
13352            self
13353        }
13354
13355        /// Sets or clears the value of [client_operation_id][crate::model::policies::CreateRequest::client_operation_id].
13356        ///
13357        /// # Example
13358        /// ```ignore,no_run
13359        /// # use google_cloud_dns_v1::model::policies::CreateRequest;
13360        /// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
13361        /// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
13362        /// ```
13363        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
13364        where
13365            T: std::convert::Into<std::string::String>,
13366        {
13367            self.client_operation_id = v.map(|x| x.into());
13368            self
13369        }
13370
13371        /// Sets the value of [project][crate::model::policies::CreateRequest::project].
13372        ///
13373        /// # Example
13374        /// ```ignore,no_run
13375        /// # use google_cloud_dns_v1::model::policies::CreateRequest;
13376        /// let x = CreateRequest::new().set_project("example");
13377        /// ```
13378        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13379            self.project = v.into();
13380            self
13381        }
13382
13383        /// Sets the value of [body][crate::model::policies::CreateRequest::body].
13384        ///
13385        /// # Example
13386        /// ```ignore,no_run
13387        /// # use google_cloud_dns_v1::model::policies::CreateRequest;
13388        /// use google_cloud_dns_v1::model::Policy;
13389        /// let x = CreateRequest::new().set_body(Policy::default()/* use setters */);
13390        /// ```
13391        pub fn set_body<T>(mut self, v: T) -> Self
13392        where
13393            T: std::convert::Into<crate::model::Policy>,
13394        {
13395            self.body = std::option::Option::Some(v.into());
13396            self
13397        }
13398
13399        /// Sets or clears the value of [body][crate::model::policies::CreateRequest::body].
13400        ///
13401        /// # Example
13402        /// ```ignore,no_run
13403        /// # use google_cloud_dns_v1::model::policies::CreateRequest;
13404        /// use google_cloud_dns_v1::model::Policy;
13405        /// let x = CreateRequest::new().set_or_clear_body(Some(Policy::default()/* use setters */));
13406        /// let x = CreateRequest::new().set_or_clear_body(None::<Policy>);
13407        /// ```
13408        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13409        where
13410            T: std::convert::Into<crate::model::Policy>,
13411        {
13412            self.body = v.map(|x| x.into());
13413            self
13414        }
13415    }
13416
13417    /// Synthetic request message for the [delete()][.policies.delete] method.
13418    #[derive(Clone, Default, PartialEq)]
13419    #[non_exhaustive]
13420    pub struct DeleteRequest {
13421        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
13422        pub client_operation_id: std::option::Option<std::string::String>,
13423
13424        /// User given friendly name of the policy addressed by this request.
13425        pub policy: std::string::String,
13426
13427        /// Identifies the project addressed by this request.
13428        pub project: std::string::String,
13429
13430        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13431    }
13432
13433    impl DeleteRequest {
13434        /// Creates a new default instance.
13435        pub fn new() -> Self {
13436            std::default::Default::default()
13437        }
13438
13439        /// Sets the value of [client_operation_id][crate::model::policies::DeleteRequest::client_operation_id].
13440        ///
13441        /// # Example
13442        /// ```ignore,no_run
13443        /// # use google_cloud_dns_v1::model::policies::DeleteRequest;
13444        /// let x = DeleteRequest::new().set_client_operation_id("example");
13445        /// ```
13446        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
13447        where
13448            T: std::convert::Into<std::string::String>,
13449        {
13450            self.client_operation_id = std::option::Option::Some(v.into());
13451            self
13452        }
13453
13454        /// Sets or clears the value of [client_operation_id][crate::model::policies::DeleteRequest::client_operation_id].
13455        ///
13456        /// # Example
13457        /// ```ignore,no_run
13458        /// # use google_cloud_dns_v1::model::policies::DeleteRequest;
13459        /// let x = DeleteRequest::new().set_or_clear_client_operation_id(Some("example"));
13460        /// let x = DeleteRequest::new().set_or_clear_client_operation_id(None::<String>);
13461        /// ```
13462        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
13463        where
13464            T: std::convert::Into<std::string::String>,
13465        {
13466            self.client_operation_id = v.map(|x| x.into());
13467            self
13468        }
13469
13470        /// Sets the value of [policy][crate::model::policies::DeleteRequest::policy].
13471        ///
13472        /// # Example
13473        /// ```ignore,no_run
13474        /// # use google_cloud_dns_v1::model::policies::DeleteRequest;
13475        /// let x = DeleteRequest::new().set_policy("example");
13476        /// ```
13477        pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13478            self.policy = v.into();
13479            self
13480        }
13481
13482        /// Sets the value of [project][crate::model::policies::DeleteRequest::project].
13483        ///
13484        /// # Example
13485        /// ```ignore,no_run
13486        /// # use google_cloud_dns_v1::model::policies::DeleteRequest;
13487        /// let x = DeleteRequest::new().set_project("example");
13488        /// ```
13489        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13490            self.project = v.into();
13491            self
13492        }
13493    }
13494
13495    /// Synthetic request message for the [get()][.policies.get] method.
13496    #[derive(Clone, Default, PartialEq)]
13497    #[non_exhaustive]
13498    pub struct GetRequest {
13499        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
13500        pub client_operation_id: std::option::Option<std::string::String>,
13501
13502        /// User given friendly name of the policy addressed by this request.
13503        pub policy: std::string::String,
13504
13505        /// Identifies the project addressed by this request.
13506        pub project: std::string::String,
13507
13508        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13509    }
13510
13511    impl GetRequest {
13512        /// Creates a new default instance.
13513        pub fn new() -> Self {
13514            std::default::Default::default()
13515        }
13516
13517        /// Sets the value of [client_operation_id][crate::model::policies::GetRequest::client_operation_id].
13518        ///
13519        /// # Example
13520        /// ```ignore,no_run
13521        /// # use google_cloud_dns_v1::model::policies::GetRequest;
13522        /// let x = GetRequest::new().set_client_operation_id("example");
13523        /// ```
13524        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
13525        where
13526            T: std::convert::Into<std::string::String>,
13527        {
13528            self.client_operation_id = std::option::Option::Some(v.into());
13529            self
13530        }
13531
13532        /// Sets or clears the value of [client_operation_id][crate::model::policies::GetRequest::client_operation_id].
13533        ///
13534        /// # Example
13535        /// ```ignore,no_run
13536        /// # use google_cloud_dns_v1::model::policies::GetRequest;
13537        /// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
13538        /// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
13539        /// ```
13540        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
13541        where
13542            T: std::convert::Into<std::string::String>,
13543        {
13544            self.client_operation_id = v.map(|x| x.into());
13545            self
13546        }
13547
13548        /// Sets the value of [policy][crate::model::policies::GetRequest::policy].
13549        ///
13550        /// # Example
13551        /// ```ignore,no_run
13552        /// # use google_cloud_dns_v1::model::policies::GetRequest;
13553        /// let x = GetRequest::new().set_policy("example");
13554        /// ```
13555        pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13556            self.policy = v.into();
13557            self
13558        }
13559
13560        /// Sets the value of [project][crate::model::policies::GetRequest::project].
13561        ///
13562        /// # Example
13563        /// ```ignore,no_run
13564        /// # use google_cloud_dns_v1::model::policies::GetRequest;
13565        /// let x = GetRequest::new().set_project("example");
13566        /// ```
13567        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13568            self.project = v.into();
13569            self
13570        }
13571    }
13572
13573    /// Synthetic request message for the [list()][.policies.list] method.
13574    #[derive(Clone, Default, PartialEq)]
13575    #[non_exhaustive]
13576    pub struct ListRequest {
13577        /// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
13578        pub max_results: std::option::Option<i32>,
13579
13580        /// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
13581        pub page_token: std::option::Option<std::string::String>,
13582
13583        /// Identifies the project addressed by this request.
13584        pub project: std::string::String,
13585
13586        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13587    }
13588
13589    impl ListRequest {
13590        /// Creates a new default instance.
13591        pub fn new() -> Self {
13592            std::default::Default::default()
13593        }
13594
13595        /// Sets the value of [max_results][crate::model::policies::ListRequest::max_results].
13596        ///
13597        /// # Example
13598        /// ```ignore,no_run
13599        /// # use google_cloud_dns_v1::model::policies::ListRequest;
13600        /// let x = ListRequest::new().set_max_results(42);
13601        /// ```
13602        pub fn set_max_results<T>(mut self, v: T) -> Self
13603        where
13604            T: std::convert::Into<i32>,
13605        {
13606            self.max_results = std::option::Option::Some(v.into());
13607            self
13608        }
13609
13610        /// Sets or clears the value of [max_results][crate::model::policies::ListRequest::max_results].
13611        ///
13612        /// # Example
13613        /// ```ignore,no_run
13614        /// # use google_cloud_dns_v1::model::policies::ListRequest;
13615        /// let x = ListRequest::new().set_or_clear_max_results(Some(42));
13616        /// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
13617        /// ```
13618        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
13619        where
13620            T: std::convert::Into<i32>,
13621        {
13622            self.max_results = v.map(|x| x.into());
13623            self
13624        }
13625
13626        /// Sets the value of [page_token][crate::model::policies::ListRequest::page_token].
13627        ///
13628        /// # Example
13629        /// ```ignore,no_run
13630        /// # use google_cloud_dns_v1::model::policies::ListRequest;
13631        /// let x = ListRequest::new().set_page_token("example");
13632        /// ```
13633        pub fn set_page_token<T>(mut self, v: T) -> Self
13634        where
13635            T: std::convert::Into<std::string::String>,
13636        {
13637            self.page_token = std::option::Option::Some(v.into());
13638            self
13639        }
13640
13641        /// Sets or clears the value of [page_token][crate::model::policies::ListRequest::page_token].
13642        ///
13643        /// # Example
13644        /// ```ignore,no_run
13645        /// # use google_cloud_dns_v1::model::policies::ListRequest;
13646        /// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
13647        /// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
13648        /// ```
13649        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
13650        where
13651            T: std::convert::Into<std::string::String>,
13652        {
13653            self.page_token = v.map(|x| x.into());
13654            self
13655        }
13656
13657        /// Sets the value of [project][crate::model::policies::ListRequest::project].
13658        ///
13659        /// # Example
13660        /// ```ignore,no_run
13661        /// # use google_cloud_dns_v1::model::policies::ListRequest;
13662        /// let x = ListRequest::new().set_project("example");
13663        /// ```
13664        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13665            self.project = v.into();
13666            self
13667        }
13668    }
13669
13670    /// Synthetic request message for the [patch()][.policies.patch] method.
13671    #[derive(Clone, Default, PartialEq)]
13672    #[non_exhaustive]
13673    pub struct PatchRequest {
13674        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
13675        pub client_operation_id: std::option::Option<std::string::String>,
13676
13677        /// User given friendly name of the policy addressed by this request.
13678        pub policy: std::string::String,
13679
13680        /// Identifies the project addressed by this request.
13681        pub project: std::string::String,
13682
13683        /// Synthetic request body field for the [patch()][.policies.patch] method.
13684        pub body: std::option::Option<crate::model::Policy>,
13685
13686        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13687    }
13688
13689    impl PatchRequest {
13690        /// Creates a new default instance.
13691        pub fn new() -> Self {
13692            std::default::Default::default()
13693        }
13694
13695        /// Sets the value of [client_operation_id][crate::model::policies::PatchRequest::client_operation_id].
13696        ///
13697        /// # Example
13698        /// ```ignore,no_run
13699        /// # use google_cloud_dns_v1::model::policies::PatchRequest;
13700        /// let x = PatchRequest::new().set_client_operation_id("example");
13701        /// ```
13702        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
13703        where
13704            T: std::convert::Into<std::string::String>,
13705        {
13706            self.client_operation_id = std::option::Option::Some(v.into());
13707            self
13708        }
13709
13710        /// Sets or clears the value of [client_operation_id][crate::model::policies::PatchRequest::client_operation_id].
13711        ///
13712        /// # Example
13713        /// ```ignore,no_run
13714        /// # use google_cloud_dns_v1::model::policies::PatchRequest;
13715        /// let x = PatchRequest::new().set_or_clear_client_operation_id(Some("example"));
13716        /// let x = PatchRequest::new().set_or_clear_client_operation_id(None::<String>);
13717        /// ```
13718        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
13719        where
13720            T: std::convert::Into<std::string::String>,
13721        {
13722            self.client_operation_id = v.map(|x| x.into());
13723            self
13724        }
13725
13726        /// Sets the value of [policy][crate::model::policies::PatchRequest::policy].
13727        ///
13728        /// # Example
13729        /// ```ignore,no_run
13730        /// # use google_cloud_dns_v1::model::policies::PatchRequest;
13731        /// let x = PatchRequest::new().set_policy("example");
13732        /// ```
13733        pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13734            self.policy = v.into();
13735            self
13736        }
13737
13738        /// Sets the value of [project][crate::model::policies::PatchRequest::project].
13739        ///
13740        /// # Example
13741        /// ```ignore,no_run
13742        /// # use google_cloud_dns_v1::model::policies::PatchRequest;
13743        /// let x = PatchRequest::new().set_project("example");
13744        /// ```
13745        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13746            self.project = v.into();
13747            self
13748        }
13749
13750        /// Sets the value of [body][crate::model::policies::PatchRequest::body].
13751        ///
13752        /// # Example
13753        /// ```ignore,no_run
13754        /// # use google_cloud_dns_v1::model::policies::PatchRequest;
13755        /// use google_cloud_dns_v1::model::Policy;
13756        /// let x = PatchRequest::new().set_body(Policy::default()/* use setters */);
13757        /// ```
13758        pub fn set_body<T>(mut self, v: T) -> Self
13759        where
13760            T: std::convert::Into<crate::model::Policy>,
13761        {
13762            self.body = std::option::Option::Some(v.into());
13763            self
13764        }
13765
13766        /// Sets or clears the value of [body][crate::model::policies::PatchRequest::body].
13767        ///
13768        /// # Example
13769        /// ```ignore,no_run
13770        /// # use google_cloud_dns_v1::model::policies::PatchRequest;
13771        /// use google_cloud_dns_v1::model::Policy;
13772        /// let x = PatchRequest::new().set_or_clear_body(Some(Policy::default()/* use setters */));
13773        /// let x = PatchRequest::new().set_or_clear_body(None::<Policy>);
13774        /// ```
13775        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13776        where
13777            T: std::convert::Into<crate::model::Policy>,
13778        {
13779            self.body = v.map(|x| x.into());
13780            self
13781        }
13782    }
13783
13784    /// Synthetic request message for the [update()][.policies.update] method.
13785    #[derive(Clone, Default, PartialEq)]
13786    #[non_exhaustive]
13787    pub struct UpdateRequest {
13788        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
13789        pub client_operation_id: std::option::Option<std::string::String>,
13790
13791        /// User given friendly name of the policy addressed by this request.
13792        pub policy: std::string::String,
13793
13794        /// Identifies the project addressed by this request.
13795        pub project: std::string::String,
13796
13797        /// Synthetic request body field for the [update()][.policies.update] method.
13798        pub body: std::option::Option<crate::model::Policy>,
13799
13800        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13801    }
13802
13803    impl UpdateRequest {
13804        /// Creates a new default instance.
13805        pub fn new() -> Self {
13806            std::default::Default::default()
13807        }
13808
13809        /// Sets the value of [client_operation_id][crate::model::policies::UpdateRequest::client_operation_id].
13810        ///
13811        /// # Example
13812        /// ```ignore,no_run
13813        /// # use google_cloud_dns_v1::model::policies::UpdateRequest;
13814        /// let x = UpdateRequest::new().set_client_operation_id("example");
13815        /// ```
13816        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
13817        where
13818            T: std::convert::Into<std::string::String>,
13819        {
13820            self.client_operation_id = std::option::Option::Some(v.into());
13821            self
13822        }
13823
13824        /// Sets or clears the value of [client_operation_id][crate::model::policies::UpdateRequest::client_operation_id].
13825        ///
13826        /// # Example
13827        /// ```ignore,no_run
13828        /// # use google_cloud_dns_v1::model::policies::UpdateRequest;
13829        /// let x = UpdateRequest::new().set_or_clear_client_operation_id(Some("example"));
13830        /// let x = UpdateRequest::new().set_or_clear_client_operation_id(None::<String>);
13831        /// ```
13832        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
13833        where
13834            T: std::convert::Into<std::string::String>,
13835        {
13836            self.client_operation_id = v.map(|x| x.into());
13837            self
13838        }
13839
13840        /// Sets the value of [policy][crate::model::policies::UpdateRequest::policy].
13841        ///
13842        /// # Example
13843        /// ```ignore,no_run
13844        /// # use google_cloud_dns_v1::model::policies::UpdateRequest;
13845        /// let x = UpdateRequest::new().set_policy("example");
13846        /// ```
13847        pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13848            self.policy = v.into();
13849            self
13850        }
13851
13852        /// Sets the value of [project][crate::model::policies::UpdateRequest::project].
13853        ///
13854        /// # Example
13855        /// ```ignore,no_run
13856        /// # use google_cloud_dns_v1::model::policies::UpdateRequest;
13857        /// let x = UpdateRequest::new().set_project("example");
13858        /// ```
13859        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13860            self.project = v.into();
13861            self
13862        }
13863
13864        /// Sets the value of [body][crate::model::policies::UpdateRequest::body].
13865        ///
13866        /// # Example
13867        /// ```ignore,no_run
13868        /// # use google_cloud_dns_v1::model::policies::UpdateRequest;
13869        /// use google_cloud_dns_v1::model::Policy;
13870        /// let x = UpdateRequest::new().set_body(Policy::default()/* use setters */);
13871        /// ```
13872        pub fn set_body<T>(mut self, v: T) -> Self
13873        where
13874            T: std::convert::Into<crate::model::Policy>,
13875        {
13876            self.body = std::option::Option::Some(v.into());
13877            self
13878        }
13879
13880        /// Sets or clears the value of [body][crate::model::policies::UpdateRequest::body].
13881        ///
13882        /// # Example
13883        /// ```ignore,no_run
13884        /// # use google_cloud_dns_v1::model::policies::UpdateRequest;
13885        /// use google_cloud_dns_v1::model::Policy;
13886        /// let x = UpdateRequest::new().set_or_clear_body(Some(Policy::default()/* use setters */));
13887        /// let x = UpdateRequest::new().set_or_clear_body(None::<Policy>);
13888        /// ```
13889        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13890        where
13891            T: std::convert::Into<crate::model::Policy>,
13892        {
13893            self.body = v.map(|x| x.into());
13894            self
13895        }
13896    }
13897}
13898
13899/// Synthetic messages for the [projects][.projects] service
13900pub mod projects {
13901    #[allow(unused_imports)]
13902    use super::*;
13903
13904    /// Synthetic request message for the [get()][.projects.get] method.
13905    #[derive(Clone, Default, PartialEq)]
13906    #[non_exhaustive]
13907    pub struct GetRequest {
13908        /// Identifies the project addressed by this request.
13909        pub project: std::string::String,
13910
13911        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13912    }
13913
13914    impl GetRequest {
13915        /// Creates a new default instance.
13916        pub fn new() -> Self {
13917            std::default::Default::default()
13918        }
13919
13920        /// Sets the value of [project][crate::model::projects::GetRequest::project].
13921        ///
13922        /// # Example
13923        /// ```ignore,no_run
13924        /// # use google_cloud_dns_v1::model::projects::GetRequest;
13925        /// let x = GetRequest::new().set_project("example");
13926        /// ```
13927        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13928            self.project = v.into();
13929            self
13930        }
13931    }
13932}
13933
13934/// Synthetic messages for the [resourceRecordSets][.resourceRecordSets] service
13935pub mod resource_record_sets {
13936    #[allow(unused_imports)]
13937    use super::*;
13938
13939    /// Synthetic request message for the [create()][.resourceRecordSets.create] method.
13940    #[derive(Clone, Default, PartialEq)]
13941    #[non_exhaustive]
13942    pub struct CreateRequest {
13943        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
13944        pub client_operation_id: std::option::Option<std::string::String>,
13945
13946        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
13947        pub managed_zone: std::string::String,
13948
13949        /// Identifies the project addressed by this request.
13950        pub project: std::string::String,
13951
13952        /// Synthetic request body field for the [create()][.resourceRecordSets.create] method.
13953        pub body: std::option::Option<crate::model::ResourceRecordSet>,
13954
13955        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13956    }
13957
13958    impl CreateRequest {
13959        /// Creates a new default instance.
13960        pub fn new() -> Self {
13961            std::default::Default::default()
13962        }
13963
13964        /// Sets the value of [client_operation_id][crate::model::resource_record_sets::CreateRequest::client_operation_id].
13965        ///
13966        /// # Example
13967        /// ```ignore,no_run
13968        /// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
13969        /// let x = CreateRequest::new().set_client_operation_id("example");
13970        /// ```
13971        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
13972        where
13973            T: std::convert::Into<std::string::String>,
13974        {
13975            self.client_operation_id = std::option::Option::Some(v.into());
13976            self
13977        }
13978
13979        /// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::CreateRequest::client_operation_id].
13980        ///
13981        /// # Example
13982        /// ```ignore,no_run
13983        /// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
13984        /// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
13985        /// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
13986        /// ```
13987        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
13988        where
13989            T: std::convert::Into<std::string::String>,
13990        {
13991            self.client_operation_id = v.map(|x| x.into());
13992            self
13993        }
13994
13995        /// Sets the value of [managed_zone][crate::model::resource_record_sets::CreateRequest::managed_zone].
13996        ///
13997        /// # Example
13998        /// ```ignore,no_run
13999        /// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
14000        /// let x = CreateRequest::new().set_managed_zone("example");
14001        /// ```
14002        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
14003            mut self,
14004            v: T,
14005        ) -> Self {
14006            self.managed_zone = v.into();
14007            self
14008        }
14009
14010        /// Sets the value of [project][crate::model::resource_record_sets::CreateRequest::project].
14011        ///
14012        /// # Example
14013        /// ```ignore,no_run
14014        /// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
14015        /// let x = CreateRequest::new().set_project("example");
14016        /// ```
14017        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14018            self.project = v.into();
14019            self
14020        }
14021
14022        /// Sets the value of [body][crate::model::resource_record_sets::CreateRequest::body].
14023        ///
14024        /// # Example
14025        /// ```ignore,no_run
14026        /// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
14027        /// use google_cloud_dns_v1::model::ResourceRecordSet;
14028        /// let x = CreateRequest::new().set_body(ResourceRecordSet::default()/* use setters */);
14029        /// ```
14030        pub fn set_body<T>(mut self, v: T) -> Self
14031        where
14032            T: std::convert::Into<crate::model::ResourceRecordSet>,
14033        {
14034            self.body = std::option::Option::Some(v.into());
14035            self
14036        }
14037
14038        /// Sets or clears the value of [body][crate::model::resource_record_sets::CreateRequest::body].
14039        ///
14040        /// # Example
14041        /// ```ignore,no_run
14042        /// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
14043        /// use google_cloud_dns_v1::model::ResourceRecordSet;
14044        /// let x = CreateRequest::new().set_or_clear_body(Some(ResourceRecordSet::default()/* use setters */));
14045        /// let x = CreateRequest::new().set_or_clear_body(None::<ResourceRecordSet>);
14046        /// ```
14047        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
14048        where
14049            T: std::convert::Into<crate::model::ResourceRecordSet>,
14050        {
14051            self.body = v.map(|x| x.into());
14052            self
14053        }
14054    }
14055
14056    /// Synthetic request message for the [delete()][.resourceRecordSets.delete] method.
14057    #[derive(Clone, Default, PartialEq)]
14058    #[non_exhaustive]
14059    pub struct DeleteRequest {
14060        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
14061        pub client_operation_id: std::option::Option<std::string::String>,
14062
14063        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
14064        pub managed_zone: std::string::String,
14065
14066        /// Fully qualified domain name.
14067        pub name: std::string::String,
14068
14069        /// Identifies the project addressed by this request.
14070        pub project: std::string::String,
14071
14072        /// RRSet type.
14073        pub r#type: std::string::String,
14074
14075        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14076    }
14077
14078    impl DeleteRequest {
14079        /// Creates a new default instance.
14080        pub fn new() -> Self {
14081            std::default::Default::default()
14082        }
14083
14084        /// Sets the value of [client_operation_id][crate::model::resource_record_sets::DeleteRequest::client_operation_id].
14085        ///
14086        /// # Example
14087        /// ```ignore,no_run
14088        /// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
14089        /// let x = DeleteRequest::new().set_client_operation_id("example");
14090        /// ```
14091        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
14092        where
14093            T: std::convert::Into<std::string::String>,
14094        {
14095            self.client_operation_id = std::option::Option::Some(v.into());
14096            self
14097        }
14098
14099        /// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::DeleteRequest::client_operation_id].
14100        ///
14101        /// # Example
14102        /// ```ignore,no_run
14103        /// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
14104        /// let x = DeleteRequest::new().set_or_clear_client_operation_id(Some("example"));
14105        /// let x = DeleteRequest::new().set_or_clear_client_operation_id(None::<String>);
14106        /// ```
14107        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
14108        where
14109            T: std::convert::Into<std::string::String>,
14110        {
14111            self.client_operation_id = v.map(|x| x.into());
14112            self
14113        }
14114
14115        /// Sets the value of [managed_zone][crate::model::resource_record_sets::DeleteRequest::managed_zone].
14116        ///
14117        /// # Example
14118        /// ```ignore,no_run
14119        /// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
14120        /// let x = DeleteRequest::new().set_managed_zone("example");
14121        /// ```
14122        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
14123            mut self,
14124            v: T,
14125        ) -> Self {
14126            self.managed_zone = v.into();
14127            self
14128        }
14129
14130        /// Sets the value of [name][crate::model::resource_record_sets::DeleteRequest::name].
14131        ///
14132        /// # Example
14133        /// ```ignore,no_run
14134        /// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
14135        /// let x = DeleteRequest::new().set_name("example");
14136        /// ```
14137        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14138            self.name = v.into();
14139            self
14140        }
14141
14142        /// Sets the value of [project][crate::model::resource_record_sets::DeleteRequest::project].
14143        ///
14144        /// # Example
14145        /// ```ignore,no_run
14146        /// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
14147        /// let x = DeleteRequest::new().set_project("example");
14148        /// ```
14149        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14150            self.project = v.into();
14151            self
14152        }
14153
14154        /// Sets the value of [r#type][crate::model::resource_record_sets::DeleteRequest::type].
14155        ///
14156        /// # Example
14157        /// ```ignore,no_run
14158        /// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
14159        /// let x = DeleteRequest::new().set_type("example");
14160        /// ```
14161        pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14162            self.r#type = v.into();
14163            self
14164        }
14165    }
14166
14167    /// Synthetic request message for the [get()][.resourceRecordSets.get] method.
14168    #[derive(Clone, Default, PartialEq)]
14169    #[non_exhaustive]
14170    pub struct GetRequest {
14171        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
14172        pub client_operation_id: std::option::Option<std::string::String>,
14173
14174        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
14175        pub managed_zone: std::string::String,
14176
14177        /// Fully qualified domain name.
14178        pub name: std::string::String,
14179
14180        /// Identifies the project addressed by this request.
14181        pub project: std::string::String,
14182
14183        /// RRSet type.
14184        pub r#type: std::string::String,
14185
14186        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14187    }
14188
14189    impl GetRequest {
14190        /// Creates a new default instance.
14191        pub fn new() -> Self {
14192            std::default::Default::default()
14193        }
14194
14195        /// Sets the value of [client_operation_id][crate::model::resource_record_sets::GetRequest::client_operation_id].
14196        ///
14197        /// # Example
14198        /// ```ignore,no_run
14199        /// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
14200        /// let x = GetRequest::new().set_client_operation_id("example");
14201        /// ```
14202        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
14203        where
14204            T: std::convert::Into<std::string::String>,
14205        {
14206            self.client_operation_id = std::option::Option::Some(v.into());
14207            self
14208        }
14209
14210        /// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::GetRequest::client_operation_id].
14211        ///
14212        /// # Example
14213        /// ```ignore,no_run
14214        /// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
14215        /// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
14216        /// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
14217        /// ```
14218        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
14219        where
14220            T: std::convert::Into<std::string::String>,
14221        {
14222            self.client_operation_id = v.map(|x| x.into());
14223            self
14224        }
14225
14226        /// Sets the value of [managed_zone][crate::model::resource_record_sets::GetRequest::managed_zone].
14227        ///
14228        /// # Example
14229        /// ```ignore,no_run
14230        /// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
14231        /// let x = GetRequest::new().set_managed_zone("example");
14232        /// ```
14233        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
14234            mut self,
14235            v: T,
14236        ) -> Self {
14237            self.managed_zone = v.into();
14238            self
14239        }
14240
14241        /// Sets the value of [name][crate::model::resource_record_sets::GetRequest::name].
14242        ///
14243        /// # Example
14244        /// ```ignore,no_run
14245        /// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
14246        /// let x = GetRequest::new().set_name("example");
14247        /// ```
14248        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14249            self.name = v.into();
14250            self
14251        }
14252
14253        /// Sets the value of [project][crate::model::resource_record_sets::GetRequest::project].
14254        ///
14255        /// # Example
14256        /// ```ignore,no_run
14257        /// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
14258        /// let x = GetRequest::new().set_project("example");
14259        /// ```
14260        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14261            self.project = v.into();
14262            self
14263        }
14264
14265        /// Sets the value of [r#type][crate::model::resource_record_sets::GetRequest::type].
14266        ///
14267        /// # Example
14268        /// ```ignore,no_run
14269        /// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
14270        /// let x = GetRequest::new().set_type("example");
14271        /// ```
14272        pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14273            self.r#type = v.into();
14274            self
14275        }
14276    }
14277
14278    /// Synthetic request message for the [list()][.resourceRecordSets.list] method.
14279    #[derive(Clone, Default, PartialEq)]
14280    #[non_exhaustive]
14281    pub struct ListRequest {
14282        /// Specify a filter expression to view records that exactly match the specified domain. Both the `name` and `type` parameters are not supported and must be omitted when you use `filter`. Your `filter` expression must conform to AIP-160 and you must specify a domain in the `name` field. Optionally, you can include the `type` field to filter records by type. You can also include the `has_suffix` function to view records that match by domain suffix. Examples: * `name`="example.com." * `name`="example.com." AND type="A" * `name`=`has_suffix`("example.com.") * `name`=`has_suffix`("example.com.") AND type="A"
14283        pub filter: std::option::Option<std::string::String>,
14284
14285        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
14286        pub managed_zone: std::string::String,
14287
14288        /// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
14289        pub max_results: std::option::Option<i32>,
14290
14291        /// Specify a fully qualified domain name to view only those records. The `name` parameter is not supported and must be omitted when you use `filter`.
14292        pub name: std::option::Option<std::string::String>,
14293
14294        /// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
14295        pub page_token: std::option::Option<std::string::String>,
14296
14297        /// Identifies the project addressed by this request.
14298        pub project: std::string::String,
14299
14300        /// Specify a record type to view only those records. You must also specify the `name` parameter. The `type` parameter is not supported and must be omitted when you use `filter`.
14301        pub r#type: std::option::Option<std::string::String>,
14302
14303        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14304    }
14305
14306    impl ListRequest {
14307        /// Creates a new default instance.
14308        pub fn new() -> Self {
14309            std::default::Default::default()
14310        }
14311
14312        /// Sets the value of [filter][crate::model::resource_record_sets::ListRequest::filter].
14313        ///
14314        /// # Example
14315        /// ```ignore,no_run
14316        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14317        /// let x = ListRequest::new().set_filter("example");
14318        /// ```
14319        pub fn set_filter<T>(mut self, v: T) -> Self
14320        where
14321            T: std::convert::Into<std::string::String>,
14322        {
14323            self.filter = std::option::Option::Some(v.into());
14324            self
14325        }
14326
14327        /// Sets or clears the value of [filter][crate::model::resource_record_sets::ListRequest::filter].
14328        ///
14329        /// # Example
14330        /// ```ignore,no_run
14331        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14332        /// let x = ListRequest::new().set_or_clear_filter(Some("example"));
14333        /// let x = ListRequest::new().set_or_clear_filter(None::<String>);
14334        /// ```
14335        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
14336        where
14337            T: std::convert::Into<std::string::String>,
14338        {
14339            self.filter = v.map(|x| x.into());
14340            self
14341        }
14342
14343        /// Sets the value of [managed_zone][crate::model::resource_record_sets::ListRequest::managed_zone].
14344        ///
14345        /// # Example
14346        /// ```ignore,no_run
14347        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14348        /// let x = ListRequest::new().set_managed_zone("example");
14349        /// ```
14350        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
14351            mut self,
14352            v: T,
14353        ) -> Self {
14354            self.managed_zone = v.into();
14355            self
14356        }
14357
14358        /// Sets the value of [max_results][crate::model::resource_record_sets::ListRequest::max_results].
14359        ///
14360        /// # Example
14361        /// ```ignore,no_run
14362        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14363        /// let x = ListRequest::new().set_max_results(42);
14364        /// ```
14365        pub fn set_max_results<T>(mut self, v: T) -> Self
14366        where
14367            T: std::convert::Into<i32>,
14368        {
14369            self.max_results = std::option::Option::Some(v.into());
14370            self
14371        }
14372
14373        /// Sets or clears the value of [max_results][crate::model::resource_record_sets::ListRequest::max_results].
14374        ///
14375        /// # Example
14376        /// ```ignore,no_run
14377        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14378        /// let x = ListRequest::new().set_or_clear_max_results(Some(42));
14379        /// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
14380        /// ```
14381        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
14382        where
14383            T: std::convert::Into<i32>,
14384        {
14385            self.max_results = v.map(|x| x.into());
14386            self
14387        }
14388
14389        /// Sets the value of [name][crate::model::resource_record_sets::ListRequest::name].
14390        ///
14391        /// # Example
14392        /// ```ignore,no_run
14393        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14394        /// let x = ListRequest::new().set_name("example");
14395        /// ```
14396        pub fn set_name<T>(mut self, v: T) -> Self
14397        where
14398            T: std::convert::Into<std::string::String>,
14399        {
14400            self.name = std::option::Option::Some(v.into());
14401            self
14402        }
14403
14404        /// Sets or clears the value of [name][crate::model::resource_record_sets::ListRequest::name].
14405        ///
14406        /// # Example
14407        /// ```ignore,no_run
14408        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14409        /// let x = ListRequest::new().set_or_clear_name(Some("example"));
14410        /// let x = ListRequest::new().set_or_clear_name(None::<String>);
14411        /// ```
14412        pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
14413        where
14414            T: std::convert::Into<std::string::String>,
14415        {
14416            self.name = v.map(|x| x.into());
14417            self
14418        }
14419
14420        /// Sets the value of [page_token][crate::model::resource_record_sets::ListRequest::page_token].
14421        ///
14422        /// # Example
14423        /// ```ignore,no_run
14424        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14425        /// let x = ListRequest::new().set_page_token("example");
14426        /// ```
14427        pub fn set_page_token<T>(mut self, v: T) -> Self
14428        where
14429            T: std::convert::Into<std::string::String>,
14430        {
14431            self.page_token = std::option::Option::Some(v.into());
14432            self
14433        }
14434
14435        /// Sets or clears the value of [page_token][crate::model::resource_record_sets::ListRequest::page_token].
14436        ///
14437        /// # Example
14438        /// ```ignore,no_run
14439        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14440        /// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
14441        /// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
14442        /// ```
14443        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
14444        where
14445            T: std::convert::Into<std::string::String>,
14446        {
14447            self.page_token = v.map(|x| x.into());
14448            self
14449        }
14450
14451        /// Sets the value of [project][crate::model::resource_record_sets::ListRequest::project].
14452        ///
14453        /// # Example
14454        /// ```ignore,no_run
14455        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14456        /// let x = ListRequest::new().set_project("example");
14457        /// ```
14458        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14459            self.project = v.into();
14460            self
14461        }
14462
14463        /// Sets the value of [r#type][crate::model::resource_record_sets::ListRequest::type].
14464        ///
14465        /// # Example
14466        /// ```ignore,no_run
14467        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14468        /// let x = ListRequest::new().set_type("example");
14469        /// ```
14470        pub fn set_type<T>(mut self, v: T) -> Self
14471        where
14472            T: std::convert::Into<std::string::String>,
14473        {
14474            self.r#type = std::option::Option::Some(v.into());
14475            self
14476        }
14477
14478        /// Sets or clears the value of [r#type][crate::model::resource_record_sets::ListRequest::type].
14479        ///
14480        /// # Example
14481        /// ```ignore,no_run
14482        /// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
14483        /// let x = ListRequest::new().set_or_clear_type(Some("example"));
14484        /// let x = ListRequest::new().set_or_clear_type(None::<String>);
14485        /// ```
14486        pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
14487        where
14488            T: std::convert::Into<std::string::String>,
14489        {
14490            self.r#type = v.map(|x| x.into());
14491            self
14492        }
14493    }
14494
14495    /// Synthetic request message for the [patch()][.resourceRecordSets.patch] method.
14496    #[derive(Clone, Default, PartialEq)]
14497    #[non_exhaustive]
14498    pub struct PatchRequest {
14499        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
14500        pub client_operation_id: std::option::Option<std::string::String>,
14501
14502        /// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
14503        pub managed_zone: std::string::String,
14504
14505        /// Fully qualified domain name.
14506        pub name: std::string::String,
14507
14508        /// Identifies the project addressed by this request.
14509        pub project: std::string::String,
14510
14511        /// RRSet type.
14512        pub r#type: std::string::String,
14513
14514        /// Synthetic request body field for the [patch()][.resourceRecordSets.patch] method.
14515        pub body: std::option::Option<crate::model::ResourceRecordSet>,
14516
14517        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14518    }
14519
14520    impl PatchRequest {
14521        /// Creates a new default instance.
14522        pub fn new() -> Self {
14523            std::default::Default::default()
14524        }
14525
14526        /// Sets the value of [client_operation_id][crate::model::resource_record_sets::PatchRequest::client_operation_id].
14527        ///
14528        /// # Example
14529        /// ```ignore,no_run
14530        /// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
14531        /// let x = PatchRequest::new().set_client_operation_id("example");
14532        /// ```
14533        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
14534        where
14535            T: std::convert::Into<std::string::String>,
14536        {
14537            self.client_operation_id = std::option::Option::Some(v.into());
14538            self
14539        }
14540
14541        /// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::PatchRequest::client_operation_id].
14542        ///
14543        /// # Example
14544        /// ```ignore,no_run
14545        /// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
14546        /// let x = PatchRequest::new().set_or_clear_client_operation_id(Some("example"));
14547        /// let x = PatchRequest::new().set_or_clear_client_operation_id(None::<String>);
14548        /// ```
14549        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
14550        where
14551            T: std::convert::Into<std::string::String>,
14552        {
14553            self.client_operation_id = v.map(|x| x.into());
14554            self
14555        }
14556
14557        /// Sets the value of [managed_zone][crate::model::resource_record_sets::PatchRequest::managed_zone].
14558        ///
14559        /// # Example
14560        /// ```ignore,no_run
14561        /// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
14562        /// let x = PatchRequest::new().set_managed_zone("example");
14563        /// ```
14564        pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
14565            mut self,
14566            v: T,
14567        ) -> Self {
14568            self.managed_zone = v.into();
14569            self
14570        }
14571
14572        /// Sets the value of [name][crate::model::resource_record_sets::PatchRequest::name].
14573        ///
14574        /// # Example
14575        /// ```ignore,no_run
14576        /// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
14577        /// let x = PatchRequest::new().set_name("example");
14578        /// ```
14579        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14580            self.name = v.into();
14581            self
14582        }
14583
14584        /// Sets the value of [project][crate::model::resource_record_sets::PatchRequest::project].
14585        ///
14586        /// # Example
14587        /// ```ignore,no_run
14588        /// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
14589        /// let x = PatchRequest::new().set_project("example");
14590        /// ```
14591        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14592            self.project = v.into();
14593            self
14594        }
14595
14596        /// Sets the value of [r#type][crate::model::resource_record_sets::PatchRequest::type].
14597        ///
14598        /// # Example
14599        /// ```ignore,no_run
14600        /// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
14601        /// let x = PatchRequest::new().set_type("example");
14602        /// ```
14603        pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14604            self.r#type = v.into();
14605            self
14606        }
14607
14608        /// Sets the value of [body][crate::model::resource_record_sets::PatchRequest::body].
14609        ///
14610        /// # Example
14611        /// ```ignore,no_run
14612        /// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
14613        /// use google_cloud_dns_v1::model::ResourceRecordSet;
14614        /// let x = PatchRequest::new().set_body(ResourceRecordSet::default()/* use setters */);
14615        /// ```
14616        pub fn set_body<T>(mut self, v: T) -> Self
14617        where
14618            T: std::convert::Into<crate::model::ResourceRecordSet>,
14619        {
14620            self.body = std::option::Option::Some(v.into());
14621            self
14622        }
14623
14624        /// Sets or clears the value of [body][crate::model::resource_record_sets::PatchRequest::body].
14625        ///
14626        /// # Example
14627        /// ```ignore,no_run
14628        /// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
14629        /// use google_cloud_dns_v1::model::ResourceRecordSet;
14630        /// let x = PatchRequest::new().set_or_clear_body(Some(ResourceRecordSet::default()/* use setters */));
14631        /// let x = PatchRequest::new().set_or_clear_body(None::<ResourceRecordSet>);
14632        /// ```
14633        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
14634        where
14635            T: std::convert::Into<crate::model::ResourceRecordSet>,
14636        {
14637            self.body = v.map(|x| x.into());
14638            self
14639        }
14640    }
14641}
14642
14643/// Synthetic messages for the [responsePolicies][.responsePolicies] service
14644pub mod response_policies {
14645    #[allow(unused_imports)]
14646    use super::*;
14647
14648    /// Synthetic request message for the [create()][.responsePolicies.create] method.
14649    #[derive(Clone, Default, PartialEq)]
14650    #[non_exhaustive]
14651    pub struct CreateRequest {
14652        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
14653        pub client_operation_id: std::option::Option<std::string::String>,
14654
14655        /// Identifies the project addressed by this request.
14656        pub project: std::string::String,
14657
14658        /// Synthetic request body field for the [create()][.responsePolicies.create] method.
14659        pub body: std::option::Option<crate::model::ResponsePolicy>,
14660
14661        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14662    }
14663
14664    impl CreateRequest {
14665        /// Creates a new default instance.
14666        pub fn new() -> Self {
14667            std::default::Default::default()
14668        }
14669
14670        /// Sets the value of [client_operation_id][crate::model::response_policies::CreateRequest::client_operation_id].
14671        ///
14672        /// # Example
14673        /// ```ignore,no_run
14674        /// # use google_cloud_dns_v1::model::response_policies::CreateRequest;
14675        /// let x = CreateRequest::new().set_client_operation_id("example");
14676        /// ```
14677        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
14678        where
14679            T: std::convert::Into<std::string::String>,
14680        {
14681            self.client_operation_id = std::option::Option::Some(v.into());
14682            self
14683        }
14684
14685        /// Sets or clears the value of [client_operation_id][crate::model::response_policies::CreateRequest::client_operation_id].
14686        ///
14687        /// # Example
14688        /// ```ignore,no_run
14689        /// # use google_cloud_dns_v1::model::response_policies::CreateRequest;
14690        /// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
14691        /// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
14692        /// ```
14693        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
14694        where
14695            T: std::convert::Into<std::string::String>,
14696        {
14697            self.client_operation_id = v.map(|x| x.into());
14698            self
14699        }
14700
14701        /// Sets the value of [project][crate::model::response_policies::CreateRequest::project].
14702        ///
14703        /// # Example
14704        /// ```ignore,no_run
14705        /// # use google_cloud_dns_v1::model::response_policies::CreateRequest;
14706        /// let x = CreateRequest::new().set_project("example");
14707        /// ```
14708        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14709            self.project = v.into();
14710            self
14711        }
14712
14713        /// Sets the value of [body][crate::model::response_policies::CreateRequest::body].
14714        ///
14715        /// # Example
14716        /// ```ignore,no_run
14717        /// # use google_cloud_dns_v1::model::response_policies::CreateRequest;
14718        /// use google_cloud_dns_v1::model::ResponsePolicy;
14719        /// let x = CreateRequest::new().set_body(ResponsePolicy::default()/* use setters */);
14720        /// ```
14721        pub fn set_body<T>(mut self, v: T) -> Self
14722        where
14723            T: std::convert::Into<crate::model::ResponsePolicy>,
14724        {
14725            self.body = std::option::Option::Some(v.into());
14726            self
14727        }
14728
14729        /// Sets or clears the value of [body][crate::model::response_policies::CreateRequest::body].
14730        ///
14731        /// # Example
14732        /// ```ignore,no_run
14733        /// # use google_cloud_dns_v1::model::response_policies::CreateRequest;
14734        /// use google_cloud_dns_v1::model::ResponsePolicy;
14735        /// let x = CreateRequest::new().set_or_clear_body(Some(ResponsePolicy::default()/* use setters */));
14736        /// let x = CreateRequest::new().set_or_clear_body(None::<ResponsePolicy>);
14737        /// ```
14738        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
14739        where
14740            T: std::convert::Into<crate::model::ResponsePolicy>,
14741        {
14742            self.body = v.map(|x| x.into());
14743            self
14744        }
14745    }
14746
14747    /// Synthetic request message for the [delete()][.responsePolicies.delete] method.
14748    #[derive(Clone, Default, PartialEq)]
14749    #[non_exhaustive]
14750    pub struct DeleteRequest {
14751        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
14752        pub client_operation_id: std::option::Option<std::string::String>,
14753
14754        /// Identifies the project addressed by this request.
14755        pub project: std::string::String,
14756
14757        /// User assigned name of the Response Policy addressed by this request.
14758        pub response_policy: std::string::String,
14759
14760        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14761    }
14762
14763    impl DeleteRequest {
14764        /// Creates a new default instance.
14765        pub fn new() -> Self {
14766            std::default::Default::default()
14767        }
14768
14769        /// Sets the value of [client_operation_id][crate::model::response_policies::DeleteRequest::client_operation_id].
14770        ///
14771        /// # Example
14772        /// ```ignore,no_run
14773        /// # use google_cloud_dns_v1::model::response_policies::DeleteRequest;
14774        /// let x = DeleteRequest::new().set_client_operation_id("example");
14775        /// ```
14776        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
14777        where
14778            T: std::convert::Into<std::string::String>,
14779        {
14780            self.client_operation_id = std::option::Option::Some(v.into());
14781            self
14782        }
14783
14784        /// Sets or clears the value of [client_operation_id][crate::model::response_policies::DeleteRequest::client_operation_id].
14785        ///
14786        /// # Example
14787        /// ```ignore,no_run
14788        /// # use google_cloud_dns_v1::model::response_policies::DeleteRequest;
14789        /// let x = DeleteRequest::new().set_or_clear_client_operation_id(Some("example"));
14790        /// let x = DeleteRequest::new().set_or_clear_client_operation_id(None::<String>);
14791        /// ```
14792        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
14793        where
14794            T: std::convert::Into<std::string::String>,
14795        {
14796            self.client_operation_id = v.map(|x| x.into());
14797            self
14798        }
14799
14800        /// Sets the value of [project][crate::model::response_policies::DeleteRequest::project].
14801        ///
14802        /// # Example
14803        /// ```ignore,no_run
14804        /// # use google_cloud_dns_v1::model::response_policies::DeleteRequest;
14805        /// let x = DeleteRequest::new().set_project("example");
14806        /// ```
14807        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14808            self.project = v.into();
14809            self
14810        }
14811
14812        /// Sets the value of [response_policy][crate::model::response_policies::DeleteRequest::response_policy].
14813        ///
14814        /// # Example
14815        /// ```ignore,no_run
14816        /// # use google_cloud_dns_v1::model::response_policies::DeleteRequest;
14817        /// let x = DeleteRequest::new().set_response_policy("example");
14818        /// ```
14819        pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
14820            mut self,
14821            v: T,
14822        ) -> Self {
14823            self.response_policy = v.into();
14824            self
14825        }
14826    }
14827
14828    /// Synthetic request message for the [get()][.responsePolicies.get] method.
14829    #[derive(Clone, Default, PartialEq)]
14830    #[non_exhaustive]
14831    pub struct GetRequest {
14832        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
14833        pub client_operation_id: std::option::Option<std::string::String>,
14834
14835        /// Identifies the project addressed by this request.
14836        pub project: std::string::String,
14837
14838        /// User assigned name of the Response Policy addressed by this request.
14839        pub response_policy: std::string::String,
14840
14841        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14842    }
14843
14844    impl GetRequest {
14845        /// Creates a new default instance.
14846        pub fn new() -> Self {
14847            std::default::Default::default()
14848        }
14849
14850        /// Sets the value of [client_operation_id][crate::model::response_policies::GetRequest::client_operation_id].
14851        ///
14852        /// # Example
14853        /// ```ignore,no_run
14854        /// # use google_cloud_dns_v1::model::response_policies::GetRequest;
14855        /// let x = GetRequest::new().set_client_operation_id("example");
14856        /// ```
14857        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
14858        where
14859            T: std::convert::Into<std::string::String>,
14860        {
14861            self.client_operation_id = std::option::Option::Some(v.into());
14862            self
14863        }
14864
14865        /// Sets or clears the value of [client_operation_id][crate::model::response_policies::GetRequest::client_operation_id].
14866        ///
14867        /// # Example
14868        /// ```ignore,no_run
14869        /// # use google_cloud_dns_v1::model::response_policies::GetRequest;
14870        /// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
14871        /// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
14872        /// ```
14873        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
14874        where
14875            T: std::convert::Into<std::string::String>,
14876        {
14877            self.client_operation_id = v.map(|x| x.into());
14878            self
14879        }
14880
14881        /// Sets the value of [project][crate::model::response_policies::GetRequest::project].
14882        ///
14883        /// # Example
14884        /// ```ignore,no_run
14885        /// # use google_cloud_dns_v1::model::response_policies::GetRequest;
14886        /// let x = GetRequest::new().set_project("example");
14887        /// ```
14888        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14889            self.project = v.into();
14890            self
14891        }
14892
14893        /// Sets the value of [response_policy][crate::model::response_policies::GetRequest::response_policy].
14894        ///
14895        /// # Example
14896        /// ```ignore,no_run
14897        /// # use google_cloud_dns_v1::model::response_policies::GetRequest;
14898        /// let x = GetRequest::new().set_response_policy("example");
14899        /// ```
14900        pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
14901            mut self,
14902            v: T,
14903        ) -> Self {
14904            self.response_policy = v.into();
14905            self
14906        }
14907    }
14908
14909    /// Synthetic request message for the [list()][.responsePolicies.list] method.
14910    #[derive(Clone, Default, PartialEq)]
14911    #[non_exhaustive]
14912    pub struct ListRequest {
14913        /// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
14914        pub max_results: std::option::Option<i32>,
14915
14916        /// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
14917        pub page_token: std::option::Option<std::string::String>,
14918
14919        /// Identifies the project addressed by this request.
14920        pub project: std::string::String,
14921
14922        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14923    }
14924
14925    impl ListRequest {
14926        /// Creates a new default instance.
14927        pub fn new() -> Self {
14928            std::default::Default::default()
14929        }
14930
14931        /// Sets the value of [max_results][crate::model::response_policies::ListRequest::max_results].
14932        ///
14933        /// # Example
14934        /// ```ignore,no_run
14935        /// # use google_cloud_dns_v1::model::response_policies::ListRequest;
14936        /// let x = ListRequest::new().set_max_results(42);
14937        /// ```
14938        pub fn set_max_results<T>(mut self, v: T) -> Self
14939        where
14940            T: std::convert::Into<i32>,
14941        {
14942            self.max_results = std::option::Option::Some(v.into());
14943            self
14944        }
14945
14946        /// Sets or clears the value of [max_results][crate::model::response_policies::ListRequest::max_results].
14947        ///
14948        /// # Example
14949        /// ```ignore,no_run
14950        /// # use google_cloud_dns_v1::model::response_policies::ListRequest;
14951        /// let x = ListRequest::new().set_or_clear_max_results(Some(42));
14952        /// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
14953        /// ```
14954        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
14955        where
14956            T: std::convert::Into<i32>,
14957        {
14958            self.max_results = v.map(|x| x.into());
14959            self
14960        }
14961
14962        /// Sets the value of [page_token][crate::model::response_policies::ListRequest::page_token].
14963        ///
14964        /// # Example
14965        /// ```ignore,no_run
14966        /// # use google_cloud_dns_v1::model::response_policies::ListRequest;
14967        /// let x = ListRequest::new().set_page_token("example");
14968        /// ```
14969        pub fn set_page_token<T>(mut self, v: T) -> Self
14970        where
14971            T: std::convert::Into<std::string::String>,
14972        {
14973            self.page_token = std::option::Option::Some(v.into());
14974            self
14975        }
14976
14977        /// Sets or clears the value of [page_token][crate::model::response_policies::ListRequest::page_token].
14978        ///
14979        /// # Example
14980        /// ```ignore,no_run
14981        /// # use google_cloud_dns_v1::model::response_policies::ListRequest;
14982        /// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
14983        /// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
14984        /// ```
14985        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
14986        where
14987            T: std::convert::Into<std::string::String>,
14988        {
14989            self.page_token = v.map(|x| x.into());
14990            self
14991        }
14992
14993        /// Sets the value of [project][crate::model::response_policies::ListRequest::project].
14994        ///
14995        /// # Example
14996        /// ```ignore,no_run
14997        /// # use google_cloud_dns_v1::model::response_policies::ListRequest;
14998        /// let x = ListRequest::new().set_project("example");
14999        /// ```
15000        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15001            self.project = v.into();
15002            self
15003        }
15004    }
15005
15006    /// Synthetic request message for the [patch()][.responsePolicies.patch] method.
15007    #[derive(Clone, Default, PartialEq)]
15008    #[non_exhaustive]
15009    pub struct PatchRequest {
15010        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
15011        pub client_operation_id: std::option::Option<std::string::String>,
15012
15013        /// Identifies the project addressed by this request.
15014        pub project: std::string::String,
15015
15016        /// User assigned name of the response policy addressed by this request.
15017        pub response_policy: std::string::String,
15018
15019        /// Synthetic request body field for the [patch()][.responsePolicies.patch] method.
15020        pub body: std::option::Option<crate::model::ResponsePolicy>,
15021
15022        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15023    }
15024
15025    impl PatchRequest {
15026        /// Creates a new default instance.
15027        pub fn new() -> Self {
15028            std::default::Default::default()
15029        }
15030
15031        /// Sets the value of [client_operation_id][crate::model::response_policies::PatchRequest::client_operation_id].
15032        ///
15033        /// # Example
15034        /// ```ignore,no_run
15035        /// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
15036        /// let x = PatchRequest::new().set_client_operation_id("example");
15037        /// ```
15038        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
15039        where
15040            T: std::convert::Into<std::string::String>,
15041        {
15042            self.client_operation_id = std::option::Option::Some(v.into());
15043            self
15044        }
15045
15046        /// Sets or clears the value of [client_operation_id][crate::model::response_policies::PatchRequest::client_operation_id].
15047        ///
15048        /// # Example
15049        /// ```ignore,no_run
15050        /// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
15051        /// let x = PatchRequest::new().set_or_clear_client_operation_id(Some("example"));
15052        /// let x = PatchRequest::new().set_or_clear_client_operation_id(None::<String>);
15053        /// ```
15054        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
15055        where
15056            T: std::convert::Into<std::string::String>,
15057        {
15058            self.client_operation_id = v.map(|x| x.into());
15059            self
15060        }
15061
15062        /// Sets the value of [project][crate::model::response_policies::PatchRequest::project].
15063        ///
15064        /// # Example
15065        /// ```ignore,no_run
15066        /// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
15067        /// let x = PatchRequest::new().set_project("example");
15068        /// ```
15069        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15070            self.project = v.into();
15071            self
15072        }
15073
15074        /// Sets the value of [response_policy][crate::model::response_policies::PatchRequest::response_policy].
15075        ///
15076        /// # Example
15077        /// ```ignore,no_run
15078        /// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
15079        /// let x = PatchRequest::new().set_response_policy("example");
15080        /// ```
15081        pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
15082            mut self,
15083            v: T,
15084        ) -> Self {
15085            self.response_policy = v.into();
15086            self
15087        }
15088
15089        /// Sets the value of [body][crate::model::response_policies::PatchRequest::body].
15090        ///
15091        /// # Example
15092        /// ```ignore,no_run
15093        /// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
15094        /// use google_cloud_dns_v1::model::ResponsePolicy;
15095        /// let x = PatchRequest::new().set_body(ResponsePolicy::default()/* use setters */);
15096        /// ```
15097        pub fn set_body<T>(mut self, v: T) -> Self
15098        where
15099            T: std::convert::Into<crate::model::ResponsePolicy>,
15100        {
15101            self.body = std::option::Option::Some(v.into());
15102            self
15103        }
15104
15105        /// Sets or clears the value of [body][crate::model::response_policies::PatchRequest::body].
15106        ///
15107        /// # Example
15108        /// ```ignore,no_run
15109        /// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
15110        /// use google_cloud_dns_v1::model::ResponsePolicy;
15111        /// let x = PatchRequest::new().set_or_clear_body(Some(ResponsePolicy::default()/* use setters */));
15112        /// let x = PatchRequest::new().set_or_clear_body(None::<ResponsePolicy>);
15113        /// ```
15114        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15115        where
15116            T: std::convert::Into<crate::model::ResponsePolicy>,
15117        {
15118            self.body = v.map(|x| x.into());
15119            self
15120        }
15121    }
15122
15123    /// Synthetic request message for the [update()][.responsePolicies.update] method.
15124    #[derive(Clone, Default, PartialEq)]
15125    #[non_exhaustive]
15126    pub struct UpdateRequest {
15127        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
15128        pub client_operation_id: std::option::Option<std::string::String>,
15129
15130        /// Identifies the project addressed by this request.
15131        pub project: std::string::String,
15132
15133        /// User assigned name of the Response Policy addressed by this request.
15134        pub response_policy: std::string::String,
15135
15136        /// Synthetic request body field for the [update()][.responsePolicies.update] method.
15137        pub body: std::option::Option<crate::model::ResponsePolicy>,
15138
15139        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15140    }
15141
15142    impl UpdateRequest {
15143        /// Creates a new default instance.
15144        pub fn new() -> Self {
15145            std::default::Default::default()
15146        }
15147
15148        /// Sets the value of [client_operation_id][crate::model::response_policies::UpdateRequest::client_operation_id].
15149        ///
15150        /// # Example
15151        /// ```ignore,no_run
15152        /// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
15153        /// let x = UpdateRequest::new().set_client_operation_id("example");
15154        /// ```
15155        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
15156        where
15157            T: std::convert::Into<std::string::String>,
15158        {
15159            self.client_operation_id = std::option::Option::Some(v.into());
15160            self
15161        }
15162
15163        /// Sets or clears the value of [client_operation_id][crate::model::response_policies::UpdateRequest::client_operation_id].
15164        ///
15165        /// # Example
15166        /// ```ignore,no_run
15167        /// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
15168        /// let x = UpdateRequest::new().set_or_clear_client_operation_id(Some("example"));
15169        /// let x = UpdateRequest::new().set_or_clear_client_operation_id(None::<String>);
15170        /// ```
15171        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
15172        where
15173            T: std::convert::Into<std::string::String>,
15174        {
15175            self.client_operation_id = v.map(|x| x.into());
15176            self
15177        }
15178
15179        /// Sets the value of [project][crate::model::response_policies::UpdateRequest::project].
15180        ///
15181        /// # Example
15182        /// ```ignore,no_run
15183        /// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
15184        /// let x = UpdateRequest::new().set_project("example");
15185        /// ```
15186        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15187            self.project = v.into();
15188            self
15189        }
15190
15191        /// Sets the value of [response_policy][crate::model::response_policies::UpdateRequest::response_policy].
15192        ///
15193        /// # Example
15194        /// ```ignore,no_run
15195        /// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
15196        /// let x = UpdateRequest::new().set_response_policy("example");
15197        /// ```
15198        pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
15199            mut self,
15200            v: T,
15201        ) -> Self {
15202            self.response_policy = v.into();
15203            self
15204        }
15205
15206        /// Sets the value of [body][crate::model::response_policies::UpdateRequest::body].
15207        ///
15208        /// # Example
15209        /// ```ignore,no_run
15210        /// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
15211        /// use google_cloud_dns_v1::model::ResponsePolicy;
15212        /// let x = UpdateRequest::new().set_body(ResponsePolicy::default()/* use setters */);
15213        /// ```
15214        pub fn set_body<T>(mut self, v: T) -> Self
15215        where
15216            T: std::convert::Into<crate::model::ResponsePolicy>,
15217        {
15218            self.body = std::option::Option::Some(v.into());
15219            self
15220        }
15221
15222        /// Sets or clears the value of [body][crate::model::response_policies::UpdateRequest::body].
15223        ///
15224        /// # Example
15225        /// ```ignore,no_run
15226        /// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
15227        /// use google_cloud_dns_v1::model::ResponsePolicy;
15228        /// let x = UpdateRequest::new().set_or_clear_body(Some(ResponsePolicy::default()/* use setters */));
15229        /// let x = UpdateRequest::new().set_or_clear_body(None::<ResponsePolicy>);
15230        /// ```
15231        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15232        where
15233            T: std::convert::Into<crate::model::ResponsePolicy>,
15234        {
15235            self.body = v.map(|x| x.into());
15236            self
15237        }
15238    }
15239}
15240
15241/// Synthetic messages for the [responsePolicyRules][.responsePolicyRules] service
15242pub mod response_policy_rules {
15243    #[allow(unused_imports)]
15244    use super::*;
15245
15246    /// Synthetic request message for the [create()][.responsePolicyRules.create] method.
15247    #[derive(Clone, Default, PartialEq)]
15248    #[non_exhaustive]
15249    pub struct CreateRequest {
15250        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
15251        pub client_operation_id: std::option::Option<std::string::String>,
15252
15253        /// Identifies the project addressed by this request.
15254        pub project: std::string::String,
15255
15256        /// User assigned name of the Response Policy containing the Response Policy Rule.
15257        pub response_policy: std::string::String,
15258
15259        /// Synthetic request body field for the [create()][.responsePolicyRules.create] method.
15260        pub body: std::option::Option<crate::model::ResponsePolicyRule>,
15261
15262        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15263    }
15264
15265    impl CreateRequest {
15266        /// Creates a new default instance.
15267        pub fn new() -> Self {
15268            std::default::Default::default()
15269        }
15270
15271        /// Sets the value of [client_operation_id][crate::model::response_policy_rules::CreateRequest::client_operation_id].
15272        ///
15273        /// # Example
15274        /// ```ignore,no_run
15275        /// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
15276        /// let x = CreateRequest::new().set_client_operation_id("example");
15277        /// ```
15278        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
15279        where
15280            T: std::convert::Into<std::string::String>,
15281        {
15282            self.client_operation_id = std::option::Option::Some(v.into());
15283            self
15284        }
15285
15286        /// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::CreateRequest::client_operation_id].
15287        ///
15288        /// # Example
15289        /// ```ignore,no_run
15290        /// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
15291        /// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
15292        /// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
15293        /// ```
15294        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
15295        where
15296            T: std::convert::Into<std::string::String>,
15297        {
15298            self.client_operation_id = v.map(|x| x.into());
15299            self
15300        }
15301
15302        /// Sets the value of [project][crate::model::response_policy_rules::CreateRequest::project].
15303        ///
15304        /// # Example
15305        /// ```ignore,no_run
15306        /// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
15307        /// let x = CreateRequest::new().set_project("example");
15308        /// ```
15309        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15310            self.project = v.into();
15311            self
15312        }
15313
15314        /// Sets the value of [response_policy][crate::model::response_policy_rules::CreateRequest::response_policy].
15315        ///
15316        /// # Example
15317        /// ```ignore,no_run
15318        /// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
15319        /// let x = CreateRequest::new().set_response_policy("example");
15320        /// ```
15321        pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
15322            mut self,
15323            v: T,
15324        ) -> Self {
15325            self.response_policy = v.into();
15326            self
15327        }
15328
15329        /// Sets the value of [body][crate::model::response_policy_rules::CreateRequest::body].
15330        ///
15331        /// # Example
15332        /// ```ignore,no_run
15333        /// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
15334        /// use google_cloud_dns_v1::model::ResponsePolicyRule;
15335        /// let x = CreateRequest::new().set_body(ResponsePolicyRule::default()/* use setters */);
15336        /// ```
15337        pub fn set_body<T>(mut self, v: T) -> Self
15338        where
15339            T: std::convert::Into<crate::model::ResponsePolicyRule>,
15340        {
15341            self.body = std::option::Option::Some(v.into());
15342            self
15343        }
15344
15345        /// Sets or clears the value of [body][crate::model::response_policy_rules::CreateRequest::body].
15346        ///
15347        /// # Example
15348        /// ```ignore,no_run
15349        /// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
15350        /// use google_cloud_dns_v1::model::ResponsePolicyRule;
15351        /// let x = CreateRequest::new().set_or_clear_body(Some(ResponsePolicyRule::default()/* use setters */));
15352        /// let x = CreateRequest::new().set_or_clear_body(None::<ResponsePolicyRule>);
15353        /// ```
15354        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15355        where
15356            T: std::convert::Into<crate::model::ResponsePolicyRule>,
15357        {
15358            self.body = v.map(|x| x.into());
15359            self
15360        }
15361    }
15362
15363    /// Synthetic request message for the [delete()][.responsePolicyRules.delete] method.
15364    #[derive(Clone, Default, PartialEq)]
15365    #[non_exhaustive]
15366    pub struct DeleteRequest {
15367        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
15368        pub client_operation_id: std::option::Option<std::string::String>,
15369
15370        /// Identifies the project addressed by this request.
15371        pub project: std::string::String,
15372
15373        /// User assigned name of the Response Policy containing the Response Policy Rule.
15374        pub response_policy: std::string::String,
15375
15376        /// User assigned name of the Response Policy Rule addressed by this request.
15377        pub response_policy_rule: std::string::String,
15378
15379        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15380    }
15381
15382    impl DeleteRequest {
15383        /// Creates a new default instance.
15384        pub fn new() -> Self {
15385            std::default::Default::default()
15386        }
15387
15388        /// Sets the value of [client_operation_id][crate::model::response_policy_rules::DeleteRequest::client_operation_id].
15389        ///
15390        /// # Example
15391        /// ```ignore,no_run
15392        /// # use google_cloud_dns_v1::model::response_policy_rules::DeleteRequest;
15393        /// let x = DeleteRequest::new().set_client_operation_id("example");
15394        /// ```
15395        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
15396        where
15397            T: std::convert::Into<std::string::String>,
15398        {
15399            self.client_operation_id = std::option::Option::Some(v.into());
15400            self
15401        }
15402
15403        /// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::DeleteRequest::client_operation_id].
15404        ///
15405        /// # Example
15406        /// ```ignore,no_run
15407        /// # use google_cloud_dns_v1::model::response_policy_rules::DeleteRequest;
15408        /// let x = DeleteRequest::new().set_or_clear_client_operation_id(Some("example"));
15409        /// let x = DeleteRequest::new().set_or_clear_client_operation_id(None::<String>);
15410        /// ```
15411        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
15412        where
15413            T: std::convert::Into<std::string::String>,
15414        {
15415            self.client_operation_id = v.map(|x| x.into());
15416            self
15417        }
15418
15419        /// Sets the value of [project][crate::model::response_policy_rules::DeleteRequest::project].
15420        ///
15421        /// # Example
15422        /// ```ignore,no_run
15423        /// # use google_cloud_dns_v1::model::response_policy_rules::DeleteRequest;
15424        /// let x = DeleteRequest::new().set_project("example");
15425        /// ```
15426        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15427            self.project = v.into();
15428            self
15429        }
15430
15431        /// Sets the value of [response_policy][crate::model::response_policy_rules::DeleteRequest::response_policy].
15432        ///
15433        /// # Example
15434        /// ```ignore,no_run
15435        /// # use google_cloud_dns_v1::model::response_policy_rules::DeleteRequest;
15436        /// let x = DeleteRequest::new().set_response_policy("example");
15437        /// ```
15438        pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
15439            mut self,
15440            v: T,
15441        ) -> Self {
15442            self.response_policy = v.into();
15443            self
15444        }
15445
15446        /// Sets the value of [response_policy_rule][crate::model::response_policy_rules::DeleteRequest::response_policy_rule].
15447        ///
15448        /// # Example
15449        /// ```ignore,no_run
15450        /// # use google_cloud_dns_v1::model::response_policy_rules::DeleteRequest;
15451        /// let x = DeleteRequest::new().set_response_policy_rule("example");
15452        /// ```
15453        pub fn set_response_policy_rule<T: std::convert::Into<std::string::String>>(
15454            mut self,
15455            v: T,
15456        ) -> Self {
15457            self.response_policy_rule = v.into();
15458            self
15459        }
15460    }
15461
15462    /// Synthetic request message for the [get()][.responsePolicyRules.get] method.
15463    #[derive(Clone, Default, PartialEq)]
15464    #[non_exhaustive]
15465    pub struct GetRequest {
15466        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
15467        pub client_operation_id: std::option::Option<std::string::String>,
15468
15469        /// Identifies the project addressed by this request.
15470        pub project: std::string::String,
15471
15472        /// User assigned name of the Response Policy containing the Response Policy Rule.
15473        pub response_policy: std::string::String,
15474
15475        /// User assigned name of the Response Policy Rule addressed by this request.
15476        pub response_policy_rule: std::string::String,
15477
15478        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15479    }
15480
15481    impl GetRequest {
15482        /// Creates a new default instance.
15483        pub fn new() -> Self {
15484            std::default::Default::default()
15485        }
15486
15487        /// Sets the value of [client_operation_id][crate::model::response_policy_rules::GetRequest::client_operation_id].
15488        ///
15489        /// # Example
15490        /// ```ignore,no_run
15491        /// # use google_cloud_dns_v1::model::response_policy_rules::GetRequest;
15492        /// let x = GetRequest::new().set_client_operation_id("example");
15493        /// ```
15494        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
15495        where
15496            T: std::convert::Into<std::string::String>,
15497        {
15498            self.client_operation_id = std::option::Option::Some(v.into());
15499            self
15500        }
15501
15502        /// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::GetRequest::client_operation_id].
15503        ///
15504        /// # Example
15505        /// ```ignore,no_run
15506        /// # use google_cloud_dns_v1::model::response_policy_rules::GetRequest;
15507        /// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
15508        /// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
15509        /// ```
15510        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
15511        where
15512            T: std::convert::Into<std::string::String>,
15513        {
15514            self.client_operation_id = v.map(|x| x.into());
15515            self
15516        }
15517
15518        /// Sets the value of [project][crate::model::response_policy_rules::GetRequest::project].
15519        ///
15520        /// # Example
15521        /// ```ignore,no_run
15522        /// # use google_cloud_dns_v1::model::response_policy_rules::GetRequest;
15523        /// let x = GetRequest::new().set_project("example");
15524        /// ```
15525        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15526            self.project = v.into();
15527            self
15528        }
15529
15530        /// Sets the value of [response_policy][crate::model::response_policy_rules::GetRequest::response_policy].
15531        ///
15532        /// # Example
15533        /// ```ignore,no_run
15534        /// # use google_cloud_dns_v1::model::response_policy_rules::GetRequest;
15535        /// let x = GetRequest::new().set_response_policy("example");
15536        /// ```
15537        pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
15538            mut self,
15539            v: T,
15540        ) -> Self {
15541            self.response_policy = v.into();
15542            self
15543        }
15544
15545        /// Sets the value of [response_policy_rule][crate::model::response_policy_rules::GetRequest::response_policy_rule].
15546        ///
15547        /// # Example
15548        /// ```ignore,no_run
15549        /// # use google_cloud_dns_v1::model::response_policy_rules::GetRequest;
15550        /// let x = GetRequest::new().set_response_policy_rule("example");
15551        /// ```
15552        pub fn set_response_policy_rule<T: std::convert::Into<std::string::String>>(
15553            mut self,
15554            v: T,
15555        ) -> Self {
15556            self.response_policy_rule = v.into();
15557            self
15558        }
15559    }
15560
15561    /// Synthetic request message for the [list()][.responsePolicyRules.list] method.
15562    #[derive(Clone, Default, PartialEq)]
15563    #[non_exhaustive]
15564    pub struct ListRequest {
15565        /// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
15566        pub max_results: std::option::Option<i32>,
15567
15568        /// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
15569        pub page_token: std::option::Option<std::string::String>,
15570
15571        /// Identifies the project addressed by this request.
15572        pub project: std::string::String,
15573
15574        /// User assigned name of the Response Policy to list.
15575        pub response_policy: std::string::String,
15576
15577        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15578    }
15579
15580    impl ListRequest {
15581        /// Creates a new default instance.
15582        pub fn new() -> Self {
15583            std::default::Default::default()
15584        }
15585
15586        /// Sets the value of [max_results][crate::model::response_policy_rules::ListRequest::max_results].
15587        ///
15588        /// # Example
15589        /// ```ignore,no_run
15590        /// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
15591        /// let x = ListRequest::new().set_max_results(42);
15592        /// ```
15593        pub fn set_max_results<T>(mut self, v: T) -> Self
15594        where
15595            T: std::convert::Into<i32>,
15596        {
15597            self.max_results = std::option::Option::Some(v.into());
15598            self
15599        }
15600
15601        /// Sets or clears the value of [max_results][crate::model::response_policy_rules::ListRequest::max_results].
15602        ///
15603        /// # Example
15604        /// ```ignore,no_run
15605        /// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
15606        /// let x = ListRequest::new().set_or_clear_max_results(Some(42));
15607        /// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
15608        /// ```
15609        pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
15610        where
15611            T: std::convert::Into<i32>,
15612        {
15613            self.max_results = v.map(|x| x.into());
15614            self
15615        }
15616
15617        /// Sets the value of [page_token][crate::model::response_policy_rules::ListRequest::page_token].
15618        ///
15619        /// # Example
15620        /// ```ignore,no_run
15621        /// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
15622        /// let x = ListRequest::new().set_page_token("example");
15623        /// ```
15624        pub fn set_page_token<T>(mut self, v: T) -> Self
15625        where
15626            T: std::convert::Into<std::string::String>,
15627        {
15628            self.page_token = std::option::Option::Some(v.into());
15629            self
15630        }
15631
15632        /// Sets or clears the value of [page_token][crate::model::response_policy_rules::ListRequest::page_token].
15633        ///
15634        /// # Example
15635        /// ```ignore,no_run
15636        /// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
15637        /// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
15638        /// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
15639        /// ```
15640        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
15641        where
15642            T: std::convert::Into<std::string::String>,
15643        {
15644            self.page_token = v.map(|x| x.into());
15645            self
15646        }
15647
15648        /// Sets the value of [project][crate::model::response_policy_rules::ListRequest::project].
15649        ///
15650        /// # Example
15651        /// ```ignore,no_run
15652        /// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
15653        /// let x = ListRequest::new().set_project("example");
15654        /// ```
15655        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15656            self.project = v.into();
15657            self
15658        }
15659
15660        /// Sets the value of [response_policy][crate::model::response_policy_rules::ListRequest::response_policy].
15661        ///
15662        /// # Example
15663        /// ```ignore,no_run
15664        /// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
15665        /// let x = ListRequest::new().set_response_policy("example");
15666        /// ```
15667        pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
15668            mut self,
15669            v: T,
15670        ) -> Self {
15671            self.response_policy = v.into();
15672            self
15673        }
15674    }
15675
15676    /// Synthetic request message for the [patch()][.responsePolicyRules.patch] method.
15677    #[derive(Clone, Default, PartialEq)]
15678    #[non_exhaustive]
15679    pub struct PatchRequest {
15680        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
15681        pub client_operation_id: std::option::Option<std::string::String>,
15682
15683        /// Identifies the project addressed by this request.
15684        pub project: std::string::String,
15685
15686        /// User assigned name of the Response Policy containing the Response Policy Rule.
15687        pub response_policy: std::string::String,
15688
15689        /// User assigned name of the Response Policy Rule addressed by this request.
15690        pub response_policy_rule: std::string::String,
15691
15692        /// Synthetic request body field for the [patch()][.responsePolicyRules.patch] method.
15693        pub body: std::option::Option<crate::model::ResponsePolicyRule>,
15694
15695        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15696    }
15697
15698    impl PatchRequest {
15699        /// Creates a new default instance.
15700        pub fn new() -> Self {
15701            std::default::Default::default()
15702        }
15703
15704        /// Sets the value of [client_operation_id][crate::model::response_policy_rules::PatchRequest::client_operation_id].
15705        ///
15706        /// # Example
15707        /// ```ignore,no_run
15708        /// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
15709        /// let x = PatchRequest::new().set_client_operation_id("example");
15710        /// ```
15711        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
15712        where
15713            T: std::convert::Into<std::string::String>,
15714        {
15715            self.client_operation_id = std::option::Option::Some(v.into());
15716            self
15717        }
15718
15719        /// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::PatchRequest::client_operation_id].
15720        ///
15721        /// # Example
15722        /// ```ignore,no_run
15723        /// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
15724        /// let x = PatchRequest::new().set_or_clear_client_operation_id(Some("example"));
15725        /// let x = PatchRequest::new().set_or_clear_client_operation_id(None::<String>);
15726        /// ```
15727        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
15728        where
15729            T: std::convert::Into<std::string::String>,
15730        {
15731            self.client_operation_id = v.map(|x| x.into());
15732            self
15733        }
15734
15735        /// Sets the value of [project][crate::model::response_policy_rules::PatchRequest::project].
15736        ///
15737        /// # Example
15738        /// ```ignore,no_run
15739        /// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
15740        /// let x = PatchRequest::new().set_project("example");
15741        /// ```
15742        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15743            self.project = v.into();
15744            self
15745        }
15746
15747        /// Sets the value of [response_policy][crate::model::response_policy_rules::PatchRequest::response_policy].
15748        ///
15749        /// # Example
15750        /// ```ignore,no_run
15751        /// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
15752        /// let x = PatchRequest::new().set_response_policy("example");
15753        /// ```
15754        pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
15755            mut self,
15756            v: T,
15757        ) -> Self {
15758            self.response_policy = v.into();
15759            self
15760        }
15761
15762        /// Sets the value of [response_policy_rule][crate::model::response_policy_rules::PatchRequest::response_policy_rule].
15763        ///
15764        /// # Example
15765        /// ```ignore,no_run
15766        /// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
15767        /// let x = PatchRequest::new().set_response_policy_rule("example");
15768        /// ```
15769        pub fn set_response_policy_rule<T: std::convert::Into<std::string::String>>(
15770            mut self,
15771            v: T,
15772        ) -> Self {
15773            self.response_policy_rule = v.into();
15774            self
15775        }
15776
15777        /// Sets the value of [body][crate::model::response_policy_rules::PatchRequest::body].
15778        ///
15779        /// # Example
15780        /// ```ignore,no_run
15781        /// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
15782        /// use google_cloud_dns_v1::model::ResponsePolicyRule;
15783        /// let x = PatchRequest::new().set_body(ResponsePolicyRule::default()/* use setters */);
15784        /// ```
15785        pub fn set_body<T>(mut self, v: T) -> Self
15786        where
15787            T: std::convert::Into<crate::model::ResponsePolicyRule>,
15788        {
15789            self.body = std::option::Option::Some(v.into());
15790            self
15791        }
15792
15793        /// Sets or clears the value of [body][crate::model::response_policy_rules::PatchRequest::body].
15794        ///
15795        /// # Example
15796        /// ```ignore,no_run
15797        /// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
15798        /// use google_cloud_dns_v1::model::ResponsePolicyRule;
15799        /// let x = PatchRequest::new().set_or_clear_body(Some(ResponsePolicyRule::default()/* use setters */));
15800        /// let x = PatchRequest::new().set_or_clear_body(None::<ResponsePolicyRule>);
15801        /// ```
15802        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15803        where
15804            T: std::convert::Into<crate::model::ResponsePolicyRule>,
15805        {
15806            self.body = v.map(|x| x.into());
15807            self
15808        }
15809    }
15810
15811    /// Synthetic request message for the [update()][.responsePolicyRules.update] method.
15812    #[derive(Clone, Default, PartialEq)]
15813    #[non_exhaustive]
15814    pub struct UpdateRequest {
15815        /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
15816        pub client_operation_id: std::option::Option<std::string::String>,
15817
15818        /// Identifies the project addressed by this request.
15819        pub project: std::string::String,
15820
15821        /// User assigned name of the Response Policy containing the Response Policy Rule.
15822        pub response_policy: std::string::String,
15823
15824        /// User assigned name of the Response Policy Rule addressed by this request.
15825        pub response_policy_rule: std::string::String,
15826
15827        /// Synthetic request body field for the [update()][.responsePolicyRules.update] method.
15828        pub body: std::option::Option<crate::model::ResponsePolicyRule>,
15829
15830        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15831    }
15832
15833    impl UpdateRequest {
15834        /// Creates a new default instance.
15835        pub fn new() -> Self {
15836            std::default::Default::default()
15837        }
15838
15839        /// Sets the value of [client_operation_id][crate::model::response_policy_rules::UpdateRequest::client_operation_id].
15840        ///
15841        /// # Example
15842        /// ```ignore,no_run
15843        /// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
15844        /// let x = UpdateRequest::new().set_client_operation_id("example");
15845        /// ```
15846        pub fn set_client_operation_id<T>(mut self, v: T) -> Self
15847        where
15848            T: std::convert::Into<std::string::String>,
15849        {
15850            self.client_operation_id = std::option::Option::Some(v.into());
15851            self
15852        }
15853
15854        /// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::UpdateRequest::client_operation_id].
15855        ///
15856        /// # Example
15857        /// ```ignore,no_run
15858        /// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
15859        /// let x = UpdateRequest::new().set_or_clear_client_operation_id(Some("example"));
15860        /// let x = UpdateRequest::new().set_or_clear_client_operation_id(None::<String>);
15861        /// ```
15862        pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
15863        where
15864            T: std::convert::Into<std::string::String>,
15865        {
15866            self.client_operation_id = v.map(|x| x.into());
15867            self
15868        }
15869
15870        /// Sets the value of [project][crate::model::response_policy_rules::UpdateRequest::project].
15871        ///
15872        /// # Example
15873        /// ```ignore,no_run
15874        /// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
15875        /// let x = UpdateRequest::new().set_project("example");
15876        /// ```
15877        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15878            self.project = v.into();
15879            self
15880        }
15881
15882        /// Sets the value of [response_policy][crate::model::response_policy_rules::UpdateRequest::response_policy].
15883        ///
15884        /// # Example
15885        /// ```ignore,no_run
15886        /// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
15887        /// let x = UpdateRequest::new().set_response_policy("example");
15888        /// ```
15889        pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
15890            mut self,
15891            v: T,
15892        ) -> Self {
15893            self.response_policy = v.into();
15894            self
15895        }
15896
15897        /// Sets the value of [response_policy_rule][crate::model::response_policy_rules::UpdateRequest::response_policy_rule].
15898        ///
15899        /// # Example
15900        /// ```ignore,no_run
15901        /// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
15902        /// let x = UpdateRequest::new().set_response_policy_rule("example");
15903        /// ```
15904        pub fn set_response_policy_rule<T: std::convert::Into<std::string::String>>(
15905            mut self,
15906            v: T,
15907        ) -> Self {
15908            self.response_policy_rule = v.into();
15909            self
15910        }
15911
15912        /// Sets the value of [body][crate::model::response_policy_rules::UpdateRequest::body].
15913        ///
15914        /// # Example
15915        /// ```ignore,no_run
15916        /// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
15917        /// use google_cloud_dns_v1::model::ResponsePolicyRule;
15918        /// let x = UpdateRequest::new().set_body(ResponsePolicyRule::default()/* use setters */);
15919        /// ```
15920        pub fn set_body<T>(mut self, v: T) -> Self
15921        where
15922            T: std::convert::Into<crate::model::ResponsePolicyRule>,
15923        {
15924            self.body = std::option::Option::Some(v.into());
15925            self
15926        }
15927
15928        /// Sets or clears the value of [body][crate::model::response_policy_rules::UpdateRequest::body].
15929        ///
15930        /// # Example
15931        /// ```ignore,no_run
15932        /// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
15933        /// use google_cloud_dns_v1::model::ResponsePolicyRule;
15934        /// let x = UpdateRequest::new().set_or_clear_body(Some(ResponsePolicyRule::default()/* use setters */));
15935        /// let x = UpdateRequest::new().set_or_clear_body(None::<ResponsePolicyRule>);
15936        /// ```
15937        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15938        where
15939            T: std::convert::Into<crate::model::ResponsePolicyRule>,
15940        {
15941            self.body = v.map(|x| x.into());
15942            self
15943        }
15944    }
15945}