aws-sdk-dsql 1.56.0

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

/// <p>The output of a created stream.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateStreamOutput {
    /// <p>The ID of the cluster for the created stream.</p>
    pub cluster_identifier: ::std::string::String,
    /// <p>The ID of the created stream.</p>
    pub stream_identifier: ::std::string::String,
    /// <p>The ARN of the created stream.</p>
    pub arn: ::std::string::String,
    /// <p>The status of the created stream.</p>
    pub status: crate::types::StreamStatus,
    /// <p>The time when created the stream.</p>
    pub creation_time: ::aws_smithy_types::DateTime,
    /// <p>The ordering mode of the created stream.</p>
    pub ordering: crate::types::StreamOrdering,
    /// <p>The format of the created stream records.</p>
    pub format: crate::types::StreamFormat,
    _request_id: Option<String>,
}
impl CreateStreamOutput {
    /// <p>The ID of the cluster for the created stream.</p>
    pub fn cluster_identifier(&self) -> &str {
        use std::ops::Deref;
        self.cluster_identifier.deref()
    }
    /// <p>The ID of the created stream.</p>
    pub fn stream_identifier(&self) -> &str {
        use std::ops::Deref;
        self.stream_identifier.deref()
    }
    /// <p>The ARN of the created stream.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>The status of the created stream.</p>
    pub fn status(&self) -> &crate::types::StreamStatus {
        &self.status
    }
    /// <p>The time when created the stream.</p>
    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
        &self.creation_time
    }
    /// <p>The ordering mode of the created stream.</p>
    pub fn ordering(&self) -> &crate::types::StreamOrdering {
        &self.ordering
    }
    /// <p>The format of the created stream records.</p>
    pub fn format(&self) -> &crate::types::StreamFormat {
        &self.format
    }
}
impl ::aws_types::request_id::RequestId for CreateStreamOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateStreamOutput {
    /// Creates a new builder-style object to manufacture [`CreateStreamOutput`](crate::operation::create_stream::CreateStreamOutput).
    pub fn builder() -> crate::operation::create_stream::builders::CreateStreamOutputBuilder {
        crate::operation::create_stream::builders::CreateStreamOutputBuilder::default()
    }
}

/// A builder for [`CreateStreamOutput`](crate::operation::create_stream::CreateStreamOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateStreamOutputBuilder {
    pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) stream_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::StreamStatus>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) ordering: ::std::option::Option<crate::types::StreamOrdering>,
    pub(crate) format: ::std::option::Option<crate::types::StreamFormat>,
    _request_id: Option<String>,
}
impl CreateStreamOutputBuilder {
    /// <p>The ID of the cluster for the created stream.</p>
    /// This field is required.
    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the cluster for the created stream.</p>
    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_identifier = input;
        self
    }
    /// <p>The ID of the cluster for the created stream.</p>
    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_identifier
    }
    /// <p>The ID of the created stream.</p>
    /// This field is required.
    pub fn stream_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stream_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the created stream.</p>
    pub fn set_stream_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.stream_identifier = input;
        self
    }
    /// <p>The ID of the created stream.</p>
    pub fn get_stream_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.stream_identifier
    }
    /// <p>The ARN of the created stream.</p>
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the created stream.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The ARN of the created stream.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The status of the created stream.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::StreamStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the created stream.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::StreamStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the created stream.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::StreamStatus> {
        &self.status
    }
    /// <p>The time when created the stream.</p>
    /// This field is required.
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when created the stream.</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The time when created the stream.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>The ordering mode of the created stream.</p>
    /// This field is required.
    pub fn ordering(mut self, input: crate::types::StreamOrdering) -> Self {
        self.ordering = ::std::option::Option::Some(input);
        self
    }
    /// <p>The ordering mode of the created stream.</p>
    pub fn set_ordering(mut self, input: ::std::option::Option<crate::types::StreamOrdering>) -> Self {
        self.ordering = input;
        self
    }
    /// <p>The ordering mode of the created stream.</p>
    pub fn get_ordering(&self) -> &::std::option::Option<crate::types::StreamOrdering> {
        &self.ordering
    }
    /// <p>The format of the created stream records.</p>
    /// This field is required.
    pub fn format(mut self, input: crate::types::StreamFormat) -> Self {
        self.format = ::std::option::Option::Some(input);
        self
    }
    /// <p>The format of the created stream records.</p>
    pub fn set_format(mut self, input: ::std::option::Option<crate::types::StreamFormat>) -> Self {
        self.format = input;
        self
    }
    /// <p>The format of the created stream records.</p>
    pub fn get_format(&self) -> &::std::option::Option<crate::types::StreamFormat> {
        &self.format
    }
    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 [`CreateStreamOutput`](crate::operation::create_stream::CreateStreamOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`cluster_identifier`](crate::operation::create_stream::builders::CreateStreamOutputBuilder::cluster_identifier)
    /// - [`stream_identifier`](crate::operation::create_stream::builders::CreateStreamOutputBuilder::stream_identifier)
    /// - [`arn`](crate::operation::create_stream::builders::CreateStreamOutputBuilder::arn)
    /// - [`status`](crate::operation::create_stream::builders::CreateStreamOutputBuilder::status)
    /// - [`creation_time`](crate::operation::create_stream::builders::CreateStreamOutputBuilder::creation_time)
    /// - [`ordering`](crate::operation::create_stream::builders::CreateStreamOutputBuilder::ordering)
    /// - [`format`](crate::operation::create_stream::builders::CreateStreamOutputBuilder::format)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_stream::CreateStreamOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_stream::CreateStreamOutput {
            cluster_identifier: self.cluster_identifier.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "cluster_identifier",
                    "cluster_identifier was not specified but it is required when building CreateStreamOutput",
                )
            })?,
            stream_identifier: self.stream_identifier.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "stream_identifier",
                    "stream_identifier was not specified but it is required when building CreateStreamOutput",
                )
            })?,
            arn: self.arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "arn",
                    "arn was not specified but it is required when building CreateStreamOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building CreateStreamOutput",
                )
            })?,
            creation_time: self.creation_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "creation_time",
                    "creation_time was not specified but it is required when building CreateStreamOutput",
                )
            })?,
            ordering: self.ordering.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "ordering",
                    "ordering was not specified but it is required when building CreateStreamOutput",
                )
            })?,
            format: self.format.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "format",
                    "format was not specified but it is required when building CreateStreamOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}