aws_sdk_bedrockagentruntime/operation/invoke_agent/
_invoke_agent_output.rs#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub struct InvokeAgentOutput {
pub completion: crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>,
pub content_type: ::std::string::String,
pub session_id: ::std::string::String,
pub memory_id: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl InvokeAgentOutput {
pub fn completion(&self) -> &crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError> {
&self.completion
}
pub fn content_type(&self) -> &str {
use std::ops::Deref;
self.content_type.deref()
}
pub fn session_id(&self) -> &str {
use std::ops::Deref;
self.session_id.deref()
}
pub fn memory_id(&self) -> ::std::option::Option<&str> {
self.memory_id.as_deref()
}
}
impl ::aws_types::request_id::RequestId for InvokeAgentOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl InvokeAgentOutput {
pub fn builder() -> crate::operation::invoke_agent::builders::InvokeAgentOutputBuilder {
crate::operation::invoke_agent::builders::InvokeAgentOutputBuilder::default()
}
}
#[derive(::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct InvokeAgentOutputBuilder {
pub(crate) completion:
::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>>,
pub(crate) content_type: ::std::option::Option<::std::string::String>,
pub(crate) session_id: ::std::option::Option<::std::string::String>,
pub(crate) memory_id: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl InvokeAgentOutputBuilder {
pub fn completion(
mut self,
input: crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>,
) -> Self {
self.completion = ::std::option::Option::Some(input);
self
}
pub fn set_completion(
mut self,
input: ::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>>,
) -> Self {
self.completion = input;
self
}
pub fn get_completion(
&self,
) -> &::std::option::Option<crate::event_receiver::EventReceiver<crate::types::ResponseStream, crate::types::error::ResponseStreamError>> {
&self.completion
}
pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.content_type = ::std::option::Option::Some(input.into());
self
}
pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.content_type = input;
self
}
pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
&self.content_type
}
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
}
pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.session_id = input;
self
}
pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
&self.session_id
}
pub fn memory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.memory_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_memory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.memory_id = input;
self
}
pub fn get_memory_id(&self) -> &::std::option::Option<::std::string::String> {
&self.memory_id
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(self) -> ::std::result::Result<crate::operation::invoke_agent::InvokeAgentOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::invoke_agent::InvokeAgentOutput {
completion: self.completion.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"completion",
"completion was not specified but it is required when building InvokeAgentOutput",
)
})?,
content_type: self.content_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"content_type",
"content_type was not specified but it is required when building InvokeAgentOutput",
)
})?,
session_id: self.session_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"session_id",
"session_id was not specified but it is required when building InvokeAgentOutput",
)
})?,
memory_id: self.memory_id,
_request_id: self._request_id,
})
}
}