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

/// <p>Identifies the finding fields that the automation rule action updates when a finding matches the defined criteria.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AutomationRulesFindingFieldsUpdate {
    /// <p>The updated note.</p>
    pub note: ::std::option::Option<crate::types::NoteUpdate>,
    /// <p>Updates to the severity information for a finding.</p>
    pub severity: ::std::option::Option<crate::types::SeverityUpdate>,
    /// <p>The rule action updates the <code>VerificationState</code> field of a finding.</p>
    pub verification_state: ::std::option::Option<crate::types::VerificationState>,
    /// <p>The rule action updates the <code>Confidence</code> field of a finding.</p>
    pub confidence: ::std::option::Option<i32>,
    /// <p>The rule action updates the <code>Criticality</code> field of a finding.</p>
    pub criticality: ::std::option::Option<i32>,
    /// <p>The rule action updates the <code>Types</code> field of a finding.</p>
    pub types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The rule action updates the <code>UserDefinedFields</code> field of a finding.</p>
    pub user_defined_fields: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>Used to update information about the investigation into the finding.</p>
    pub workflow: ::std::option::Option<crate::types::WorkflowUpdate>,
    /// <p>The rule action updates the <code>RelatedFindings</code> field of a finding.</p>
    pub related_findings: ::std::option::Option<::std::vec::Vec<crate::types::RelatedFinding>>,
}
impl AutomationRulesFindingFieldsUpdate {
    /// <p>The updated note.</p>
    pub fn note(&self) -> ::std::option::Option<&crate::types::NoteUpdate> {
        self.note.as_ref()
    }
    /// <p>Updates to the severity information for a finding.</p>
    pub fn severity(&self) -> ::std::option::Option<&crate::types::SeverityUpdate> {
        self.severity.as_ref()
    }
    /// <p>The rule action updates the <code>VerificationState</code> field of a finding.</p>
    pub fn verification_state(&self) -> ::std::option::Option<&crate::types::VerificationState> {
        self.verification_state.as_ref()
    }
    /// <p>The rule action updates the <code>Confidence</code> field of a finding.</p>
    pub fn confidence(&self) -> ::std::option::Option<i32> {
        self.confidence
    }
    /// <p>The rule action updates the <code>Criticality</code> field of a finding.</p>
    pub fn criticality(&self) -> ::std::option::Option<i32> {
        self.criticality
    }
    /// <p>The rule action updates the <code>Types</code> field of a finding.</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 `.types.is_none()`.
    pub fn types(&self) -> &[::std::string::String] {
        self.types.as_deref().unwrap_or_default()
    }
    /// <p>The rule action updates the <code>UserDefinedFields</code> field of a finding.</p>
    pub fn user_defined_fields(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.user_defined_fields.as_ref()
    }
    /// <p>Used to update information about the investigation into the finding.</p>
    pub fn workflow(&self) -> ::std::option::Option<&crate::types::WorkflowUpdate> {
        self.workflow.as_ref()
    }
    /// <p>The rule action updates the <code>RelatedFindings</code> field of a finding.</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 `.related_findings.is_none()`.
    pub fn related_findings(&self) -> &[crate::types::RelatedFinding] {
        self.related_findings.as_deref().unwrap_or_default()
    }
}
impl AutomationRulesFindingFieldsUpdate {
    /// Creates a new builder-style object to manufacture [`AutomationRulesFindingFieldsUpdate`](crate::types::AutomationRulesFindingFieldsUpdate).
    pub fn builder() -> crate::types::builders::AutomationRulesFindingFieldsUpdateBuilder {
        crate::types::builders::AutomationRulesFindingFieldsUpdateBuilder::default()
    }
}

