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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Contains results that are output for the user turn by the test execution.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UserTurnOutputSpecification {
    /// <p>Contains information about the intent.</p>
    pub intent: ::std::option::Option<crate::types::UserTurnIntentOutput>,
    /// <p>The contexts that are active in the turn.</p>
    pub active_contexts: ::std::option::Option<::std::vec::Vec<crate::types::ActiveContext>>,
    /// <p>The transcript that is output for the user turn by the test execution.</p>
    pub transcript: ::std::option::Option<::std::string::String>,
}
impl UserTurnOutputSpecification {
    /// <p>Contains information about the intent.</p>
    pub fn intent(&self) -> ::std::option::Option<&crate::types::UserTurnIntentOutput> {
        self.intent.as_ref()
    }
    /// <p>The contexts that are active in the turn.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.active_contexts.is_none()`.
    pub fn active_contexts(&self) -> &[crate::types::ActiveContext] {
        self.active_contexts.as_deref().unwrap_or_default()
    }
    /// <p>The transcript that is output for the user turn by the test execution.</p>
    pub fn transcript(&self) -> ::std::option::Option<&str> {
        self.transcript.as_deref()
    }
}
impl UserTurnOutputSpecification {
    /// Creates a new builder-style object to manufacture [`UserTurnOutputSpecification`](crate::types::UserTurnOutputSpecification).
    pub fn builder() -> crate::types::builders::UserTurnOutputSpecificationBuilder {
        crate::types::builders::UserTurnOutputSpecificationBuilder::default()
    }
}

/// A builder for [`UserTurnOutputSpecification`](crate::types::UserTurnOutputSpecification).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct UserTurnOutputSpecificationBuilder {
    pub(crate) intent: ::std::option::Option<crate::types::UserTurnIntentOutput>,
    pub(crate) active_contexts: ::std::option::Option<::std::vec::Vec<crate::types::ActiveContext>>,
    pub(crate) transcript: ::std::option::Option<::std::string::String>,
}
impl UserTurnOutputSpecificationBuilder {
    /// <p>Contains information about the intent.</p>
    /// This field is required.
    pub fn intent(mut self, input: crate::types::UserTurnIntentOutput) -> Self {
        self.intent = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains information about the intent.</p>
    pub fn set_intent(mut self, input: ::std::option::Option<crate::types::UserTurnIntentOutput>) -> Self {
        self.intent = input;
        self
    }
    /// <p>Contains information about the intent.</p>
    pub fn get_intent(&self) -> &::std::option::Option<crate::types::UserTurnIntentOutput> {
        &self.intent
    }
    /// Appends an item to `active_contexts`.
    ///
    /// To override the contents of this collection use [`set_active_contexts`](Self::set_active_contexts).
    ///
    /// <p>The contexts that are active in the turn.</p>
    pub fn active_contexts(mut self, input: crate::types::ActiveContext) -> Self {
        let mut v = self.active_contexts.unwrap_or_default();
        v.push(input);
        self.active_contexts = ::std::option::Option::Some(v);
        self
    }
    /// <p>The contexts that are active in the turn.</p>
    pub fn set_active_contexts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ActiveContext>>) -> Self {
        self.active_contexts = input;
        self
    }
    /// <p>The contexts that are active in the turn.</p>
    pub fn get_active_contexts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ActiveContext>> {
        &self.active_contexts
    }
    /// <p>The transcript that is output for the user turn by the test execution.</p>
    pub fn transcript(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.transcript = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The transcript that is output for the user turn by the test execution.</p>
    pub fn set_transcript(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.transcript = input;
        self
    }
    /// <p>The transcript that is output for the user turn by the test execution.</p>
    pub fn get_transcript(&self) -> &::std::option::Option<::std::string::String> {
        &self.transcript
    }
    /// Consumes the builder and constructs a [`UserTurnOutputSpecification`](crate::types::UserTurnOutputSpecification).
    pub fn build(self) -> crate::types::UserTurnOutputSpecification {
        crate::types::UserTurnOutputSpecification {
            intent: self.intent,
            active_contexts: self.active_contexts,
            transcript: self.transcript,
        }
    }
}