aws_sdk_sns/operation/create_topic/_create_topic_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Input for CreateTopic action.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateTopicInput {
7 /// <p>The name of the topic you want to create.</p>
8 /// <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long.</p>
9 /// <p>For a FIFO (first-in-first-out) topic, the name must end with the <code>.fifo</code> suffix.</p>
10 pub name: ::std::option::Option<::std::string::String>,
11 /// <p>A map of attributes with their corresponding values.</p>
12 /// <p>The following lists names, descriptions, and values of the special request parameters that the <code>CreateTopic</code> action uses:</p>
13 /// <ul>
14 /// <li>
15 /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
16 /// <li>
17 /// <p><code>DisplayName</code> – The display name to use for a topic with SMS subscriptions.</p></li>
18 /// <li>
19 /// <p><code>FifoTopic</code> – Set to true to create a FIFO topic.</p></li>
20 /// <li>
21 /// <p><code>Policy</code> – The policy that defines who can access your topic. By default, only the topic owner can publish or subscribe to the topic.</p></li>
22 /// <li>
23 /// <p><code>SignatureVersion</code> – The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default, <code>SignatureVersion</code> is set to <code>1</code>.</p></li>
24 /// <li>
25 /// <p><code>TracingConfig</code> – Tracing mode of an Amazon SNS topic. By default <code>TracingConfig</code> is set to <code>PassThrough</code>, and the topic passes through the tracing header it receives from an Amazon SNS publisher to its subscriptions. If set to <code>Active</code>, Amazon SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true. This is only supported on standard topics.</p></li>
26 /// </ul>
27 /// <p>The following attribute applies only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html">server-side encryption</a>:</p>
28 /// <ul>
29 /// <li>
30 /// <p><code>KmsMasterKeyId</code> – The ID of an Amazon Web Services managed customer master key (CMK) for Amazon SNS or a custom CMK. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms">Key Terms</a>. For more examples, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters">KeyId</a> in the <i>Key Management Service API Reference</i>.</p></li>
31 /// </ul>
32 /// <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p>
33 /// <ul>
34 /// <li>
35 /// <p><code>ArchivePolicy</code> – The policy that sets the retention period for messages stored in the message archive of an Amazon SNS FIFO topic.</p></li>
36 /// <li>
37 /// <p><code>ContentBasedDeduplication</code> – Enables content-based deduplication for FIFO topics.</p>
38 /// <ul>
39 /// <li>
40 /// <p>By default, <code>ContentBasedDeduplication</code> is set to <code>false</code>. If you create a FIFO topic and this attribute is <code>false</code>, you must specify a value for the <code>MessageDeduplicationId</code> parameter for the <a href="https://docs.aws.amazon.com/sns/latest/api/API_Publish.html">Publish</a> action.</p></li>
41 /// <li>
42 /// <p>When you set <code>ContentBasedDeduplication</code> to <code>true</code>, Amazon SNS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p>
43 /// <p>(Optional) To override the generated value, you can specify a value for the <code>MessageDeduplicationId</code> parameter for the <code>Publish</code> action.</p></li>
44 /// </ul></li>
45 /// </ul>
46 /// <ul>
47 /// <li>
48 /// <p><code>FifoThroughputScope</code> – Enables higher throughput for your FIFO topic by adjusting the scope of deduplication. This attribute has two possible values:</p>
49 /// <ul>
50 /// <li>
51 /// <p><code>Topic</code> – The scope of message deduplication is across the entire topic. This is the default value and maintains existing behavior, with a maximum throughput of 3000 messages per second or 20MB per second, whichever comes first.</p></li>
52 /// <li>
53 /// <p><code>MessageGroup</code> – The scope of deduplication is within each individual message group, which enables higher throughput per topic subject to regional quotas. For more information on quotas or to request an increase, see <a href="https://docs.aws.amazon.com/general/latest/gr/sns.html">Amazon SNS service quotas</a> in the Amazon Web Services General Reference.</p></li>
54 /// </ul></li>
55 /// </ul>
56 pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
57 /// <p>The list of tags to add to a new topic.</p><note>
58 /// <p>To be able to tag a topic on creation, you must have the <code>sns:CreateTopic</code> and <code>sns:TagResource</code> permissions.</p>
59 /// </note>
60 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
61 /// <p>The body of the policy document you want to use for this topic.</p>
62 /// <p>You can only add one policy per topic.</p>
63 /// <p>The policy must be in JSON string format.</p>
64 /// <p>Length Constraints: Maximum length of 30,720.</p>
65 pub data_protection_policy: ::std::option::Option<::std::string::String>,
66}
67impl CreateTopicInput {
68 /// <p>The name of the topic you want to create.</p>
69 /// <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long.</p>
70 /// <p>For a FIFO (first-in-first-out) topic, the name must end with the <code>.fifo</code> suffix.</p>
71 pub fn name(&self) -> ::std::option::Option<&str> {
72 self.name.as_deref()
73 }
74 /// <p>A map of attributes with their corresponding values.</p>
75 /// <p>The following lists names, descriptions, and values of the special request parameters that the <code>CreateTopic</code> action uses:</p>
76 /// <ul>
77 /// <li>
78 /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
79 /// <li>
80 /// <p><code>DisplayName</code> – The display name to use for a topic with SMS subscriptions.</p></li>
81 /// <li>
82 /// <p><code>FifoTopic</code> – Set to true to create a FIFO topic.</p></li>
83 /// <li>
84 /// <p><code>Policy</code> – The policy that defines who can access your topic. By default, only the topic owner can publish or subscribe to the topic.</p></li>
85 /// <li>
86 /// <p><code>SignatureVersion</code> – The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default, <code>SignatureVersion</code> is set to <code>1</code>.</p></li>
87 /// <li>
88 /// <p><code>TracingConfig</code> – Tracing mode of an Amazon SNS topic. By default <code>TracingConfig</code> is set to <code>PassThrough</code>, and the topic passes through the tracing header it receives from an Amazon SNS publisher to its subscriptions. If set to <code>Active</code>, Amazon SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true. This is only supported on standard topics.</p></li>
89 /// </ul>
90 /// <p>The following attribute applies only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html">server-side encryption</a>:</p>
91 /// <ul>
92 /// <li>
93 /// <p><code>KmsMasterKeyId</code> – The ID of an Amazon Web Services managed customer master key (CMK) for Amazon SNS or a custom CMK. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms">Key Terms</a>. For more examples, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters">KeyId</a> in the <i>Key Management Service API Reference</i>.</p></li>
94 /// </ul>
95 /// <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p>
96 /// <ul>
97 /// <li>
98 /// <p><code>ArchivePolicy</code> – The policy that sets the retention period for messages stored in the message archive of an Amazon SNS FIFO topic.</p></li>
99 /// <li>
100 /// <p><code>ContentBasedDeduplication</code> – Enables content-based deduplication for FIFO topics.</p>
101 /// <ul>
102 /// <li>
103 /// <p>By default, <code>ContentBasedDeduplication</code> is set to <code>false</code>. If you create a FIFO topic and this attribute is <code>false</code>, you must specify a value for the <code>MessageDeduplicationId</code> parameter for the <a href="https://docs.aws.amazon.com/sns/latest/api/API_Publish.html">Publish</a> action.</p></li>
104 /// <li>
105 /// <p>When you set <code>ContentBasedDeduplication</code> to <code>true</code>, Amazon SNS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p>
106 /// <p>(Optional) To override the generated value, you can specify a value for the <code>MessageDeduplicationId</code> parameter for the <code>Publish</code> action.</p></li>
107 /// </ul></li>
108 /// </ul>
109 /// <ul>
110 /// <li>
111 /// <p><code>FifoThroughputScope</code> – Enables higher throughput for your FIFO topic by adjusting the scope of deduplication. This attribute has two possible values:</p>
112 /// <ul>
113 /// <li>
114 /// <p><code>Topic</code> – The scope of message deduplication is across the entire topic. This is the default value and maintains existing behavior, with a maximum throughput of 3000 messages per second or 20MB per second, whichever comes first.</p></li>
115 /// <li>
116 /// <p><code>MessageGroup</code> – The scope of deduplication is within each individual message group, which enables higher throughput per topic subject to regional quotas. For more information on quotas or to request an increase, see <a href="https://docs.aws.amazon.com/general/latest/gr/sns.html">Amazon SNS service quotas</a> in the Amazon Web Services General Reference.</p></li>
117 /// </ul></li>
118 /// </ul>
119 pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
120 self.attributes.as_ref()
121 }
122 /// <p>The list of tags to add to a new topic.</p><note>
123 /// <p>To be able to tag a topic on creation, you must have the <code>sns:CreateTopic</code> and <code>sns:TagResource</code> permissions.</p>
124 /// </note>
125 ///
126 /// 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()`.
127 pub fn tags(&self) -> &[crate::types::Tag] {
128 self.tags.as_deref().unwrap_or_default()
129 }
130 /// <p>The body of the policy document you want to use for this topic.</p>
131 /// <p>You can only add one policy per topic.</p>
132 /// <p>The policy must be in JSON string format.</p>
133 /// <p>Length Constraints: Maximum length of 30,720.</p>
134 pub fn data_protection_policy(&self) -> ::std::option::Option<&str> {
135 self.data_protection_policy.as_deref()
136 }
137}
138impl CreateTopicInput {
139 /// Creates a new builder-style object to manufacture [`CreateTopicInput`](crate::operation::create_topic::CreateTopicInput).
140 pub fn builder() -> crate::operation::create_topic::builders::CreateTopicInputBuilder {
141 crate::operation::create_topic::builders::CreateTopicInputBuilder::default()
142 }
143}
144
145/// A builder for [`CreateTopicInput`](crate::operation::create_topic::CreateTopicInput).
146#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
147#[non_exhaustive]
148pub struct CreateTopicInputBuilder {
149 pub(crate) name: ::std::option::Option<::std::string::String>,
150 pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
151 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
152 pub(crate) data_protection_policy: ::std::option::Option<::std::string::String>,
153}
154impl CreateTopicInputBuilder {
155 /// <p>The name of the topic you want to create.</p>
156 /// <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long.</p>
157 /// <p>For a FIFO (first-in-first-out) topic, the name must end with the <code>.fifo</code> suffix.</p>
158 /// This field is required.
159 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.name = ::std::option::Option::Some(input.into());
161 self
162 }
163 /// <p>The name of the topic you want to create.</p>
164 /// <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long.</p>
165 /// <p>For a FIFO (first-in-first-out) topic, the name must end with the <code>.fifo</code> suffix.</p>
166 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167 self.name = input;
168 self
169 }
170 /// <p>The name of the topic you want to create.</p>
171 /// <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long.</p>
172 /// <p>For a FIFO (first-in-first-out) topic, the name must end with the <code>.fifo</code> suffix.</p>
173 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
174 &self.name
175 }
176 /// Adds a key-value pair to `attributes`.
177 ///
178 /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
179 ///
180 /// <p>A map of attributes with their corresponding values.</p>
181 /// <p>The following lists names, descriptions, and values of the special request parameters that the <code>CreateTopic</code> action uses:</p>
182 /// <ul>
183 /// <li>
184 /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
185 /// <li>
186 /// <p><code>DisplayName</code> – The display name to use for a topic with SMS subscriptions.</p></li>
187 /// <li>
188 /// <p><code>FifoTopic</code> – Set to true to create a FIFO topic.</p></li>
189 /// <li>
190 /// <p><code>Policy</code> – The policy that defines who can access your topic. By default, only the topic owner can publish or subscribe to the topic.</p></li>
191 /// <li>
192 /// <p><code>SignatureVersion</code> – The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default, <code>SignatureVersion</code> is set to <code>1</code>.</p></li>
193 /// <li>
194 /// <p><code>TracingConfig</code> – Tracing mode of an Amazon SNS topic. By default <code>TracingConfig</code> is set to <code>PassThrough</code>, and the topic passes through the tracing header it receives from an Amazon SNS publisher to its subscriptions. If set to <code>Active</code>, Amazon SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true. This is only supported on standard topics.</p></li>
195 /// </ul>
196 /// <p>The following attribute applies only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html">server-side encryption</a>:</p>
197 /// <ul>
198 /// <li>
199 /// <p><code>KmsMasterKeyId</code> – The ID of an Amazon Web Services managed customer master key (CMK) for Amazon SNS or a custom CMK. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms">Key Terms</a>. For more examples, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters">KeyId</a> in the <i>Key Management Service API Reference</i>.</p></li>
200 /// </ul>
201 /// <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p>
202 /// <ul>
203 /// <li>
204 /// <p><code>ArchivePolicy</code> – The policy that sets the retention period for messages stored in the message archive of an Amazon SNS FIFO topic.</p></li>
205 /// <li>
206 /// <p><code>ContentBasedDeduplication</code> – Enables content-based deduplication for FIFO topics.</p>
207 /// <ul>
208 /// <li>
209 /// <p>By default, <code>ContentBasedDeduplication</code> is set to <code>false</code>. If you create a FIFO topic and this attribute is <code>false</code>, you must specify a value for the <code>MessageDeduplicationId</code> parameter for the <a href="https://docs.aws.amazon.com/sns/latest/api/API_Publish.html">Publish</a> action.</p></li>
210 /// <li>
211 /// <p>When you set <code>ContentBasedDeduplication</code> to <code>true</code>, Amazon SNS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p>
212 /// <p>(Optional) To override the generated value, you can specify a value for the <code>MessageDeduplicationId</code> parameter for the <code>Publish</code> action.</p></li>
213 /// </ul></li>
214 /// </ul>
215 /// <ul>
216 /// <li>
217 /// <p><code>FifoThroughputScope</code> – Enables higher throughput for your FIFO topic by adjusting the scope of deduplication. This attribute has two possible values:</p>
218 /// <ul>
219 /// <li>
220 /// <p><code>Topic</code> – The scope of message deduplication is across the entire topic. This is the default value and maintains existing behavior, with a maximum throughput of 3000 messages per second or 20MB per second, whichever comes first.</p></li>
221 /// <li>
222 /// <p><code>MessageGroup</code> – The scope of deduplication is within each individual message group, which enables higher throughput per topic subject to regional quotas. For more information on quotas or to request an increase, see <a href="https://docs.aws.amazon.com/general/latest/gr/sns.html">Amazon SNS service quotas</a> in the Amazon Web Services General Reference.</p></li>
223 /// </ul></li>
224 /// </ul>
225 pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
226 let mut hash_map = self.attributes.unwrap_or_default();
227 hash_map.insert(k.into(), v.into());
228 self.attributes = ::std::option::Option::Some(hash_map);
229 self
230 }
231 /// <p>A map of attributes with their corresponding values.</p>
232 /// <p>The following lists names, descriptions, and values of the special request parameters that the <code>CreateTopic</code> action uses:</p>
233 /// <ul>
234 /// <li>
235 /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
236 /// <li>
237 /// <p><code>DisplayName</code> – The display name to use for a topic with SMS subscriptions.</p></li>
238 /// <li>
239 /// <p><code>FifoTopic</code> – Set to true to create a FIFO topic.</p></li>
240 /// <li>
241 /// <p><code>Policy</code> – The policy that defines who can access your topic. By default, only the topic owner can publish or subscribe to the topic.</p></li>
242 /// <li>
243 /// <p><code>SignatureVersion</code> – The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default, <code>SignatureVersion</code> is set to <code>1</code>.</p></li>
244 /// <li>
245 /// <p><code>TracingConfig</code> – Tracing mode of an Amazon SNS topic. By default <code>TracingConfig</code> is set to <code>PassThrough</code>, and the topic passes through the tracing header it receives from an Amazon SNS publisher to its subscriptions. If set to <code>Active</code>, Amazon SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true. This is only supported on standard topics.</p></li>
246 /// </ul>
247 /// <p>The following attribute applies only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html">server-side encryption</a>:</p>
248 /// <ul>
249 /// <li>
250 /// <p><code>KmsMasterKeyId</code> – The ID of an Amazon Web Services managed customer master key (CMK) for Amazon SNS or a custom CMK. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms">Key Terms</a>. For more examples, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters">KeyId</a> in the <i>Key Management Service API Reference</i>.</p></li>
251 /// </ul>
252 /// <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p>
253 /// <ul>
254 /// <li>
255 /// <p><code>ArchivePolicy</code> – The policy that sets the retention period for messages stored in the message archive of an Amazon SNS FIFO topic.</p></li>
256 /// <li>
257 /// <p><code>ContentBasedDeduplication</code> – Enables content-based deduplication for FIFO topics.</p>
258 /// <ul>
259 /// <li>
260 /// <p>By default, <code>ContentBasedDeduplication</code> is set to <code>false</code>. If you create a FIFO topic and this attribute is <code>false</code>, you must specify a value for the <code>MessageDeduplicationId</code> parameter for the <a href="https://docs.aws.amazon.com/sns/latest/api/API_Publish.html">Publish</a> action.</p></li>
261 /// <li>
262 /// <p>When you set <code>ContentBasedDeduplication</code> to <code>true</code>, Amazon SNS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p>
263 /// <p>(Optional) To override the generated value, you can specify a value for the <code>MessageDeduplicationId</code> parameter for the <code>Publish</code> action.</p></li>
264 /// </ul></li>
265 /// </ul>
266 /// <ul>
267 /// <li>
268 /// <p><code>FifoThroughputScope</code> – Enables higher throughput for your FIFO topic by adjusting the scope of deduplication. This attribute has two possible values:</p>
269 /// <ul>
270 /// <li>
271 /// <p><code>Topic</code> – The scope of message deduplication is across the entire topic. This is the default value and maintains existing behavior, with a maximum throughput of 3000 messages per second or 20MB per second, whichever comes first.</p></li>
272 /// <li>
273 /// <p><code>MessageGroup</code> – The scope of deduplication is within each individual message group, which enables higher throughput per topic subject to regional quotas. For more information on quotas or to request an increase, see <a href="https://docs.aws.amazon.com/general/latest/gr/sns.html">Amazon SNS service quotas</a> in the Amazon Web Services General Reference.</p></li>
274 /// </ul></li>
275 /// </ul>
276 pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
277 self.attributes = input;
278 self
279 }
280 /// <p>A map of attributes with their corresponding values.</p>
281 /// <p>The following lists names, descriptions, and values of the special request parameters that the <code>CreateTopic</code> action uses:</p>
282 /// <ul>
283 /// <li>
284 /// <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li>
285 /// <li>
286 /// <p><code>DisplayName</code> – The display name to use for a topic with SMS subscriptions.</p></li>
287 /// <li>
288 /// <p><code>FifoTopic</code> – Set to true to create a FIFO topic.</p></li>
289 /// <li>
290 /// <p><code>Policy</code> – The policy that defines who can access your topic. By default, only the topic owner can publish or subscribe to the topic.</p></li>
291 /// <li>
292 /// <p><code>SignatureVersion</code> – The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default, <code>SignatureVersion</code> is set to <code>1</code>.</p></li>
293 /// <li>
294 /// <p><code>TracingConfig</code> – Tracing mode of an Amazon SNS topic. By default <code>TracingConfig</code> is set to <code>PassThrough</code>, and the topic passes through the tracing header it receives from an Amazon SNS publisher to its subscriptions. If set to <code>Active</code>, Amazon SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true. This is only supported on standard topics.</p></li>
295 /// </ul>
296 /// <p>The following attribute applies only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html">server-side encryption</a>:</p>
297 /// <ul>
298 /// <li>
299 /// <p><code>KmsMasterKeyId</code> – The ID of an Amazon Web Services managed customer master key (CMK) for Amazon SNS or a custom CMK. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms">Key Terms</a>. For more examples, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters">KeyId</a> in the <i>Key Management Service API Reference</i>.</p></li>
300 /// </ul>
301 /// <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p>
302 /// <ul>
303 /// <li>
304 /// <p><code>ArchivePolicy</code> – The policy that sets the retention period for messages stored in the message archive of an Amazon SNS FIFO topic.</p></li>
305 /// <li>
306 /// <p><code>ContentBasedDeduplication</code> – Enables content-based deduplication for FIFO topics.</p>
307 /// <ul>
308 /// <li>
309 /// <p>By default, <code>ContentBasedDeduplication</code> is set to <code>false</code>. If you create a FIFO topic and this attribute is <code>false</code>, you must specify a value for the <code>MessageDeduplicationId</code> parameter for the <a href="https://docs.aws.amazon.com/sns/latest/api/API_Publish.html">Publish</a> action.</p></li>
310 /// <li>
311 /// <p>When you set <code>ContentBasedDeduplication</code> to <code>true</code>, Amazon SNS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p>
312 /// <p>(Optional) To override the generated value, you can specify a value for the <code>MessageDeduplicationId</code> parameter for the <code>Publish</code> action.</p></li>
313 /// </ul></li>
314 /// </ul>
315 /// <ul>
316 /// <li>
317 /// <p><code>FifoThroughputScope</code> – Enables higher throughput for your FIFO topic by adjusting the scope of deduplication. This attribute has two possible values:</p>
318 /// <ul>
319 /// <li>
320 /// <p><code>Topic</code> – The scope of message deduplication is across the entire topic. This is the default value and maintains existing behavior, with a maximum throughput of 3000 messages per second or 20MB per second, whichever comes first.</p></li>
321 /// <li>
322 /// <p><code>MessageGroup</code> – The scope of deduplication is within each individual message group, which enables higher throughput per topic subject to regional quotas. For more information on quotas or to request an increase, see <a href="https://docs.aws.amazon.com/general/latest/gr/sns.html">Amazon SNS service quotas</a> in the Amazon Web Services General Reference.</p></li>
323 /// </ul></li>
324 /// </ul>
325 pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
326 &self.attributes
327 }
328 /// Appends an item to `tags`.
329 ///
330 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
331 ///
332 /// <p>The list of tags to add to a new topic.</p><note>
333 /// <p>To be able to tag a topic on creation, you must have the <code>sns:CreateTopic</code> and <code>sns:TagResource</code> permissions.</p>
334 /// </note>
335 pub fn tags(mut self, input: crate::types::Tag) -> Self {
336 let mut v = self.tags.unwrap_or_default();
337 v.push(input);
338 self.tags = ::std::option::Option::Some(v);
339 self
340 }
341 /// <p>The list of tags to add to a new topic.</p><note>
342 /// <p>To be able to tag a topic on creation, you must have the <code>sns:CreateTopic</code> and <code>sns:TagResource</code> permissions.</p>
343 /// </note>
344 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
345 self.tags = input;
346 self
347 }
348 /// <p>The list of tags to add to a new topic.</p><note>
349 /// <p>To be able to tag a topic on creation, you must have the <code>sns:CreateTopic</code> and <code>sns:TagResource</code> permissions.</p>
350 /// </note>
351 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
352 &self.tags
353 }
354 /// <p>The body of the policy document you want to use for this topic.</p>
355 /// <p>You can only add one policy per topic.</p>
356 /// <p>The policy must be in JSON string format.</p>
357 /// <p>Length Constraints: Maximum length of 30,720.</p>
358 pub fn data_protection_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
359 self.data_protection_policy = ::std::option::Option::Some(input.into());
360 self
361 }
362 /// <p>The body of the policy document you want to use for this topic.</p>
363 /// <p>You can only add one policy per topic.</p>
364 /// <p>The policy must be in JSON string format.</p>
365 /// <p>Length Constraints: Maximum length of 30,720.</p>
366 pub fn set_data_protection_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
367 self.data_protection_policy = input;
368 self
369 }
370 /// <p>The body of the policy document you want to use for this topic.</p>
371 /// <p>You can only add one policy per topic.</p>
372 /// <p>The policy must be in JSON string format.</p>
373 /// <p>Length Constraints: Maximum length of 30,720.</p>
374 pub fn get_data_protection_policy(&self) -> &::std::option::Option<::std::string::String> {
375 &self.data_protection_policy
376 }
377 /// Consumes the builder and constructs a [`CreateTopicInput`](crate::operation::create_topic::CreateTopicInput).
378 pub fn build(self) -> ::std::result::Result<crate::operation::create_topic::CreateTopicInput, ::aws_smithy_types::error::operation::BuildError> {
379 ::std::result::Result::Ok(crate::operation::create_topic::CreateTopicInput {
380 name: self.name,
381 attributes: self.attributes,
382 tags: self.tags,
383 data_protection_policy: self.data_protection_policy,
384 })
385 }
386}