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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RequestSenderIdOutput {
/// <p>The Amazon Resource Name (ARN) associated with the SenderId.</p>
pub sender_id_arn: ::std::string::String,
/// <p>The sender ID that was requested.</p>
pub sender_id: ::std::string::String,
/// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.</p>
pub iso_country_code: ::std::string::String,
/// <p>The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.</p>
pub message_types: ::std::vec::Vec<crate::types::MessageType>,
/// <p>The monthly price, in US dollars, to lease the sender ID.</p>
pub monthly_leasing_price: ::std::string::String,
/// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
pub deletion_protection_enabled: bool,
/// <p>True if the sender ID is registered.</p>
pub registered: bool,
/// <p>An array of tags (key and value pairs) to associate with the sender ID.</p>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
_request_id: Option<String>,
}
impl RequestSenderIdOutput {
/// <p>The Amazon Resource Name (ARN) associated with the SenderId.</p>
pub fn sender_id_arn(&self) -> &str {
use std::ops::Deref;
self.sender_id_arn.deref()
}
/// <p>The sender ID that was requested.</p>
pub fn sender_id(&self) -> &str {
use std::ops::Deref;
self.sender_id.deref()
}
/// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.</p>
pub fn iso_country_code(&self) -> &str {
use std::ops::Deref;
self.iso_country_code.deref()
}
/// <p>The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.</p>
pub fn message_types(&self) -> &[crate::types::MessageType] {
use std::ops::Deref;
self.message_types.deref()
}
/// <p>The monthly price, in US dollars, to lease the sender ID.</p>
pub fn monthly_leasing_price(&self) -> &str {
use std::ops::Deref;
self.monthly_leasing_price.deref()
}
/// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
pub fn deletion_protection_enabled(&self) -> bool {
self.deletion_protection_enabled
}
/// <p>True if the sender ID is registered.</p>
pub fn registered(&self) -> bool {
self.registered
}
/// <p>An array of tags (key and value pairs) to associate with the sender ID.</p>
///
/// 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()`.
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
}
impl ::aws_types::request_id::RequestId for RequestSenderIdOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl RequestSenderIdOutput {
/// Creates a new builder-style object to manufacture [`RequestSenderIdOutput`](crate::operation::request_sender_id::RequestSenderIdOutput).
pub fn builder() -> crate::operation::request_sender_id::builders::RequestSenderIdOutputBuilder {
crate::operation::request_sender_id::builders::RequestSenderIdOutputBuilder::default()
}
}
/// A builder for [`RequestSenderIdOutput`](crate::operation::request_sender_id::RequestSenderIdOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RequestSenderIdOutputBuilder {
pub(crate) sender_id_arn: ::std::option::Option<::std::string::String>,
pub(crate) sender_id: ::std::option::Option<::std::string::String>,
pub(crate) iso_country_code: ::std::option::Option<::std::string::String>,
pub(crate) message_types: ::std::option::Option<::std::vec::Vec<crate::types::MessageType>>,
pub(crate) monthly_leasing_price: ::std::option::Option<::std::string::String>,
pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
pub(crate) registered: ::std::option::Option<bool>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
_request_id: Option<String>,
}
impl RequestSenderIdOutputBuilder {
/// <p>The Amazon Resource Name (ARN) associated with the SenderId.</p>
/// This field is required.
pub fn sender_id_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.sender_id_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) associated with the SenderId.</p>
pub fn set_sender_id_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.sender_id_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) associated with the SenderId.</p>
pub fn get_sender_id_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.sender_id_arn
}
/// <p>The sender ID that was requested.</p>
/// This field is required.
pub fn sender_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.sender_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The sender ID that was requested.</p>
pub fn set_sender_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.sender_id = input;
self
}
/// <p>The sender ID that was requested.</p>
pub fn get_sender_id(&self) -> &::std::option::Option<::std::string::String> {
&self.sender_id
}
/// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.</p>
/// This field is required.
pub fn iso_country_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.iso_country_code = ::std::option::Option::Some(input.into());
self
}
/// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.</p>
pub fn set_iso_country_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.iso_country_code = input;
self
}
/// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.</p>
pub fn get_iso_country_code(&self) -> &::std::option::Option<::std::string::String> {
&self.iso_country_code
}
/// Appends an item to `message_types`.
///
/// To override the contents of this collection use [`set_message_types`](Self::set_message_types).
///
/// <p>The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.</p>
pub fn message_types(mut self, input: crate::types::MessageType) -> Self {
let mut v = self.message_types.unwrap_or_default();
v.push(input);
self.message_types = ::std::option::Option::Some(v);
self
}
/// <p>The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.</p>
pub fn set_message_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MessageType>>) -> Self {
self.message_types = input;
self
}
/// <p>The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.</p>
pub fn get_message_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MessageType>> {
&self.message_types
}
/// <p>The monthly price, in US dollars, to lease the sender ID.</p>
/// This field is required.
pub fn monthly_leasing_price(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.monthly_leasing_price = ::std::option::Option::Some(input.into());
self
}
/// <p>The monthly price, in US dollars, to lease the sender ID.</p>
pub fn set_monthly_leasing_price(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.monthly_leasing_price = input;
self
}
/// <p>The monthly price, in US dollars, to lease the sender ID.</p>
pub fn get_monthly_leasing_price(&self) -> &::std::option::Option<::std::string::String> {
&self.monthly_leasing_price
}
/// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
/// This field is required.
pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
self.deletion_protection_enabled = ::std::option::Option::Some(input);
self
}
/// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
self.deletion_protection_enabled = input;
self
}
/// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
&self.deletion_protection_enabled
}
/// <p>True if the sender ID is registered.</p>
/// This field is required.
pub fn registered(mut self, input: bool) -> Self {
self.registered = ::std::option::Option::Some(input);
self
}
/// <p>True if the sender ID is registered.</p>
pub fn set_registered(mut self, input: ::std::option::Option<bool>) -> Self {
self.registered = input;
self
}
/// <p>True if the sender ID is registered.</p>
pub fn get_registered(&self) -> &::std::option::Option<bool> {
&self.registered
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>An array of tags (key and value pairs) to associate with the sender ID.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>An array of tags (key and value pairs) to associate with the sender ID.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>An array of tags (key and value pairs) to associate with the sender ID.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`RequestSenderIdOutput`](crate::operation::request_sender_id::RequestSenderIdOutput).
/// This method will fail if any of the following fields are not set:
/// - [`sender_id_arn`](crate::operation::request_sender_id::builders::RequestSenderIdOutputBuilder::sender_id_arn)
/// - [`sender_id`](crate::operation::request_sender_id::builders::RequestSenderIdOutputBuilder::sender_id)
/// - [`iso_country_code`](crate::operation::request_sender_id::builders::RequestSenderIdOutputBuilder::iso_country_code)
/// - [`message_types`](crate::operation::request_sender_id::builders::RequestSenderIdOutputBuilder::message_types)
/// - [`monthly_leasing_price`](crate::operation::request_sender_id::builders::RequestSenderIdOutputBuilder::monthly_leasing_price)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::request_sender_id::RequestSenderIdOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::request_sender_id::RequestSenderIdOutput {
sender_id_arn: self.sender_id_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"sender_id_arn",
"sender_id_arn was not specified but it is required when building RequestSenderIdOutput",
)
})?,
sender_id: self.sender_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"sender_id",
"sender_id was not specified but it is required when building RequestSenderIdOutput",
)
})?,
iso_country_code: self.iso_country_code.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"iso_country_code",
"iso_country_code was not specified but it is required when building RequestSenderIdOutput",
)
})?,
message_types: self.message_types.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"message_types",
"message_types was not specified but it is required when building RequestSenderIdOutput",
)
})?,
monthly_leasing_price: self.monthly_leasing_price.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"monthly_leasing_price",
"monthly_leasing_price was not specified but it is required when building RequestSenderIdOutput",
)
})?,
deletion_protection_enabled: self.deletion_protection_enabled.unwrap_or_default(),
registered: self.registered.unwrap_or_default(),
tags: self.tags,
_request_id: self._request_id,
})
}
}