aws_sdk_iotsitewise/operation/invoke_assistant/
_invoke_assistant_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub struct InvokeAssistantOutput {
6 pub body: crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>,
8 pub conversation_id: ::std::string::String,
10 _request_id: Option<String>,
11}
12impl InvokeAssistantOutput {
13 pub fn body(&self) -> &crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError> {
15 &self.body
16 }
17 pub fn conversation_id(&self) -> &str {
19 use std::ops::Deref;
20 self.conversation_id.deref()
21 }
22}
23impl ::aws_types::request_id::RequestId for InvokeAssistantOutput {
24 fn request_id(&self) -> Option<&str> {
25 self._request_id.as_deref()
26 }
27}
28impl InvokeAssistantOutput {
29 pub fn builder() -> crate::operation::invoke_assistant::builders::InvokeAssistantOutputBuilder {
31 crate::operation::invoke_assistant::builders::InvokeAssistantOutputBuilder::default()
32 }
33}
34
35#[derive(::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct InvokeAssistantOutputBuilder {
39 pub(crate) body:
40 ::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>>,
41 pub(crate) conversation_id: ::std::option::Option<::std::string::String>,
42 _request_id: Option<String>,
43}
44impl InvokeAssistantOutputBuilder {
45 pub fn body(
48 mut self,
49 input: crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>,
50 ) -> Self {
51 self.body = ::std::option::Option::Some(input);
52 self
53 }
54 pub fn set_body(
56 mut self,
57 input: ::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>>,
58 ) -> Self {
59 self.body = input;
60 self
61 }
62 pub fn get_body(
64 &self,
65 ) -> &::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>> {
66 &self.body
67 }
68 pub fn conversation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71 self.conversation_id = ::std::option::Option::Some(input.into());
72 self
73 }
74 pub fn set_conversation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76 self.conversation_id = input;
77 self
78 }
79 pub fn get_conversation_id(&self) -> &::std::option::Option<::std::string::String> {
81 &self.conversation_id
82 }
83 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
84 self._request_id = Some(request_id.into());
85 self
86 }
87
88 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
89 self._request_id = request_id;
90 self
91 }
92 pub fn build(
97 self,
98 ) -> ::std::result::Result<crate::operation::invoke_assistant::InvokeAssistantOutput, ::aws_smithy_types::error::operation::BuildError> {
99 ::std::result::Result::Ok(crate::operation::invoke_assistant::InvokeAssistantOutput {
100 body: self.body.ok_or_else(|| {
101 ::aws_smithy_types::error::operation::BuildError::missing_field(
102 "body",
103 "body was not specified but it is required when building InvokeAssistantOutput",
104 )
105 })?,
106 conversation_id: self.conversation_id.ok_or_else(|| {
107 ::aws_smithy_types::error::operation::BuildError::missing_field(
108 "conversation_id",
109 "conversation_id was not specified but it is required when building InvokeAssistantOutput",
110 )
111 })?,
112 _request_id: self._request_id,
113 })
114 }
115}