aws_sdk_bedrockagentruntime/operation/invoke_agent/
_invoke_agent_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub struct InvokeAgentOutput {
6 pub completion: crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>,
8 pub content_type: ::std::string::String,
10 pub session_id: ::std::string::String,
12 pub memory_id: ::std::option::Option<::std::string::String>,
14 _request_id: Option<String>,
15}
16impl InvokeAgentOutput {
17 pub fn completion(&self) -> &crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError> {
19 &self.completion
20 }
21 pub fn content_type(&self) -> &str {
23 use std::ops::Deref;
24 self.content_type.deref()
25 }
26 pub fn session_id(&self) -> &str {
28 use std::ops::Deref;
29 self.session_id.deref()
30 }
31 pub fn memory_id(&self) -> ::std::option::Option<&str> {
33 self.memory_id.as_deref()
34 }
35}
36impl ::aws_types::request_id::RequestId for InvokeAgentOutput {
37 fn request_id(&self) -> Option<&str> {
38 self._request_id.as_deref()
39 }
40}
41impl InvokeAgentOutput {
42 pub fn builder() -> crate::operation::invoke_agent::builders::InvokeAgentOutputBuilder {
44 crate::operation::invoke_agent::builders::InvokeAgentOutputBuilder::default()
45 }
46}
47
48#[derive(::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct InvokeAgentOutputBuilder {
52 pub(crate) completion:
53 ::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>>,
54 pub(crate) content_type: ::std::option::Option<::std::string::String>,
55 pub(crate) session_id: ::std::option::Option<::std::string::String>,
56 pub(crate) memory_id: ::std::option::Option<::std::string::String>,
57 _request_id: Option<String>,
58}
59impl InvokeAgentOutputBuilder {
60 pub fn completion(
63 mut self,
64 input: crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>,
65 ) -> Self {
66 self.completion = ::std::option::Option::Some(input);
67 self
68 }
69 pub fn set_completion(
71 mut self,
72 input: ::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>>,
73 ) -> Self {
74 self.completion = input;
75 self
76 }
77 pub fn get_completion(
79 &self,
80 ) -> &::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>> {
81 &self.completion
82 }
83 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86 self.content_type = ::std::option::Option::Some(input.into());
87 self
88 }
89 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91 self.content_type = input;
92 self
93 }
94 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
96 &self.content_type
97 }
98 pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.session_id = ::std::option::Option::Some(input.into());
102 self
103 }
104 pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.session_id = input;
107 self
108 }
109 pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
111 &self.session_id
112 }
113 pub fn memory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.memory_id = ::std::option::Option::Some(input.into());
116 self
117 }
118 pub fn set_memory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.memory_id = input;
121 self
122 }
123 pub fn get_memory_id(&self) -> &::std::option::Option<::std::string::String> {
125 &self.memory_id
126 }
127 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
128 self._request_id = Some(request_id.into());
129 self
130 }
131
132 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
133 self._request_id = request_id;
134 self
135 }
136 pub fn build(self) -> ::std::result::Result<crate::operation::invoke_agent::InvokeAgentOutput, ::aws_smithy_types::error::operation::BuildError> {
142 ::std::result::Result::Ok(crate::operation::invoke_agent::InvokeAgentOutput {
143 completion: self.completion.ok_or_else(|| {
144 ::aws_smithy_types::error::operation::BuildError::missing_field(
145 "completion",
146 "completion was not specified but it is required when building InvokeAgentOutput",
147 )
148 })?,
149 content_type: self.content_type.ok_or_else(|| {
150 ::aws_smithy_types::error::operation::BuildError::missing_field(
151 "content_type",
152 "content_type was not specified but it is required when building InvokeAgentOutput",
153 )
154 })?,
155 session_id: self.session_id.ok_or_else(|| {
156 ::aws_smithy_types::error::operation::BuildError::missing_field(
157 "session_id",
158 "session_id was not specified but it is required when building InvokeAgentOutput",
159 )
160 })?,
161 memory_id: self.memory_id,
162 _request_id: self._request_id,
163 })
164 }
165}