aws-sdk-elasticache 1.110.0

AWS SDK for Amazon ElastiCache
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::reset_cache_parameter_group::_reset_cache_parameter_group_input::ResetCacheParameterGroupInputBuilder;

pub use crate::operation::reset_cache_parameter_group::_reset_cache_parameter_group_output::ResetCacheParameterGroupOutputBuilder;

impl crate::operation::reset_cache_parameter_group::builders::ResetCacheParameterGroupInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::reset_cache_parameter_group::ResetCacheParameterGroupOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::reset_cache_parameter_group::ResetCacheParameterGroupError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.reset_cache_parameter_group();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `ResetCacheParameterGroup`.
///
/// <p>Modifies the parameters of a cache parameter group to the engine or system default value. You can reset specific parameters by submitting a list of parameter names. To reset the entire cache parameter group, specify the <code>ResetAllParameters</code> and <code>CacheParameterGroupName</code> parameters.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ResetCacheParameterGroupFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::reset_cache_parameter_group::builders::ResetCacheParameterGroupInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::reset_cache_parameter_group::ResetCacheParameterGroupOutput,
        crate::operation::reset_cache_parameter_group::ResetCacheParameterGroupError,
    > for ResetCacheParameterGroupFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::reset_cache_parameter_group::ResetCacheParameterGroupOutput,
            crate::operation::reset_cache_parameter_group::ResetCacheParameterGroupError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ResetCacheParameterGroupFluentBuilder {
    /// Creates a new `ResetCacheParameterGroupFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the ResetCacheParameterGroup as a reference.
    pub fn as_input(&self) -> &crate::operation::reset_cache_parameter_group::builders::ResetCacheParameterGroupInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::reset_cache_parameter_group::ResetCacheParameterGroupOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::reset_cache_parameter_group::ResetCacheParameterGroupError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::reset_cache_parameter_group::ResetCacheParameterGroup::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::reset_cache_parameter_group::ResetCacheParameterGroup::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::reset_cache_parameter_group::ResetCacheParameterGroupOutput,
        crate::operation::reset_cache_parameter_group::ResetCacheParameterGroupError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The name of the cache parameter group to reset.</p>
    pub fn cache_parameter_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.cache_parameter_group_name(input.into());
        self
    }
    /// <p>The name of the cache parameter group to reset.</p>
    pub fn set_cache_parameter_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_cache_parameter_group_name(input);
        self
    }
    /// <p>The name of the cache parameter group to reset.</p>
    pub fn get_cache_parameter_group_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_cache_parameter_group_name()
    }
    /// <p>If <code>true</code>, all parameters in the cache parameter group are reset to their default values. If <code>false</code>, only the parameters listed by <code>ParameterNameValues</code> are reset to their default values.</p>
    /// <p>Valid values: <code>true</code> | <code>false</code></p>
    pub fn reset_all_parameters(mut self, input: bool) -> Self {
        self.inner = self.inner.reset_all_parameters(input);
        self
    }
    /// <p>If <code>true</code>, all parameters in the cache parameter group are reset to their default values. If <code>false</code>, only the parameters listed by <code>ParameterNameValues</code> are reset to their default values.</p>
    /// <p>Valid values: <code>true</code> | <code>false</code></p>
    pub fn set_reset_all_parameters(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_reset_all_parameters(input);
        self
    }
    /// <p>If <code>true</code>, all parameters in the cache parameter group are reset to their default values. If <code>false</code>, only the parameters listed by <code>ParameterNameValues</code> are reset to their default values.</p>
    /// <p>Valid values: <code>true</code> | <code>false</code></p>
    pub fn get_reset_all_parameters(&self) -> &::std::option::Option<bool> {
        self.inner.get_reset_all_parameters()
    }
    ///
    /// Appends an item to `ParameterNameValues`.
    ///
    /// To override the contents of this collection use [`set_parameter_name_values`](Self::set_parameter_name_values).
    ///
    /// <p>An array of parameter names to reset to their default values. If <code>ResetAllParameters</code> is <code>true</code>, do not use <code>ParameterNameValues</code>. If <code>ResetAllParameters</code> is <code>false</code>, you must specify the name of at least one parameter to reset.</p>
    pub fn parameter_name_values(mut self, input: crate::types::ParameterNameValue) -> Self {
        self.inner = self.inner.parameter_name_values(input);
        self
    }
    /// <p>An array of parameter names to reset to their default values. If <code>ResetAllParameters</code> is <code>true</code>, do not use <code>ParameterNameValues</code>. If <code>ResetAllParameters</code> is <code>false</code>, you must specify the name of at least one parameter to reset.</p>
    pub fn set_parameter_name_values(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ParameterNameValue>>) -> Self {
        self.inner = self.inner.set_parameter_name_values(input);
        self
    }
    /// <p>An array of parameter names to reset to their default values. If <code>ResetAllParameters</code> is <code>true</code>, do not use <code>ParameterNameValues</code>. If <code>ResetAllParameters</code> is <code>false</code>, you must specify the name of at least one parameter to reset.</p>
    pub fn get_parameter_name_values(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ParameterNameValue>> {
        self.inner.get_parameter_name_values()
    }
}