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

/// <p>The override object.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct MobileDeviceAccessOverride {
    /// <p>The WorkMail user to which the access override applies.</p>
    pub user_id: ::std::option::Option<::std::string::String>,
    /// <p>The device to which the override applies.</p>
    pub device_id: ::std::option::Option<::std::string::String>,
    /// <p>The effect of the override, <code>ALLOW</code> or <code>DENY</code>.</p>
    pub effect: ::std::option::Option<crate::types::MobileDeviceAccessRuleEffect>,
    /// <p>A description of the override.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The date the override was first created.</p>
    pub date_created: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date the override was last modified.</p>
    pub date_modified: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl MobileDeviceAccessOverride {
    /// <p>The WorkMail user to which the access override applies.</p>
    pub fn user_id(&self) -> ::std::option::Option<&str> {
        self.user_id.as_deref()
    }
    /// <p>The device to which the override applies.</p>
    pub fn device_id(&self) -> ::std::option::Option<&str> {
        self.device_id.as_deref()
    }
    /// <p>The effect of the override, <code>ALLOW</code> or <code>DENY</code>.</p>
    pub fn effect(&self) -> ::std::option::Option<&crate::types::MobileDeviceAccessRuleEffect> {
        self.effect.as_ref()
    }
    /// <p>A description of the override.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The date the override was first created.</p>
    pub fn date_created(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.date_created.as_ref()
    }
    /// <p>The date the override was last modified.</p>
    pub fn date_modified(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.date_modified.as_ref()
    }
}
impl MobileDeviceAccessOverride {
    /// Creates a new builder-style object to manufacture [`MobileDeviceAccessOverride`](crate::types::MobileDeviceAccessOverride).
    pub fn builder() -> crate::types::builders::MobileDeviceAccessOverrideBuilder {
        crate::types::builders::MobileDeviceAccessOverrideBuilder::default()
    }
}

/// A builder for [`MobileDeviceAccessOverride`](crate::types::MobileDeviceAccessOverride).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct MobileDeviceAccessOverrideBuilder {
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) device_id: ::std::option::Option<::std::string::String>,
    pub(crate) effect: ::std::option::Option<crate::types::MobileDeviceAccessRuleEffect>,
    pub(crate) description: ::std::option::Option<::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 MobileDeviceAccessOverrideBuilder {
    /// <p>The WorkMail user to which the access override applies.</p>
    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The WorkMail user to which the access override applies.</p>
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_id = input;
        self
    }
    /// <p>The WorkMail user to which the access override applies.</p>
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// <p>The device to which the override applies.</p>
    pub fn device_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.device_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The device to which the override applies.</p>
    pub fn set_device_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.device_id = input;
        self
    }
    /// <p>The device to which the override applies.</p>
    pub fn get_device_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.device_id
    }
    /// <p>The effect of the override, <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 override, <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 override, <code>ALLOW</code> or <code>DENY</code>.</p>
    pub fn get_effect(&self) -> &::std::option::Option<crate::types::MobileDeviceAccessRuleEffect> {
        &self.effect
    }
    /// <p>A description of the override.</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>A description of the override.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the override.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The date the override was first 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 the override was first 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 the override was first created.</p>
    pub fn get_date_created(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.date_created
    }
    /// <p>The date the override was last 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 the override was last 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 the override was last modified.</p>
    pub fn get_date_modified(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.date_modified
    }
    /// Consumes the builder and constructs a [`MobileDeviceAccessOverride`](crate::types::MobileDeviceAccessOverride).
    pub fn build(self) -> crate::types::MobileDeviceAccessOverride {
        crate::types::MobileDeviceAccessOverride {
            user_id: self.user_id,
            device_id: self.device_id,
            effect: self.effect,
            description: self.description,
            date_created: self.date_created,
            date_modified: self.date_modified,
        }
    }
}