aws-sdk-bedrockruntime 1.130.0

AWS SDK 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 ConverseStreamOutput {
    /// <p>The output stream that the model generated.</p>
    pub stream: crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError>,
    _request_id: Option<String>,
}
impl ConverseStreamOutput {
    /// <p>The output stream that the model generated.</p>
    pub fn stream(
        &self,
    ) -> &crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError> {
        &self.stream
    }
}
impl ::aws_types::request_id::RequestId for ConverseStreamOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ConverseStreamOutput {
    /// Creates a new builder-style object to manufacture [`ConverseStreamOutput`](crate::operation::converse_stream::ConverseStreamOutput).
    pub fn builder() -> crate::operation::converse_stream::builders::ConverseStreamOutputBuilder {
        crate::operation::converse_stream::builders::ConverseStreamOutputBuilder::default()
    }
}

/// A builder for [`ConverseStreamOutput`](crate::operation::converse_stream::ConverseStreamOutput).
#[derive(::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ConverseStreamOutputBuilder {
    pub(crate) stream: ::std::option::Option<
        crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError>,
    >,
    _request_id: Option<String>,
}
impl ConverseStreamOutputBuilder {
    /// <p>The output stream that the model generated.</p>
    pub fn stream(
        mut self,
        input: crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError>,
    ) -> Self {
        self.stream = ::std::option::Option::Some(input);
        self
    }
    /// <p>The output stream that the model generated.</p>
    pub fn set_stream(
        mut self,
        input: ::std::option::Option<
            crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError>,
        >,
    ) -> Self {
        self.stream = input;
        self
    }
    /// <p>The output stream that the model generated.</p>
    pub fn get_stream(
        &self,
    ) -> &::std::option::Option<
        crate::event_receiver::EventReceiver<crate::types::ConverseStreamOutput, crate::types::error::ConverseStreamOutputError>,
    > {
        &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 [`ConverseStreamOutput`](crate::operation::converse_stream::ConverseStreamOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`stream`](crate::operation::converse_stream::builders::ConverseStreamOutputBuilder::stream)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::converse_stream::ConverseStreamOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::converse_stream::ConverseStreamOutput {
            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 ConverseStreamOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}