aws_sdk_pinpointsmsvoicev2/operation/create_pool/_create_pool_input.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 CreatePoolInput {
6 /// <p>The origination identity to use such as a PhoneNumberId, PhoneNumberArn, SenderId or SenderIdArn. You can use <code>DescribePhoneNumbers</code> to find the values for PhoneNumberId and PhoneNumberArn while <code>DescribeSenderIds</code> can be used to get the values for SenderId and SenderIdArn.</p>
7 /// <p>After the pool is created you can add more origination identities to the pool by using <a href="https://docs.aws.amazon.com/pinpoint/latest/apireference_smsvoicev2/API_AssociateOriginationIdentity.html">AssociateOriginationIdentity</a>.</p><important>
8 /// <p>If you are using a shared AWS End User Messaging SMS and Voice resource then you must use the full Amazon Resource Name(ARN).</p>
9 /// </important>
10 pub origination_identity: ::std::option::Option<::std::string::String>,
11 /// <p>The new two-character code, in ISO 3166-1 alpha-2 format, for the country or region of the new pool.</p>
12 pub iso_country_code: ::std::option::Option<::std::string::String>,
13 /// <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. After the pool is created the MessageType can't be changed.</p>
14 pub message_type: ::std::option::Option<crate::types::MessageType>,
15 /// <p>By default this is set to false. When set to true the pool can't be deleted. You can change this value using the <code>UpdatePool</code> action.</p>
16 pub deletion_protection_enabled: ::std::option::Option<bool>,
17 /// <p>An array of tags (key and value pairs) associated with the pool.</p>
18 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
19 /// <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>
20 pub client_token: ::std::option::Option<::std::string::String>,
21}
22impl CreatePoolInput {
23 /// <p>The origination identity to use such as a PhoneNumberId, PhoneNumberArn, SenderId or SenderIdArn. You can use <code>DescribePhoneNumbers</code> to find the values for PhoneNumberId and PhoneNumberArn while <code>DescribeSenderIds</code> can be used to get the values for SenderId and SenderIdArn.</p>
24 /// <p>After the pool is created you can add more origination identities to the pool by using <a href="https://docs.aws.amazon.com/pinpoint/latest/apireference_smsvoicev2/API_AssociateOriginationIdentity.html">AssociateOriginationIdentity</a>.</p><important>
25 /// <p>If you are using a shared AWS End User Messaging SMS and Voice resource then you must use the full Amazon Resource Name(ARN).</p>
26 /// </important>
27 pub fn origination_identity(&self) -> ::std::option::Option<&str> {
28 self.origination_identity.as_deref()
29 }
30 /// <p>The new two-character code, in ISO 3166-1 alpha-2 format, for the country or region of the new pool.</p>
31 pub fn iso_country_code(&self) -> ::std::option::Option<&str> {
32 self.iso_country_code.as_deref()
33 }
34 /// <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. After the pool is created the MessageType can't be changed.</p>
35 pub fn message_type(&self) -> ::std::option::Option<&crate::types::MessageType> {
36 self.message_type.as_ref()
37 }
38 /// <p>By default this is set to false. When set to true the pool can't be deleted. You can change this value using the <code>UpdatePool</code> action.</p>
39 pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
40 self.deletion_protection_enabled
41 }
42 /// <p>An array of tags (key and value pairs) associated with the pool.</p>
43 ///
44 /// 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()`.
45 pub fn tags(&self) -> &[crate::types::Tag] {
46 self.tags.as_deref().unwrap_or_default()
47 }
48 /// <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>
49 pub fn client_token(&self) -> ::std::option::Option<&str> {
50 self.client_token.as_deref()
51 }
52}
53impl CreatePoolInput {
54 /// Creates a new builder-style object to manufacture [`CreatePoolInput`](crate::operation::create_pool::CreatePoolInput).
55 pub fn builder() -> crate::operation::create_pool::builders::CreatePoolInputBuilder {
56 crate::operation::create_pool::builders::CreatePoolInputBuilder::default()
57 }
58}
59
60/// A builder for [`CreatePoolInput`](crate::operation::create_pool::CreatePoolInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreatePoolInputBuilder {
64 pub(crate) origination_identity: ::std::option::Option<::std::string::String>,
65 pub(crate) iso_country_code: ::std::option::Option<::std::string::String>,
66 pub(crate) message_type: ::std::option::Option<crate::types::MessageType>,
67 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
68 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
69 pub(crate) client_token: ::std::option::Option<::std::string::String>,
70}
71impl CreatePoolInputBuilder {
72 /// <p>The origination identity to use such as a PhoneNumberId, PhoneNumberArn, SenderId or SenderIdArn. You can use <code>DescribePhoneNumbers</code> to find the values for PhoneNumberId and PhoneNumberArn while <code>DescribeSenderIds</code> can be used to get the values for SenderId and SenderIdArn.</p>
73 /// <p>After the pool is created you can add more origination identities to the pool by using <a href="https://docs.aws.amazon.com/pinpoint/latest/apireference_smsvoicev2/API_AssociateOriginationIdentity.html">AssociateOriginationIdentity</a>.</p><important>
74 /// <p>If you are using a shared AWS End User Messaging SMS and Voice resource then you must use the full Amazon Resource Name(ARN).</p>
75 /// </important>
76 /// This field is required.
77 pub fn origination_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78 self.origination_identity = ::std::option::Option::Some(input.into());
79 self
80 }
81 /// <p>The origination identity to use such as a PhoneNumberId, PhoneNumberArn, SenderId or SenderIdArn. You can use <code>DescribePhoneNumbers</code> to find the values for PhoneNumberId and PhoneNumberArn while <code>DescribeSenderIds</code> can be used to get the values for SenderId and SenderIdArn.</p>
82 /// <p>After the pool is created you can add more origination identities to the pool by using <a href="https://docs.aws.amazon.com/pinpoint/latest/apireference_smsvoicev2/API_AssociateOriginationIdentity.html">AssociateOriginationIdentity</a>.</p><important>
83 /// <p>If you are using a shared AWS End User Messaging SMS and Voice resource then you must use the full Amazon Resource Name(ARN).</p>
84 /// </important>
85 pub fn set_origination_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.origination_identity = input;
87 self
88 }
89 /// <p>The origination identity to use such as a PhoneNumberId, PhoneNumberArn, SenderId or SenderIdArn. You can use <code>DescribePhoneNumbers</code> to find the values for PhoneNumberId and PhoneNumberArn while <code>DescribeSenderIds</code> can be used to get the values for SenderId and SenderIdArn.</p>
90 /// <p>After the pool is created you can add more origination identities to the pool by using <a href="https://docs.aws.amazon.com/pinpoint/latest/apireference_smsvoicev2/API_AssociateOriginationIdentity.html">AssociateOriginationIdentity</a>.</p><important>
91 /// <p>If you are using a shared AWS End User Messaging SMS and Voice resource then you must use the full Amazon Resource Name(ARN).</p>
92 /// </important>
93 pub fn get_origination_identity(&self) -> &::std::option::Option<::std::string::String> {
94 &self.origination_identity
95 }
96 /// <p>The new two-character code, in ISO 3166-1 alpha-2 format, for the country or region of the new pool.</p>
97 /// This field is required.
98 pub fn iso_country_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99 self.iso_country_code = ::std::option::Option::Some(input.into());
100 self
101 }
102 /// <p>The new two-character code, in ISO 3166-1 alpha-2 format, for the country or region of the new pool.</p>
103 pub fn set_iso_country_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104 self.iso_country_code = input;
105 self
106 }
107 /// <p>The new two-character code, in ISO 3166-1 alpha-2 format, for the country or region of the new pool.</p>
108 pub fn get_iso_country_code(&self) -> &::std::option::Option<::std::string::String> {
109 &self.iso_country_code
110 }
111 /// <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. After the pool is created the MessageType can't be changed.</p>
112 /// This field is required.
113 pub fn message_type(mut self, input: crate::types::MessageType) -> Self {
114 self.message_type = ::std::option::Option::Some(input);
115 self
116 }
117 /// <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. After the pool is created the MessageType can't be changed.</p>
118 pub fn set_message_type(mut self, input: ::std::option::Option<crate::types::MessageType>) -> Self {
119 self.message_type = input;
120 self
121 }
122 /// <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. After the pool is created the MessageType can't be changed.</p>
123 pub fn get_message_type(&self) -> &::std::option::Option<crate::types::MessageType> {
124 &self.message_type
125 }
126 /// <p>By default this is set to false. When set to true the pool can't be deleted. You can change this value using the <code>UpdatePool</code> action.</p>
127 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
128 self.deletion_protection_enabled = ::std::option::Option::Some(input);
129 self
130 }
131 /// <p>By default this is set to false. When set to true the pool can't be deleted. You can change this value using the <code>UpdatePool</code> action.</p>
132 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
133 self.deletion_protection_enabled = input;
134 self
135 }
136 /// <p>By default this is set to false. When set to true the pool can't be deleted. You can change this value using the <code>UpdatePool</code> action.</p>
137 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
138 &self.deletion_protection_enabled
139 }
140 /// Appends an item to `tags`.
141 ///
142 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
143 ///
144 /// <p>An array of tags (key and value pairs) associated with the pool.</p>
145 pub fn tags(mut self, input: crate::types::Tag) -> Self {
146 let mut v = self.tags.unwrap_or_default();
147 v.push(input);
148 self.tags = ::std::option::Option::Some(v);
149 self
150 }
151 /// <p>An array of tags (key and value pairs) associated with the pool.</p>
152 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
153 self.tags = input;
154 self
155 }
156 /// <p>An array of tags (key and value pairs) associated with the pool.</p>
157 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
158 &self.tags
159 }
160 /// <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>
161 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162 self.client_token = ::std::option::Option::Some(input.into());
163 self
164 }
165 /// <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>
166 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167 self.client_token = input;
168 self
169 }
170 /// <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>
171 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
172 &self.client_token
173 }
174 /// Consumes the builder and constructs a [`CreatePoolInput`](crate::operation::create_pool::CreatePoolInput).
175 pub fn build(self) -> ::std::result::Result<crate::operation::create_pool::CreatePoolInput, ::aws_smithy_types::error::operation::BuildError> {
176 ::std::result::Result::Ok(crate::operation::create_pool::CreatePoolInput {
177 origination_identity: self.origination_identity,
178 iso_country_code: self.iso_country_code,
179 message_type: self.message_type,
180 deletion_protection_enabled: self.deletion_protection_enabled,
181 tags: self.tags,
182 client_token: self.client_token,
183 })
184 }
185}