aws_sdk_pinpointsmsvoicev2/operation/carrier_lookup/
_carrier_lookup_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CarrierLookupOutput {
6 pub e164_phone_number: ::std::string::String,
8 pub dialing_country_code: ::std::option::Option<::std::string::String>,
10 pub iso_country_code: ::std::option::Option<::std::string::String>,
12 pub country: ::std::option::Option<::std::string::String>,
14 pub mcc: ::std::option::Option<::std::string::String>,
16 pub mnc: ::std::option::Option<::std::string::String>,
18 pub carrier: ::std::option::Option<::std::string::String>,
20 pub phone_number_type: crate::types::PhoneNumberType,
22 _request_id: Option<String>,
23}
24impl CarrierLookupOutput {
25 pub fn e164_phone_number(&self) -> &str {
27 use std::ops::Deref;
28 self.e164_phone_number.deref()
29 }
30 pub fn dialing_country_code(&self) -> ::std::option::Option<&str> {
32 self.dialing_country_code.as_deref()
33 }
34 pub fn iso_country_code(&self) -> ::std::option::Option<&str> {
36 self.iso_country_code.as_deref()
37 }
38 pub fn country(&self) -> ::std::option::Option<&str> {
40 self.country.as_deref()
41 }
42 pub fn mcc(&self) -> ::std::option::Option<&str> {
44 self.mcc.as_deref()
45 }
46 pub fn mnc(&self) -> ::std::option::Option<&str> {
48 self.mnc.as_deref()
49 }
50 pub fn carrier(&self) -> ::std::option::Option<&str> {
52 self.carrier.as_deref()
53 }
54 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 pub fn builder() -> crate::operation::carrier_lookup::builders::CarrierLookupOutputBuilder {
67 crate::operation::carrier_lookup::builders::CarrierLookupOutputBuilder::default()
68 }
69}
70
71#[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 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 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 pub fn get_e164_phone_number(&self) -> &::std::option::Option<::std::string::String> {
99 &self.e164_phone_number
100 }
101 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 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 pub fn get_dialing_country_code(&self) -> &::std::option::Option<::std::string::String> {
113 &self.dialing_country_code
114 }
115 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 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 pub fn get_iso_country_code(&self) -> &::std::option::Option<::std::string::String> {
127 &self.iso_country_code
128 }
129 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 pub fn set_country(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.country = input;
137 self
138 }
139 pub fn get_country(&self) -> &::std::option::Option<::std::string::String> {
141 &self.country
142 }
143 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 pub fn set_mcc(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.mcc = input;
151 self
152 }
153 pub fn get_mcc(&self) -> &::std::option::Option<::std::string::String> {
155 &self.mcc
156 }
157 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 pub fn set_mnc(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164 self.mnc = input;
165 self
166 }
167 pub fn get_mnc(&self) -> &::std::option::Option<::std::string::String> {
169 &self.mnc
170 }
171 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 pub fn set_carrier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178 self.carrier = input;
179 self
180 }
181 pub fn get_carrier(&self) -> &::std::option::Option<::std::string::String> {
183 &self.carrier
184 }
185 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 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 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 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}