aws-sdk-memorydb 1.46.0

AWS SDK for Amazon MemoryDB
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 FailoverShardInput {
    /// <p>The cluster being failed over</p>
    pub cluster_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the shard</p>
    pub shard_name: ::std::option::Option<::std::string::String>,
}
impl FailoverShardInput {
    /// <p>The cluster being failed over</p>
    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
        self.cluster_name.as_deref()
    }
    /// <p>The name of the shard</p>
    pub fn shard_name(&self) -> ::std::option::Option<&str> {
        self.shard_name.as_deref()
    }
}
impl FailoverShardInput {
    /// Creates a new builder-style object to manufacture [`FailoverShardInput`](crate::operation::failover_shard::FailoverShardInput).
    pub fn builder() -> crate::operation::failover_shard::builders::FailoverShardInputBuilder {
        crate::operation::failover_shard::builders::FailoverShardInputBuilder::default()
    }
}

/// A builder for [`FailoverShardInput`](crate::operation::failover_shard::FailoverShardInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct FailoverShardInputBuilder {
    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
    pub(crate) shard_name: ::std::option::Option<::std::string::String>,
}
impl FailoverShardInputBuilder {
    /// <p>The cluster being failed over</p>
    /// This field is required.
    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The cluster being failed over</p>
    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_name = input;
        self
    }
    /// <p>The cluster being failed over</p>
    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_name
    }
    /// <p>The name of the shard</p>
    /// This field is required.
    pub fn shard_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.shard_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the shard</p>
    pub fn set_shard_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.shard_name = input;
        self
    }
    /// <p>The name of the shard</p>
    pub fn get_shard_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.shard_name
    }
    /// Consumes the builder and constructs a [`FailoverShardInput`](crate::operation::failover_shard::FailoverShardInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::failover_shard::FailoverShardInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::failover_shard::FailoverShardInput {
            cluster_name: self.cluster_name,
            shard_name: self.shard_name,
        })
    }
}