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
// 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 RequestSenderIdInput {
/// <p>The sender ID string to request. The sender ID can be 1-11 alphanumeric characters including letters (A-Z, a-z), numbers (0-9), or hyphens (-). The sender ID must contain at least one letter and cannot start or end with a hyphen.</p>
pub sender_id: ::std::option::Option<::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::option::Option<::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::option::Option<::std::vec::Vec<crate::types::MessageType>>,
/// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
pub deletion_protection_enabled: ::std::option::Option<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>>,
/// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
pub client_token: ::std::option::Option<::std::string::String>,
}
impl RequestSenderIdInput {
/// <p>The sender ID string to request. The sender ID can be 1-11 alphanumeric characters including letters (A-Z, a-z), numbers (0-9), or hyphens (-). The sender ID must contain at least one letter and cannot start or end with a hyphen.</p>
pub fn sender_id(&self) -> ::std::option::Option<&str> {
self.sender_id.as_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) -> ::std::option::Option<&str> {
self.iso_country_code.as_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>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.message_types.is_none()`.
pub fn message_types(&self) -> &[crate::types::MessageType] {
self.message_types.as_deref().unwrap_or_default()
}
/// <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) -> ::std::option::Option<bool> {
self.deletion_protection_enabled
}
/// <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()
}
/// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl RequestSenderIdInput {
/// Creates a new builder-style object to manufacture [`RequestSenderIdInput`](crate::operation::request_sender_id::RequestSenderIdInput).
pub fn builder() -> crate::operation::request_sender_id::builders::RequestSenderIdInputBuilder {
crate::operation::request_sender_id::builders::RequestSenderIdInputBuilder::default()
}
}
/// A builder for [`RequestSenderIdInput`](crate::operation::request_sender_id::RequestSenderIdInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RequestSenderIdInputBuilder {
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) deletion_protection_enabled: ::std::option::Option<bool>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl RequestSenderIdInputBuilder {
/// <p>The sender ID string to request. The sender ID can be 1-11 alphanumeric characters including letters (A-Z, a-z), numbers (0-9), or hyphens (-). The sender ID must contain at least one letter and cannot start or end with a hyphen.</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 string to request. The sender ID can be 1-11 alphanumeric characters including letters (A-Z, a-z), numbers (0-9), or hyphens (-). The sender ID must contain at least one letter and cannot start or end with a hyphen.</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 string to request. The sender ID can be 1-11 alphanumeric characters including letters (A-Z, a-z), numbers (0-9), or hyphens (-). The sender ID must contain at least one letter and cannot start or end with a hyphen.</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>By default this is set to false. When set to true the sender ID can't be deleted.</p>
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
}
/// 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
}
/// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
/// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
/// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
/// Consumes the builder and constructs a [`RequestSenderIdInput`](crate::operation::request_sender_id::RequestSenderIdInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::request_sender_id::RequestSenderIdInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::request_sender_id::RequestSenderIdInput {
sender_id: self.sender_id,
iso_country_code: self.iso_country_code,
message_types: self.message_types,
deletion_protection_enabled: self.deletion_protection_enabled,
tags: self.tags,
client_token: self.client_token,
})
}
}