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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A rule that controls access to mobile devices for an WorkMail group.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct MobileDeviceAccessRule {
    /// <p>The ID assigned to a mobile access rule.</p>
    pub mobile_device_access_rule_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of a mobile access rule.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The description of a mobile access rule.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The effect of the rule when it matches. Allowed values are <code>ALLOW</code> or <code>DENY</code>.</p>
    pub effect: ::std::option::Option<crate::types::MobileDeviceAccessRuleEffect>,
    /// <p>Device types that a rule will match.</p>
    pub device_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Device types that a rule <b>will not</b> match. All other device types will match.</p>
    pub not_device_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Device models that a rule will match.</p>
    pub device_models: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Device models that a rule <b>will not</b> match. All other device models will match.</p>
    pub not_device_models: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Device operating systems that a rule will match.</p>
    pub device_operating_systems: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Device operating systems that a rule <b>will not</b> match. All other device types will match.</p>
    pub not_device_operating_systems: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Device user agents that a rule will match.</p>
    pub device_user_agents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Device user agents that a rule <b>will not</b> match. All other device user agents will match.</p>
    pub not_device_user_agents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The date and time at which an access rule was created.</p>
    pub date_created: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time at which an access rule was modified.</p>
    pub date_modified: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl MobileDeviceAccessRule {
    /// <p>The ID assigned to a mobile access rule.</p>
    pub fn mobile_device_access_rule_id(&self) -> ::std::option::Option<&str> {
        self.mobile_device_access_rule_id.as_deref()
    }
    /// <p>The name of a mobile access rule.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The description of a mobile access rule.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The effect of the rule when it matches. Allowed values are <code>ALLOW</code> or <code>DENY</code>.</p>
    pub fn effect(&self) -> ::std::option::Option<&crate::types::MobileDeviceAccessRuleEffect> {
        self.effect.as_ref()
    }
    /// <p>Device types that a rule will match.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.device_types.is_none()`.
    pub fn device_types(&self) -> &[::std::string::String] {
        self.device_types.as_deref().unwrap_or_default()
    }
    /// <p>Device types that a rule <b>will not</b> match. All other device types will match.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.not_device_types.is_none()`.
    pub fn not_device_types(&self) -> &[::std::string::String] {
        self.not_device_types.as_deref().unwrap_or_default()
    }
    /// <p>Device models that a rule will match.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.device_models.is_none()`.
    pub fn device_models(&self) -> &[::std::string::String] {
        self.device_models.as_deref().unwrap_or_default()
    }
    /// <p>Device models that a rule <b>will not</b> match. All other device models will match.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.not_device_models.is_none()`.
    pub fn not_device_models(&self) -> &[::std::string::String] {
        self.not_device_models.as_deref().unwrap_or_default()
    }
    /// <p>Device operating systems that a rule will match.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.device_operating_systems.is_none()`.
    pub fn device_operating_systems(&self) -> &[::std::string::String] {
        self.device_operating_systems.as_deref().unwrap_or_default()
    }
    /// <p>Device operating systems that a rule <b>will not</b> match. All other device types will match.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.not_device_operating_systems.is_none()`.
    pub fn not_device_operating_systems(&self) -> &[::std::string::String] {
        self.not_device_operating_systems.as_deref().unwrap_or_default()
    }
    /// <p>Device user agents that a rule will match.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.device_user_agents.is_none()`.
    pub fn device_user_agents(&self) -> &[::std::string::String] {
        self.device_user_agents.as_deref().unwrap_or_default()
    }
    /// <p>Device user agents that a rule <b>will not</b> match. All other device user agents will match.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.not_device_user_agents.is_none()`.
    pub fn not_device_user_agents(&self) -> &[::std::string::String] {
        self.not_device_user_agents.as_deref().unwrap_or_default()
    }
    /// <p>The date and time at which an access rule was created.</p>
    pub fn date_created(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.date_created.as_ref()
    }
    /// <p>The date and time at which an access rule was modified.</p>
    pub fn date_modified(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.date_modified.as_ref()
    }
}
impl MobileDeviceAccessRule {
    /// Creates a new builder-style object to manufacture [`MobileDeviceAccessRule`](crate::types::MobileDeviceAccessRule).
    pub fn builder() -> crate::types::builders::MobileDeviceAccessRuleBuilder {
        crate::types::builders::MobileDeviceAccessRuleBuilder::default()
    }
}

/// A builder for [`MobileDeviceAccessRule`](crate::types::MobileDeviceAccessRule).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct MobileDeviceAccessRuleBuilder {
    pub(crate) mobile_device_access_rule_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) effect: ::std::option::Option<crate::types::MobileDeviceAccessRuleEffect>,
    pub(crate) device_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) not_device_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) device_models: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) not_device_models: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) device_operating_systems: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) not_device_operating_systems: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) device_user_agents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) not_device_user_agents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) date_created: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) date_modified: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl MobileDeviceAccessRuleBuilder {
    /// <p>The ID assigned to a mobile access rule.</p>
    pub fn mobile_device_access_rule_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.mobile_device_access_rule_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID assigned to a mobile access rule.</p>
    pub fn set_mobile_device_access_rule_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.mobile_device_access_rule_id = input;
        self
    }
    /// <p>The ID assigned to a mobile access rule.</p>
    pub fn get_mobile_device_access_rule_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.mobile_device_access_rule_id
    }
    /// <p>The name of a mobile access rule.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of a mobile access rule.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of a mobile access rule.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The description of a mobile access rule.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of a mobile access rule.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of a mobile access rule.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The effect of the rule when it matches. Allowed values are <code>ALLOW</code> or <code>DENY</code>.</p>
    pub fn effect(mut self, input: crate::types::MobileDeviceAccessRuleEffect) -> Self {
        self.effect = ::std::option::Option::Some(input);
        self
    }
    /// <p>The effect of the rule when it matches. Allowed values are <code>ALLOW</code> or <code>DENY</code>.</p>
    pub fn set_effect(mut self, input: ::std::option::Option<crate::types::MobileDeviceAccessRuleEffect>) -> Self {
        self.effect = input;
        self
    }
    /// <p>The effect of the rule when it matches. Allowed values are <code>ALLOW</code> or <code>DENY</code>.</p>
    pub fn get_effect(&self) -> &::std::option::Option<crate::types::MobileDeviceAccessRuleEffect> {
        &self.effect
    }
    /// Appends an item to `device_types`.
    ///
    /// To override the contents of this collection use [`set_device_types`](Self::set_device_types).
    ///
    /// <p>Device types that a rule will match.</p>
    pub fn device_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.device_types.unwrap_or_default();
        v.push(input.into());
        self.device_types = ::std::option::Option::Some(v);
        self
    }
    /// <p>Device types that a rule will match.</p>
    pub fn set_device_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.device_types = input;
        self
    }
    /// <p>Device types that a rule will match.</p>
    pub fn get_device_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.device_types
    }
    /// Appends an item to `not_device_types`.
    ///
    /// To override the contents of this collection use [`set_not_device_types`](Self::set_not_device_types).
    ///
    /// <p>Device types that a rule <b>will not</b> match. All other device types will match.</p>
    pub fn not_device_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.not_device_types.unwrap_or_default();
        v.push(input.into());
        self.not_device_types = ::std::option::Option::Some(v);
        self
    }
    /// <p>Device types that a rule <b>will not</b> match. All other device types will match.</p>
    pub fn set_not_device_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.not_device_types = input;
        self
    }
    /// <p>Device types that a rule <b>will not</b> match. All other device types will match.</p>
    pub fn get_not_device_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.not_device_types
    }
    /// Appends an item to `device_models`.
    ///
    /// To override the contents of this collection use [`set_device_models`](Self::set_device_models).
    ///
    /// <p>Device models that a rule will match.</p>
    pub fn device_models(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.device_models.unwrap_or_default();
        v.push(input.into());
        self.device_models = ::std::option::Option::Some(v);
        self
    }
    /// <p>Device models that a rule will match.</p>
    pub fn set_device_models(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.device_models = input;
        self
    }
    /// <p>Device models that a rule will match.</p>
    pub fn get_device_models(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.device_models
    }
    /// Appends an item to `not_device_models`.
    ///
    /// To override the contents of this collection use [`set_not_device_models`](Self::set_not_device_models).
    ///
    /// <p>Device models that a rule <b>will not</b> match. All other device models will match.</p>
    pub fn not_device_models(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.not_device_models.unwrap_or_default();
        v.push(input.into());
        self.not_device_models = ::std::option::Option::Some(v);
        self
    }
    /// <p>Device models that a rule <b>will not</b> match. All other device models will match.</p>
    pub fn set_not_device_models(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.not_device_models = input;
        self
    }
    /// <p>Device models that a rule <b>will not</b> match. All other device models will match.</p>
    pub fn get_not_device_models(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.not_device_models
    }
    /// Appends an item to `device_operating_systems`.
    ///
    /// To override the contents of this collection use [`set_device_operating_systems`](Self::set_device_operating_systems).
    ///
    /// <p>Device operating systems that a rule will match.</p>
    pub fn device_operating_systems(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.device_operating_systems.unwrap_or_default();
        v.push(input.into());
        self.device_operating_systems = ::std::option::Option::Some(v);
        self
    }
    /// <p>Device operating systems that a rule will match.</p>
    pub fn set_device_operating_systems(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.device_operating_systems = input;
        self
    }
    /// <p>Device operating systems that a rule will match.</p>
    pub fn get_device_operating_systems(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.device_operating_systems
    }
    /// Appends an item to `not_device_operating_systems`.
    ///
    /// To override the contents of this collection use [`set_not_device_operating_systems`](Self::set_not_device_operating_systems).
    ///
    /// <p>Device operating systems that a rule <b>will not</b> match. All other device types will match.</p>
    pub fn not_device_operating_systems(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.not_device_operating_systems.unwrap_or_default();
        v.push(input.into());
        self.not_device_operating_systems = ::std::option::Option::Some(v);
        self
    }
    /// <p>Device operating systems that a rule <b>will not</b> match. All other device types will match.</p>
    pub fn set_not_device_operating_systems(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.not_device_operating_systems = input;
        self
    }
    /// <p>Device operating systems that a rule <b>will not</b> match. All other device types will match.</p>
    pub fn get_not_device_operating_systems(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.not_device_operating_systems
    }
    /// Appends an item to `device_user_agents`.
    ///
    /// To override the contents of this collection use [`set_device_user_agents`](Self::set_device_user_agents).
    ///
    /// <p>Device user agents that a rule will match.</p>
    pub fn device_user_agents(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.device_user_agents.unwrap_or_default();
        v.push(input.into());
        self.device_user_agents = ::std::option::Option::Some(v);
        self
    }
    /// <p>Device user agents that a rule will match.</p>
    pub fn set_device_user_agents(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.device_user_agents = input;
        self
    }
    /// <p>Device user agents that a rule will match.</p>
    pub fn get_device_user_agents(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.device_user_agents
    }
    /// Appends an item to `not_device_user_agents`.
    ///
    /// To override the contents of this collection use [`set_not_device_user_agents`](Self::set_not_device_user_agents).
    ///
    /// <p>Device user agents that a rule <b>will not</b> match. All other device user agents will match.</p>
    pub fn not_device_user_agents(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.not_device_user_agents.unwrap_or_default();
        v.push(input.into());
        self.not_device_user_agents = ::std::option::Option::Some(v);
        self
    }
    /// <p>Device user agents that a rule <b>will not</b> match. All other device user agents will match.</p>
    pub fn set_not_device_user_agents(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.not_device_user_agents = input;
        self
    }
    /// <p>Device user agents that a rule <b>will not</b> match. All other device user agents will match.</p>
    pub fn get_not_device_user_agents(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.not_device_user_agents
    }
    /// <p>The date and time at which an access rule was created.</p>
    pub fn date_created(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.date_created = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time at which an access rule was created.</p>
    pub fn set_date_created(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.date_created = input;
        self
    }
    /// <p>The date and time at which an access rule was created.</p>
    pub fn get_date_created(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.date_created
    }
    /// <p>The date and time at which an access rule was modified.</p>
    pub fn date_modified(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.date_modified = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time at which an access rule was modified.</p>
    pub fn set_date_modified(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.date_modified = input;
        self
    }
    /// <p>The date and time at which an access rule was modified.</p>
    pub fn get_date_modified(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.date_modified
    }
    /// Consumes the builder and constructs a [`MobileDeviceAccessRule`](crate::types::MobileDeviceAccessRule).
    pub fn build(self) -> crate::types::MobileDeviceAccessRule {
        crate::types::MobileDeviceAccessRule {
            mobile_device_access_rule_id: self.mobile_device_access_rule_id,
            name: self.name,
            description: self.description,
            effect: self.effect,
            device_types: self.device_types,
            not_device_types: self.not_device_types,
            device_models: self.device_models,
            not_device_models: self.not_device_models,
            device_operating_systems: self.device_operating_systems,
            not_device_operating_systems: self.not_device_operating_systems,
            device_user_agents: self.device_user_agents,
            not_device_user_agents: self.not_device_user_agents,
            date_created: self.date_created,
            date_modified: self.date_modified,
        }
    }
}