aws-sdk-rds 1.132.0

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

/// <p></p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct FailoverDbClusterInput {
    /// <p>The identifier of the DB cluster to force a failover for. This parameter isn't case-sensitive.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must match the identifier of an existing DB cluster.</p></li>
    /// </ul>
    pub db_cluster_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The name of the DB instance to promote to the primary DB instance.</p>
    /// <p>Specify the DB instance identifier for an Aurora Replica or a Multi-AZ readable standby in the DB cluster, for example <code>mydbcluster-replica1</code>.</p>
    /// <p>This setting isn't supported for RDS for MySQL Multi-AZ DB clusters.</p>
    pub target_db_instance_identifier: ::std::option::Option<::std::string::String>,
}
impl FailoverDbClusterInput {
    /// <p>The identifier of the DB cluster to force a failover for. This parameter isn't case-sensitive.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must match the identifier of an existing DB cluster.</p></li>
    /// </ul>
    pub fn db_cluster_identifier(&self) -> ::std::option::Option<&str> {
        self.db_cluster_identifier.as_deref()
    }
    /// <p>The name of the DB instance to promote to the primary DB instance.</p>
    /// <p>Specify the DB instance identifier for an Aurora Replica or a Multi-AZ readable standby in the DB cluster, for example <code>mydbcluster-replica1</code>.</p>
    /// <p>This setting isn't supported for RDS for MySQL Multi-AZ DB clusters.</p>
    pub fn target_db_instance_identifier(&self) -> ::std::option::Option<&str> {
        self.target_db_instance_identifier.as_deref()
    }
}
impl FailoverDbClusterInput {
    /// Creates a new builder-style object to manufacture [`FailoverDbClusterInput`](crate::operation::failover_db_cluster::FailoverDbClusterInput).
    pub fn builder() -> crate::operation::failover_db_cluster::builders::FailoverDbClusterInputBuilder {
        crate::operation::failover_db_cluster::builders::FailoverDbClusterInputBuilder::default()
    }
}

/// A builder for [`FailoverDbClusterInput`](crate::operation::failover_db_cluster::FailoverDbClusterInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct FailoverDbClusterInputBuilder {
    pub(crate) db_cluster_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) target_db_instance_identifier: ::std::option::Option<::std::string::String>,
}
impl FailoverDbClusterInputBuilder {
    /// <p>The identifier of the DB cluster to force a failover for. This parameter isn't case-sensitive.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must match the identifier of an existing DB cluster.</p></li>
    /// </ul>
    /// This field is required.
    pub fn db_cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.db_cluster_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the DB cluster to force a failover for. This parameter isn't case-sensitive.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must match the identifier of an existing DB cluster.</p></li>
    /// </ul>
    pub fn set_db_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.db_cluster_identifier = input;
        self
    }
    /// <p>The identifier of the DB cluster to force a failover for. This parameter isn't case-sensitive.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must match the identifier of an existing DB cluster.</p></li>
    /// </ul>
    pub fn get_db_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.db_cluster_identifier
    }
    /// <p>The name of the DB instance to promote to the primary DB instance.</p>
    /// <p>Specify the DB instance identifier for an Aurora Replica or a Multi-AZ readable standby in the DB cluster, for example <code>mydbcluster-replica1</code>.</p>
    /// <p>This setting isn't supported for RDS for MySQL Multi-AZ DB clusters.</p>
    pub fn target_db_instance_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.target_db_instance_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the DB instance to promote to the primary DB instance.</p>
    /// <p>Specify the DB instance identifier for an Aurora Replica or a Multi-AZ readable standby in the DB cluster, for example <code>mydbcluster-replica1</code>.</p>
    /// <p>This setting isn't supported for RDS for MySQL Multi-AZ DB clusters.</p>
    pub fn set_target_db_instance_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.target_db_instance_identifier = input;
        self
    }
    /// <p>The name of the DB instance to promote to the primary DB instance.</p>
    /// <p>Specify the DB instance identifier for an Aurora Replica or a Multi-AZ readable standby in the DB cluster, for example <code>mydbcluster-replica1</code>.</p>
    /// <p>This setting isn't supported for RDS for MySQL Multi-AZ DB clusters.</p>
    pub fn get_target_db_instance_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.target_db_instance_identifier
    }
    /// Consumes the builder and constructs a [`FailoverDbClusterInput`](crate::operation::failover_db_cluster::FailoverDbClusterInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::failover_db_cluster::FailoverDbClusterInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::failover_db_cluster::FailoverDbClusterInput {
            db_cluster_identifier: self.db_cluster_identifier,
            target_db_instance_identifier: self.target_db_instance_identifier,
        })
    }
}