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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The current intent that Amazon Lex V2 is attempting to fulfill.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Intent {
/// <p>The name of the intent.</p>
pub name: ::std::string::String,
/// <p>A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.</p>
pub slots: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Slot>>,
/// <p>Indicates the fulfillment state for the intent. The meanings of each value are as follows:</p>
/// <ul>
/// <li>
/// <p><code>Failed</code> – The bot failed to fulfill the intent.</p></li>
/// <li>
/// <p><code>Fulfilled</code> – The bot has completed fulfillment of the intent.</p></li>
/// <li>
/// <p><code>FulfillmentInProgress</code> – The bot is in the middle of fulfilling the intent.</p></li>
/// <li>
/// <p><code>InProgress</code> – The bot is in the middle of eliciting the slot values that are necessary to fulfill the intent.</p></li>
/// <li>
/// <p><code>ReadyForFulfillment</code> – The bot has elicited all the slot values for the intent and is ready to fulfill the intent.</p></li>
/// <li>
/// <p><code>Waiting</code> – The bot is waiting for a response from the user (limited to streaming conversations).</p></li>
/// </ul>
pub state: ::std::option::Option<crate::types::IntentState>,
/// <p>Indicates whether the intent has been <code>Confirmed</code>, <code>Denied</code>, or <code>None</code> if the confirmation stage has not yet been reached.</p>
pub confirmation_state: ::std::option::Option<crate::types::ConfirmationState>,
}
impl Intent {
/// <p>The name of the intent.</p>
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
/// <p>A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.</p>
pub fn slots(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::Slot>> {
self.slots.as_ref()
}
/// <p>Indicates the fulfillment state for the intent. The meanings of each value are as follows:</p>
/// <ul>
/// <li>
/// <p><code>Failed</code> – The bot failed to fulfill the intent.</p></li>
/// <li>
/// <p><code>Fulfilled</code> – The bot has completed fulfillment of the intent.</p></li>
/// <li>
/// <p><code>FulfillmentInProgress</code> – The bot is in the middle of fulfilling the intent.</p></li>
/// <li>
/// <p><code>InProgress</code> – The bot is in the middle of eliciting the slot values that are necessary to fulfill the intent.</p></li>
/// <li>
/// <p><code>ReadyForFulfillment</code> – The bot has elicited all the slot values for the intent and is ready to fulfill the intent.</p></li>
/// <li>
/// <p><code>Waiting</code> – The bot is waiting for a response from the user (limited to streaming conversations).</p></li>
/// </ul>
pub fn state(&self) -> ::std::option::Option<&crate::types::IntentState> {
self.state.as_ref()
}
/// <p>Indicates whether the intent has been <code>Confirmed</code>, <code>Denied</code>, or <code>None</code> if the confirmation stage has not yet been reached.</p>
pub fn confirmation_state(&self) -> ::std::option::Option<&crate::types::ConfirmationState> {
self.confirmation_state.as_ref()
}
}
impl Intent {
/// Creates a new builder-style object to manufacture [`Intent`](crate::types::Intent).
pub fn builder() -> crate::types::builders::IntentBuilder {
crate::types::builders::IntentBuilder::default()
}
}
/// A builder for [`Intent`](crate::types::Intent).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct IntentBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) slots: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Slot>>,
pub(crate) state: ::std::option::Option<crate::types::IntentState>,
pub(crate) confirmation_state: ::std::option::Option<crate::types::ConfirmationState>,
}
impl IntentBuilder {
/// <p>The name of the intent.</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the intent.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the intent.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// Adds a key-value pair to `slots`.
///
/// To override the contents of this collection use [`set_slots`](Self::set_slots).
///
/// <p>A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.</p>
pub fn slots(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Slot) -> Self {
let mut hash_map = self.slots.unwrap_or_default();
hash_map.insert(k.into(), v);
self.slots = ::std::option::Option::Some(hash_map);
self
}
/// <p>A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.</p>
pub fn set_slots(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Slot>>) -> Self {
self.slots = input;
self
}
/// <p>A map of all of the slots for the intent. The name of the slot maps to the value of the slot. If a slot has not been filled, the value is null.</p>
pub fn get_slots(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Slot>> {
&self.slots
}
/// <p>Indicates the fulfillment state for the intent. The meanings of each value are as follows:</p>
/// <ul>
/// <li>
/// <p><code>Failed</code> – The bot failed to fulfill the intent.</p></li>
/// <li>
/// <p><code>Fulfilled</code> – The bot has completed fulfillment of the intent.</p></li>
/// <li>
/// <p><code>FulfillmentInProgress</code> – The bot is in the middle of fulfilling the intent.</p></li>
/// <li>
/// <p><code>InProgress</code> – The bot is in the middle of eliciting the slot values that are necessary to fulfill the intent.</p></li>
/// <li>
/// <p><code>ReadyForFulfillment</code> – The bot has elicited all the slot values for the intent and is ready to fulfill the intent.</p></li>
/// <li>
/// <p><code>Waiting</code> – The bot is waiting for a response from the user (limited to streaming conversations).</p></li>
/// </ul>
pub fn state(mut self, input: crate::types::IntentState) -> Self {
self.state = ::std::option::Option::Some(input);
self
}
/// <p>Indicates the fulfillment state for the intent. The meanings of each value are as follows:</p>
/// <ul>
/// <li>
/// <p><code>Failed</code> – The bot failed to fulfill the intent.</p></li>
/// <li>
/// <p><code>Fulfilled</code> – The bot has completed fulfillment of the intent.</p></li>
/// <li>
/// <p><code>FulfillmentInProgress</code> – The bot is in the middle of fulfilling the intent.</p></li>
/// <li>
/// <p><code>InProgress</code> – The bot is in the middle of eliciting the slot values that are necessary to fulfill the intent.</p></li>
/// <li>
/// <p><code>ReadyForFulfillment</code> – The bot has elicited all the slot values for the intent and is ready to fulfill the intent.</p></li>
/// <li>
/// <p><code>Waiting</code> – The bot is waiting for a response from the user (limited to streaming conversations).</p></li>
/// </ul>
pub fn set_state(mut self, input: ::std::option::Option<crate::types::IntentState>) -> Self {
self.state = input;
self
}
/// <p>Indicates the fulfillment state for the intent. The meanings of each value are as follows:</p>
/// <ul>
/// <li>
/// <p><code>Failed</code> – The bot failed to fulfill the intent.</p></li>
/// <li>
/// <p><code>Fulfilled</code> – The bot has completed fulfillment of the intent.</p></li>
/// <li>
/// <p><code>FulfillmentInProgress</code> – The bot is in the middle of fulfilling the intent.</p></li>
/// <li>
/// <p><code>InProgress</code> – The bot is in the middle of eliciting the slot values that are necessary to fulfill the intent.</p></li>
/// <li>
/// <p><code>ReadyForFulfillment</code> – The bot has elicited all the slot values for the intent and is ready to fulfill the intent.</p></li>
/// <li>
/// <p><code>Waiting</code> – The bot is waiting for a response from the user (limited to streaming conversations).</p></li>
/// </ul>
pub fn get_state(&self) -> &::std::option::Option<crate::types::IntentState> {
&self.state
}
/// <p>Indicates whether the intent has been <code>Confirmed</code>, <code>Denied</code>, or <code>None</code> if the confirmation stage has not yet been reached.</p>
pub fn confirmation_state(mut self, input: crate::types::ConfirmationState) -> Self {
self.confirmation_state = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether the intent has been <code>Confirmed</code>, <code>Denied</code>, or <code>None</code> if the confirmation stage has not yet been reached.</p>
pub fn set_confirmation_state(mut self, input: ::std::option::Option<crate::types::ConfirmationState>) -> Self {
self.confirmation_state = input;
self
}
/// <p>Indicates whether the intent has been <code>Confirmed</code>, <code>Denied</code>, or <code>None</code> if the confirmation stage has not yet been reached.</p>
pub fn get_confirmation_state(&self) -> &::std::option::Option<crate::types::ConfirmationState> {
&self.confirmation_state
}
/// Consumes the builder and constructs a [`Intent`](crate::types::Intent).
/// This method will fail if any of the following fields are not set:
/// - [`name`](crate::types::builders::IntentBuilder::name)
pub fn build(self) -> ::std::result::Result<crate::types::Intent, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Intent {
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building Intent",
)
})?,
slots: self.slots,
state: self.state,
confirmation_state: self.confirmation_state,
})
}
}