aws_sdk_appsync/operation/update_api_cache/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_api_cache::_update_api_cache_output::UpdateApiCacheOutputBuilder;
3
4pub use crate::operation::update_api_cache::_update_api_cache_input::UpdateApiCacheInputBuilder;
5
6impl crate::operation::update_api_cache::builders::UpdateApiCacheInputBuilder {
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::update_api_cache::UpdateApiCacheOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_api_cache::UpdateApiCacheError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_api_cache();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateApiCache`.
24///
25/// <p>Updates the cache for the GraphQL API.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateApiCacheFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_api_cache::builders::UpdateApiCacheInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_api_cache::UpdateApiCacheOutput,
35        crate::operation::update_api_cache::UpdateApiCacheError,
36    > for UpdateApiCacheFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_api_cache::UpdateApiCacheOutput,
44            crate::operation::update_api_cache::UpdateApiCacheError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateApiCacheFluentBuilder {
51    /// Creates a new `UpdateApiCacheFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdateApiCache as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_api_cache::builders::UpdateApiCacheInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_api_cache::UpdateApiCacheOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_api_cache::UpdateApiCacheError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_api_cache::UpdateApiCache::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_api_cache::UpdateApiCache::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_api_cache::UpdateApiCacheOutput,
97        crate::operation::update_api_cache::UpdateApiCacheError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The GraphQL API ID.</p>
112    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.api_id(input.into());
114        self
115    }
116    /// <p>The GraphQL API ID.</p>
117    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_api_id(input);
119        self
120    }
121    /// <p>The GraphQL API ID.</p>
122    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_api_id()
124    }
125    /// <p>TTL in seconds for cache entries.</p>
126    /// <p>Valid values are 1–3,600 seconds.</p>
127    pub fn ttl(mut self, input: i64) -> Self {
128        self.inner = self.inner.ttl(input);
129        self
130    }
131    /// <p>TTL in seconds for cache entries.</p>
132    /// <p>Valid values are 1–3,600 seconds.</p>
133    pub fn set_ttl(mut self, input: ::std::option::Option<i64>) -> Self {
134        self.inner = self.inner.set_ttl(input);
135        self
136    }
137    /// <p>TTL in seconds for cache entries.</p>
138    /// <p>Valid values are 1–3,600 seconds.</p>
139    pub fn get_ttl(&self) -> &::std::option::Option<i64> {
140        self.inner.get_ttl()
141    }
142    /// <p>Caching behavior.</p>
143    /// <ul>
144    /// <li>
145    /// <p><b>FULL_REQUEST_CACHING</b>: All requests from the same user are cached. Individual resolvers are automatically cached. All API calls will try to return responses from the cache.</p></li>
146    /// <li>
147    /// <p><b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p></li>
148    /// <li>
149    /// <p><b>OPERATION_LEVEL_CACHING</b>: Full requests are cached together and returned without executing resolvers.</p></li>
150    /// </ul>
151    pub fn api_caching_behavior(mut self, input: crate::types::ApiCachingBehavior) -> Self {
152        self.inner = self.inner.api_caching_behavior(input);
153        self
154    }
155    /// <p>Caching behavior.</p>
156    /// <ul>
157    /// <li>
158    /// <p><b>FULL_REQUEST_CACHING</b>: All requests from the same user are cached. Individual resolvers are automatically cached. All API calls will try to return responses from the cache.</p></li>
159    /// <li>
160    /// <p><b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p></li>
161    /// <li>
162    /// <p><b>OPERATION_LEVEL_CACHING</b>: Full requests are cached together and returned without executing resolvers.</p></li>
163    /// </ul>
164    pub fn set_api_caching_behavior(mut self, input: ::std::option::Option<crate::types::ApiCachingBehavior>) -> Self {
165        self.inner = self.inner.set_api_caching_behavior(input);
166        self
167    }
168    /// <p>Caching behavior.</p>
169    /// <ul>
170    /// <li>
171    /// <p><b>FULL_REQUEST_CACHING</b>: All requests from the same user are cached. Individual resolvers are automatically cached. All API calls will try to return responses from the cache.</p></li>
172    /// <li>
173    /// <p><b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p></li>
174    /// <li>
175    /// <p><b>OPERATION_LEVEL_CACHING</b>: Full requests are cached together and returned without executing resolvers.</p></li>
176    /// </ul>
177    pub fn get_api_caching_behavior(&self) -> &::std::option::Option<crate::types::ApiCachingBehavior> {
178        self.inner.get_api_caching_behavior()
179    }
180    /// <p>The cache instance type. Valid values are</p>
181    /// <ul>
182    /// <li>
183    /// <p><code>SMALL</code></p></li>
184    /// <li>
185    /// <p><code>MEDIUM</code></p></li>
186    /// <li>
187    /// <p><code>LARGE</code></p></li>
188    /// <li>
189    /// <p><code>XLARGE</code></p></li>
190    /// <li>
191    /// <p><code>LARGE_2X</code></p></li>
192    /// <li>
193    /// <p><code>LARGE_4X</code></p></li>
194    /// <li>
195    /// <p><code>LARGE_8X</code> (not available in all regions)</p></li>
196    /// <li>
197    /// <p><code>LARGE_12X</code></p></li>
198    /// </ul>
199    /// <p>Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.</p>
200    /// <p>The following legacy instance types are available, but their use is discouraged:</p>
201    /// <ul>
202    /// <li>
203    /// <p><b>T2_SMALL</b>: A t2.small instance type.</p></li>
204    /// <li>
205    /// <p><b>T2_MEDIUM</b>: A t2.medium instance type.</p></li>
206    /// <li>
207    /// <p><b>R4_LARGE</b>: A r4.large instance type.</p></li>
208    /// <li>
209    /// <p><b>R4_XLARGE</b>: A r4.xlarge instance type.</p></li>
210    /// <li>
211    /// <p><b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p></li>
212    /// <li>
213    /// <p><b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p></li>
214    /// <li>
215    /// <p><b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p></li>
216    /// </ul>
217    pub fn r#type(mut self, input: crate::types::ApiCacheType) -> Self {
218        self.inner = self.inner.r#type(input);
219        self
220    }
221    /// <p>The cache instance type. Valid values are</p>
222    /// <ul>
223    /// <li>
224    /// <p><code>SMALL</code></p></li>
225    /// <li>
226    /// <p><code>MEDIUM</code></p></li>
227    /// <li>
228    /// <p><code>LARGE</code></p></li>
229    /// <li>
230    /// <p><code>XLARGE</code></p></li>
231    /// <li>
232    /// <p><code>LARGE_2X</code></p></li>
233    /// <li>
234    /// <p><code>LARGE_4X</code></p></li>
235    /// <li>
236    /// <p><code>LARGE_8X</code> (not available in all regions)</p></li>
237    /// <li>
238    /// <p><code>LARGE_12X</code></p></li>
239    /// </ul>
240    /// <p>Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.</p>
241    /// <p>The following legacy instance types are available, but their use is discouraged:</p>
242    /// <ul>
243    /// <li>
244    /// <p><b>T2_SMALL</b>: A t2.small instance type.</p></li>
245    /// <li>
246    /// <p><b>T2_MEDIUM</b>: A t2.medium instance type.</p></li>
247    /// <li>
248    /// <p><b>R4_LARGE</b>: A r4.large instance type.</p></li>
249    /// <li>
250    /// <p><b>R4_XLARGE</b>: A r4.xlarge instance type.</p></li>
251    /// <li>
252    /// <p><b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p></li>
253    /// <li>
254    /// <p><b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p></li>
255    /// <li>
256    /// <p><b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p></li>
257    /// </ul>
258    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ApiCacheType>) -> Self {
259        self.inner = self.inner.set_type(input);
260        self
261    }
262    /// <p>The cache instance type. Valid values are</p>
263    /// <ul>
264    /// <li>
265    /// <p><code>SMALL</code></p></li>
266    /// <li>
267    /// <p><code>MEDIUM</code></p></li>
268    /// <li>
269    /// <p><code>LARGE</code></p></li>
270    /// <li>
271    /// <p><code>XLARGE</code></p></li>
272    /// <li>
273    /// <p><code>LARGE_2X</code></p></li>
274    /// <li>
275    /// <p><code>LARGE_4X</code></p></li>
276    /// <li>
277    /// <p><code>LARGE_8X</code> (not available in all regions)</p></li>
278    /// <li>
279    /// <p><code>LARGE_12X</code></p></li>
280    /// </ul>
281    /// <p>Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.</p>
282    /// <p>The following legacy instance types are available, but their use is discouraged:</p>
283    /// <ul>
284    /// <li>
285    /// <p><b>T2_SMALL</b>: A t2.small instance type.</p></li>
286    /// <li>
287    /// <p><b>T2_MEDIUM</b>: A t2.medium instance type.</p></li>
288    /// <li>
289    /// <p><b>R4_LARGE</b>: A r4.large instance type.</p></li>
290    /// <li>
291    /// <p><b>R4_XLARGE</b>: A r4.xlarge instance type.</p></li>
292    /// <li>
293    /// <p><b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p></li>
294    /// <li>
295    /// <p><b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p></li>
296    /// <li>
297    /// <p><b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p></li>
298    /// </ul>
299    pub fn get_type(&self) -> &::std::option::Option<crate::types::ApiCacheType> {
300        self.inner.get_type()
301    }
302    /// <p>Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:</p>
303    /// <ul>
304    /// <li>
305    /// <p>NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
306    /// <li>
307    /// <p>EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
308    /// </ul>
309    /// <p>Metrics will be recorded by API ID. You can set the value to <code>ENABLED</code> or <code>DISABLED</code>.</p>
310    pub fn health_metrics_config(mut self, input: crate::types::CacheHealthMetricsConfig) -> Self {
311        self.inner = self.inner.health_metrics_config(input);
312        self
313    }
314    /// <p>Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:</p>
315    /// <ul>
316    /// <li>
317    /// <p>NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
318    /// <li>
319    /// <p>EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
320    /// </ul>
321    /// <p>Metrics will be recorded by API ID. You can set the value to <code>ENABLED</code> or <code>DISABLED</code>.</p>
322    pub fn set_health_metrics_config(mut self, input: ::std::option::Option<crate::types::CacheHealthMetricsConfig>) -> Self {
323        self.inner = self.inner.set_health_metrics_config(input);
324        self
325    }
326    /// <p>Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:</p>
327    /// <ul>
328    /// <li>
329    /// <p>NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
330    /// <li>
331    /// <p>EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
332    /// </ul>
333    /// <p>Metrics will be recorded by API ID. You can set the value to <code>ENABLED</code> or <code>DISABLED</code>.</p>
334    pub fn get_health_metrics_config(&self) -> &::std::option::Option<crate::types::CacheHealthMetricsConfig> {
335        self.inner.get_health_metrics_config()
336    }
337}