aws_sdk_pinpointsmsvoicev2/operation/create_registration/_create_registration_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 CreateRegistrationOutput {
6 /// <p>The Amazon Resource Name (ARN) for the registration.</p>
7 pub registration_arn: ::std::string::String,
8 /// <p>The unique identifier for the registration.</p>
9 pub registration_id: ::std::string::String,
10 /// <p>The type of registration form to create. The list of <b>RegistrationTypes</b> can be found using the <code>DescribeRegistrationTypeDefinitions</code> action.</p>
11 pub registration_type: ::std::string::String,
12 /// <p>The status of the registration.</p>
13 /// <ul>
14 /// <li>
15 /// <p><code>CLOSED</code>: The phone number or sender ID has been deleted and you must also delete the registration for the number.</p></li>
16 /// <li>
17 /// <p><code>CREATED</code>: Your registration is created but not submitted.</p></li>
18 /// <li>
19 /// <p><code>COMPLETE</code>: Your registration has been approved and your origination identity has been created.</p></li>
20 /// <li>
21 /// <p><code>DELETED</code>: The registration has been deleted.</p></li>
22 /// <li>
23 /// <p><code>PROVISIONING</code>: Your registration has been approved and your origination identity is being created.</p></li>
24 /// <li>
25 /// <p><code>REQUIRES_AUTHENTICATION</code>: You need to complete email authentication.</p></li>
26 /// <li>
27 /// <p><code>REQUIRES_UPDATES</code>: You must fix your registration and resubmit it.</p></li>
28 /// <li>
29 /// <p><code>REVIEWING</code>: Your registration has been accepted and is being reviewed.</p></li>
30 /// <li>
31 /// <p><code>SUBMITTED</code>: Your registration has been submitted and is awaiting review.</p></li>
32 /// </ul>
33 pub registration_status: crate::types::RegistrationStatus,
34 /// <p>The current version number of the registration.</p>
35 pub current_version_number: i64,
36 /// <p>Metadata about a given registration which is specific to that registration type.</p>
37 pub additional_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
38 /// <p>An array of tags (key and value pairs) to associate with the registration.</p>
39 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
40 /// <p>The time when the registration was created, in <a href="https://www.epochconverter.com/">UNIX epoch time</a> format.</p>
41 pub created_timestamp: ::aws_smithy_types::DateTime,
42 _request_id: Option<String>,
43}
44impl CreateRegistrationOutput {
45 /// <p>The Amazon Resource Name (ARN) for the registration.</p>
46 pub fn registration_arn(&self) -> &str {
47 use std::ops::Deref;
48 self.registration_arn.deref()
49 }
50 /// <p>The unique identifier for the registration.</p>
51 pub fn registration_id(&self) -> &str {
52 use std::ops::Deref;
53 self.registration_id.deref()
54 }
55 /// <p>The type of registration form to create. The list of <b>RegistrationTypes</b> can be found using the <code>DescribeRegistrationTypeDefinitions</code> action.</p>
56 pub fn registration_type(&self) -> &str {
57 use std::ops::Deref;
58 self.registration_type.deref()
59 }
60 /// <p>The status of the registration.</p>
61 /// <ul>
62 /// <li>
63 /// <p><code>CLOSED</code>: The phone number or sender ID has been deleted and you must also delete the registration for the number.</p></li>
64 /// <li>
65 /// <p><code>CREATED</code>: Your registration is created but not submitted.</p></li>
66 /// <li>
67 /// <p><code>COMPLETE</code>: Your registration has been approved and your origination identity has been created.</p></li>
68 /// <li>
69 /// <p><code>DELETED</code>: The registration has been deleted.</p></li>
70 /// <li>
71 /// <p><code>PROVISIONING</code>: Your registration has been approved and your origination identity is being created.</p></li>
72 /// <li>
73 /// <p><code>REQUIRES_AUTHENTICATION</code>: You need to complete email authentication.</p></li>
74 /// <li>
75 /// <p><code>REQUIRES_UPDATES</code>: You must fix your registration and resubmit it.</p></li>
76 /// <li>
77 /// <p><code>REVIEWING</code>: Your registration has been accepted and is being reviewed.</p></li>
78 /// <li>
79 /// <p><code>SUBMITTED</code>: Your registration has been submitted and is awaiting review.</p></li>
80 /// </ul>
81 pub fn registration_status(&self) -> &crate::types::RegistrationStatus {
82 &self.registration_status
83 }
84 /// <p>The current version number of the registration.</p>
85 pub fn current_version_number(&self) -> i64 {
86 self.current_version_number
87 }
88 /// <p>Metadata about a given registration which is specific to that registration type.</p>
89 pub fn additional_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
90 self.additional_attributes.as_ref()
91 }
92 /// <p>An array of tags (key and value pairs) to associate with the registration.</p>
93 ///
94 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
95 pub fn tags(&self) -> &[crate::types::Tag] {
96 self.tags.as_deref().unwrap_or_default()
97 }
98 /// <p>The time when the registration was created, in <a href="https://www.epochconverter.com/">UNIX epoch time</a> format.</p>
99 pub fn created_timestamp(&self) -> &::aws_smithy_types::DateTime {
100 &self.created_timestamp
101 }
102}
103impl ::aws_types::request_id::RequestId for CreateRegistrationOutput {
104 fn request_id(&self) -> Option<&str> {
105 self._request_id.as_deref()
106 }
107}
108impl CreateRegistrationOutput {
109 /// Creates a new builder-style object to manufacture [`CreateRegistrationOutput`](crate::operation::create_registration::CreateRegistrationOutput).
110 pub fn builder() -> crate::operation::create_registration::builders::CreateRegistrationOutputBuilder {
111 crate::operation::create_registration::builders::CreateRegistrationOutputBuilder::default()
112 }
113}
114
115/// A builder for [`CreateRegistrationOutput`](crate::operation::create_registration::CreateRegistrationOutput).
116#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
117#[non_exhaustive]
118pub struct CreateRegistrationOutputBuilder {
119 pub(crate) registration_arn: ::std::option::Option<::std::string::String>,
120 pub(crate) registration_id: ::std::option::Option<::std::string::String>,
121 pub(crate) registration_type: ::std::option::Option<::std::string::String>,
122 pub(crate) registration_status: ::std::option::Option<crate::types::RegistrationStatus>,
123 pub(crate) current_version_number: ::std::option::Option<i64>,
124 pub(crate) additional_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
125 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
126 pub(crate) created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
127 _request_id: Option<String>,
128}
129impl CreateRegistrationOutputBuilder {
130 /// <p>The Amazon Resource Name (ARN) for the registration.</p>
131 /// This field is required.
132 pub fn registration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.registration_arn = ::std::option::Option::Some(input.into());
134 self
135 }
136 /// <p>The Amazon Resource Name (ARN) for the registration.</p>
137 pub fn set_registration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.registration_arn = input;
139 self
140 }
141 /// <p>The Amazon Resource Name (ARN) for the registration.</p>
142 pub fn get_registration_arn(&self) -> &::std::option::Option<::std::string::String> {
143 &self.registration_arn
144 }
145 /// <p>The unique identifier for the registration.</p>
146 /// This field is required.
147 pub fn registration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148 self.registration_id = ::std::option::Option::Some(input.into());
149 self
150 }
151 /// <p>The unique identifier for the registration.</p>
152 pub fn set_registration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153 self.registration_id = input;
154 self
155 }
156 /// <p>The unique identifier for the registration.</p>
157 pub fn get_registration_id(&self) -> &::std::option::Option<::std::string::String> {
158 &self.registration_id
159 }
160 /// <p>The type of registration form to create. The list of <b>RegistrationTypes</b> can be found using the <code>DescribeRegistrationTypeDefinitions</code> action.</p>
161 /// This field is required.
162 pub fn registration_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163 self.registration_type = ::std::option::Option::Some(input.into());
164 self
165 }
166 /// <p>The type of registration form to create. The list of <b>RegistrationTypes</b> can be found using the <code>DescribeRegistrationTypeDefinitions</code> action.</p>
167 pub fn set_registration_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168 self.registration_type = input;
169 self
170 }
171 /// <p>The type of registration form to create. The list of <b>RegistrationTypes</b> can be found using the <code>DescribeRegistrationTypeDefinitions</code> action.</p>
172 pub fn get_registration_type(&self) -> &::std::option::Option<::std::string::String> {
173 &self.registration_type
174 }
175 /// <p>The status of the registration.</p>
176 /// <ul>
177 /// <li>
178 /// <p><code>CLOSED</code>: The phone number or sender ID has been deleted and you must also delete the registration for the number.</p></li>
179 /// <li>
180 /// <p><code>CREATED</code>: Your registration is created but not submitted.</p></li>
181 /// <li>
182 /// <p><code>COMPLETE</code>: Your registration has been approved and your origination identity has been created.</p></li>
183 /// <li>
184 /// <p><code>DELETED</code>: The registration has been deleted.</p></li>
185 /// <li>
186 /// <p><code>PROVISIONING</code>: Your registration has been approved and your origination identity is being created.</p></li>
187 /// <li>
188 /// <p><code>REQUIRES_AUTHENTICATION</code>: You need to complete email authentication.</p></li>
189 /// <li>
190 /// <p><code>REQUIRES_UPDATES</code>: You must fix your registration and resubmit it.</p></li>
191 /// <li>
192 /// <p><code>REVIEWING</code>: Your registration has been accepted and is being reviewed.</p></li>
193 /// <li>
194 /// <p><code>SUBMITTED</code>: Your registration has been submitted and is awaiting review.</p></li>
195 /// </ul>
196 /// This field is required.
197 pub fn registration_status(mut self, input: crate::types::RegistrationStatus) -> Self {
198 self.registration_status = ::std::option::Option::Some(input);
199 self
200 }
201 /// <p>The status of the registration.</p>
202 /// <ul>
203 /// <li>
204 /// <p><code>CLOSED</code>: The phone number or sender ID has been deleted and you must also delete the registration for the number.</p></li>
205 /// <li>
206 /// <p><code>CREATED</code>: Your registration is created but not submitted.</p></li>
207 /// <li>
208 /// <p><code>COMPLETE</code>: Your registration has been approved and your origination identity has been created.</p></li>
209 /// <li>
210 /// <p><code>DELETED</code>: The registration has been deleted.</p></li>
211 /// <li>
212 /// <p><code>PROVISIONING</code>: Your registration has been approved and your origination identity is being created.</p></li>
213 /// <li>
214 /// <p><code>REQUIRES_AUTHENTICATION</code>: You need to complete email authentication.</p></li>
215 /// <li>
216 /// <p><code>REQUIRES_UPDATES</code>: You must fix your registration and resubmit it.</p></li>
217 /// <li>
218 /// <p><code>REVIEWING</code>: Your registration has been accepted and is being reviewed.</p></li>
219 /// <li>
220 /// <p><code>SUBMITTED</code>: Your registration has been submitted and is awaiting review.</p></li>
221 /// </ul>
222 pub fn set_registration_status(mut self, input: ::std::option::Option<crate::types::RegistrationStatus>) -> Self {
223 self.registration_status = input;
224 self
225 }
226 /// <p>The status of the registration.</p>
227 /// <ul>
228 /// <li>
229 /// <p><code>CLOSED</code>: The phone number or sender ID has been deleted and you must also delete the registration for the number.</p></li>
230 /// <li>
231 /// <p><code>CREATED</code>: Your registration is created but not submitted.</p></li>
232 /// <li>
233 /// <p><code>COMPLETE</code>: Your registration has been approved and your origination identity has been created.</p></li>
234 /// <li>
235 /// <p><code>DELETED</code>: The registration has been deleted.</p></li>
236 /// <li>
237 /// <p><code>PROVISIONING</code>: Your registration has been approved and your origination identity is being created.</p></li>
238 /// <li>
239 /// <p><code>REQUIRES_AUTHENTICATION</code>: You need to complete email authentication.</p></li>
240 /// <li>
241 /// <p><code>REQUIRES_UPDATES</code>: You must fix your registration and resubmit it.</p></li>
242 /// <li>
243 /// <p><code>REVIEWING</code>: Your registration has been accepted and is being reviewed.</p></li>
244 /// <li>
245 /// <p><code>SUBMITTED</code>: Your registration has been submitted and is awaiting review.</p></li>
246 /// </ul>
247 pub fn get_registration_status(&self) -> &::std::option::Option<crate::types::RegistrationStatus> {
248 &self.registration_status
249 }
250 /// <p>The current version number of the registration.</p>
251 /// This field is required.
252 pub fn current_version_number(mut self, input: i64) -> Self {
253 self.current_version_number = ::std::option::Option::Some(input);
254 self
255 }
256 /// <p>The current version number of the registration.</p>
257 pub fn set_current_version_number(mut self, input: ::std::option::Option<i64>) -> Self {
258 self.current_version_number = input;
259 self
260 }
261 /// <p>The current version number of the registration.</p>
262 pub fn get_current_version_number(&self) -> &::std::option::Option<i64> {
263 &self.current_version_number
264 }
265 /// Adds a key-value pair to `additional_attributes`.
266 ///
267 /// To override the contents of this collection use [`set_additional_attributes`](Self::set_additional_attributes).
268 ///
269 /// <p>Metadata about a given registration which is specific to that registration type.</p>
270 pub fn additional_attributes(
271 mut self,
272 k: impl ::std::convert::Into<::std::string::String>,
273 v: impl ::std::convert::Into<::std::string::String>,
274 ) -> Self {
275 let mut hash_map = self.additional_attributes.unwrap_or_default();
276 hash_map.insert(k.into(), v.into());
277 self.additional_attributes = ::std::option::Option::Some(hash_map);
278 self
279 }
280 /// <p>Metadata about a given registration which is specific to that registration type.</p>
281 pub fn set_additional_attributes(
282 mut self,
283 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
284 ) -> Self {
285 self.additional_attributes = input;
286 self
287 }
288 /// <p>Metadata about a given registration which is specific to that registration type.</p>
289 pub fn get_additional_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
290 &self.additional_attributes
291 }
292 /// Appends an item to `tags`.
293 ///
294 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
295 ///
296 /// <p>An array of tags (key and value pairs) to associate with the registration.</p>
297 pub fn tags(mut self, input: crate::types::Tag) -> Self {
298 let mut v = self.tags.unwrap_or_default();
299 v.push(input);
300 self.tags = ::std::option::Option::Some(v);
301 self
302 }
303 /// <p>An array of tags (key and value pairs) to associate with the registration.</p>
304 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
305 self.tags = input;
306 self
307 }
308 /// <p>An array of tags (key and value pairs) to associate with the registration.</p>
309 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
310 &self.tags
311 }
312 /// <p>The time when the registration was created, in <a href="https://www.epochconverter.com/">UNIX epoch time</a> format.</p>
313 /// This field is required.
314 pub fn created_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
315 self.created_timestamp = ::std::option::Option::Some(input);
316 self
317 }
318 /// <p>The time when the registration was created, in <a href="https://www.epochconverter.com/">UNIX epoch time</a> format.</p>
319 pub fn set_created_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
320 self.created_timestamp = input;
321 self
322 }
323 /// <p>The time when the registration was created, in <a href="https://www.epochconverter.com/">UNIX epoch time</a> format.</p>
324 pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
325 &self.created_timestamp
326 }
327 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
328 self._request_id = Some(request_id.into());
329 self
330 }
331
332 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
333 self._request_id = request_id;
334 self
335 }
336 /// Consumes the builder and constructs a [`CreateRegistrationOutput`](crate::operation::create_registration::CreateRegistrationOutput).
337 /// This method will fail if any of the following fields are not set:
338 /// - [`registration_arn`](crate::operation::create_registration::builders::CreateRegistrationOutputBuilder::registration_arn)
339 /// - [`registration_id`](crate::operation::create_registration::builders::CreateRegistrationOutputBuilder::registration_id)
340 /// - [`registration_type`](crate::operation::create_registration::builders::CreateRegistrationOutputBuilder::registration_type)
341 /// - [`registration_status`](crate::operation::create_registration::builders::CreateRegistrationOutputBuilder::registration_status)
342 /// - [`current_version_number`](crate::operation::create_registration::builders::CreateRegistrationOutputBuilder::current_version_number)
343 /// - [`created_timestamp`](crate::operation::create_registration::builders::CreateRegistrationOutputBuilder::created_timestamp)
344 pub fn build(
345 self,
346 ) -> ::std::result::Result<crate::operation::create_registration::CreateRegistrationOutput, ::aws_smithy_types::error::operation::BuildError>
347 {
348 ::std::result::Result::Ok(crate::operation::create_registration::CreateRegistrationOutput {
349 registration_arn: self.registration_arn.ok_or_else(|| {
350 ::aws_smithy_types::error::operation::BuildError::missing_field(
351 "registration_arn",
352 "registration_arn was not specified but it is required when building CreateRegistrationOutput",
353 )
354 })?,
355 registration_id: self.registration_id.ok_or_else(|| {
356 ::aws_smithy_types::error::operation::BuildError::missing_field(
357 "registration_id",
358 "registration_id was not specified but it is required when building CreateRegistrationOutput",
359 )
360 })?,
361 registration_type: self.registration_type.ok_or_else(|| {
362 ::aws_smithy_types::error::operation::BuildError::missing_field(
363 "registration_type",
364 "registration_type was not specified but it is required when building CreateRegistrationOutput",
365 )
366 })?,
367 registration_status: self.registration_status.ok_or_else(|| {
368 ::aws_smithy_types::error::operation::BuildError::missing_field(
369 "registration_status",
370 "registration_status was not specified but it is required when building CreateRegistrationOutput",
371 )
372 })?,
373 current_version_number: self.current_version_number.ok_or_else(|| {
374 ::aws_smithy_types::error::operation::BuildError::missing_field(
375 "current_version_number",
376 "current_version_number was not specified but it is required when building CreateRegistrationOutput",
377 )
378 })?,
379 additional_attributes: self.additional_attributes,
380 tags: self.tags,
381 created_timestamp: self.created_timestamp.ok_or_else(|| {
382 ::aws_smithy_types::error::operation::BuildError::missing_field(
383 "created_timestamp",
384 "created_timestamp was not specified but it is required when building CreateRegistrationOutput",
385 )
386 })?,
387 _request_id: self._request_id,
388 })
389 }
390}