aws_sdk_elasticache/operation/create_cache_parameter_group/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_cache_parameter_group::_create_cache_parameter_group_output::CreateCacheParameterGroupOutputBuilder;
3
4pub use crate::operation::create_cache_parameter_group::_create_cache_parameter_group_input::CreateCacheParameterGroupInputBuilder;
5
6impl crate::operation::create_cache_parameter_group::builders::CreateCacheParameterGroupInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_cache_parameter_group::CreateCacheParameterGroupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_cache_parameter_group::CreateCacheParameterGroupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_cache_parameter_group();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateCacheParameterGroup`.
24///
25/// <p>Creates a new Amazon ElastiCache cache parameter group. An ElastiCache cache parameter group is a collection of parameters and their values that are applied to all of the nodes in any cluster or replication group using the CacheParameterGroup.</p>
26/// <p>A newly created CacheParameterGroup is an exact duplicate of the default parameter group for the CacheParameterGroupFamily. To customize the newly created CacheParameterGroup you can change the values of specific parameters. For more information, see:</p>
27/// <ul>
28/// <li>
29/// <p><a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_ModifyCacheParameterGroup.html">ModifyCacheParameterGroup</a> in the ElastiCache API Reference.</p></li>
30/// <li>
31/// <p><a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/ParameterGroups.html">Parameters and Parameter Groups</a> in the ElastiCache User Guide.</p></li>
32/// </ul>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct CreateCacheParameterGroupFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::create_cache_parameter_group::builders::CreateCacheParameterGroupInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::create_cache_parameter_group::CreateCacheParameterGroupOutput,
42        crate::operation::create_cache_parameter_group::CreateCacheParameterGroupError,
43    > for CreateCacheParameterGroupFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::create_cache_parameter_group::CreateCacheParameterGroupOutput,
51            crate::operation::create_cache_parameter_group::CreateCacheParameterGroupError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl CreateCacheParameterGroupFluentBuilder {
58    /// Creates a new `CreateCacheParameterGroupFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the CreateCacheParameterGroup as a reference.
67    pub fn as_input(&self) -> &crate::operation::create_cache_parameter_group::builders::CreateCacheParameterGroupInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::create_cache_parameter_group::CreateCacheParameterGroupOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::create_cache_parameter_group::CreateCacheParameterGroupError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::create_cache_parameter_group::CreateCacheParameterGroup::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::create_cache_parameter_group::CreateCacheParameterGroup::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::create_cache_parameter_group::CreateCacheParameterGroupOutput,
104        crate::operation::create_cache_parameter_group::CreateCacheParameterGroupError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>A user-specified name for the cache parameter group.</p>
119    pub fn cache_parameter_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.cache_parameter_group_name(input.into());
121        self
122    }
123    /// <p>A user-specified name for the cache parameter group.</p>
124    pub fn set_cache_parameter_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_cache_parameter_group_name(input);
126        self
127    }
128    /// <p>A user-specified name for the cache parameter group.</p>
129    pub fn get_cache_parameter_group_name(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_cache_parameter_group_name()
131    }
132    /// <p>The name of the cache parameter group family that the cache parameter group can be used with.</p>
133    /// <p>Valid values are: <code>valkey8</code> | <code>valkey7</code> | <code>memcached1.4</code> | <code>memcached1.5</code> | <code>memcached1.6</code> | <code>redis2.6</code> | <code>redis2.8</code> | <code>redis3.2</code> | <code>redis4.0</code> | <code>redis5.0</code> | <code>redis6.x</code> | <code>redis7</code></p>
134    pub fn cache_parameter_group_family(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.cache_parameter_group_family(input.into());
136        self
137    }
138    /// <p>The name of the cache parameter group family that the cache parameter group can be used with.</p>
139    /// <p>Valid values are: <code>valkey8</code> | <code>valkey7</code> | <code>memcached1.4</code> | <code>memcached1.5</code> | <code>memcached1.6</code> | <code>redis2.6</code> | <code>redis2.8</code> | <code>redis3.2</code> | <code>redis4.0</code> | <code>redis5.0</code> | <code>redis6.x</code> | <code>redis7</code></p>
140    pub fn set_cache_parameter_group_family(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.inner = self.inner.set_cache_parameter_group_family(input);
142        self
143    }
144    /// <p>The name of the cache parameter group family that the cache parameter group can be used with.</p>
145    /// <p>Valid values are: <code>valkey8</code> | <code>valkey7</code> | <code>memcached1.4</code> | <code>memcached1.5</code> | <code>memcached1.6</code> | <code>redis2.6</code> | <code>redis2.8</code> | <code>redis3.2</code> | <code>redis4.0</code> | <code>redis5.0</code> | <code>redis6.x</code> | <code>redis7</code></p>
146    pub fn get_cache_parameter_group_family(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_cache_parameter_group_family()
148    }
149    /// <p>A user-specified description for the cache parameter group.</p>
150    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.description(input.into());
152        self
153    }
154    /// <p>A user-specified description for the cache parameter group.</p>
155    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_description(input);
157        self
158    }
159    /// <p>A user-specified description for the cache parameter group.</p>
160    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_description()
162    }
163    ///
164    /// Appends an item to `Tags`.
165    ///
166    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
167    ///
168    /// <p>A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.</p>
169    pub fn tags(mut self, input: crate::types::Tag) -> Self {
170        self.inner = self.inner.tags(input);
171        self
172    }
173    /// <p>A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.</p>
174    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
175        self.inner = self.inner.set_tags(input);
176        self
177    }
178    /// <p>A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.</p>
179    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
180        self.inner.get_tags()
181    }
182}