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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The Dialed Number Identification Service (DNIS) emergency calling configuration details associated with an Amazon Chime Voice Connector's emergency calling configuration.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct DnisEmergencyCallingConfiguration {
    /// <p>The DNIS phone number to route emergency calls to, in E.164 format.</p>
    pub emergency_phone_number: ::std::string::String,
    /// <p>The DNIS phone number to route test emergency calls to, in E.164 format.</p>
    pub test_phone_number: ::std::option::Option<::std::string::String>,
    /// <p>The country from which emergency calls are allowed, in ISO 3166-1 alpha-2 format.</p>
    pub calling_country: ::std::string::String,
}
impl DnisEmergencyCallingConfiguration {
    /// <p>The DNIS phone number to route emergency calls to, in E.164 format.</p>
    pub fn emergency_phone_number(&self) -> &str {
        use std::ops::Deref;
        self.emergency_phone_number.deref()
    }
    /// <p>The DNIS phone number to route test emergency calls to, in E.164 format.</p>
    pub fn test_phone_number(&self) -> ::std::option::Option<&str> {
        self.test_phone_number.as_deref()
    }
    /// <p>The country from which emergency calls are allowed, in ISO 3166-1 alpha-2 format.</p>
    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 {
    /// Creates a new builder-style object to manufacture [`DnisEmergencyCallingConfiguration`](crate::types::DnisEmergencyCallingConfiguration).
    pub fn builder() -> crate::types::builders::DnisEmergencyCallingConfigurationBuilder {
        crate::types::builders::DnisEmergencyCallingConfigurationBuilder::default()
    }
}

/// A builder for [`DnisEmergencyCallingConfiguration`](crate::types::DnisEmergencyCallingConfiguration).
#[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 {
    /// <p>The DNIS phone number to route emergency calls to, in E.164 format.</p>
    /// This field is required.
    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
    }
    /// <p>The DNIS phone number to route emergency calls to, in E.164 format.</p>
    pub fn set_emergency_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.emergency_phone_number = input;
        self
    }
    /// <p>The DNIS phone number to route emergency calls to, in E.164 format.</p>
    pub fn get_emergency_phone_number(&self) -> &::std::option::Option<::std::string::String> {
        &self.emergency_phone_number
    }
    /// <p>The DNIS phone number to route test emergency calls to, in E.164 format.</p>
    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
    }
    /// <p>The DNIS phone number to route test emergency calls to, in E.164 format.</p>
    pub fn set_test_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.test_phone_number = input;
        self
    }
    /// <p>The DNIS phone number to route test emergency calls to, in E.164 format.</p>
    pub fn get_test_phone_number(&self) -> &::std::option::Option<::std::string::String> {
        &self.test_phone_number
    }
    /// <p>The country from which emergency calls are allowed, in ISO 3166-1 alpha-2 format.</p>
    /// This field is required.
    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
    }
    /// <p>The country from which emergency calls are allowed, in ISO 3166-1 alpha-2 format.</p>
    pub fn set_calling_country(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.calling_country = input;
        self
    }
    /// <p>The country from which emergency calls are allowed, in ISO 3166-1 alpha-2 format.</p>
    pub fn get_calling_country(&self) -> &::std::option::Option<::std::string::String> {
        &self.calling_country
    }
    /// Consumes the builder and constructs a [`DnisEmergencyCallingConfiguration`](crate::types::DnisEmergencyCallingConfiguration).
    /// This method will fail if any of the following fields are not set:
    /// - [`emergency_phone_number`](crate::types::builders::DnisEmergencyCallingConfigurationBuilder::emergency_phone_number)
    /// - [`calling_country`](crate::types::builders::DnisEmergencyCallingConfigurationBuilder::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()
    }
}