aws-sdk-keyspacesstreams 1.26.0

AWS SDK for Amazon Keyspaces Streams
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::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetStreamOutput {
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific stream.</p>
    pub stream_arn: ::std::string::String,
    /// <p>A timestamp that serves as a unique identifier for this stream, used for debugging and monitoring purposes. The stream label represents the point in time when the stream was created.</p>
    pub stream_label: ::std::string::String,
    /// <p>The current status of the stream. Values can be <code>ENABLING</code>, <code>ENABLED</code>, <code>DISABLING</code>, or <code>DISABLED</code>. Operations on the stream depend on its current status.</p>
    pub stream_status: crate::types::StreamStatus,
    /// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
    /// <ul>
    /// <li>
    /// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
    /// <li>
    /// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
    /// <li>
    /// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
    /// <li>
    /// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
    /// </ul>
    pub stream_view_type: crate::types::StreamViewType,
    /// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
    pub creation_request_date_time: ::aws_smithy_types::DateTime,
    /// <p>The name of the keyspace containing the table associated with this stream. The keyspace name is part of the table's hierarchical identifier in Amazon Keyspaces.</p>
    pub keyspace_name: ::std::string::String,
    /// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
    pub table_name: ::std::string::String,
    /// <p>An array of shard objects associated with this stream. Each shard contains a subset of the stream's data records and has its own unique identifier. The collection of shards represents the complete stream data.</p>
    pub shards: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>,
    /// <p>A pagination token that can be used in a subsequent <code>GetStream</code> request. This token is returned if the response contains more shards than can be returned in a single response.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetStreamOutput {
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific stream.</p>
    pub fn stream_arn(&self) -> &str {
        use std::ops::Deref;
        self.stream_arn.deref()
    }
    /// <p>A timestamp that serves as a unique identifier for this stream, used for debugging and monitoring purposes. The stream label represents the point in time when the stream was created.</p>
    pub fn stream_label(&self) -> &str {
        use std::ops::Deref;
        self.stream_label.deref()
    }
    /// <p>The current status of the stream. Values can be <code>ENABLING</code>, <code>ENABLED</code>, <code>DISABLING</code>, or <code>DISABLED</code>. Operations on the stream depend on its current status.</p>
    pub fn stream_status(&self) -> &crate::types::StreamStatus {
        &self.stream_status
    }
    /// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
    /// <ul>
    /// <li>
    /// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
    /// <li>
    /// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
    /// <li>
    /// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
    /// <li>
    /// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
    /// </ul>
    pub fn stream_view_type(&self) -> &crate::types::StreamViewType {
        &self.stream_view_type
    }
    /// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
    pub fn creation_request_date_time(&self) -> &::aws_smithy_types::DateTime {
        &self.creation_request_date_time
    }
    /// <p>The name of the keyspace containing the table associated with this stream. The keyspace name is part of the table's hierarchical identifier in Amazon Keyspaces.</p>
    pub fn keyspace_name(&self) -> &str {
        use std::ops::Deref;
        self.keyspace_name.deref()
    }
    /// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
    pub fn table_name(&self) -> &str {
        use std::ops::Deref;
        self.table_name.deref()
    }
    /// <p>An array of shard objects associated with this stream. Each shard contains a subset of the stream's data records and has its own unique identifier. The collection of shards represents the complete stream data.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.shards.is_none()`.
    pub fn shards(&self) -> &[crate::types::Shard] {
        self.shards.as_deref().unwrap_or_default()
    }
    /// <p>A pagination token that can be used in a subsequent <code>GetStream</code> request. This token is returned if the response contains more shards than can be returned in a single response.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
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) stream_arn: ::std::option::Option<::std::string::String>,
    pub(crate) stream_label: ::std::option::Option<::std::string::String>,
    pub(crate) stream_status: ::std::option::Option<crate::types::StreamStatus>,
    pub(crate) stream_view_type: ::std::option::Option<crate::types::StreamViewType>,
    pub(crate) creation_request_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) keyspace_name: ::std::option::Option<::std::string::String>,
    pub(crate) table_name: ::std::option::Option<::std::string::String>,
    pub(crate) shards: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetStreamOutputBuilder {
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific stream.</p>
    /// This field is required.
    pub fn stream_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stream_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific stream.</p>
    pub fn set_stream_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.stream_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the stream within Amazon Keyspaces. This ARN can be used in other API operations to reference this specific stream.</p>
    pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.stream_arn
    }
    /// <p>A timestamp that serves as a unique identifier for this stream, used for debugging and monitoring purposes. The stream label represents the point in time when the stream was created.</p>
    /// This field is required.
    pub fn stream_label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stream_label = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A timestamp that serves as a unique identifier for this stream, used for debugging and monitoring purposes. The stream label represents the point in time when the stream was created.</p>
    pub fn set_stream_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.stream_label = input;
        self
    }
    /// <p>A timestamp that serves as a unique identifier for this stream, used for debugging and monitoring purposes. The stream label represents the point in time when the stream was created.</p>
    pub fn get_stream_label(&self) -> &::std::option::Option<::std::string::String> {
        &self.stream_label
    }
    /// <p>The current status of the stream. Values can be <code>ENABLING</code>, <code>ENABLED</code>, <code>DISABLING</code>, or <code>DISABLED</code>. Operations on the stream depend on its current status.</p>
    /// This field is required.
    pub fn stream_status(mut self, input: crate::types::StreamStatus) -> Self {
        self.stream_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the stream. Values can be <code>ENABLING</code>, <code>ENABLED</code>, <code>DISABLING</code>, or <code>DISABLED</code>. Operations on the stream depend on its current status.</p>
    pub fn set_stream_status(mut self, input: ::std::option::Option<crate::types::StreamStatus>) -> Self {
        self.stream_status = input;
        self
    }
    /// <p>The current status of the stream. Values can be <code>ENABLING</code>, <code>ENABLED</code>, <code>DISABLING</code>, or <code>DISABLED</code>. Operations on the stream depend on its current status.</p>
    pub fn get_stream_status(&self) -> &::std::option::Option<crate::types::StreamStatus> {
        &self.stream_status
    }
    /// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
    /// <ul>
    /// <li>
    /// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
    /// <li>
    /// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
    /// <li>
    /// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
    /// <li>
    /// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
    /// </ul>
    /// This field is required.
    pub fn stream_view_type(mut self, input: crate::types::StreamViewType) -> Self {
        self.stream_view_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
    /// <ul>
    /// <li>
    /// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
    /// <li>
    /// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
    /// <li>
    /// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
    /// <li>
    /// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
    /// </ul>
    pub fn set_stream_view_type(mut self, input: ::std::option::Option<crate::types::StreamViewType>) -> Self {
        self.stream_view_type = input;
        self
    }
    /// <p>The format of the data records in this stream. Currently, this can be one of the following options:</p>
    /// <ul>
    /// <li>
    /// <p><code>NEW_AND_OLD_IMAGES</code> - both versions of the row, before and after the change. This is the default.</p></li>
    /// <li>
    /// <p><code>NEW_IMAGE</code> - the version of the row after the change.</p></li>
    /// <li>
    /// <p><code>OLD_IMAGE</code> - the version of the row before the change.</p></li>
    /// <li>
    /// <p><code>KEYS_ONLY</code> - the partition and clustering keys of the row that was changed.</p></li>
    /// </ul>
    pub fn get_stream_view_type(&self) -> &::std::option::Option<crate::types::StreamViewType> {
        &self.stream_view_type
    }
    /// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
    /// This field is required.
    pub fn creation_request_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_request_date_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
    pub fn set_creation_request_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_request_date_time = input;
        self
    }
    /// <p>The date and time when the request to create this stream was issued. The value is represented in ISO 8601 format.</p>
    pub fn get_creation_request_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_request_date_time
    }
    /// <p>The name of the keyspace containing the table associated with this stream. The keyspace name is part of the table's hierarchical identifier in Amazon Keyspaces.</p>
    /// This field is required.
    pub fn keyspace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.keyspace_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the keyspace containing the table associated with this stream. The keyspace name is part of the table's hierarchical identifier in Amazon Keyspaces.</p>
    pub fn set_keyspace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.keyspace_name = input;
        self
    }
    /// <p>The name of the keyspace containing the table associated with this stream. The keyspace name is part of the table's hierarchical identifier in Amazon Keyspaces.</p>
    pub fn get_keyspace_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.keyspace_name
    }
    /// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
    /// This field is required.
    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.table_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.table_name = input;
        self
    }
    /// <p>The name of the table associated with this stream. The stream captures changes to rows in this Amazon Keyspaces table.</p>
    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.table_name
    }
    /// Appends an item to `shards`.
    ///
    /// To override the contents of this collection use [`set_shards`](Self::set_shards).
    ///
    /// <p>An array of shard objects associated with this stream. Each shard contains a subset of the stream's data records and has its own unique identifier. The collection of shards represents the complete stream data.</p>
    pub fn shards(mut self, input: crate::types::Shard) -> Self {
        let mut v = self.shards.unwrap_or_default();
        v.push(input);
        self.shards = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of shard objects associated with this stream. Each shard contains a subset of the stream's data records and has its own unique identifier. The collection of shards represents the complete stream data.</p>
    pub fn set_shards(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Shard>>) -> Self {
        self.shards = input;
        self
    }
    /// <p>An array of shard objects associated with this stream. Each shard contains a subset of the stream's data records and has its own unique identifier. The collection of shards represents the complete stream data.</p>
    pub fn get_shards(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Shard>> {
        &self.shards
    }
    /// <p>A pagination token that can be used in a subsequent <code>GetStream</code> request. This token is returned if the response contains more shards than can be returned in a single response.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A pagination token that can be used in a subsequent <code>GetStream</code> request. This token is returned if the response contains more shards than can be returned in a single response.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>A pagination token that can be used in a subsequent <code>GetStream</code> request. This token is returned if the response contains more shards than can be returned in a single response.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    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:
    /// - [`stream_arn`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_arn)
    /// - [`stream_label`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_label)
    /// - [`stream_status`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_status)
    /// - [`stream_view_type`](crate::operation::get_stream::builders::GetStreamOutputBuilder::stream_view_type)
    /// - [`creation_request_date_time`](crate::operation::get_stream::builders::GetStreamOutputBuilder::creation_request_date_time)
    /// - [`keyspace_name`](crate::operation::get_stream::builders::GetStreamOutputBuilder::keyspace_name)
    /// - [`table_name`](crate::operation::get_stream::builders::GetStreamOutputBuilder::table_name)
    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 {
            stream_arn: self.stream_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "stream_arn",
                    "stream_arn was not specified but it is required when building GetStreamOutput",
                )
            })?,
            stream_label: self.stream_label.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "stream_label",
                    "stream_label was not specified but it is required when building GetStreamOutput",
                )
            })?,
            stream_status: self.stream_status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "stream_status",
                    "stream_status was not specified but it is required when building GetStreamOutput",
                )
            })?,
            stream_view_type: self.stream_view_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "stream_view_type",
                    "stream_view_type was not specified but it is required when building GetStreamOutput",
                )
            })?,
            creation_request_date_time: self.creation_request_date_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "creation_request_date_time",
                    "creation_request_date_time was not specified but it is required when building GetStreamOutput",
                )
            })?,
            keyspace_name: self.keyspace_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "keyspace_name",
                    "keyspace_name was not specified but it is required when building GetStreamOutput",
                )
            })?,
            table_name: self.table_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "table_name",
                    "table_name was not specified but it is required when building GetStreamOutput",
                )
            })?,
            shards: self.shards,
            next_token: self.next_token,
            _request_id: self._request_id,
        })
    }
}