aws-sdk-bedrockagentruntime 1.131.0

AWS SDK for Agents for Amazon Bedrock Runtime
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Response structure for the agentic retrieve stream operation.</p>
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub struct AgenticRetrieveStreamOutput {
    /// <p>The output stream containing retrieval results and trace events.</p>
    pub stream: crate::event_receiver::EventReceiver<
        crate::types::AgenticRetrieveStreamResponseOutput,
        crate::types::error::AgenticRetrieveStreamResponseOutputError,
    >,
    _request_id: Option<String>,
}
impl AgenticRetrieveStreamOutput {
    /// <p>The output stream containing retrieval results and trace events.</p>
    pub fn stream(
        &self,
    ) -> &crate::event_receiver::EventReceiver<
        crate::types::AgenticRetrieveStreamResponseOutput,
        crate::types::error::AgenticRetrieveStreamResponseOutputError,
    > {
        &self.stream
    }
}
impl ::aws_types::request_id::RequestId for AgenticRetrieveStreamOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl AgenticRetrieveStreamOutput {
    /// Creates a new builder-style object to manufacture [`AgenticRetrieveStreamOutput`](crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamOutput).
    pub fn builder() -> crate::operation::agentic_retrieve_stream::builders::AgenticRetrieveStreamOutputBuilder {
        crate::operation::agentic_retrieve_stream::builders::AgenticRetrieveStreamOutputBuilder::default()
    }
}

/// A builder for [`AgenticRetrieveStreamOutput`](crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamOutput).
#[derive(::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AgenticRetrieveStreamOutputBuilder {
    pub(crate) stream: ::std::option::Option<
        crate::event_receiver::EventReceiver<
            crate::types::AgenticRetrieveStreamResponseOutput,
            crate::types::error::AgenticRetrieveStreamResponseOutputError,
        >,
    >,
    _request_id: Option<String>,
}
impl AgenticRetrieveStreamOutputBuilder {
    /// <p>The output stream containing retrieval results and trace events.</p>
    /// This field is required.
    pub fn stream(
        mut self,
        input: crate::event_receiver::EventReceiver<
            crate::types::AgenticRetrieveStreamResponseOutput,
            crate::types::error::AgenticRetrieveStreamResponseOutputError,
        >,
    ) -> Self {
        self.stream = ::std::option::Option::Some(input);
        self
    }
    /// <p>The output stream containing retrieval results and trace events.</p>
    pub fn set_stream(
        mut self,
        input: ::std::option::Option<
            crate::event_receiver::EventReceiver<
                crate::types::AgenticRetrieveStreamResponseOutput,
                crate::types::error::AgenticRetrieveStreamResponseOutputError,
            >,
        >,
    ) -> Self {
        self.stream = input;
        self
    }
    /// <p>The output stream containing retrieval results and trace events.</p>
    pub fn get_stream(
        &self,
    ) -> &::std::option::Option<
        crate::event_receiver::EventReceiver<
            crate::types::AgenticRetrieveStreamResponseOutput,
            crate::types::error::AgenticRetrieveStreamResponseOutputError,
        >,
    > {
        &self.stream
    }
    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 [`AgenticRetrieveStreamOutput`](crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`stream`](crate::operation::agentic_retrieve_stream::builders::AgenticRetrieveStreamOutputBuilder::stream)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::agentic_retrieve_stream::AgenticRetrieveStreamOutput {
            stream: self.stream.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "stream",
                    "stream was not specified but it is required when building AgenticRetrieveStreamOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}