aws_sdk_lexmodelsv2/types/
_analytics_intent_group_by_specification.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the category by which to group the intents.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AnalyticsIntentGroupBySpecification {
7    /// <p>Specifies whether to group the intent stages by their name or their end state.</p>
8    pub name: crate::types::AnalyticsIntentField,
9}
10impl AnalyticsIntentGroupBySpecification {
11    /// <p>Specifies whether to group the intent stages by their name or their end state.</p>
12    pub fn name(&self) -> &crate::types::AnalyticsIntentField {
13        &self.name
14    }
15}
16impl AnalyticsIntentGroupBySpecification {
17    /// Creates a new builder-style object to manufacture [`AnalyticsIntentGroupBySpecification`](crate::types::AnalyticsIntentGroupBySpecification).
18    pub fn builder() -> crate::types::builders::AnalyticsIntentGroupBySpecificationBuilder {
19        crate::types::builders::AnalyticsIntentGroupBySpecificationBuilder::default()
20    }
21}
22
23/// A builder for [`AnalyticsIntentGroupBySpecification`](crate::types::AnalyticsIntentGroupBySpecification).
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
25#[non_exhaustive]
26pub struct AnalyticsIntentGroupBySpecificationBuilder {
27    pub(crate) name: ::std::option::Option<crate::types::AnalyticsIntentField>,
28}
29impl AnalyticsIntentGroupBySpecificationBuilder {
30    /// <p>Specifies whether to group the intent stages by their name or their end state.</p>
31    /// This field is required.
32    pub fn name(mut self, input: crate::types::AnalyticsIntentField) -> Self {
33        self.name = ::std::option::Option::Some(input);
34        self
35    }
36    /// <p>Specifies whether to group the intent stages by their name or their end state.</p>
37    pub fn set_name(mut self, input: ::std::option::Option<crate::types::AnalyticsIntentField>) -> Self {
38        self.name = input;
39        self
40    }
41    /// <p>Specifies whether to group the intent stages by their name or their end state.</p>
42    pub fn get_name(&self) -> &::std::option::Option<crate::types::AnalyticsIntentField> {
43        &self.name
44    }
45    /// Consumes the builder and constructs a [`AnalyticsIntentGroupBySpecification`](crate::types::AnalyticsIntentGroupBySpecification).
46    /// This method will fail if any of the following fields are not set:
47    /// - [`name`](crate::types::builders::AnalyticsIntentGroupBySpecificationBuilder::name)
48    pub fn build(self) -> ::std::result::Result<crate::types::AnalyticsIntentGroupBySpecification, ::aws_smithy_types::error::operation::BuildError> {
49        ::std::result::Result::Ok(crate::types::AnalyticsIntentGroupBySpecification {
50            name: self.name.ok_or_else(|| {
51                ::aws_smithy_types::error::operation::BuildError::missing_field(
52                    "name",
53                    "name was not specified but it is required when building AnalyticsIntentGroupBySpecification",
54                )
55            })?,
56        })
57    }
58}