// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_lro;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
/// 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.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Change {
/// Which ResourceRecordSets to add?
pub additions: std::vec::Vec<crate::model::ResourceRecordSet>,
/// Which ResourceRecordSets to remove? Must match existing data exactly.
pub deletions: std::vec::Vec<crate::model::ResourceRecordSet>,
/// Unique identifier for the resource; defined by the server (output only).
pub id: std::option::Option<std::string::String>,
/// If the DNS queries for the zone will be served.
pub is_serving: std::option::Option<bool>,
pub kind: std::option::Option<std::string::String>,
/// The time that this operation was started by the server (output only). This is in RFC3339 text format.
pub start_time: std::option::Option<std::string::String>,
/// 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.
pub status: std::option::Option<crate::model::change::Status>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Change {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [additions][crate::model::Change::additions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = Change::new()
/// .set_additions([
/// ResourceRecordSet::default()/* use setters */,
/// ResourceRecordSet::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_additions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResourceRecordSet>,
{
use std::iter::Iterator;
self.additions = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [deletions][crate::model::Change::deletions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = Change::new()
/// .set_deletions([
/// ResourceRecordSet::default()/* use setters */,
/// ResourceRecordSet::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_deletions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResourceRecordSet>,
{
use std::iter::Iterator;
self.deletions = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [id][crate::model::Change::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// let x = Change::new().set_id("example");
/// ```
pub fn set_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [id][crate::model::Change::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// let x = Change::new().set_or_clear_id(Some("example"));
/// let x = Change::new().set_or_clear_id(None::<String>);
/// ```
pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.id = v.map(|x| x.into());
self
}
/// Sets the value of [is_serving][crate::model::Change::is_serving].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// let x = Change::new().set_is_serving(true);
/// ```
pub fn set_is_serving<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.is_serving = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [is_serving][crate::model::Change::is_serving].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// let x = Change::new().set_or_clear_is_serving(Some(false));
/// let x = Change::new().set_or_clear_is_serving(None::<bool>);
/// ```
pub fn set_or_clear_is_serving<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.is_serving = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::Change::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// let x = Change::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::Change::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// let x = Change::new().set_or_clear_kind(Some("example"));
/// let x = Change::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [start_time][crate::model::Change::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// let x = Change::new().set_start_time("example");
/// ```
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [start_time][crate::model::Change::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// let x = Change::new().set_or_clear_start_time(Some("example"));
/// let x = Change::new().set_or_clear_start_time(None::<String>);
/// ```
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.start_time = v.map(|x| x.into());
self
}
/// Sets the value of [status][crate::model::Change::status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// use google_cloud_dns_v1::model::change::Status;
/// let x0 = Change::new().set_status(Status::Done);
/// ```
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::change::Status>,
{
self.status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [status][crate::model::Change::status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Change;
/// use google_cloud_dns_v1::model::change::Status;
/// let x0 = Change::new().set_or_clear_status(Some(Status::Done));
/// let x_none = Change::new().set_or_clear_status(None::<Status>);
/// ```
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::change::Status>,
{
self.status = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Change {
fn typename() -> &'static str {
"type.googleapis.com/.Change"
}
}
/// Defines additional types related to [Change].
pub mod change {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [status][.Change.status] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Status {
Pending,
Done,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Status::value] or
/// [Status::name].
UnknownValue(status::UnknownValue),
}
#[doc(hidden)]
pub mod status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Status {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Pending => std::option::Option::Some(0),
Self::Done => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Pending => std::option::Option::Some("pending"),
Self::Done => std::option::Option::Some("done"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Status {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Status {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Status {
fn from(value: i32) -> Self {
match value {
0 => Self::Pending,
1 => Self::Done,
_ => Self::UnknownValue(status::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Status {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"pending" => Self::Pending,
"done" => Self::Done,
_ => Self::UnknownValue(status::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Status {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Pending => serializer.serialize_str("pending"),
Self::Done => serializer.serialize_str("done"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Status {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer
.deserialize_any(wkt::internal::EnumVisitor::<Status>::new("..Change.status"))
}
}
}
/// The response to a request to enumerate Changes to a ResourceRecordSets collection.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ChangesListResponse {
/// The requested changes.
pub changes: std::vec::Vec<crate::model::Change>,
/// Type of resource.
pub kind: std::option::Option<std::string::String>,
/// 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.
pub next_page_token: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ChangesListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [changes][crate::model::ChangesListResponse::changes].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ChangesListResponse;
/// use google_cloud_dns_v1::model::Change;
/// let x = ChangesListResponse::new()
/// .set_changes([
/// Change::default()/* use setters */,
/// Change::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_changes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Change>,
{
use std::iter::Iterator;
self.changes = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [kind][crate::model::ChangesListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ChangesListResponse;
/// let x = ChangesListResponse::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ChangesListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ChangesListResponse;
/// let x = ChangesListResponse::new().set_or_clear_kind(Some("example"));
/// let x = ChangesListResponse::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [next_page_token][crate::model::ChangesListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ChangesListResponse;
/// let x = ChangesListResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [next_page_token][crate::model::ChangesListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ChangesListResponse;
/// let x = ChangesListResponse::new().set_or_clear_next_page_token(Some("example"));
/// let x = ChangesListResponse::new().set_or_clear_next_page_token(None::<String>);
/// ```
pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ChangesListResponse {
fn typename() -> &'static str {
"type.googleapis.com/.ChangesListResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ChangesListResponse {
type PageItem = crate::model::Change;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.changes
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone().unwrap_or_default()
}
}
/// A DNSSEC key pair.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DnsKey {
/// String mnemonic specifying the DNSSEC algorithm of this key. Immutable after creation time.
pub algorithm: std::option::Option<crate::model::dns_key::Algorithm>,
/// The time that this resource was created in the control plane. This is in RFC3339 text format. Output only.
pub creation_time: std::option::Option<std::string::String>,
/// 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.
pub description: std::option::Option<std::string::String>,
/// 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.
pub digests: std::vec::Vec<crate::model::DnsKeyDigest>,
/// Unique identifier for the resource; defined by the server (output only).
pub id: std::option::Option<std::string::String>,
/// 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.
pub is_active: std::option::Option<bool>,
/// Length of the key in bits. Specified at creation time, and then immutable.
pub key_length: std::option::Option<u32>,
/// 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.
pub key_tag: std::option::Option<i32>,
pub kind: std::option::Option<std::string::String>,
/// Base64 encoded public half of this key. Output only.
pub public_key: std::option::Option<std::string::String>,
/// 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.
pub r#type: std::option::Option<crate::model::dns_key::Type>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DnsKey {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [algorithm][crate::model::DnsKey::algorithm].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// use google_cloud_dns_v1::model::dns_key::Algorithm;
/// let x0 = DnsKey::new().set_algorithm(Algorithm::Rsasha256);
/// let x1 = DnsKey::new().set_algorithm(Algorithm::Rsasha512);
/// let x2 = DnsKey::new().set_algorithm(Algorithm::Ecdsap256Sha256);
/// ```
pub fn set_algorithm<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::dns_key::Algorithm>,
{
self.algorithm = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [algorithm][crate::model::DnsKey::algorithm].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// use google_cloud_dns_v1::model::dns_key::Algorithm;
/// let x0 = DnsKey::new().set_or_clear_algorithm(Some(Algorithm::Rsasha256));
/// let x1 = DnsKey::new().set_or_clear_algorithm(Some(Algorithm::Rsasha512));
/// let x2 = DnsKey::new().set_or_clear_algorithm(Some(Algorithm::Ecdsap256Sha256));
/// let x_none = DnsKey::new().set_or_clear_algorithm(None::<Algorithm>);
/// ```
pub fn set_or_clear_algorithm<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::dns_key::Algorithm>,
{
self.algorithm = v.map(|x| x.into());
self
}
/// Sets the value of [creation_time][crate::model::DnsKey::creation_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_creation_time("example");
/// ```
pub fn set_creation_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.creation_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [creation_time][crate::model::DnsKey::creation_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_or_clear_creation_time(Some("example"));
/// let x = DnsKey::new().set_or_clear_creation_time(None::<String>);
/// ```
pub fn set_or_clear_creation_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.creation_time = v.map(|x| x.into());
self
}
/// Sets the value of [description][crate::model::DnsKey::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_description("example");
/// ```
pub fn set_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [description][crate::model::DnsKey::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_or_clear_description(Some("example"));
/// let x = DnsKey::new().set_or_clear_description(None::<String>);
/// ```
pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = v.map(|x| x.into());
self
}
/// Sets the value of [digests][crate::model::DnsKey::digests].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// use google_cloud_dns_v1::model::DnsKeyDigest;
/// let x = DnsKey::new()
/// .set_digests([
/// DnsKeyDigest::default()/* use setters */,
/// DnsKeyDigest::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_digests<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DnsKeyDigest>,
{
use std::iter::Iterator;
self.digests = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [id][crate::model::DnsKey::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_id("example");
/// ```
pub fn set_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [id][crate::model::DnsKey::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_or_clear_id(Some("example"));
/// let x = DnsKey::new().set_or_clear_id(None::<String>);
/// ```
pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.id = v.map(|x| x.into());
self
}
/// Sets the value of [is_active][crate::model::DnsKey::is_active].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_is_active(true);
/// ```
pub fn set_is_active<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.is_active = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [is_active][crate::model::DnsKey::is_active].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_or_clear_is_active(Some(false));
/// let x = DnsKey::new().set_or_clear_is_active(None::<bool>);
/// ```
pub fn set_or_clear_is_active<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.is_active = v.map(|x| x.into());
self
}
/// Sets the value of [key_length][crate::model::DnsKey::key_length].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_key_length(42_u32);
/// ```
pub fn set_key_length<T>(mut self, v: T) -> Self
where
T: std::convert::Into<u32>,
{
self.key_length = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [key_length][crate::model::DnsKey::key_length].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_or_clear_key_length(Some(42_u32));
/// let x = DnsKey::new().set_or_clear_key_length(None::<u32>);
/// ```
pub fn set_or_clear_key_length<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<u32>,
{
self.key_length = v.map(|x| x.into());
self
}
/// Sets the value of [key_tag][crate::model::DnsKey::key_tag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_key_tag(42);
/// ```
pub fn set_key_tag<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.key_tag = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [key_tag][crate::model::DnsKey::key_tag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_or_clear_key_tag(Some(42));
/// let x = DnsKey::new().set_or_clear_key_tag(None::<i32>);
/// ```
pub fn set_or_clear_key_tag<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.key_tag = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::DnsKey::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::DnsKey::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_or_clear_kind(Some("example"));
/// let x = DnsKey::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [public_key][crate::model::DnsKey::public_key].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_public_key("example");
/// ```
pub fn set_public_key<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.public_key = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [public_key][crate::model::DnsKey::public_key].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKey::new().set_or_clear_public_key(Some("example"));
/// let x = DnsKey::new().set_or_clear_public_key(None::<String>);
/// ```
pub fn set_or_clear_public_key<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.public_key = v.map(|x| x.into());
self
}
/// Sets the value of [r#type][crate::model::DnsKey::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// use google_cloud_dns_v1::model::dns_key::Type;
/// let x0 = DnsKey::new().set_type(Type::ZoneSigning);
/// ```
pub fn set_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::dns_key::Type>,
{
self.r#type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [r#type][crate::model::DnsKey::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKey;
/// use google_cloud_dns_v1::model::dns_key::Type;
/// let x0 = DnsKey::new().set_or_clear_type(Some(Type::ZoneSigning));
/// let x_none = DnsKey::new().set_or_clear_type(None::<Type>);
/// ```
pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::dns_key::Type>,
{
self.r#type = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DnsKey {
fn typename() -> &'static str {
"type.googleapis.com/.DnsKey"
}
}
/// Defines additional types related to [DnsKey].
pub mod dns_key {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [algorithm][.DnsKey.algorithm] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Algorithm {
Rsasha1,
Rsasha256,
Rsasha512,
Ecdsap256Sha256,
Ecdsap384Sha384,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Algorithm::value] or
/// [Algorithm::name].
UnknownValue(algorithm::UnknownValue),
}
#[doc(hidden)]
pub mod algorithm {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Algorithm {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Rsasha1 => std::option::Option::Some(0),
Self::Rsasha256 => std::option::Option::Some(1),
Self::Rsasha512 => std::option::Option::Some(2),
Self::Ecdsap256Sha256 => std::option::Option::Some(3),
Self::Ecdsap384Sha384 => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Rsasha1 => std::option::Option::Some("rsasha1"),
Self::Rsasha256 => std::option::Option::Some("rsasha256"),
Self::Rsasha512 => std::option::Option::Some("rsasha512"),
Self::Ecdsap256Sha256 => std::option::Option::Some("ecdsap256sha256"),
Self::Ecdsap384Sha384 => std::option::Option::Some("ecdsap384sha384"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Algorithm {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Algorithm {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Algorithm {
fn from(value: i32) -> Self {
match value {
0 => Self::Rsasha1,
1 => Self::Rsasha256,
2 => Self::Rsasha512,
3 => Self::Ecdsap256Sha256,
4 => Self::Ecdsap384Sha384,
_ => Self::UnknownValue(algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Algorithm {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"rsasha1" => Self::Rsasha1,
"rsasha256" => Self::Rsasha256,
"rsasha512" => Self::Rsasha512,
"ecdsap256sha256" => Self::Ecdsap256Sha256,
"ecdsap384sha384" => Self::Ecdsap384Sha384,
_ => Self::UnknownValue(algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Algorithm {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Rsasha1 => serializer.serialize_str("rsasha1"),
Self::Rsasha256 => serializer.serialize_str("rsasha256"),
Self::Rsasha512 => serializer.serialize_str("rsasha512"),
Self::Ecdsap256Sha256 => serializer.serialize_str("ecdsap256sha256"),
Self::Ecdsap384Sha384 => serializer.serialize_str("ecdsap384sha384"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Algorithm {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Algorithm>::new(
"..DnsKey.algorithm",
))
}
}
/// The enumerated type for the [type][.DnsKey.type] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
KeySigning,
ZoneSigning,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Type::value] or
/// [Type::name].
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::KeySigning => std::option::Option::Some(0),
Self::ZoneSigning => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::KeySigning => std::option::Option::Some("keySigning"),
Self::ZoneSigning => std::option::Option::Some("zoneSigning"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::KeySigning,
1 => Self::ZoneSigning,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"keySigning" => Self::KeySigning,
"zoneSigning" => Self::ZoneSigning,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::KeySigning => serializer.serialize_str("keySigning"),
Self::ZoneSigning => serializer.serialize_str("zoneSigning"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new("..DnsKey.type"))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DnsKeyDigest {
/// The base-16 encoded bytes of this digest. Suitable for use in a DS resource record.
pub digest: std::option::Option<std::string::String>,
/// Specifies the algorithm used to calculate this digest.
pub r#type: std::option::Option<crate::model::dns_key_digest::Type>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DnsKeyDigest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [digest][crate::model::DnsKeyDigest::digest].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeyDigest;
/// let x = DnsKeyDigest::new().set_digest("example");
/// ```
pub fn set_digest<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.digest = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [digest][crate::model::DnsKeyDigest::digest].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeyDigest;
/// let x = DnsKeyDigest::new().set_or_clear_digest(Some("example"));
/// let x = DnsKeyDigest::new().set_or_clear_digest(None::<String>);
/// ```
pub fn set_or_clear_digest<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.digest = v.map(|x| x.into());
self
}
/// Sets the value of [r#type][crate::model::DnsKeyDigest::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeyDigest;
/// use google_cloud_dns_v1::model::dns_key_digest::Type;
/// let x0 = DnsKeyDigest::new().set_type(Type::Sha256);
/// let x1 = DnsKeyDigest::new().set_type(Type::Sha384);
/// ```
pub fn set_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::dns_key_digest::Type>,
{
self.r#type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [r#type][crate::model::DnsKeyDigest::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeyDigest;
/// use google_cloud_dns_v1::model::dns_key_digest::Type;
/// let x0 = DnsKeyDigest::new().set_or_clear_type(Some(Type::Sha256));
/// let x1 = DnsKeyDigest::new().set_or_clear_type(Some(Type::Sha384));
/// let x_none = DnsKeyDigest::new().set_or_clear_type(None::<Type>);
/// ```
pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::dns_key_digest::Type>,
{
self.r#type = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DnsKeyDigest {
fn typename() -> &'static str {
"type.googleapis.com/.DnsKeyDigest"
}
}
/// Defines additional types related to [DnsKeyDigest].
pub mod dns_key_digest {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [type][.DnsKeyDigest.type] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Sha1,
Sha256,
Sha384,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Type::value] or
/// [Type::name].
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Sha1 => std::option::Option::Some(0),
Self::Sha256 => std::option::Option::Some(1),
Self::Sha384 => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Sha1 => std::option::Option::Some("sha1"),
Self::Sha256 => std::option::Option::Some("sha256"),
Self::Sha384 => std::option::Option::Some("sha384"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Sha1,
1 => Self::Sha256,
2 => Self::Sha384,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"sha1" => Self::Sha1,
"sha256" => Self::Sha256,
"sha384" => Self::Sha384,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Sha1 => serializer.serialize_str("sha1"),
Self::Sha256 => serializer.serialize_str("sha256"),
Self::Sha384 => serializer.serialize_str("sha384"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
"..DnsKeyDigest.type",
))
}
}
}
/// Parameters for DnsKey key generation. Used for generating initial keys for a new ManagedZone and as default when adding a new DnsKey.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DnsKeySpec {
/// String mnemonic specifying the DNSSEC algorithm of this key.
pub algorithm: std::option::Option<crate::model::dns_key_spec::Algorithm>,
/// Length of the keys in bits.
pub key_length: std::option::Option<u32>,
/// 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.
pub key_type: std::option::Option<crate::model::dns_key_spec::KeyType>,
pub kind: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DnsKeySpec {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [algorithm][crate::model::DnsKeySpec::algorithm].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeySpec;
/// use google_cloud_dns_v1::model::dns_key_spec::Algorithm;
/// let x0 = DnsKeySpec::new().set_algorithm(Algorithm::Rsasha256);
/// let x1 = DnsKeySpec::new().set_algorithm(Algorithm::Rsasha512);
/// let x2 = DnsKeySpec::new().set_algorithm(Algorithm::Ecdsap256Sha256);
/// ```
pub fn set_algorithm<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::dns_key_spec::Algorithm>,
{
self.algorithm = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [algorithm][crate::model::DnsKeySpec::algorithm].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeySpec;
/// use google_cloud_dns_v1::model::dns_key_spec::Algorithm;
/// let x0 = DnsKeySpec::new().set_or_clear_algorithm(Some(Algorithm::Rsasha256));
/// let x1 = DnsKeySpec::new().set_or_clear_algorithm(Some(Algorithm::Rsasha512));
/// let x2 = DnsKeySpec::new().set_or_clear_algorithm(Some(Algorithm::Ecdsap256Sha256));
/// let x_none = DnsKeySpec::new().set_or_clear_algorithm(None::<Algorithm>);
/// ```
pub fn set_or_clear_algorithm<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::dns_key_spec::Algorithm>,
{
self.algorithm = v.map(|x| x.into());
self
}
/// Sets the value of [key_length][crate::model::DnsKeySpec::key_length].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeySpec;
/// let x = DnsKeySpec::new().set_key_length(42_u32);
/// ```
pub fn set_key_length<T>(mut self, v: T) -> Self
where
T: std::convert::Into<u32>,
{
self.key_length = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [key_length][crate::model::DnsKeySpec::key_length].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeySpec;
/// let x = DnsKeySpec::new().set_or_clear_key_length(Some(42_u32));
/// let x = DnsKeySpec::new().set_or_clear_key_length(None::<u32>);
/// ```
pub fn set_or_clear_key_length<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<u32>,
{
self.key_length = v.map(|x| x.into());
self
}
/// Sets the value of [key_type][crate::model::DnsKeySpec::key_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeySpec;
/// use google_cloud_dns_v1::model::dns_key_spec::KeyType;
/// let x0 = DnsKeySpec::new().set_key_type(KeyType::ZoneSigning);
/// ```
pub fn set_key_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::dns_key_spec::KeyType>,
{
self.key_type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [key_type][crate::model::DnsKeySpec::key_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeySpec;
/// use google_cloud_dns_v1::model::dns_key_spec::KeyType;
/// let x0 = DnsKeySpec::new().set_or_clear_key_type(Some(KeyType::ZoneSigning));
/// let x_none = DnsKeySpec::new().set_or_clear_key_type(None::<KeyType>);
/// ```
pub fn set_or_clear_key_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::dns_key_spec::KeyType>,
{
self.key_type = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::DnsKeySpec::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeySpec;
/// let x = DnsKeySpec::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::DnsKeySpec::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeySpec;
/// let x = DnsKeySpec::new().set_or_clear_kind(Some("example"));
/// let x = DnsKeySpec::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DnsKeySpec {
fn typename() -> &'static str {
"type.googleapis.com/.DnsKeySpec"
}
}
/// Defines additional types related to [DnsKeySpec].
pub mod dns_key_spec {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [algorithm][.DnsKeySpec.algorithm] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Algorithm {
Rsasha1,
Rsasha256,
Rsasha512,
Ecdsap256Sha256,
Ecdsap384Sha384,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Algorithm::value] or
/// [Algorithm::name].
UnknownValue(algorithm::UnknownValue),
}
#[doc(hidden)]
pub mod algorithm {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Algorithm {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Rsasha1 => std::option::Option::Some(0),
Self::Rsasha256 => std::option::Option::Some(1),
Self::Rsasha512 => std::option::Option::Some(2),
Self::Ecdsap256Sha256 => std::option::Option::Some(3),
Self::Ecdsap384Sha384 => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Rsasha1 => std::option::Option::Some("rsasha1"),
Self::Rsasha256 => std::option::Option::Some("rsasha256"),
Self::Rsasha512 => std::option::Option::Some("rsasha512"),
Self::Ecdsap256Sha256 => std::option::Option::Some("ecdsap256sha256"),
Self::Ecdsap384Sha384 => std::option::Option::Some("ecdsap384sha384"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Algorithm {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Algorithm {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Algorithm {
fn from(value: i32) -> Self {
match value {
0 => Self::Rsasha1,
1 => Self::Rsasha256,
2 => Self::Rsasha512,
3 => Self::Ecdsap256Sha256,
4 => Self::Ecdsap384Sha384,
_ => Self::UnknownValue(algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Algorithm {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"rsasha1" => Self::Rsasha1,
"rsasha256" => Self::Rsasha256,
"rsasha512" => Self::Rsasha512,
"ecdsap256sha256" => Self::Ecdsap256Sha256,
"ecdsap384sha384" => Self::Ecdsap384Sha384,
_ => Self::UnknownValue(algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Algorithm {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Rsasha1 => serializer.serialize_str("rsasha1"),
Self::Rsasha256 => serializer.serialize_str("rsasha256"),
Self::Rsasha512 => serializer.serialize_str("rsasha512"),
Self::Ecdsap256Sha256 => serializer.serialize_str("ecdsap256sha256"),
Self::Ecdsap384Sha384 => serializer.serialize_str("ecdsap384sha384"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Algorithm {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Algorithm>::new(
"..DnsKeySpec.algorithm",
))
}
}
/// The enumerated type for the [keyType][.DnsKeySpec.keyType] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum KeyType {
KeySigning,
ZoneSigning,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [KeyType::value] or
/// [KeyType::name].
UnknownValue(key_type::UnknownValue),
}
#[doc(hidden)]
pub mod key_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl KeyType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::KeySigning => std::option::Option::Some(0),
Self::ZoneSigning => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::KeySigning => std::option::Option::Some("keySigning"),
Self::ZoneSigning => std::option::Option::Some("zoneSigning"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for KeyType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for KeyType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for KeyType {
fn from(value: i32) -> Self {
match value {
0 => Self::KeySigning,
1 => Self::ZoneSigning,
_ => Self::UnknownValue(key_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for KeyType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"keySigning" => Self::KeySigning,
"zoneSigning" => Self::ZoneSigning,
_ => Self::UnknownValue(key_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for KeyType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::KeySigning => serializer.serialize_str("keySigning"),
Self::ZoneSigning => serializer.serialize_str("zoneSigning"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for KeyType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<KeyType>::new(
"..DnsKeySpec.keyType",
))
}
}
}
/// The response to a request to enumerate DnsKeys in a ManagedZone.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DnsKeysListResponse {
/// The requested resources.
pub dns_keys: std::vec::Vec<crate::model::DnsKey>,
/// Type of resource.
pub kind: std::option::Option<std::string::String>,
/// 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.
pub next_page_token: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DnsKeysListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [dns_keys][crate::model::DnsKeysListResponse::dns_keys].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeysListResponse;
/// use google_cloud_dns_v1::model::DnsKey;
/// let x = DnsKeysListResponse::new()
/// .set_dns_keys([
/// DnsKey::default()/* use setters */,
/// DnsKey::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_dns_keys<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DnsKey>,
{
use std::iter::Iterator;
self.dns_keys = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [kind][crate::model::DnsKeysListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeysListResponse;
/// let x = DnsKeysListResponse::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::DnsKeysListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeysListResponse;
/// let x = DnsKeysListResponse::new().set_or_clear_kind(Some("example"));
/// let x = DnsKeysListResponse::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [next_page_token][crate::model::DnsKeysListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeysListResponse;
/// let x = DnsKeysListResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [next_page_token][crate::model::DnsKeysListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::DnsKeysListResponse;
/// let x = DnsKeysListResponse::new().set_or_clear_next_page_token(Some("example"));
/// let x = DnsKeysListResponse::new().set_or_clear_next_page_token(None::<String>);
/// ```
pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DnsKeysListResponse {
fn typename() -> &'static str {
"type.googleapis.com/.DnsKeysListResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for DnsKeysListResponse {
type PageItem = crate::model::DnsKey;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.dns_keys
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone().unwrap_or_default()
}
}
/// 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.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Expr {
/// Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
pub description: std::option::Option<std::string::String>,
/// Textual representation of an expression in Common Expression Language syntax.
pub expression: std::option::Option<std::string::String>,
/// Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
pub location: std::option::Option<std::string::String>,
/// 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.
pub title: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Expr {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [description][crate::model::Expr::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Expr;
/// let x = Expr::new().set_description("example");
/// ```
pub fn set_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [description][crate::model::Expr::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Expr;
/// let x = Expr::new().set_or_clear_description(Some("example"));
/// let x = Expr::new().set_or_clear_description(None::<String>);
/// ```
pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = v.map(|x| x.into());
self
}
/// Sets the value of [expression][crate::model::Expr::expression].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Expr;
/// let x = Expr::new().set_expression("example");
/// ```
pub fn set_expression<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.expression = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [expression][crate::model::Expr::expression].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Expr;
/// let x = Expr::new().set_or_clear_expression(Some("example"));
/// let x = Expr::new().set_or_clear_expression(None::<String>);
/// ```
pub fn set_or_clear_expression<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.expression = v.map(|x| x.into());
self
}
/// Sets the value of [location][crate::model::Expr::location].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Expr;
/// let x = Expr::new().set_location("example");
/// ```
pub fn set_location<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.location = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [location][crate::model::Expr::location].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Expr;
/// let x = Expr::new().set_or_clear_location(Some("example"));
/// let x = Expr::new().set_or_clear_location(None::<String>);
/// ```
pub fn set_or_clear_location<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.location = v.map(|x| x.into());
self
}
/// Sets the value of [title][crate::model::Expr::title].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Expr;
/// let x = Expr::new().set_title("example");
/// ```
pub fn set_title<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.title = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [title][crate::model::Expr::title].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Expr;
/// let x = Expr::new().set_or_clear_title(Some("example"));
/// let x = Expr::new().set_or_clear_title(None::<String>);
/// ```
pub fn set_or_clear_title<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.title = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Expr {
fn typename() -> &'static str {
"type.googleapis.com/.Expr"
}
}
/// 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.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleIamV1AuditConfig {
/// The configuration for logging of each type of permission.
pub audit_log_configs: std::vec::Vec<crate::model::GoogleIamV1AuditLogConfig>,
/// 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.
pub service: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleIamV1AuditConfig {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [audit_log_configs][crate::model::GoogleIamV1AuditConfig::audit_log_configs].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1AuditConfig;
/// use google_cloud_dns_v1::model::GoogleIamV1AuditLogConfig;
/// let x = GoogleIamV1AuditConfig::new()
/// .set_audit_log_configs([
/// GoogleIamV1AuditLogConfig::default()/* use setters */,
/// GoogleIamV1AuditLogConfig::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_audit_log_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GoogleIamV1AuditLogConfig>,
{
use std::iter::Iterator;
self.audit_log_configs = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [service][crate::model::GoogleIamV1AuditConfig::service].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1AuditConfig;
/// let x = GoogleIamV1AuditConfig::new().set_service("example");
/// ```
pub fn set_service<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.service = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [service][crate::model::GoogleIamV1AuditConfig::service].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1AuditConfig;
/// let x = GoogleIamV1AuditConfig::new().set_or_clear_service(Some("example"));
/// let x = GoogleIamV1AuditConfig::new().set_or_clear_service(None::<String>);
/// ```
pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.service = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GoogleIamV1AuditConfig {
fn typename() -> &'static str {
"type.googleapis.com/.GoogleIamV1AuditConfig"
}
}
/// 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.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleIamV1AuditLogConfig {
/// Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.
pub exempted_members: std::vec::Vec<std::string::String>,
/// The log type that this config enables.
pub log_type: std::option::Option<crate::model::google_iam_v_1_audit_log_config::LogType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleIamV1AuditLogConfig {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [exempted_members][crate::model::GoogleIamV1AuditLogConfig::exempted_members].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1AuditLogConfig;
/// let x = GoogleIamV1AuditLogConfig::new().set_exempted_members(["a", "b", "c"]);
/// ```
pub fn set_exempted_members<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.exempted_members = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [log_type][crate::model::GoogleIamV1AuditLogConfig::log_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1AuditLogConfig;
/// use google_cloud_dns_v1::model::google_iam_v_1_audit_log_config::LogType;
/// let x0 = GoogleIamV1AuditLogConfig::new().set_log_type(LogType::AdminRead);
/// let x1 = GoogleIamV1AuditLogConfig::new().set_log_type(LogType::DataWrite);
/// let x2 = GoogleIamV1AuditLogConfig::new().set_log_type(LogType::DataRead);
/// ```
pub fn set_log_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::google_iam_v_1_audit_log_config::LogType>,
{
self.log_type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [log_type][crate::model::GoogleIamV1AuditLogConfig::log_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1AuditLogConfig;
/// use google_cloud_dns_v1::model::google_iam_v_1_audit_log_config::LogType;
/// let x0 = GoogleIamV1AuditLogConfig::new().set_or_clear_log_type(Some(LogType::AdminRead));
/// let x1 = GoogleIamV1AuditLogConfig::new().set_or_clear_log_type(Some(LogType::DataWrite));
/// let x2 = GoogleIamV1AuditLogConfig::new().set_or_clear_log_type(Some(LogType::DataRead));
/// let x_none = GoogleIamV1AuditLogConfig::new().set_or_clear_log_type(None::<LogType>);
/// ```
pub fn set_or_clear_log_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::google_iam_v_1_audit_log_config::LogType>,
{
self.log_type = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GoogleIamV1AuditLogConfig {
fn typename() -> &'static str {
"type.googleapis.com/.GoogleIamV1AuditLogConfig"
}
}
/// Defines additional types related to [GoogleIamV1AuditLogConfig].
pub mod google_iam_v_1_audit_log_config {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [logType][.GoogleIamV1AuditLogConfig.logType] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LogType {
/// Default case. Should never be this.
Unspecified,
/// Admin reads. Example: CloudIAM getIamPolicy
AdminRead,
/// Data writes. Example: CloudSQL Users create
DataWrite,
/// Data reads. Example: CloudSQL Users list
DataRead,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [LogType::value] or
/// [LogType::name].
UnknownValue(log_type::UnknownValue),
}
#[doc(hidden)]
pub mod log_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl LogType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::AdminRead => std::option::Option::Some(1),
Self::DataWrite => std::option::Option::Some(2),
Self::DataRead => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("LOG_TYPE_UNSPECIFIED"),
Self::AdminRead => std::option::Option::Some("ADMIN_READ"),
Self::DataWrite => std::option::Option::Some("DATA_WRITE"),
Self::DataRead => std::option::Option::Some("DATA_READ"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for LogType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for LogType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for LogType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::AdminRead,
2 => Self::DataWrite,
3 => Self::DataRead,
_ => Self::UnknownValue(log_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for LogType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LOG_TYPE_UNSPECIFIED" => Self::Unspecified,
"ADMIN_READ" => Self::AdminRead,
"DATA_WRITE" => Self::DataWrite,
"DATA_READ" => Self::DataRead,
_ => Self::UnknownValue(log_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for LogType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_str("LOG_TYPE_UNSPECIFIED"),
Self::AdminRead => serializer.serialize_str("ADMIN_READ"),
Self::DataWrite => serializer.serialize_str("DATA_WRITE"),
Self::DataRead => serializer.serialize_str("DATA_READ"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for LogType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<LogType>::new(
"..GoogleIamV1AuditLogConfig.logType",
))
}
}
}
/// Associates `members`, or principals, with a `role`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleIamV1Binding {
/// 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).
pub condition: std::option::Option<crate::model::Expr>,
/// 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`.
pub members: std::vec::Vec<std::string::String>,
/// 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).
pub role: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleIamV1Binding {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [condition][crate::model::GoogleIamV1Binding::condition].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1Binding;
/// use google_cloud_dns_v1::model::Expr;
/// let x = GoogleIamV1Binding::new().set_condition(Expr::default()/* use setters */);
/// ```
pub fn set_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Expr>,
{
self.condition = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [condition][crate::model::GoogleIamV1Binding::condition].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1Binding;
/// use google_cloud_dns_v1::model::Expr;
/// let x = GoogleIamV1Binding::new().set_or_clear_condition(Some(Expr::default()/* use setters */));
/// let x = GoogleIamV1Binding::new().set_or_clear_condition(None::<Expr>);
/// ```
pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Expr>,
{
self.condition = v.map(|x| x.into());
self
}
/// Sets the value of [members][crate::model::GoogleIamV1Binding::members].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1Binding;
/// let x = GoogleIamV1Binding::new().set_members(["a", "b", "c"]);
/// ```
pub fn set_members<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.members = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [role][crate::model::GoogleIamV1Binding::role].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1Binding;
/// let x = GoogleIamV1Binding::new().set_role("example");
/// ```
pub fn set_role<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.role = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [role][crate::model::GoogleIamV1Binding::role].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1Binding;
/// let x = GoogleIamV1Binding::new().set_or_clear_role(Some("example"));
/// let x = GoogleIamV1Binding::new().set_or_clear_role(None::<String>);
/// ```
pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.role = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GoogleIamV1Binding {
fn typename() -> &'static str {
"type.googleapis.com/.GoogleIamV1Binding"
}
}
/// Request message for `GetIamPolicy` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleIamV1GetIamPolicyRequest {
/// OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`.
pub options: std::option::Option<crate::model::GoogleIamV1GetPolicyOptions>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleIamV1GetIamPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [options][crate::model::GoogleIamV1GetIamPolicyRequest::options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1GetIamPolicyRequest;
/// use google_cloud_dns_v1::model::GoogleIamV1GetPolicyOptions;
/// let x = GoogleIamV1GetIamPolicyRequest::new().set_options(GoogleIamV1GetPolicyOptions::default()/* use setters */);
/// ```
pub fn set_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GoogleIamV1GetPolicyOptions>,
{
self.options = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [options][crate::model::GoogleIamV1GetIamPolicyRequest::options].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1GetIamPolicyRequest;
/// use google_cloud_dns_v1::model::GoogleIamV1GetPolicyOptions;
/// let x = GoogleIamV1GetIamPolicyRequest::new().set_or_clear_options(Some(GoogleIamV1GetPolicyOptions::default()/* use setters */));
/// let x = GoogleIamV1GetIamPolicyRequest::new().set_or_clear_options(None::<GoogleIamV1GetPolicyOptions>);
/// ```
pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GoogleIamV1GetPolicyOptions>,
{
self.options = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GoogleIamV1GetIamPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/.GoogleIamV1GetIamPolicyRequest"
}
}
/// Encapsulates settings provided to GetIamPolicy.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleIamV1GetPolicyOptions {
/// 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).
pub requested_policy_version: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleIamV1GetPolicyOptions {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [requested_policy_version][crate::model::GoogleIamV1GetPolicyOptions::requested_policy_version].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1GetPolicyOptions;
/// let x = GoogleIamV1GetPolicyOptions::new().set_requested_policy_version(42);
/// ```
pub fn set_requested_policy_version<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.requested_policy_version = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [requested_policy_version][crate::model::GoogleIamV1GetPolicyOptions::requested_policy_version].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1GetPolicyOptions;
/// let x = GoogleIamV1GetPolicyOptions::new().set_or_clear_requested_policy_version(Some(42));
/// let x = GoogleIamV1GetPolicyOptions::new().set_or_clear_requested_policy_version(None::<i32>);
/// ```
pub fn set_or_clear_requested_policy_version<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.requested_policy_version = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GoogleIamV1GetPolicyOptions {
fn typename() -> &'static str {
"type.googleapis.com/.GoogleIamV1GetPolicyOptions"
}
}
/// 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/).
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleIamV1Policy {
/// Specifies cloud audit logging configuration for this policy.
pub audit_configs: std::vec::Vec<crate::model::GoogleIamV1AuditConfig>,
/// 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`.
pub bindings: std::vec::Vec<crate::model::GoogleIamV1Binding>,
/// `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.
pub etag: std::option::Option<::bytes::Bytes>,
/// 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).
pub version: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleIamV1Policy {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [audit_configs][crate::model::GoogleIamV1Policy::audit_configs].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
/// use google_cloud_dns_v1::model::GoogleIamV1AuditConfig;
/// let x = GoogleIamV1Policy::new()
/// .set_audit_configs([
/// GoogleIamV1AuditConfig::default()/* use setters */,
/// GoogleIamV1AuditConfig::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_audit_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GoogleIamV1AuditConfig>,
{
use std::iter::Iterator;
self.audit_configs = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [bindings][crate::model::GoogleIamV1Policy::bindings].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
/// use google_cloud_dns_v1::model::GoogleIamV1Binding;
/// let x = GoogleIamV1Policy::new()
/// .set_bindings([
/// GoogleIamV1Binding::default()/* use setters */,
/// GoogleIamV1Binding::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_bindings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GoogleIamV1Binding>,
{
use std::iter::Iterator;
self.bindings = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [etag][crate::model::GoogleIamV1Policy::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
/// let x = GoogleIamV1Policy::new().set_etag(bytes::Bytes::from_static(b"example"));
/// ```
pub fn set_etag<T>(mut self, v: T) -> Self
where
T: std::convert::Into<::bytes::Bytes>,
{
self.etag = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [etag][crate::model::GoogleIamV1Policy::etag].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
/// let x = GoogleIamV1Policy::new().set_or_clear_etag(Some(bytes::Bytes::from_static(b"example")));
/// let x = GoogleIamV1Policy::new().set_or_clear_etag(None::<bytes::Bytes>);
/// ```
pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<::bytes::Bytes>,
{
self.etag = v.map(|x| x.into());
self
}
/// Sets the value of [version][crate::model::GoogleIamV1Policy::version].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
/// let x = GoogleIamV1Policy::new().set_version(42);
/// ```
pub fn set_version<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.version = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [version][crate::model::GoogleIamV1Policy::version].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1Policy;
/// let x = GoogleIamV1Policy::new().set_or_clear_version(Some(42));
/// let x = GoogleIamV1Policy::new().set_or_clear_version(None::<i32>);
/// ```
pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.version = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GoogleIamV1Policy {
fn typename() -> &'static str {
"type.googleapis.com/.GoogleIamV1Policy"
}
}
/// Request message for `SetIamPolicy` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleIamV1SetIamPolicyRequest {
/// 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.
pub policy: std::option::Option<crate::model::GoogleIamV1Policy>,
/// 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"`
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleIamV1SetIamPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [policy][crate::model::GoogleIamV1SetIamPolicyRequest::policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
/// use google_cloud_dns_v1::model::GoogleIamV1Policy;
/// let x = GoogleIamV1SetIamPolicyRequest::new().set_policy(GoogleIamV1Policy::default()/* use setters */);
/// ```
pub fn set_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GoogleIamV1Policy>,
{
self.policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [policy][crate::model::GoogleIamV1SetIamPolicyRequest::policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
/// use google_cloud_dns_v1::model::GoogleIamV1Policy;
/// let x = GoogleIamV1SetIamPolicyRequest::new().set_or_clear_policy(Some(GoogleIamV1Policy::default()/* use setters */));
/// let x = GoogleIamV1SetIamPolicyRequest::new().set_or_clear_policy(None::<GoogleIamV1Policy>);
/// ```
pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GoogleIamV1Policy>,
{
self.policy = v.map(|x| x.into());
self
}
/// Sets the value of [update_mask][crate::model::GoogleIamV1SetIamPolicyRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
/// use wkt::FieldMask;
/// let x = GoogleIamV1SetIamPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
/// ```
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [update_mask][crate::model::GoogleIamV1SetIamPolicyRequest::update_mask].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
/// use wkt::FieldMask;
/// let x = GoogleIamV1SetIamPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
/// let x = GoogleIamV1SetIamPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
/// ```
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GoogleIamV1SetIamPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/.GoogleIamV1SetIamPolicyRequest"
}
}
/// Request message for `TestIamPermissions` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleIamV1TestIamPermissionsRequest {
/// 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).
pub permissions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleIamV1TestIamPermissionsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [permissions][crate::model::GoogleIamV1TestIamPermissionsRequest::permissions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1TestIamPermissionsRequest;
/// let x = GoogleIamV1TestIamPermissionsRequest::new().set_permissions(["a", "b", "c"]);
/// ```
pub fn set_permissions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.permissions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GoogleIamV1TestIamPermissionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/.GoogleIamV1TestIamPermissionsRequest"
}
}
/// Response message for `TestIamPermissions` method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleIamV1TestIamPermissionsResponse {
/// A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
pub permissions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GoogleIamV1TestIamPermissionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [permissions][crate::model::GoogleIamV1TestIamPermissionsResponse::permissions].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::GoogleIamV1TestIamPermissionsResponse;
/// let x = GoogleIamV1TestIamPermissionsResponse::new().set_permissions(["a", "b", "c"]);
/// ```
pub fn set_permissions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.permissions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GoogleIamV1TestIamPermissionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/.GoogleIamV1TestIamPermissionsResponse"
}
}
/// 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.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZone {
pub cloud_logging_config: std::option::Option<crate::model::ManagedZoneCloudLoggingConfig>,
/// The time that this resource was created on the server. This is in RFC3339 text format. Output only.
pub creation_time: std::option::Option<std::string::String>,
/// 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.
pub description: std::option::Option<std::string::String>,
/// The DNS name of this managed zone, for instance "example.com.".
pub dns_name: std::option::Option<std::string::String>,
/// DNSSEC configuration.
pub dnssec_config: std::option::Option<crate::model::ManagedZoneDnsSecConfig>,
/// 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.
pub forwarding_config: std::option::Option<crate::model::ManagedZoneForwardingConfig>,
/// Unique identifier for the resource; defined by the server (output only)
pub id: std::option::Option<u64>,
pub kind: std::option::Option<std::string::String>,
/// User labels.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// 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.
pub name: std::option::Option<std::string::String>,
/// 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.
pub name_server_set: std::option::Option<std::string::String>,
/// Delegate your managed_zone to these virtual name servers; defined by the server (output only)
pub name_servers: std::vec::Vec<std::string::String>,
/// 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.
pub peering_config: std::option::Option<crate::model::ManagedZonePeeringConfig>,
/// For privately visible zones, the set of Virtual Private Cloud resources that the zone is visible from.
pub private_visibility_config:
std::option::Option<crate::model::ManagedZonePrivateVisibilityConfig>,
/// 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.
pub reverse_lookup_config: std::option::Option<crate::model::ManagedZoneReverseLookupConfig>,
/// This field links to the associated service directory namespace. Do not set this field for public zones or forwarding zones.
pub service_directory_config:
std::option::Option<crate::model::ManagedZoneServiceDirectoryConfig>,
/// The zone's visibility: public zones are exposed to the Internet, while private zones are visible only to Virtual Private Cloud resources.
pub visibility: std::option::Option<crate::model::managed_zone::Visibility>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZone {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [cloud_logging_config][crate::model::ManagedZone::cloud_logging_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
/// let x = ManagedZone::new().set_cloud_logging_config(ManagedZoneCloudLoggingConfig::default()/* use setters */);
/// ```
pub fn set_cloud_logging_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneCloudLoggingConfig>,
{
self.cloud_logging_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [cloud_logging_config][crate::model::ManagedZone::cloud_logging_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
/// let x = ManagedZone::new().set_or_clear_cloud_logging_config(Some(ManagedZoneCloudLoggingConfig::default()/* use setters */));
/// let x = ManagedZone::new().set_or_clear_cloud_logging_config(None::<ManagedZoneCloudLoggingConfig>);
/// ```
pub fn set_or_clear_cloud_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneCloudLoggingConfig>,
{
self.cloud_logging_config = v.map(|x| x.into());
self
}
/// Sets the value of [creation_time][crate::model::ManagedZone::creation_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_creation_time("example");
/// ```
pub fn set_creation_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.creation_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [creation_time][crate::model::ManagedZone::creation_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_or_clear_creation_time(Some("example"));
/// let x = ManagedZone::new().set_or_clear_creation_time(None::<String>);
/// ```
pub fn set_or_clear_creation_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.creation_time = v.map(|x| x.into());
self
}
/// Sets the value of [description][crate::model::ManagedZone::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_description("example");
/// ```
pub fn set_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [description][crate::model::ManagedZone::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_or_clear_description(Some("example"));
/// let x = ManagedZone::new().set_or_clear_description(None::<String>);
/// ```
pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = v.map(|x| x.into());
self
}
/// Sets the value of [dns_name][crate::model::ManagedZone::dns_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_dns_name("example");
/// ```
pub fn set_dns_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [dns_name][crate::model::ManagedZone::dns_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_or_clear_dns_name(Some("example"));
/// let x = ManagedZone::new().set_or_clear_dns_name(None::<String>);
/// ```
pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = v.map(|x| x.into());
self
}
/// Sets the value of [dnssec_config][crate::model::ManagedZone::dnssec_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
/// let x = ManagedZone::new().set_dnssec_config(ManagedZoneDnsSecConfig::default()/* use setters */);
/// ```
pub fn set_dnssec_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneDnsSecConfig>,
{
self.dnssec_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [dnssec_config][crate::model::ManagedZone::dnssec_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
/// let x = ManagedZone::new().set_or_clear_dnssec_config(Some(ManagedZoneDnsSecConfig::default()/* use setters */));
/// let x = ManagedZone::new().set_or_clear_dnssec_config(None::<ManagedZoneDnsSecConfig>);
/// ```
pub fn set_or_clear_dnssec_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneDnsSecConfig>,
{
self.dnssec_config = v.map(|x| x.into());
self
}
/// Sets the value of [forwarding_config][crate::model::ManagedZone::forwarding_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZoneForwardingConfig;
/// let x = ManagedZone::new().set_forwarding_config(ManagedZoneForwardingConfig::default()/* use setters */);
/// ```
pub fn set_forwarding_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneForwardingConfig>,
{
self.forwarding_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [forwarding_config][crate::model::ManagedZone::forwarding_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZoneForwardingConfig;
/// let x = ManagedZone::new().set_or_clear_forwarding_config(Some(ManagedZoneForwardingConfig::default()/* use setters */));
/// let x = ManagedZone::new().set_or_clear_forwarding_config(None::<ManagedZoneForwardingConfig>);
/// ```
pub fn set_or_clear_forwarding_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneForwardingConfig>,
{
self.forwarding_config = v.map(|x| x.into());
self
}
/// Sets the value of [id][crate::model::ManagedZone::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_id(42_u32);
/// ```
pub fn set_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<u64>,
{
self.id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [id][crate::model::ManagedZone::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_or_clear_id(Some(42_u32));
/// let x = ManagedZone::new().set_or_clear_id(None::<u32>);
/// ```
pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<u64>,
{
self.id = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::ManagedZone::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZone::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZone::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::ManagedZone::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [name][crate::model::ManagedZone::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_name("example");
/// ```
pub fn set_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [name][crate::model::ManagedZone::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_or_clear_name(Some("example"));
/// let x = ManagedZone::new().set_or_clear_name(None::<String>);
/// ```
pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = v.map(|x| x.into());
self
}
/// Sets the value of [name_server_set][crate::model::ManagedZone::name_server_set].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_name_server_set("example");
/// ```
pub fn set_name_server_set<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name_server_set = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [name_server_set][crate::model::ManagedZone::name_server_set].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_or_clear_name_server_set(Some("example"));
/// let x = ManagedZone::new().set_or_clear_name_server_set(None::<String>);
/// ```
pub fn set_or_clear_name_server_set<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name_server_set = v.map(|x| x.into());
self
}
/// Sets the value of [name_servers][crate::model::ManagedZone::name_servers].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZone::new().set_name_servers(["a", "b", "c"]);
/// ```
pub fn set_name_servers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.name_servers = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [peering_config][crate::model::ManagedZone::peering_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
/// let x = ManagedZone::new().set_peering_config(ManagedZonePeeringConfig::default()/* use setters */);
/// ```
pub fn set_peering_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZonePeeringConfig>,
{
self.peering_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [peering_config][crate::model::ManagedZone::peering_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
/// let x = ManagedZone::new().set_or_clear_peering_config(Some(ManagedZonePeeringConfig::default()/* use setters */));
/// let x = ManagedZone::new().set_or_clear_peering_config(None::<ManagedZonePeeringConfig>);
/// ```
pub fn set_or_clear_peering_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZonePeeringConfig>,
{
self.peering_config = v.map(|x| x.into());
self
}
/// Sets the value of [private_visibility_config][crate::model::ManagedZone::private_visibility_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
/// let x = ManagedZone::new().set_private_visibility_config(ManagedZonePrivateVisibilityConfig::default()/* use setters */);
/// ```
pub fn set_private_visibility_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZonePrivateVisibilityConfig>,
{
self.private_visibility_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [private_visibility_config][crate::model::ManagedZone::private_visibility_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
/// let x = ManagedZone::new().set_or_clear_private_visibility_config(Some(ManagedZonePrivateVisibilityConfig::default()/* use setters */));
/// let x = ManagedZone::new().set_or_clear_private_visibility_config(None::<ManagedZonePrivateVisibilityConfig>);
/// ```
pub fn set_or_clear_private_visibility_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZonePrivateVisibilityConfig>,
{
self.private_visibility_config = v.map(|x| x.into());
self
}
/// Sets the value of [reverse_lookup_config][crate::model::ManagedZone::reverse_lookup_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZoneReverseLookupConfig;
/// let x = ManagedZone::new().set_reverse_lookup_config(ManagedZoneReverseLookupConfig::default()/* use setters */);
/// ```
pub fn set_reverse_lookup_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneReverseLookupConfig>,
{
self.reverse_lookup_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [reverse_lookup_config][crate::model::ManagedZone::reverse_lookup_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZoneReverseLookupConfig;
/// let x = ManagedZone::new().set_or_clear_reverse_lookup_config(Some(ManagedZoneReverseLookupConfig::default()/* use setters */));
/// let x = ManagedZone::new().set_or_clear_reverse_lookup_config(None::<ManagedZoneReverseLookupConfig>);
/// ```
pub fn set_or_clear_reverse_lookup_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneReverseLookupConfig>,
{
self.reverse_lookup_config = v.map(|x| x.into());
self
}
/// Sets the value of [service_directory_config][crate::model::ManagedZone::service_directory_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
/// let x = ManagedZone::new().set_service_directory_config(ManagedZoneServiceDirectoryConfig::default()/* use setters */);
/// ```
pub fn set_service_directory_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneServiceDirectoryConfig>,
{
self.service_directory_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [service_directory_config][crate::model::ManagedZone::service_directory_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
/// let x = ManagedZone::new().set_or_clear_service_directory_config(Some(ManagedZoneServiceDirectoryConfig::default()/* use setters */));
/// let x = ManagedZone::new().set_or_clear_service_directory_config(None::<ManagedZoneServiceDirectoryConfig>);
/// ```
pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneServiceDirectoryConfig>,
{
self.service_directory_config = v.map(|x| x.into());
self
}
/// Sets the value of [visibility][crate::model::ManagedZone::visibility].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::managed_zone::Visibility;
/// let x0 = ManagedZone::new().set_visibility(Visibility::Private);
/// ```
pub fn set_visibility<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::managed_zone::Visibility>,
{
self.visibility = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [visibility][crate::model::ManagedZone::visibility].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZone;
/// use google_cloud_dns_v1::model::managed_zone::Visibility;
/// let x0 = ManagedZone::new().set_or_clear_visibility(Some(Visibility::Private));
/// let x_none = ManagedZone::new().set_or_clear_visibility(None::<Visibility>);
/// ```
pub fn set_or_clear_visibility<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::managed_zone::Visibility>,
{
self.visibility = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZone {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZone"
}
}
/// Defines additional types related to [ManagedZone].
pub mod managed_zone {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [visibility][.ManagedZone.visibility] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Visibility {
/// Indicates that records in this zone can be queried from the public internet.
Public,
/// Indicates that records in this zone cannot be queried from the public internet. Access to private zones depends on the zone configuration.
Private,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Visibility::value] or
/// [Visibility::name].
UnknownValue(visibility::UnknownValue),
}
#[doc(hidden)]
pub mod visibility {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Visibility {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Public => std::option::Option::Some(0),
Self::Private => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Public => std::option::Option::Some("public"),
Self::Private => std::option::Option::Some("private"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Visibility {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Visibility {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Visibility {
fn from(value: i32) -> Self {
match value {
0 => Self::Public,
1 => Self::Private,
_ => Self::UnknownValue(visibility::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Visibility {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"public" => Self::Public,
"private" => Self::Private,
_ => Self::UnknownValue(visibility::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Visibility {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Public => serializer.serialize_str("public"),
Self::Private => serializer.serialize_str("private"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Visibility {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Visibility>::new(
"..ManagedZone.visibility",
))
}
}
}
/// Cloud Logging configurations for publicly visible zones.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZoneCloudLoggingConfig {
/// If set, enable query logging for this ManagedZone. False by default, making logging opt-in.
pub enable_logging: std::option::Option<bool>,
pub kind: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZoneCloudLoggingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [enable_logging][crate::model::ManagedZoneCloudLoggingConfig::enable_logging].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
/// let x = ManagedZoneCloudLoggingConfig::new().set_enable_logging(true);
/// ```
pub fn set_enable_logging<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_logging = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [enable_logging][crate::model::ManagedZoneCloudLoggingConfig::enable_logging].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
/// let x = ManagedZoneCloudLoggingConfig::new().set_or_clear_enable_logging(Some(false));
/// let x = ManagedZoneCloudLoggingConfig::new().set_or_clear_enable_logging(None::<bool>);
/// ```
pub fn set_or_clear_enable_logging<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_logging = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::ManagedZoneCloudLoggingConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
/// let x = ManagedZoneCloudLoggingConfig::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZoneCloudLoggingConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneCloudLoggingConfig;
/// let x = ManagedZoneCloudLoggingConfig::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZoneCloudLoggingConfig::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZoneCloudLoggingConfig {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZoneCloudLoggingConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZoneDnsSecConfig {
/// Specifies parameters for generating initial DnsKeys for this ManagedZone. Can only be changed while the state is OFF.
pub default_key_specs: std::vec::Vec<crate::model::DnsKeySpec>,
pub kind: std::option::Option<std::string::String>,
/// Specifies the mechanism for authenticated denial-of-existence responses. Can only be changed while the state is OFF.
pub non_existence: std::option::Option<crate::model::managed_zone_dns_sec_config::NonExistence>,
/// Specifies whether DNSSEC is enabled, and what mode it is in.
pub state: std::option::Option<crate::model::managed_zone_dns_sec_config::State>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZoneDnsSecConfig {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [default_key_specs][crate::model::ManagedZoneDnsSecConfig::default_key_specs].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
/// use google_cloud_dns_v1::model::DnsKeySpec;
/// let x = ManagedZoneDnsSecConfig::new()
/// .set_default_key_specs([
/// DnsKeySpec::default()/* use setters */,
/// DnsKeySpec::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_default_key_specs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DnsKeySpec>,
{
use std::iter::Iterator;
self.default_key_specs = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [kind][crate::model::ManagedZoneDnsSecConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
/// let x = ManagedZoneDnsSecConfig::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZoneDnsSecConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
/// let x = ManagedZoneDnsSecConfig::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZoneDnsSecConfig::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [non_existence][crate::model::ManagedZoneDnsSecConfig::non_existence].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
/// use google_cloud_dns_v1::model::managed_zone_dns_sec_config::NonExistence;
/// let x0 = ManagedZoneDnsSecConfig::new().set_non_existence(NonExistence::Nsec3);
/// ```
pub fn set_non_existence<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::managed_zone_dns_sec_config::NonExistence>,
{
self.non_existence = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [non_existence][crate::model::ManagedZoneDnsSecConfig::non_existence].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
/// use google_cloud_dns_v1::model::managed_zone_dns_sec_config::NonExistence;
/// let x0 = ManagedZoneDnsSecConfig::new().set_or_clear_non_existence(Some(NonExistence::Nsec3));
/// let x_none = ManagedZoneDnsSecConfig::new().set_or_clear_non_existence(None::<NonExistence>);
/// ```
pub fn set_or_clear_non_existence<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::managed_zone_dns_sec_config::NonExistence>,
{
self.non_existence = v.map(|x| x.into());
self
}
/// Sets the value of [state][crate::model::ManagedZoneDnsSecConfig::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
/// use google_cloud_dns_v1::model::managed_zone_dns_sec_config::State;
/// let x0 = ManagedZoneDnsSecConfig::new().set_state(State::On);
/// let x1 = ManagedZoneDnsSecConfig::new().set_state(State::Transfer);
/// ```
pub fn set_state<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::managed_zone_dns_sec_config::State>,
{
self.state = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [state][crate::model::ManagedZoneDnsSecConfig::state].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneDnsSecConfig;
/// use google_cloud_dns_v1::model::managed_zone_dns_sec_config::State;
/// let x0 = ManagedZoneDnsSecConfig::new().set_or_clear_state(Some(State::On));
/// let x1 = ManagedZoneDnsSecConfig::new().set_or_clear_state(Some(State::Transfer));
/// let x_none = ManagedZoneDnsSecConfig::new().set_or_clear_state(None::<State>);
/// ```
pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::managed_zone_dns_sec_config::State>,
{
self.state = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZoneDnsSecConfig {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZoneDnsSecConfig"
}
}
/// Defines additional types related to [ManagedZoneDnsSecConfig].
pub mod managed_zone_dns_sec_config {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [nonExistence][.ManagedZoneDnsSecConfig.nonExistence] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NonExistence {
/// 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.
Nsec,
/// 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.
Nsec3,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [NonExistence::value] or
/// [NonExistence::name].
UnknownValue(non_existence::UnknownValue),
}
#[doc(hidden)]
pub mod non_existence {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl NonExistence {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Nsec => std::option::Option::Some(0),
Self::Nsec3 => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Nsec => std::option::Option::Some("nsec"),
Self::Nsec3 => std::option::Option::Some("nsec3"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for NonExistence {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for NonExistence {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for NonExistence {
fn from(value: i32) -> Self {
match value {
0 => Self::Nsec,
1 => Self::Nsec3,
_ => Self::UnknownValue(non_existence::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for NonExistence {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"nsec" => Self::Nsec,
"nsec3" => Self::Nsec3,
_ => Self::UnknownValue(non_existence::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for NonExistence {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Nsec => serializer.serialize_str("nsec"),
Self::Nsec3 => serializer.serialize_str("nsec3"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for NonExistence {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<NonExistence>::new(
"..ManagedZoneDnsSecConfig.nonExistence",
))
}
}
/// The enumerated type for the [state][.ManagedZoneDnsSecConfig.state] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
/// DNSSEC is disabled; the zone is not signed.
Off,
/// DNSSEC is enabled; the zone is signed and fully managed.
On,
/// DNSSEC is enabled, but in a "transfer" mode.
Transfer,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [State::value] or
/// [State::name].
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Off => std::option::Option::Some(0),
Self::On => std::option::Option::Some(1),
Self::Transfer => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Off => std::option::Option::Some("off"),
Self::On => std::option::Option::Some("on"),
Self::Transfer => std::option::Option::Some("transfer"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Off,
1 => Self::On,
2 => Self::Transfer,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"off" => Self::Off,
"on" => Self::On,
"transfer" => Self::Transfer,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Off => serializer.serialize_str("off"),
Self::On => serializer.serialize_str("on"),
Self::Transfer => serializer.serialize_str("transfer"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
"..ManagedZoneDnsSecConfig.state",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZoneForwardingConfig {
pub kind: std::option::Option<std::string::String>,
/// List of target name servers to forward to. Cloud DNS selects the best available name server if more than one target is given.
pub target_name_servers:
std::vec::Vec<crate::model::ManagedZoneForwardingConfigNameServerTarget>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZoneForwardingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::ManagedZoneForwardingConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfig;
/// let x = ManagedZoneForwardingConfig::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZoneForwardingConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfig;
/// let x = ManagedZoneForwardingConfig::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZoneForwardingConfig::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [target_name_servers][crate::model::ManagedZoneForwardingConfig::target_name_servers].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfig;
/// use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
/// let x = ManagedZoneForwardingConfig::new()
/// .set_target_name_servers([
/// ManagedZoneForwardingConfigNameServerTarget::default()/* use setters */,
/// ManagedZoneForwardingConfigNameServerTarget::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_target_name_servers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ManagedZoneForwardingConfigNameServerTarget>,
{
use std::iter::Iterator;
self.target_name_servers = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ManagedZoneForwardingConfig {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZoneForwardingConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZoneForwardingConfigNameServerTarget {
/// Fully qualified domain name for the forwarding target.
pub domain_name: std::option::Option<std::string::String>,
/// 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.
pub forwarding_path: std::option::Option<
crate::model::managed_zone_forwarding_config_name_server_target::ForwardingPath,
>,
/// IPv4 address of a target name server.
pub ipv_4_address: std::option::Option<std::string::String>,
/// IPv6 address of a target name server. Does not accept both fields (ipv4 & ipv6) being populated. Public preview as of November 2022.
pub ipv_6_address: std::option::Option<std::string::String>,
pub kind: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZoneForwardingConfigNameServerTarget {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [domain_name][crate::model::ManagedZoneForwardingConfigNameServerTarget::domain_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_domain_name("example");
/// ```
pub fn set_domain_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.domain_name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [domain_name][crate::model::ManagedZoneForwardingConfigNameServerTarget::domain_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_domain_name(Some("example"));
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_domain_name(None::<String>);
/// ```
pub fn set_or_clear_domain_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.domain_name = v.map(|x| x.into());
self
}
/// Sets the value of [forwarding_path][crate::model::ManagedZoneForwardingConfigNameServerTarget::forwarding_path].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
/// use google_cloud_dns_v1::model::managed_zone_forwarding_config_name_server_target::ForwardingPath;
/// let x0 = ManagedZoneForwardingConfigNameServerTarget::new().set_forwarding_path(ForwardingPath::Private);
/// ```
pub fn set_forwarding_path<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::managed_zone_forwarding_config_name_server_target::ForwardingPath,
>,
{
self.forwarding_path = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [forwarding_path][crate::model::ManagedZoneForwardingConfigNameServerTarget::forwarding_path].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
/// use google_cloud_dns_v1::model::managed_zone_forwarding_config_name_server_target::ForwardingPath;
/// let x0 = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_forwarding_path(Some(ForwardingPath::Private));
/// let x_none = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_forwarding_path(None::<ForwardingPath>);
/// ```
pub fn set_or_clear_forwarding_path<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::managed_zone_forwarding_config_name_server_target::ForwardingPath,
>,
{
self.forwarding_path = v.map(|x| x.into());
self
}
/// Sets the value of [ipv_4_address][crate::model::ManagedZoneForwardingConfigNameServerTarget::ipv_4_address].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_ipv_4_address("example");
/// ```
pub fn set_ipv_4_address<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ipv_4_address = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [ipv_4_address][crate::model::ManagedZoneForwardingConfigNameServerTarget::ipv_4_address].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_ipv_4_address(Some("example"));
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_ipv_4_address(None::<String>);
/// ```
pub fn set_or_clear_ipv_4_address<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ipv_4_address = v.map(|x| x.into());
self
}
/// Sets the value of [ipv_6_address][crate::model::ManagedZoneForwardingConfigNameServerTarget::ipv_6_address].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_ipv_6_address("example");
/// ```
pub fn set_ipv_6_address<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ipv_6_address = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [ipv_6_address][crate::model::ManagedZoneForwardingConfigNameServerTarget::ipv_6_address].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_ipv_6_address(Some("example"));
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_ipv_6_address(None::<String>);
/// ```
pub fn set_or_clear_ipv_6_address<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ipv_6_address = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::ManagedZoneForwardingConfigNameServerTarget::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZoneForwardingConfigNameServerTarget::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneForwardingConfigNameServerTarget;
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZoneForwardingConfigNameServerTarget::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZoneForwardingConfigNameServerTarget {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZoneForwardingConfigNameServerTarget"
}
}
/// Defines additional types related to [ManagedZoneForwardingConfigNameServerTarget].
pub mod managed_zone_forwarding_config_name_server_target {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [forwardingPath][.ManagedZoneForwardingConfigNameServerTarget.forwardingPath] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ForwardingPath {
/// 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
Default,
/// Cloud DNS always forwards to this target through the VPC.
Private,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [ForwardingPath::value] or
/// [ForwardingPath::name].
UnknownValue(forwarding_path::UnknownValue),
}
#[doc(hidden)]
pub mod forwarding_path {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ForwardingPath {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Default => std::option::Option::Some(0),
Self::Private => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Default => std::option::Option::Some("default"),
Self::Private => std::option::Option::Some("private"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ForwardingPath {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ForwardingPath {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ForwardingPath {
fn from(value: i32) -> Self {
match value {
0 => Self::Default,
1 => Self::Private,
_ => Self::UnknownValue(forwarding_path::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ForwardingPath {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"default" => Self::Default,
"private" => Self::Private,
_ => Self::UnknownValue(forwarding_path::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ForwardingPath {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Default => serializer.serialize_str("default"),
Self::Private => serializer.serialize_str("private"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ForwardingPath {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ForwardingPath>::new(
"..ManagedZoneForwardingConfigNameServerTarget.forwardingPath",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZoneOperationsListResponse {
/// Type of resource.
pub kind: std::option::Option<std::string::String>,
/// 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.
pub next_page_token: std::option::Option<std::string::String>,
/// The operation resources.
pub operations: std::vec::Vec<crate::model::Operation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZoneOperationsListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::ManagedZoneOperationsListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneOperationsListResponse;
/// let x = ManagedZoneOperationsListResponse::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZoneOperationsListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneOperationsListResponse;
/// let x = ManagedZoneOperationsListResponse::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZoneOperationsListResponse::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [next_page_token][crate::model::ManagedZoneOperationsListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneOperationsListResponse;
/// let x = ManagedZoneOperationsListResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [next_page_token][crate::model::ManagedZoneOperationsListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneOperationsListResponse;
/// let x = ManagedZoneOperationsListResponse::new().set_or_clear_next_page_token(Some("example"));
/// let x = ManagedZoneOperationsListResponse::new().set_or_clear_next_page_token(None::<String>);
/// ```
pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = v.map(|x| x.into());
self
}
/// Sets the value of [operations][crate::model::ManagedZoneOperationsListResponse::operations].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneOperationsListResponse;
/// use google_cloud_dns_v1::model::Operation;
/// let x = ManagedZoneOperationsListResponse::new()
/// .set_operations([
/// Operation::default()/* use setters */,
/// Operation::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_operations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Operation>,
{
use std::iter::Iterator;
self.operations = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ManagedZoneOperationsListResponse {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZoneOperationsListResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ManagedZoneOperationsListResponse {
type PageItem = crate::model::Operation;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.operations
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone().unwrap_or_default()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZonePeeringConfig {
pub kind: std::option::Option<std::string::String>,
/// The network with which to peer.
pub target_network: std::option::Option<crate::model::ManagedZonePeeringConfigTargetNetwork>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZonePeeringConfig {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::ManagedZonePeeringConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
/// let x = ManagedZonePeeringConfig::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZonePeeringConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
/// let x = ManagedZonePeeringConfig::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZonePeeringConfig::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [target_network][crate::model::ManagedZonePeeringConfig::target_network].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
/// use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
/// let x = ManagedZonePeeringConfig::new().set_target_network(ManagedZonePeeringConfigTargetNetwork::default()/* use setters */);
/// ```
pub fn set_target_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZonePeeringConfigTargetNetwork>,
{
self.target_network = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [target_network][crate::model::ManagedZonePeeringConfig::target_network].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePeeringConfig;
/// use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
/// let x = ManagedZonePeeringConfig::new().set_or_clear_target_network(Some(ManagedZonePeeringConfigTargetNetwork::default()/* use setters */));
/// let x = ManagedZonePeeringConfig::new().set_or_clear_target_network(None::<ManagedZonePeeringConfigTargetNetwork>);
/// ```
pub fn set_or_clear_target_network<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZonePeeringConfigTargetNetwork>,
{
self.target_network = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZonePeeringConfig {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZonePeeringConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZonePeeringConfigTargetNetwork {
/// 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.
pub deactivate_time: std::option::Option<std::string::String>,
pub kind: std::option::Option<std::string::String>,
/// 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}>`
pub network_url: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZonePeeringConfigTargetNetwork {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [deactivate_time][crate::model::ManagedZonePeeringConfigTargetNetwork::deactivate_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
/// let x = ManagedZonePeeringConfigTargetNetwork::new().set_deactivate_time("example");
/// ```
pub fn set_deactivate_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.deactivate_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [deactivate_time][crate::model::ManagedZonePeeringConfigTargetNetwork::deactivate_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
/// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_deactivate_time(Some("example"));
/// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_deactivate_time(None::<String>);
/// ```
pub fn set_or_clear_deactivate_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.deactivate_time = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::ManagedZonePeeringConfigTargetNetwork::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
/// let x = ManagedZonePeeringConfigTargetNetwork::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZonePeeringConfigTargetNetwork::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
/// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [network_url][crate::model::ManagedZonePeeringConfigTargetNetwork::network_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
/// let x = ManagedZonePeeringConfigTargetNetwork::new().set_network_url("example");
/// ```
pub fn set_network_url<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.network_url = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [network_url][crate::model::ManagedZonePeeringConfigTargetNetwork::network_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePeeringConfigTargetNetwork;
/// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_network_url(Some("example"));
/// let x = ManagedZonePeeringConfigTargetNetwork::new().set_or_clear_network_url(None::<String>);
/// ```
pub fn set_or_clear_network_url<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.network_url = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZonePeeringConfigTargetNetwork {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZonePeeringConfigTargetNetwork"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZonePrivateVisibilityConfig {
/// The list of Google Kubernetes Engine clusters that can see this zone.
pub gke_clusters: std::vec::Vec<crate::model::ManagedZonePrivateVisibilityConfigGKECluster>,
pub kind: std::option::Option<std::string::String>,
/// The list of VPC networks that can see this zone.
pub networks: std::vec::Vec<crate::model::ManagedZonePrivateVisibilityConfigNetwork>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZonePrivateVisibilityConfig {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [gke_clusters][crate::model::ManagedZonePrivateVisibilityConfig::gke_clusters].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
/// use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigGKECluster;
/// let x = ManagedZonePrivateVisibilityConfig::new()
/// .set_gke_clusters([
/// ManagedZonePrivateVisibilityConfigGKECluster::default()/* use setters */,
/// ManagedZonePrivateVisibilityConfigGKECluster::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ManagedZonePrivateVisibilityConfigGKECluster>,
{
use std::iter::Iterator;
self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [kind][crate::model::ManagedZonePrivateVisibilityConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
/// let x = ManagedZonePrivateVisibilityConfig::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZonePrivateVisibilityConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
/// let x = ManagedZonePrivateVisibilityConfig::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZonePrivateVisibilityConfig::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [networks][crate::model::ManagedZonePrivateVisibilityConfig::networks].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfig;
/// use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigNetwork;
/// let x = ManagedZonePrivateVisibilityConfig::new()
/// .set_networks([
/// ManagedZonePrivateVisibilityConfigNetwork::default()/* use setters */,
/// ManagedZonePrivateVisibilityConfigNetwork::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_networks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ManagedZonePrivateVisibilityConfigNetwork>,
{
use std::iter::Iterator;
self.networks = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ManagedZonePrivateVisibilityConfig {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZonePrivateVisibilityConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZonePrivateVisibilityConfigGKECluster {
/// 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>
pub gke_cluster_name: std::option::Option<std::string::String>,
pub kind: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZonePrivateVisibilityConfigGKECluster {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [gke_cluster_name][crate::model::ManagedZonePrivateVisibilityConfigGKECluster::gke_cluster_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigGKECluster;
/// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_gke_cluster_name("example");
/// ```
pub fn set_gke_cluster_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.gke_cluster_name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [gke_cluster_name][crate::model::ManagedZonePrivateVisibilityConfigGKECluster::gke_cluster_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigGKECluster;
/// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_or_clear_gke_cluster_name(Some("example"));
/// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_or_clear_gke_cluster_name(None::<String>);
/// ```
pub fn set_or_clear_gke_cluster_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.gke_cluster_name = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::ManagedZonePrivateVisibilityConfigGKECluster::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigGKECluster;
/// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZonePrivateVisibilityConfigGKECluster::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigGKECluster;
/// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZonePrivateVisibilityConfigGKECluster::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZonePrivateVisibilityConfigGKECluster {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZonePrivateVisibilityConfigGKECluster"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZonePrivateVisibilityConfigNetwork {
pub kind: std::option::Option<std::string::String>,
/// 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}>`
pub network_url: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZonePrivateVisibilityConfigNetwork {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::ManagedZonePrivateVisibilityConfigNetwork::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigNetwork;
/// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZonePrivateVisibilityConfigNetwork::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigNetwork;
/// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [network_url][crate::model::ManagedZonePrivateVisibilityConfigNetwork::network_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigNetwork;
/// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_network_url("example");
/// ```
pub fn set_network_url<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.network_url = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [network_url][crate::model::ManagedZonePrivateVisibilityConfigNetwork::network_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonePrivateVisibilityConfigNetwork;
/// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_or_clear_network_url(Some("example"));
/// let x = ManagedZonePrivateVisibilityConfigNetwork::new().set_or_clear_network_url(None::<String>);
/// ```
pub fn set_or_clear_network_url<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.network_url = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZonePrivateVisibilityConfigNetwork {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZonePrivateVisibilityConfigNetwork"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZoneReverseLookupConfig {
pub kind: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZoneReverseLookupConfig {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::ManagedZoneReverseLookupConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneReverseLookupConfig;
/// let x = ManagedZoneReverseLookupConfig::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZoneReverseLookupConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneReverseLookupConfig;
/// let x = ManagedZoneReverseLookupConfig::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZoneReverseLookupConfig::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZoneReverseLookupConfig {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZoneReverseLookupConfig"
}
}
/// Contains information about Service Directory-backed zones.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZoneServiceDirectoryConfig {
pub kind: std::option::Option<std::string::String>,
/// Contains information about the namespace associated with the zone.
pub namespace: std::option::Option<crate::model::ManagedZoneServiceDirectoryConfigNamespace>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZoneServiceDirectoryConfig {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::ManagedZoneServiceDirectoryConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
/// let x = ManagedZoneServiceDirectoryConfig::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZoneServiceDirectoryConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
/// let x = ManagedZoneServiceDirectoryConfig::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZoneServiceDirectoryConfig::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [namespace][crate::model::ManagedZoneServiceDirectoryConfig::namespace].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
/// use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
/// let x = ManagedZoneServiceDirectoryConfig::new().set_namespace(ManagedZoneServiceDirectoryConfigNamespace::default()/* use setters */);
/// ```
pub fn set_namespace<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneServiceDirectoryConfigNamespace>,
{
self.namespace = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [namespace][crate::model::ManagedZoneServiceDirectoryConfig::namespace].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfig;
/// use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
/// let x = ManagedZoneServiceDirectoryConfig::new().set_or_clear_namespace(Some(ManagedZoneServiceDirectoryConfigNamespace::default()/* use setters */));
/// let x = ManagedZoneServiceDirectoryConfig::new().set_or_clear_namespace(None::<ManagedZoneServiceDirectoryConfigNamespace>);
/// ```
pub fn set_or_clear_namespace<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZoneServiceDirectoryConfigNamespace>,
{
self.namespace = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZoneServiceDirectoryConfig {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZoneServiceDirectoryConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZoneServiceDirectoryConfigNamespace {
/// 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.
pub deletion_time: std::option::Option<std::string::String>,
pub kind: std::option::Option<std::string::String>,
/// 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}>`
pub namespace_url: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZoneServiceDirectoryConfigNamespace {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [deletion_time][crate::model::ManagedZoneServiceDirectoryConfigNamespace::deletion_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
/// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_deletion_time("example");
/// ```
pub fn set_deletion_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.deletion_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [deletion_time][crate::model::ManagedZoneServiceDirectoryConfigNamespace::deletion_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
/// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_deletion_time(Some("example"));
/// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_deletion_time(None::<String>);
/// ```
pub fn set_or_clear_deletion_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.deletion_time = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::ManagedZoneServiceDirectoryConfigNamespace::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
/// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZoneServiceDirectoryConfigNamespace::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
/// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [namespace_url][crate::model::ManagedZoneServiceDirectoryConfigNamespace::namespace_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
/// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_namespace_url("example");
/// ```
pub fn set_namespace_url<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.namespace_url = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [namespace_url][crate::model::ManagedZoneServiceDirectoryConfigNamespace::namespace_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZoneServiceDirectoryConfigNamespace;
/// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_namespace_url(Some("example"));
/// let x = ManagedZoneServiceDirectoryConfigNamespace::new().set_or_clear_namespace_url(None::<String>);
/// ```
pub fn set_or_clear_namespace_url<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.namespace_url = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZoneServiceDirectoryConfigNamespace {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZoneServiceDirectoryConfigNamespace"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedZonesListResponse {
/// Type of resource.
pub kind: std::option::Option<std::string::String>,
/// The managed zone resources.
pub managed_zones: std::vec::Vec<crate::model::ManagedZone>,
/// 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.
pub next_page_token: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ManagedZonesListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::ManagedZonesListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonesListResponse;
/// let x = ManagedZonesListResponse::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ManagedZonesListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonesListResponse;
/// let x = ManagedZonesListResponse::new().set_or_clear_kind(Some("example"));
/// let x = ManagedZonesListResponse::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zones][crate::model::ManagedZonesListResponse::managed_zones].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonesListResponse;
/// use google_cloud_dns_v1::model::ManagedZone;
/// let x = ManagedZonesListResponse::new()
/// .set_managed_zones([
/// ManagedZone::default()/* use setters */,
/// ManagedZone::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_managed_zones<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ManagedZone>,
{
use std::iter::Iterator;
self.managed_zones = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [next_page_token][crate::model::ManagedZonesListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonesListResponse;
/// let x = ManagedZonesListResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [next_page_token][crate::model::ManagedZonesListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ManagedZonesListResponse;
/// let x = ManagedZonesListResponse::new().set_or_clear_next_page_token(Some("example"));
/// let x = ManagedZonesListResponse::new().set_or_clear_next_page_token(None::<String>);
/// ```
pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ManagedZonesListResponse {
fn typename() -> &'static str {
"type.googleapis.com/.ManagedZonesListResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ManagedZonesListResponse {
type PageItem = crate::model::ManagedZone;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.managed_zones
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone().unwrap_or_default()
}
}
/// 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.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Operation {
/// Only populated if the operation targeted a DnsKey (output only).
pub dns_key_context: std::option::Option<crate::model::OperationDnsKeyContext>,
/// 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)
pub id: std::option::Option<std::string::String>,
pub kind: std::option::Option<std::string::String>,
/// The time that this operation was started by the server. This is in RFC3339 text format (output only).
pub start_time: std::option::Option<std::string::String>,
/// 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.
pub status: std::option::Option<crate::model::operation::Status>,
/// Type of the operation. Operations include insert, update, and delete (output only).
pub r#type: std::option::Option<std::string::String>,
/// User who requested the operation, for example: user@example.com. cloud-dns-system for operations automatically done by the system. (output only)
pub user: std::option::Option<std::string::String>,
/// Only populated if the operation targeted a ManagedZone (output only).
pub zone_context: std::option::Option<crate::model::OperationManagedZoneContext>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Operation {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [dns_key_context][crate::model::Operation::dns_key_context].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// use google_cloud_dns_v1::model::OperationDnsKeyContext;
/// let x = Operation::new().set_dns_key_context(OperationDnsKeyContext::default()/* use setters */);
/// ```
pub fn set_dns_key_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OperationDnsKeyContext>,
{
self.dns_key_context = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [dns_key_context][crate::model::Operation::dns_key_context].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// use google_cloud_dns_v1::model::OperationDnsKeyContext;
/// let x = Operation::new().set_or_clear_dns_key_context(Some(OperationDnsKeyContext::default()/* use setters */));
/// let x = Operation::new().set_or_clear_dns_key_context(None::<OperationDnsKeyContext>);
/// ```
pub fn set_or_clear_dns_key_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OperationDnsKeyContext>,
{
self.dns_key_context = v.map(|x| x.into());
self
}
/// Sets the value of [id][crate::model::Operation::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// let x = Operation::new().set_id("example");
/// ```
pub fn set_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [id][crate::model::Operation::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// let x = Operation::new().set_or_clear_id(Some("example"));
/// let x = Operation::new().set_or_clear_id(None::<String>);
/// ```
pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.id = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::Operation::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// let x = Operation::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::Operation::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// let x = Operation::new().set_or_clear_kind(Some("example"));
/// let x = Operation::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [start_time][crate::model::Operation::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// let x = Operation::new().set_start_time("example");
/// ```
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [start_time][crate::model::Operation::start_time].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// let x = Operation::new().set_or_clear_start_time(Some("example"));
/// let x = Operation::new().set_or_clear_start_time(None::<String>);
/// ```
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.start_time = v.map(|x| x.into());
self
}
/// Sets the value of [status][crate::model::Operation::status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// use google_cloud_dns_v1::model::operation::Status;
/// let x0 = Operation::new().set_status(Status::Done);
/// ```
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::operation::Status>,
{
self.status = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [status][crate::model::Operation::status].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// use google_cloud_dns_v1::model::operation::Status;
/// let x0 = Operation::new().set_or_clear_status(Some(Status::Done));
/// let x_none = Operation::new().set_or_clear_status(None::<Status>);
/// ```
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::operation::Status>,
{
self.status = v.map(|x| x.into());
self
}
/// Sets the value of [r#type][crate::model::Operation::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// let x = Operation::new().set_type("example");
/// ```
pub fn set_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.r#type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [r#type][crate::model::Operation::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// let x = Operation::new().set_or_clear_type(Some("example"));
/// let x = Operation::new().set_or_clear_type(None::<String>);
/// ```
pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.r#type = v.map(|x| x.into());
self
}
/// Sets the value of [user][crate::model::Operation::user].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// let x = Operation::new().set_user("example");
/// ```
pub fn set_user<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.user = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [user][crate::model::Operation::user].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// let x = Operation::new().set_or_clear_user(Some("example"));
/// let x = Operation::new().set_or_clear_user(None::<String>);
/// ```
pub fn set_or_clear_user<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.user = v.map(|x| x.into());
self
}
/// Sets the value of [zone_context][crate::model::Operation::zone_context].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// use google_cloud_dns_v1::model::OperationManagedZoneContext;
/// let x = Operation::new().set_zone_context(OperationManagedZoneContext::default()/* use setters */);
/// ```
pub fn set_zone_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::OperationManagedZoneContext>,
{
self.zone_context = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [zone_context][crate::model::Operation::zone_context].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Operation;
/// use google_cloud_dns_v1::model::OperationManagedZoneContext;
/// let x = Operation::new().set_or_clear_zone_context(Some(OperationManagedZoneContext::default()/* use setters */));
/// let x = Operation::new().set_or_clear_zone_context(None::<OperationManagedZoneContext>);
/// ```
pub fn set_or_clear_zone_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::OperationManagedZoneContext>,
{
self.zone_context = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Operation {
fn typename() -> &'static str {
"type.googleapis.com/.Operation"
}
}
/// Defines additional types related to [Operation].
pub mod operation {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [status][.Operation.status] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Status {
Pending,
Done,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Status::value] or
/// [Status::name].
UnknownValue(status::UnknownValue),
}
#[doc(hidden)]
pub mod status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Status {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Pending => std::option::Option::Some(0),
Self::Done => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Pending => std::option::Option::Some("pending"),
Self::Done => std::option::Option::Some("done"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Status {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Status {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Status {
fn from(value: i32) -> Self {
match value {
0 => Self::Pending,
1 => Self::Done,
_ => Self::UnknownValue(status::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Status {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"pending" => Self::Pending,
"done" => Self::Done,
_ => Self::UnknownValue(status::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Status {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Pending => serializer.serialize_str("pending"),
Self::Done => serializer.serialize_str("done"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Status {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
"..Operation.status",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationDnsKeyContext {
/// The post-operation DnsKey resource.
pub new_value: std::option::Option<crate::model::DnsKey>,
/// The pre-operation DnsKey resource.
pub old_value: std::option::Option<crate::model::DnsKey>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationDnsKeyContext {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [new_value][crate::model::OperationDnsKeyContext::new_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::OperationDnsKeyContext;
/// use google_cloud_dns_v1::model::DnsKey;
/// let x = OperationDnsKeyContext::new().set_new_value(DnsKey::default()/* use setters */);
/// ```
pub fn set_new_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DnsKey>,
{
self.new_value = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [new_value][crate::model::OperationDnsKeyContext::new_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::OperationDnsKeyContext;
/// use google_cloud_dns_v1::model::DnsKey;
/// let x = OperationDnsKeyContext::new().set_or_clear_new_value(Some(DnsKey::default()/* use setters */));
/// let x = OperationDnsKeyContext::new().set_or_clear_new_value(None::<DnsKey>);
/// ```
pub fn set_or_clear_new_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DnsKey>,
{
self.new_value = v.map(|x| x.into());
self
}
/// Sets the value of [old_value][crate::model::OperationDnsKeyContext::old_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::OperationDnsKeyContext;
/// use google_cloud_dns_v1::model::DnsKey;
/// let x = OperationDnsKeyContext::new().set_old_value(DnsKey::default()/* use setters */);
/// ```
pub fn set_old_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DnsKey>,
{
self.old_value = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [old_value][crate::model::OperationDnsKeyContext::old_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::OperationDnsKeyContext;
/// use google_cloud_dns_v1::model::DnsKey;
/// let x = OperationDnsKeyContext::new().set_or_clear_old_value(Some(DnsKey::default()/* use setters */));
/// let x = OperationDnsKeyContext::new().set_or_clear_old_value(None::<DnsKey>);
/// ```
pub fn set_or_clear_old_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DnsKey>,
{
self.old_value = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for OperationDnsKeyContext {
fn typename() -> &'static str {
"type.googleapis.com/.OperationDnsKeyContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationManagedZoneContext {
/// The post-operation ManagedZone resource.
pub new_value: std::option::Option<crate::model::ManagedZone>,
/// The pre-operation ManagedZone resource.
pub old_value: std::option::Option<crate::model::ManagedZone>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationManagedZoneContext {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [new_value][crate::model::OperationManagedZoneContext::new_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::OperationManagedZoneContext;
/// use google_cloud_dns_v1::model::ManagedZone;
/// let x = OperationManagedZoneContext::new().set_new_value(ManagedZone::default()/* use setters */);
/// ```
pub fn set_new_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZone>,
{
self.new_value = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [new_value][crate::model::OperationManagedZoneContext::new_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::OperationManagedZoneContext;
/// use google_cloud_dns_v1::model::ManagedZone;
/// let x = OperationManagedZoneContext::new().set_or_clear_new_value(Some(ManagedZone::default()/* use setters */));
/// let x = OperationManagedZoneContext::new().set_or_clear_new_value(None::<ManagedZone>);
/// ```
pub fn set_or_clear_new_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZone>,
{
self.new_value = v.map(|x| x.into());
self
}
/// Sets the value of [old_value][crate::model::OperationManagedZoneContext::old_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::OperationManagedZoneContext;
/// use google_cloud_dns_v1::model::ManagedZone;
/// let x = OperationManagedZoneContext::new().set_old_value(ManagedZone::default()/* use setters */);
/// ```
pub fn set_old_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZone>,
{
self.old_value = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [old_value][crate::model::OperationManagedZoneContext::old_value].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::OperationManagedZoneContext;
/// use google_cloud_dns_v1::model::ManagedZone;
/// let x = OperationManagedZoneContext::new().set_or_clear_old_value(Some(ManagedZone::default()/* use setters */));
/// let x = OperationManagedZoneContext::new().set_or_clear_old_value(None::<ManagedZone>);
/// ```
pub fn set_or_clear_old_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZone>,
{
self.old_value = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for OperationManagedZoneContext {
fn typename() -> &'static str {
"type.googleapis.com/.OperationManagedZoneContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PoliciesListResponse {
/// Type of resource.
pub kind: std::option::Option<std::string::String>,
/// 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.
pub next_page_token: std::option::Option<std::string::String>,
/// The policy resources.
pub policies: std::vec::Vec<crate::model::Policy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PoliciesListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::PoliciesListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PoliciesListResponse;
/// let x = PoliciesListResponse::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::PoliciesListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PoliciesListResponse;
/// let x = PoliciesListResponse::new().set_or_clear_kind(Some("example"));
/// let x = PoliciesListResponse::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [next_page_token][crate::model::PoliciesListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PoliciesListResponse;
/// let x = PoliciesListResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [next_page_token][crate::model::PoliciesListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PoliciesListResponse;
/// let x = PoliciesListResponse::new().set_or_clear_next_page_token(Some("example"));
/// let x = PoliciesListResponse::new().set_or_clear_next_page_token(None::<String>);
/// ```
pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = v.map(|x| x.into());
self
}
/// Sets the value of [policies][crate::model::PoliciesListResponse::policies].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PoliciesListResponse;
/// use google_cloud_dns_v1::model::Policy;
/// let x = PoliciesListResponse::new()
/// .set_policies([
/// Policy::default()/* use setters */,
/// Policy::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_policies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Policy>,
{
use std::iter::Iterator;
self.policies = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PoliciesListResponse {
fn typename() -> &'static str {
"type.googleapis.com/.PoliciesListResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for PoliciesListResponse {
type PageItem = crate::model::Policy;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.policies
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone().unwrap_or_default()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PoliciesPatchResponse {
pub policy: std::option::Option<crate::model::Policy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PoliciesPatchResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [policy][crate::model::PoliciesPatchResponse::policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PoliciesPatchResponse;
/// use google_cloud_dns_v1::model::Policy;
/// let x = PoliciesPatchResponse::new().set_policy(Policy::default()/* use setters */);
/// ```
pub fn set_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [policy][crate::model::PoliciesPatchResponse::policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PoliciesPatchResponse;
/// use google_cloud_dns_v1::model::Policy;
/// let x = PoliciesPatchResponse::new().set_or_clear_policy(Some(Policy::default()/* use setters */));
/// let x = PoliciesPatchResponse::new().set_or_clear_policy(None::<Policy>);
/// ```
pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.policy = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PoliciesPatchResponse {
fn typename() -> &'static str {
"type.googleapis.com/.PoliciesPatchResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PoliciesUpdateResponse {
pub policy: std::option::Option<crate::model::Policy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PoliciesUpdateResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [policy][crate::model::PoliciesUpdateResponse::policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PoliciesUpdateResponse;
/// use google_cloud_dns_v1::model::Policy;
/// let x = PoliciesUpdateResponse::new().set_policy(Policy::default()/* use setters */);
/// ```
pub fn set_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [policy][crate::model::PoliciesUpdateResponse::policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PoliciesUpdateResponse;
/// use google_cloud_dns_v1::model::Policy;
/// let x = PoliciesUpdateResponse::new().set_or_clear_policy(Some(Policy::default()/* use setters */));
/// let x = PoliciesUpdateResponse::new().set_or_clear_policy(None::<Policy>);
/// ```
pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.policy = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PoliciesUpdateResponse {
fn typename() -> &'static str {
"type.googleapis.com/.PoliciesUpdateResponse"
}
}
/// A policy is a collection of DNS rules applied to one or more Virtual Private Cloud resources.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Policy {
/// 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.
pub alternative_name_server_config:
std::option::Option<crate::model::PolicyAlternativeNameServerConfig>,
/// 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.
pub description: std::option::Option<std::string::String>,
/// Configurations related to DNS64 for this policy.
pub dns_64_config: std::option::Option<crate::model::PolicyDns64Config>,
/// 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.
pub enable_inbound_forwarding: std::option::Option<bool>,
/// Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.
pub enable_logging: std::option::Option<bool>,
/// Unique identifier for the resource; defined by the server (output only).
pub id: std::option::Option<u64>,
pub kind: std::option::Option<std::string::String>,
/// User-assigned name for this policy.
pub name: std::option::Option<std::string::String>,
/// List of network names specifying networks to which this policy is applied.
pub networks: std::vec::Vec<crate::model::PolicyNetwork>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Policy {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [alternative_name_server_config][crate::model::Policy::alternative_name_server_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfig;
/// let x = Policy::new().set_alternative_name_server_config(PolicyAlternativeNameServerConfig::default()/* use setters */);
/// ```
pub fn set_alternative_name_server_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PolicyAlternativeNameServerConfig>,
{
self.alternative_name_server_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [alternative_name_server_config][crate::model::Policy::alternative_name_server_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfig;
/// let x = Policy::new().set_or_clear_alternative_name_server_config(Some(PolicyAlternativeNameServerConfig::default()/* use setters */));
/// let x = Policy::new().set_or_clear_alternative_name_server_config(None::<PolicyAlternativeNameServerConfig>);
/// ```
pub fn set_or_clear_alternative_name_server_config<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::PolicyAlternativeNameServerConfig>,
{
self.alternative_name_server_config = v.map(|x| x.into());
self
}
/// Sets the value of [description][crate::model::Policy::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_description("example");
/// ```
pub fn set_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [description][crate::model::Policy::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_or_clear_description(Some("example"));
/// let x = Policy::new().set_or_clear_description(None::<String>);
/// ```
pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = v.map(|x| x.into());
self
}
/// Sets the value of [dns_64_config][crate::model::Policy::dns_64_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// use google_cloud_dns_v1::model::PolicyDns64Config;
/// let x = Policy::new().set_dns_64_config(PolicyDns64Config::default()/* use setters */);
/// ```
pub fn set_dns_64_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PolicyDns64Config>,
{
self.dns_64_config = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [dns_64_config][crate::model::Policy::dns_64_config].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// use google_cloud_dns_v1::model::PolicyDns64Config;
/// let x = Policy::new().set_or_clear_dns_64_config(Some(PolicyDns64Config::default()/* use setters */));
/// let x = Policy::new().set_or_clear_dns_64_config(None::<PolicyDns64Config>);
/// ```
pub fn set_or_clear_dns_64_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PolicyDns64Config>,
{
self.dns_64_config = v.map(|x| x.into());
self
}
/// Sets the value of [enable_inbound_forwarding][crate::model::Policy::enable_inbound_forwarding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_enable_inbound_forwarding(true);
/// ```
pub fn set_enable_inbound_forwarding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_inbound_forwarding = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [enable_inbound_forwarding][crate::model::Policy::enable_inbound_forwarding].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_or_clear_enable_inbound_forwarding(Some(false));
/// let x = Policy::new().set_or_clear_enable_inbound_forwarding(None::<bool>);
/// ```
pub fn set_or_clear_enable_inbound_forwarding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_inbound_forwarding = v.map(|x| x.into());
self
}
/// Sets the value of [enable_logging][crate::model::Policy::enable_logging].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_enable_logging(true);
/// ```
pub fn set_enable_logging<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_logging = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [enable_logging][crate::model::Policy::enable_logging].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_or_clear_enable_logging(Some(false));
/// let x = Policy::new().set_or_clear_enable_logging(None::<bool>);
/// ```
pub fn set_or_clear_enable_logging<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_logging = v.map(|x| x.into());
self
}
/// Sets the value of [id][crate::model::Policy::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_id(42_u32);
/// ```
pub fn set_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<u64>,
{
self.id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [id][crate::model::Policy::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_or_clear_id(Some(42_u32));
/// let x = Policy::new().set_or_clear_id(None::<u32>);
/// ```
pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<u64>,
{
self.id = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::Policy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::Policy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_or_clear_kind(Some("example"));
/// let x = Policy::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [name][crate::model::Policy::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_name("example");
/// ```
pub fn set_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [name][crate::model::Policy::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// let x = Policy::new().set_or_clear_name(Some("example"));
/// let x = Policy::new().set_or_clear_name(None::<String>);
/// ```
pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = v.map(|x| x.into());
self
}
/// Sets the value of [networks][crate::model::Policy::networks].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Policy;
/// use google_cloud_dns_v1::model::PolicyNetwork;
/// let x = Policy::new()
/// .set_networks([
/// PolicyNetwork::default()/* use setters */,
/// PolicyNetwork::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_networks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PolicyNetwork>,
{
use std::iter::Iterator;
self.networks = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Policy {
fn typename() -> &'static str {
"type.googleapis.com/.Policy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyAlternativeNameServerConfig {
pub kind: std::option::Option<std::string::String>,
/// 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.
pub target_name_servers:
std::vec::Vec<crate::model::PolicyAlternativeNameServerConfigTargetNameServer>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolicyAlternativeNameServerConfig {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::PolicyAlternativeNameServerConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfig;
/// let x = PolicyAlternativeNameServerConfig::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::PolicyAlternativeNameServerConfig::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfig;
/// let x = PolicyAlternativeNameServerConfig::new().set_or_clear_kind(Some("example"));
/// let x = PolicyAlternativeNameServerConfig::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [target_name_servers][crate::model::PolicyAlternativeNameServerConfig::target_name_servers].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfig;
/// use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
/// let x = PolicyAlternativeNameServerConfig::new()
/// .set_target_name_servers([
/// PolicyAlternativeNameServerConfigTargetNameServer::default()/* use setters */,
/// PolicyAlternativeNameServerConfigTargetNameServer::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_target_name_servers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PolicyAlternativeNameServerConfigTargetNameServer>,
{
use std::iter::Iterator;
self.target_name_servers = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PolicyAlternativeNameServerConfig {
fn typename() -> &'static str {
"type.googleapis.com/.PolicyAlternativeNameServerConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyAlternativeNameServerConfigTargetNameServer {
/// 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.
pub forwarding_path: std::option::Option<
crate::model::policy_alternative_name_server_config_target_name_server::ForwardingPath,
>,
/// IPv4 address to forward queries to.
pub ipv_4_address: std::option::Option<std::string::String>,
/// IPv6 address to forward to. Does not accept both fields (ipv4 & ipv6) being populated. Public preview as of November 2022.
pub ipv_6_address: std::option::Option<std::string::String>,
pub kind: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolicyAlternativeNameServerConfigTargetNameServer {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [forwarding_path][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::forwarding_path].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
/// use google_cloud_dns_v1::model::policy_alternative_name_server_config_target_name_server::ForwardingPath;
/// let x0 = PolicyAlternativeNameServerConfigTargetNameServer::new().set_forwarding_path(ForwardingPath::Private);
/// ```
pub fn set_forwarding_path<T>(mut self, v: T) -> Self
where T: std::convert::Into<crate::model::policy_alternative_name_server_config_target_name_server::ForwardingPath>
{
self.forwarding_path = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [forwarding_path][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::forwarding_path].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
/// use google_cloud_dns_v1::model::policy_alternative_name_server_config_target_name_server::ForwardingPath;
/// let x0 = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_forwarding_path(Some(ForwardingPath::Private));
/// let x_none = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_forwarding_path(None::<ForwardingPath>);
/// ```
pub fn set_or_clear_forwarding_path<T>(mut self, v: std::option::Option<T>) -> Self
where T: std::convert::Into<crate::model::policy_alternative_name_server_config_target_name_server::ForwardingPath>
{
self.forwarding_path = v.map(|x| x.into());
self
}
/// Sets the value of [ipv_4_address][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::ipv_4_address].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
/// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_ipv_4_address("example");
/// ```
pub fn set_ipv_4_address<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ipv_4_address = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [ipv_4_address][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::ipv_4_address].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
/// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_ipv_4_address(Some("example"));
/// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_ipv_4_address(None::<String>);
/// ```
pub fn set_or_clear_ipv_4_address<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ipv_4_address = v.map(|x| x.into());
self
}
/// Sets the value of [ipv_6_address][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::ipv_6_address].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
/// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_ipv_6_address("example");
/// ```
pub fn set_ipv_6_address<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ipv_6_address = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [ipv_6_address][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::ipv_6_address].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
/// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_ipv_6_address(Some("example"));
/// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_ipv_6_address(None::<String>);
/// ```
pub fn set_or_clear_ipv_6_address<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ipv_6_address = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
/// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::PolicyAlternativeNameServerConfigTargetNameServer::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyAlternativeNameServerConfigTargetNameServer;
/// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_kind(Some("example"));
/// let x = PolicyAlternativeNameServerConfigTargetNameServer::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PolicyAlternativeNameServerConfigTargetNameServer {
fn typename() -> &'static str {
"type.googleapis.com/.PolicyAlternativeNameServerConfigTargetNameServer"
}
}
/// Defines additional types related to [PolicyAlternativeNameServerConfigTargetNameServer].
pub mod policy_alternative_name_server_config_target_name_server {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [forwardingPath][.PolicyAlternativeNameServerConfigTargetNameServer.forwardingPath] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ForwardingPath {
/// 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
Default,
/// Cloud DNS always forwards to this target through the VPC.
Private,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [ForwardingPath::value] or
/// [ForwardingPath::name].
UnknownValue(forwarding_path::UnknownValue),
}
#[doc(hidden)]
pub mod forwarding_path {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ForwardingPath {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Default => std::option::Option::Some(0),
Self::Private => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Default => std::option::Option::Some("default"),
Self::Private => std::option::Option::Some("private"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ForwardingPath {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ForwardingPath {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ForwardingPath {
fn from(value: i32) -> Self {
match value {
0 => Self::Default,
1 => Self::Private,
_ => Self::UnknownValue(forwarding_path::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ForwardingPath {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"default" => Self::Default,
"private" => Self::Private,
_ => Self::UnknownValue(forwarding_path::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ForwardingPath {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Default => serializer.serialize_str("default"),
Self::Private => serializer.serialize_str("private"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ForwardingPath {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ForwardingPath>::new(
"..PolicyAlternativeNameServerConfigTargetNameServer.forwardingPath",
))
}
}
}
/// DNS64 policies
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyDns64Config {
pub kind: std::option::Option<std::string::String>,
/// The scope to which DNS64 config will be applied to.
pub scope: std::option::Option<crate::model::PolicyDns64ConfigScope>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolicyDns64Config {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::PolicyDns64Config::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyDns64Config;
/// let x = PolicyDns64Config::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::PolicyDns64Config::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyDns64Config;
/// let x = PolicyDns64Config::new().set_or_clear_kind(Some("example"));
/// let x = PolicyDns64Config::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [scope][crate::model::PolicyDns64Config::scope].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyDns64Config;
/// use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
/// let x = PolicyDns64Config::new().set_scope(PolicyDns64ConfigScope::default()/* use setters */);
/// ```
pub fn set_scope<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PolicyDns64ConfigScope>,
{
self.scope = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [scope][crate::model::PolicyDns64Config::scope].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyDns64Config;
/// use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
/// let x = PolicyDns64Config::new().set_or_clear_scope(Some(PolicyDns64ConfigScope::default()/* use setters */));
/// let x = PolicyDns64Config::new().set_or_clear_scope(None::<PolicyDns64ConfigScope>);
/// ```
pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PolicyDns64ConfigScope>,
{
self.scope = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PolicyDns64Config {
fn typename() -> &'static str {
"type.googleapis.com/.PolicyDns64Config"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyDns64ConfigScope {
/// Controls whether DNS64 is enabled globally for all networks bound to the policy.
pub all_queries: std::option::Option<bool>,
pub kind: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolicyDns64ConfigScope {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [all_queries][crate::model::PolicyDns64ConfigScope::all_queries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
/// let x = PolicyDns64ConfigScope::new().set_all_queries(true);
/// ```
pub fn set_all_queries<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.all_queries = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [all_queries][crate::model::PolicyDns64ConfigScope::all_queries].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
/// let x = PolicyDns64ConfigScope::new().set_or_clear_all_queries(Some(false));
/// let x = PolicyDns64ConfigScope::new().set_or_clear_all_queries(None::<bool>);
/// ```
pub fn set_or_clear_all_queries<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.all_queries = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::PolicyDns64ConfigScope::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
/// let x = PolicyDns64ConfigScope::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::PolicyDns64ConfigScope::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyDns64ConfigScope;
/// let x = PolicyDns64ConfigScope::new().set_or_clear_kind(Some("example"));
/// let x = PolicyDns64ConfigScope::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PolicyDns64ConfigScope {
fn typename() -> &'static str {
"type.googleapis.com/.PolicyDns64ConfigScope"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyNetwork {
pub kind: std::option::Option<std::string::String>,
/// 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}>
pub network_url: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolicyNetwork {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::PolicyNetwork::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyNetwork;
/// let x = PolicyNetwork::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::PolicyNetwork::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyNetwork;
/// let x = PolicyNetwork::new().set_or_clear_kind(Some("example"));
/// let x = PolicyNetwork::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [network_url][crate::model::PolicyNetwork::network_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyNetwork;
/// let x = PolicyNetwork::new().set_network_url("example");
/// ```
pub fn set_network_url<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.network_url = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [network_url][crate::model::PolicyNetwork::network_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::PolicyNetwork;
/// let x = PolicyNetwork::new().set_or_clear_network_url(Some("example"));
/// let x = PolicyNetwork::new().set_or_clear_network_url(None::<String>);
/// ```
pub fn set_or_clear_network_url<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.network_url = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PolicyNetwork {
fn typename() -> &'static str {
"type.googleapis.com/.PolicyNetwork"
}
}
/// 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.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Project {
/// User assigned unique identifier for the resource (output only).
pub id: std::option::Option<std::string::String>,
pub kind: std::option::Option<std::string::String>,
/// Unique numeric identifier for the resource; defined by the server (output only).
pub number: std::option::Option<u64>,
/// Quotas assigned to this project (output only).
pub quota: std::option::Option<crate::model::Quota>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Project {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [id][crate::model::Project::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Project;
/// let x = Project::new().set_id("example");
/// ```
pub fn set_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [id][crate::model::Project::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Project;
/// let x = Project::new().set_or_clear_id(Some("example"));
/// let x = Project::new().set_or_clear_id(None::<String>);
/// ```
pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.id = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::Project::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Project;
/// let x = Project::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::Project::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Project;
/// let x = Project::new().set_or_clear_kind(Some("example"));
/// let x = Project::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [number][crate::model::Project::number].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Project;
/// let x = Project::new().set_number(42_u32);
/// ```
pub fn set_number<T>(mut self, v: T) -> Self
where
T: std::convert::Into<u64>,
{
self.number = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [number][crate::model::Project::number].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Project;
/// let x = Project::new().set_or_clear_number(Some(42_u32));
/// let x = Project::new().set_or_clear_number(None::<u32>);
/// ```
pub fn set_or_clear_number<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<u64>,
{
self.number = v.map(|x| x.into());
self
}
/// Sets the value of [quota][crate::model::Project::quota].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Project;
/// use google_cloud_dns_v1::model::Quota;
/// let x = Project::new().set_quota(Quota::default()/* use setters */);
/// ```
pub fn set_quota<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Quota>,
{
self.quota = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [quota][crate::model::Project::quota].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Project;
/// use google_cloud_dns_v1::model::Quota;
/// let x = Project::new().set_or_clear_quota(Some(Quota::default()/* use setters */));
/// let x = Project::new().set_or_clear_quota(None::<Quota>);
/// ```
pub fn set_or_clear_quota<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Quota>,
{
self.quota = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Project {
fn typename() -> &'static str {
"type.googleapis.com/.Project"
}
}
/// Limits associated with a Project.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Quota {
/// Maximum allowed number of DnsKeys per ManagedZone.
pub dns_keys_per_managed_zone: std::option::Option<i32>,
/// Maximum allowed number of GKE clusters to which a privately scoped zone can be attached.
pub gke_clusters_per_managed_zone: std::option::Option<i32>,
/// Maximum allowed number of GKE clusters per policy.
pub gke_clusters_per_policy: std::option::Option<i32>,
/// Maximum allowed number of GKE clusters per response policy.
pub gke_clusters_per_response_policy: std::option::Option<i32>,
pub internet_health_checks_per_managed_zone: std::option::Option<i32>,
/// Maximum allowed number of items per routing policy.
pub items_per_routing_policy: std::option::Option<i32>,
pub kind: std::option::Option<std::string::String>,
/// Maximum allowed number of managed zones in the project.
pub managed_zones: std::option::Option<i32>,
/// Maximum allowed number of managed zones which can be attached to a GKE cluster.
pub managed_zones_per_gke_cluster: std::option::Option<i32>,
/// Maximum allowed number of managed zones which can be attached to a network.
pub managed_zones_per_network: std::option::Option<i32>,
/// Maximum number of nameservers per delegation, meant to prevent abuse
pub nameservers_per_delegation: std::option::Option<i32>,
/// Maximum allowed number of networks to which a privately scoped zone can be attached.
pub networks_per_managed_zone: std::option::Option<i32>,
/// Maximum allowed number of networks per policy.
pub networks_per_policy: std::option::Option<i32>,
/// Maximum allowed number of networks per response policy.
pub networks_per_response_policy: std::option::Option<i32>,
/// Maximum allowed number of consumer peering zones per target network owned by this producer project
pub peering_zones_per_target_network: std::option::Option<i32>,
/// Maximum allowed number of policies per project.
pub policies: std::option::Option<i32>,
/// Maximum allowed number of ResourceRecords per ResourceRecordSet.
pub resource_records_per_rrset: std::option::Option<i32>,
/// Maximum allowed number of response policies per project.
pub response_policies: std::option::Option<i32>,
/// Maximum allowed number of rules per response policy.
pub response_policy_rules_per_response_policy: std::option::Option<i32>,
/// Maximum allowed number of ResourceRecordSets to add per ChangesCreateRequest.
pub rrset_additions_per_change: std::option::Option<i32>,
/// Maximum allowed number of ResourceRecordSets to delete per ChangesCreateRequest.
pub rrset_deletions_per_change: std::option::Option<i32>,
/// Maximum allowed number of ResourceRecordSets per zone in the project.
pub rrsets_per_managed_zone: std::option::Option<i32>,
/// Maximum allowed number of target name servers per managed forwarding zone.
pub target_name_servers_per_managed_zone: std::option::Option<i32>,
/// Maximum allowed number of alternative target name servers per policy.
pub target_name_servers_per_policy: std::option::Option<i32>,
/// Maximum allowed size for total rrdata in one ChangesCreateRequest in bytes.
pub total_rrdata_size_per_change: std::option::Option<i32>,
/// DNSSEC algorithm and key length types that can be used for DnsKeys.
pub whitelisted_key_specs: std::vec::Vec<crate::model::DnsKeySpec>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Quota {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [dns_keys_per_managed_zone][crate::model::Quota::dns_keys_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_dns_keys_per_managed_zone(42);
/// ```
pub fn set_dns_keys_per_managed_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.dns_keys_per_managed_zone = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [dns_keys_per_managed_zone][crate::model::Quota::dns_keys_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_dns_keys_per_managed_zone(Some(42));
/// let x = Quota::new().set_or_clear_dns_keys_per_managed_zone(None::<i32>);
/// ```
pub fn set_or_clear_dns_keys_per_managed_zone<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.dns_keys_per_managed_zone = v.map(|x| x.into());
self
}
/// Sets the value of [gke_clusters_per_managed_zone][crate::model::Quota::gke_clusters_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_gke_clusters_per_managed_zone(42);
/// ```
pub fn set_gke_clusters_per_managed_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.gke_clusters_per_managed_zone = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [gke_clusters_per_managed_zone][crate::model::Quota::gke_clusters_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_gke_clusters_per_managed_zone(Some(42));
/// let x = Quota::new().set_or_clear_gke_clusters_per_managed_zone(None::<i32>);
/// ```
pub fn set_or_clear_gke_clusters_per_managed_zone<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.gke_clusters_per_managed_zone = v.map(|x| x.into());
self
}
/// Sets the value of [gke_clusters_per_policy][crate::model::Quota::gke_clusters_per_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_gke_clusters_per_policy(42);
/// ```
pub fn set_gke_clusters_per_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.gke_clusters_per_policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [gke_clusters_per_policy][crate::model::Quota::gke_clusters_per_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_gke_clusters_per_policy(Some(42));
/// let x = Quota::new().set_or_clear_gke_clusters_per_policy(None::<i32>);
/// ```
pub fn set_or_clear_gke_clusters_per_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.gke_clusters_per_policy = v.map(|x| x.into());
self
}
/// Sets the value of [gke_clusters_per_response_policy][crate::model::Quota::gke_clusters_per_response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_gke_clusters_per_response_policy(42);
/// ```
pub fn set_gke_clusters_per_response_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.gke_clusters_per_response_policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [gke_clusters_per_response_policy][crate::model::Quota::gke_clusters_per_response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_gke_clusters_per_response_policy(Some(42));
/// let x = Quota::new().set_or_clear_gke_clusters_per_response_policy(None::<i32>);
/// ```
pub fn set_or_clear_gke_clusters_per_response_policy<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.gke_clusters_per_response_policy = v.map(|x| x.into());
self
}
/// Sets the value of [internet_health_checks_per_managed_zone][crate::model::Quota::internet_health_checks_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_internet_health_checks_per_managed_zone(42);
/// ```
pub fn set_internet_health_checks_per_managed_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.internet_health_checks_per_managed_zone = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [internet_health_checks_per_managed_zone][crate::model::Quota::internet_health_checks_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_internet_health_checks_per_managed_zone(Some(42));
/// let x = Quota::new().set_or_clear_internet_health_checks_per_managed_zone(None::<i32>);
/// ```
pub fn set_or_clear_internet_health_checks_per_managed_zone<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.internet_health_checks_per_managed_zone = v.map(|x| x.into());
self
}
/// Sets the value of [items_per_routing_policy][crate::model::Quota::items_per_routing_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_items_per_routing_policy(42);
/// ```
pub fn set_items_per_routing_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.items_per_routing_policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [items_per_routing_policy][crate::model::Quota::items_per_routing_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_items_per_routing_policy(Some(42));
/// let x = Quota::new().set_or_clear_items_per_routing_policy(None::<i32>);
/// ```
pub fn set_or_clear_items_per_routing_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.items_per_routing_policy = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::Quota::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::Quota::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_kind(Some("example"));
/// let x = Quota::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zones][crate::model::Quota::managed_zones].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_managed_zones(42);
/// ```
pub fn set_managed_zones<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.managed_zones = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [managed_zones][crate::model::Quota::managed_zones].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_managed_zones(Some(42));
/// let x = Quota::new().set_or_clear_managed_zones(None::<i32>);
/// ```
pub fn set_or_clear_managed_zones<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.managed_zones = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zones_per_gke_cluster][crate::model::Quota::managed_zones_per_gke_cluster].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_managed_zones_per_gke_cluster(42);
/// ```
pub fn set_managed_zones_per_gke_cluster<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.managed_zones_per_gke_cluster = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [managed_zones_per_gke_cluster][crate::model::Quota::managed_zones_per_gke_cluster].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_managed_zones_per_gke_cluster(Some(42));
/// let x = Quota::new().set_or_clear_managed_zones_per_gke_cluster(None::<i32>);
/// ```
pub fn set_or_clear_managed_zones_per_gke_cluster<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.managed_zones_per_gke_cluster = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zones_per_network][crate::model::Quota::managed_zones_per_network].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_managed_zones_per_network(42);
/// ```
pub fn set_managed_zones_per_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.managed_zones_per_network = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [managed_zones_per_network][crate::model::Quota::managed_zones_per_network].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_managed_zones_per_network(Some(42));
/// let x = Quota::new().set_or_clear_managed_zones_per_network(None::<i32>);
/// ```
pub fn set_or_clear_managed_zones_per_network<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.managed_zones_per_network = v.map(|x| x.into());
self
}
/// Sets the value of [nameservers_per_delegation][crate::model::Quota::nameservers_per_delegation].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_nameservers_per_delegation(42);
/// ```
pub fn set_nameservers_per_delegation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.nameservers_per_delegation = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [nameservers_per_delegation][crate::model::Quota::nameservers_per_delegation].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_nameservers_per_delegation(Some(42));
/// let x = Quota::new().set_or_clear_nameservers_per_delegation(None::<i32>);
/// ```
pub fn set_or_clear_nameservers_per_delegation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.nameservers_per_delegation = v.map(|x| x.into());
self
}
/// Sets the value of [networks_per_managed_zone][crate::model::Quota::networks_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_networks_per_managed_zone(42);
/// ```
pub fn set_networks_per_managed_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.networks_per_managed_zone = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [networks_per_managed_zone][crate::model::Quota::networks_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_networks_per_managed_zone(Some(42));
/// let x = Quota::new().set_or_clear_networks_per_managed_zone(None::<i32>);
/// ```
pub fn set_or_clear_networks_per_managed_zone<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.networks_per_managed_zone = v.map(|x| x.into());
self
}
/// Sets the value of [networks_per_policy][crate::model::Quota::networks_per_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_networks_per_policy(42);
/// ```
pub fn set_networks_per_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.networks_per_policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [networks_per_policy][crate::model::Quota::networks_per_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_networks_per_policy(Some(42));
/// let x = Quota::new().set_or_clear_networks_per_policy(None::<i32>);
/// ```
pub fn set_or_clear_networks_per_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.networks_per_policy = v.map(|x| x.into());
self
}
/// Sets the value of [networks_per_response_policy][crate::model::Quota::networks_per_response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_networks_per_response_policy(42);
/// ```
pub fn set_networks_per_response_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.networks_per_response_policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [networks_per_response_policy][crate::model::Quota::networks_per_response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_networks_per_response_policy(Some(42));
/// let x = Quota::new().set_or_clear_networks_per_response_policy(None::<i32>);
/// ```
pub fn set_or_clear_networks_per_response_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.networks_per_response_policy = v.map(|x| x.into());
self
}
/// Sets the value of [peering_zones_per_target_network][crate::model::Quota::peering_zones_per_target_network].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_peering_zones_per_target_network(42);
/// ```
pub fn set_peering_zones_per_target_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.peering_zones_per_target_network = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [peering_zones_per_target_network][crate::model::Quota::peering_zones_per_target_network].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_peering_zones_per_target_network(Some(42));
/// let x = Quota::new().set_or_clear_peering_zones_per_target_network(None::<i32>);
/// ```
pub fn set_or_clear_peering_zones_per_target_network<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.peering_zones_per_target_network = v.map(|x| x.into());
self
}
/// Sets the value of [policies][crate::model::Quota::policies].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_policies(42);
/// ```
pub fn set_policies<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.policies = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [policies][crate::model::Quota::policies].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_policies(Some(42));
/// let x = Quota::new().set_or_clear_policies(None::<i32>);
/// ```
pub fn set_or_clear_policies<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.policies = v.map(|x| x.into());
self
}
/// Sets the value of [resource_records_per_rrset][crate::model::Quota::resource_records_per_rrset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_resource_records_per_rrset(42);
/// ```
pub fn set_resource_records_per_rrset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.resource_records_per_rrset = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [resource_records_per_rrset][crate::model::Quota::resource_records_per_rrset].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_resource_records_per_rrset(Some(42));
/// let x = Quota::new().set_or_clear_resource_records_per_rrset(None::<i32>);
/// ```
pub fn set_or_clear_resource_records_per_rrset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.resource_records_per_rrset = v.map(|x| x.into());
self
}
/// Sets the value of [response_policies][crate::model::Quota::response_policies].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_response_policies(42);
/// ```
pub fn set_response_policies<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.response_policies = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [response_policies][crate::model::Quota::response_policies].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_response_policies(Some(42));
/// let x = Quota::new().set_or_clear_response_policies(None::<i32>);
/// ```
pub fn set_or_clear_response_policies<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.response_policies = v.map(|x| x.into());
self
}
/// Sets the value of [response_policy_rules_per_response_policy][crate::model::Quota::response_policy_rules_per_response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_response_policy_rules_per_response_policy(42);
/// ```
pub fn set_response_policy_rules_per_response_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.response_policy_rules_per_response_policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [response_policy_rules_per_response_policy][crate::model::Quota::response_policy_rules_per_response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_response_policy_rules_per_response_policy(Some(42));
/// let x = Quota::new().set_or_clear_response_policy_rules_per_response_policy(None::<i32>);
/// ```
pub fn set_or_clear_response_policy_rules_per_response_policy<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.response_policy_rules_per_response_policy = v.map(|x| x.into());
self
}
/// Sets the value of [rrset_additions_per_change][crate::model::Quota::rrset_additions_per_change].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_rrset_additions_per_change(42);
/// ```
pub fn set_rrset_additions_per_change<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.rrset_additions_per_change = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [rrset_additions_per_change][crate::model::Quota::rrset_additions_per_change].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_rrset_additions_per_change(Some(42));
/// let x = Quota::new().set_or_clear_rrset_additions_per_change(None::<i32>);
/// ```
pub fn set_or_clear_rrset_additions_per_change<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.rrset_additions_per_change = v.map(|x| x.into());
self
}
/// Sets the value of [rrset_deletions_per_change][crate::model::Quota::rrset_deletions_per_change].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_rrset_deletions_per_change(42);
/// ```
pub fn set_rrset_deletions_per_change<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.rrset_deletions_per_change = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [rrset_deletions_per_change][crate::model::Quota::rrset_deletions_per_change].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_rrset_deletions_per_change(Some(42));
/// let x = Quota::new().set_or_clear_rrset_deletions_per_change(None::<i32>);
/// ```
pub fn set_or_clear_rrset_deletions_per_change<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.rrset_deletions_per_change = v.map(|x| x.into());
self
}
/// Sets the value of [rrsets_per_managed_zone][crate::model::Quota::rrsets_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_rrsets_per_managed_zone(42);
/// ```
pub fn set_rrsets_per_managed_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.rrsets_per_managed_zone = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [rrsets_per_managed_zone][crate::model::Quota::rrsets_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_rrsets_per_managed_zone(Some(42));
/// let x = Quota::new().set_or_clear_rrsets_per_managed_zone(None::<i32>);
/// ```
pub fn set_or_clear_rrsets_per_managed_zone<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.rrsets_per_managed_zone = v.map(|x| x.into());
self
}
/// Sets the value of [target_name_servers_per_managed_zone][crate::model::Quota::target_name_servers_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_target_name_servers_per_managed_zone(42);
/// ```
pub fn set_target_name_servers_per_managed_zone<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.target_name_servers_per_managed_zone = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [target_name_servers_per_managed_zone][crate::model::Quota::target_name_servers_per_managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_target_name_servers_per_managed_zone(Some(42));
/// let x = Quota::new().set_or_clear_target_name_servers_per_managed_zone(None::<i32>);
/// ```
pub fn set_or_clear_target_name_servers_per_managed_zone<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.target_name_servers_per_managed_zone = v.map(|x| x.into());
self
}
/// Sets the value of [target_name_servers_per_policy][crate::model::Quota::target_name_servers_per_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_target_name_servers_per_policy(42);
/// ```
pub fn set_target_name_servers_per_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.target_name_servers_per_policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [target_name_servers_per_policy][crate::model::Quota::target_name_servers_per_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_target_name_servers_per_policy(Some(42));
/// let x = Quota::new().set_or_clear_target_name_servers_per_policy(None::<i32>);
/// ```
pub fn set_or_clear_target_name_servers_per_policy<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.target_name_servers_per_policy = v.map(|x| x.into());
self
}
/// Sets the value of [total_rrdata_size_per_change][crate::model::Quota::total_rrdata_size_per_change].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_total_rrdata_size_per_change(42);
/// ```
pub fn set_total_rrdata_size_per_change<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.total_rrdata_size_per_change = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [total_rrdata_size_per_change][crate::model::Quota::total_rrdata_size_per_change].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// let x = Quota::new().set_or_clear_total_rrdata_size_per_change(Some(42));
/// let x = Quota::new().set_or_clear_total_rrdata_size_per_change(None::<i32>);
/// ```
pub fn set_or_clear_total_rrdata_size_per_change<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.total_rrdata_size_per_change = v.map(|x| x.into());
self
}
/// Sets the value of [whitelisted_key_specs][crate::model::Quota::whitelisted_key_specs].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::Quota;
/// use google_cloud_dns_v1::model::DnsKeySpec;
/// let x = Quota::new()
/// .set_whitelisted_key_specs([
/// DnsKeySpec::default()/* use setters */,
/// DnsKeySpec::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_whitelisted_key_specs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DnsKeySpec>,
{
use std::iter::Iterator;
self.whitelisted_key_specs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Quota {
fn typename() -> &'static str {
"type.googleapis.com/.Quota"
}
}
/// 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.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RRSetRoutingPolicy {
pub geo: std::option::Option<crate::model::RRSetRoutingPolicyGeoPolicy>,
/// 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>
pub health_check: std::option::Option<std::string::String>,
pub kind: std::option::Option<std::string::String>,
pub primary_backup: std::option::Option<crate::model::RRSetRoutingPolicyPrimaryBackupPolicy>,
pub wrr: std::option::Option<crate::model::RRSetRoutingPolicyWrrPolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RRSetRoutingPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [geo][crate::model::RRSetRoutingPolicy::geo].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
/// let x = RRSetRoutingPolicy::new().set_geo(RRSetRoutingPolicyGeoPolicy::default()/* use setters */);
/// ```
pub fn set_geo<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyGeoPolicy>,
{
self.geo = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [geo][crate::model::RRSetRoutingPolicy::geo].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
/// let x = RRSetRoutingPolicy::new().set_or_clear_geo(Some(RRSetRoutingPolicyGeoPolicy::default()/* use setters */));
/// let x = RRSetRoutingPolicy::new().set_or_clear_geo(None::<RRSetRoutingPolicyGeoPolicy>);
/// ```
pub fn set_or_clear_geo<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyGeoPolicy>,
{
self.geo = v.map(|x| x.into());
self
}
/// Sets the value of [health_check][crate::model::RRSetRoutingPolicy::health_check].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// let x = RRSetRoutingPolicy::new().set_health_check("example");
/// ```
pub fn set_health_check<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.health_check = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [health_check][crate::model::RRSetRoutingPolicy::health_check].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// let x = RRSetRoutingPolicy::new().set_or_clear_health_check(Some("example"));
/// let x = RRSetRoutingPolicy::new().set_or_clear_health_check(None::<String>);
/// ```
pub fn set_or_clear_health_check<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.health_check = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::RRSetRoutingPolicy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// let x = RRSetRoutingPolicy::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// let x = RRSetRoutingPolicy::new().set_or_clear_kind(Some("example"));
/// let x = RRSetRoutingPolicy::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [primary_backup][crate::model::RRSetRoutingPolicy::primary_backup].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
/// let x = RRSetRoutingPolicy::new().set_primary_backup(RRSetRoutingPolicyPrimaryBackupPolicy::default()/* use setters */);
/// ```
pub fn set_primary_backup<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyPrimaryBackupPolicy>,
{
self.primary_backup = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [primary_backup][crate::model::RRSetRoutingPolicy::primary_backup].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
/// let x = RRSetRoutingPolicy::new().set_or_clear_primary_backup(Some(RRSetRoutingPolicyPrimaryBackupPolicy::default()/* use setters */));
/// let x = RRSetRoutingPolicy::new().set_or_clear_primary_backup(None::<RRSetRoutingPolicyPrimaryBackupPolicy>);
/// ```
pub fn set_or_clear_primary_backup<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyPrimaryBackupPolicy>,
{
self.primary_backup = v.map(|x| x.into());
self
}
/// Sets the value of [wrr][crate::model::RRSetRoutingPolicy::wrr].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicy;
/// let x = RRSetRoutingPolicy::new().set_wrr(RRSetRoutingPolicyWrrPolicy::default()/* use setters */);
/// ```
pub fn set_wrr<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyWrrPolicy>,
{
self.wrr = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [wrr][crate::model::RRSetRoutingPolicy::wrr].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicy;
/// let x = RRSetRoutingPolicy::new().set_or_clear_wrr(Some(RRSetRoutingPolicyWrrPolicy::default()/* use setters */));
/// let x = RRSetRoutingPolicy::new().set_or_clear_wrr(None::<RRSetRoutingPolicyWrrPolicy>);
/// ```
pub fn set_or_clear_wrr<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyWrrPolicy>,
{
self.wrr = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RRSetRoutingPolicy {
fn typename() -> &'static str {
"type.googleapis.com/.RRSetRoutingPolicy"
}
}
/// Configures a `RRSetRoutingPolicy` that routes based on the geo location of the querying user.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RRSetRoutingPolicyGeoPolicy {
/// 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.
pub enable_fencing: std::option::Option<bool>,
/// The primary geo routing configuration. If there are multiple items with the same location, an error is returned instead.
pub items: std::vec::Vec<crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem>,
pub kind: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RRSetRoutingPolicyGeoPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [enable_fencing][crate::model::RRSetRoutingPolicyGeoPolicy::enable_fencing].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
/// let x = RRSetRoutingPolicyGeoPolicy::new().set_enable_fencing(true);
/// ```
pub fn set_enable_fencing<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_fencing = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [enable_fencing][crate::model::RRSetRoutingPolicyGeoPolicy::enable_fencing].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
/// let x = RRSetRoutingPolicyGeoPolicy::new().set_or_clear_enable_fencing(Some(false));
/// let x = RRSetRoutingPolicyGeoPolicy::new().set_or_clear_enable_fencing(None::<bool>);
/// ```
pub fn set_or_clear_enable_fencing<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.enable_fencing = v.map(|x| x.into());
self
}
/// Sets the value of [items][crate::model::RRSetRoutingPolicyGeoPolicy::items].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
/// let x = RRSetRoutingPolicyGeoPolicy::new()
/// .set_items([
/// RRSetRoutingPolicyGeoPolicyGeoPolicyItem::default()/* use setters */,
/// RRSetRoutingPolicyGeoPolicyGeoPolicyItem::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [kind][crate::model::RRSetRoutingPolicyGeoPolicy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
/// let x = RRSetRoutingPolicyGeoPolicy::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyGeoPolicy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
/// let x = RRSetRoutingPolicyGeoPolicy::new().set_or_clear_kind(Some("example"));
/// let x = RRSetRoutingPolicyGeoPolicy::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RRSetRoutingPolicyGeoPolicy {
fn typename() -> &'static str {
"type.googleapis.com/.RRSetRoutingPolicyGeoPolicy"
}
}
/// ResourceRecordSet data for one geo location.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RRSetRoutingPolicyGeoPolicyGeoPolicyItem {
/// 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.
pub health_checked_targets:
std::option::Option<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
pub kind: std::option::Option<std::string::String>,
/// 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.
pub location: std::option::Option<std::string::String>,
pub rrdatas: std::vec::Vec<std::string::String>,
/// 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.
pub signature_rrdatas: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RRSetRoutingPolicyGeoPolicyGeoPolicyItem {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [health_checked_targets][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::health_checked_targets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
/// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_health_checked_targets(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */);
/// ```
pub fn set_health_checked_targets<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
{
self.health_checked_targets = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [health_checked_targets][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::health_checked_targets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
/// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_health_checked_targets(Some(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */));
/// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_health_checked_targets(None::<RRSetRoutingPolicyHealthCheckTargets>);
/// ```
pub fn set_or_clear_health_checked_targets<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
{
self.health_checked_targets = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
/// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
/// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_kind(Some("example"));
/// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [location][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::location].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
/// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_location("example");
/// ```
pub fn set_location<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.location = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [location][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::location].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
/// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_location(Some("example"));
/// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_or_clear_location(None::<String>);
/// ```
pub fn set_or_clear_location<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.location = v.map(|x| x.into());
self
}
/// Sets the value of [rrdatas][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::rrdatas].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
/// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_rrdatas(["a", "b", "c"]);
/// ```
pub fn set_rrdatas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.rrdatas = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [signature_rrdatas][crate::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem::signature_rrdatas].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicyGeoPolicyItem;
/// let x = RRSetRoutingPolicyGeoPolicyGeoPolicyItem::new().set_signature_rrdatas(["a", "b", "c"]);
/// ```
pub fn set_signature_rrdatas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.signature_rrdatas = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RRSetRoutingPolicyGeoPolicyGeoPolicyItem {
fn typename() -> &'static str {
"type.googleapis.com/.RRSetRoutingPolicyGeoPolicyGeoPolicyItem"
}
}
/// 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.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RRSetRoutingPolicyHealthCheckTargets {
/// 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)
pub external_endpoints: std::vec::Vec<std::string::String>,
/// Configuration for internal load balancers to be health checked.
pub internal_load_balancers: std::vec::Vec<crate::model::RRSetRoutingPolicyLoadBalancerTarget>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RRSetRoutingPolicyHealthCheckTargets {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [external_endpoints][crate::model::RRSetRoutingPolicyHealthCheckTargets::external_endpoints].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
/// let x = RRSetRoutingPolicyHealthCheckTargets::new().set_external_endpoints(["a", "b", "c"]);
/// ```
pub fn set_external_endpoints<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.external_endpoints = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [internal_load_balancers][crate::model::RRSetRoutingPolicyHealthCheckTargets::internal_load_balancers].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyHealthCheckTargets::new()
/// .set_internal_load_balancers([
/// RRSetRoutingPolicyLoadBalancerTarget::default()/* use setters */,
/// RRSetRoutingPolicyLoadBalancerTarget::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_internal_load_balancers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RRSetRoutingPolicyLoadBalancerTarget>,
{
use std::iter::Iterator;
self.internal_load_balancers = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RRSetRoutingPolicyHealthCheckTargets {
fn typename() -> &'static str {
"type.googleapis.com/.RRSetRoutingPolicyHealthCheckTargets"
}
}
/// The configuration for an individual load balancer to health check.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RRSetRoutingPolicyLoadBalancerTarget {
/// The frontend IP address of the load balancer to health check.
pub ip_address: std::option::Option<std::string::String>,
/// The protocol of the load balancer to health check.
pub ip_protocol:
std::option::Option<crate::model::rr_set_routing_policy_load_balancer_target::IpProtocol>,
pub kind: std::option::Option<std::string::String>,
/// 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.
pub load_balancer_type: std::option::Option<
crate::model::rr_set_routing_policy_load_balancer_target::LoadBalancerType,
>,
/// 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}>`.
pub network_url: std::option::Option<std::string::String>,
/// The configured port of the load balancer.
pub port: std::option::Option<std::string::String>,
/// The project ID in which the load balancer is located.
pub project: std::option::Option<std::string::String>,
/// The region in which the load balancer is located.
pub region: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RRSetRoutingPolicyLoadBalancerTarget {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [ip_address][crate::model::RRSetRoutingPolicyLoadBalancerTarget::ip_address].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_ip_address("example");
/// ```
pub fn set_ip_address<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ip_address = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [ip_address][crate::model::RRSetRoutingPolicyLoadBalancerTarget::ip_address].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_ip_address(Some("example"));
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_ip_address(None::<String>);
/// ```
pub fn set_or_clear_ip_address<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.ip_address = v.map(|x| x.into());
self
}
/// Sets the value of [ip_protocol][crate::model::RRSetRoutingPolicyLoadBalancerTarget::ip_protocol].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// use google_cloud_dns_v1::model::rr_set_routing_policy_load_balancer_target::IpProtocol;
/// let x0 = RRSetRoutingPolicyLoadBalancerTarget::new().set_ip_protocol(IpProtocol::Tcp);
/// let x1 = RRSetRoutingPolicyLoadBalancerTarget::new().set_ip_protocol(IpProtocol::Udp);
/// ```
pub fn set_ip_protocol<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::rr_set_routing_policy_load_balancer_target::IpProtocol>,
{
self.ip_protocol = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [ip_protocol][crate::model::RRSetRoutingPolicyLoadBalancerTarget::ip_protocol].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// use google_cloud_dns_v1::model::rr_set_routing_policy_load_balancer_target::IpProtocol;
/// let x0 = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_ip_protocol(Some(IpProtocol::Tcp));
/// let x1 = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_ip_protocol(Some(IpProtocol::Udp));
/// let x_none = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_ip_protocol(None::<IpProtocol>);
/// ```
pub fn set_or_clear_ip_protocol<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::rr_set_routing_policy_load_balancer_target::IpProtocol>,
{
self.ip_protocol = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::RRSetRoutingPolicyLoadBalancerTarget::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyLoadBalancerTarget::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_kind(Some("example"));
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [load_balancer_type][crate::model::RRSetRoutingPolicyLoadBalancerTarget::load_balancer_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// use google_cloud_dns_v1::model::rr_set_routing_policy_load_balancer_target::LoadBalancerType;
/// let x0 = RRSetRoutingPolicyLoadBalancerTarget::new().set_load_balancer_type(LoadBalancerType::GlobalL7Ilb);
/// let x1 = RRSetRoutingPolicyLoadBalancerTarget::new().set_load_balancer_type(LoadBalancerType::RegionalL4Ilb);
/// let x2 = RRSetRoutingPolicyLoadBalancerTarget::new().set_load_balancer_type(LoadBalancerType::RegionalL7Ilb);
/// ```
pub fn set_load_balancer_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::rr_set_routing_policy_load_balancer_target::LoadBalancerType,
>,
{
self.load_balancer_type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [load_balancer_type][crate::model::RRSetRoutingPolicyLoadBalancerTarget::load_balancer_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// use google_cloud_dns_v1::model::rr_set_routing_policy_load_balancer_target::LoadBalancerType;
/// let x0 = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::GlobalL7Ilb));
/// let x1 = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::RegionalL4Ilb));
/// let x2 = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::RegionalL7Ilb));
/// let x_none = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_load_balancer_type(None::<LoadBalancerType>);
/// ```
pub fn set_or_clear_load_balancer_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::rr_set_routing_policy_load_balancer_target::LoadBalancerType,
>,
{
self.load_balancer_type = v.map(|x| x.into());
self
}
/// Sets the value of [network_url][crate::model::RRSetRoutingPolicyLoadBalancerTarget::network_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_network_url("example");
/// ```
pub fn set_network_url<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.network_url = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [network_url][crate::model::RRSetRoutingPolicyLoadBalancerTarget::network_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_network_url(Some("example"));
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_network_url(None::<String>);
/// ```
pub fn set_or_clear_network_url<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.network_url = v.map(|x| x.into());
self
}
/// Sets the value of [port][crate::model::RRSetRoutingPolicyLoadBalancerTarget::port].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_port("example");
/// ```
pub fn set_port<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.port = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [port][crate::model::RRSetRoutingPolicyLoadBalancerTarget::port].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_port(Some("example"));
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_port(None::<String>);
/// ```
pub fn set_or_clear_port<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.port = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::RRSetRoutingPolicyLoadBalancerTarget::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_project("example");
/// ```
pub fn set_project<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.project = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [project][crate::model::RRSetRoutingPolicyLoadBalancerTarget::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_project(Some("example"));
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_project(None::<String>);
/// ```
pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.project = v.map(|x| x.into());
self
}
/// Sets the value of [region][crate::model::RRSetRoutingPolicyLoadBalancerTarget::region].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_region("example");
/// ```
pub fn set_region<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.region = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [region][crate::model::RRSetRoutingPolicyLoadBalancerTarget::region].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyLoadBalancerTarget;
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_region(Some("example"));
/// let x = RRSetRoutingPolicyLoadBalancerTarget::new().set_or_clear_region(None::<String>);
/// ```
pub fn set_or_clear_region<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.region = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RRSetRoutingPolicyLoadBalancerTarget {
fn typename() -> &'static str {
"type.googleapis.com/.RRSetRoutingPolicyLoadBalancerTarget"
}
}
/// Defines additional types related to [RRSetRoutingPolicyLoadBalancerTarget].
pub mod rr_set_routing_policy_load_balancer_target {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [ipProtocol][.RRSetRoutingPolicyLoadBalancerTarget.ipProtocol] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum IpProtocol {
Undefined,
/// Indicates the load balancer is accessible via TCP.
Tcp,
/// Indicates the load balancer is accessible via UDP.
Udp,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [IpProtocol::value] or
/// [IpProtocol::name].
UnknownValue(ip_protocol::UnknownValue),
}
#[doc(hidden)]
pub mod ip_protocol {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl IpProtocol {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Undefined => std::option::Option::Some(0),
Self::Tcp => std::option::Option::Some(1),
Self::Udp => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Undefined => std::option::Option::Some("undefined"),
Self::Tcp => std::option::Option::Some("tcp"),
Self::Udp => std::option::Option::Some("udp"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for IpProtocol {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for IpProtocol {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for IpProtocol {
fn from(value: i32) -> Self {
match value {
0 => Self::Undefined,
1 => Self::Tcp,
2 => Self::Udp,
_ => Self::UnknownValue(ip_protocol::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for IpProtocol {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"undefined" => Self::Undefined,
"tcp" => Self::Tcp,
"udp" => Self::Udp,
_ => Self::UnknownValue(ip_protocol::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for IpProtocol {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Undefined => serializer.serialize_str("undefined"),
Self::Tcp => serializer.serialize_str("tcp"),
Self::Udp => serializer.serialize_str("udp"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for IpProtocol {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<IpProtocol>::new(
"..RRSetRoutingPolicyLoadBalancerTarget.ipProtocol",
))
}
}
/// The enumerated type for the [loadBalancerType][.RRSetRoutingPolicyLoadBalancerTarget.loadBalancerType] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LoadBalancerType {
None,
/// Indicates the load balancer is a Cross-Region Application Load Balancer.
GlobalL7Ilb,
/// Indicates the load balancer is a Regional Network Passthrough Load Balancer.
RegionalL4Ilb,
/// Indicates the load balancer is a Regional Application Load Balancer.
RegionalL7Ilb,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [LoadBalancerType::value] or
/// [LoadBalancerType::name].
UnknownValue(load_balancer_type::UnknownValue),
}
#[doc(hidden)]
pub mod load_balancer_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl LoadBalancerType {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::None => std::option::Option::Some(0),
Self::GlobalL7Ilb => std::option::Option::Some(1),
Self::RegionalL4Ilb => std::option::Option::Some(2),
Self::RegionalL7Ilb => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::None => std::option::Option::Some("none"),
Self::GlobalL7Ilb => std::option::Option::Some("globalL7ilb"),
Self::RegionalL4Ilb => std::option::Option::Some("regionalL4ilb"),
Self::RegionalL7Ilb => std::option::Option::Some("regionalL7ilb"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for LoadBalancerType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for LoadBalancerType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for LoadBalancerType {
fn from(value: i32) -> Self {
match value {
0 => Self::None,
1 => Self::GlobalL7Ilb,
2 => Self::RegionalL4Ilb,
3 => Self::RegionalL7Ilb,
_ => Self::UnknownValue(load_balancer_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for LoadBalancerType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"none" => Self::None,
"globalL7ilb" => Self::GlobalL7Ilb,
"regionalL4ilb" => Self::RegionalL4Ilb,
"regionalL7ilb" => Self::RegionalL7Ilb,
_ => Self::UnknownValue(load_balancer_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for LoadBalancerType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::None => serializer.serialize_str("none"),
Self::GlobalL7Ilb => serializer.serialize_str("globalL7ilb"),
Self::RegionalL4Ilb => serializer.serialize_str("regionalL4ilb"),
Self::RegionalL7Ilb => serializer.serialize_str("regionalL7ilb"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
"..RRSetRoutingPolicyLoadBalancerTarget.loadBalancerType",
))
}
}
}
/// 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.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RRSetRoutingPolicyPrimaryBackupPolicy {
/// 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.
pub backup_geo_targets: std::option::Option<crate::model::RRSetRoutingPolicyGeoPolicy>,
pub kind: std::option::Option<std::string::String>,
/// 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`.
pub primary_targets: std::option::Option<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
/// When serving state is `PRIMARY`, this field provides the option of sending a small percentage of the traffic to the backup targets.
pub trickle_traffic: std::option::Option<f64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RRSetRoutingPolicyPrimaryBackupPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [backup_geo_targets][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::backup_geo_targets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_backup_geo_targets(RRSetRoutingPolicyGeoPolicy::default()/* use setters */);
/// ```
pub fn set_backup_geo_targets<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyGeoPolicy>,
{
self.backup_geo_targets = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [backup_geo_targets][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::backup_geo_targets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyGeoPolicy;
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_backup_geo_targets(Some(RRSetRoutingPolicyGeoPolicy::default()/* use setters */));
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_backup_geo_targets(None::<RRSetRoutingPolicyGeoPolicy>);
/// ```
pub fn set_or_clear_backup_geo_targets<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyGeoPolicy>,
{
self.backup_geo_targets = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_kind(Some("example"));
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [primary_targets][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::primary_targets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_primary_targets(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */);
/// ```
pub fn set_primary_targets<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
{
self.primary_targets = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [primary_targets][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::primary_targets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_primary_targets(Some(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */));
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_primary_targets(None::<RRSetRoutingPolicyHealthCheckTargets>);
/// ```
pub fn set_or_clear_primary_targets<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
{
self.primary_targets = v.map(|x| x.into());
self
}
/// Sets the value of [trickle_traffic][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::trickle_traffic].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_trickle_traffic(42.0);
/// ```
pub fn set_trickle_traffic<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.trickle_traffic = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [trickle_traffic][crate::model::RRSetRoutingPolicyPrimaryBackupPolicy::trickle_traffic].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyPrimaryBackupPolicy;
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_trickle_traffic(Some(42.0));
/// let x = RRSetRoutingPolicyPrimaryBackupPolicy::new().set_or_clear_trickle_traffic(None::<f32>);
/// ```
pub fn set_or_clear_trickle_traffic<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.trickle_traffic = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RRSetRoutingPolicyPrimaryBackupPolicy {
fn typename() -> &'static str {
"type.googleapis.com/.RRSetRoutingPolicyPrimaryBackupPolicy"
}
}
/// Configures a RRSetRoutingPolicy that routes in a weighted round robin fashion.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RRSetRoutingPolicyWrrPolicy {
pub items: std::vec::Vec<crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem>,
pub kind: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RRSetRoutingPolicyWrrPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [items][crate::model::RRSetRoutingPolicyWrrPolicy::items].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicy;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
/// let x = RRSetRoutingPolicyWrrPolicy::new()
/// .set_items([
/// RRSetRoutingPolicyWrrPolicyWrrPolicyItem::default()/* use setters */,
/// RRSetRoutingPolicyWrrPolicyWrrPolicyItem::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [kind][crate::model::RRSetRoutingPolicyWrrPolicy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicy;
/// let x = RRSetRoutingPolicyWrrPolicy::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyWrrPolicy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicy;
/// let x = RRSetRoutingPolicyWrrPolicy::new().set_or_clear_kind(Some("example"));
/// let x = RRSetRoutingPolicyWrrPolicy::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RRSetRoutingPolicyWrrPolicy {
fn typename() -> &'static str {
"type.googleapis.com/.RRSetRoutingPolicyWrrPolicy"
}
}
/// A routing block which contains the routing information for one WRR item.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RRSetRoutingPolicyWrrPolicyWrrPolicyItem {
/// 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.
pub health_checked_targets:
std::option::Option<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
pub kind: std::option::Option<std::string::String>,
pub rrdatas: std::vec::Vec<std::string::String>,
/// 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.
pub signature_rrdatas: std::vec::Vec<std::string::String>,
/// 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.
pub weight: std::option::Option<f64>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RRSetRoutingPolicyWrrPolicyWrrPolicyItem {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [health_checked_targets][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::health_checked_targets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
/// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_health_checked_targets(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */);
/// ```
pub fn set_health_checked_targets<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
{
self.health_checked_targets = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [health_checked_targets][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::health_checked_targets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicyHealthCheckTargets;
/// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_health_checked_targets(Some(RRSetRoutingPolicyHealthCheckTargets::default()/* use setters */));
/// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_health_checked_targets(None::<RRSetRoutingPolicyHealthCheckTargets>);
/// ```
pub fn set_or_clear_health_checked_targets<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicyHealthCheckTargets>,
{
self.health_checked_targets = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
/// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
/// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_kind(Some("example"));
/// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [rrdatas][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::rrdatas].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
/// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_rrdatas(["a", "b", "c"]);
/// ```
pub fn set_rrdatas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.rrdatas = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [signature_rrdatas][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::signature_rrdatas].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
/// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_signature_rrdatas(["a", "b", "c"]);
/// ```
pub fn set_signature_rrdatas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.signature_rrdatas = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [weight][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::weight].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
/// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_weight(42.0);
/// ```
pub fn set_weight<T>(mut self, v: T) -> Self
where
T: std::convert::Into<f64>,
{
self.weight = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [weight][crate::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem::weight].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::RRSetRoutingPolicyWrrPolicyWrrPolicyItem;
/// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_weight(Some(42.0));
/// let x = RRSetRoutingPolicyWrrPolicyWrrPolicyItem::new().set_or_clear_weight(None::<f32>);
/// ```
pub fn set_or_clear_weight<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<f64>,
{
self.weight = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RRSetRoutingPolicyWrrPolicyWrrPolicyItem {
fn typename() -> &'static str {
"type.googleapis.com/.RRSetRoutingPolicyWrrPolicyWrrPolicyItem"
}
}
/// A unit of data that is returned by the DNS servers.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceRecordSet {
pub kind: std::option::Option<std::string::String>,
/// For example, www.example.com.
pub name: std::option::Option<std::string::String>,
/// 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).
pub routing_policy: std::option::Option<crate::model::RRSetRoutingPolicy>,
/// As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- see examples.
pub rrdatas: std::vec::Vec<std::string::String>,
/// As defined in RFC 4034 (section 3.2).
pub signature_rrdatas: std::vec::Vec<std::string::String>,
/// Number of seconds that this `ResourceRecordSet` can be cached by resolvers.
pub ttl: std::option::Option<i32>,
/// The identifier of a supported record type. See the list of Supported DNS record types.
pub r#type: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceRecordSet {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::ResourceRecordSet::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResourceRecordSet::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ResourceRecordSet::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResourceRecordSet::new().set_or_clear_kind(Some("example"));
/// let x = ResourceRecordSet::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [name][crate::model::ResourceRecordSet::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResourceRecordSet::new().set_name("example");
/// ```
pub fn set_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [name][crate::model::ResourceRecordSet::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResourceRecordSet::new().set_or_clear_name(Some("example"));
/// let x = ResourceRecordSet::new().set_or_clear_name(None::<String>);
/// ```
pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = v.map(|x| x.into());
self
}
/// Sets the value of [routing_policy][crate::model::ResourceRecordSet::routing_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// let x = ResourceRecordSet::new().set_routing_policy(RRSetRoutingPolicy::default()/* use setters */);
/// ```
pub fn set_routing_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicy>,
{
self.routing_policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [routing_policy][crate::model::ResourceRecordSet::routing_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// use google_cloud_dns_v1::model::RRSetRoutingPolicy;
/// let x = ResourceRecordSet::new().set_or_clear_routing_policy(Some(RRSetRoutingPolicy::default()/* use setters */));
/// let x = ResourceRecordSet::new().set_or_clear_routing_policy(None::<RRSetRoutingPolicy>);
/// ```
pub fn set_or_clear_routing_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RRSetRoutingPolicy>,
{
self.routing_policy = v.map(|x| x.into());
self
}
/// Sets the value of [rrdatas][crate::model::ResourceRecordSet::rrdatas].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResourceRecordSet::new().set_rrdatas(["a", "b", "c"]);
/// ```
pub fn set_rrdatas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.rrdatas = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [signature_rrdatas][crate::model::ResourceRecordSet::signature_rrdatas].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResourceRecordSet::new().set_signature_rrdatas(["a", "b", "c"]);
/// ```
pub fn set_signature_rrdatas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.signature_rrdatas = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [ttl][crate::model::ResourceRecordSet::ttl].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResourceRecordSet::new().set_ttl(42);
/// ```
pub fn set_ttl<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.ttl = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [ttl][crate::model::ResourceRecordSet::ttl].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResourceRecordSet::new().set_or_clear_ttl(Some(42));
/// let x = ResourceRecordSet::new().set_or_clear_ttl(None::<i32>);
/// ```
pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.ttl = v.map(|x| x.into());
self
}
/// Sets the value of [r#type][crate::model::ResourceRecordSet::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResourceRecordSet::new().set_type("example");
/// ```
pub fn set_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.r#type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [r#type][crate::model::ResourceRecordSet::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResourceRecordSet::new().set_or_clear_type(Some("example"));
/// let x = ResourceRecordSet::new().set_or_clear_type(None::<String>);
/// ```
pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.r#type = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ResourceRecordSet {
fn typename() -> &'static str {
"type.googleapis.com/.ResourceRecordSet"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceRecordSetsDeleteResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceRecordSetsDeleteResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ResourceRecordSetsDeleteResponse {
fn typename() -> &'static str {
"type.googleapis.com/.ResourceRecordSetsDeleteResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceRecordSetsListResponse {
/// Type of resource.
pub kind: std::option::Option<std::string::String>,
/// 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.
pub next_page_token: std::option::Option<std::string::String>,
/// The resource record set resources.
pub rrsets: std::vec::Vec<crate::model::ResourceRecordSet>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceRecordSetsListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::ResourceRecordSetsListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSetsListResponse;
/// let x = ResourceRecordSetsListResponse::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ResourceRecordSetsListResponse::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSetsListResponse;
/// let x = ResourceRecordSetsListResponse::new().set_or_clear_kind(Some("example"));
/// let x = ResourceRecordSetsListResponse::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [next_page_token][crate::model::ResourceRecordSetsListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSetsListResponse;
/// let x = ResourceRecordSetsListResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [next_page_token][crate::model::ResourceRecordSetsListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSetsListResponse;
/// let x = ResourceRecordSetsListResponse::new().set_or_clear_next_page_token(Some("example"));
/// let x = ResourceRecordSetsListResponse::new().set_or_clear_next_page_token(None::<String>);
/// ```
pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = v.map(|x| x.into());
self
}
/// Sets the value of [rrsets][crate::model::ResourceRecordSetsListResponse::rrsets].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResourceRecordSetsListResponse;
/// use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResourceRecordSetsListResponse::new()
/// .set_rrsets([
/// ResourceRecordSet::default()/* use setters */,
/// ResourceRecordSet::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_rrsets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResourceRecordSet>,
{
use std::iter::Iterator;
self.rrsets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ResourceRecordSetsListResponse {
fn typename() -> &'static str {
"type.googleapis.com/.ResourceRecordSetsListResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ResourceRecordSetsListResponse {
type PageItem = crate::model::ResourceRecordSet;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.rrsets
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone().unwrap_or_default()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResponsePoliciesListResponse {
/// 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.
pub next_page_token: std::option::Option<std::string::String>,
/// The Response Policy resources.
pub response_policies: std::vec::Vec<crate::model::ResponsePolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResponsePoliciesListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [next_page_token][crate::model::ResponsePoliciesListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePoliciesListResponse;
/// let x = ResponsePoliciesListResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [next_page_token][crate::model::ResponsePoliciesListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePoliciesListResponse;
/// let x = ResponsePoliciesListResponse::new().set_or_clear_next_page_token(Some("example"));
/// let x = ResponsePoliciesListResponse::new().set_or_clear_next_page_token(None::<String>);
/// ```
pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = v.map(|x| x.into());
self
}
/// Sets the value of [response_policies][crate::model::ResponsePoliciesListResponse::response_policies].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePoliciesListResponse;
/// use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePoliciesListResponse::new()
/// .set_response_policies([
/// ResponsePolicy::default()/* use setters */,
/// ResponsePolicy::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_response_policies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResponsePolicy>,
{
use std::iter::Iterator;
self.response_policies = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ResponsePoliciesListResponse {
fn typename() -> &'static str {
"type.googleapis.com/.ResponsePoliciesListResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ResponsePoliciesListResponse {
type PageItem = crate::model::ResponsePolicy;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.response_policies
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone().unwrap_or_default()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResponsePoliciesPatchResponse {
pub response_policy: std::option::Option<crate::model::ResponsePolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResponsePoliciesPatchResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [response_policy][crate::model::ResponsePoliciesPatchResponse::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePoliciesPatchResponse;
/// use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePoliciesPatchResponse::new().set_response_policy(ResponsePolicy::default()/* use setters */);
/// ```
pub fn set_response_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicy>,
{
self.response_policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [response_policy][crate::model::ResponsePoliciesPatchResponse::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePoliciesPatchResponse;
/// use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePoliciesPatchResponse::new().set_or_clear_response_policy(Some(ResponsePolicy::default()/* use setters */));
/// let x = ResponsePoliciesPatchResponse::new().set_or_clear_response_policy(None::<ResponsePolicy>);
/// ```
pub fn set_or_clear_response_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicy>,
{
self.response_policy = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ResponsePoliciesPatchResponse {
fn typename() -> &'static str {
"type.googleapis.com/.ResponsePoliciesPatchResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResponsePoliciesUpdateResponse {
pub response_policy: std::option::Option<crate::model::ResponsePolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResponsePoliciesUpdateResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [response_policy][crate::model::ResponsePoliciesUpdateResponse::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePoliciesUpdateResponse;
/// use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePoliciesUpdateResponse::new().set_response_policy(ResponsePolicy::default()/* use setters */);
/// ```
pub fn set_response_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicy>,
{
self.response_policy = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [response_policy][crate::model::ResponsePoliciesUpdateResponse::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePoliciesUpdateResponse;
/// use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePoliciesUpdateResponse::new().set_or_clear_response_policy(Some(ResponsePolicy::default()/* use setters */));
/// let x = ResponsePoliciesUpdateResponse::new().set_or_clear_response_policy(None::<ResponsePolicy>);
/// ```
pub fn set_or_clear_response_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicy>,
{
self.response_policy = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ResponsePoliciesUpdateResponse {
fn typename() -> &'static str {
"type.googleapis.com/.ResponsePoliciesUpdateResponse"
}
}
/// A Response Policy is a collection of selectors that apply to queries made against one or more Virtual Private Cloud networks.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResponsePolicy {
/// User-provided description for this Response Policy.
pub description: std::option::Option<std::string::String>,
/// The list of Google Kubernetes Engine clusters to which this response policy is applied.
pub gke_clusters: std::vec::Vec<crate::model::ResponsePolicyGKECluster>,
/// Unique identifier for the resource; defined by the server (output only).
pub id: std::option::Option<i64>,
pub kind: std::option::Option<std::string::String>,
/// User labels.
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
/// List of network names specifying networks to which this policy is applied.
pub networks: std::vec::Vec<crate::model::ResponsePolicyNetwork>,
/// User assigned name for this Response Policy.
pub response_policy_name: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResponsePolicy {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [description][crate::model::ResponsePolicy::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePolicy::new().set_description("example");
/// ```
pub fn set_description<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [description][crate::model::ResponsePolicy::description].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePolicy::new().set_or_clear_description(Some("example"));
/// let x = ResponsePolicy::new().set_or_clear_description(None::<String>);
/// ```
pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.description = v.map(|x| x.into());
self
}
/// Sets the value of [gke_clusters][crate::model::ResponsePolicy::gke_clusters].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicy;
/// use google_cloud_dns_v1::model::ResponsePolicyGKECluster;
/// let x = ResponsePolicy::new()
/// .set_gke_clusters([
/// ResponsePolicyGKECluster::default()/* use setters */,
/// ResponsePolicyGKECluster::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResponsePolicyGKECluster>,
{
use std::iter::Iterator;
self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [id][crate::model::ResponsePolicy::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePolicy::new().set_id(42);
/// ```
pub fn set_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [id][crate::model::ResponsePolicy::id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePolicy::new().set_or_clear_id(Some(42));
/// let x = ResponsePolicy::new().set_or_clear_id(None::<i32>);
/// ```
pub fn set_or_clear_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.id = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::ResponsePolicy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePolicy::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ResponsePolicy::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePolicy::new().set_or_clear_kind(Some("example"));
/// let x = ResponsePolicy::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [labels][crate::model::ResponsePolicy::labels].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePolicy::new().set_labels([
/// ("key0", "abc"),
/// ("key1", "xyz"),
/// ]);
/// ```
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
/// Sets the value of [networks][crate::model::ResponsePolicy::networks].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicy;
/// use google_cloud_dns_v1::model::ResponsePolicyNetwork;
/// let x = ResponsePolicy::new()
/// .set_networks([
/// ResponsePolicyNetwork::default()/* use setters */,
/// ResponsePolicyNetwork::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_networks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResponsePolicyNetwork>,
{
use std::iter::Iterator;
self.networks = v.into_iter().map(|i| i.into()).collect();
self
}
/// Sets the value of [response_policy_name][crate::model::ResponsePolicy::response_policy_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePolicy::new().set_response_policy_name("example");
/// ```
pub fn set_response_policy_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.response_policy_name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [response_policy_name][crate::model::ResponsePolicy::response_policy_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = ResponsePolicy::new().set_or_clear_response_policy_name(Some("example"));
/// let x = ResponsePolicy::new().set_or_clear_response_policy_name(None::<String>);
/// ```
pub fn set_or_clear_response_policy_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.response_policy_name = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ResponsePolicy {
fn typename() -> &'static str {
"type.googleapis.com/.ResponsePolicy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResponsePolicyGKECluster {
/// 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>
pub gke_cluster_name: std::option::Option<std::string::String>,
pub kind: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResponsePolicyGKECluster {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [gke_cluster_name][crate::model::ResponsePolicyGKECluster::gke_cluster_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyGKECluster;
/// let x = ResponsePolicyGKECluster::new().set_gke_cluster_name("example");
/// ```
pub fn set_gke_cluster_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.gke_cluster_name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [gke_cluster_name][crate::model::ResponsePolicyGKECluster::gke_cluster_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyGKECluster;
/// let x = ResponsePolicyGKECluster::new().set_or_clear_gke_cluster_name(Some("example"));
/// let x = ResponsePolicyGKECluster::new().set_or_clear_gke_cluster_name(None::<String>);
/// ```
pub fn set_or_clear_gke_cluster_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.gke_cluster_name = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::ResponsePolicyGKECluster::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyGKECluster;
/// let x = ResponsePolicyGKECluster::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ResponsePolicyGKECluster::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyGKECluster;
/// let x = ResponsePolicyGKECluster::new().set_or_clear_kind(Some("example"));
/// let x = ResponsePolicyGKECluster::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ResponsePolicyGKECluster {
fn typename() -> &'static str {
"type.googleapis.com/.ResponsePolicyGKECluster"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResponsePolicyNetwork {
pub kind: std::option::Option<std::string::String>,
/// 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}>`
pub network_url: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResponsePolicyNetwork {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [kind][crate::model::ResponsePolicyNetwork::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyNetwork;
/// let x = ResponsePolicyNetwork::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ResponsePolicyNetwork::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyNetwork;
/// let x = ResponsePolicyNetwork::new().set_or_clear_kind(Some("example"));
/// let x = ResponsePolicyNetwork::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [network_url][crate::model::ResponsePolicyNetwork::network_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyNetwork;
/// let x = ResponsePolicyNetwork::new().set_network_url("example");
/// ```
pub fn set_network_url<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.network_url = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [network_url][crate::model::ResponsePolicyNetwork::network_url].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyNetwork;
/// let x = ResponsePolicyNetwork::new().set_or_clear_network_url(Some("example"));
/// let x = ResponsePolicyNetwork::new().set_or_clear_network_url(None::<String>);
/// ```
pub fn set_or_clear_network_url<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.network_url = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ResponsePolicyNetwork {
fn typename() -> &'static str {
"type.googleapis.com/.ResponsePolicyNetwork"
}
}
/// 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.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResponsePolicyRule {
/// Answer this query with a behavior rather than DNS data.
pub behavior: std::option::Option<crate::model::response_policy_rule::Behavior>,
/// The DNS name (wildcard or exact) to apply this rule to. Must be unique within the Response Policy Rule.
pub dns_name: std::option::Option<std::string::String>,
pub kind: std::option::Option<std::string::String>,
/// 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.
pub local_data: std::option::Option<crate::model::ResponsePolicyRuleLocalData>,
/// An identifier for this rule. Must be unique with the ResponsePolicy.
pub rule_name: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResponsePolicyRule {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [behavior][crate::model::ResponsePolicyRule::behavior].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRule;
/// use google_cloud_dns_v1::model::response_policy_rule::Behavior;
/// let x0 = ResponsePolicyRule::new().set_behavior(Behavior::BypassResponsePolicy);
/// ```
pub fn set_behavior<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::response_policy_rule::Behavior>,
{
self.behavior = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [behavior][crate::model::ResponsePolicyRule::behavior].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRule;
/// use google_cloud_dns_v1::model::response_policy_rule::Behavior;
/// let x0 = ResponsePolicyRule::new().set_or_clear_behavior(Some(Behavior::BypassResponsePolicy));
/// let x_none = ResponsePolicyRule::new().set_or_clear_behavior(None::<Behavior>);
/// ```
pub fn set_or_clear_behavior<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::response_policy_rule::Behavior>,
{
self.behavior = v.map(|x| x.into());
self
}
/// Sets the value of [dns_name][crate::model::ResponsePolicyRule::dns_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = ResponsePolicyRule::new().set_dns_name("example");
/// ```
pub fn set_dns_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [dns_name][crate::model::ResponsePolicyRule::dns_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = ResponsePolicyRule::new().set_or_clear_dns_name(Some("example"));
/// let x = ResponsePolicyRule::new().set_or_clear_dns_name(None::<String>);
/// ```
pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = v.map(|x| x.into());
self
}
/// Sets the value of [kind][crate::model::ResponsePolicyRule::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = ResponsePolicyRule::new().set_kind("example");
/// ```
pub fn set_kind<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [kind][crate::model::ResponsePolicyRule::kind].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = ResponsePolicyRule::new().set_or_clear_kind(Some("example"));
/// let x = ResponsePolicyRule::new().set_or_clear_kind(None::<String>);
/// ```
pub fn set_or_clear_kind<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.kind = v.map(|x| x.into());
self
}
/// Sets the value of [local_data][crate::model::ResponsePolicyRule::local_data].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRule;
/// use google_cloud_dns_v1::model::ResponsePolicyRuleLocalData;
/// let x = ResponsePolicyRule::new().set_local_data(ResponsePolicyRuleLocalData::default()/* use setters */);
/// ```
pub fn set_local_data<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRuleLocalData>,
{
self.local_data = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [local_data][crate::model::ResponsePolicyRule::local_data].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRule;
/// use google_cloud_dns_v1::model::ResponsePolicyRuleLocalData;
/// let x = ResponsePolicyRule::new().set_or_clear_local_data(Some(ResponsePolicyRuleLocalData::default()/* use setters */));
/// let x = ResponsePolicyRule::new().set_or_clear_local_data(None::<ResponsePolicyRuleLocalData>);
/// ```
pub fn set_or_clear_local_data<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRuleLocalData>,
{
self.local_data = v.map(|x| x.into());
self
}
/// Sets the value of [rule_name][crate::model::ResponsePolicyRule::rule_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = ResponsePolicyRule::new().set_rule_name("example");
/// ```
pub fn set_rule_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.rule_name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [rule_name][crate::model::ResponsePolicyRule::rule_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = ResponsePolicyRule::new().set_or_clear_rule_name(Some("example"));
/// let x = ResponsePolicyRule::new().set_or_clear_rule_name(None::<String>);
/// ```
pub fn set_or_clear_rule_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.rule_name = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ResponsePolicyRule {
fn typename() -> &'static str {
"type.googleapis.com/.ResponsePolicyRule"
}
}
/// Defines additional types related to [ResponsePolicyRule].
pub mod response_policy_rule {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [behavior][.ResponsePolicyRule.behavior] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Behavior {
BehaviorUnspecified,
/// 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.
BypassResponsePolicy,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [Behavior::value] or
/// [Behavior::name].
UnknownValue(behavior::UnknownValue),
}
#[doc(hidden)]
pub mod behavior {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Behavior {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::BehaviorUnspecified => std::option::Option::Some(0),
Self::BypassResponsePolicy => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::BehaviorUnspecified => std::option::Option::Some("behaviorUnspecified"),
Self::BypassResponsePolicy => std::option::Option::Some("bypassResponsePolicy"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Behavior {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Behavior {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Behavior {
fn from(value: i32) -> Self {
match value {
0 => Self::BehaviorUnspecified,
1 => Self::BypassResponsePolicy,
_ => Self::UnknownValue(behavior::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Behavior {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"behaviorUnspecified" => Self::BehaviorUnspecified,
"bypassResponsePolicy" => Self::BypassResponsePolicy,
_ => Self::UnknownValue(behavior::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Behavior {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::BehaviorUnspecified => serializer.serialize_str("behaviorUnspecified"),
Self::BypassResponsePolicy => serializer.serialize_str("bypassResponsePolicy"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Behavior {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Behavior>::new(
"..ResponsePolicyRule.behavior",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResponsePolicyRuleLocalData {
/// All resource record sets for this selector, one per resource record type. The name must match the dns_name.
pub local_datas: std::vec::Vec<crate::model::ResourceRecordSet>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResponsePolicyRuleLocalData {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [local_datas][crate::model::ResponsePolicyRuleLocalData::local_datas].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRuleLocalData;
/// use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = ResponsePolicyRuleLocalData::new()
/// .set_local_datas([
/// ResourceRecordSet::default()/* use setters */,
/// ResourceRecordSet::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_local_datas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResourceRecordSet>,
{
use std::iter::Iterator;
self.local_datas = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ResponsePolicyRuleLocalData {
fn typename() -> &'static str {
"type.googleapis.com/.ResponsePolicyRuleLocalData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResponsePolicyRulesListResponse {
/// 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.
pub next_page_token: std::option::Option<std::string::String>,
/// The Response Policy Rule resources.
pub response_policy_rules: std::vec::Vec<crate::model::ResponsePolicyRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResponsePolicyRulesListResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [next_page_token][crate::model::ResponsePolicyRulesListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRulesListResponse;
/// let x = ResponsePolicyRulesListResponse::new().set_next_page_token("example");
/// ```
pub fn set_next_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [next_page_token][crate::model::ResponsePolicyRulesListResponse::next_page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRulesListResponse;
/// let x = ResponsePolicyRulesListResponse::new().set_or_clear_next_page_token(Some("example"));
/// let x = ResponsePolicyRulesListResponse::new().set_or_clear_next_page_token(None::<String>);
/// ```
pub fn set_or_clear_next_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.next_page_token = v.map(|x| x.into());
self
}
/// Sets the value of [response_policy_rules][crate::model::ResponsePolicyRulesListResponse::response_policy_rules].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRulesListResponse;
/// use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = ResponsePolicyRulesListResponse::new()
/// .set_response_policy_rules([
/// ResponsePolicyRule::default()/* use setters */,
/// ResponsePolicyRule::default()/* use (different) setters */,
/// ]);
/// ```
pub fn set_response_policy_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ResponsePolicyRule>,
{
use std::iter::Iterator;
self.response_policy_rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ResponsePolicyRulesListResponse {
fn typename() -> &'static str {
"type.googleapis.com/.ResponsePolicyRulesListResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ResponsePolicyRulesListResponse {
type PageItem = crate::model::ResponsePolicyRule;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.response_policy_rules
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone().unwrap_or_default()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResponsePolicyRulesPatchResponse {
pub response_policy_rule: std::option::Option<crate::model::ResponsePolicyRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResponsePolicyRulesPatchResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [response_policy_rule][crate::model::ResponsePolicyRulesPatchResponse::response_policy_rule].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRulesPatchResponse;
/// use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = ResponsePolicyRulesPatchResponse::new().set_response_policy_rule(ResponsePolicyRule::default()/* use setters */);
/// ```
pub fn set_response_policy_rule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRule>,
{
self.response_policy_rule = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [response_policy_rule][crate::model::ResponsePolicyRulesPatchResponse::response_policy_rule].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRulesPatchResponse;
/// use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = ResponsePolicyRulesPatchResponse::new().set_or_clear_response_policy_rule(Some(ResponsePolicyRule::default()/* use setters */));
/// let x = ResponsePolicyRulesPatchResponse::new().set_or_clear_response_policy_rule(None::<ResponsePolicyRule>);
/// ```
pub fn set_or_clear_response_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRule>,
{
self.response_policy_rule = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ResponsePolicyRulesPatchResponse {
fn typename() -> &'static str {
"type.googleapis.com/.ResponsePolicyRulesPatchResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResponsePolicyRulesUpdateResponse {
pub response_policy_rule: std::option::Option<crate::model::ResponsePolicyRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResponsePolicyRulesUpdateResponse {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [response_policy_rule][crate::model::ResponsePolicyRulesUpdateResponse::response_policy_rule].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRulesUpdateResponse;
/// use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = ResponsePolicyRulesUpdateResponse::new().set_response_policy_rule(ResponsePolicyRule::default()/* use setters */);
/// ```
pub fn set_response_policy_rule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRule>,
{
self.response_policy_rule = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [response_policy_rule][crate::model::ResponsePolicyRulesUpdateResponse::response_policy_rule].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::ResponsePolicyRulesUpdateResponse;
/// use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = ResponsePolicyRulesUpdateResponse::new().set_or_clear_response_policy_rule(Some(ResponsePolicyRule::default()/* use setters */));
/// let x = ResponsePolicyRulesUpdateResponse::new().set_or_clear_response_policy_rule(None::<ResponsePolicyRule>);
/// ```
pub fn set_or_clear_response_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRule>,
{
self.response_policy_rule = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ResponsePolicyRulesUpdateResponse {
fn typename() -> &'static str {
"type.googleapis.com/.ResponsePolicyRulesUpdateResponse"
}
}
/// Synthetic messages for the [changes][.changes] service
pub mod changes {
#[allow(unused_imports)]
use super::*;
/// Synthetic request message for the [create()][.changes.create] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// Synthetic request body field for the [create()][.changes.create] method.
pub body: std::option::Option<crate::model::Change>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::changes::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::CreateRequest;
/// let x = CreateRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::changes::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::CreateRequest;
/// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::changes::CreateRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::CreateRequest;
/// let x = CreateRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [project][crate::model::changes::CreateRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::CreateRequest;
/// let x = CreateRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [body][crate::model::changes::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::CreateRequest;
/// use google_cloud_dns_v1::model::Change;
/// let x = CreateRequest::new().set_body(Change::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Change>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::changes::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::CreateRequest;
/// use google_cloud_dns_v1::model::Change;
/// let x = CreateRequest::new().set_or_clear_body(Some(Change::default()/* use setters */));
/// let x = CreateRequest::new().set_or_clear_body(None::<Change>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Change>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [get()][.changes.get] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRequest {
/// The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.
pub change_id: std::string::String,
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [change_id][crate::model::changes::GetRequest::change_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::GetRequest;
/// let x = GetRequest::new().set_change_id("example");
/// ```
pub fn set_change_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.change_id = v.into();
self
}
/// Sets the value of [client_operation_id][crate::model::changes::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::GetRequest;
/// let x = GetRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::changes::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::GetRequest;
/// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::changes::GetRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::GetRequest;
/// let x = GetRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [project][crate::model::changes::GetRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::GetRequest;
/// let x = GetRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
/// Synthetic request message for the [list()][.changes.list] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRequest {
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
pub max_results: std::option::Option<i32>,
/// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
pub page_token: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// Sorting criterion. The only supported value is change sequence.
pub sort_by: std::option::Option<crate::model::changes::list_request::SortBy>,
/// Sorting order direction: 'ascending' or 'descending'.
pub sort_order: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [managed_zone][crate::model::changes::ListRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::ListRequest;
/// let x = ListRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [max_results][crate::model::changes::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::ListRequest;
/// let x = ListRequest::new().set_max_results(42);
/// ```
pub fn set_max_results<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [max_results][crate::model::changes::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::ListRequest;
/// let x = ListRequest::new().set_or_clear_max_results(Some(42));
/// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
/// ```
pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = v.map(|x| x.into());
self
}
/// Sets the value of [page_token][crate::model::changes::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::ListRequest;
/// let x = ListRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [page_token][crate::model::changes::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::ListRequest;
/// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
/// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
/// ```
pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::changes::ListRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::ListRequest;
/// let x = ListRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [sort_by][crate::model::changes::ListRequest::sort_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::ListRequest;
/// use google_cloud_dns_v1::model::changes::list_request::SortBy;
/// let x0 = ListRequest::new().set_sort_by(SortBy::ChangeSequence);
/// ```
pub fn set_sort_by<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::changes::list_request::SortBy>,
{
self.sort_by = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [sort_by][crate::model::changes::ListRequest::sort_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::ListRequest;
/// use google_cloud_dns_v1::model::changes::list_request::SortBy;
/// let x0 = ListRequest::new().set_or_clear_sort_by(Some(SortBy::ChangeSequence));
/// let x_none = ListRequest::new().set_or_clear_sort_by(None::<SortBy>);
/// ```
pub fn set_or_clear_sort_by<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::changes::list_request::SortBy>,
{
self.sort_by = v.map(|x| x.into());
self
}
/// Sets the value of [sort_order][crate::model::changes::ListRequest::sort_order].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::ListRequest;
/// let x = ListRequest::new().set_sort_order("example");
/// ```
pub fn set_sort_order<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.sort_order = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [sort_order][crate::model::changes::ListRequest::sort_order].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::changes::ListRequest;
/// let x = ListRequest::new().set_or_clear_sort_order(Some("example"));
/// let x = ListRequest::new().set_or_clear_sort_order(None::<String>);
/// ```
pub fn set_or_clear_sort_order<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.sort_order = v.map(|x| x.into());
self
}
}
/// Defines additional types related to [ListRequest].
pub mod list_request {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [sortBy][.changes.listRequest.sortBy] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SortBy {
ChangeSequence,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [SortBy::value] or
/// [SortBy::name].
UnknownValue(sort_by::UnknownValue),
}
#[doc(hidden)]
pub mod sort_by {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SortBy {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::ChangeSequence => std::option::Option::Some(0),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::ChangeSequence => std::option::Option::Some("changeSequence"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SortBy {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SortBy {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SortBy {
fn from(value: i32) -> Self {
match value {
0 => Self::ChangeSequence,
_ => Self::UnknownValue(sort_by::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SortBy {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"changeSequence" => Self::ChangeSequence,
_ => Self::UnknownValue(sort_by::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SortBy {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::ChangeSequence => serializer.serialize_str("changeSequence"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SortBy {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SortBy>::new(
"..changes.listRequest.sortBy",
))
}
}
}
}
/// Synthetic messages for the [dnsKeys][.dnsKeys] service
pub mod dns_keys {
#[allow(unused_imports)]
use super::*;
/// Synthetic request message for the [get()][.dnsKeys.get] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// 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.
pub digest_type: std::option::Option<std::string::String>,
/// The identifier of the requested DnsKey.
pub dns_key_id: std::string::String,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::dns_keys::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
/// let x = GetRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::dns_keys::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
/// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [digest_type][crate::model::dns_keys::GetRequest::digest_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
/// let x = GetRequest::new().set_digest_type("example");
/// ```
pub fn set_digest_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.digest_type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [digest_type][crate::model::dns_keys::GetRequest::digest_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
/// let x = GetRequest::new().set_or_clear_digest_type(Some("example"));
/// let x = GetRequest::new().set_or_clear_digest_type(None::<String>);
/// ```
pub fn set_or_clear_digest_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.digest_type = v.map(|x| x.into());
self
}
/// Sets the value of [dns_key_id][crate::model::dns_keys::GetRequest::dns_key_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
/// let x = GetRequest::new().set_dns_key_id("example");
/// ```
pub fn set_dns_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dns_key_id = v.into();
self
}
/// Sets the value of [managed_zone][crate::model::dns_keys::GetRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
/// let x = GetRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [project][crate::model::dns_keys::GetRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::GetRequest;
/// let x = GetRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
/// Synthetic request message for the [list()][.dnsKeys.list] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRequest {
/// 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.
pub digest_type: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
pub max_results: std::option::Option<i32>,
/// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
pub page_token: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [digest_type][crate::model::dns_keys::ListRequest::digest_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
/// let x = ListRequest::new().set_digest_type("example");
/// ```
pub fn set_digest_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.digest_type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [digest_type][crate::model::dns_keys::ListRequest::digest_type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
/// let x = ListRequest::new().set_or_clear_digest_type(Some("example"));
/// let x = ListRequest::new().set_or_clear_digest_type(None::<String>);
/// ```
pub fn set_or_clear_digest_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.digest_type = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::dns_keys::ListRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
/// let x = ListRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [max_results][crate::model::dns_keys::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
/// let x = ListRequest::new().set_max_results(42);
/// ```
pub fn set_max_results<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [max_results][crate::model::dns_keys::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
/// let x = ListRequest::new().set_or_clear_max_results(Some(42));
/// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
/// ```
pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = v.map(|x| x.into());
self
}
/// Sets the value of [page_token][crate::model::dns_keys::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
/// let x = ListRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [page_token][crate::model::dns_keys::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
/// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
/// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
/// ```
pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::dns_keys::ListRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::dns_keys::ListRequest;
/// let x = ListRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
}
/// Synthetic messages for the [managedZoneOperations][.managedZoneOperations] service
pub mod managed_zone_operations {
#[allow(unused_imports)]
use super::*;
/// Synthetic request message for the [get()][.managedZoneOperations.get] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request.
pub managed_zone: std::string::String,
/// Identifies the operation addressed by this request (ID of the operation).
pub operation: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::managed_zone_operations::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::GetRequest;
/// let x = GetRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::managed_zone_operations::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::GetRequest;
/// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::managed_zone_operations::GetRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::GetRequest;
/// let x = GetRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [operation][crate::model::managed_zone_operations::GetRequest::operation].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::GetRequest;
/// let x = GetRequest::new().set_operation("example");
/// ```
pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.operation = v.into();
self
}
/// Sets the value of [project][crate::model::managed_zone_operations::GetRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::GetRequest;
/// let x = GetRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
/// Synthetic request message for the [list()][.managedZoneOperations.list] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRequest {
/// Identifies the managed zone addressed by this request.
pub managed_zone: std::string::String,
/// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
pub max_results: std::option::Option<i32>,
/// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
pub page_token: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// Sorting criterion. The only supported values are START_TIME and ID.
pub sort_by:
std::option::Option<crate::model::managed_zone_operations::list_request::SortBy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [managed_zone][crate::model::managed_zone_operations::ListRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
/// let x = ListRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [max_results][crate::model::managed_zone_operations::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
/// let x = ListRequest::new().set_max_results(42);
/// ```
pub fn set_max_results<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [max_results][crate::model::managed_zone_operations::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
/// let x = ListRequest::new().set_or_clear_max_results(Some(42));
/// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
/// ```
pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = v.map(|x| x.into());
self
}
/// Sets the value of [page_token][crate::model::managed_zone_operations::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
/// let x = ListRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [page_token][crate::model::managed_zone_operations::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
/// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
/// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
/// ```
pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::managed_zone_operations::ListRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
/// let x = ListRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [sort_by][crate::model::managed_zone_operations::ListRequest::sort_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
/// use google_cloud_dns_v1::model::managed_zone_operations::list_request::SortBy;
/// let x0 = ListRequest::new().set_sort_by(SortBy::Id);
/// ```
pub fn set_sort_by<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::managed_zone_operations::list_request::SortBy>,
{
self.sort_by = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [sort_by][crate::model::managed_zone_operations::ListRequest::sort_by].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zone_operations::ListRequest;
/// use google_cloud_dns_v1::model::managed_zone_operations::list_request::SortBy;
/// let x0 = ListRequest::new().set_or_clear_sort_by(Some(SortBy::Id));
/// let x_none = ListRequest::new().set_or_clear_sort_by(None::<SortBy>);
/// ```
pub fn set_or_clear_sort_by<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::managed_zone_operations::list_request::SortBy>,
{
self.sort_by = v.map(|x| x.into());
self
}
}
/// Defines additional types related to [ListRequest].
pub mod list_request {
#[allow(unused_imports)]
use super::*;
/// The enumerated type for the [sortBy][.managedZoneOperations.listRequest.sortBy] field.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SortBy {
StartTime,
Id,
/// If set, the enum was initialized with an unknown value.
///
/// Applications can examine the value using [SortBy::value] or
/// [SortBy::name].
UnknownValue(sort_by::UnknownValue),
}
#[doc(hidden)]
pub mod sort_by {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SortBy {
/// Gets the enum value.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the string representation of enums.
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::StartTime => std::option::Option::Some(0),
Self::Id => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
/// Gets the enum value as a string.
///
/// Returns `None` if the enum contains an unknown value deserialized from
/// the integer representation of enums.
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::StartTime => std::option::Option::Some("startTime"),
Self::Id => std::option::Option::Some("id"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SortBy {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SortBy {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SortBy {
fn from(value: i32) -> Self {
match value {
0 => Self::StartTime,
1 => Self::Id,
_ => Self::UnknownValue(sort_by::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SortBy {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"startTime" => Self::StartTime,
"id" => Self::Id,
_ => Self::UnknownValue(sort_by::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SortBy {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::StartTime => serializer.serialize_str("startTime"),
Self::Id => serializer.serialize_str("id"),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SortBy {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SortBy>::new(
"..managedZoneOperations.listRequest.sortBy",
))
}
}
}
}
/// Synthetic messages for the [managedZones][.managedZones] service
pub mod managed_zones {
#[allow(unused_imports)]
use super::*;
/// Synthetic request message for the [create()][.managedZones.create] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// Synthetic request body field for the [create()][.managedZones.create] method.
pub body: std::option::Option<crate::model::ManagedZone>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::managed_zones::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::CreateRequest;
/// let x = CreateRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::managed_zones::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::CreateRequest;
/// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::managed_zones::CreateRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::CreateRequest;
/// let x = CreateRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [body][crate::model::managed_zones::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::CreateRequest;
/// use google_cloud_dns_v1::model::ManagedZone;
/// let x = CreateRequest::new().set_body(ManagedZone::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZone>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::managed_zones::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::CreateRequest;
/// use google_cloud_dns_v1::model::ManagedZone;
/// let x = CreateRequest::new().set_or_clear_body(Some(ManagedZone::default()/* use setters */));
/// let x = CreateRequest::new().set_or_clear_body(None::<ManagedZone>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZone>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [delete()][.managedZones.delete] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::managed_zones::DeleteRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::DeleteRequest;
/// let x = DeleteRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::managed_zones::DeleteRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::DeleteRequest;
/// let x = DeleteRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = DeleteRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::managed_zones::DeleteRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::DeleteRequest;
/// let x = DeleteRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [project][crate::model::managed_zones::DeleteRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::DeleteRequest;
/// let x = DeleteRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
/// Synthetic request message for the [get()][.managedZones.get] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::managed_zones::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::GetRequest;
/// let x = GetRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::managed_zones::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::GetRequest;
/// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::managed_zones::GetRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::GetRequest;
/// let x = GetRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [project][crate::model::managed_zones::GetRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::GetRequest;
/// let x = GetRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
/// Synthetic request message for the [getIamPolicy()][.managedZones.getIamPolicy] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetIamPolicyRequest {
/// 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.
pub resource: std::string::String,
/// Synthetic request body field for the [getIamPolicy()][.managedZones.getIamPolicy] method.
pub body: std::option::Option<crate::model::GoogleIamV1GetIamPolicyRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetIamPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [resource][crate::model::managed_zones::GetIamPolicyRequest::resource].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::GetIamPolicyRequest;
/// let x = GetIamPolicyRequest::new().set_resource("example");
/// ```
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
/// Sets the value of [body][crate::model::managed_zones::GetIamPolicyRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::GetIamPolicyRequest;
/// use google_cloud_dns_v1::model::GoogleIamV1GetIamPolicyRequest;
/// let x = GetIamPolicyRequest::new().set_body(GoogleIamV1GetIamPolicyRequest::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GoogleIamV1GetIamPolicyRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::managed_zones::GetIamPolicyRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::GetIamPolicyRequest;
/// use google_cloud_dns_v1::model::GoogleIamV1GetIamPolicyRequest;
/// let x = GetIamPolicyRequest::new().set_or_clear_body(Some(GoogleIamV1GetIamPolicyRequest::default()/* use setters */));
/// let x = GetIamPolicyRequest::new().set_or_clear_body(None::<GoogleIamV1GetIamPolicyRequest>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GoogleIamV1GetIamPolicyRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [list()][.managedZones.list] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRequest {
/// Restricts the list to return only zones with this domain name.
pub dns_name: std::option::Option<std::string::String>,
/// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
pub max_results: std::option::Option<i32>,
/// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
pub page_token: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [dns_name][crate::model::managed_zones::ListRequest::dns_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
/// let x = ListRequest::new().set_dns_name("example");
/// ```
pub fn set_dns_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [dns_name][crate::model::managed_zones::ListRequest::dns_name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
/// let x = ListRequest::new().set_or_clear_dns_name(Some("example"));
/// let x = ListRequest::new().set_or_clear_dns_name(None::<String>);
/// ```
pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.dns_name = v.map(|x| x.into());
self
}
/// Sets the value of [max_results][crate::model::managed_zones::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
/// let x = ListRequest::new().set_max_results(42);
/// ```
pub fn set_max_results<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [max_results][crate::model::managed_zones::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
/// let x = ListRequest::new().set_or_clear_max_results(Some(42));
/// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
/// ```
pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = v.map(|x| x.into());
self
}
/// Sets the value of [page_token][crate::model::managed_zones::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
/// let x = ListRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [page_token][crate::model::managed_zones::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
/// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
/// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
/// ```
pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::managed_zones::ListRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::ListRequest;
/// let x = ListRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
/// Synthetic request message for the [patch()][.managedZones.patch] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PatchRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// Synthetic request body field for the [patch()][.managedZones.patch] method.
pub body: std::option::Option<crate::model::ManagedZone>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PatchRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::managed_zones::PatchRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
/// let x = PatchRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::managed_zones::PatchRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
/// let x = PatchRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = PatchRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::managed_zones::PatchRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
/// let x = PatchRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [project][crate::model::managed_zones::PatchRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
/// let x = PatchRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [body][crate::model::managed_zones::PatchRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
/// use google_cloud_dns_v1::model::ManagedZone;
/// let x = PatchRequest::new().set_body(ManagedZone::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZone>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::managed_zones::PatchRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::PatchRequest;
/// use google_cloud_dns_v1::model::ManagedZone;
/// let x = PatchRequest::new().set_or_clear_body(Some(ManagedZone::default()/* use setters */));
/// let x = PatchRequest::new().set_or_clear_body(None::<ManagedZone>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZone>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [setIamPolicy()][.managedZones.setIamPolicy] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SetIamPolicyRequest {
/// 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.
pub resource: std::string::String,
/// Synthetic request body field for the [setIamPolicy()][.managedZones.setIamPolicy] method.
pub body: std::option::Option<crate::model::GoogleIamV1SetIamPolicyRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SetIamPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [resource][crate::model::managed_zones::SetIamPolicyRequest::resource].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::SetIamPolicyRequest;
/// let x = SetIamPolicyRequest::new().set_resource("example");
/// ```
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
/// Sets the value of [body][crate::model::managed_zones::SetIamPolicyRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::SetIamPolicyRequest;
/// use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
/// let x = SetIamPolicyRequest::new().set_body(GoogleIamV1SetIamPolicyRequest::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GoogleIamV1SetIamPolicyRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::managed_zones::SetIamPolicyRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::SetIamPolicyRequest;
/// use google_cloud_dns_v1::model::GoogleIamV1SetIamPolicyRequest;
/// let x = SetIamPolicyRequest::new().set_or_clear_body(Some(GoogleIamV1SetIamPolicyRequest::default()/* use setters */));
/// let x = SetIamPolicyRequest::new().set_or_clear_body(None::<GoogleIamV1SetIamPolicyRequest>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GoogleIamV1SetIamPolicyRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [testIamPermissions()][.managedZones.testIamPermissions] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TestIamPermissionsRequest {
/// 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.
pub resource: std::string::String,
/// Synthetic request body field for the [testIamPermissions()][.managedZones.testIamPermissions] method.
pub body: std::option::Option<crate::model::GoogleIamV1TestIamPermissionsRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TestIamPermissionsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [resource][crate::model::managed_zones::TestIamPermissionsRequest::resource].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::TestIamPermissionsRequest;
/// let x = TestIamPermissionsRequest::new().set_resource("example");
/// ```
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
/// Sets the value of [body][crate::model::managed_zones::TestIamPermissionsRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::TestIamPermissionsRequest;
/// use google_cloud_dns_v1::model::GoogleIamV1TestIamPermissionsRequest;
/// let x = TestIamPermissionsRequest::new().set_body(GoogleIamV1TestIamPermissionsRequest::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GoogleIamV1TestIamPermissionsRequest>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::managed_zones::TestIamPermissionsRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::TestIamPermissionsRequest;
/// use google_cloud_dns_v1::model::GoogleIamV1TestIamPermissionsRequest;
/// let x = TestIamPermissionsRequest::new().set_or_clear_body(Some(GoogleIamV1TestIamPermissionsRequest::default()/* use setters */));
/// let x = TestIamPermissionsRequest::new().set_or_clear_body(None::<GoogleIamV1TestIamPermissionsRequest>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GoogleIamV1TestIamPermissionsRequest>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [update()][.managedZones.update] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// Synthetic request body field for the [update()][.managedZones.update] method.
pub body: std::option::Option<crate::model::ManagedZone>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::managed_zones::UpdateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
/// let x = UpdateRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::managed_zones::UpdateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
/// let x = UpdateRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = UpdateRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::managed_zones::UpdateRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
/// let x = UpdateRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [project][crate::model::managed_zones::UpdateRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
/// let x = UpdateRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [body][crate::model::managed_zones::UpdateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
/// use google_cloud_dns_v1::model::ManagedZone;
/// let x = UpdateRequest::new().set_body(ManagedZone::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ManagedZone>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::managed_zones::UpdateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::managed_zones::UpdateRequest;
/// use google_cloud_dns_v1::model::ManagedZone;
/// let x = UpdateRequest::new().set_or_clear_body(Some(ManagedZone::default()/* use setters */));
/// let x = UpdateRequest::new().set_or_clear_body(None::<ManagedZone>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ManagedZone>,
{
self.body = v.map(|x| x.into());
self
}
}
}
/// Synthetic messages for the [policies][.policies] service
pub mod policies {
#[allow(unused_imports)]
use super::*;
/// Synthetic request message for the [create()][.policies.create] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// Synthetic request body field for the [create()][.policies.create] method.
pub body: std::option::Option<crate::model::Policy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::policies::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::CreateRequest;
/// let x = CreateRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::policies::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::CreateRequest;
/// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::policies::CreateRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::CreateRequest;
/// let x = CreateRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [body][crate::model::policies::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::CreateRequest;
/// use google_cloud_dns_v1::model::Policy;
/// let x = CreateRequest::new().set_body(Policy::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::policies::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::CreateRequest;
/// use google_cloud_dns_v1::model::Policy;
/// let x = CreateRequest::new().set_or_clear_body(Some(Policy::default()/* use setters */));
/// let x = CreateRequest::new().set_or_clear_body(None::<Policy>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [delete()][.policies.delete] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// User given friendly name of the policy addressed by this request.
pub policy: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::policies::DeleteRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::DeleteRequest;
/// let x = DeleteRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::policies::DeleteRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::DeleteRequest;
/// let x = DeleteRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = DeleteRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [policy][crate::model::policies::DeleteRequest::policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::DeleteRequest;
/// let x = DeleteRequest::new().set_policy("example");
/// ```
pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.policy = v.into();
self
}
/// Sets the value of [project][crate::model::policies::DeleteRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::DeleteRequest;
/// let x = DeleteRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
/// Synthetic request message for the [get()][.policies.get] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// User given friendly name of the policy addressed by this request.
pub policy: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::policies::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::GetRequest;
/// let x = GetRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::policies::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::GetRequest;
/// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [policy][crate::model::policies::GetRequest::policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::GetRequest;
/// let x = GetRequest::new().set_policy("example");
/// ```
pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.policy = v.into();
self
}
/// Sets the value of [project][crate::model::policies::GetRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::GetRequest;
/// let x = GetRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
/// Synthetic request message for the [list()][.policies.list] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRequest {
/// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
pub max_results: std::option::Option<i32>,
/// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
pub page_token: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [max_results][crate::model::policies::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::ListRequest;
/// let x = ListRequest::new().set_max_results(42);
/// ```
pub fn set_max_results<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [max_results][crate::model::policies::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::ListRequest;
/// let x = ListRequest::new().set_or_clear_max_results(Some(42));
/// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
/// ```
pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = v.map(|x| x.into());
self
}
/// Sets the value of [page_token][crate::model::policies::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::ListRequest;
/// let x = ListRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [page_token][crate::model::policies::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::ListRequest;
/// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
/// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
/// ```
pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::policies::ListRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::ListRequest;
/// let x = ListRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
/// Synthetic request message for the [patch()][.policies.patch] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PatchRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// User given friendly name of the policy addressed by this request.
pub policy: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// Synthetic request body field for the [patch()][.policies.patch] method.
pub body: std::option::Option<crate::model::Policy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PatchRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::policies::PatchRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::PatchRequest;
/// let x = PatchRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::policies::PatchRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::PatchRequest;
/// let x = PatchRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = PatchRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [policy][crate::model::policies::PatchRequest::policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::PatchRequest;
/// let x = PatchRequest::new().set_policy("example");
/// ```
pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.policy = v.into();
self
}
/// Sets the value of [project][crate::model::policies::PatchRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::PatchRequest;
/// let x = PatchRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [body][crate::model::policies::PatchRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::PatchRequest;
/// use google_cloud_dns_v1::model::Policy;
/// let x = PatchRequest::new().set_body(Policy::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::policies::PatchRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::PatchRequest;
/// use google_cloud_dns_v1::model::Policy;
/// let x = PatchRequest::new().set_or_clear_body(Some(Policy::default()/* use setters */));
/// let x = PatchRequest::new().set_or_clear_body(None::<Policy>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [update()][.policies.update] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// User given friendly name of the policy addressed by this request.
pub policy: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// Synthetic request body field for the [update()][.policies.update] method.
pub body: std::option::Option<crate::model::Policy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::policies::UpdateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::UpdateRequest;
/// let x = UpdateRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::policies::UpdateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::UpdateRequest;
/// let x = UpdateRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = UpdateRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [policy][crate::model::policies::UpdateRequest::policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::UpdateRequest;
/// let x = UpdateRequest::new().set_policy("example");
/// ```
pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.policy = v.into();
self
}
/// Sets the value of [project][crate::model::policies::UpdateRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::UpdateRequest;
/// let x = UpdateRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [body][crate::model::policies::UpdateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::UpdateRequest;
/// use google_cloud_dns_v1::model::Policy;
/// let x = UpdateRequest::new().set_body(Policy::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::policies::UpdateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::policies::UpdateRequest;
/// use google_cloud_dns_v1::model::Policy;
/// let x = UpdateRequest::new().set_or_clear_body(Some(Policy::default()/* use setters */));
/// let x = UpdateRequest::new().set_or_clear_body(None::<Policy>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.body = v.map(|x| x.into());
self
}
}
}
/// Synthetic messages for the [projects][.projects] service
pub mod projects {
#[allow(unused_imports)]
use super::*;
/// Synthetic request message for the [get()][.projects.get] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::projects::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::projects::GetRequest;
/// let x = GetRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::projects::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::projects::GetRequest;
/// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::projects::GetRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::projects::GetRequest;
/// let x = GetRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
}
/// Synthetic messages for the [resourceRecordSets][.resourceRecordSets] service
pub mod resource_record_sets {
#[allow(unused_imports)]
use super::*;
/// Synthetic request message for the [create()][.resourceRecordSets.create] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// Synthetic request body field for the [create()][.resourceRecordSets.create] method.
pub body: std::option::Option<crate::model::ResourceRecordSet>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::resource_record_sets::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
/// let x = CreateRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
/// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::resource_record_sets::CreateRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
/// let x = CreateRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [project][crate::model::resource_record_sets::CreateRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
/// let x = CreateRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [body][crate::model::resource_record_sets::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
/// use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = CreateRequest::new().set_body(ResourceRecordSet::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResourceRecordSet>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::resource_record_sets::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::CreateRequest;
/// use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = CreateRequest::new().set_or_clear_body(Some(ResourceRecordSet::default()/* use setters */));
/// let x = CreateRequest::new().set_or_clear_body(None::<ResourceRecordSet>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResourceRecordSet>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [delete()][.resourceRecordSets.delete] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Fully qualified domain name.
pub name: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// RRSet type.
pub r#type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::resource_record_sets::DeleteRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
/// let x = DeleteRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::DeleteRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
/// let x = DeleteRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = DeleteRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::resource_record_sets::DeleteRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
/// let x = DeleteRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [name][crate::model::resource_record_sets::DeleteRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
/// let x = DeleteRequest::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [project][crate::model::resource_record_sets::DeleteRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
/// let x = DeleteRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [r#type][crate::model::resource_record_sets::DeleteRequest::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::DeleteRequest;
/// let x = DeleteRequest::new().set_type("example");
/// ```
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
/// Synthetic request message for the [get()][.resourceRecordSets.get] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Fully qualified domain name.
pub name: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// RRSet type.
pub r#type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::resource_record_sets::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
/// let x = GetRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
/// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::resource_record_sets::GetRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
/// let x = GetRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [name][crate::model::resource_record_sets::GetRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
/// let x = GetRequest::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [project][crate::model::resource_record_sets::GetRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
/// let x = GetRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [r#type][crate::model::resource_record_sets::GetRequest::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::GetRequest;
/// let x = GetRequest::new().set_type("example");
/// ```
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
/// Synthetic request message for the [list()][.resourceRecordSets.list] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRequest {
/// Specify a filter expression to view records that exactly match the specified domain. Both the name and type parameters are not supported when you use filter and must be omitted. 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"
pub filter: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
pub max_results: std::option::Option<i32>,
/// 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.
pub name: std::option::Option<std::string::String>,
/// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
pub page_token: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// 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.
pub r#type: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [filter][crate::model::resource_record_sets::ListRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_filter("example");
/// ```
pub fn set_filter<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.filter = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [filter][crate::model::resource_record_sets::ListRequest::filter].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_or_clear_filter(Some("example"));
/// let x = ListRequest::new().set_or_clear_filter(None::<String>);
/// ```
pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.filter = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::resource_record_sets::ListRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [max_results][crate::model::resource_record_sets::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_max_results(42);
/// ```
pub fn set_max_results<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [max_results][crate::model::resource_record_sets::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_or_clear_max_results(Some(42));
/// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
/// ```
pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = v.map(|x| x.into());
self
}
/// Sets the value of [name][crate::model::resource_record_sets::ListRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_name("example");
/// ```
pub fn set_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [name][crate::model::resource_record_sets::ListRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_or_clear_name(Some("example"));
/// let x = ListRequest::new().set_or_clear_name(None::<String>);
/// ```
pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.name = v.map(|x| x.into());
self
}
/// Sets the value of [page_token][crate::model::resource_record_sets::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [page_token][crate::model::resource_record_sets::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
/// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
/// ```
pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::resource_record_sets::ListRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [r#type][crate::model::resource_record_sets::ListRequest::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_type("example");
/// ```
pub fn set_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.r#type = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [r#type][crate::model::resource_record_sets::ListRequest::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::ListRequest;
/// let x = ListRequest::new().set_or_clear_type(Some("example"));
/// let x = ListRequest::new().set_or_clear_type(None::<String>);
/// ```
pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.r#type = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [patch()][.resourceRecordSets.patch] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PatchRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
pub managed_zone: std::string::String,
/// Fully qualified domain name.
pub name: std::string::String,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// RRSet type.
pub r#type: std::string::String,
/// Synthetic request body field for the [patch()][.resourceRecordSets.patch] method.
pub body: std::option::Option<crate::model::ResourceRecordSet>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PatchRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::resource_record_sets::PatchRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
/// let x = PatchRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::resource_record_sets::PatchRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
/// let x = PatchRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = PatchRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [managed_zone][crate::model::resource_record_sets::PatchRequest::managed_zone].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
/// let x = PatchRequest::new().set_managed_zone("example");
/// ```
pub fn set_managed_zone<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.managed_zone = v.into();
self
}
/// Sets the value of [name][crate::model::resource_record_sets::PatchRequest::name].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
/// let x = PatchRequest::new().set_name("example");
/// ```
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
/// Sets the value of [project][crate::model::resource_record_sets::PatchRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
/// let x = PatchRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [r#type][crate::model::resource_record_sets::PatchRequest::type].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
/// let x = PatchRequest::new().set_type("example");
/// ```
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
/// Sets the value of [body][crate::model::resource_record_sets::PatchRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
/// use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = PatchRequest::new().set_body(ResourceRecordSet::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResourceRecordSet>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::resource_record_sets::PatchRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::resource_record_sets::PatchRequest;
/// use google_cloud_dns_v1::model::ResourceRecordSet;
/// let x = PatchRequest::new().set_or_clear_body(Some(ResourceRecordSet::default()/* use setters */));
/// let x = PatchRequest::new().set_or_clear_body(None::<ResourceRecordSet>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResourceRecordSet>,
{
self.body = v.map(|x| x.into());
self
}
}
}
/// Synthetic messages for the [responsePolicies][.responsePolicies] service
pub mod response_policies {
#[allow(unused_imports)]
use super::*;
/// Synthetic request message for the [create()][.responsePolicies.create] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// Synthetic request body field for the [create()][.responsePolicies.create] method.
pub body: std::option::Option<crate::model::ResponsePolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::response_policies::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::CreateRequest;
/// let x = CreateRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::response_policies::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::CreateRequest;
/// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policies::CreateRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::CreateRequest;
/// let x = CreateRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [body][crate::model::response_policies::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::CreateRequest;
/// use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = CreateRequest::new().set_body(ResponsePolicy::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicy>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::response_policies::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::CreateRequest;
/// use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = CreateRequest::new().set_or_clear_body(Some(ResponsePolicy::default()/* use setters */));
/// let x = CreateRequest::new().set_or_clear_body(None::<ResponsePolicy>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicy>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [delete()][.responsePolicies.delete] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// User assigned name of the Response Policy addressed by this request.
pub response_policy: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::response_policies::DeleteRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::DeleteRequest;
/// let x = DeleteRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::response_policies::DeleteRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::DeleteRequest;
/// let x = DeleteRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = DeleteRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policies::DeleteRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::DeleteRequest;
/// let x = DeleteRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [response_policy][crate::model::response_policies::DeleteRequest::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::DeleteRequest;
/// let x = DeleteRequest::new().set_response_policy("example");
/// ```
pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy = v.into();
self
}
}
/// Synthetic request message for the [get()][.responsePolicies.get] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// User assigned name of the Response Policy addressed by this request.
pub response_policy: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::response_policies::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::GetRequest;
/// let x = GetRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::response_policies::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::GetRequest;
/// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policies::GetRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::GetRequest;
/// let x = GetRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [response_policy][crate::model::response_policies::GetRequest::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::GetRequest;
/// let x = GetRequest::new().set_response_policy("example");
/// ```
pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy = v.into();
self
}
}
/// Synthetic request message for the [list()][.responsePolicies.list] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRequest {
/// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
pub max_results: std::option::Option<i32>,
/// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
pub page_token: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [max_results][crate::model::response_policies::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::ListRequest;
/// let x = ListRequest::new().set_max_results(42);
/// ```
pub fn set_max_results<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [max_results][crate::model::response_policies::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::ListRequest;
/// let x = ListRequest::new().set_or_clear_max_results(Some(42));
/// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
/// ```
pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = v.map(|x| x.into());
self
}
/// Sets the value of [page_token][crate::model::response_policies::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::ListRequest;
/// let x = ListRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [page_token][crate::model::response_policies::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::ListRequest;
/// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
/// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
/// ```
pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policies::ListRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::ListRequest;
/// let x = ListRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
}
/// Synthetic request message for the [patch()][.responsePolicies.patch] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PatchRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// User assigned name of the response policy addressed by this request.
pub response_policy: std::string::String,
/// Synthetic request body field for the [patch()][.responsePolicies.patch] method.
pub body: std::option::Option<crate::model::ResponsePolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PatchRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::response_policies::PatchRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
/// let x = PatchRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::response_policies::PatchRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
/// let x = PatchRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = PatchRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policies::PatchRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
/// let x = PatchRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [response_policy][crate::model::response_policies::PatchRequest::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
/// let x = PatchRequest::new().set_response_policy("example");
/// ```
pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy = v.into();
self
}
/// Sets the value of [body][crate::model::response_policies::PatchRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
/// use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = PatchRequest::new().set_body(ResponsePolicy::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicy>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::response_policies::PatchRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::PatchRequest;
/// use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = PatchRequest::new().set_or_clear_body(Some(ResponsePolicy::default()/* use setters */));
/// let x = PatchRequest::new().set_or_clear_body(None::<ResponsePolicy>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicy>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [update()][.responsePolicies.update] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// User assigned name of the Response Policy addressed by this request.
pub response_policy: std::string::String,
/// Synthetic request body field for the [update()][.responsePolicies.update] method.
pub body: std::option::Option<crate::model::ResponsePolicy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::response_policies::UpdateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
/// let x = UpdateRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::response_policies::UpdateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
/// let x = UpdateRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = UpdateRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policies::UpdateRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
/// let x = UpdateRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [response_policy][crate::model::response_policies::UpdateRequest::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
/// let x = UpdateRequest::new().set_response_policy("example");
/// ```
pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy = v.into();
self
}
/// Sets the value of [body][crate::model::response_policies::UpdateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
/// use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = UpdateRequest::new().set_body(ResponsePolicy::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicy>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::response_policies::UpdateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policies::UpdateRequest;
/// use google_cloud_dns_v1::model::ResponsePolicy;
/// let x = UpdateRequest::new().set_or_clear_body(Some(ResponsePolicy::default()/* use setters */));
/// let x = UpdateRequest::new().set_or_clear_body(None::<ResponsePolicy>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicy>,
{
self.body = v.map(|x| x.into());
self
}
}
}
/// Synthetic messages for the [responsePolicyRules][.responsePolicyRules] service
pub mod response_policy_rules {
#[allow(unused_imports)]
use super::*;
/// Synthetic request message for the [create()][.responsePolicyRules.create] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// User assigned name of the Response Policy containing the Response Policy Rule.
pub response_policy: std::string::String,
/// Synthetic request body field for the [create()][.responsePolicyRules.create] method.
pub body: std::option::Option<crate::model::ResponsePolicyRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::response_policy_rules::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
/// let x = CreateRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::CreateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
/// let x = CreateRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = CreateRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policy_rules::CreateRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
/// let x = CreateRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [response_policy][crate::model::response_policy_rules::CreateRequest::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
/// let x = CreateRequest::new().set_response_policy("example");
/// ```
pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy = v.into();
self
}
/// Sets the value of [body][crate::model::response_policy_rules::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
/// use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = CreateRequest::new().set_body(ResponsePolicyRule::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRule>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::response_policy_rules::CreateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::CreateRequest;
/// use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = CreateRequest::new().set_or_clear_body(Some(ResponsePolicyRule::default()/* use setters */));
/// let x = CreateRequest::new().set_or_clear_body(None::<ResponsePolicyRule>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRule>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [delete()][.responsePolicyRules.delete] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// User assigned name of the Response Policy containing the Response Policy Rule.
pub response_policy: std::string::String,
/// User assigned name of the Response Policy Rule addressed by this request.
pub response_policy_rule: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::response_policy_rules::DeleteRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::DeleteRequest;
/// let x = DeleteRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::DeleteRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::DeleteRequest;
/// let x = DeleteRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = DeleteRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policy_rules::DeleteRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::DeleteRequest;
/// let x = DeleteRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [response_policy][crate::model::response_policy_rules::DeleteRequest::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::DeleteRequest;
/// let x = DeleteRequest::new().set_response_policy("example");
/// ```
pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy = v.into();
self
}
/// Sets the value of [response_policy_rule][crate::model::response_policy_rules::DeleteRequest::response_policy_rule].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::DeleteRequest;
/// let x = DeleteRequest::new().set_response_policy_rule("example");
/// ```
pub fn set_response_policy_rule<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy_rule = v.into();
self
}
}
/// Synthetic request message for the [get()][.responsePolicyRules.get] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// User assigned name of the Response Policy containing the Response Policy Rule.
pub response_policy: std::string::String,
/// User assigned name of the Response Policy Rule addressed by this request.
pub response_policy_rule: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::response_policy_rules::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::GetRequest;
/// let x = GetRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::GetRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::GetRequest;
/// let x = GetRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = GetRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policy_rules::GetRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::GetRequest;
/// let x = GetRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [response_policy][crate::model::response_policy_rules::GetRequest::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::GetRequest;
/// let x = GetRequest::new().set_response_policy("example");
/// ```
pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy = v.into();
self
}
/// Sets the value of [response_policy_rule][crate::model::response_policy_rules::GetRequest::response_policy_rule].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::GetRequest;
/// let x = GetRequest::new().set_response_policy_rule("example");
/// ```
pub fn set_response_policy_rule<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy_rule = v.into();
self
}
}
/// Synthetic request message for the [list()][.responsePolicyRules.list] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRequest {
/// Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
pub max_results: std::option::Option<i32>,
/// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
pub page_token: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// User assigned name of the Response Policy to list.
pub response_policy: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [max_results][crate::model::response_policy_rules::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
/// let x = ListRequest::new().set_max_results(42);
/// ```
pub fn set_max_results<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [max_results][crate::model::response_policy_rules::ListRequest::max_results].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
/// let x = ListRequest::new().set_or_clear_max_results(Some(42));
/// let x = ListRequest::new().set_or_clear_max_results(None::<i32>);
/// ```
pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.max_results = v.map(|x| x.into());
self
}
/// Sets the value of [page_token][crate::model::response_policy_rules::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
/// let x = ListRequest::new().set_page_token("example");
/// ```
pub fn set_page_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [page_token][crate::model::response_policy_rules::ListRequest::page_token].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
/// let x = ListRequest::new().set_or_clear_page_token(Some("example"));
/// let x = ListRequest::new().set_or_clear_page_token(None::<String>);
/// ```
pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.page_token = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policy_rules::ListRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
/// let x = ListRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [response_policy][crate::model::response_policy_rules::ListRequest::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::ListRequest;
/// let x = ListRequest::new().set_response_policy("example");
/// ```
pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy = v.into();
self
}
}
/// Synthetic request message for the [patch()][.responsePolicyRules.patch] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PatchRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// User assigned name of the Response Policy containing the Response Policy Rule.
pub response_policy: std::string::String,
/// User assigned name of the Response Policy Rule addressed by this request.
pub response_policy_rule: std::string::String,
/// Synthetic request body field for the [patch()][.responsePolicyRules.patch] method.
pub body: std::option::Option<crate::model::ResponsePolicyRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PatchRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::response_policy_rules::PatchRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
/// let x = PatchRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::PatchRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
/// let x = PatchRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = PatchRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policy_rules::PatchRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
/// let x = PatchRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [response_policy][crate::model::response_policy_rules::PatchRequest::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
/// let x = PatchRequest::new().set_response_policy("example");
/// ```
pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy = v.into();
self
}
/// Sets the value of [response_policy_rule][crate::model::response_policy_rules::PatchRequest::response_policy_rule].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
/// let x = PatchRequest::new().set_response_policy_rule("example");
/// ```
pub fn set_response_policy_rule<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy_rule = v.into();
self
}
/// Sets the value of [body][crate::model::response_policy_rules::PatchRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
/// use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = PatchRequest::new().set_body(ResponsePolicyRule::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRule>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::response_policy_rules::PatchRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::PatchRequest;
/// use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = PatchRequest::new().set_or_clear_body(Some(ResponsePolicyRule::default()/* use setters */));
/// let x = PatchRequest::new().set_or_clear_body(None::<ResponsePolicyRule>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRule>,
{
self.body = v.map(|x| x.into());
self
}
}
/// Synthetic request message for the [update()][.responsePolicyRules.update] method.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateRequest {
/// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
pub client_operation_id: std::option::Option<std::string::String>,
/// Identifies the project addressed by this request.
pub project: std::string::String,
/// User assigned name of the Response Policy containing the Response Policy Rule.
pub response_policy: std::string::String,
/// User assigned name of the Response Policy Rule addressed by this request.
pub response_policy_rule: std::string::String,
/// Synthetic request body field for the [update()][.responsePolicyRules.update] method.
pub body: std::option::Option<crate::model::ResponsePolicyRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
/// Sets the value of [client_operation_id][crate::model::response_policy_rules::UpdateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
/// let x = UpdateRequest::new().set_client_operation_id("example");
/// ```
pub fn set_client_operation_id<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [client_operation_id][crate::model::response_policy_rules::UpdateRequest::client_operation_id].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
/// let x = UpdateRequest::new().set_or_clear_client_operation_id(Some("example"));
/// let x = UpdateRequest::new().set_or_clear_client_operation_id(None::<String>);
/// ```
pub fn set_or_clear_client_operation_id<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.client_operation_id = v.map(|x| x.into());
self
}
/// Sets the value of [project][crate::model::response_policy_rules::UpdateRequest::project].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
/// let x = UpdateRequest::new().set_project("example");
/// ```
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
/// Sets the value of [response_policy][crate::model::response_policy_rules::UpdateRequest::response_policy].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
/// let x = UpdateRequest::new().set_response_policy("example");
/// ```
pub fn set_response_policy<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy = v.into();
self
}
/// Sets the value of [response_policy_rule][crate::model::response_policy_rules::UpdateRequest::response_policy_rule].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
/// let x = UpdateRequest::new().set_response_policy_rule("example");
/// ```
pub fn set_response_policy_rule<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.response_policy_rule = v.into();
self
}
/// Sets the value of [body][crate::model::response_policy_rules::UpdateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
/// use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = UpdateRequest::new().set_body(ResponsePolicyRule::default()/* use setters */);
/// ```
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRule>,
{
self.body = std::option::Option::Some(v.into());
self
}
/// Sets or clears the value of [body][crate::model::response_policy_rules::UpdateRequest::body].
///
/// # Example
/// ```ignore,no_run
/// # use google_cloud_dns_v1::model::response_policy_rules::UpdateRequest;
/// use google_cloud_dns_v1::model::ResponsePolicyRule;
/// let x = UpdateRequest::new().set_or_clear_body(Some(ResponsePolicyRule::default()/* use setters */));
/// let x = UpdateRequest::new().set_or_clear_body(None::<ResponsePolicyRule>);
/// ```
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResponsePolicyRule>,
{
self.body = v.map(|x| x.into());
self
}
}
}