/// A builder for [`AutomationRulesFindingFieldsUpdate`](crate::types::AutomationRulesFindingFieldsUpdate).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AutomationRulesFindingFieldsUpdateBuilder {
    pub(crate) note: ::std::option::Option<crate::types::NoteUpdate>,
    pub(crate) severity: ::std::option::Option<crate::types::SeverityUpdate>,
    pub(crate) verification_state: ::std::option::Option<crate::types::VerificationState>,
    pub(crate) confidence: ::std::option::Option<i32>,
    pub(crate) criticality: ::std::option::Option<i32>,
    pub(crate) types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) user_defined_fields: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) workflow: ::std::option::Option<crate::types::WorkflowUpdate>,
    pub(crate) related_findings: ::std::option::Option<::std::vec::Vec<crate::types::RelatedFinding>>,
}
impl AutomationRulesFindingFieldsUpdateBuilder {
    /// <p>The updated note.</p>
    pub fn note(mut self, input: crate::types::NoteUpdate) -> Self {
        self.note = ::std::option::Option::Some(input);
        self
    }
    /// <p>The updated note.</p>
    pub fn set_note(mut self, input: ::std::option::Option<crate::types::NoteUpdate>) -> Self {
        self.note = input;
        self
    }
    /// <p>The updated note.</p>
    pub fn get_note(&self) -> &::std::option::Option<crate::types::NoteUpdate> {
        &self.note
    }
    /// <p>Updates to the severity information for a finding.</p>
    pub fn severity(mut self, input: crate::types::SeverityUpdate) -> Self {
        self.severity = ::std::option::Option::Some(input);
        self
    }
    /// <p>Updates to the severity information for a finding.</p>
    pub fn set_severity(mut self, input: ::std::option::Option<crate::types::SeverityUpdate>) -> Self {
        self.severity = input;
        self
    }
    /// <p>Updates to the severity information for a finding.</p>
    pub fn get_severity(&self) -> &::std::option::Option<crate::types::SeverityUpdate> {
        &self.severity
    }
    /// <p>The rule action updates the <code>VerificationState</code> field of a finding.</p>
    pub fn verification_state(mut self, input: crate::types::VerificationState) -> Self {
        self.verification_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The rule action updates the <code>VerificationState</code> field of a finding.</p>
    pub fn set_verification_state(mut self, input: ::std::option::Option<crate::types::VerificationState>) -> Self {
        self.verification_state = input;
        self
    }
    /// <p>The rule action updates the <code>VerificationState</code> field of a finding.</p>
    pub fn get_verification_state(&self) -> &::std::option::Option<crate::types::VerificationState> {
        &self.verification_state
    }
    /// <p>The rule action updates the <code>Confidence</code> field of a finding.</p>
    pub fn confidence(mut self, input: i32) -> Self {
        self.confidence = ::std::option::Option::Some(input);
        self
    }
    /// <p>The rule action updates the <code>Confidence</code> field of a finding.</p>
    pub fn set_confidence(mut self, input: ::std::option::Option<i32>) -> Self {
        self.confidence = input;
        self
    }
    /// <p>The rule action updates the <code>Confidence</code> field of a finding.</p>
    pub fn get_confidence(&self) -> &::std::option::Option<i32> {
        &self.confidence
    }
    /// <p>The rule action updates the <code>Criticality</code> field of a finding.</p>
    pub fn criticality(mut self, input: i32) -> Self {
        self.criticality = ::std::option::Option::Some(input);
        self
    }
    /// <p>The rule action updates the <code>Criticality</code> field of a finding.</p>
    pub fn set_criticality(mut self, input: ::std::option::Option<i32>) -> Self {
        self.criticality = input;
        self
    }
    /// <p>The rule action updates the <code>Criticality</code> field of a finding.</p>
    pub fn get_criticality(&self) -> &::std::option::Option<i32> {
        &self.criticality
    }
    /// Appends an item to `types`.
    ///
    /// To override the contents of this collection use [`set_types`](Self::set_types).
    ///
    /// <p>The rule action updates the <code>Types</code> field of a finding.</p>
    pub fn types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.types.unwrap_or_default();
        v.push(input.into());
        self.types = ::std::option::Option::Some(v);
        self
    }
    /// <p>The rule action updates the <code>Types</code> field of a finding.</p>
    pub fn set_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.types = input;
        self
    }
    /// <p>The rule action updates the <code>Types</code> field of a finding.</p>
    pub fn get_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.types
    }
    /// Adds a key-value pair to `user_defined_fields`.
    ///
    /// To override the contents of this collection use [`set_user_defined_fields`](Self::set_user_defined_fields).
    ///
    /// <p>The rule action updates the <code>UserDefinedFields</code> field of a finding.</p>
    pub fn user_defined_fields(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.user_defined_fields.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.user_defined_fields = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The rule action updates the <code>UserDefinedFields</code> field of a finding.</p>
    pub fn set_user_defined_fields(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.user_defined_fields = input;
        self
    }
    /// <p>The rule action updates the <code>UserDefinedFields</code> field of a finding.</p>
    pub fn get_user_defined_fields(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.user_defined_fields
    }
    /// <p>Used to update information about the investigation into the finding.</p>
    pub fn workflow(mut self, input: crate::types::WorkflowUpdate) -> Self {
        self.workflow = ::std::option::Option::Some(input);
        self
    }
    /// <p>Used to update information about the investigation into the finding.</p>
    pub fn set_workflow(mut self, input: ::std::option::Option<crate::types::WorkflowUpdate>) -> Self {
        self.workflow = input;
        self
    }
    /// <p>Used to update information about the investigation into the finding.</p>
    pub fn get_workflow(&self) -> &::std::option::Option<crate::types::WorkflowUpdate> {
        &self.workflow
    }
    /// Appends an item to `related_findings`.
    ///
    /// To override the contents of this collection use [`set_related_findings`](Self::set_related_findings).
    ///
    /// <p>The rule action updates the <code>RelatedFindings</code> field of a finding.</p>
    pub fn related_findings(mut self, input: crate::types::RelatedFinding) -> Self {
        let mut v = self.related_findings.unwrap_or_default();
        v.push(input);
        self.related_findings = ::std::option::Option::Some(v);
        self
    }
    /// <p>The rule action updates the <code>RelatedFindings</code> field of a finding.</p>
    pub fn set_related_findings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RelatedFinding>>) -> Self {
        self.related_findings = input;
        self
    }
    /// <p>The rule action updates the <code>RelatedFindings</code> field of a finding.</p>
    pub fn get_related_findings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RelatedFinding>> {
        &self.related_findings
    }
    /// Consumes the builder and constructs a [`AutomationRulesFindingFieldsUpdate`](crate::types::AutomationRulesFindingFieldsUpdate).
    pub fn build(self) -> crate::types::AutomationRulesFindingFieldsUpdate {
        crate::types::AutomationRulesFindingFieldsUpdate {
            note: self.note,
            severity: self.severity,
            verification_state: self.verification_state,
            confidence: self.confidence,
            criticality: self.criticality,
            types: self.types,
            user_defined_fields: self.user_defined_fields,
            workflow: self.workflow,
            related_findings: self.related_findings,
        }
    }
}