1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Name server includes the following elements.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Nameserver {
/// <p>The fully qualified host name of the name server.</p>
/// <p>Constraint: Maximum 255 characters</p>
pub name: ::std::string::String,
/// <p>Glue IP address of a name server entry. Glue IP addresses are required only when the name of the name server is a subdomain of the domain. For example, if your domain is example.com and the name server for the domain is ns.example.com, you need to specify the IP address for ns.example.com.</p>
/// <p>Constraints: The list can contain only one IPv4 and one IPv6 address.</p>
pub glue_ips: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Nameserver {
/// <p>The fully qualified host name of the name server.</p>
/// <p>Constraint: Maximum 255 characters</p>
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
/// <p>Glue IP address of a name server entry. Glue IP addresses are required only when the name of the name server is a subdomain of the domain. For example, if your domain is example.com and the name server for the domain is ns.example.com, you need to specify the IP address for ns.example.com.</p>
/// <p>Constraints: The list can contain only one IPv4 and one IPv6 address.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.glue_ips.is_none()`.
pub fn glue_ips(&self) -> &[::std::string::String] {
self.glue_ips.as_deref().unwrap_or_default()
}
}
impl Nameserver {
/// Creates a new builder-style object to manufacture [`Nameserver`](crate::types::Nameserver).
pub fn builder() -> crate::types::builders::NameserverBuilder {
crate::types::builders::NameserverBuilder::default()
}
}
/// A builder for [`Nameserver`](crate::types::Nameserver).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct NameserverBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) glue_ips: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl NameserverBuilder {
/// <p>The fully qualified host name of the name server.</p>
/// <p>Constraint: Maximum 255 characters</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The fully qualified host name of the name server.</p>
/// <p>Constraint: Maximum 255 characters</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The fully qualified host name of the name server.</p>
/// <p>Constraint: Maximum 255 characters</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// Appends an item to `glue_ips`.
///
/// To override the contents of this collection use [`set_glue_ips`](Self::set_glue_ips).
///
/// <p>Glue IP address of a name server entry. Glue IP addresses are required only when the name of the name server is a subdomain of the domain. For example, if your domain is example.com and the name server for the domain is ns.example.com, you need to specify the IP address for ns.example.com.</p>
/// <p>Constraints: The list can contain only one IPv4 and one IPv6 address.</p>
pub fn glue_ips(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.glue_ips.unwrap_or_default();
v.push(input.into());
self.glue_ips = ::std::option::Option::Some(v);
self
}
/// <p>Glue IP address of a name server entry. Glue IP addresses are required only when the name of the name server is a subdomain of the domain. For example, if your domain is example.com and the name server for the domain is ns.example.com, you need to specify the IP address for ns.example.com.</p>
/// <p>Constraints: The list can contain only one IPv4 and one IPv6 address.</p>
pub fn set_glue_ips(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.glue_ips = input;
self
}
/// <p>Glue IP address of a name server entry. Glue IP addresses are required only when the name of the name server is a subdomain of the domain. For example, if your domain is example.com and the name server for the domain is ns.example.com, you need to specify the IP address for ns.example.com.</p>
/// <p>Constraints: The list can contain only one IPv4 and one IPv6 address.</p>
pub fn get_glue_ips(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.glue_ips
}
/// Consumes the builder and constructs a [`Nameserver`](crate::types::Nameserver).
/// This method will fail if any of the following fields are not set:
/// - [`name`](crate::types::builders::NameserverBuilder::name)
pub fn build(self) -> ::std::result::Result<crate::types::Nameserver, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Nameserver {
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building Nameserver",
)
})?,
glue_ips: self.glue_ips,
})
}
}