aws_sdk_pinpointsmsvoicev2/operation/carrier_lookup/
_carrier_lookup_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CarrierLookupOutput {
6    /// <p>The phone number in E164 format, sanitized from the original input by removing any formatting characters.</p>
7    pub e164_phone_number: ::std::string::String,
8    /// <p>The numeric dialing code for the country or region where the phone number was originally registered.</p>
9    pub dialing_country_code: ::std::option::Option<::std::string::String>,
10    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region where the phone number was originally registered.</p>
11    pub iso_country_code: ::std::option::Option<::std::string::String>,
12    /// <p>The name of the country where the phone number was originally registered.</p>
13    pub country: ::std::option::Option<::std::string::String>,
14    /// <p>The phone number's mobile country code, for mobile phone number types</p>
15    pub mcc: ::std::option::Option<::std::string::String>,
16    /// <p>The phone number's mobile network code, for mobile phone number types.</p>
17    pub mnc: ::std::option::Option<::std::string::String>,
18    /// <p>The carrier or service provider that the phone number is currently registered with. In some countries and regions, this value may be the carrier or service provider that the phone number was originally registered with.</p>
19    pub carrier: ::std::option::Option<::std::string::String>,
20    /// <p>Describes the type of phone number. Valid values are: MOBILE, LANDLINE, OTHER, and INVALID. Avoid sending SMS or voice messages to INVALID phone numbers, as these numbers are unlikely to belong to actual recipients.</p>
21    pub phone_number_type: crate::types::PhoneNumberType,
22    _request_id: Option<String>,
23}
24impl CarrierLookupOutput {
25    /// <p>The phone number in E164 format, sanitized from the original input by removing any formatting characters.</p>
26    pub fn e164_phone_number(&self) -> &str {
27        use std::ops::Deref;
28        self.e164_phone_number.deref()
29    }
30    /// <p>The numeric dialing code for the country or region where the phone number was originally registered.</p>
31    pub fn dialing_country_code(&self) -> ::std::option::Option<&str> {
32        self.dialing_country_code.as_deref()
33    }
34    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region where the phone number was originally registered.</p>
35    pub fn iso_country_code(&self) -> ::std::option::Option<&str> {
36        self.iso_country_code.as_deref()
37    }
38    /// <p>The name of the country where the phone number was originally registered.</p>
39    pub fn country(&self) -> ::std::option::Option<&str> {
40        self.country.as_deref()
41    }
42    /// <p>The phone number's mobile country code, for mobile phone number types</p>
43    pub fn mcc(&self) -> ::std::option::Option<&str> {
44        self.mcc.as_deref()
45    }
46    /// <p>The phone number's mobile network code, for mobile phone number types.</p>
47    pub fn mnc(&self) -> ::std::option::Option<&str> {
48        self.mnc.as_deref()
49    }
50    /// <p>The carrier or service provider that the phone number is currently registered with. In some countries and regions, this value may be the carrier or service provider that the phone number was originally registered with.</p>
51    pub fn carrier(&self) -> ::std::option::Option<&str> {
52        self.carrier.as_deref()
53    }
54    /// <p>Describes the type of phone number. Valid values are: MOBILE, LANDLINE, OTHER, and INVALID. Avoid sending SMS or voice messages to INVALID phone numbers, as these numbers are unlikely to belong to actual recipients.</p>
55    pub fn phone_number_type(&self) -> &crate::types::PhoneNumberType {
56        &self.phone_number_type
57    }
58}
59impl ::aws_types::request_id::RequestId for CarrierLookupOutput {
60    fn request_id(&self) -> Option<&str> {
61        self._request_id.as_deref()
62    }
63}
64impl CarrierLookupOutput {
65    /// Creates a new builder-style object to manufacture [`CarrierLookupOutput`](crate::operation::carrier_lookup::CarrierLookupOutput).
66    pub fn builder() -> crate::operation::carrier_lookup::builders::CarrierLookupOutputBuilder {
67        crate::operation::carrier_lookup::builders::CarrierLookupOutputBuilder::default()
68    }
69}
70
71/// A builder for [`CarrierLookupOutput`](crate::operation::carrier_lookup::CarrierLookupOutput).
72#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
73#[non_exhaustive]
74pub struct CarrierLookupOutputBuilder {
75    pub(crate) e164_phone_number: ::std::option::Option<::std::string::String>,
76    pub(crate) dialing_country_code: ::std::option::Option<::std::string::String>,
77    pub(crate) iso_country_code: ::std::option::Option<::std::string::String>,
78    pub(crate) country: ::std::option::Option<::std::string::String>,
79    pub(crate) mcc: ::std::option::Option<::std::string::String>,
80    pub(crate) mnc: ::std::option::Option<::std::string::String>,
81    pub(crate) carrier: ::std::option::Option<::std::string::String>,
82    pub(crate) phone_number_type: ::std::option::Option<crate::types::PhoneNumberType>,
83    _request_id: Option<String>,
84}
85impl CarrierLookupOutputBuilder {
86    /// <p>The phone number in E164 format, sanitized from the original input by removing any formatting characters.</p>
87    /// This field is required.
88    pub fn e164_phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.e164_phone_number = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The phone number in E164 format, sanitized from the original input by removing any formatting characters.</p>
93    pub fn set_e164_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.e164_phone_number = input;
95        self
96    }
97    /// <p>The phone number in E164 format, sanitized from the original input by removing any formatting characters.</p>
98    pub fn get_e164_phone_number(&self) -> &::std::option::Option<::std::string::String> {
99        &self.e164_phone_number
100    }
101    /// <p>The numeric dialing code for the country or region where the phone number was originally registered.</p>
102    pub fn dialing_country_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.dialing_country_code = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The numeric dialing code for the country or region where the phone number was originally registered.</p>
107    pub fn set_dialing_country_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.dialing_country_code = input;
109        self
110    }
111    /// <p>The numeric dialing code for the country or region where the phone number was originally registered.</p>
112    pub fn get_dialing_country_code(&self) -> &::std::option::Option<::std::string::String> {
113        &self.dialing_country_code
114    }
115    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region where the phone number was originally registered.</p>
116    pub fn iso_country_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.iso_country_code = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region where the phone number was originally registered.</p>
121    pub fn set_iso_country_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.iso_country_code = input;
123        self
124    }
125    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region where the phone number was originally registered.</p>
126    pub fn get_iso_country_code(&self) -> &::std::option::Option<::std::string::String> {
127        &self.iso_country_code
128    }
129    /// <p>The name of the country where the phone number was originally registered.</p>
130    pub fn country(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.country = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>The name of the country where the phone number was originally registered.</p>
135    pub fn set_country(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.country = input;
137        self
138    }
139    /// <p>The name of the country where the phone number was originally registered.</p>
140    pub fn get_country(&self) -> &::std::option::Option<::std::string::String> {
141        &self.country
142    }
143    /// <p>The phone number's mobile country code, for mobile phone number types</p>
144    pub fn mcc(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.mcc = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>The phone number's mobile country code, for mobile phone number types</p>
149    pub fn set_mcc(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.mcc = input;
151        self
152    }
153    /// <p>The phone number's mobile country code, for mobile phone number types</p>
154    pub fn get_mcc(&self) -> &::std::option::Option<::std::string::String> {
155        &self.mcc
156    }
157    /// <p>The phone number's mobile network code, for mobile phone number types.</p>
158    pub fn mnc(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.mnc = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>The phone number's mobile network code, for mobile phone number types.</p>
163    pub fn set_mnc(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.mnc = input;
165        self
166    }
167    /// <p>The phone number's mobile network code, for mobile phone number types.</p>
168    pub fn get_mnc(&self) -> &::std::option::Option<::std::string::String> {
169        &self.mnc
170    }
171    /// <p>The carrier or service provider that the phone number is currently registered with. In some countries and regions, this value may be the carrier or service provider that the phone number was originally registered with.</p>
172    pub fn carrier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.carrier = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The carrier or service provider that the phone number is currently registered with. In some countries and regions, this value may be the carrier or service provider that the phone number was originally registered with.</p>
177    pub fn set_carrier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.carrier = input;
179        self
180    }
181    /// <p>The carrier or service provider that the phone number is currently registered with. In some countries and regions, this value may be the carrier or service provider that the phone number was originally registered with.</p>
182    pub fn get_carrier(&self) -> &::std::option::Option<::std::string::String> {
183        &self.carrier
184    }
185    /// <p>Describes the type of phone number. Valid values are: MOBILE, LANDLINE, OTHER, and INVALID. Avoid sending SMS or voice messages to INVALID phone numbers, as these numbers are unlikely to belong to actual recipients.</p>
186    /// This field is required.
187    pub fn phone_number_type(mut self, input: crate::types::PhoneNumberType) -> Self {
188        self.phone_number_type = ::std::option::Option::Some(input);
189        self
190    }
191    /// <p>Describes the type of phone number. Valid values are: MOBILE, LANDLINE, OTHER, and INVALID. Avoid sending SMS or voice messages to INVALID phone numbers, as these numbers are unlikely to belong to actual recipients.</p>
192    pub fn set_phone_number_type(mut self, input: ::std::option::Option<crate::types::PhoneNumberType>) -> Self {
193        self.phone_number_type = input;
194        self
195    }
196    /// <p>Describes the type of phone number. Valid values are: MOBILE, LANDLINE, OTHER, and INVALID. Avoid sending SMS or voice messages to INVALID phone numbers, as these numbers are unlikely to belong to actual recipients.</p>
197    pub fn get_phone_number_type(&self) -> &::std::option::Option<crate::types::PhoneNumberType> {
198        &self.phone_number_type
199    }
200    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
201        self._request_id = Some(request_id.into());
202        self
203    }
204
205    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
206        self._request_id = request_id;
207        self
208    }
209    /// Consumes the builder and constructs a [`CarrierLookupOutput`](crate::operation::carrier_lookup::CarrierLookupOutput).
210    /// This method will fail if any of the following fields are not set:
211    /// - [`e164_phone_number`](crate::operation::carrier_lookup::builders::CarrierLookupOutputBuilder::e164_phone_number)
212    /// - [`phone_number_type`](crate::operation::carrier_lookup::builders::CarrierLookupOutputBuilder::phone_number_type)
213    pub fn build(
214        self,
215    ) -> ::std::result::Result<crate::operation::carrier_lookup::CarrierLookupOutput, ::aws_smithy_types::error::operation::BuildError> {
216        ::std::result::Result::Ok(crate::operation::carrier_lookup::CarrierLookupOutput {
217            e164_phone_number: self.e164_phone_number.ok_or_else(|| {
218                ::aws_smithy_types::error::operation::BuildError::missing_field(
219                    "e164_phone_number",
220                    "e164_phone_number was not specified but it is required when building CarrierLookupOutput",
221                )
222            })?,
223            dialing_country_code: self.dialing_country_code,
224            iso_country_code: self.iso_country_code,
225            country: self.country,
226            mcc: self.mcc,
227            mnc: self.mnc,
228            carrier: self.carrier,
229            phone_number_type: self.phone_number_type.ok_or_else(|| {
230                ::aws_smithy_types::error::operation::BuildError::missing_field(
231                    "phone_number_type",
232                    "phone_number_type was not specified but it is required when building CarrierLookupOutput",
233                )
234            })?,
235            _request_id: self._request_id,
236        })
237    }
238}