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 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutSessionInput {
/// <p>The identifier of the bot that receives the session data.</p>
pub bot_id: ::std::option::Option<::std::string::String>,
/// <p>The alias identifier of the bot that receives the session data.</p>
pub bot_alias_id: ::std::option::Option<::std::string::String>,
/// <p>The locale where the session is in use.</p>
pub locale_id: ::std::option::Option<::std::string::String>,
/// <p>The identifier of the session that receives the session data.</p>
pub session_id: ::std::option::Option<::std::string::String>,
/// <p>A list of messages to send to the user. Messages are sent in the order that they are defined in the list.</p>
pub messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
/// <p>Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation with the user.</p>
pub session_state: ::std::option::Option<crate::types::SessionState>,
/// <p>Request-specific information passed between Amazon Lex V2 and the client application.</p>
/// <p>The namespace <code>x-amz-lex:</code> is reserved for special attributes. Don't create any request attributes with the prefix <code>x-amz-lex:</code>.</p>
pub request_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// <p>The message that Amazon Lex V2 returns in the response can be either text or speech depending on the value of this parameter. </p>
/// <ul>
/// <li> <p>If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex V2 returns text in the response.</p> </li>
/// </ul>
pub response_content_type: ::std::option::Option<::std::string::String>,
}
impl PutSessionInput {
/// <p>The identifier of the bot that receives the session data.</p>
pub fn bot_id(&self) -> ::std::option::Option<&str> {
self.bot_id.as_deref()
}
/// <p>The alias identifier of the bot that receives the session data.</p>
pub fn bot_alias_id(&self) -> ::std::option::Option<&str> {
self.bot_alias_id.as_deref()
}
/// <p>The locale where the session is in use.</p>
pub fn locale_id(&self) -> ::std::option::Option<&str> {
self.locale_id.as_deref()
}
/// <p>The identifier of the session that receives the session data.</p>
pub fn session_id(&self) -> ::std::option::Option<&str> {
self.session_id.as_deref()
}
/// <p>A list of messages to send to the user. Messages are sent in the order that they are defined in the list.</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 `.messages.is_none()`.
pub fn messages(&self) -> &[crate::types::Message] {
self.messages.as_deref().unwrap_or_default()
}
/// <p>Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation with the user.</p>
pub fn session_state(&self) -> ::std::option::Option<&crate::types::SessionState> {
self.session_state.as_ref()
}
/// <p>Request-specific information passed between Amazon Lex V2 and the client application.</p>
/// <p>The namespace <code>x-amz-lex:</code> is reserved for special attributes. Don't create any request attributes with the prefix <code>x-amz-lex:</code>.</p>
pub fn request_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.request_attributes.as_ref()
}
/// <p>The message that Amazon Lex V2 returns in the response can be either text or speech depending on the value of this parameter. </p>
/// <ul>
/// <li> <p>If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex V2 returns text in the response.</p> </li>
/// </ul>
pub fn response_content_type(&self) -> ::std::option::Option<&str> {
self.response_content_type.as_deref()
}
}
impl PutSessionInput {
/// Creates a new builder-style object to manufacture [`PutSessionInput`](crate::operation::put_session::PutSessionInput).
pub fn builder() -> crate::operation::put_session::builders::PutSessionInputBuilder {
crate::operation::put_session::builders::PutSessionInputBuilder::default()
}
}
/// A builder for [`PutSessionInput`](crate::operation::put_session::PutSessionInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct PutSessionInputBuilder {
pub(crate) bot_id: ::std::option::Option<::std::string::String>,
pub(crate) bot_alias_id: ::std::option::Option<::std::string::String>,
pub(crate) locale_id: ::std::option::Option<::std::string::String>,
pub(crate) session_id: ::std::option::Option<::std::string::String>,
pub(crate) messages: ::std::option::Option<::std::vec::Vec<crate::types::Message>>,
pub(crate) session_state: ::std::option::Option<crate::types::SessionState>,
pub(crate) request_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) response_content_type: ::std::option::Option<::std::string::String>,
}
impl PutSessionInputBuilder {
/// <p>The identifier of the bot that receives the session data.</p>
/// This field is required.
pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.bot_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the bot that receives the session data.</p>
pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.bot_id = input;
self
}
/// <p>The identifier of the bot that receives the session data.</p>
pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
&self.bot_id
}
/// <p>The alias identifier of the bot that receives the session data.</p>
/// This field is required.
pub fn bot_alias_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.bot_alias_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The alias identifier of the bot that receives the session data.</p>
pub fn set_bot_alias_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.bot_alias_id = input;
self
}
/// <p>The alias identifier of the bot that receives the session data.</p>
pub fn get_bot_alias_id(&self) -> &::std::option::Option<::std::string::String> {
&self.bot_alias_id
}
/// <p>The locale where the session is in use.</p>
/// This field is required.
pub fn locale_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.locale_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The locale where the session is in use.</p>
pub fn set_locale_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.locale_id = input;
self
}
/// <p>The locale where the session is in use.</p>
pub fn get_locale_id(&self) -> &::std::option::Option<::std::string::String> {
&self.locale_id
}
/// <p>The identifier of the session that receives the session data.</p>
/// This field is required.
pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.session_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the session that receives the session data.</p>
pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.session_id = input;
self
}
/// <p>The identifier of the session that receives the session data.</p>
pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
&self.session_id
}
/// Appends an item to `messages`.
///
/// To override the contents of this collection use [`set_messages`](Self::set_messages).
///
/// <p>A list of messages to send to the user. Messages are sent in the order that they are defined in the list.</p>
pub fn messages(mut self, input: crate::types::Message) -> Self {
let mut v = self.messages.unwrap_or_default();
v.push(input);
self.messages = ::std::option::Option::Some(v);
self
}
/// <p>A list of messages to send to the user. Messages are sent in the order that they are defined in the list.</p>
pub fn set_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Message>>) -> Self {
self.messages = input;
self
}
/// <p>A list of messages to send to the user. Messages are sent in the order that they are defined in the list.</p>
pub fn get_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Message>> {
&self.messages
}
/// <p>Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation with the user.</p>
/// This field is required.
pub fn session_state(mut self, input: crate::types::SessionState) -> Self {
self.session_state = ::std::option::Option::Some(input);
self
}
/// <p>Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation with the user.</p>
pub fn set_session_state(mut self, input: ::std::option::Option<crate::types::SessionState>) -> Self {
self.session_state = input;
self
}
/// <p>Sets the state of the session with the user. You can use this to set the current intent, attributes, context, and dialog action. Use the dialog action to determine the next step that Amazon Lex V2 should use in the conversation with the user.</p>
pub fn get_session_state(&self) -> &::std::option::Option<crate::types::SessionState> {
&self.session_state
}
/// Adds a key-value pair to `request_attributes`.
///
/// To override the contents of this collection use [`set_request_attributes`](Self::set_request_attributes).
///
/// <p>Request-specific information passed between Amazon Lex V2 and the client application.</p>
/// <p>The namespace <code>x-amz-lex:</code> is reserved for special attributes. Don't create any request attributes with the prefix <code>x-amz-lex:</code>.</p>
pub fn request_attributes(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.request_attributes.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.request_attributes = ::std::option::Option::Some(hash_map);
self
}
/// <p>Request-specific information passed between Amazon Lex V2 and the client application.</p>
/// <p>The namespace <code>x-amz-lex:</code> is reserved for special attributes. Don't create any request attributes with the prefix <code>x-amz-lex:</code>.</p>
pub fn set_request_attributes(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.request_attributes = input;
self
}
/// <p>Request-specific information passed between Amazon Lex V2 and the client application.</p>
/// <p>The namespace <code>x-amz-lex:</code> is reserved for special attributes. Don't create any request attributes with the prefix <code>x-amz-lex:</code>.</p>
pub fn get_request_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.request_attributes
}
/// <p>The message that Amazon Lex V2 returns in the response can be either text or speech depending on the value of this parameter. </p>
/// <ul>
/// <li> <p>If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex V2 returns text in the response.</p> </li>
/// </ul>
pub fn response_content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.response_content_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The message that Amazon Lex V2 returns in the response can be either text or speech depending on the value of this parameter. </p>
/// <ul>
/// <li> <p>If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex V2 returns text in the response.</p> </li>
/// </ul>
pub fn set_response_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.response_content_type = input;
self
}
/// <p>The message that Amazon Lex V2 returns in the response can be either text or speech depending on the value of this parameter. </p>
/// <ul>
/// <li> <p>If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex V2 returns text in the response.</p> </li>
/// </ul>
pub fn get_response_content_type(&self) -> &::std::option::Option<::std::string::String> {
&self.response_content_type
}
/// Consumes the builder and constructs a [`PutSessionInput`](crate::operation::put_session::PutSessionInput).
pub fn build(self) -> ::std::result::Result<crate::operation::put_session::PutSessionInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::put_session::PutSessionInput {
bot_id: self.bot_id,
bot_alias_id: self.bot_alias_id,
locale_id: self.locale_id,
session_id: self.session_id,
messages: self.messages,
session_state: self.session_state,
request_attributes: self.request_attributes,
response_content_type: self.response_content_type,
})
}
}