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>The details for how to sort the data.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SortDefinition {
    /// <p>The key that's used to sort the data.</p>
    pub key: ::std::option::Option<::std::string::String>,
    /// <p>The order that's used to sort the data.</p>
    pub sort_order: ::std::option::Option<crate::types::SortOrder>,
}
impl SortDefinition {
    /// <p>The key that's used to sort the data.</p>
    pub fn key(&self) -> ::std::option::Option<&str> {
        self.key.as_deref()
    }
    /// <p>The order that's used to sort the data.</p>
    pub fn sort_order(&self) -> ::std::option::Option<&crate::types::SortOrder> {
        self.sort_order.as_ref()
    }
}
impl SortDefinition {
    /// Creates a new builder-style object to manufacture [`SortDefinition`](crate::types::SortDefinition).
    pub fn builder() -> crate::types::builders::SortDefinitionBuilder {
        crate::types::builders::SortDefinitionBuilder::default()
    }
}

/// A builder for [`SortDefinition`](crate::types::SortDefinition).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SortDefinitionBuilder {
    pub(crate) key: ::std::option::Option<::std::string::String>,
    pub(crate) sort_order: ::std::option::Option<crate::types::SortOrder>,
}
impl SortDefinitionBuilder {
    /// <p>The key that's used to sort the data.</p>
    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.key = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The key that's used to sort the data.</p>
    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.key = input;
        self
    }
    /// <p>The key that's used to sort the data.</p>
    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
        &self.key
    }
    /// <p>The order that's used to sort the data.</p>
    pub fn sort_order(mut self, input: crate::types::SortOrder) -> Self {
        self.sort_order = ::std::option::Option::Some(input);
        self
    }
    /// <p>The order that's used to sort the data.</p>
    pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SortOrder>) -> Self {
        self.sort_order = input;
        self
    }
    /// <p>The order that's used to sort the data.</p>
    pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SortOrder> {
        &self.sort_order
    }
    /// Consumes the builder and constructs a [`SortDefinition`](crate::types::SortDefinition).
    pub fn build(self) -> crate::types::SortDefinition {
        crate::types::SortDefinition {
            key: self.key,
            sort_order: self.sort_order,
        }
    }
}