aws_sdk_lexruntimev2/operation/start_conversation/
_start_conversation_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 StartConversationOutput {
6    /// <p>Represents the stream of events from Amazon Lex V2 to your application. The events are encoded as HTTP/2 data frames.</p>
7    pub response_event_stream: crate::event_receiver::EventReceiver<
8        crate::types::StartConversationResponseEventStream,
9        crate::types::error::StartConversationResponseEventStreamError,
10    >,
11    _request_id: Option<String>,
12}
13impl StartConversationOutput {
14    /// <p>Represents the stream of events from Amazon Lex V2 to your application. The events are encoded as HTTP/2 data frames.</p>
15    pub fn response_event_stream(
16        &self,
17    ) -> &crate::event_receiver::EventReceiver<
18        crate::types::StartConversationResponseEventStream,
19        crate::types::error::StartConversationResponseEventStreamError,
20    > {
21        &self.response_event_stream
22    }
23}
24impl ::aws_types::request_id::RequestId for StartConversationOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl StartConversationOutput {
30    /// Creates a new builder-style object to manufacture [`StartConversationOutput`](crate::operation::start_conversation::StartConversationOutput).
31    pub fn builder() -> crate::operation::start_conversation::builders::StartConversationOutputBuilder {
32        crate::operation::start_conversation::builders::StartConversationOutputBuilder::default()
33    }
34}
35
36/// A builder for [`StartConversationOutput`](crate::operation::start_conversation::StartConversationOutput).
37#[derive(::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct StartConversationOutputBuilder {
40    pub(crate) response_event_stream: ::std::option::Option<
41        crate::event_receiver::EventReceiver<
42            crate::types::StartConversationResponseEventStream,
43            crate::types::error::StartConversationResponseEventStreamError,
44        >,
45    >,
46    _request_id: Option<String>,
47}
48impl StartConversationOutputBuilder {
49    /// <p>Represents the stream of events from Amazon Lex V2 to your application. The events are encoded as HTTP/2 data frames.</p>
50    pub fn response_event_stream(
51        mut self,
52        input: crate::event_receiver::EventReceiver<
53            crate::types::StartConversationResponseEventStream,
54            crate::types::error::StartConversationResponseEventStreamError,
55        >,
56    ) -> Self {
57        self.response_event_stream = ::std::option::Option::Some(input);
58        self
59    }
60    /// <p>Represents the stream of events from Amazon Lex V2 to your application. The events are encoded as HTTP/2 data frames.</p>
61    pub fn set_response_event_stream(
62        mut self,
63        input: ::std::option::Option<
64            crate::event_receiver::EventReceiver<
65                crate::types::StartConversationResponseEventStream,
66                crate::types::error::StartConversationResponseEventStreamError,
67            >,
68        >,
69    ) -> Self {
70        self.response_event_stream = input;
71        self
72    }
73    /// <p>Represents the stream of events from Amazon Lex V2 to your application. The events are encoded as HTTP/2 data frames.</p>
74    pub fn get_response_event_stream(
75        &self,
76    ) -> &::std::option::Option<
77        crate::event_receiver::EventReceiver<
78            crate::types::StartConversationResponseEventStream,
79            crate::types::error::StartConversationResponseEventStreamError,
80        >,
81    > {
82        &self.response_event_stream
83    }
84    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
85        self._request_id = Some(request_id.into());
86        self
87    }
88
89    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
90        self._request_id = request_id;
91        self
92    }
93    /// Consumes the builder and constructs a [`StartConversationOutput`](crate::operation::start_conversation::StartConversationOutput).
94    /// This method will fail if any of the following fields are not set:
95    /// - [`response_event_stream`](crate::operation::start_conversation::builders::StartConversationOutputBuilder::response_event_stream)
96    pub fn build(
97        self,
98    ) -> ::std::result::Result<crate::operation::start_conversation::StartConversationOutput, ::aws_smithy_types::error::operation::BuildError> {
99        ::std::result::Result::Ok(crate::operation::start_conversation::StartConversationOutput {
100            response_event_stream: self.response_event_stream.ok_or_else(|| {
101                ::aws_smithy_types::error::operation::BuildError::missing_field(
102                    "response_event_stream",
103                    "response_event_stream was not specified but it is required when building StartConversationOutput",
104                )
105            })?,
106            _request_id: self._request_id,
107        })
108    }
109}