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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Provides information about the status and settings of the APNs (Apple Push Notification service) channel for an application.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ApnsChannelResponse {
    /// <p>The unique identifier for the application that the APNs channel applies to.</p>
    #[doc(hidden)]
    pub application_id: std::option::Option<std::string::String>,
    /// <p>The date and time when the APNs channel was enabled.</p>
    #[doc(hidden)]
    pub creation_date: std::option::Option<std::string::String>,
    /// <p>The default authentication method that Amazon Pinpoint uses to authenticate with APNs for this channel, key or certificate.</p>
    #[doc(hidden)]
    pub default_authentication_method: std::option::Option<std::string::String>,
    /// <p>Specifies whether the APNs channel is enabled for the application.</p>
    #[doc(hidden)]
    pub enabled: bool,
    /// <p>(Not used) This property is retained only for backward compatibility.</p>
    #[doc(hidden)]
    pub has_credential: bool,
    /// <p>Specifies whether the APNs channel is configured to communicate with APNs by using APNs tokens. To provide an authentication key for APNs tokens, set the TokenKey property of the channel.</p>
    #[doc(hidden)]
    pub has_token_key: bool,
    /// <p>(Deprecated) An identifier for the APNs channel. This property is retained only for backward compatibility.</p>
    #[doc(hidden)]
    pub id: std::option::Option<std::string::String>,
    /// <p>Specifies whether the APNs channel is archived.</p>
    #[doc(hidden)]
    pub is_archived: bool,
    /// <p>The user who last modified the APNs channel.</p>
    #[doc(hidden)]
    pub last_modified_by: std::option::Option<std::string::String>,
    /// <p>The date and time when the APNs channel was last modified.</p>
    #[doc(hidden)]
    pub last_modified_date: std::option::Option<std::string::String>,
    /// <p>The type of messaging or notification platform for the channel. For the APNs channel, this value is APNS.</p>
    #[doc(hidden)]
    pub platform: std::option::Option<std::string::String>,
    /// <p>The current version of the APNs channel.</p>
    #[doc(hidden)]
    pub version: i32,
}
impl ApnsChannelResponse {
    /// <p>The unique identifier for the application that the APNs channel applies to.</p>
    pub fn application_id(&self) -> std::option::Option<&str> {
        self.application_id.as_deref()
    }
    /// <p>The date and time when the APNs channel was enabled.</p>
    pub fn creation_date(&self) -> std::option::Option<&str> {
        self.creation_date.as_deref()
    }
    /// <p>The default authentication method that Amazon Pinpoint uses to authenticate with APNs for this channel, key or certificate.</p>
    pub fn default_authentication_method(&self) -> std::option::Option<&str> {
        self.default_authentication_method.as_deref()
    }
    /// <p>Specifies whether the APNs channel is enabled for the application.</p>
    pub fn enabled(&self) -> bool {
        self.enabled
    }
    /// <p>(Not used) This property is retained only for backward compatibility.</p>
    pub fn has_credential(&self) -> bool {
        self.has_credential
    }
    /// <p>Specifies whether the APNs channel is configured to communicate with APNs by using APNs tokens. To provide an authentication key for APNs tokens, set the TokenKey property of the channel.</p>
    pub fn has_token_key(&self) -> bool {
        self.has_token_key
    }
    /// <p>(Deprecated) An identifier for the APNs channel. This property is retained only for backward compatibility.</p>
    pub fn id(&self) -> std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>Specifies whether the APNs channel is archived.</p>
    pub fn is_archived(&self) -> bool {
        self.is_archived
    }
    /// <p>The user who last modified the APNs channel.</p>
    pub fn last_modified_by(&self) -> std::option::Option<&str> {
        self.last_modified_by.as_deref()
    }
    /// <p>The date and time when the APNs channel was last modified.</p>
    pub fn last_modified_date(&self) -> std::option::Option<&str> {
        self.last_modified_date.as_deref()
    }
    /// <p>The type of messaging or notification platform for the channel. For the APNs channel, this value is APNS.</p>
    pub fn platform(&self) -> std::option::Option<&str> {
        self.platform.as_deref()
    }
    /// <p>The current version of the APNs channel.</p>
    pub fn version(&self) -> i32 {
        self.version
    }
}
impl ApnsChannelResponse {
    /// Creates a new builder-style object to manufacture [`ApnsChannelResponse`](crate::types::ApnsChannelResponse).
    pub fn builder() -> crate::types::builders::ApnsChannelResponseBuilder {
        crate::types::builders::ApnsChannelResponseBuilder::default()
    }
}

