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

/// <p>Specifies criteria for sorting the results of a request for findings.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SortCriteria {
    /// <p>The name of the property to sort the results by. Valid values are: count, createdAt, policyDetails.action.apiCallDetails.firstSeen, policyDetails.action.apiCallDetails.lastSeen, resourcesAffected, severity.score, type, and updatedAt.</p>
    pub attribute_name: ::std::option::Option<::std::string::String>,
    /// <p>The sort order to apply to the results, based on the value for the property specified by the attributeName property. Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.</p>
    pub order_by: ::std::option::Option<crate::types::OrderBy>,
}
impl SortCriteria {
    /// <p>The name of the property to sort the results by. Valid values are: count, createdAt, policyDetails.action.apiCallDetails.firstSeen, policyDetails.action.apiCallDetails.lastSeen, resourcesAffected, severity.score, type, and updatedAt.</p>
    pub fn attribute_name(&self) -> ::std::option::Option<&str> {
        self.attribute_name.as_deref()
    }
    /// <p>The sort order to apply to the results, based on the value for the property specified by the attributeName property. Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.</p>
    pub fn order_by(&self) -> ::std::option::Option<&crate::types::OrderBy> {
        self.order_by.as_ref()
    }
}
impl SortCriteria {
    /// Creates a new builder-style object to manufacture [`SortCriteria`](crate::types::SortCriteria).
    pub fn builder() -> crate::types::builders::SortCriteriaBuilder {
        crate::types::builders::SortCriteriaBuilder::default()
    }
}

/// A builder for [`SortCriteria`](crate::types::SortCriteria).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SortCriteriaBuilder {
    pub(crate) attribute_name: ::std::option::Option<::std::string::String>,
    pub(crate) order_by: ::std::option::Option<crate::types::OrderBy>,
}
impl SortCriteriaBuilder {
    /// <p>The name of the property to sort the results by. Valid values are: count, createdAt, policyDetails.action.apiCallDetails.firstSeen, policyDetails.action.apiCallDetails.lastSeen, resourcesAffected, severity.score, type, and updatedAt.</p>
    pub fn attribute_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.attribute_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the property to sort the results by. Valid values are: count, createdAt, policyDetails.action.apiCallDetails.firstSeen, policyDetails.action.apiCallDetails.lastSeen, resourcesAffected, severity.score, type, and updatedAt.</p>
    pub fn set_attribute_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.attribute_name = input;
        self
    }
    /// <p>The name of the property to sort the results by. Valid values are: count, createdAt, policyDetails.action.apiCallDetails.firstSeen, policyDetails.action.apiCallDetails.lastSeen, resourcesAffected, severity.score, type, and updatedAt.</p>
    pub fn get_attribute_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.attribute_name
    }
    /// <p>The sort order to apply to the results, based on the value for the property specified by the attributeName property. Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.</p>
    pub fn order_by(mut self, input: crate::types::OrderBy) -> Self {
        self.order_by = ::std::option::Option::Some(input);
        self
    }
    /// <p>The sort order to apply to the results, based on the value for the property specified by the attributeName property. Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.</p>
    pub fn set_order_by(mut self, input: ::std::option::Option<crate::types::OrderBy>) -> Self {
        self.order_by = input;
        self
    }
    /// <p>The sort order to apply to the results, based on the value for the property specified by the attributeName property. Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.</p>
    pub fn get_order_by(&self) -> &::std::option::Option<crate::types::OrderBy> {
        &self.order_by
    }
    /// Consumes the builder and constructs a [`SortCriteria`](crate::types::SortCriteria).
    pub fn build(self) -> crate::types::SortCriteria {
        crate::types::SortCriteria {
            attribute_name: self.attribute_name,
            order_by: self.order_by,
        }
    }
}