Skip to main content

aws_sdk_connect/operation/create_notification/
_create_notification_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 CreateNotificationInput {
6    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
7    pub instance_id: ::std::option::Option<::std::string::String>,
8    /// <p>The timestamp when the notification should expire and no longer be displayed to users. If not specified, defaults to one week from creation.</p>
9    pub expires_at: ::std::option::Option<::aws_smithy_types::DateTime>,
10    /// <p>A list of Amazon Resource Names (ARNs) identifying the recipients of the notification. Can include user ARNs or instance ARNs to target all users in an instance. Maximum of 200 recipients.</p>
11    pub recipients: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    /// <p>The priority level of the notification. Valid values are HIGH and LOW. High priority notifications are displayed above low priority notifications.</p>
13    pub priority: ::std::option::Option<crate::types::ConfigurableNotificationPriority>,
14    /// <p>The localized content of the notification. A map where keys are locale codes and values are the notification text in that locale. Content supports links. Maximum 250 characters per locale.</p>
15    pub content: ::std::option::Option<::std::collections::HashMap<crate::types::LocaleCode, ::std::string::String>>,
16    /// <p>The tags used to organize, track, or control access for this resource. For example, <code>{ "Tags": {"key1":"value1", "key2":"value2"} }</code>.</p>
17    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18    /// <p>The unique identifier for a notification.</p>
19    #[deprecated(note = "PredefinedNotificationId is deprecated. Use ClientToken for idempotency.", since = "3/13/2026")]
20    pub predefined_notification_id: ::std::option::Option<::std::string::String>,
21    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
22    pub client_token: ::std::option::Option<::std::string::String>,
23}
24impl CreateNotificationInput {
25    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
26    pub fn instance_id(&self) -> ::std::option::Option<&str> {
27        self.instance_id.as_deref()
28    }
29    /// <p>The timestamp when the notification should expire and no longer be displayed to users. If not specified, defaults to one week from creation.</p>
30    pub fn expires_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
31        self.expires_at.as_ref()
32    }
33    /// <p>A list of Amazon Resource Names (ARNs) identifying the recipients of the notification. Can include user ARNs or instance ARNs to target all users in an instance. Maximum of 200 recipients.</p>
34    ///
35    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.recipients.is_none()`.
36    pub fn recipients(&self) -> &[::std::string::String] {
37        self.recipients.as_deref().unwrap_or_default()
38    }
39    /// <p>The priority level of the notification. Valid values are HIGH and LOW. High priority notifications are displayed above low priority notifications.</p>
40    pub fn priority(&self) -> ::std::option::Option<&crate::types::ConfigurableNotificationPriority> {
41        self.priority.as_ref()
42    }
43    /// <p>The localized content of the notification. A map where keys are locale codes and values are the notification text in that locale. Content supports links. Maximum 250 characters per locale.</p>
44    pub fn content(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::LocaleCode, ::std::string::String>> {
45        self.content.as_ref()
46    }
47    /// <p>The tags used to organize, track, or control access for this resource. For example, <code>{ "Tags": {"key1":"value1", "key2":"value2"} }</code>.</p>
48    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
49        self.tags.as_ref()
50    }
51    /// <p>The unique identifier for a notification.</p>
52    #[deprecated(note = "PredefinedNotificationId is deprecated. Use ClientToken for idempotency.", since = "3/13/2026")]
53    pub fn predefined_notification_id(&self) -> ::std::option::Option<&str> {
54        self.predefined_notification_id.as_deref()
55    }
56    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
57    pub fn client_token(&self) -> ::std::option::Option<&str> {
58        self.client_token.as_deref()
59    }
60}
61impl CreateNotificationInput {
62    /// Creates a new builder-style object to manufacture [`CreateNotificationInput`](crate::operation::create_notification::CreateNotificationInput).
63    pub fn builder() -> crate::operation::create_notification::builders::CreateNotificationInputBuilder {
64        crate::operation::create_notification::builders::CreateNotificationInputBuilder::default()
65    }
66}
67
68/// A builder for [`CreateNotificationInput`](crate::operation::create_notification::CreateNotificationInput).
69#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
70#[non_exhaustive]
71pub struct CreateNotificationInputBuilder {
72    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
73    pub(crate) expires_at: ::std::option::Option<::aws_smithy_types::DateTime>,
74    pub(crate) recipients: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
75    pub(crate) priority: ::std::option::Option<crate::types::ConfigurableNotificationPriority>,
76    pub(crate) content: ::std::option::Option<::std::collections::HashMap<crate::types::LocaleCode, ::std::string::String>>,
77    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
78    pub(crate) predefined_notification_id: ::std::option::Option<::std::string::String>,
79    pub(crate) client_token: ::std::option::Option<::std::string::String>,
80}
81impl CreateNotificationInputBuilder {
82    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
83    /// This field is required.
84    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.instance_id = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
89    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.instance_id = input;
91        self
92    }
93    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
94    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
95        &self.instance_id
96    }
97    /// <p>The timestamp when the notification should expire and no longer be displayed to users. If not specified, defaults to one week from creation.</p>
98    pub fn expires_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
99        self.expires_at = ::std::option::Option::Some(input);
100        self
101    }
102    /// <p>The timestamp when the notification should expire and no longer be displayed to users. If not specified, defaults to one week from creation.</p>
103    pub fn set_expires_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
104        self.expires_at = input;
105        self
106    }
107    /// <p>The timestamp when the notification should expire and no longer be displayed to users. If not specified, defaults to one week from creation.</p>
108    pub fn get_expires_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
109        &self.expires_at
110    }
111    /// Appends an item to `recipients`.
112    ///
113    /// To override the contents of this collection use [`set_recipients`](Self::set_recipients).
114    ///
115    /// <p>A list of Amazon Resource Names (ARNs) identifying the recipients of the notification. Can include user ARNs or instance ARNs to target all users in an instance. Maximum of 200 recipients.</p>
116    pub fn recipients(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        let mut v = self.recipients.unwrap_or_default();
118        v.push(input.into());
119        self.recipients = ::std::option::Option::Some(v);
120        self
121    }
122    /// <p>A list of Amazon Resource Names (ARNs) identifying the recipients of the notification. Can include user ARNs or instance ARNs to target all users in an instance. Maximum of 200 recipients.</p>
123    pub fn set_recipients(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
124        self.recipients = input;
125        self
126    }
127    /// <p>A list of Amazon Resource Names (ARNs) identifying the recipients of the notification. Can include user ARNs or instance ARNs to target all users in an instance. Maximum of 200 recipients.</p>
128    pub fn get_recipients(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
129        &self.recipients
130    }
131    /// <p>The priority level of the notification. Valid values are HIGH and LOW. High priority notifications are displayed above low priority notifications.</p>
132    pub fn priority(mut self, input: crate::types::ConfigurableNotificationPriority) -> Self {
133        self.priority = ::std::option::Option::Some(input);
134        self
135    }
136    /// <p>The priority level of the notification. Valid values are HIGH and LOW. High priority notifications are displayed above low priority notifications.</p>
137    pub fn set_priority(mut self, input: ::std::option::Option<crate::types::ConfigurableNotificationPriority>) -> Self {
138        self.priority = input;
139        self
140    }
141    /// <p>The priority level of the notification. Valid values are HIGH and LOW. High priority notifications are displayed above low priority notifications.</p>
142    pub fn get_priority(&self) -> &::std::option::Option<crate::types::ConfigurableNotificationPriority> {
143        &self.priority
144    }
145    /// Adds a key-value pair to `content`.
146    ///
147    /// To override the contents of this collection use [`set_content`](Self::set_content).
148    ///
149    /// <p>The localized content of the notification. A map where keys are locale codes and values are the notification text in that locale. Content supports links. Maximum 250 characters per locale.</p>
150    pub fn content(mut self, k: crate::types::LocaleCode, v: impl ::std::convert::Into<::std::string::String>) -> Self {
151        let mut hash_map = self.content.unwrap_or_default();
152        hash_map.insert(k, v.into());
153        self.content = ::std::option::Option::Some(hash_map);
154        self
155    }
156    /// <p>The localized content of the notification. A map where keys are locale codes and values are the notification text in that locale. Content supports links. Maximum 250 characters per locale.</p>
157    pub fn set_content(mut self, input: ::std::option::Option<::std::collections::HashMap<crate::types::LocaleCode, ::std::string::String>>) -> Self {
158        self.content = input;
159        self
160    }
161    /// <p>The localized content of the notification. A map where keys are locale codes and values are the notification text in that locale. Content supports links. Maximum 250 characters per locale.</p>
162    pub fn get_content(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::LocaleCode, ::std::string::String>> {
163        &self.content
164    }
165    /// Adds a key-value pair to `tags`.
166    ///
167    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
168    ///
169    /// <p>The tags used to organize, track, or control access for this resource. For example, <code>{ "Tags": {"key1":"value1", "key2":"value2"} }</code>.</p>
170    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
171        let mut hash_map = self.tags.unwrap_or_default();
172        hash_map.insert(k.into(), v.into());
173        self.tags = ::std::option::Option::Some(hash_map);
174        self
175    }
176    /// <p>The tags used to organize, track, or control access for this resource. For example, <code>{ "Tags": {"key1":"value1", "key2":"value2"} }</code>.</p>
177    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
178        self.tags = input;
179        self
180    }
181    /// <p>The tags used to organize, track, or control access for this resource. For example, <code>{ "Tags": {"key1":"value1", "key2":"value2"} }</code>.</p>
182    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
183        &self.tags
184    }
185    /// <p>The unique identifier for a notification.</p>
186    #[deprecated(note = "PredefinedNotificationId is deprecated. Use ClientToken for idempotency.", since = "3/13/2026")]
187    pub fn predefined_notification_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.predefined_notification_id = ::std::option::Option::Some(input.into());
189        self
190    }
191    /// <p>The unique identifier for a notification.</p>
192    #[deprecated(note = "PredefinedNotificationId is deprecated. Use ClientToken for idempotency.", since = "3/13/2026")]
193    pub fn set_predefined_notification_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194        self.predefined_notification_id = input;
195        self
196    }
197    /// <p>The unique identifier for a notification.</p>
198    #[deprecated(note = "PredefinedNotificationId is deprecated. Use ClientToken for idempotency.", since = "3/13/2026")]
199    pub fn get_predefined_notification_id(&self) -> &::std::option::Option<::std::string::String> {
200        &self.predefined_notification_id
201    }
202    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
203    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204        self.client_token = ::std::option::Option::Some(input.into());
205        self
206    }
207    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
208    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209        self.client_token = input;
210        self
211    }
212    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
213    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
214        &self.client_token
215    }
216    /// Consumes the builder and constructs a [`CreateNotificationInput`](crate::operation::create_notification::CreateNotificationInput).
217    pub fn build(
218        self,
219    ) -> ::std::result::Result<crate::operation::create_notification::CreateNotificationInput, ::aws_smithy_types::error::operation::BuildError> {
220        ::std::result::Result::Ok(crate::operation::create_notification::CreateNotificationInput {
221            instance_id: self.instance_id,
222            expires_at: self.expires_at,
223            recipients: self.recipients,
224            priority: self.priority,
225            content: self.content,
226            tags: self.tags,
227            predefined_notification_id: self.predefined_notification_id,
228            client_token: self.client_token,
229        })
230    }
231}