Skip to main content

aws_sdk_lexmodelsv2/types/
_utterance_data_sort_by.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object specifying the measure and method by which to sort the utterance data.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UtteranceDataSortBy {
7    /// <p>The measure by which to sort the utterance analytics data.</p>
8    /// <ul>
9    /// <li>
10    /// <p><code>Count</code> – The number of utterances.</p></li>
11    /// <li>
12    /// <p><code>UtteranceTimestamp</code> – The date and time of the utterance.</p></li>
13    /// </ul>
14    pub name: crate::types::AnalyticsUtteranceSortByName,
15    /// <p>Specifies whether to sort the results in ascending or descending order.</p>
16    pub order: crate::types::AnalyticsSortOrder,
17}
18impl UtteranceDataSortBy {
19    /// <p>The measure by which to sort the utterance analytics data.</p>
20    /// <ul>
21    /// <li>
22    /// <p><code>Count</code> – The number of utterances.</p></li>
23    /// <li>
24    /// <p><code>UtteranceTimestamp</code> – The date and time of the utterance.</p></li>
25    /// </ul>
26    pub fn name(&self) -> &crate::types::AnalyticsUtteranceSortByName {
27        &self.name
28    }
29    /// <p>Specifies whether to sort the results in ascending or descending order.</p>
30    pub fn order(&self) -> &crate::types::AnalyticsSortOrder {
31        &self.order
32    }
33}
34impl UtteranceDataSortBy {
35    /// Creates a new builder-style object to manufacture [`UtteranceDataSortBy`](crate::types::UtteranceDataSortBy).
36    pub fn builder() -> crate::types::builders::UtteranceDataSortByBuilder {
37        crate::types::builders::UtteranceDataSortByBuilder::default()
38    }
39}
40
41/// A builder for [`UtteranceDataSortBy`](crate::types::UtteranceDataSortBy).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct UtteranceDataSortByBuilder {
45    pub(crate) name: ::std::option::Option<crate::types::AnalyticsUtteranceSortByName>,
46    pub(crate) order: ::std::option::Option<crate::types::AnalyticsSortOrder>,
47}
48impl UtteranceDataSortByBuilder {
49    /// <p>The measure by which to sort the utterance analytics data.</p>
50    /// <ul>
51    /// <li>
52    /// <p><code>Count</code> – The number of utterances.</p></li>
53    /// <li>
54    /// <p><code>UtteranceTimestamp</code> – The date and time of the utterance.</p></li>
55    /// </ul>
56    /// This field is required.
57    pub fn name(mut self, input: crate::types::AnalyticsUtteranceSortByName) -> Self {
58        self.name = ::std::option::Option::Some(input);
59        self
60    }
61    /// <p>The measure by which to sort the utterance analytics data.</p>
62    /// <ul>
63    /// <li>
64    /// <p><code>Count</code> – The number of utterances.</p></li>
65    /// <li>
66    /// <p><code>UtteranceTimestamp</code> – The date and time of the utterance.</p></li>
67    /// </ul>
68    pub fn set_name(mut self, input: ::std::option::Option<crate::types::AnalyticsUtteranceSortByName>) -> Self {
69        self.name = input;
70        self
71    }
72    /// <p>The measure by which to sort the utterance analytics data.</p>
73    /// <ul>
74    /// <li>
75    /// <p><code>Count</code> – The number of utterances.</p></li>
76    /// <li>
77    /// <p><code>UtteranceTimestamp</code> – The date and time of the utterance.</p></li>
78    /// </ul>
79    pub fn get_name(&self) -> &::std::option::Option<crate::types::AnalyticsUtteranceSortByName> {
80        &self.name
81    }
82    /// <p>Specifies whether to sort the results in ascending or descending order.</p>
83    /// This field is required.
84    pub fn order(mut self, input: crate::types::AnalyticsSortOrder) -> Self {
85        self.order = ::std::option::Option::Some(input);
86        self
87    }
88    /// <p>Specifies whether to sort the results in ascending or descending order.</p>
89    pub fn set_order(mut self, input: ::std::option::Option<crate::types::AnalyticsSortOrder>) -> Self {
90        self.order = input;
91        self
92    }
93    /// <p>Specifies whether to sort the results in ascending or descending order.</p>
94    pub fn get_order(&self) -> &::std::option::Option<crate::types::AnalyticsSortOrder> {
95        &self.order
96    }
97    /// Consumes the builder and constructs a [`UtteranceDataSortBy`](crate::types::UtteranceDataSortBy).
98    /// This method will fail if any of the following fields are not set:
99    /// - [`name`](crate::types::builders::UtteranceDataSortByBuilder::name)
100    /// - [`order`](crate::types::builders::UtteranceDataSortByBuilder::order)
101    pub fn build(self) -> ::std::result::Result<crate::types::UtteranceDataSortBy, ::aws_smithy_types::error::operation::BuildError> {
102        ::std::result::Result::Ok(crate::types::UtteranceDataSortBy {
103            name: self.name.ok_or_else(|| {
104                ::aws_smithy_types::error::operation::BuildError::missing_field(
105                    "name",
106                    "name was not specified but it is required when building UtteranceDataSortBy",
107                )
108            })?,
109            order: self.order.ok_or_else(|| {
110                ::aws_smithy_types::error::operation::BuildError::missing_field(
111                    "order",
112                    "order was not specified but it is required when building UtteranceDataSortBy",
113                )
114            })?,
115        })
116    }
117}