aws_sdk_appsync/operation/create_api_cache/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_api_cache::_create_api_cache_output::CreateApiCacheOutputBuilder;
3
4pub use crate::operation::create_api_cache::_create_api_cache_input::CreateApiCacheInputBuilder;
5
6impl crate::operation::create_api_cache::builders::CreateApiCacheInputBuilder {
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_api_cache::CreateApiCacheOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_api_cache::CreateApiCacheError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_api_cache();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateApiCache`.
24///
25/// <p>Creates a cache for the GraphQL API.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateApiCacheFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_api_cache::builders::CreateApiCacheInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_api_cache::CreateApiCacheOutput,
35 crate::operation::create_api_cache::CreateApiCacheError,
36 > for CreateApiCacheFluentBuilder
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::create_api_cache::CreateApiCacheOutput,
44 crate::operation::create_api_cache::CreateApiCacheError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateApiCacheFluentBuilder {
51 /// Creates a new `CreateApiCacheFluentBuilder`.
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 CreateApiCache as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_api_cache::builders::CreateApiCacheInputBuilder {
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::create_api_cache::CreateApiCacheOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_api_cache::CreateApiCacheError,
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::create_api_cache::CreateApiCache::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_api_cache::CreateApiCache::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::create_api_cache::CreateApiCacheOutput,
97 crate::operation::create_api_cache::CreateApiCacheError,
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>Transit encryption flag when connecting to cache. You cannot update this setting after creation.</p>
143 #[deprecated(
144 note = "transitEncryptionEnabled attribute is deprecated. Encryption in transit is always enabled.",
145 since = "5/15/2025"
146 )]
147 pub fn transit_encryption_enabled(mut self, input: bool) -> Self {
148 self.inner = self.inner.transit_encryption_enabled(input);
149 self
150 }
151 /// <p>Transit encryption flag when connecting to cache. You cannot update this setting after creation.</p>
152 #[deprecated(
153 note = "transitEncryptionEnabled attribute is deprecated. Encryption in transit is always enabled.",
154 since = "5/15/2025"
155 )]
156 pub fn set_transit_encryption_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
157 self.inner = self.inner.set_transit_encryption_enabled(input);
158 self
159 }
160 /// <p>Transit encryption flag when connecting to cache. You cannot update this setting after creation.</p>
161 #[deprecated(
162 note = "transitEncryptionEnabled attribute is deprecated. Encryption in transit is always enabled.",
163 since = "5/15/2025"
164 )]
165 pub fn get_transit_encryption_enabled(&self) -> &::std::option::Option<bool> {
166 self.inner.get_transit_encryption_enabled()
167 }
168 /// <p>At-rest encryption flag for cache. You cannot update this setting after creation.</p>
169 #[deprecated(
170 note = "atRestEncryptionEnabled attribute is deprecated. Encryption at rest is always enabled.",
171 since = "5/15/2025"
172 )]
173 pub fn at_rest_encryption_enabled(mut self, input: bool) -> Self {
174 self.inner = self.inner.at_rest_encryption_enabled(input);
175 self
176 }
177 /// <p>At-rest encryption flag for cache. You cannot update this setting after creation.</p>
178 #[deprecated(
179 note = "atRestEncryptionEnabled attribute is deprecated. Encryption at rest is always enabled.",
180 since = "5/15/2025"
181 )]
182 pub fn set_at_rest_encryption_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
183 self.inner = self.inner.set_at_rest_encryption_enabled(input);
184 self
185 }
186 /// <p>At-rest encryption flag for cache. You cannot update this setting after creation.</p>
187 #[deprecated(
188 note = "atRestEncryptionEnabled attribute is deprecated. Encryption at rest is always enabled.",
189 since = "5/15/2025"
190 )]
191 pub fn get_at_rest_encryption_enabled(&self) -> &::std::option::Option<bool> {
192 self.inner.get_at_rest_encryption_enabled()
193 }
194 /// <p>Caching behavior.</p>
195 /// <ul>
196 /// <li>
197 /// <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>
198 /// <li>
199 /// <p><b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p></li>
200 /// <li>
201 /// <p><b>OPERATION_LEVEL_CACHING</b>: Full requests are cached together and returned without executing resolvers.</p></li>
202 /// </ul>
203 pub fn api_caching_behavior(mut self, input: crate::types::ApiCachingBehavior) -> Self {
204 self.inner = self.inner.api_caching_behavior(input);
205 self
206 }
207 /// <p>Caching behavior.</p>
208 /// <ul>
209 /// <li>
210 /// <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>
211 /// <li>
212 /// <p><b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p></li>
213 /// <li>
214 /// <p><b>OPERATION_LEVEL_CACHING</b>: Full requests are cached together and returned without executing resolvers.</p></li>
215 /// </ul>
216 pub fn set_api_caching_behavior(mut self, input: ::std::option::Option<crate::types::ApiCachingBehavior>) -> Self {
217 self.inner = self.inner.set_api_caching_behavior(input);
218 self
219 }
220 /// <p>Caching behavior.</p>
221 /// <ul>
222 /// <li>
223 /// <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>
224 /// <li>
225 /// <p><b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p></li>
226 /// <li>
227 /// <p><b>OPERATION_LEVEL_CACHING</b>: Full requests are cached together and returned without executing resolvers.</p></li>
228 /// </ul>
229 pub fn get_api_caching_behavior(&self) -> &::std::option::Option<crate::types::ApiCachingBehavior> {
230 self.inner.get_api_caching_behavior()
231 }
232 /// <p>The cache instance type. Valid values are</p>
233 /// <ul>
234 /// <li>
235 /// <p><code>SMALL</code></p></li>
236 /// <li>
237 /// <p><code>MEDIUM</code></p></li>
238 /// <li>
239 /// <p><code>LARGE</code></p></li>
240 /// <li>
241 /// <p><code>XLARGE</code></p></li>
242 /// <li>
243 /// <p><code>LARGE_2X</code></p></li>
244 /// <li>
245 /// <p><code>LARGE_4X</code></p></li>
246 /// <li>
247 /// <p><code>LARGE_8X</code> (not available in all regions)</p></li>
248 /// <li>
249 /// <p><code>LARGE_12X</code></p></li>
250 /// </ul>
251 /// <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>
252 /// <p>The following legacy instance types are available, but their use is discouraged:</p>
253 /// <ul>
254 /// <li>
255 /// <p><b>T2_SMALL</b>: A t2.small instance type.</p></li>
256 /// <li>
257 /// <p><b>T2_MEDIUM</b>: A t2.medium instance type.</p></li>
258 /// <li>
259 /// <p><b>R4_LARGE</b>: A r4.large instance type.</p></li>
260 /// <li>
261 /// <p><b>R4_XLARGE</b>: A r4.xlarge instance type.</p></li>
262 /// <li>
263 /// <p><b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p></li>
264 /// <li>
265 /// <p><b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p></li>
266 /// <li>
267 /// <p><b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p></li>
268 /// </ul>
269 pub fn r#type(mut self, input: crate::types::ApiCacheType) -> Self {
270 self.inner = self.inner.r#type(input);
271 self
272 }
273 /// <p>The cache instance type. Valid values are</p>
274 /// <ul>
275 /// <li>
276 /// <p><code>SMALL</code></p></li>
277 /// <li>
278 /// <p><code>MEDIUM</code></p></li>
279 /// <li>
280 /// <p><code>LARGE</code></p></li>
281 /// <li>
282 /// <p><code>XLARGE</code></p></li>
283 /// <li>
284 /// <p><code>LARGE_2X</code></p></li>
285 /// <li>
286 /// <p><code>LARGE_4X</code></p></li>
287 /// <li>
288 /// <p><code>LARGE_8X</code> (not available in all regions)</p></li>
289 /// <li>
290 /// <p><code>LARGE_12X</code></p></li>
291 /// </ul>
292 /// <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>
293 /// <p>The following legacy instance types are available, but their use is discouraged:</p>
294 /// <ul>
295 /// <li>
296 /// <p><b>T2_SMALL</b>: A t2.small instance type.</p></li>
297 /// <li>
298 /// <p><b>T2_MEDIUM</b>: A t2.medium instance type.</p></li>
299 /// <li>
300 /// <p><b>R4_LARGE</b>: A r4.large instance type.</p></li>
301 /// <li>
302 /// <p><b>R4_XLARGE</b>: A r4.xlarge instance type.</p></li>
303 /// <li>
304 /// <p><b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p></li>
305 /// <li>
306 /// <p><b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p></li>
307 /// <li>
308 /// <p><b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p></li>
309 /// </ul>
310 pub fn set_type(mut self, input: ::std::option::Option<crate::types::ApiCacheType>) -> Self {
311 self.inner = self.inner.set_type(input);
312 self
313 }
314 /// <p>The cache instance type. Valid values are</p>
315 /// <ul>
316 /// <li>
317 /// <p><code>SMALL</code></p></li>
318 /// <li>
319 /// <p><code>MEDIUM</code></p></li>
320 /// <li>
321 /// <p><code>LARGE</code></p></li>
322 /// <li>
323 /// <p><code>XLARGE</code></p></li>
324 /// <li>
325 /// <p><code>LARGE_2X</code></p></li>
326 /// <li>
327 /// <p><code>LARGE_4X</code></p></li>
328 /// <li>
329 /// <p><code>LARGE_8X</code> (not available in all regions)</p></li>
330 /// <li>
331 /// <p><code>LARGE_12X</code></p></li>
332 /// </ul>
333 /// <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>
334 /// <p>The following legacy instance types are available, but their use is discouraged:</p>
335 /// <ul>
336 /// <li>
337 /// <p><b>T2_SMALL</b>: A t2.small instance type.</p></li>
338 /// <li>
339 /// <p><b>T2_MEDIUM</b>: A t2.medium instance type.</p></li>
340 /// <li>
341 /// <p><b>R4_LARGE</b>: A r4.large instance type.</p></li>
342 /// <li>
343 /// <p><b>R4_XLARGE</b>: A r4.xlarge instance type.</p></li>
344 /// <li>
345 /// <p><b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p></li>
346 /// <li>
347 /// <p><b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p></li>
348 /// <li>
349 /// <p><b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p></li>
350 /// </ul>
351 pub fn get_type(&self) -> &::std::option::Option<crate::types::ApiCacheType> {
352 self.inner.get_type()
353 }
354 /// <p>Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:</p>
355 /// <ul>
356 /// <li>
357 /// <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>
358 /// <li>
359 /// <p>EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
360 /// </ul>
361 /// <p>Metrics will be recorded by API ID. You can set the value to <code>ENABLED</code> or <code>DISABLED</code>.</p>
362 pub fn health_metrics_config(mut self, input: crate::types::CacheHealthMetricsConfig) -> Self {
363 self.inner = self.inner.health_metrics_config(input);
364 self
365 }
366 /// <p>Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:</p>
367 /// <ul>
368 /// <li>
369 /// <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>
370 /// <li>
371 /// <p>EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
372 /// </ul>
373 /// <p>Metrics will be recorded by API ID. You can set the value to <code>ENABLED</code> or <code>DISABLED</code>.</p>
374 pub fn set_health_metrics_config(mut self, input: ::std::option::Option<crate::types::CacheHealthMetricsConfig>) -> Self {
375 self.inner = self.inner.set_health_metrics_config(input);
376 self
377 }
378 /// <p>Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:</p>
379 /// <ul>
380 /// <li>
381 /// <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>
382 /// <li>
383 /// <p>EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
384 /// </ul>
385 /// <p>Metrics will be recorded by API ID. You can set the value to <code>ENABLED</code> or <code>DISABLED</code>.</p>
386 pub fn get_health_metrics_config(&self) -> &::std::option::Option<crate::types::CacheHealthMetricsConfig> {
387 self.inner.get_health_metrics_config()
388 }
389}