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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Specifies the channel type and other settings for an endpoint.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EndpointRequest {
    /// <p>The destination address for messages or push notifications that you send to the endpoint. The address varies by channel. For a push-notification channel, use the token provided by the push notification service, such as an Apple Push Notification service (APNs) device token or a Firebase Cloud Messaging (FCM) registration token. For the SMS channel, use a phone number in E.164 format, such as +12065550100. For the email channel, use an email address.</p>
    pub address: ::std::option::Option<::std::string::String>,
    /// <p>One or more custom attributes that describe the endpoint by associating a name with an array of values. For example, the value of a custom attribute named Interests might be: ["Science", "Music", "Travel"]. You can use these attributes as filter criteria when you create segments. Attribute names are case sensitive.</p>
    /// <p>An attribute name can contain up to 50 characters. An attribute value can contain up to 100 characters. When you define the name of a custom attribute, avoid using the following characters: number sign (#), colon (:), question mark (?), backslash (\), and slash (/). The Amazon Pinpoint console can't display attribute names that contain these characters. This restriction doesn't apply to attribute values.</p>
    pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
    /// <p>The channel to use when sending messages or push notifications to the endpoint.</p>
    pub channel_type: ::std::option::Option<crate::types::ChannelType>,
    /// <p>The demographic information for the endpoint, such as the time zone and platform.</p>
    pub demographic: ::std::option::Option<crate::types::EndpointDemographic>,
    /// <p>The date and time, in ISO 8601 format, when the endpoint is updated.</p>
    pub effective_date: ::std::option::Option<::std::string::String>,
    /// <p>Specifies whether to send messages or push notifications to the endpoint. Valid values are: ACTIVE, messages are sent to the endpoint; and, INACTIVE, messages aren’t sent to the endpoint.</p>
    /// <p>Amazon Pinpoint automatically sets this value to ACTIVE when you create an endpoint or update an existing endpoint. Amazon Pinpoint automatically sets this value to INACTIVE if you update another endpoint that has the same address specified by the Address property.</p>
    pub endpoint_status: ::std::option::Option<::std::string::String>,
    /// <p>The geographic information for the endpoint.</p>
    pub location: ::std::option::Option<crate::types::EndpointLocation>,
    /// <p>One or more custom metrics that your app reports to Amazon Pinpoint for the endpoint.</p>
    pub metrics: ::std::option::Option<::std::collections::HashMap<::std::string::String, f64>>,
    /// <p>Specifies whether the user who's associated with the endpoint has opted out of receiving messages and push notifications from you. Possible values are: ALL, the user has opted out and doesn't want to receive any messages or push notifications; and, NONE, the user hasn't opted out and wants to receive all messages and push notifications.</p>
    pub opt_out: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier for the most recent request to update the endpoint.</p>
    pub request_id: ::std::option::Option<::std::string::String>,
    /// <p>One or more custom attributes that describe the user who's associated with the endpoint.</p>
    pub user: ::std::option::Option<crate::types::EndpointUser>,
}
impl EndpointRequest {
    /// <p>The destination address for messages or push notifications that you send to the endpoint. The address varies by channel. For a push-notification channel, use the token provided by the push notification service, such as an Apple Push Notification service (APNs) device token or a Firebase Cloud Messaging (FCM) registration token. For the SMS channel, use a phone number in E.164 format, such as +12065550100. For the email channel, use an email address.</p>
    pub fn address(&self) -> ::std::option::Option<&str> {
        self.address.as_deref()
    }
    /// <p>One or more custom attributes that describe the endpoint by associating a name with an array of values. For example, the value of a custom attribute named Interests might be: ["Science", "Music", "Travel"]. You can use these attributes as filter criteria when you create segments. Attribute names are case sensitive.</p>
    /// <p>An attribute name can contain up to 50 characters. An attribute value can contain up to 100 characters. When you define the name of a custom attribute, avoid using the following characters: number sign (#), colon (:), question mark (?), backslash (\), and slash (/). The Amazon Pinpoint console can't display attribute names that contain these characters. This restriction doesn't apply to attribute values.</p>
    pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
        self.attributes.as_ref()
    }
    /// <p>The channel to use when sending messages or push notifications to the endpoint.</p>
    pub fn channel_type(&self) -> ::std::option::Option<&crate::types::ChannelType> {
        self.channel_type.as_ref()
    }
    /// <p>The demographic information for the endpoint, such as the time zone and platform.</p>
    pub fn demographic(&self) -> ::std::option::Option<&crate::types::EndpointDemographic> {
        self.demographic.as_ref()
    }
    /// <p>The date and time, in ISO 8601 format, when the endpoint is updated.</p>
    pub fn effective_date(&self) -> ::std::option::Option<&str> {
        self.effective_date.as_deref()
    }
    /// <p>Specifies whether to send messages or push notifications to the endpoint. Valid values are: ACTIVE, messages are sent to the endpoint; and, INACTIVE, messages aren’t sent to the endpoint.</p>
    /// <p>Amazon Pinpoint automatically sets this value to ACTIVE when you create an endpoint or update an existing endpoint. Amazon Pinpoint automatically sets this value to INACTIVE if you update another endpoint that has the same address specified by the Address property.</p>
    pub fn endpoint_status(&self) -> ::std::option::Option<&str> {
        self.endpoint_status.as_deref()
    }
    /// <p>The geographic information for the endpoint.</p>
    pub fn location(&self) -> ::std::option::Option<&crate::types::EndpointLocation> {
        self.location.as_ref()
    }
    /// <p>One or more custom metrics that your app reports to Amazon Pinpoint for the endpoint.</p>
    pub fn metrics(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, f64>> {
        self.metrics.as_ref()
    }
    /// <p>Specifies whether the user who's associated with the endpoint has opted out of receiving messages and push notifications from you. Possible values are: ALL, the user has opted out and doesn't want to receive any messages or push notifications; and, NONE, the user hasn't opted out and wants to receive all messages and push notifications.</p>
    pub fn opt_out(&self) -> ::std::option::Option<&str> {
        self.opt_out.as_deref()
    }
    /// <p>The unique identifier for the most recent request to update the endpoint.</p>
    pub fn request_id(&self) -> ::std::option::Option<&str> {
        self.request_id.as_deref()
    }
    /// <p>One or more custom attributes that describe the user who's associated with the endpoint.</p>
    pub fn user(&self) -> ::std::option::Option<&crate::types::EndpointUser> {
        self.user.as_ref()
    }
}
impl EndpointRequest {
    /// Creates a new builder-style object to manufacture [`EndpointRequest`](crate::types::EndpointRequest).
    pub fn builder() -> crate::types::builders::EndpointRequestBuilder {
        crate::types::builders::EndpointRequestBuilder::default()
    }
}

