aws-sdk-appsync 1.111.0

AWS SDK for AWS AppSync
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_api_cache::_update_api_cache_input::UpdateApiCacheInputBuilder;

pub use crate::operation::update_api_cache::_update_api_cache_output::UpdateApiCacheOutputBuilder;

impl crate::operation::update_api_cache::builders::UpdateApiCacheInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_api_cache::UpdateApiCacheOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_api_cache::UpdateApiCacheError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_api_cache();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateApiCache`.
///
/// <p>Updates the cache for the GraphQL API.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateApiCacheFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_api_cache::builders::UpdateApiCacheInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_api_cache::UpdateApiCacheOutput,
        crate::operation::update_api_cache::UpdateApiCacheError,
    > for UpdateApiCacheFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_api_cache::UpdateApiCacheOutput,
            crate::operation::update_api_cache::UpdateApiCacheError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateApiCacheFluentBuilder {
    /// Creates a new `UpdateApiCacheFluentBuilder`.
    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 UpdateApiCache as a reference.
    pub fn as_input(&self) -> &crate::operation::update_api_cache::builders::UpdateApiCacheInputBuilder {
        &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::update_api_cache::UpdateApiCacheOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_api_cache::UpdateApiCacheError,
            ::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::update_api_cache::UpdateApiCache::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_api_cache::UpdateApiCache::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::update_api_cache::UpdateApiCacheOutput,
        crate::operation::update_api_cache::UpdateApiCacheError,
        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 GraphQL API ID.</p>
    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.api_id(input.into());
        self
    }
    /// <p>The GraphQL API ID.</p>
    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_api_id(input);
        self
    }
    /// <p>The GraphQL API ID.</p>
    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_api_id()
    }
    /// <p>TTL in seconds for cache entries.</p>
    /// <p>Valid values are 1–3,600 seconds.</p>
    pub fn ttl(mut self, input: i64) -> Self {
        self.inner = self.inner.ttl(input);
        self
    }
    /// <p>TTL in seconds for cache entries.</p>
    /// <p>Valid values are 1–3,600 seconds.</p>
    pub fn set_ttl(mut self, input: ::std::option::Option<i64>) -> Self {
        self.inner = self.inner.set_ttl(input);
        self
    }
    /// <p>TTL in seconds for cache entries.</p>
    /// <p>Valid values are 1–3,600 seconds.</p>
    pub fn get_ttl(&self) -> &::std::option::Option<i64> {
        self.inner.get_ttl()
    }
    /// <p>Caching behavior.</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <p><b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p></li>
    /// <li>
    /// <p><b>OPERATION_LEVEL_CACHING</b>: Full requests are cached together and returned without executing resolvers.</p></li>
    /// </ul>
    pub fn api_caching_behavior(mut self, input: crate::types::ApiCachingBehavior) -> Self {
        self.inner = self.inner.api_caching_behavior(input);
        self
    }
    /// <p>Caching behavior.</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <p><b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p></li>
    /// <li>
    /// <p><b>OPERATION_LEVEL_CACHING</b>: Full requests are cached together and returned without executing resolvers.</p></li>
    /// </ul>
    pub fn set_api_caching_behavior(mut self, input: ::std::option::Option<crate::types::ApiCachingBehavior>) -> Self {
        self.inner = self.inner.set_api_caching_behavior(input);
        self
    }
    /// <p>Caching behavior.</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <p><b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p></li>
    /// <li>
    /// <p><b>OPERATION_LEVEL_CACHING</b>: Full requests are cached together and returned without executing resolvers.</p></li>
    /// </ul>
    pub fn get_api_caching_behavior(&self) -> &::std::option::Option<crate::types::ApiCachingBehavior> {
        self.inner.get_api_caching_behavior()
    }
    /// <p>The cache instance type. Valid values are</p>
    /// <ul>
    /// <li>
    /// <p><code>SMALL</code></p></li>
    /// <li>
    /// <p><code>MEDIUM</code></p></li>
    /// <li>
    /// <p><code>LARGE</code></p></li>
    /// <li>
    /// <p><code>XLARGE</code></p></li>
    /// <li>
    /// <p><code>LARGE_2X</code></p></li>
    /// <li>
    /// <p><code>LARGE_4X</code></p></li>
    /// <li>
    /// <p><code>LARGE_8X</code> (not available in all regions)</p></li>
    /// <li>
    /// <p><code>LARGE_12X</code></p></li>
    /// </ul>
    /// <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>
    /// <p>The following legacy instance types are available, but their use is discouraged:</p>
    /// <ul>
    /// <li>
    /// <p><b>T2_SMALL</b>: A t2.small instance type.</p></li>
    /// <li>
    /// <p><b>T2_MEDIUM</b>: A t2.medium instance type.</p></li>
    /// <li>
    /// <p><b>R4_LARGE</b>: A r4.large instance type.</p></li>
    /// <li>
    /// <p><b>R4_XLARGE</b>: A r4.xlarge instance type.</p></li>
    /// <li>
    /// <p><b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p></li>
    /// <li>
    /// <p><b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p></li>
    /// <li>
    /// <p><b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p></li>
    /// </ul>
    pub fn r#type(mut self, input: crate::types::ApiCacheType) -> Self {
        self.inner = self.inner.r#type(input);
        self
    }
    /// <p>The cache instance type. Valid values are</p>
    /// <ul>
    /// <li>
    /// <p><code>SMALL</code></p></li>
    /// <li>
    /// <p><code>MEDIUM</code></p></li>
    /// <li>
    /// <p><code>LARGE</code></p></li>
    /// <li>
    /// <p><code>XLARGE</code></p></li>
    /// <li>
    /// <p><code>LARGE_2X</code></p></li>
    /// <li>
    /// <p><code>LARGE_4X</code></p></li>
    /// <li>
    /// <p><code>LARGE_8X</code> (not available in all regions)</p></li>
    /// <li>
    /// <p><code>LARGE_12X</code></p></li>
    /// </ul>
    /// <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>
    /// <p>The following legacy instance types are available, but their use is discouraged:</p>
    /// <ul>
    /// <li>
    /// <p><b>T2_SMALL</b>: A t2.small instance type.</p></li>
    /// <li>
    /// <p><b>T2_MEDIUM</b>: A t2.medium instance type.</p></li>
    /// <li>
    /// <p><b>R4_LARGE</b>: A r4.large instance type.</p></li>
    /// <li>
    /// <p><b>R4_XLARGE</b>: A r4.xlarge instance type.</p></li>
    /// <li>
    /// <p><b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p></li>
    /// <li>
    /// <p><b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p></li>
    /// <li>
    /// <p><b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p></li>
    /// </ul>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ApiCacheType>) -> Self {
        self.inner = self.inner.set_type(input);
        self
    }
    /// <p>The cache instance type. Valid values are</p>
    /// <ul>
    /// <li>
    /// <p><code>SMALL</code></p></li>
    /// <li>
    /// <p><code>MEDIUM</code></p></li>
    /// <li>
    /// <p><code>LARGE</code></p></li>
    /// <li>
    /// <p><code>XLARGE</code></p></li>
    /// <li>
    /// <p><code>LARGE_2X</code></p></li>
    /// <li>
    /// <p><code>LARGE_4X</code></p></li>
    /// <li>
    /// <p><code>LARGE_8X</code> (not available in all regions)</p></li>
    /// <li>
    /// <p><code>LARGE_12X</code></p></li>
    /// </ul>
    /// <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>
    /// <p>The following legacy instance types are available, but their use is discouraged:</p>
    /// <ul>
    /// <li>
    /// <p><b>T2_SMALL</b>: A t2.small instance type.</p></li>
    /// <li>
    /// <p><b>T2_MEDIUM</b>: A t2.medium instance type.</p></li>
    /// <li>
    /// <p><b>R4_LARGE</b>: A r4.large instance type.</p></li>
    /// <li>
    /// <p><b>R4_XLARGE</b>: A r4.xlarge instance type.</p></li>
    /// <li>
    /// <p><b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p></li>
    /// <li>
    /// <p><b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p></li>
    /// <li>
    /// <p><b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p></li>
    /// </ul>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::ApiCacheType> {
        self.inner.get_type()
    }
    /// <p>Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <p>EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
    /// </ul>
    /// <p>Metrics will be recorded by API ID. You can set the value to <code>ENABLED</code> or <code>DISABLED</code>.</p>
    pub fn health_metrics_config(mut self, input: crate::types::CacheHealthMetricsConfig) -> Self {
        self.inner = self.inner.health_metrics_config(input);
        self
    }
    /// <p>Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <p>EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
    /// </ul>
    /// <p>Metrics will be recorded by API ID. You can set the value to <code>ENABLED</code> or <code>DISABLED</code>.</p>
    pub fn set_health_metrics_config(mut self, input: ::std::option::Option<crate::types::CacheHealthMetricsConfig>) -> Self {
        self.inner = self.inner.set_health_metrics_config(input);
        self
    }
    /// <p>Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <p>EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>
    /// </ul>
    /// <p>Metrics will be recorded by API ID. You can set the value to <code>ENABLED</code> or <code>DISABLED</code>.</p>
    pub fn get_health_metrics_config(&self) -> &::std::option::Option<crate::types::CacheHealthMetricsConfig> {
        self.inner.get_health_metrics_config()
    }
}