aws_sdk_pinpoint/types/
_number_validate_response.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides information about a phone number.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct NumberValidateResponse {
7    /// <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>
8    pub carrier: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the city where the phone number was originally registered.</p>
10    pub city: ::std::option::Option<::std::string::String>,
11    /// <p>The cleansed phone number, in E.164 format, for the location where the phone number was originally registered.</p>
12    pub cleansed_phone_number_e164: ::std::option::Option<::std::string::String>,
13    /// <p>The cleansed phone number, in the format for the location where the phone number was originally registered.</p>
14    pub cleansed_phone_number_national: ::std::option::Option<::std::string::String>,
15    /// <p>The name of the country or region where the phone number was originally registered.</p>
16    pub country: ::std::option::Option<::std::string::String>,
17    /// <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>
18    pub country_code_iso2: ::std::option::Option<::std::string::String>,
19    /// <p>The numeric code for the country or region where the phone number was originally registered.</p>
20    pub country_code_numeric: ::std::option::Option<::std::string::String>,
21    /// <p>The name of the county where the phone number was originally registered.</p>
22    pub county: ::std::option::Option<::std::string::String>,
23    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, that was sent in the request body.</p>
24    pub original_country_code_iso2: ::std::option::Option<::std::string::String>,
25    /// <p>The phone number that was sent in the request body.</p>
26    pub original_phone_number: ::std::option::Option<::std::string::String>,
27    /// <p>The description of the phone type. Valid values are: MOBILE, LANDLINE, VOIP, INVALID, PREPAID, and OTHER.</p>
28    pub phone_type: ::std::option::Option<::std::string::String>,
29    /// <p>The phone type, represented by an integer. Valid values are: 0 (mobile), 1 (landline), 2 (VoIP), 3 (invalid), 4 (other), and 5 (prepaid).</p>
30    pub phone_type_code: ::std::option::Option<i32>,
31    /// <p>The time zone for the location where the phone number was originally registered.</p>
32    pub timezone: ::std::option::Option<::std::string::String>,
33    /// <p>The postal or ZIP code for the location where the phone number was originally registered.</p>
34    pub zip_code: ::std::option::Option<::std::string::String>,
35}
36impl NumberValidateResponse {
37    /// <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>
38    pub fn carrier(&self) -> ::std::option::Option<&str> {
39        self.carrier.as_deref()
40    }
41    /// <p>The name of the city where the phone number was originally registered.</p>
42    pub fn city(&self) -> ::std::option::Option<&str> {
43        self.city.as_deref()
44    }
45    /// <p>The cleansed phone number, in E.164 format, for the location where the phone number was originally registered.</p>
46    pub fn cleansed_phone_number_e164(&self) -> ::std::option::Option<&str> {
47        self.cleansed_phone_number_e164.as_deref()
48    }
49    /// <p>The cleansed phone number, in the format for the location where the phone number was originally registered.</p>
50    pub fn cleansed_phone_number_national(&self) -> ::std::option::Option<&str> {
51        self.cleansed_phone_number_national.as_deref()
52    }
53    /// <p>The name of the country or region where the phone number was originally registered.</p>
54    pub fn country(&self) -> ::std::option::Option<&str> {
55        self.country.as_deref()
56    }
57    /// <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>
58    pub fn country_code_iso2(&self) -> ::std::option::Option<&str> {
59        self.country_code_iso2.as_deref()
60    }
61    /// <p>The numeric code for the country or region where the phone number was originally registered.</p>
62    pub fn country_code_numeric(&self) -> ::std::option::Option<&str> {
63        self.country_code_numeric.as_deref()
64    }
65    /// <p>The name of the county where the phone number was originally registered.</p>
66    pub fn county(&self) -> ::std::option::Option<&str> {
67        self.county.as_deref()
68    }
69    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, that was sent in the request body.</p>
70    pub fn original_country_code_iso2(&self) -> ::std::option::Option<&str> {
71        self.original_country_code_iso2.as_deref()
72    }
73    /// <p>The phone number that was sent in the request body.</p>
74    pub fn original_phone_number(&self) -> ::std::option::Option<&str> {
75        self.original_phone_number.as_deref()
76    }
77    /// <p>The description of the phone type. Valid values are: MOBILE, LANDLINE, VOIP, INVALID, PREPAID, and OTHER.</p>
78    pub fn phone_type(&self) -> ::std::option::Option<&str> {
79        self.phone_type.as_deref()
80    }
81    /// <p>The phone type, represented by an integer. Valid values are: 0 (mobile), 1 (landline), 2 (VoIP), 3 (invalid), 4 (other), and 5 (prepaid).</p>
82    pub fn phone_type_code(&self) -> ::std::option::Option<i32> {
83        self.phone_type_code
84    }
85    /// <p>The time zone for the location where the phone number was originally registered.</p>
86    pub fn timezone(&self) -> ::std::option::Option<&str> {
87        self.timezone.as_deref()
88    }
89    /// <p>The postal or ZIP code for the location where the phone number was originally registered.</p>
90    pub fn zip_code(&self) -> ::std::option::Option<&str> {
91        self.zip_code.as_deref()
92    }
93}
94impl NumberValidateResponse {
95    /// Creates a new builder-style object to manufacture [`NumberValidateResponse`](crate::types::NumberValidateResponse).
96    pub fn builder() -> crate::types::builders::NumberValidateResponseBuilder {
97        crate::types::builders::NumberValidateResponseBuilder::default()
98    }
99}
100
101/// A builder for [`NumberValidateResponse`](crate::types::NumberValidateResponse).
102#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
103#[non_exhaustive]
104pub struct NumberValidateResponseBuilder {
105    pub(crate) carrier: ::std::option::Option<::std::string::String>,
106    pub(crate) city: ::std::option::Option<::std::string::String>,
107    pub(crate) cleansed_phone_number_e164: ::std::option::Option<::std::string::String>,
108    pub(crate) cleansed_phone_number_national: ::std::option::Option<::std::string::String>,
109    pub(crate) country: ::std::option::Option<::std::string::String>,
110    pub(crate) country_code_iso2: ::std::option::Option<::std::string::String>,
111    pub(crate) country_code_numeric: ::std::option::Option<::std::string::String>,
112    pub(crate) county: ::std::option::Option<::std::string::String>,
113    pub(crate) original_country_code_iso2: ::std::option::Option<::std::string::String>,
114    pub(crate) original_phone_number: ::std::option::Option<::std::string::String>,
115    pub(crate) phone_type: ::std::option::Option<::std::string::String>,
116    pub(crate) phone_type_code: ::std::option::Option<i32>,
117    pub(crate) timezone: ::std::option::Option<::std::string::String>,
118    pub(crate) zip_code: ::std::option::Option<::std::string::String>,
119}
120impl NumberValidateResponseBuilder {
121    /// <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>
122    pub fn carrier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.carrier = ::std::option::Option::Some(input.into());
124        self
125    }
126    /// <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>
127    pub fn set_carrier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.carrier = input;
129        self
130    }
131    /// <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>
132    pub fn get_carrier(&self) -> &::std::option::Option<::std::string::String> {
133        &self.carrier
134    }
135    /// <p>The name of the city where the phone number was originally registered.</p>
136    pub fn city(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.city = ::std::option::Option::Some(input.into());
138        self
139    }
140    /// <p>The name of the city where the phone number was originally registered.</p>
141    pub fn set_city(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.city = input;
143        self
144    }
145    /// <p>The name of the city where the phone number was originally registered.</p>
146    pub fn get_city(&self) -> &::std::option::Option<::std::string::String> {
147        &self.city
148    }
149    /// <p>The cleansed phone number, in E.164 format, for the location where the phone number was originally registered.</p>
150    pub fn cleansed_phone_number_e164(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.cleansed_phone_number_e164 = ::std::option::Option::Some(input.into());
152        self
153    }
154    /// <p>The cleansed phone number, in E.164 format, for the location where the phone number was originally registered.</p>
155    pub fn set_cleansed_phone_number_e164(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.cleansed_phone_number_e164 = input;
157        self
158    }
159    /// <p>The cleansed phone number, in E.164 format, for the location where the phone number was originally registered.</p>
160    pub fn get_cleansed_phone_number_e164(&self) -> &::std::option::Option<::std::string::String> {
161        &self.cleansed_phone_number_e164
162    }
163    /// <p>The cleansed phone number, in the format for the location where the phone number was originally registered.</p>
164    pub fn cleansed_phone_number_national(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.cleansed_phone_number_national = ::std::option::Option::Some(input.into());
166        self
167    }
168    /// <p>The cleansed phone number, in the format for the location where the phone number was originally registered.</p>
169    pub fn set_cleansed_phone_number_national(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.cleansed_phone_number_national = input;
171        self
172    }
173    /// <p>The cleansed phone number, in the format for the location where the phone number was originally registered.</p>
174    pub fn get_cleansed_phone_number_national(&self) -> &::std::option::Option<::std::string::String> {
175        &self.cleansed_phone_number_national
176    }
177    /// <p>The name of the country or region where the phone number was originally registered.</p>
178    pub fn country(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.country = ::std::option::Option::Some(input.into());
180        self
181    }
182    /// <p>The name of the country or region where the phone number was originally registered.</p>
183    pub fn set_country(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.country = input;
185        self
186    }
187    /// <p>The name of the country or region where the phone number was originally registered.</p>
188    pub fn get_country(&self) -> &::std::option::Option<::std::string::String> {
189        &self.country
190    }
191    /// <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>
192    pub fn country_code_iso2(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.country_code_iso2 = ::std::option::Option::Some(input.into());
194        self
195    }
196    /// <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>
197    pub fn set_country_code_iso2(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198        self.country_code_iso2 = input;
199        self
200    }
201    /// <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>
202    pub fn get_country_code_iso2(&self) -> &::std::option::Option<::std::string::String> {
203        &self.country_code_iso2
204    }
205    /// <p>The numeric code for the country or region where the phone number was originally registered.</p>
206    pub fn country_code_numeric(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.country_code_numeric = ::std::option::Option::Some(input.into());
208        self
209    }
210    /// <p>The numeric code for the country or region where the phone number was originally registered.</p>
211    pub fn set_country_code_numeric(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.country_code_numeric = input;
213        self
214    }
215    /// <p>The numeric code for the country or region where the phone number was originally registered.</p>
216    pub fn get_country_code_numeric(&self) -> &::std::option::Option<::std::string::String> {
217        &self.country_code_numeric
218    }
219    /// <p>The name of the county where the phone number was originally registered.</p>
220    pub fn county(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
221        self.county = ::std::option::Option::Some(input.into());
222        self
223    }
224    /// <p>The name of the county where the phone number was originally registered.</p>
225    pub fn set_county(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
226        self.county = input;
227        self
228    }
229    /// <p>The name of the county where the phone number was originally registered.</p>
230    pub fn get_county(&self) -> &::std::option::Option<::std::string::String> {
231        &self.county
232    }
233    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, that was sent in the request body.</p>
234    pub fn original_country_code_iso2(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.original_country_code_iso2 = ::std::option::Option::Some(input.into());
236        self
237    }
238    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, that was sent in the request body.</p>
239    pub fn set_original_country_code_iso2(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240        self.original_country_code_iso2 = input;
241        self
242    }
243    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, that was sent in the request body.</p>
244    pub fn get_original_country_code_iso2(&self) -> &::std::option::Option<::std::string::String> {
245        &self.original_country_code_iso2
246    }
247    /// <p>The phone number that was sent in the request body.</p>
248    pub fn original_phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
249        self.original_phone_number = ::std::option::Option::Some(input.into());
250        self
251    }
252    /// <p>The phone number that was sent in the request body.</p>
253    pub fn set_original_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
254        self.original_phone_number = input;
255        self
256    }
257    /// <p>The phone number that was sent in the request body.</p>
258    pub fn get_original_phone_number(&self) -> &::std::option::Option<::std::string::String> {
259        &self.original_phone_number
260    }
261    /// <p>The description of the phone type. Valid values are: MOBILE, LANDLINE, VOIP, INVALID, PREPAID, and OTHER.</p>
262    pub fn phone_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
263        self.phone_type = ::std::option::Option::Some(input.into());
264        self
265    }
266    /// <p>The description of the phone type. Valid values are: MOBILE, LANDLINE, VOIP, INVALID, PREPAID, and OTHER.</p>
267    pub fn set_phone_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268        self.phone_type = input;
269        self
270    }
271    /// <p>The description of the phone type. Valid values are: MOBILE, LANDLINE, VOIP, INVALID, PREPAID, and OTHER.</p>
272    pub fn get_phone_type(&self) -> &::std::option::Option<::std::string::String> {
273        &self.phone_type
274    }
275    /// <p>The phone type, represented by an integer. Valid values are: 0 (mobile), 1 (landline), 2 (VoIP), 3 (invalid), 4 (other), and 5 (prepaid).</p>
276    pub fn phone_type_code(mut self, input: i32) -> Self {
277        self.phone_type_code = ::std::option::Option::Some(input);
278        self
279    }
280    /// <p>The phone type, represented by an integer. Valid values are: 0 (mobile), 1 (landline), 2 (VoIP), 3 (invalid), 4 (other), and 5 (prepaid).</p>
281    pub fn set_phone_type_code(mut self, input: ::std::option::Option<i32>) -> Self {
282        self.phone_type_code = input;
283        self
284    }
285    /// <p>The phone type, represented by an integer. Valid values are: 0 (mobile), 1 (landline), 2 (VoIP), 3 (invalid), 4 (other), and 5 (prepaid).</p>
286    pub fn get_phone_type_code(&self) -> &::std::option::Option<i32> {
287        &self.phone_type_code
288    }
289    /// <p>The time zone for the location where the phone number was originally registered.</p>
290    pub fn timezone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
291        self.timezone = ::std::option::Option::Some(input.into());
292        self
293    }
294    /// <p>The time zone for the location where the phone number was originally registered.</p>
295    pub fn set_timezone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
296        self.timezone = input;
297        self
298    }
299    /// <p>The time zone for the location where the phone number was originally registered.</p>
300    pub fn get_timezone(&self) -> &::std::option::Option<::std::string::String> {
301        &self.timezone
302    }
303    /// <p>The postal or ZIP code for the location where the phone number was originally registered.</p>
304    pub fn zip_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
305        self.zip_code = ::std::option::Option::Some(input.into());
306        self
307    }
308    /// <p>The postal or ZIP code for the location where the phone number was originally registered.</p>
309    pub fn set_zip_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
310        self.zip_code = input;
311        self
312    }
313    /// <p>The postal or ZIP code for the location where the phone number was originally registered.</p>
314    pub fn get_zip_code(&self) -> &::std::option::Option<::std::string::String> {
315        &self.zip_code
316    }
317    /// Consumes the builder and constructs a [`NumberValidateResponse`](crate::types::NumberValidateResponse).
318    pub fn build(self) -> crate::types::NumberValidateResponse {
319        crate::types::NumberValidateResponse {
320            carrier: self.carrier,
321            city: self.city,
322            cleansed_phone_number_e164: self.cleansed_phone_number_e164,
323            cleansed_phone_number_national: self.cleansed_phone_number_national,
324            country: self.country,
325            country_code_iso2: self.country_code_iso2,
326            country_code_numeric: self.country_code_numeric,
327            county: self.county,
328            original_country_code_iso2: self.original_country_code_iso2,
329            original_phone_number: self.original_phone_number,
330            phone_type: self.phone_type,
331            phone_type_code: self.phone_type_code,
332            timezone: self.timezone,
333            zip_code: self.zip_code,
334        }
335    }
336}