/// A builder for [`EndpointRequest`](crate::types::EndpointRequest).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct EndpointRequestBuilder {
    pub(crate) address: ::std::option::Option<::std::string::String>,
    pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
    pub(crate) channel_type: ::std::option::Option<crate::types::ChannelType>,
    pub(crate) demographic: ::std::option::Option<crate::types::EndpointDemographic>,
    pub(crate) effective_date: ::std::option::Option<::std::string::String>,
    pub(crate) endpoint_status: ::std::option::Option<::std::string::String>,
    pub(crate) location: ::std::option::Option<crate::types::EndpointLocation>,
    pub(crate) metrics: ::std::option::Option<::std::collections::HashMap<::std::string::String, f64>>,
    pub(crate) opt_out: ::std::option::Option<::std::string::String>,
    pub(crate) request_id: ::std::option::Option<::std::string::String>,
    pub(crate) user: ::std::option::Option<crate::types::EndpointUser>,
}
impl EndpointRequestBuilder {
    /// <p>The destination address for messages or push notifications that you send to the endpoint. The address varies by channel. For a push-notification channel, use the token provided by the push notification service, such as an Apple Push Notification service (APNs) device token or a Firebase Cloud Messaging (FCM) registration token. For the SMS channel, use a phone number in E.164 format, such as +12065550100. For the email channel, use an email address.</p>
    pub fn address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.address = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The destination address for messages or push notifications that you send to the endpoint. The address varies by channel. For a push-notification channel, use the token provided by the push notification service, such as an Apple Push Notification service (APNs) device token or a Firebase Cloud Messaging (FCM) registration token. For the SMS channel, use a phone number in E.164 format, such as +12065550100. For the email channel, use an email address.</p>
    pub fn set_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.address = input;
        self
    }
    /// <p>The destination address for messages or push notifications that you send to the endpoint. The address varies by channel. For a push-notification channel, use the token provided by the push notification service, such as an Apple Push Notification service (APNs) device token or a Firebase Cloud Messaging (FCM) registration token. For the SMS channel, use a phone number in E.164 format, such as +12065550100. For the email channel, use an email address.</p>
    pub fn get_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.address
    }
    /// Adds a key-value pair to `attributes`.
    ///
    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
    ///
    /// <p>One or more custom attributes that describe the endpoint by associating a name with an array of values. For example, the value of a custom attribute named Interests might be: ["Science", "Music", "Travel"]. You can use these attributes as filter criteria when you create segments. Attribute names are case sensitive.</p>
    /// <p>An attribute name can contain up to 50 characters. An attribute value can contain up to 100 characters. When you define the name of a custom attribute, avoid using the following characters: number sign (#), colon (:), question mark (?), backslash (\), and slash (/). The Amazon Pinpoint console can't display attribute names that contain these characters. This restriction doesn't apply to attribute values.</p>
    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
        let mut hash_map = self.attributes.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.attributes = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>One or more custom attributes that describe the endpoint by associating a name with an array of values. For example, the value of a custom attribute named Interests might be: ["Science", "Music", "Travel"]. You can use these attributes as filter criteria when you create segments. Attribute names are case sensitive.</p>
    /// <p>An attribute name can contain up to 50 characters. An attribute value can contain up to 100 characters. When you define the name of a custom attribute, avoid using the following characters: number sign (#), colon (:), question mark (?), backslash (\), and slash (/). The Amazon Pinpoint console can't display attribute names that contain these characters. This restriction doesn't apply to attribute values.</p>
    pub fn set_attributes(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
    ) -> Self {
        self.attributes = input;
        self
    }
    /// <p>One or more custom attributes that describe the endpoint by associating a name with an array of values. For example, the value of a custom attribute named Interests might be: ["Science", "Music", "Travel"]. You can use these attributes as filter criteria when you create segments. Attribute names are case sensitive.</p>
    /// <p>An attribute name can contain up to 50 characters. An attribute value can contain up to 100 characters. When you define the name of a custom attribute, avoid using the following characters: number sign (#), colon (:), question mark (?), backslash (\), and slash (/). The Amazon Pinpoint console can't display attribute names that contain these characters. This restriction doesn't apply to attribute values.</p>
    pub fn get_attributes(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
        &self.attributes
    }
    /// <p>The channel to use when sending messages or push notifications to the endpoint.</p>
    pub fn channel_type(mut self, input: crate::types::ChannelType) -> Self {
        self.channel_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The channel to use when sending messages or push notifications to the endpoint.</p>
    pub fn set_channel_type(mut self, input: ::std::option::Option<crate::types::ChannelType>) -> Self {
        self.channel_type = input;
        self
    }
    /// <p>The channel to use when sending messages or push notifications to the endpoint.</p>
    pub fn get_channel_type(&self) -> &::std::option::Option<crate::types::ChannelType> {
        &self.channel_type
    }
    /// <p>The demographic information for the endpoint, such as the time zone and platform.</p>
    pub fn demographic(mut self, input: crate::types::EndpointDemographic) -> Self {
        self.demographic = ::std::option::Option::Some(input);
        self
    }
    /// <p>The demographic information for the endpoint, such as the time zone and platform.</p>
    pub fn set_demographic(mut self, input: ::std::option::Option<crate::types::EndpointDemographic>) -> Self {
        self.demographic = input;
        self
    }
    /// <p>The demographic information for the endpoint, such as the time zone and platform.</p>
    pub fn get_demographic(&self) -> &::std::option::Option<crate::types::EndpointDemographic> {
        &self.demographic
    }
    /// <p>The date and time, in ISO 8601 format, when the endpoint is updated.</p>
    pub fn effective_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.effective_date = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The date and time, in ISO 8601 format, when the endpoint is updated.</p>
    pub fn set_effective_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.effective_date = input;
        self
    }
    /// <p>The date and time, in ISO 8601 format, when the endpoint is updated.</p>
    pub fn get_effective_date(&self) -> &::std::option::Option<::std::string::String> {
        &self.effective_date
    }
    /// <p>Specifies whether to send messages or push notifications to the endpoint. Valid values are: ACTIVE, messages are sent to the endpoint; and, INACTIVE, messages aren’t sent to the endpoint.</p>
    /// <p>Amazon Pinpoint automatically sets this value to ACTIVE when you create an endpoint or update an existing endpoint. Amazon Pinpoint automatically sets this value to INACTIVE if you update another endpoint that has the same address specified by the Address property.</p>
    pub fn endpoint_status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.endpoint_status = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies whether to send messages or push notifications to the endpoint. Valid values are: ACTIVE, messages are sent to the endpoint; and, INACTIVE, messages aren’t sent to the endpoint.</p>
    /// <p>Amazon Pinpoint automatically sets this value to ACTIVE when you create an endpoint or update an existing endpoint. Amazon Pinpoint automatically sets this value to INACTIVE if you update another endpoint that has the same address specified by the Address property.</p>
    pub fn set_endpoint_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.endpoint_status = input;
        self
    }
    /// <p>Specifies whether to send messages or push notifications to the endpoint. Valid values are: ACTIVE, messages are sent to the endpoint; and, INACTIVE, messages aren’t sent to the endpoint.</p>
    /// <p>Amazon Pinpoint automatically sets this value to ACTIVE when you create an endpoint or update an existing endpoint. Amazon Pinpoint automatically sets this value to INACTIVE if you update another endpoint that has the same address specified by the Address property.</p>
    pub fn get_endpoint_status(&self) -> &::std::option::Option<::std::string::String> {
        &self.endpoint_status
    }
    /// <p>The geographic information for the endpoint.</p>
    pub fn location(mut self, input: crate::types::EndpointLocation) -> Self {
        self.location = ::std::option::Option::Some(input);
        self
    }
    /// <p>The geographic information for the endpoint.</p>
    pub fn set_location(mut self, input: ::std::option::Option<crate::types::EndpointLocation>) -> Self {
        self.location = input;
        self
    }
    /// <p>The geographic information for the endpoint.</p>
    pub fn get_location(&self) -> &::std::option::Option<crate::types::EndpointLocation> {
        &self.location
    }
    /// Adds a key-value pair to `metrics`.
    ///
    /// To override the contents of this collection use [`set_metrics`](Self::set_metrics).
    ///
    /// <p>One or more custom metrics that your app reports to Amazon Pinpoint for the endpoint.</p>
    pub fn metrics(mut self, k: impl ::std::convert::Into<::std::string::String>, v: f64) -> Self {
        let mut hash_map = self.metrics.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.metrics = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>One or more custom metrics that your app reports to Amazon Pinpoint for the endpoint.</p>
    pub fn set_metrics(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, f64>>) -> Self {
        self.metrics = input;
        self
    }
    /// <p>One or more custom metrics that your app reports to Amazon Pinpoint for the endpoint.</p>
    pub fn get_metrics(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, f64>> {
        &self.metrics
    }
    /// <p>Specifies whether the user who's associated with the endpoint has opted out of receiving messages and push notifications from you. Possible values are: ALL, the user has opted out and doesn't want to receive any messages or push notifications; and, NONE, the user hasn't opted out and wants to receive all messages and push notifications.</p>
    pub fn opt_out(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.opt_out = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies whether the user who's associated with the endpoint has opted out of receiving messages and push notifications from you. Possible values are: ALL, the user has opted out and doesn't want to receive any messages or push notifications; and, NONE, the user hasn't opted out and wants to receive all messages and push notifications.</p>
    pub fn set_opt_out(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.opt_out = input;
        self
    }
    /// <p>Specifies whether the user who's associated with the endpoint has opted out of receiving messages and push notifications from you. Possible values are: ALL, the user has opted out and doesn't want to receive any messages or push notifications; and, NONE, the user hasn't opted out and wants to receive all messages and push notifications.</p>
    pub fn get_opt_out(&self) -> &::std::option::Option<::std::string::String> {
        &self.opt_out
    }
    /// <p>The unique identifier for the most recent request to update the endpoint.</p>
    pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.request_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier for the most recent request to update the endpoint.</p>
    pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.request_id = input;
        self
    }
    /// <p>The unique identifier for the most recent request to update the endpoint.</p>
    pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.request_id
    }
    /// <p>One or more custom attributes that describe the user who's associated with the endpoint.</p>
    pub fn user(mut self, input: crate::types::EndpointUser) -> Self {
        self.user = ::std::option::Option::Some(input);
        self
    }
    /// <p>One or more custom attributes that describe the user who's associated with the endpoint.</p>
    pub fn set_user(mut self, input: ::std::option::Option<crate::types::EndpointUser>) -> Self {
        self.user = input;
        self
    }
    /// <p>One or more custom attributes that describe the user who's associated with the endpoint.</p>
    pub fn get_user(&self) -> &::std::option::Option<crate::types::EndpointUser> {
        &self.user
    }
    /// Consumes the builder and constructs a [`EndpointRequest`](crate::types::EndpointRequest).
    pub fn build(self) -> crate::types::EndpointRequest {
        crate::types::EndpointRequest {
            address: self.address,
            attributes: self.attributes,
            channel_type: self.channel_type,
            demographic: self.demographic,
            effective_date: self.effective_date,
            endpoint_status: self.endpoint_status,
            location: self.location,
            metrics: self.metrics,
            opt_out: self.opt_out,
            request_id: self.request_id,
            user: self.user,
        }
    }
}