aws-sdk-ssmsap 1.106.0

AWS SDK for AWS Systems Manager for SAP
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The SAP HANA database of the application registered with AWS Systems Manager for SAP.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Database {
    /// <p>The ID of the application.</p>
    pub application_id: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the component.</p>
    pub component_id: ::std::option::Option<::std::string::String>,
    /// <p>The credentials of the database.</p>
    pub credentials: ::std::option::Option<::std::vec::Vec<crate::types::ApplicationCredential>>,
    /// <p>The ID of the SAP HANA database.</p>
    pub database_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the database.</p>
    pub database_name: ::std::option::Option<::std::string::String>,
    /// <p>The type of the database.</p>
    pub database_type: ::std::option::Option<crate::types::DatabaseType>,
    /// <p>The Amazon Resource Name (ARN) of the database.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The status of the database.</p>
    pub status: ::std::option::Option<crate::types::DatabaseStatus>,
    /// <p>The primary host of the database.</p>
    pub primary_host: ::std::option::Option<::std::string::String>,
    /// <p>The SQL port of the database.</p>
    pub sql_port: ::std::option::Option<i32>,
    /// <p>The time at which the database was last updated.</p>
    pub last_updated: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The Amazon Resource Names of the connected AWS Systems Manager for SAP components.</p>
    pub connected_component_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Database {
    /// <p>The ID of the application.</p>
    pub fn application_id(&self) -> ::std::option::Option<&str> {
        self.application_id.as_deref()
    }
    /// <p>The ID of the component.</p>
    pub fn component_id(&self) -> ::std::option::Option<&str> {
        self.component_id.as_deref()
    }
    /// <p>The credentials of the database.</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 `.credentials.is_none()`.
    pub fn credentials(&self) -> &[crate::types::ApplicationCredential] {
        self.credentials.as_deref().unwrap_or_default()
    }
    /// <p>The ID of the SAP HANA database.</p>
    pub fn database_id(&self) -> ::std::option::Option<&str> {
        self.database_id.as_deref()
    }
    /// <p>The name of the database.</p>
    pub fn database_name(&self) -> ::std::option::Option<&str> {
        self.database_name.as_deref()
    }
    /// <p>The type of the database.</p>
    pub fn database_type(&self) -> ::std::option::Option<&crate::types::DatabaseType> {
        self.database_type.as_ref()
    }
    /// <p>The Amazon Resource Name (ARN) of the database.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The status of the database.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::DatabaseStatus> {
        self.status.as_ref()
    }
    /// <p>The primary host of the database.</p>
    pub fn primary_host(&self) -> ::std::option::Option<&str> {
        self.primary_host.as_deref()
    }
    /// <p>The SQL port of the database.</p>
    pub fn sql_port(&self) -> ::std::option::Option<i32> {
        self.sql_port
    }
    /// <p>The time at which the database was last updated.</p>
    pub fn last_updated(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_updated.as_ref()
    }
    /// <p>The Amazon Resource Names of the connected AWS Systems Manager for SAP components.</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 `.connected_component_arns.is_none()`.
    pub fn connected_component_arns(&self) -> &[::std::string::String] {
        self.connected_component_arns.as_deref().unwrap_or_default()
    }
}
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) application_id: ::std::option::Option<::std::string::String>,
    pub(crate) component_id: ::std::option::Option<::std::string::String>,
    pub(crate) credentials: ::std::option::Option<::std::vec::Vec<crate::types::ApplicationCredential>>,
    pub(crate) database_id: ::std::option::Option<::std::string::String>,
    pub(crate) database_name: ::std::option::Option<::std::string::String>,
    pub(crate) database_type: ::std::option::Option<crate::types::DatabaseType>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::DatabaseStatus>,
    pub(crate) primary_host: ::std::option::Option<::std::string::String>,
    pub(crate) sql_port: ::std::option::Option<i32>,
    pub(crate) last_updated: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) connected_component_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl DatabaseBuilder {
    /// <p>The ID of the application.</p>
    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.application_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the application.</p>
    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_id = input;
        self
    }
    /// <p>The ID of the application.</p>
    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_id
    }
    /// <p>The ID of the component.</p>
    pub fn component_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.component_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the component.</p>
    pub fn set_component_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.component_id = input;
        self
    }
    /// <p>The ID of the component.</p>
    pub fn get_component_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.component_id
    }
    /// Appends an item to `credentials`.
    ///
    /// To override the contents of this collection use [`set_credentials`](Self::set_credentials).
    ///
    /// <p>The credentials of the database.</p>
    pub fn credentials(mut self, input: crate::types::ApplicationCredential) -> Self {
        let mut v = self.credentials.unwrap_or_default();
        v.push(input);
        self.credentials = ::std::option::Option::Some(v);
        self
    }
    /// <p>The credentials of the database.</p>
    pub fn set_credentials(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ApplicationCredential>>) -> Self {
        self.credentials = input;
        self
    }
    /// <p>The credentials of the database.</p>
    pub fn get_credentials(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ApplicationCredential>> {
        &self.credentials
    }
    /// <p>The ID of the SAP HANA database.</p>
    pub fn database_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.database_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the SAP HANA database.</p>
    pub fn set_database_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.database_id = input;
        self
    }
    /// <p>The ID of the SAP HANA database.</p>
    pub fn get_database_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.database_id
    }
    /// <p>The name of the 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 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 database.</p>
    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.database_name
    }
    /// <p>The type of the database.</p>
    pub fn database_type(mut self, input: crate::types::DatabaseType) -> Self {
        self.database_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the database.</p>
    pub fn set_database_type(mut self, input: ::std::option::Option<crate::types::DatabaseType>) -> Self {
        self.database_type = input;
        self
    }
    /// <p>The type of the database.</p>
    pub fn get_database_type(&self) -> &::std::option::Option<crate::types::DatabaseType> {
        &self.database_type
    }
    /// <p>The Amazon Resource Name (ARN) of the 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 (ARN) of the 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 (ARN) of the database.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The status of the database.</p>
    pub fn status(mut self, input: crate::types::DatabaseStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the database.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::DatabaseStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the database.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::DatabaseStatus> {
        &self.status
    }
    /// <p>The primary host of the database.</p>
    pub fn primary_host(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.primary_host = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The primary host of the database.</p>
    pub fn set_primary_host(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.primary_host = input;
        self
    }
    /// <p>The primary host of the database.</p>
    pub fn get_primary_host(&self) -> &::std::option::Option<::std::string::String> {
        &self.primary_host
    }
    /// <p>The SQL port of the database.</p>
    pub fn sql_port(mut self, input: i32) -> Self {
        self.sql_port = ::std::option::Option::Some(input);
        self
    }
    /// <p>The SQL port of the database.</p>
    pub fn set_sql_port(mut self, input: ::std::option::Option<i32>) -> Self {
        self.sql_port = input;
        self
    }
    /// <p>The SQL port of the database.</p>
    pub fn get_sql_port(&self) -> &::std::option::Option<i32> {
        &self.sql_port
    }
    /// <p>The time at which the database was last updated.</p>
    pub fn last_updated(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_updated = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the database was last updated.</p>
    pub fn set_last_updated(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_updated = input;
        self
    }
    /// <p>The time at which the database was last updated.</p>
    pub fn get_last_updated(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_updated
    }
    /// Appends an item to `connected_component_arns`.
    ///
    /// To override the contents of this collection use [`set_connected_component_arns`](Self::set_connected_component_arns).
    ///
    /// <p>The Amazon Resource Names of the connected AWS Systems Manager for SAP components.</p>
    pub fn connected_component_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.connected_component_arns.unwrap_or_default();
        v.push(input.into());
        self.connected_component_arns = ::std::option::Option::Some(v);
        self
    }
    /// <p>The Amazon Resource Names of the connected AWS Systems Manager for SAP components.</p>
    pub fn set_connected_component_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.connected_component_arns = input;
        self
    }
    /// <p>The Amazon Resource Names of the connected AWS Systems Manager for SAP components.</p>
    pub fn get_connected_component_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.connected_component_arns
    }
    /// Consumes the builder and constructs a [`Database`](crate::types::Database).
    pub fn build(self) -> crate::types::Database {
        crate::types::Database {
            application_id: self.application_id,
            component_id: self.component_id,
            credentials: self.credentials,
            database_id: self.database_id,
            database_name: self.database_name,
            database_type: self.database_type,
            arn: self.arn,
            status: self.status,
            primary_host: self.primary_host,
            sql_port: self.sql_port,
            last_updated: self.last_updated,
            connected_component_arns: self.connected_component_arns,
        }
    }
}