#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct DnisEmergencyCallingConfiguration {
pub emergency_phone_number: ::std::string::String,
pub test_phone_number: ::std::option::Option<::std::string::String>,
pub calling_country: ::std::string::String,
}
impl DnisEmergencyCallingConfiguration {
pub fn emergency_phone_number(&self) -> &str {
use std::ops::Deref;
self.emergency_phone_number.deref()
}
pub fn test_phone_number(&self) -> ::std::option::Option<&str> {
self.test_phone_number.as_deref()
}
pub fn calling_country(&self) -> &str {
use std::ops::Deref;
self.calling_country.deref()
}
}
impl ::std::fmt::Debug for DnisEmergencyCallingConfiguration {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("DnisEmergencyCallingConfiguration");
formatter.field("emergency_phone_number", &"*** Sensitive Data Redacted ***");
formatter.field("test_phone_number", &"*** Sensitive Data Redacted ***");
formatter.field("calling_country", &self.calling_country);
formatter.finish()
}
}
impl DnisEmergencyCallingConfiguration {
pub fn builder() -> crate::types::builders::DnisEmergencyCallingConfigurationBuilder {
crate::types::builders::DnisEmergencyCallingConfigurationBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct DnisEmergencyCallingConfigurationBuilder {
pub(crate) emergency_phone_number: ::std::option::Option<::std::string::String>,
pub(crate) test_phone_number: ::std::option::Option<::std::string::String>,
pub(crate) calling_country: ::std::option::Option<::std::string::String>,
}
impl DnisEmergencyCallingConfigurationBuilder {
pub fn emergency_phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.emergency_phone_number = ::std::option::Option::Some(input.into());
self
}
pub fn set_emergency_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.emergency_phone_number = input;
self
}
pub fn get_emergency_phone_number(&self) -> &::std::option::Option<::std::string::String> {
&self.emergency_phone_number
}
pub fn test_phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.test_phone_number = ::std::option::Option::Some(input.into());
self
}
pub fn set_test_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.test_phone_number = input;
self
}
pub fn get_test_phone_number(&self) -> &::std::option::Option<::std::string::String> {
&self.test_phone_number
}
pub fn calling_country(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.calling_country = ::std::option::Option::Some(input.into());
self
}
pub fn set_calling_country(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.calling_country = input;
self
}
pub fn get_calling_country(&self) -> &::std::option::Option<::std::string::String> {
&self.calling_country
}
pub fn build(self) -> ::std::result::Result<crate::types::DnisEmergencyCallingConfiguration, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::DnisEmergencyCallingConfiguration {
emergency_phone_number: self.emergency_phone_number.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"emergency_phone_number",
"emergency_phone_number was not specified but it is required when building DnisEmergencyCallingConfiguration",
)
})?,
test_phone_number: self.test_phone_number,
calling_country: self.calling_country.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"calling_country",
"calling_country was not specified but it is required when building DnisEmergencyCallingConfiguration",
)
})?,
})
}
}
impl ::std::fmt::Debug for DnisEmergencyCallingConfigurationBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("DnisEmergencyCallingConfigurationBuilder");
formatter.field("emergency_phone_number", &"*** Sensitive Data Redacted ***");
formatter.field("test_phone_number", &"*** Sensitive Data Redacted ***");
formatter.field("calling_country", &self.calling_country);
formatter.finish()
}
}