aws_sdk_lexruntimev2/operation/put_session/_put_session_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub struct PutSessionOutput {
6 /// <p>The type of response. Same as the type specified in the <code>responseContentType</code> field in the request.</p>
7 pub content_type: ::std::option::Option<::std::string::String>,
8 /// <p>A list of messages that were last sent to the user. The messages are ordered based on how you return the messages from you Lambda function or the order that the messages are defined in the bot.</p>
9 pub messages: ::std::option::Option<::std::string::String>,
10 /// <p>A base-64-encoded gzipped field that represents the current state of the dialog between the user and the bot. Use this to determine the progress of the conversation and what the next action may be.</p>
11 pub session_state: ::std::option::Option<::std::string::String>,
12 /// <p>A base-64-encoded gzipped field that provides request-specific information passed between the client application and Amazon Lex V2. These are the same as the <code>requestAttribute</code> parameter in the call to the <code>PutSession</code> operation.</p>
13 pub request_attributes: ::std::option::Option<::std::string::String>,
14 /// <p>The identifier of the session that received the data.</p>
15 pub session_id: ::std::option::Option<::std::string::String>,
16 /// <p>If the requested content type was audio, the audio version of the message to convey to the user.</p>
17 pub audio_stream: ::aws_smithy_types::byte_stream::ByteStream,
18 _request_id: Option<String>,
19}
20impl PutSessionOutput {
21 /// <p>The type of response. Same as the type specified in the <code>responseContentType</code> field in the request.</p>
22 pub fn content_type(&self) -> ::std::option::Option<&str> {
23 self.content_type.as_deref()
24 }
25 /// <p>A list of messages that were last sent to the user. The messages are ordered based on how you return the messages from you Lambda function or the order that the messages are defined in the bot.</p>
26 pub fn messages(&self) -> ::std::option::Option<&str> {
27 self.messages.as_deref()
28 }
29 /// <p>A base-64-encoded gzipped field that represents the current state of the dialog between the user and the bot. Use this to determine the progress of the conversation and what the next action may be.</p>
30 pub fn session_state(&self) -> ::std::option::Option<&str> {
31 self.session_state.as_deref()
32 }
33 /// <p>A base-64-encoded gzipped field that provides request-specific information passed between the client application and Amazon Lex V2. These are the same as the <code>requestAttribute</code> parameter in the call to the <code>PutSession</code> operation.</p>
34 pub fn request_attributes(&self) -> ::std::option::Option<&str> {
35 self.request_attributes.as_deref()
36 }
37 /// <p>The identifier of the session that received the data.</p>
38 pub fn session_id(&self) -> ::std::option::Option<&str> {
39 self.session_id.as_deref()
40 }
41 /// <p>If the requested content type was audio, the audio version of the message to convey to the user.</p>
42 pub fn audio_stream(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
43 &self.audio_stream
44 }
45}
46impl ::aws_types::request_id::RequestId for PutSessionOutput {
47 fn request_id(&self) -> Option<&str> {
48 self._request_id.as_deref()
49 }
50}
51impl PutSessionOutput {
52 /// Creates a new builder-style object to manufacture [`PutSessionOutput`](crate::operation::put_session::PutSessionOutput).
53 pub fn builder() -> crate::operation::put_session::builders::PutSessionOutputBuilder {
54 crate::operation::put_session::builders::PutSessionOutputBuilder::default()
55 }
56}
57
58/// A builder for [`PutSessionOutput`](crate::operation::put_session::PutSessionOutput).
59#[derive(::std::default::Default, ::std::fmt::Debug)]
60#[non_exhaustive]
61pub struct PutSessionOutputBuilder {
62 pub(crate) content_type: ::std::option::Option<::std::string::String>,
63 pub(crate) messages: ::std::option::Option<::std::string::String>,
64 pub(crate) session_state: ::std::option::Option<::std::string::String>,
65 pub(crate) request_attributes: ::std::option::Option<::std::string::String>,
66 pub(crate) session_id: ::std::option::Option<::std::string::String>,
67 pub(crate) audio_stream: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
68 _request_id: Option<String>,
69}
70impl PutSessionOutputBuilder {
71 /// <p>The type of response. Same as the type specified in the <code>responseContentType</code> field in the request.</p>
72 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73 self.content_type = ::std::option::Option::Some(input.into());
74 self
75 }
76 /// <p>The type of response. Same as the type specified in the <code>responseContentType</code> field in the request.</p>
77 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78 self.content_type = input;
79 self
80 }
81 /// <p>The type of response. Same as the type specified in the <code>responseContentType</code> field in the request.</p>
82 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
83 &self.content_type
84 }
85 /// <p>A list of messages that were last sent to the user. The messages are ordered based on how you return the messages from you Lambda function or the order that the messages are defined in the bot.</p>
86 pub fn messages(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.messages = ::std::option::Option::Some(input.into());
88 self
89 }
90 /// <p>A list of messages that were last sent to the user. The messages are ordered based on how you return the messages from you Lambda function or the order that the messages are defined in the bot.</p>
91 pub fn set_messages(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.messages = input;
93 self
94 }
95 /// <p>A list of messages that were last sent to the user. The messages are ordered based on how you return the messages from you Lambda function or the order that the messages are defined in the bot.</p>
96 pub fn get_messages(&self) -> &::std::option::Option<::std::string::String> {
97 &self.messages
98 }
99 /// <p>A base-64-encoded gzipped field that represents the current state of the dialog between the user and the bot. Use this to determine the progress of the conversation and what the next action may be.</p>
100 pub fn session_state(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.session_state = ::std::option::Option::Some(input.into());
102 self
103 }
104 /// <p>A base-64-encoded gzipped field that represents the current state of the dialog between the user and the bot. Use this to determine the progress of the conversation and what the next action may be.</p>
105 pub fn set_session_state(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.session_state = input;
107 self
108 }
109 /// <p>A base-64-encoded gzipped field that represents the current state of the dialog between the user and the bot. Use this to determine the progress of the conversation and what the next action may be.</p>
110 pub fn get_session_state(&self) -> &::std::option::Option<::std::string::String> {
111 &self.session_state
112 }
113 /// <p>A base-64-encoded gzipped field that provides request-specific information passed between the client application and Amazon Lex V2. These are the same as the <code>requestAttribute</code> parameter in the call to the <code>PutSession</code> operation.</p>
114 pub fn request_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.request_attributes = ::std::option::Option::Some(input.into());
116 self
117 }
118 /// <p>A base-64-encoded gzipped field that provides request-specific information passed between the client application and Amazon Lex V2. These are the same as the <code>requestAttribute</code> parameter in the call to the <code>PutSession</code> operation.</p>
119 pub fn set_request_attributes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.request_attributes = input;
121 self
122 }
123 /// <p>A base-64-encoded gzipped field that provides request-specific information passed between the client application and Amazon Lex V2. These are the same as the <code>requestAttribute</code> parameter in the call to the <code>PutSession</code> operation.</p>
124 pub fn get_request_attributes(&self) -> &::std::option::Option<::std::string::String> {
125 &self.request_attributes
126 }
127 /// <p>The identifier of the session that received the data.</p>
128 pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129 self.session_id = ::std::option::Option::Some(input.into());
130 self
131 }
132 /// <p>The identifier of the session that received the data.</p>
133 pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.session_id = input;
135 self
136 }
137 /// <p>The identifier of the session that received the data.</p>
138 pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
139 &self.session_id
140 }
141 /// <p>If the requested content type was audio, the audio version of the message to convey to the user.</p>
142 pub fn audio_stream(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
143 self.audio_stream = ::std::option::Option::Some(input);
144 self
145 }
146 /// <p>If the requested content type was audio, the audio version of the message to convey to the user.</p>
147 pub fn set_audio_stream(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
148 self.audio_stream = input;
149 self
150 }
151 /// <p>If the requested content type was audio, the audio version of the message to convey to the user.</p>
152 pub fn get_audio_stream(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
153 &self.audio_stream
154 }
155 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
156 self._request_id = Some(request_id.into());
157 self
158 }
159
160 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
161 self._request_id = request_id;
162 self
163 }
164 /// Consumes the builder and constructs a [`PutSessionOutput`](crate::operation::put_session::PutSessionOutput).
165 pub fn build(self) -> crate::operation::put_session::PutSessionOutput {
166 crate::operation::put_session::PutSessionOutput {
167 content_type: self.content_type,
168 messages: self.messages,
169 session_state: self.session_state,
170 request_attributes: self.request_attributes,
171 session_id: self.session_id,
172 audio_stream: self.audio_stream.unwrap_or_default(),
173 _request_id: self._request_id,
174 }
175 }
176}