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 100 101 102 103
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object that represents the DNS service discovery information for your virtual node.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DnsServiceDiscovery {
/// <p>Specifies the DNS service discovery hostname for the virtual node.</p>
pub hostname: ::std::string::String,
/// <p>Specifies the DNS response type for the virtual node.</p>
pub response_type: ::std::option::Option<crate::types::DnsResponseType>,
/// <p>The preferred IP version that this virtual node uses. Setting the IP preference on the virtual node only overrides the IP preference set for the mesh on this specific node.</p>
pub ip_preference: ::std::option::Option<crate::types::IpPreference>,
}
impl DnsServiceDiscovery {
/// <p>Specifies the DNS service discovery hostname for the virtual node.</p>
pub fn hostname(&self) -> &str {
use std::ops::Deref;
self.hostname.deref()
}
/// <p>Specifies the DNS response type for the virtual node.</p>
pub fn response_type(&self) -> ::std::option::Option<&crate::types::DnsResponseType> {
self.response_type.as_ref()
}
/// <p>The preferred IP version that this virtual node uses. Setting the IP preference on the virtual node only overrides the IP preference set for the mesh on this specific node.</p>
pub fn ip_preference(&self) -> ::std::option::Option<&crate::types::IpPreference> {
self.ip_preference.as_ref()
}
}
impl DnsServiceDiscovery {
/// Creates a new builder-style object to manufacture [`DnsServiceDiscovery`](crate::types::DnsServiceDiscovery).
pub fn builder() -> crate::types::builders::DnsServiceDiscoveryBuilder {
crate::types::builders::DnsServiceDiscoveryBuilder::default()
}
}
/// A builder for [`DnsServiceDiscovery`](crate::types::DnsServiceDiscovery).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct DnsServiceDiscoveryBuilder {
pub(crate) hostname: ::std::option::Option<::std::string::String>,
pub(crate) response_type: ::std::option::Option<crate::types::DnsResponseType>,
pub(crate) ip_preference: ::std::option::Option<crate::types::IpPreference>,
}
impl DnsServiceDiscoveryBuilder {
/// <p>Specifies the DNS service discovery hostname for the virtual node.</p>
/// This field is required.
pub fn hostname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.hostname = ::std::option::Option::Some(input.into());
self
}
/// <p>Specifies the DNS service discovery hostname for the virtual node.</p>
pub fn set_hostname(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.hostname = input;
self
}
/// <p>Specifies the DNS service discovery hostname for the virtual node.</p>
pub fn get_hostname(&self) -> &::std::option::Option<::std::string::String> {
&self.hostname
}
/// <p>Specifies the DNS response type for the virtual node.</p>
pub fn response_type(mut self, input: crate::types::DnsResponseType) -> Self {
self.response_type = ::std::option::Option::Some(input);
self
}
/// <p>Specifies the DNS response type for the virtual node.</p>
pub fn set_response_type(mut self, input: ::std::option::Option<crate::types::DnsResponseType>) -> Self {
self.response_type = input;
self
}
/// <p>Specifies the DNS response type for the virtual node.</p>
pub fn get_response_type(&self) -> &::std::option::Option<crate::types::DnsResponseType> {
&self.response_type
}
/// <p>The preferred IP version that this virtual node uses. Setting the IP preference on the virtual node only overrides the IP preference set for the mesh on this specific node.</p>
pub fn ip_preference(mut self, input: crate::types::IpPreference) -> Self {
self.ip_preference = ::std::option::Option::Some(input);
self
}
/// <p>The preferred IP version that this virtual node uses. Setting the IP preference on the virtual node only overrides the IP preference set for the mesh on this specific node.</p>
pub fn set_ip_preference(mut self, input: ::std::option::Option<crate::types::IpPreference>) -> Self {
self.ip_preference = input;
self
}
/// <p>The preferred IP version that this virtual node uses. Setting the IP preference on the virtual node only overrides the IP preference set for the mesh on this specific node.</p>
pub fn get_ip_preference(&self) -> &::std::option::Option<crate::types::IpPreference> {
&self.ip_preference
}
/// Consumes the builder and constructs a [`DnsServiceDiscovery`](crate::types::DnsServiceDiscovery).
/// This method will fail if any of the following fields are not set:
/// - [`hostname`](crate::types::builders::DnsServiceDiscoveryBuilder::hostname)
pub fn build(self) -> ::std::result::Result<crate::types::DnsServiceDiscovery, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::DnsServiceDiscovery {
hostname: self.hostname.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"hostname",
"hostname was not specified but it is required when building DnsServiceDiscovery",
)
})?,
response_type: self.response_type,
ip_preference: self.ip_preference,
})
}
}