aws-sdk-timestreamwrite 1.98.0

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

/// <p>A top-level container for a table. Databases and tables are the fundamental management concepts in Amazon Timestream. All tables in a database are encrypted with the same KMS key.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Database {
    /// <p>The Amazon Resource Name that uniquely identifies this database.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the Timestream database.</p>
    pub database_name: ::std::option::Option<::std::string::String>,
    /// <p>The total number of tables found within a Timestream database.</p>
    pub table_count: i64,
    /// <p>The identifier of the KMS key used to encrypt the data stored in the database.</p>
    pub kms_key_id: ::std::option::Option<::std::string::String>,
    /// <p>The time when the database was created, calculated from the Unix epoch time.</p>
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The last time that this database was updated.</p>
    pub last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Database {
    /// <p>The Amazon Resource Name that uniquely identifies this database.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The name of the Timestream database.</p>
    pub fn database_name(&self) -> ::std::option::Option<&str> {
        self.database_name.as_deref()
    }
    /// <p>The total number of tables found within a Timestream database.</p>
    pub fn table_count(&self) -> i64 {
        self.table_count
    }
    /// <p>The identifier of the KMS key used to encrypt the data stored in the database.</p>
    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
        self.kms_key_id.as_deref()
    }
    /// <p>The time when the database was created, calculated from the Unix epoch time.</p>
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
    /// <p>The last time that this database was updated.</p>
    pub fn last_updated_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_updated_time.as_ref()
    }
}
impl Database {
    /// Creates a new builder-style object to manufacture [`Database`](crate::types::Database).
    pub fn builder() -> crate::types::builders::DatabaseBuilder {
        crate::types::builders::DatabaseBuilder::default()
    }
}

/// A builder for [`Database`](crate::types::Database).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DatabaseBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) database_name: ::std::option::Option<::std::string::String>,
    pub(crate) table_count: ::std::option::Option<i64>,
    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl DatabaseBuilder {
    /// <p>The Amazon Resource Name that uniquely identifies this database.</p>
    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 Amazon Resource Name that uniquely identifies this database.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name that uniquely identifies this database.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The name of the Timestream database.</p>
    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.database_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the Timestream database.</p>
    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.database_name = input;
        self
    }
    /// <p>The name of the Timestream database.</p>
    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.database_name
    }
    /// <p>The total number of tables found within a Timestream database.</p>
    pub fn table_count(mut self, input: i64) -> Self {
        self.table_count = ::std::option::Option::Some(input);
        self
    }
    /// <p>The total number of tables found within a Timestream database.</p>
    pub fn set_table_count(mut self, input: ::std::option::Option<i64>) -> Self {
        self.table_count = input;
        self
    }
    /// <p>The total number of tables found within a Timestream database.</p>
    pub fn get_table_count(&self) -> &::std::option::Option<i64> {
        &self.table_count
    }
    /// <p>The identifier of the KMS key used to encrypt the data stored in the database.</p>
    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the KMS key used to encrypt the data stored in the database.</p>
    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key_id = input;
        self
    }
    /// <p>The identifier of the KMS key used to encrypt the data stored in the database.</p>
    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.kms_key_id
    }
    /// <p>The time when the database was created, calculated from the Unix epoch time.</p>
    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 database was created, calculated from the Unix epoch time.</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 database was created, calculated from the Unix epoch time.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>The last time that this database was updated.</p>
    pub fn last_updated_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_updated_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The last time that this database was updated.</p>
    pub fn set_last_updated_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_updated_time = input;
        self
    }
    /// <p>The last time that this database was updated.</p>
    pub fn get_last_updated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_updated_time
    }
    /// Consumes the builder and constructs a [`Database`](crate::types::Database).
    pub fn build(self) -> crate::types::Database {
        crate::types::Database {
            arn: self.arn,
            database_name: self.database_name,
            table_count: self.table_count.unwrap_or_default(),
            kms_key_id: self.kms_key_id,
            creation_time: self.creation_time,
            last_updated_time: self.last_updated_time,
        }
    }
}