/// A builder for [`ApnsChannelResponse`](crate::types::ApnsChannelResponse).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct ApnsChannelResponseBuilder {
    pub(crate) application_id: std::option::Option<std::string::String>,
    pub(crate) creation_date: std::option::Option<std::string::String>,
    pub(crate) default_authentication_method: std::option::Option<std::string::String>,
    pub(crate) enabled: std::option::Option<bool>,
    pub(crate) has_credential: std::option::Option<bool>,
    pub(crate) has_token_key: std::option::Option<bool>,
    pub(crate) id: std::option::Option<std::string::String>,
    pub(crate) is_archived: std::option::Option<bool>,
    pub(crate) last_modified_by: std::option::Option<std::string::String>,
    pub(crate) last_modified_date: std::option::Option<std::string::String>,
    pub(crate) platform: std::option::Option<std::string::String>,
    pub(crate) version: std::option::Option<i32>,
}
impl ApnsChannelResponseBuilder {
    /// <p>The unique identifier for the application that the APNs channel applies to.</p>
    pub fn application_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.application_id = Some(input.into());
        self
    }
    /// <p>The unique identifier for the application that the APNs channel applies to.</p>
    pub fn set_application_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.application_id = input;
        self
    }
    /// <p>The date and time when the APNs channel was enabled.</p>
    pub fn creation_date(mut self, input: impl Into<std::string::String>) -> Self {
        self.creation_date = Some(input.into());
        self
    }
    /// <p>The date and time when the APNs channel was enabled.</p>
    pub fn set_creation_date(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.creation_date = input;
        self
    }
    /// <p>The default authentication method that Amazon Pinpoint uses to authenticate with APNs for this channel, key or certificate.</p>
    pub fn default_authentication_method(mut self, input: impl Into<std::string::String>) -> Self {
        self.default_authentication_method = Some(input.into());
        self
    }
    /// <p>The default authentication method that Amazon Pinpoint uses to authenticate with APNs for this channel, key or certificate.</p>
    pub fn set_default_authentication_method(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.default_authentication_method = input;
        self
    }
    /// <p>Specifies whether the APNs channel is enabled for the application.</p>
    pub fn enabled(mut self, input: bool) -> Self {
        self.enabled = Some(input);
        self
    }
    /// <p>Specifies whether the APNs channel is enabled for the application.</p>
    pub fn set_enabled(mut self, input: std::option::Option<bool>) -> Self {
        self.enabled = input;
        self
    }
    /// <p>(Not used) This property is retained only for backward compatibility.</p>
    pub fn has_credential(mut self, input: bool) -> Self {
        self.has_credential = Some(input);
        self
    }
    /// <p>(Not used) This property is retained only for backward compatibility.</p>
    pub fn set_has_credential(mut self, input: std::option::Option<bool>) -> Self {
        self.has_credential = input;
        self
    }
    /// <p>Specifies whether the APNs channel is configured to communicate with APNs by using APNs tokens. To provide an authentication key for APNs tokens, set the TokenKey property of the channel.</p>
    pub fn has_token_key(mut self, input: bool) -> Self {
        self.has_token_key = Some(input);
        self
    }
    /// <p>Specifies whether the APNs channel is configured to communicate with APNs by using APNs tokens. To provide an authentication key for APNs tokens, set the TokenKey property of the channel.</p>
    pub fn set_has_token_key(mut self, input: std::option::Option<bool>) -> Self {
        self.has_token_key = input;
        self
    }
    /// <p>(Deprecated) An identifier for the APNs channel. This property is retained only for backward compatibility.</p>
    pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
        self.id = Some(input.into());
        self
    }
    /// <p>(Deprecated) An identifier for the APNs channel. This property is retained only for backward compatibility.</p>
    pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>Specifies whether the APNs channel is archived.</p>
    pub fn is_archived(mut self, input: bool) -> Self {
        self.is_archived = Some(input);
        self
    }
    /// <p>Specifies whether the APNs channel is archived.</p>
    pub fn set_is_archived(mut self, input: std::option::Option<bool>) -> Self {
        self.is_archived = input;
        self
    }
    /// <p>The user who last modified the APNs channel.</p>
    pub fn last_modified_by(mut self, input: impl Into<std::string::String>) -> Self {
        self.last_modified_by = Some(input.into());
        self
    }
    /// <p>The user who last modified the APNs channel.</p>
    pub fn set_last_modified_by(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.last_modified_by = input;
        self
    }
    /// <p>The date and time when the APNs channel was last modified.</p>
    pub fn last_modified_date(mut self, input: impl Into<std::string::String>) -> Self {
        self.last_modified_date = Some(input.into());
        self
    }
    /// <p>The date and time when the APNs channel was last modified.</p>
    pub fn set_last_modified_date(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.last_modified_date = input;
        self
    }
    /// <p>The type of messaging or notification platform for the channel. For the APNs channel, this value is APNS.</p>
    pub fn platform(mut self, input: impl Into<std::string::String>) -> Self {
        self.platform = Some(input.into());
        self
    }
    /// <p>The type of messaging or notification platform for the channel. For the APNs channel, this value is APNS.</p>
    pub fn set_platform(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.platform = input;
        self
    }
    /// <p>The current version of the APNs channel.</p>
    pub fn version(mut self, input: i32) -> Self {
        self.version = Some(input);
        self
    }
    /// <p>The current version of the APNs channel.</p>
    pub fn set_version(mut self, input: std::option::Option<i32>) -> Self {
        self.version = input;
        self
    }
    /// Consumes the builder and constructs a [`ApnsChannelResponse`](crate::types::ApnsChannelResponse).
    pub fn build(self) -> crate::types::ApnsChannelResponse {
        crate::types::ApnsChannelResponse {
            application_id: self.application_id,
            creation_date: self.creation_date,
            default_authentication_method: self.default_authentication_method,
            enabled: self.enabled.unwrap_or_default(),
            has_credential: self.has_credential.unwrap_or_default(),
            has_token_key: self.has_token_key.unwrap_or_default(),
            id: self.id,
            is_archived: self.is_archived.unwrap_or_default(),
            last_modified_by: self.last_modified_by,
            last_modified_date: self.last_modified_date,
            platform: self.platform,
            version: self.version.unwrap_or_default(),
        }
    }
}