aws-sdk-dsql 1.58.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 retrieved stream.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetStreamOutput {
    /// <p>The ID of the cluster for the retrieved stream.</p>
    pub cluster_identifier: ::std::string::String,
    /// <p>The ID of the retrieved stream.</p>
    pub stream_identifier: ::std::string::String,
    /// <p>The ARN of the retrieved stream.</p>
    pub arn: ::std::string::String,
    /// <p>The current status of the retrieved stream.</p>
    pub status: crate::types::StreamStatus,
    /// <p>The time when the stream was created.</p>
    pub creation_time: ::aws_smithy_types::DateTime,
    /// <p>The ordering mode of the stream.</p>
    pub ordering: crate::types::StreamOrdering,
    /// <p>The format of the stream records.</p>
    pub format: crate::types::StreamFormat,
    /// <p>The target definition for the stream destination.</p>
    pub target_definition: ::std::option::Option<crate::types::TargetDefinition>,
    /// <p>Stream status reason with error code and timestamp (if applicable).</p>
    pub status_reason: ::std::option::Option<crate::types::StatusReason>,
    /// <p>A map of tags associated with the stream.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl GetStreamOutput {
    /// <p>The ID of the cluster for the retrieved stream.</p>
    pub fn cluster_identifier(&self) -> &str {
        use std::ops::Deref;
        self.cluster_identifier.deref()
    }
    /// <p>The ID of the retrieved stream.</p>
    pub fn stream_identifier(&self) -> &str {
        use std::ops::Deref;
        self.stream_identifier.deref()
    }
    /// <p>The ARN of the retrieved stream.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>The current status of the retrieved stream.</p>
    pub fn status(&self) -> &crate::types::StreamStatus {
        &self.status
    }
    /// <p>The time when the stream was created.</p>
    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
        &self.creation_time
    }
    /// <p>The ordering mode of the stream.</p>
    pub fn ordering(&self) -> &crate::types::StreamOrdering {
        &self.ordering
    }
    /// <p>The format of the stream records.</p>
    pub fn format(&self) -> &crate::types::StreamFormat {
        &self.format
    }
    /// <p>The target definition for the stream destination.</p>
    pub fn target_definition(&self) -> ::std::option::Option<&crate::types::TargetDefinition> {
        self.target_definition.as_ref()
    }
    /// <p>Stream status reason with error code and timestamp (if applicable).</p>
    pub fn status_reason(&self) -> ::std::option::Option<&crate::types::StatusReason> {
        self.status_reason.as_ref()
    }
    /// <p>A map of tags associated with the stream.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetStreamOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetStreamOutput {
    /// Creates a new builder-style object to manufacture [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
    pub fn builder() -> crate::operation::get_stream::builders::GetStreamOutputBuilder {
        crate::operation::get_stream::builders::GetStreamOutputBuilder::default()
    }
}

/// A builder for [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetStreamOutputBuilder {
    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>,
    pub(crate) target_definition: ::std::option::Option<crate::types::TargetDefinition>,
    pub(crate) status_reason: ::std::option::Option<crate::types::StatusReason>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl GetStreamOutputBuilder {
    /// <p>The ID of the cluster for the retrieved 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 retrieved 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 retrieved stream.</p>
    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_identifier
    }
    /// <p>The ID of the retrieved 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 retrieved 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 retrieved stream.</p>
    pub fn get_stream_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.stream_identifier
    }
    /// <p>The ARN of the retrieved 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 retrieved 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 retrieved stream.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The current status of the retrieved 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 current status of the retrieved stream.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::StreamStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the retrieved stream.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::StreamStatus> {
        &self.status
    }
    /// <p>The time when the stream was created.</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 the stream was created.</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 the stream was created.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>The ordering mode of the 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 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 stream.</p>
    pub fn get_ordering(&self) -> &::std::option::Option<crate::types::StreamOrdering> {
        &self.ordering
    }
    /// <p>The format of the 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 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 stream records.</p>
    pub fn get_format(&self) -> &::std::option::Option<crate::types::StreamFormat> {
        &self.format
    }
    /// <p>The target definition for the stream destination.</p>
    pub fn target_definition(mut self, input: crate::types::TargetDefinition) -> Self {
        self.target_definition = ::std::option::Option::Some(input);
        self
    }
    /// <p>The target definition for the stream destination.</p>
    pub fn set_target_definition(mut self, input: ::std::option::Option<crate::types::TargetDefinition>) -> Self {
        self.target_definition = input;
        self
    }
    /// <p>The target definition for the stream destination.</p>
    pub fn get_target_definition(&self) -> &::std::option::Option<crate::types::TargetDefinition> {
        &self.target_definition
    }
    /// <p>Stream status reason with error code and timestamp (if applicable).</p>
    pub fn status_reason(mut self, input: crate::types::StatusReason) -> Self {
        self.status_reason = ::std::option::Option::Some(input);
        self
    }
    /// <p>Stream status reason with error code and timestamp (if applicable).</p>
    pub fn set_status_reason(mut self, input: ::std::option::Option<crate::types::StatusReason>) -> Self {
        self.status_reason = input;
        self
    }
    /// <p>Stream status reason with error code and timestamp (if applicable).</p>
    pub fn get_status_reason(&self) -> &::std::option::Option<crate::types::StatusReason> {
        &self.status_reason
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A map of tags associated with the stream.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A map of tags associated with the stream.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>A map of tags associated with the stream.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    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 [`GetStreamOutput`](crate::operation::get_stream::GetStreamOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`cluster_identifier`](crate::operation::get_stream::builders::GetStreamOutputBuilder::cluster_identifier)
    /// - [`stream_identifier`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_identifier)
    /// - [`arn`](crate::operation::get_stream::builders::GetStreamOutputBuilder::arn)
    /// - [`status`](crate::operation::get_stream::builders::GetStreamOutputBuilder::status)
    /// - [`creation_time`](crate::operation::get_stream::builders::GetStreamOutputBuilder::creation_time)
    /// - [`ordering`](crate::operation::get_stream::builders::GetStreamOutputBuilder::ordering)
    /// - [`format`](crate::operation::get_stream::builders::GetStreamOutputBuilder::format)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_stream::GetStreamOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_stream::GetStreamOutput {
            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 GetStreamOutput",
                )
            })?,
            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 GetStreamOutput",
                )
            })?,
            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 GetStreamOutput",
                )
            })?,
            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 GetStreamOutput",
                )
            })?,
            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 GetStreamOutput",
                )
            })?,
            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 GetStreamOutput",
                )
            })?,
            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 GetStreamOutput",
                )
            })?,
            target_definition: self.target_definition,
            status_reason: self.status_reason,
            tags: self.tags,
            _request_id: self._request_id,
        })
    }
}