aws-sdk-bedrockagentruntime 1.126.0

AWS SDK for Agents for Amazon Bedrock Runtime
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub struct InvokeInlineAgentOutput {
    /// <p>The inline agent's response to the user prompt.</p>
    pub completion:
        crate::event_receiver::EventReceiver<crate::types::InlineAgentResponseStream, crate::types::error::InlineAgentResponseStreamError>,
    /// <p>The MIME type of the input data in the request. The default value is application/json.</p>
    pub content_type: ::std::string::String,
    /// <p>The unique identifier of the session with the agent.</p>
    pub session_id: ::std::string::String,
    _request_id: Option<String>,
}
impl InvokeInlineAgentOutput {
    /// <p>The inline agent's response to the user prompt.</p>
    pub fn completion(
        &self,
    ) -> &crate::event_receiver::EventReceiver<crate::types::InlineAgentResponseStream, crate::types::error::InlineAgentResponseStreamError> {
        &self.completion
    }
    /// <p>The MIME type of the input data in the request. The default value is application/json.</p>
    pub fn content_type(&self) -> &str {
        use std::ops::Deref;
        self.content_type.deref()
    }
    /// <p>The unique identifier of the session with the agent.</p>
    pub fn session_id(&self) -> &str {
        use std::ops::Deref;
        self.session_id.deref()
    }
}
impl ::aws_types::request_id::RequestId for InvokeInlineAgentOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl InvokeInlineAgentOutput {
    /// Creates a new builder-style object to manufacture [`InvokeInlineAgentOutput`](crate::operation::invoke_inline_agent::InvokeInlineAgentOutput).
    pub fn builder() -> crate::operation::invoke_inline_agent::builders::InvokeInlineAgentOutputBuilder {
        crate::operation::invoke_inline_agent::builders::InvokeInlineAgentOutputBuilder::default()
    }
}

/// A builder for [`InvokeInlineAgentOutput`](crate::operation::invoke_inline_agent::InvokeInlineAgentOutput).
#[derive(::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct InvokeInlineAgentOutputBuilder {
    pub(crate) completion: ::std::option::Option<
        crate::event_receiver::EventReceiver<crate::types::InlineAgentResponseStream, crate::types::error::InlineAgentResponseStreamError>,
    >,
    pub(crate) content_type: ::std::option::Option<::std::string::String>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl InvokeInlineAgentOutputBuilder {
    /// <p>The inline agent's response to the user prompt.</p>
    /// This field is required.
    pub fn completion(
        mut self,
        input: crate::event_receiver::EventReceiver<crate::types::InlineAgentResponseStream, crate::types::error::InlineAgentResponseStreamError>,
    ) -> Self {
        self.completion = ::std::option::Option::Some(input);
        self
    }
    /// <p>The inline agent's response to the user prompt.</p>
    pub fn set_completion(
        mut self,
        input: ::std::option::Option<
            crate::event_receiver::EventReceiver<crate::types::InlineAgentResponseStream, crate::types::error::InlineAgentResponseStreamError>,
        >,
    ) -> Self {
        self.completion = input;
        self
    }
    /// <p>The inline agent's response to the user prompt.</p>
    pub fn get_completion(
        &self,
    ) -> &::std::option::Option<
        crate::event_receiver::EventReceiver<crate::types::InlineAgentResponseStream, crate::types::error::InlineAgentResponseStreamError>,
    > {
        &self.completion
    }
    /// <p>The MIME type of the input data in the request. The default value is application/json.</p>
    /// This field is required.
    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
    }
    /// <p>The MIME type of the input data in the request. The default value is application/json.</p>
    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.content_type = input;
        self
    }
    /// <p>The MIME type of the input data in the request. The default value is application/json.</p>
    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.content_type
    }
    /// <p>The unique identifier of the session with the agent.</p>
    /// This field is required.
    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
    }
    /// <p>The unique identifier of the session with the agent.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The unique identifier of the session with the agent.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_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
    }
    /// Consumes the builder and constructs a [`InvokeInlineAgentOutput`](crate::operation::invoke_inline_agent::InvokeInlineAgentOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`completion`](crate::operation::invoke_inline_agent::builders::InvokeInlineAgentOutputBuilder::completion)
    /// - [`content_type`](crate::operation::invoke_inline_agent::builders::InvokeInlineAgentOutputBuilder::content_type)
    /// - [`session_id`](crate::operation::invoke_inline_agent::builders::InvokeInlineAgentOutputBuilder::session_id)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::invoke_inline_agent::InvokeInlineAgentOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::invoke_inline_agent::InvokeInlineAgentOutput {
            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 InvokeInlineAgentOutput",
                )
            })?,
            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 InvokeInlineAgentOutput",
                )
            })?,
            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 InvokeInlineAgentOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}