Skip to main content

aws_sdk_inspector/types/
_assessment_run_filter.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Used as the request parameter in the <code>ListAssessmentRuns</code> action.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AssessmentRunFilter {
7    /// <p>For a record to match a filter, an explicit value or a string containing a wildcard that is specified for this data type property must match the value of the <b>assessmentRunName</b> property of the <code>AssessmentRun</code> data type.</p>
8    pub name_pattern: ::std::option::Option<::std::string::String>,
9    /// <p>For a record to match a filter, one of the values specified for this data type property must be the exact match of the value of the <b>assessmentRunState</b> property of the <code>AssessmentRun</code> data type.</p>
10    pub states: ::std::option::Option<::std::vec::Vec<crate::types::AssessmentRunState>>,
11    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>durationInSeconds</b> property of the <code>AssessmentRun</code> data type.</p>
12    pub duration_range: ::std::option::Option<crate::types::DurationRange>,
13    /// <p>For a record to match a filter, the value that is specified for this data type property must be contained in the list of values of the <b>rulesPackages</b> property of the <code>AssessmentRun</code> data type.</p>
14    pub rules_package_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>startTime</b> property of the <code>AssessmentRun</code> data type.</p>
16    pub start_time_range: ::std::option::Option<crate::types::TimestampRange>,
17    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>completedAt</b> property of the <code>AssessmentRun</code> data type.</p>
18    pub completion_time_range: ::std::option::Option<crate::types::TimestampRange>,
19    /// <p>For a record to match a filter, the value that is specified for this data type property must match the <b>stateChangedAt</b> property of the <code>AssessmentRun</code> data type.</p>
20    pub state_change_time_range: ::std::option::Option<crate::types::TimestampRange>,
21}
22impl AssessmentRunFilter {
23    /// <p>For a record to match a filter, an explicit value or a string containing a wildcard that is specified for this data type property must match the value of the <b>assessmentRunName</b> property of the <code>AssessmentRun</code> data type.</p>
24    pub fn name_pattern(&self) -> ::std::option::Option<&str> {
25        self.name_pattern.as_deref()
26    }
27    /// <p>For a record to match a filter, one of the values specified for this data type property must be the exact match of the value of the <b>assessmentRunState</b> property of the <code>AssessmentRun</code> data type.</p>
28    ///
29    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.states.is_none()`.
30    pub fn states(&self) -> &[crate::types::AssessmentRunState] {
31        self.states.as_deref().unwrap_or_default()
32    }
33    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>durationInSeconds</b> property of the <code>AssessmentRun</code> data type.</p>
34    pub fn duration_range(&self) -> ::std::option::Option<&crate::types::DurationRange> {
35        self.duration_range.as_ref()
36    }
37    /// <p>For a record to match a filter, the value that is specified for this data type property must be contained in the list of values of the <b>rulesPackages</b> property of the <code>AssessmentRun</code> data type.</p>
38    ///
39    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.rules_package_arns.is_none()`.
40    pub fn rules_package_arns(&self) -> &[::std::string::String] {
41        self.rules_package_arns.as_deref().unwrap_or_default()
42    }
43    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>startTime</b> property of the <code>AssessmentRun</code> data type.</p>
44    pub fn start_time_range(&self) -> ::std::option::Option<&crate::types::TimestampRange> {
45        self.start_time_range.as_ref()
46    }
47    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>completedAt</b> property of the <code>AssessmentRun</code> data type.</p>
48    pub fn completion_time_range(&self) -> ::std::option::Option<&crate::types::TimestampRange> {
49        self.completion_time_range.as_ref()
50    }
51    /// <p>For a record to match a filter, the value that is specified for this data type property must match the <b>stateChangedAt</b> property of the <code>AssessmentRun</code> data type.</p>
52    pub fn state_change_time_range(&self) -> ::std::option::Option<&crate::types::TimestampRange> {
53        self.state_change_time_range.as_ref()
54    }
55}
56impl AssessmentRunFilter {
57    /// Creates a new builder-style object to manufacture [`AssessmentRunFilter`](crate::types::AssessmentRunFilter).
58    pub fn builder() -> crate::types::builders::AssessmentRunFilterBuilder {
59        crate::types::builders::AssessmentRunFilterBuilder::default()
60    }
61}
62
63/// A builder for [`AssessmentRunFilter`](crate::types::AssessmentRunFilter).
64#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
65#[non_exhaustive]
66pub struct AssessmentRunFilterBuilder {
67    pub(crate) name_pattern: ::std::option::Option<::std::string::String>,
68    pub(crate) states: ::std::option::Option<::std::vec::Vec<crate::types::AssessmentRunState>>,
69    pub(crate) duration_range: ::std::option::Option<crate::types::DurationRange>,
70    pub(crate) rules_package_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
71    pub(crate) start_time_range: ::std::option::Option<crate::types::TimestampRange>,
72    pub(crate) completion_time_range: ::std::option::Option<crate::types::TimestampRange>,
73    pub(crate) state_change_time_range: ::std::option::Option<crate::types::TimestampRange>,
74}
75impl AssessmentRunFilterBuilder {
76    /// <p>For a record to match a filter, an explicit value or a string containing a wildcard that is specified for this data type property must match the value of the <b>assessmentRunName</b> property of the <code>AssessmentRun</code> data type.</p>
77    pub fn name_pattern(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.name_pattern = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>For a record to match a filter, an explicit value or a string containing a wildcard that is specified for this data type property must match the value of the <b>assessmentRunName</b> property of the <code>AssessmentRun</code> data type.</p>
82    pub fn set_name_pattern(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.name_pattern = input;
84        self
85    }
86    /// <p>For a record to match a filter, an explicit value or a string containing a wildcard that is specified for this data type property must match the value of the <b>assessmentRunName</b> property of the <code>AssessmentRun</code> data type.</p>
87    pub fn get_name_pattern(&self) -> &::std::option::Option<::std::string::String> {
88        &self.name_pattern
89    }
90    /// Appends an item to `states`.
91    ///
92    /// To override the contents of this collection use [`set_states`](Self::set_states).
93    ///
94    /// <p>For a record to match a filter, one of the values specified for this data type property must be the exact match of the value of the <b>assessmentRunState</b> property of the <code>AssessmentRun</code> data type.</p>
95    pub fn states(mut self, input: crate::types::AssessmentRunState) -> Self {
96        let mut v = self.states.unwrap_or_default();
97        v.push(input);
98        self.states = ::std::option::Option::Some(v);
99        self
100    }
101    /// <p>For a record to match a filter, one of the values specified for this data type property must be the exact match of the value of the <b>assessmentRunState</b> property of the <code>AssessmentRun</code> data type.</p>
102    pub fn set_states(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssessmentRunState>>) -> Self {
103        self.states = input;
104        self
105    }
106    /// <p>For a record to match a filter, one of the values specified for this data type property must be the exact match of the value of the <b>assessmentRunState</b> property of the <code>AssessmentRun</code> data type.</p>
107    pub fn get_states(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssessmentRunState>> {
108        &self.states
109    }
110    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>durationInSeconds</b> property of the <code>AssessmentRun</code> data type.</p>
111    pub fn duration_range(mut self, input: crate::types::DurationRange) -> Self {
112        self.duration_range = ::std::option::Option::Some(input);
113        self
114    }
115    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>durationInSeconds</b> property of the <code>AssessmentRun</code> data type.</p>
116    pub fn set_duration_range(mut self, input: ::std::option::Option<crate::types::DurationRange>) -> Self {
117        self.duration_range = input;
118        self
119    }
120    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>durationInSeconds</b> property of the <code>AssessmentRun</code> data type.</p>
121    pub fn get_duration_range(&self) -> &::std::option::Option<crate::types::DurationRange> {
122        &self.duration_range
123    }
124    /// Appends an item to `rules_package_arns`.
125    ///
126    /// To override the contents of this collection use [`set_rules_package_arns`](Self::set_rules_package_arns).
127    ///
128    /// <p>For a record to match a filter, the value that is specified for this data type property must be contained in the list of values of the <b>rulesPackages</b> property of the <code>AssessmentRun</code> data type.</p>
129    pub fn rules_package_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        let mut v = self.rules_package_arns.unwrap_or_default();
131        v.push(input.into());
132        self.rules_package_arns = ::std::option::Option::Some(v);
133        self
134    }
135    /// <p>For a record to match a filter, the value that is specified for this data type property must be contained in the list of values of the <b>rulesPackages</b> property of the <code>AssessmentRun</code> data type.</p>
136    pub fn set_rules_package_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
137        self.rules_package_arns = input;
138        self
139    }
140    /// <p>For a record to match a filter, the value that is specified for this data type property must be contained in the list of values of the <b>rulesPackages</b> property of the <code>AssessmentRun</code> data type.</p>
141    pub fn get_rules_package_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
142        &self.rules_package_arns
143    }
144    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>startTime</b> property of the <code>AssessmentRun</code> data type.</p>
145    pub fn start_time_range(mut self, input: crate::types::TimestampRange) -> Self {
146        self.start_time_range = ::std::option::Option::Some(input);
147        self
148    }
149    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>startTime</b> property of the <code>AssessmentRun</code> data type.</p>
150    pub fn set_start_time_range(mut self, input: ::std::option::Option<crate::types::TimestampRange>) -> Self {
151        self.start_time_range = input;
152        self
153    }
154    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>startTime</b> property of the <code>AssessmentRun</code> data type.</p>
155    pub fn get_start_time_range(&self) -> &::std::option::Option<crate::types::TimestampRange> {
156        &self.start_time_range
157    }
158    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>completedAt</b> property of the <code>AssessmentRun</code> data type.</p>
159    pub fn completion_time_range(mut self, input: crate::types::TimestampRange) -> Self {
160        self.completion_time_range = ::std::option::Option::Some(input);
161        self
162    }
163    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>completedAt</b> property of the <code>AssessmentRun</code> data type.</p>
164    pub fn set_completion_time_range(mut self, input: ::std::option::Option<crate::types::TimestampRange>) -> Self {
165        self.completion_time_range = input;
166        self
167    }
168    /// <p>For a record to match a filter, the value that is specified for this data type property must inclusively match any value between the specified minimum and maximum values of the <b>completedAt</b> property of the <code>AssessmentRun</code> data type.</p>
169    pub fn get_completion_time_range(&self) -> &::std::option::Option<crate::types::TimestampRange> {
170        &self.completion_time_range
171    }
172    /// <p>For a record to match a filter, the value that is specified for this data type property must match the <b>stateChangedAt</b> property of the <code>AssessmentRun</code> data type.</p>
173    pub fn state_change_time_range(mut self, input: crate::types::TimestampRange) -> Self {
174        self.state_change_time_range = ::std::option::Option::Some(input);
175        self
176    }
177    /// <p>For a record to match a filter, the value that is specified for this data type property must match the <b>stateChangedAt</b> property of the <code>AssessmentRun</code> data type.</p>
178    pub fn set_state_change_time_range(mut self, input: ::std::option::Option<crate::types::TimestampRange>) -> Self {
179        self.state_change_time_range = input;
180        self
181    }
182    /// <p>For a record to match a filter, the value that is specified for this data type property must match the <b>stateChangedAt</b> property of the <code>AssessmentRun</code> data type.</p>
183    pub fn get_state_change_time_range(&self) -> &::std::option::Option<crate::types::TimestampRange> {
184        &self.state_change_time_range
185    }
186    /// Consumes the builder and constructs a [`AssessmentRunFilter`](crate::types::AssessmentRunFilter).
187    pub fn build(self) -> crate::types::AssessmentRunFilter {
188        crate::types::AssessmentRunFilter {
189            name_pattern: self.name_pattern,
190            states: self.states,
191            duration_range: self.duration_range,
192            rules_package_arns: self.rules_package_arns,
193            start_time_range: self.start_time_range,
194            completion_time_range: self.completion_time_range,
195            state_change_time_range: self.state_change_time_range,
196        }
197    }
198}