Skip to main content

aws_sdk_lexmodelsv2/types/
_bot_version_replica_sort_by.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The sort category for the version replicated bots.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BotVersionReplicaSortBy {
7    /// <p>The attribute of the sort category for the version replicated bots.</p>
8    pub attribute: crate::types::BotVersionReplicaSortAttribute,
9    /// <p>The order of the sort category for the version replicated bots.</p>
10    pub order: crate::types::SortOrder,
11}
12impl BotVersionReplicaSortBy {
13    /// <p>The attribute of the sort category for the version replicated bots.</p>
14    pub fn attribute(&self) -> &crate::types::BotVersionReplicaSortAttribute {
15        &self.attribute
16    }
17    /// <p>The order of the sort category for the version replicated bots.</p>
18    pub fn order(&self) -> &crate::types::SortOrder {
19        &self.order
20    }
21}
22impl BotVersionReplicaSortBy {
23    /// Creates a new builder-style object to manufacture [`BotVersionReplicaSortBy`](crate::types::BotVersionReplicaSortBy).
24    pub fn builder() -> crate::types::builders::BotVersionReplicaSortByBuilder {
25        crate::types::builders::BotVersionReplicaSortByBuilder::default()
26    }
27}
28
29/// A builder for [`BotVersionReplicaSortBy`](crate::types::BotVersionReplicaSortBy).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct BotVersionReplicaSortByBuilder {
33    pub(crate) attribute: ::std::option::Option<crate::types::BotVersionReplicaSortAttribute>,
34    pub(crate) order: ::std::option::Option<crate::types::SortOrder>,
35}
36impl BotVersionReplicaSortByBuilder {
37    /// <p>The attribute of the sort category for the version replicated bots.</p>
38    /// This field is required.
39    pub fn attribute(mut self, input: crate::types::BotVersionReplicaSortAttribute) -> Self {
40        self.attribute = ::std::option::Option::Some(input);
41        self
42    }
43    /// <p>The attribute of the sort category for the version replicated bots.</p>
44    pub fn set_attribute(mut self, input: ::std::option::Option<crate::types::BotVersionReplicaSortAttribute>) -> Self {
45        self.attribute = input;
46        self
47    }
48    /// <p>The attribute of the sort category for the version replicated bots.</p>
49    pub fn get_attribute(&self) -> &::std::option::Option<crate::types::BotVersionReplicaSortAttribute> {
50        &self.attribute
51    }
52    /// <p>The order of the sort category for the version replicated bots.</p>
53    /// This field is required.
54    pub fn order(mut self, input: crate::types::SortOrder) -> Self {
55        self.order = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>The order of the sort category for the version replicated bots.</p>
59    pub fn set_order(mut self, input: ::std::option::Option<crate::types::SortOrder>) -> Self {
60        self.order = input;
61        self
62    }
63    /// <p>The order of the sort category for the version replicated bots.</p>
64    pub fn get_order(&self) -> &::std::option::Option<crate::types::SortOrder> {
65        &self.order
66    }
67    /// Consumes the builder and constructs a [`BotVersionReplicaSortBy`](crate::types::BotVersionReplicaSortBy).
68    /// This method will fail if any of the following fields are not set:
69    /// - [`attribute`](crate::types::builders::BotVersionReplicaSortByBuilder::attribute)
70    /// - [`order`](crate::types::builders::BotVersionReplicaSortByBuilder::order)
71    pub fn build(self) -> ::std::result::Result<crate::types::BotVersionReplicaSortBy, ::aws_smithy_types::error::operation::BuildError> {
72        ::std::result::Result::Ok(crate::types::BotVersionReplicaSortBy {
73            attribute: self.attribute.ok_or_else(|| {
74                ::aws_smithy_types::error::operation::BuildError::missing_field(
75                    "attribute",
76                    "attribute was not specified but it is required when building BotVersionReplicaSortBy",
77                )
78            })?,
79            order: self.order.ok_or_else(|| {
80                ::aws_smithy_types::error::operation::BuildError::missing_field(
81                    "order",
82                    "order was not specified but it is required when building BotVersionReplicaSortBy",
83                )
84            })?,
85        })
86    }
87}