{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ElastiCache.ModifyCacheCluster
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies the settings for a cluster. You can use this operation to
-- change one or more cluster configuration parameters by specifying the
-- parameters and the new values.
module Amazonka.ElastiCache.ModifyCacheCluster
  ( -- * Creating a Request
    ModifyCacheCluster (..),
    newModifyCacheCluster,

    -- * Request Lenses
    modifyCacheCluster_aZMode,
    modifyCacheCluster_applyImmediately,
    modifyCacheCluster_authToken,
    modifyCacheCluster_authTokenUpdateStrategy,
    modifyCacheCluster_autoMinorVersionUpgrade,
    modifyCacheCluster_cacheNodeIdsToRemove,
    modifyCacheCluster_cacheNodeType,
    modifyCacheCluster_cacheParameterGroupName,
    modifyCacheCluster_cacheSecurityGroupNames,
    modifyCacheCluster_engineVersion,
    modifyCacheCluster_ipDiscovery,
    modifyCacheCluster_logDeliveryConfigurations,
    modifyCacheCluster_newAvailabilityZones,
    modifyCacheCluster_notificationTopicArn,
    modifyCacheCluster_notificationTopicStatus,
    modifyCacheCluster_numCacheNodes,
    modifyCacheCluster_preferredMaintenanceWindow,
    modifyCacheCluster_securityGroupIds,
    modifyCacheCluster_snapshotRetentionLimit,
    modifyCacheCluster_snapshotWindow,
    modifyCacheCluster_cacheClusterId,

    -- * Destructuring the Response
    ModifyCacheClusterResponse (..),
    newModifyCacheClusterResponse,

    -- * Response Lenses
    modifyCacheClusterResponse_cacheCluster,
    modifyCacheClusterResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElastiCache.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the input of a @ModifyCacheCluster@ operation.
--
-- /See:/ 'newModifyCacheCluster' smart constructor.
data ModifyCacheCluster = ModifyCacheCluster'
  { -- | Specifies whether the new nodes in this Memcached cluster are all
    -- created in a single Availability Zone or created across multiple
    -- Availability Zones.
    --
    -- Valid values: @single-az@ | @cross-az@.
    --
    -- This option is only supported for Memcached clusters.
    --
    -- You cannot specify @single-az@ if the Memcached cluster already has
    -- cache nodes in different Availability Zones. If @cross-az@ is specified,
    -- existing Memcached nodes remain in their current Availability Zone.
    --
    -- Only newly created nodes are located in different Availability Zones.
    ModifyCacheCluster -> Maybe AZMode
aZMode :: Prelude.Maybe AZMode,
    -- | If @true@, this parameter causes the modifications in this request and
    -- any pending modifications to be applied, asynchronously and as soon as
    -- possible, regardless of the @PreferredMaintenanceWindow@ setting for the
    -- cluster.
    --
    -- If @false@, changes to the cluster are applied on the next maintenance
    -- reboot, or the next failure reboot, whichever occurs first.
    --
    -- If you perform a @ModifyCacheCluster@ before a pending modification is
    -- applied, the pending modification is replaced by the newer modification.
    --
    -- Valid values: @true@ | @false@
    --
    -- Default: @false@
    ModifyCacheCluster -> Maybe Bool
applyImmediately :: Prelude.Maybe Prelude.Bool,
    -- | Reserved parameter. The password used to access a password protected
    -- server. This parameter must be specified with the @auth-token-update@
    -- parameter. Password constraints:
    --
    -- -   Must be only printable ASCII characters
    --
    -- -   Must be at least 16 characters and no more than 128 characters in
    --     length
    --
    -- -   Cannot contain any of the following characters: \'\/\', \'\"\', or
    --     \'\@\', \'%\'
    --
    -- For more information, see AUTH password at
    -- <http://redis.io/commands/AUTH AUTH>.
    ModifyCacheCluster -> Maybe Text
authToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies the strategy to use to update the AUTH token. This parameter
    -- must be specified with the @auth-token@ parameter. Possible values:
    --
    -- -   Rotate
    --
    -- -   Set
    --
    -- For more information, see
    -- <http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/auth.html Authenticating Users with Redis AUTH>
    ModifyCacheCluster -> Maybe AuthTokenUpdateStrategyType
authTokenUpdateStrategy :: Prelude.Maybe AuthTokenUpdateStrategyType,
    -- | If you are running Redis engine version 6.0 or later, set this
    -- parameter to yes if you want to opt-in to the next auto minor version
    -- upgrade campaign. This parameter is disabled for previous versions.
    ModifyCacheCluster -> Maybe Bool
autoMinorVersionUpgrade :: Prelude.Maybe Prelude.Bool,
    -- | A list of cache node IDs to be removed. A node ID is a numeric
    -- identifier (0001, 0002, etc.). This parameter is only valid when
    -- @NumCacheNodes@ is less than the existing number of cache nodes. The
    -- number of cache node IDs supplied in this parameter must match the
    -- difference between the existing number of cache nodes in the cluster or
    -- pending cache nodes, whichever is greater, and the value of
    -- @NumCacheNodes@ in the request.
    --
    -- For example: If you have 3 active cache nodes, 7 pending cache nodes,
    -- and the number of cache nodes in this @ModifyCacheCluster@ call is 5,
    -- you must list 2 (7 - 5) cache node IDs to remove.
    ModifyCacheCluster -> Maybe [Text]
cacheNodeIdsToRemove :: Prelude.Maybe [Prelude.Text],
    -- | A valid cache node type that you want to scale this cluster up to.
    ModifyCacheCluster -> Maybe Text
cacheNodeType :: Prelude.Maybe Prelude.Text,
    -- | The name of the cache parameter group to apply to this cluster. This
    -- change is asynchronously applied as soon as possible for parameters when
    -- the @ApplyImmediately@ parameter is specified as @true@ for this
    -- request.
    ModifyCacheCluster -> Maybe Text
cacheParameterGroupName :: Prelude.Maybe Prelude.Text,
    -- | A list of cache security group names to authorize on this cluster. This
    -- change is asynchronously applied as soon as possible.
    --
    -- You can use this parameter only with clusters that are created outside
    -- of an Amazon Virtual Private Cloud (Amazon VPC).
    --
    -- Constraints: Must contain no more than 255 alphanumeric characters. Must
    -- not be \"Default\".
    ModifyCacheCluster -> Maybe [Text]
cacheSecurityGroupNames :: Prelude.Maybe [Prelude.Text],
    -- | The upgraded version of the cache engine to be run on the cache nodes.
    --
    -- __Important:__ You can upgrade to a newer engine version (see
    -- <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SelectEngine.html#VersionManagement Selecting a Cache Engine and Version>),
    -- but you cannot downgrade to an earlier engine version. If you want to
    -- use an earlier engine version, you must delete the existing cluster and
    -- create it anew with the earlier engine version.
    ModifyCacheCluster -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | The network type you choose when modifying a cluster, either @ipv4@ |
    -- @ipv6@. IPv6 is supported for workloads using Redis engine version 6.2
    -- onward or Memcached engine version 1.6.6 on all instances built on the
    -- <https://aws.amazon.com/ec2/nitro/ Nitro system>.
    ModifyCacheCluster -> Maybe IpDiscovery
ipDiscovery :: Prelude.Maybe IpDiscovery,
    -- | Specifies the destination, format and type of the logs.
    ModifyCacheCluster -> Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations :: Prelude.Maybe [LogDeliveryConfigurationRequest],
    -- | This option is only supported on Memcached clusters.
    --
    -- The list of Availability Zones where the new Memcached cache nodes are
    -- created.
    --
    -- This parameter is only valid when @NumCacheNodes@ in the request is
    -- greater than the sum of the number of active cache nodes and the number
    -- of cache nodes pending creation (which may be zero). The number of
    -- Availability Zones supplied in this list must match the cache nodes
    -- being added in this request.
    --
    -- Scenarios:
    --
    -- -   __Scenario 1:__ You have 3 active nodes and wish to add 2 nodes.
    --     Specify @NumCacheNodes=5@ (3 + 2) and optionally specify two
    --     Availability Zones for the two new nodes.
    --
    -- -   __Scenario 2:__ You have 3 active nodes and 2 nodes pending creation
    --     (from the scenario 1 call) and want to add 1 more node. Specify
    --     @NumCacheNodes=6@ ((3 + 2) + 1) and optionally specify an
    --     Availability Zone for the new node.
    --
    -- -   __Scenario 3:__ You want to cancel all pending operations. Specify
    --     @NumCacheNodes=3@ to cancel all pending operations.
    --
    -- The Availability Zone placement of nodes pending creation cannot be
    -- modified. If you wish to cancel any nodes pending creation, add 0 nodes
    -- by setting @NumCacheNodes@ to the number of current nodes.
    --
    -- If @cross-az@ is specified, existing Memcached nodes remain in their
    -- current Availability Zone. Only newly created nodes can be located in
    -- different Availability Zones. For guidance on how to move existing
    -- Memcached nodes to different Availability Zones, see the __Availability
    -- Zone Considerations__ section of
    -- <https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/CacheNodes.SupportedTypes.html Cache Node Considerations for Memcached>.
    --
    -- __Impact of new add\/remove requests upon pending requests__
    --
    -- -   Scenario-1
    --
    --     -   Pending Action: Delete
    --
    --     -   New Request: Delete
    --
    --     -   Result: The new delete, pending or immediate, replaces the
    --         pending delete.
    --
    -- -   Scenario-2
    --
    --     -   Pending Action: Delete
    --
    --     -   New Request: Create
    --
    --     -   Result: The new create, pending or immediate, replaces the
    --         pending delete.
    --
    -- -   Scenario-3
    --
    --     -   Pending Action: Create
    --
    --     -   New Request: Delete
    --
    --     -   Result: The new delete, pending or immediate, replaces the
    --         pending create.
    --
    -- -   Scenario-4
    --
    --     -   Pending Action: Create
    --
    --     -   New Request: Create
    --
    --     -   Result: The new create is added to the pending create.
    --
    --         __Important:__ If the new create request is __Apply Immediately
    --         - Yes__, all creates are performed immediately. If the new
    --         create request is __Apply Immediately - No__, all creates are
    --         pending.
    ModifyCacheCluster -> Maybe [Text]
newAvailabilityZones' :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon Resource Name (ARN) of the Amazon SNS topic to which
    -- notifications are sent.
    --
    -- The Amazon SNS topic owner must be same as the cluster owner.
    ModifyCacheCluster -> Maybe Text
notificationTopicArn :: Prelude.Maybe Prelude.Text,
    -- | The status of the Amazon SNS notification topic. Notifications are sent
    -- only if the status is @active@.
    --
    -- Valid values: @active@ | @inactive@
    ModifyCacheCluster -> Maybe Text
notificationTopicStatus :: Prelude.Maybe Prelude.Text,
    -- | The number of cache nodes that the cluster should have. If the value for
    -- @NumCacheNodes@ is greater than the sum of the number of current cache
    -- nodes and the number of cache nodes pending creation (which may be
    -- zero), more nodes are added. If the value is less than the number of
    -- existing cache nodes, nodes are removed. If the value is equal to the
    -- number of current cache nodes, any pending add or remove requests are
    -- canceled.
    --
    -- If you are removing cache nodes, you must use the @CacheNodeIdsToRemove@
    -- parameter to provide the IDs of the specific cache nodes to remove.
    --
    -- For clusters running Redis, this value must be 1. For clusters running
    -- Memcached, this value must be between 1 and 40.
    --
    -- Adding or removing Memcached cache nodes can be applied immediately or
    -- as a pending operation (see @ApplyImmediately@).
    --
    -- A pending operation to modify the number of cache nodes in a cluster
    -- during its maintenance window, whether by adding or removing nodes in
    -- accordance with the scale out architecture, is not queued. The
    -- customer\'s latest request to add or remove nodes to the cluster
    -- overrides any previous pending operations to modify the number of cache
    -- nodes in the cluster. For example, a request to remove 2 nodes would
    -- override a previous pending operation to remove 3 nodes. Similarly, a
    -- request to add 2 nodes would override a previous pending operation to
    -- remove 3 nodes and vice versa. As Memcached cache nodes may now be
    -- provisioned in different Availability Zones with flexible cache node
    -- placement, a request to add nodes does not automatically override a
    -- previous pending operation to add nodes. The customer can modify the
    -- previous pending operation to add more nodes or explicitly cancel the
    -- pending request and retry the new request. To cancel pending operations
    -- to modify the number of cache nodes in a cluster, use the
    -- @ModifyCacheCluster@ request and set @NumCacheNodes@ equal to the number
    -- of cache nodes currently in the cluster.
    ModifyCacheCluster -> Maybe Int
numCacheNodes :: Prelude.Maybe Prelude.Int,
    -- | Specifies the weekly time range during which maintenance on the cluster
    -- is performed. It is specified as a range in the format
    -- ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window
    -- is a 60 minute period.
    --
    -- Valid values for @ddd@ are:
    --
    -- -   @sun@
    --
    -- -   @mon@
    --
    -- -   @tue@
    --
    -- -   @wed@
    --
    -- -   @thu@
    --
    -- -   @fri@
    --
    -- -   @sat@
    --
    -- Example: @sun:23:00-mon:01:30@
    ModifyCacheCluster -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
    -- | Specifies the VPC Security Groups associated with the cluster.
    --
    -- This parameter can be used only with clusters that are created in an
    -- Amazon Virtual Private Cloud (Amazon VPC).
    ModifyCacheCluster -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | The number of days for which ElastiCache retains automatic cluster
    -- snapshots before deleting them. For example, if you set
    -- @SnapshotRetentionLimit@ to 5, a snapshot that was taken today is
    -- retained for 5 days before being deleted.
    --
    -- If the value of @SnapshotRetentionLimit@ is set to zero (0), backups are
    -- turned off.
    ModifyCacheCluster -> Maybe Int
snapshotRetentionLimit :: Prelude.Maybe Prelude.Int,
    -- | The daily time range (in UTC) during which ElastiCache begins taking a
    -- daily snapshot of your cluster.
    ModifyCacheCluster -> Maybe Text
snapshotWindow :: Prelude.Maybe Prelude.Text,
    -- | The cluster identifier. This value is stored as a lowercase string.
    ModifyCacheCluster -> Text
cacheClusterId :: Prelude.Text
  }
  deriving (ModifyCacheCluster -> ModifyCacheCluster -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyCacheCluster -> ModifyCacheCluster -> Bool
$c/= :: ModifyCacheCluster -> ModifyCacheCluster -> Bool
== :: ModifyCacheCluster -> ModifyCacheCluster -> Bool
$c== :: ModifyCacheCluster -> ModifyCacheCluster -> Bool
Prelude.Eq, ReadPrec [ModifyCacheCluster]
ReadPrec ModifyCacheCluster
Int -> ReadS ModifyCacheCluster
ReadS [ModifyCacheCluster]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyCacheCluster]
$creadListPrec :: ReadPrec [ModifyCacheCluster]
readPrec :: ReadPrec ModifyCacheCluster
$creadPrec :: ReadPrec ModifyCacheCluster
readList :: ReadS [ModifyCacheCluster]
$creadList :: ReadS [ModifyCacheCluster]
readsPrec :: Int -> ReadS ModifyCacheCluster
$creadsPrec :: Int -> ReadS ModifyCacheCluster
Prelude.Read, Int -> ModifyCacheCluster -> ShowS
[ModifyCacheCluster] -> ShowS
ModifyCacheCluster -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyCacheCluster] -> ShowS
$cshowList :: [ModifyCacheCluster] -> ShowS
show :: ModifyCacheCluster -> String
$cshow :: ModifyCacheCluster -> String
showsPrec :: Int -> ModifyCacheCluster -> ShowS
$cshowsPrec :: Int -> ModifyCacheCluster -> ShowS
Prelude.Show, forall x. Rep ModifyCacheCluster x -> ModifyCacheCluster
forall x. ModifyCacheCluster -> Rep ModifyCacheCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyCacheCluster x -> ModifyCacheCluster
$cfrom :: forall x. ModifyCacheCluster -> Rep ModifyCacheCluster x
Prelude.Generic)

-- |
-- Create a value of 'ModifyCacheCluster' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'aZMode', 'modifyCacheCluster_aZMode' - Specifies whether the new nodes in this Memcached cluster are all
-- created in a single Availability Zone or created across multiple
-- Availability Zones.
--
-- Valid values: @single-az@ | @cross-az@.
--
-- This option is only supported for Memcached clusters.
--
-- You cannot specify @single-az@ if the Memcached cluster already has
-- cache nodes in different Availability Zones. If @cross-az@ is specified,
-- existing Memcached nodes remain in their current Availability Zone.
--
-- Only newly created nodes are located in different Availability Zones.
--
-- 'applyImmediately', 'modifyCacheCluster_applyImmediately' - If @true@, this parameter causes the modifications in this request and
-- any pending modifications to be applied, asynchronously and as soon as
-- possible, regardless of the @PreferredMaintenanceWindow@ setting for the
-- cluster.
--
-- If @false@, changes to the cluster are applied on the next maintenance
-- reboot, or the next failure reboot, whichever occurs first.
--
-- If you perform a @ModifyCacheCluster@ before a pending modification is
-- applied, the pending modification is replaced by the newer modification.
--
-- Valid values: @true@ | @false@
--
-- Default: @false@
--
-- 'authToken', 'modifyCacheCluster_authToken' - Reserved parameter. The password used to access a password protected
-- server. This parameter must be specified with the @auth-token-update@
-- parameter. Password constraints:
--
-- -   Must be only printable ASCII characters
--
-- -   Must be at least 16 characters and no more than 128 characters in
--     length
--
-- -   Cannot contain any of the following characters: \'\/\', \'\"\', or
--     \'\@\', \'%\'
--
-- For more information, see AUTH password at
-- <http://redis.io/commands/AUTH AUTH>.
--
-- 'authTokenUpdateStrategy', 'modifyCacheCluster_authTokenUpdateStrategy' - Specifies the strategy to use to update the AUTH token. This parameter
-- must be specified with the @auth-token@ parameter. Possible values:
--
-- -   Rotate
--
-- -   Set
--
-- For more information, see
-- <http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/auth.html Authenticating Users with Redis AUTH>
--
-- 'autoMinorVersionUpgrade', 'modifyCacheCluster_autoMinorVersionUpgrade' - If you are running Redis engine version 6.0 or later, set this
-- parameter to yes if you want to opt-in to the next auto minor version
-- upgrade campaign. This parameter is disabled for previous versions.
--
-- 'cacheNodeIdsToRemove', 'modifyCacheCluster_cacheNodeIdsToRemove' - A list of cache node IDs to be removed. A node ID is a numeric
-- identifier (0001, 0002, etc.). This parameter is only valid when
-- @NumCacheNodes@ is less than the existing number of cache nodes. The
-- number of cache node IDs supplied in this parameter must match the
-- difference between the existing number of cache nodes in the cluster or
-- pending cache nodes, whichever is greater, and the value of
-- @NumCacheNodes@ in the request.
--
-- For example: If you have 3 active cache nodes, 7 pending cache nodes,
-- and the number of cache nodes in this @ModifyCacheCluster@ call is 5,
-- you must list 2 (7 - 5) cache node IDs to remove.
--
-- 'cacheNodeType', 'modifyCacheCluster_cacheNodeType' - A valid cache node type that you want to scale this cluster up to.
--
-- 'cacheParameterGroupName', 'modifyCacheCluster_cacheParameterGroupName' - The name of the cache parameter group to apply to this cluster. This
-- change is asynchronously applied as soon as possible for parameters when
-- the @ApplyImmediately@ parameter is specified as @true@ for this
-- request.
--
-- 'cacheSecurityGroupNames', 'modifyCacheCluster_cacheSecurityGroupNames' - A list of cache security group names to authorize on this cluster. This
-- change is asynchronously applied as soon as possible.
--
-- You can use this parameter only with clusters that are created outside
-- of an Amazon Virtual Private Cloud (Amazon VPC).
--
-- Constraints: Must contain no more than 255 alphanumeric characters. Must
-- not be \"Default\".
--
-- 'engineVersion', 'modifyCacheCluster_engineVersion' - The upgraded version of the cache engine to be run on the cache nodes.
--
-- __Important:__ You can upgrade to a newer engine version (see
-- <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SelectEngine.html#VersionManagement Selecting a Cache Engine and Version>),
-- but you cannot downgrade to an earlier engine version. If you want to
-- use an earlier engine version, you must delete the existing cluster and
-- create it anew with the earlier engine version.
--
-- 'ipDiscovery', 'modifyCacheCluster_ipDiscovery' - The network type you choose when modifying a cluster, either @ipv4@ |
-- @ipv6@. IPv6 is supported for workloads using Redis engine version 6.2
-- onward or Memcached engine version 1.6.6 on all instances built on the
-- <https://aws.amazon.com/ec2/nitro/ Nitro system>.
--
-- 'logDeliveryConfigurations', 'modifyCacheCluster_logDeliveryConfigurations' - Specifies the destination, format and type of the logs.
--
-- 'newAvailabilityZones'', 'modifyCacheCluster_newAvailabilityZones' - This option is only supported on Memcached clusters.
--
-- The list of Availability Zones where the new Memcached cache nodes are
-- created.
--
-- This parameter is only valid when @NumCacheNodes@ in the request is
-- greater than the sum of the number of active cache nodes and the number
-- of cache nodes pending creation (which may be zero). The number of
-- Availability Zones supplied in this list must match the cache nodes
-- being added in this request.
--
-- Scenarios:
--
-- -   __Scenario 1:__ You have 3 active nodes and wish to add 2 nodes.
--     Specify @NumCacheNodes=5@ (3 + 2) and optionally specify two
--     Availability Zones for the two new nodes.
--
-- -   __Scenario 2:__ You have 3 active nodes and 2 nodes pending creation
--     (from the scenario 1 call) and want to add 1 more node. Specify
--     @NumCacheNodes=6@ ((3 + 2) + 1) and optionally specify an
--     Availability Zone for the new node.
--
-- -   __Scenario 3:__ You want to cancel all pending operations. Specify
--     @NumCacheNodes=3@ to cancel all pending operations.
--
-- The Availability Zone placement of nodes pending creation cannot be
-- modified. If you wish to cancel any nodes pending creation, add 0 nodes
-- by setting @NumCacheNodes@ to the number of current nodes.
--
-- If @cross-az@ is specified, existing Memcached nodes remain in their
-- current Availability Zone. Only newly created nodes can be located in
-- different Availability Zones. For guidance on how to move existing
-- Memcached nodes to different Availability Zones, see the __Availability
-- Zone Considerations__ section of
-- <https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/CacheNodes.SupportedTypes.html Cache Node Considerations for Memcached>.
--
-- __Impact of new add\/remove requests upon pending requests__
--
-- -   Scenario-1
--
--     -   Pending Action: Delete
--
--     -   New Request: Delete
--
--     -   Result: The new delete, pending or immediate, replaces the
--         pending delete.
--
-- -   Scenario-2
--
--     -   Pending Action: Delete
--
--     -   New Request: Create
--
--     -   Result: The new create, pending or immediate, replaces the
--         pending delete.
--
-- -   Scenario-3
--
--     -   Pending Action: Create
--
--     -   New Request: Delete
--
--     -   Result: The new delete, pending or immediate, replaces the
--         pending create.
--
-- -   Scenario-4
--
--     -   Pending Action: Create
--
--     -   New Request: Create
--
--     -   Result: The new create is added to the pending create.
--
--         __Important:__ If the new create request is __Apply Immediately
--         - Yes__, all creates are performed immediately. If the new
--         create request is __Apply Immediately - No__, all creates are
--         pending.
--
-- 'notificationTopicArn', 'modifyCacheCluster_notificationTopicArn' - The Amazon Resource Name (ARN) of the Amazon SNS topic to which
-- notifications are sent.
--
-- The Amazon SNS topic owner must be same as the cluster owner.
--
-- 'notificationTopicStatus', 'modifyCacheCluster_notificationTopicStatus' - The status of the Amazon SNS notification topic. Notifications are sent
-- only if the status is @active@.
--
-- Valid values: @active@ | @inactive@
--
-- 'numCacheNodes', 'modifyCacheCluster_numCacheNodes' - The number of cache nodes that the cluster should have. If the value for
-- @NumCacheNodes@ is greater than the sum of the number of current cache
-- nodes and the number of cache nodes pending creation (which may be
-- zero), more nodes are added. If the value is less than the number of
-- existing cache nodes, nodes are removed. If the value is equal to the
-- number of current cache nodes, any pending add or remove requests are
-- canceled.
--
-- If you are removing cache nodes, you must use the @CacheNodeIdsToRemove@
-- parameter to provide the IDs of the specific cache nodes to remove.
--
-- For clusters running Redis, this value must be 1. For clusters running
-- Memcached, this value must be between 1 and 40.
--
-- Adding or removing Memcached cache nodes can be applied immediately or
-- as a pending operation (see @ApplyImmediately@).
--
-- A pending operation to modify the number of cache nodes in a cluster
-- during its maintenance window, whether by adding or removing nodes in
-- accordance with the scale out architecture, is not queued. The
-- customer\'s latest request to add or remove nodes to the cluster
-- overrides any previous pending operations to modify the number of cache
-- nodes in the cluster. For example, a request to remove 2 nodes would
-- override a previous pending operation to remove 3 nodes. Similarly, a
-- request to add 2 nodes would override a previous pending operation to
-- remove 3 nodes and vice versa. As Memcached cache nodes may now be
-- provisioned in different Availability Zones with flexible cache node
-- placement, a request to add nodes does not automatically override a
-- previous pending operation to add nodes. The customer can modify the
-- previous pending operation to add more nodes or explicitly cancel the
-- pending request and retry the new request. To cancel pending operations
-- to modify the number of cache nodes in a cluster, use the
-- @ModifyCacheCluster@ request and set @NumCacheNodes@ equal to the number
-- of cache nodes currently in the cluster.
--
-- 'preferredMaintenanceWindow', 'modifyCacheCluster_preferredMaintenanceWindow' - Specifies the weekly time range during which maintenance on the cluster
-- is performed. It is specified as a range in the format
-- ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window
-- is a 60 minute period.
--
-- Valid values for @ddd@ are:
--
-- -   @sun@
--
-- -   @mon@
--
-- -   @tue@
--
-- -   @wed@
--
-- -   @thu@
--
-- -   @fri@
--
-- -   @sat@
--
-- Example: @sun:23:00-mon:01:30@
--
-- 'securityGroupIds', 'modifyCacheCluster_securityGroupIds' - Specifies the VPC Security Groups associated with the cluster.
--
-- This parameter can be used only with clusters that are created in an
-- Amazon Virtual Private Cloud (Amazon VPC).
--
-- 'snapshotRetentionLimit', 'modifyCacheCluster_snapshotRetentionLimit' - The number of days for which ElastiCache retains automatic cluster
-- snapshots before deleting them. For example, if you set
-- @SnapshotRetentionLimit@ to 5, a snapshot that was taken today is
-- retained for 5 days before being deleted.
--
-- If the value of @SnapshotRetentionLimit@ is set to zero (0), backups are
-- turned off.
--
-- 'snapshotWindow', 'modifyCacheCluster_snapshotWindow' - The daily time range (in UTC) during which ElastiCache begins taking a
-- daily snapshot of your cluster.
--
-- 'cacheClusterId', 'modifyCacheCluster_cacheClusterId' - The cluster identifier. This value is stored as a lowercase string.
newModifyCacheCluster ::
  -- | 'cacheClusterId'
  Prelude.Text ->
  ModifyCacheCluster
newModifyCacheCluster :: Text -> ModifyCacheCluster
newModifyCacheCluster Text
pCacheClusterId_ =
  ModifyCacheCluster'
    { $sel:aZMode:ModifyCacheCluster' :: Maybe AZMode
aZMode = forall a. Maybe a
Prelude.Nothing,
      $sel:applyImmediately:ModifyCacheCluster' :: Maybe Bool
applyImmediately = forall a. Maybe a
Prelude.Nothing,
      $sel:authToken:ModifyCacheCluster' :: Maybe Text
authToken = forall a. Maybe a
Prelude.Nothing,
      $sel:authTokenUpdateStrategy:ModifyCacheCluster' :: Maybe AuthTokenUpdateStrategyType
authTokenUpdateStrategy = forall a. Maybe a
Prelude.Nothing,
      $sel:autoMinorVersionUpgrade:ModifyCacheCluster' :: Maybe Bool
autoMinorVersionUpgrade = forall a. Maybe a
Prelude.Nothing,
      $sel:cacheNodeIdsToRemove:ModifyCacheCluster' :: Maybe [Text]
cacheNodeIdsToRemove = forall a. Maybe a
Prelude.Nothing,
      $sel:cacheNodeType:ModifyCacheCluster' :: Maybe Text
cacheNodeType = forall a. Maybe a
Prelude.Nothing,
      $sel:cacheParameterGroupName:ModifyCacheCluster' :: Maybe Text
cacheParameterGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:cacheSecurityGroupNames:ModifyCacheCluster' :: Maybe [Text]
cacheSecurityGroupNames = forall a. Maybe a
Prelude.Nothing,
      $sel:engineVersion:ModifyCacheCluster' :: Maybe Text
engineVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:ipDiscovery:ModifyCacheCluster' :: Maybe IpDiscovery
ipDiscovery = forall a. Maybe a
Prelude.Nothing,
      $sel:logDeliveryConfigurations:ModifyCacheCluster' :: Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations = forall a. Maybe a
Prelude.Nothing,
      $sel:newAvailabilityZones':ModifyCacheCluster' :: Maybe [Text]
newAvailabilityZones' = forall a. Maybe a
Prelude.Nothing,
      $sel:notificationTopicArn:ModifyCacheCluster' :: Maybe Text
notificationTopicArn = forall a. Maybe a
Prelude.Nothing,
      $sel:notificationTopicStatus:ModifyCacheCluster' :: Maybe Text
notificationTopicStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:numCacheNodes:ModifyCacheCluster' :: Maybe Int
numCacheNodes = forall a. Maybe a
Prelude.Nothing,
      $sel:preferredMaintenanceWindow:ModifyCacheCluster' :: Maybe Text
preferredMaintenanceWindow = forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroupIds:ModifyCacheCluster' :: Maybe [Text]
securityGroupIds = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotRetentionLimit:ModifyCacheCluster' :: Maybe Int
snapshotRetentionLimit = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotWindow:ModifyCacheCluster' :: Maybe Text
snapshotWindow = forall a. Maybe a
Prelude.Nothing,
      $sel:cacheClusterId:ModifyCacheCluster' :: Text
cacheClusterId = Text
pCacheClusterId_
    }

-- | Specifies whether the new nodes in this Memcached cluster are all
-- created in a single Availability Zone or created across multiple
-- Availability Zones.
--
-- Valid values: @single-az@ | @cross-az@.
--
-- This option is only supported for Memcached clusters.
--
-- You cannot specify @single-az@ if the Memcached cluster already has
-- cache nodes in different Availability Zones. If @cross-az@ is specified,
-- existing Memcached nodes remain in their current Availability Zone.
--
-- Only newly created nodes are located in different Availability Zones.
modifyCacheCluster_aZMode :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe AZMode)
modifyCacheCluster_aZMode :: Lens' ModifyCacheCluster (Maybe AZMode)
modifyCacheCluster_aZMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe AZMode
aZMode :: Maybe AZMode
$sel:aZMode:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe AZMode
aZMode} -> Maybe AZMode
aZMode) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe AZMode
a -> ModifyCacheCluster
s {$sel:aZMode:ModifyCacheCluster' :: Maybe AZMode
aZMode = Maybe AZMode
a} :: ModifyCacheCluster)

-- | If @true@, this parameter causes the modifications in this request and
-- any pending modifications to be applied, asynchronously and as soon as
-- possible, regardless of the @PreferredMaintenanceWindow@ setting for the
-- cluster.
--
-- If @false@, changes to the cluster are applied on the next maintenance
-- reboot, or the next failure reboot, whichever occurs first.
--
-- If you perform a @ModifyCacheCluster@ before a pending modification is
-- applied, the pending modification is replaced by the newer modification.
--
-- Valid values: @true@ | @false@
--
-- Default: @false@
modifyCacheCluster_applyImmediately :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Bool)
modifyCacheCluster_applyImmediately :: Lens' ModifyCacheCluster (Maybe Bool)
modifyCacheCluster_applyImmediately = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Bool
applyImmediately :: Maybe Bool
$sel:applyImmediately:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Bool
applyImmediately} -> Maybe Bool
applyImmediately) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Bool
a -> ModifyCacheCluster
s {$sel:applyImmediately:ModifyCacheCluster' :: Maybe Bool
applyImmediately = Maybe Bool
a} :: ModifyCacheCluster)

-- | Reserved parameter. The password used to access a password protected
-- server. This parameter must be specified with the @auth-token-update@
-- parameter. Password constraints:
--
-- -   Must be only printable ASCII characters
--
-- -   Must be at least 16 characters and no more than 128 characters in
--     length
--
-- -   Cannot contain any of the following characters: \'\/\', \'\"\', or
--     \'\@\', \'%\'
--
-- For more information, see AUTH password at
-- <http://redis.io/commands/AUTH AUTH>.
modifyCacheCluster_authToken :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Text)
modifyCacheCluster_authToken :: Lens' ModifyCacheCluster (Maybe Text)
modifyCacheCluster_authToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Text
authToken :: Maybe Text
$sel:authToken:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
authToken} -> Maybe Text
authToken) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Text
a -> ModifyCacheCluster
s {$sel:authToken:ModifyCacheCluster' :: Maybe Text
authToken = Maybe Text
a} :: ModifyCacheCluster)

-- | Specifies the strategy to use to update the AUTH token. This parameter
-- must be specified with the @auth-token@ parameter. Possible values:
--
-- -   Rotate
--
-- -   Set
--
-- For more information, see
-- <http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/auth.html Authenticating Users with Redis AUTH>
modifyCacheCluster_authTokenUpdateStrategy :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe AuthTokenUpdateStrategyType)
modifyCacheCluster_authTokenUpdateStrategy :: Lens' ModifyCacheCluster (Maybe AuthTokenUpdateStrategyType)
modifyCacheCluster_authTokenUpdateStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe AuthTokenUpdateStrategyType
authTokenUpdateStrategy :: Maybe AuthTokenUpdateStrategyType
$sel:authTokenUpdateStrategy:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe AuthTokenUpdateStrategyType
authTokenUpdateStrategy} -> Maybe AuthTokenUpdateStrategyType
authTokenUpdateStrategy) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe AuthTokenUpdateStrategyType
a -> ModifyCacheCluster
s {$sel:authTokenUpdateStrategy:ModifyCacheCluster' :: Maybe AuthTokenUpdateStrategyType
authTokenUpdateStrategy = Maybe AuthTokenUpdateStrategyType
a} :: ModifyCacheCluster)

-- | If you are running Redis engine version 6.0 or later, set this
-- parameter to yes if you want to opt-in to the next auto minor version
-- upgrade campaign. This parameter is disabled for previous versions.
modifyCacheCluster_autoMinorVersionUpgrade :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Bool)
modifyCacheCluster_autoMinorVersionUpgrade :: Lens' ModifyCacheCluster (Maybe Bool)
modifyCacheCluster_autoMinorVersionUpgrade = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Bool
autoMinorVersionUpgrade :: Maybe Bool
$sel:autoMinorVersionUpgrade:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Bool
autoMinorVersionUpgrade} -> Maybe Bool
autoMinorVersionUpgrade) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Bool
a -> ModifyCacheCluster
s {$sel:autoMinorVersionUpgrade:ModifyCacheCluster' :: Maybe Bool
autoMinorVersionUpgrade = Maybe Bool
a} :: ModifyCacheCluster)

-- | A list of cache node IDs to be removed. A node ID is a numeric
-- identifier (0001, 0002, etc.). This parameter is only valid when
-- @NumCacheNodes@ is less than the existing number of cache nodes. The
-- number of cache node IDs supplied in this parameter must match the
-- difference between the existing number of cache nodes in the cluster or
-- pending cache nodes, whichever is greater, and the value of
-- @NumCacheNodes@ in the request.
--
-- For example: If you have 3 active cache nodes, 7 pending cache nodes,
-- and the number of cache nodes in this @ModifyCacheCluster@ call is 5,
-- you must list 2 (7 - 5) cache node IDs to remove.
modifyCacheCluster_cacheNodeIdsToRemove :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe [Prelude.Text])
modifyCacheCluster_cacheNodeIdsToRemove :: Lens' ModifyCacheCluster (Maybe [Text])
modifyCacheCluster_cacheNodeIdsToRemove = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe [Text]
cacheNodeIdsToRemove :: Maybe [Text]
$sel:cacheNodeIdsToRemove:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
cacheNodeIdsToRemove} -> Maybe [Text]
cacheNodeIdsToRemove) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe [Text]
a -> ModifyCacheCluster
s {$sel:cacheNodeIdsToRemove:ModifyCacheCluster' :: Maybe [Text]
cacheNodeIdsToRemove = Maybe [Text]
a} :: ModifyCacheCluster) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A valid cache node type that you want to scale this cluster up to.
modifyCacheCluster_cacheNodeType :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Text)
modifyCacheCluster_cacheNodeType :: Lens' ModifyCacheCluster (Maybe Text)
modifyCacheCluster_cacheNodeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Text
cacheNodeType :: Maybe Text
$sel:cacheNodeType:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
cacheNodeType} -> Maybe Text
cacheNodeType) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Text
a -> ModifyCacheCluster
s {$sel:cacheNodeType:ModifyCacheCluster' :: Maybe Text
cacheNodeType = Maybe Text
a} :: ModifyCacheCluster)

-- | The name of the cache parameter group to apply to this cluster. This
-- change is asynchronously applied as soon as possible for parameters when
-- the @ApplyImmediately@ parameter is specified as @true@ for this
-- request.
modifyCacheCluster_cacheParameterGroupName :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Text)
modifyCacheCluster_cacheParameterGroupName :: Lens' ModifyCacheCluster (Maybe Text)
modifyCacheCluster_cacheParameterGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Text
cacheParameterGroupName :: Maybe Text
$sel:cacheParameterGroupName:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
cacheParameterGroupName} -> Maybe Text
cacheParameterGroupName) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Text
a -> ModifyCacheCluster
s {$sel:cacheParameterGroupName:ModifyCacheCluster' :: Maybe Text
cacheParameterGroupName = Maybe Text
a} :: ModifyCacheCluster)

-- | A list of cache security group names to authorize on this cluster. This
-- change is asynchronously applied as soon as possible.
--
-- You can use this parameter only with clusters that are created outside
-- of an Amazon Virtual Private Cloud (Amazon VPC).
--
-- Constraints: Must contain no more than 255 alphanumeric characters. Must
-- not be \"Default\".
modifyCacheCluster_cacheSecurityGroupNames :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe [Prelude.Text])
modifyCacheCluster_cacheSecurityGroupNames :: Lens' ModifyCacheCluster (Maybe [Text])
modifyCacheCluster_cacheSecurityGroupNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe [Text]
cacheSecurityGroupNames :: Maybe [Text]
$sel:cacheSecurityGroupNames:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
cacheSecurityGroupNames} -> Maybe [Text]
cacheSecurityGroupNames) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe [Text]
a -> ModifyCacheCluster
s {$sel:cacheSecurityGroupNames:ModifyCacheCluster' :: Maybe [Text]
cacheSecurityGroupNames = Maybe [Text]
a} :: ModifyCacheCluster) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The upgraded version of the cache engine to be run on the cache nodes.
--
-- __Important:__ You can upgrade to a newer engine version (see
-- <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SelectEngine.html#VersionManagement Selecting a Cache Engine and Version>),
-- but you cannot downgrade to an earlier engine version. If you want to
-- use an earlier engine version, you must delete the existing cluster and
-- create it anew with the earlier engine version.
modifyCacheCluster_engineVersion :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Text)
modifyCacheCluster_engineVersion :: Lens' ModifyCacheCluster (Maybe Text)
modifyCacheCluster_engineVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Text
a -> ModifyCacheCluster
s {$sel:engineVersion:ModifyCacheCluster' :: Maybe Text
engineVersion = Maybe Text
a} :: ModifyCacheCluster)

-- | The network type you choose when modifying a cluster, either @ipv4@ |
-- @ipv6@. IPv6 is supported for workloads using Redis engine version 6.2
-- onward or Memcached engine version 1.6.6 on all instances built on the
-- <https://aws.amazon.com/ec2/nitro/ Nitro system>.
modifyCacheCluster_ipDiscovery :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe IpDiscovery)
modifyCacheCluster_ipDiscovery :: Lens' ModifyCacheCluster (Maybe IpDiscovery)
modifyCacheCluster_ipDiscovery = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe IpDiscovery
ipDiscovery :: Maybe IpDiscovery
$sel:ipDiscovery:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe IpDiscovery
ipDiscovery} -> Maybe IpDiscovery
ipDiscovery) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe IpDiscovery
a -> ModifyCacheCluster
s {$sel:ipDiscovery:ModifyCacheCluster' :: Maybe IpDiscovery
ipDiscovery = Maybe IpDiscovery
a} :: ModifyCacheCluster)

-- | Specifies the destination, format and type of the logs.
modifyCacheCluster_logDeliveryConfigurations :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe [LogDeliveryConfigurationRequest])
modifyCacheCluster_logDeliveryConfigurations :: Lens' ModifyCacheCluster (Maybe [LogDeliveryConfigurationRequest])
modifyCacheCluster_logDeliveryConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations :: Maybe [LogDeliveryConfigurationRequest]
$sel:logDeliveryConfigurations:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations} -> Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe [LogDeliveryConfigurationRequest]
a -> ModifyCacheCluster
s {$sel:logDeliveryConfigurations:ModifyCacheCluster' :: Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations = Maybe [LogDeliveryConfigurationRequest]
a} :: ModifyCacheCluster) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | This option is only supported on Memcached clusters.
--
-- The list of Availability Zones where the new Memcached cache nodes are
-- created.
--
-- This parameter is only valid when @NumCacheNodes@ in the request is
-- greater than the sum of the number of active cache nodes and the number
-- of cache nodes pending creation (which may be zero). The number of
-- Availability Zones supplied in this list must match the cache nodes
-- being added in this request.
--
-- Scenarios:
--
-- -   __Scenario 1:__ You have 3 active nodes and wish to add 2 nodes.
--     Specify @NumCacheNodes=5@ (3 + 2) and optionally specify two
--     Availability Zones for the two new nodes.
--
-- -   __Scenario 2:__ You have 3 active nodes and 2 nodes pending creation
--     (from the scenario 1 call) and want to add 1 more node. Specify
--     @NumCacheNodes=6@ ((3 + 2) + 1) and optionally specify an
--     Availability Zone for the new node.
--
-- -   __Scenario 3:__ You want to cancel all pending operations. Specify
--     @NumCacheNodes=3@ to cancel all pending operations.
--
-- The Availability Zone placement of nodes pending creation cannot be
-- modified. If you wish to cancel any nodes pending creation, add 0 nodes
-- by setting @NumCacheNodes@ to the number of current nodes.
--
-- If @cross-az@ is specified, existing Memcached nodes remain in their
-- current Availability Zone. Only newly created nodes can be located in
-- different Availability Zones. For guidance on how to move existing
-- Memcached nodes to different Availability Zones, see the __Availability
-- Zone Considerations__ section of
-- <https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/CacheNodes.SupportedTypes.html Cache Node Considerations for Memcached>.
--
-- __Impact of new add\/remove requests upon pending requests__
--
-- -   Scenario-1
--
--     -   Pending Action: Delete
--
--     -   New Request: Delete
--
--     -   Result: The new delete, pending or immediate, replaces the
--         pending delete.
--
-- -   Scenario-2
--
--     -   Pending Action: Delete
--
--     -   New Request: Create
--
--     -   Result: The new create, pending or immediate, replaces the
--         pending delete.
--
-- -   Scenario-3
--
--     -   Pending Action: Create
--
--     -   New Request: Delete
--
--     -   Result: The new delete, pending or immediate, replaces the
--         pending create.
--
-- -   Scenario-4
--
--     -   Pending Action: Create
--
--     -   New Request: Create
--
--     -   Result: The new create is added to the pending create.
--
--         __Important:__ If the new create request is __Apply Immediately
--         - Yes__, all creates are performed immediately. If the new
--         create request is __Apply Immediately - No__, all creates are
--         pending.
modifyCacheCluster_newAvailabilityZones :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe [Prelude.Text])
modifyCacheCluster_newAvailabilityZones :: Lens' ModifyCacheCluster (Maybe [Text])
modifyCacheCluster_newAvailabilityZones = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe [Text]
newAvailabilityZones' :: Maybe [Text]
$sel:newAvailabilityZones':ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
newAvailabilityZones'} -> Maybe [Text]
newAvailabilityZones') (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe [Text]
a -> ModifyCacheCluster
s {$sel:newAvailabilityZones':ModifyCacheCluster' :: Maybe [Text]
newAvailabilityZones' = Maybe [Text]
a} :: ModifyCacheCluster) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the Amazon SNS topic to which
-- notifications are sent.
--
-- The Amazon SNS topic owner must be same as the cluster owner.
modifyCacheCluster_notificationTopicArn :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Text)
modifyCacheCluster_notificationTopicArn :: Lens' ModifyCacheCluster (Maybe Text)
modifyCacheCluster_notificationTopicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Text
notificationTopicArn :: Maybe Text
$sel:notificationTopicArn:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
notificationTopicArn} -> Maybe Text
notificationTopicArn) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Text
a -> ModifyCacheCluster
s {$sel:notificationTopicArn:ModifyCacheCluster' :: Maybe Text
notificationTopicArn = Maybe Text
a} :: ModifyCacheCluster)

-- | The status of the Amazon SNS notification topic. Notifications are sent
-- only if the status is @active@.
--
-- Valid values: @active@ | @inactive@
modifyCacheCluster_notificationTopicStatus :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Text)
modifyCacheCluster_notificationTopicStatus :: Lens' ModifyCacheCluster (Maybe Text)
modifyCacheCluster_notificationTopicStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Text
notificationTopicStatus :: Maybe Text
$sel:notificationTopicStatus:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
notificationTopicStatus} -> Maybe Text
notificationTopicStatus) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Text
a -> ModifyCacheCluster
s {$sel:notificationTopicStatus:ModifyCacheCluster' :: Maybe Text
notificationTopicStatus = Maybe Text
a} :: ModifyCacheCluster)

-- | The number of cache nodes that the cluster should have. If the value for
-- @NumCacheNodes@ is greater than the sum of the number of current cache
-- nodes and the number of cache nodes pending creation (which may be
-- zero), more nodes are added. If the value is less than the number of
-- existing cache nodes, nodes are removed. If the value is equal to the
-- number of current cache nodes, any pending add or remove requests are
-- canceled.
--
-- If you are removing cache nodes, you must use the @CacheNodeIdsToRemove@
-- parameter to provide the IDs of the specific cache nodes to remove.
--
-- For clusters running Redis, this value must be 1. For clusters running
-- Memcached, this value must be between 1 and 40.
--
-- Adding or removing Memcached cache nodes can be applied immediately or
-- as a pending operation (see @ApplyImmediately@).
--
-- A pending operation to modify the number of cache nodes in a cluster
-- during its maintenance window, whether by adding or removing nodes in
-- accordance with the scale out architecture, is not queued. The
-- customer\'s latest request to add or remove nodes to the cluster
-- overrides any previous pending operations to modify the number of cache
-- nodes in the cluster. For example, a request to remove 2 nodes would
-- override a previous pending operation to remove 3 nodes. Similarly, a
-- request to add 2 nodes would override a previous pending operation to
-- remove 3 nodes and vice versa. As Memcached cache nodes may now be
-- provisioned in different Availability Zones with flexible cache node
-- placement, a request to add nodes does not automatically override a
-- previous pending operation to add nodes. The customer can modify the
-- previous pending operation to add more nodes or explicitly cancel the
-- pending request and retry the new request. To cancel pending operations
-- to modify the number of cache nodes in a cluster, use the
-- @ModifyCacheCluster@ request and set @NumCacheNodes@ equal to the number
-- of cache nodes currently in the cluster.
modifyCacheCluster_numCacheNodes :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Int)
modifyCacheCluster_numCacheNodes :: Lens' ModifyCacheCluster (Maybe Int)
modifyCacheCluster_numCacheNodes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Int
numCacheNodes :: Maybe Int
$sel:numCacheNodes:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Int
numCacheNodes} -> Maybe Int
numCacheNodes) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Int
a -> ModifyCacheCluster
s {$sel:numCacheNodes:ModifyCacheCluster' :: Maybe Int
numCacheNodes = Maybe Int
a} :: ModifyCacheCluster)

-- | Specifies the weekly time range during which maintenance on the cluster
-- is performed. It is specified as a range in the format
-- ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window
-- is a 60 minute period.
--
-- Valid values for @ddd@ are:
--
-- -   @sun@
--
-- -   @mon@
--
-- -   @tue@
--
-- -   @wed@
--
-- -   @thu@
--
-- -   @fri@
--
-- -   @sat@
--
-- Example: @sun:23:00-mon:01:30@
modifyCacheCluster_preferredMaintenanceWindow :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Text)
modifyCacheCluster_preferredMaintenanceWindow :: Lens' ModifyCacheCluster (Maybe Text)
modifyCacheCluster_preferredMaintenanceWindow = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Text
preferredMaintenanceWindow :: Maybe Text
$sel:preferredMaintenanceWindow:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
preferredMaintenanceWindow} -> Maybe Text
preferredMaintenanceWindow) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Text
a -> ModifyCacheCluster
s {$sel:preferredMaintenanceWindow:ModifyCacheCluster' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
a} :: ModifyCacheCluster)

-- | Specifies the VPC Security Groups associated with the cluster.
--
-- This parameter can be used only with clusters that are created in an
-- Amazon Virtual Private Cloud (Amazon VPC).
modifyCacheCluster_securityGroupIds :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe [Prelude.Text])
modifyCacheCluster_securityGroupIds :: Lens' ModifyCacheCluster (Maybe [Text])
modifyCacheCluster_securityGroupIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe [Text]
a -> ModifyCacheCluster
s {$sel:securityGroupIds:ModifyCacheCluster' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: ModifyCacheCluster) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The number of days for which ElastiCache retains automatic cluster
-- snapshots before deleting them. For example, if you set
-- @SnapshotRetentionLimit@ to 5, a snapshot that was taken today is
-- retained for 5 days before being deleted.
--
-- If the value of @SnapshotRetentionLimit@ is set to zero (0), backups are
-- turned off.
modifyCacheCluster_snapshotRetentionLimit :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Int)
modifyCacheCluster_snapshotRetentionLimit :: Lens' ModifyCacheCluster (Maybe Int)
modifyCacheCluster_snapshotRetentionLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Int
snapshotRetentionLimit :: Maybe Int
$sel:snapshotRetentionLimit:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Int
snapshotRetentionLimit} -> Maybe Int
snapshotRetentionLimit) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Int
a -> ModifyCacheCluster
s {$sel:snapshotRetentionLimit:ModifyCacheCluster' :: Maybe Int
snapshotRetentionLimit = Maybe Int
a} :: ModifyCacheCluster)

-- | The daily time range (in UTC) during which ElastiCache begins taking a
-- daily snapshot of your cluster.
modifyCacheCluster_snapshotWindow :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Text)
modifyCacheCluster_snapshotWindow :: Lens' ModifyCacheCluster (Maybe Text)
modifyCacheCluster_snapshotWindow = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Maybe Text
snapshotWindow :: Maybe Text
$sel:snapshotWindow:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
snapshotWindow} -> Maybe Text
snapshotWindow) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Maybe Text
a -> ModifyCacheCluster
s {$sel:snapshotWindow:ModifyCacheCluster' :: Maybe Text
snapshotWindow = Maybe Text
a} :: ModifyCacheCluster)

-- | The cluster identifier. This value is stored as a lowercase string.
modifyCacheCluster_cacheClusterId :: Lens.Lens' ModifyCacheCluster Prelude.Text
modifyCacheCluster_cacheClusterId :: Lens' ModifyCacheCluster Text
modifyCacheCluster_cacheClusterId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheCluster' {Text
cacheClusterId :: Text
$sel:cacheClusterId:ModifyCacheCluster' :: ModifyCacheCluster -> Text
cacheClusterId} -> Text
cacheClusterId) (\s :: ModifyCacheCluster
s@ModifyCacheCluster' {} Text
a -> ModifyCacheCluster
s {$sel:cacheClusterId:ModifyCacheCluster' :: Text
cacheClusterId = Text
a} :: ModifyCacheCluster)

instance Core.AWSRequest ModifyCacheCluster where
  type
    AWSResponse ModifyCacheCluster =
      ModifyCacheClusterResponse
  request :: (Service -> Service)
-> ModifyCacheCluster -> Request ModifyCacheCluster
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ModifyCacheCluster
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyCacheCluster)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ModifyCacheClusterResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe CacheCluster -> Int -> ModifyCacheClusterResponse
ModifyCacheClusterResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"CacheCluster")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ModifyCacheCluster where
  hashWithSalt :: Int -> ModifyCacheCluster -> Int
hashWithSalt Int
_salt ModifyCacheCluster' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [LogDeliveryConfigurationRequest]
Maybe Text
Maybe AZMode
Maybe AuthTokenUpdateStrategyType
Maybe IpDiscovery
Text
cacheClusterId :: Text
snapshotWindow :: Maybe Text
snapshotRetentionLimit :: Maybe Int
securityGroupIds :: Maybe [Text]
preferredMaintenanceWindow :: Maybe Text
numCacheNodes :: Maybe Int
notificationTopicStatus :: Maybe Text
notificationTopicArn :: Maybe Text
newAvailabilityZones' :: Maybe [Text]
logDeliveryConfigurations :: Maybe [LogDeliveryConfigurationRequest]
ipDiscovery :: Maybe IpDiscovery
engineVersion :: Maybe Text
cacheSecurityGroupNames :: Maybe [Text]
cacheParameterGroupName :: Maybe Text
cacheNodeType :: Maybe Text
cacheNodeIdsToRemove :: Maybe [Text]
autoMinorVersionUpgrade :: Maybe Bool
authTokenUpdateStrategy :: Maybe AuthTokenUpdateStrategyType
authToken :: Maybe Text
applyImmediately :: Maybe Bool
aZMode :: Maybe AZMode
$sel:cacheClusterId:ModifyCacheCluster' :: ModifyCacheCluster -> Text
$sel:snapshotWindow:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:snapshotRetentionLimit:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Int
$sel:securityGroupIds:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:preferredMaintenanceWindow:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:numCacheNodes:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Int
$sel:notificationTopicStatus:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:notificationTopicArn:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:newAvailabilityZones':ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:logDeliveryConfigurations:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [LogDeliveryConfigurationRequest]
$sel:ipDiscovery:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe IpDiscovery
$sel:engineVersion:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:cacheSecurityGroupNames:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:cacheParameterGroupName:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:cacheNodeType:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:cacheNodeIdsToRemove:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:autoMinorVersionUpgrade:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Bool
$sel:authTokenUpdateStrategy:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe AuthTokenUpdateStrategyType
$sel:authToken:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:applyImmediately:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Bool
$sel:aZMode:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe AZMode
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AZMode
aZMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
applyImmediately
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AuthTokenUpdateStrategyType
authTokenUpdateStrategy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
autoMinorVersionUpgrade
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
cacheNodeIdsToRemove
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cacheNodeType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cacheParameterGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
cacheSecurityGroupNames
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
engineVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpDiscovery
ipDiscovery
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
newAvailabilityZones'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notificationTopicArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notificationTopicStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numCacheNodes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
preferredMaintenanceWindow
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
securityGroupIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
snapshotRetentionLimit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotWindow
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cacheClusterId

instance Prelude.NFData ModifyCacheCluster where
  rnf :: ModifyCacheCluster -> ()
rnf ModifyCacheCluster' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [LogDeliveryConfigurationRequest]
Maybe Text
Maybe AZMode
Maybe AuthTokenUpdateStrategyType
Maybe IpDiscovery
Text
cacheClusterId :: Text
snapshotWindow :: Maybe Text
snapshotRetentionLimit :: Maybe Int
securityGroupIds :: Maybe [Text]
preferredMaintenanceWindow :: Maybe Text
numCacheNodes :: Maybe Int
notificationTopicStatus :: Maybe Text
notificationTopicArn :: Maybe Text
newAvailabilityZones' :: Maybe [Text]
logDeliveryConfigurations :: Maybe [LogDeliveryConfigurationRequest]
ipDiscovery :: Maybe IpDiscovery
engineVersion :: Maybe Text
cacheSecurityGroupNames :: Maybe [Text]
cacheParameterGroupName :: Maybe Text
cacheNodeType :: Maybe Text
cacheNodeIdsToRemove :: Maybe [Text]
autoMinorVersionUpgrade :: Maybe Bool
authTokenUpdateStrategy :: Maybe AuthTokenUpdateStrategyType
authToken :: Maybe Text
applyImmediately :: Maybe Bool
aZMode :: Maybe AZMode
$sel:cacheClusterId:ModifyCacheCluster' :: ModifyCacheCluster -> Text
$sel:snapshotWindow:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:snapshotRetentionLimit:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Int
$sel:securityGroupIds:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:preferredMaintenanceWindow:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:numCacheNodes:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Int
$sel:notificationTopicStatus:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:notificationTopicArn:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:newAvailabilityZones':ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:logDeliveryConfigurations:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [LogDeliveryConfigurationRequest]
$sel:ipDiscovery:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe IpDiscovery
$sel:engineVersion:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:cacheSecurityGroupNames:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:cacheParameterGroupName:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:cacheNodeType:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:cacheNodeIdsToRemove:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:autoMinorVersionUpgrade:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Bool
$sel:authTokenUpdateStrategy:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe AuthTokenUpdateStrategyType
$sel:authToken:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:applyImmediately:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Bool
$sel:aZMode:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe AZMode
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AZMode
aZMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
applyImmediately
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AuthTokenUpdateStrategyType
authTokenUpdateStrategy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
autoMinorVersionUpgrade
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
cacheNodeIdsToRemove
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cacheNodeType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cacheParameterGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
cacheSecurityGroupNames
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
engineVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpDiscovery
ipDiscovery
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
newAvailabilityZones'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notificationTopicArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notificationTopicStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
numCacheNodes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe Text
preferredMaintenanceWindow
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
securityGroupIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe Int
snapshotRetentionLimit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotWindow
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
cacheClusterId

instance Data.ToHeaders ModifyCacheCluster where
  toHeaders :: ModifyCacheCluster -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath ModifyCacheCluster where
  toPath :: ModifyCacheCluster -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery ModifyCacheCluster where
  toQuery :: ModifyCacheCluster -> QueryString
toQuery ModifyCacheCluster' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [LogDeliveryConfigurationRequest]
Maybe Text
Maybe AZMode
Maybe AuthTokenUpdateStrategyType
Maybe IpDiscovery
Text
cacheClusterId :: Text
snapshotWindow :: Maybe Text
snapshotRetentionLimit :: Maybe Int
securityGroupIds :: Maybe [Text]
preferredMaintenanceWindow :: Maybe Text
numCacheNodes :: Maybe Int
notificationTopicStatus :: Maybe Text
notificationTopicArn :: Maybe Text
newAvailabilityZones' :: Maybe [Text]
logDeliveryConfigurations :: Maybe [LogDeliveryConfigurationRequest]
ipDiscovery :: Maybe IpDiscovery
engineVersion :: Maybe Text
cacheSecurityGroupNames :: Maybe [Text]
cacheParameterGroupName :: Maybe Text
cacheNodeType :: Maybe Text
cacheNodeIdsToRemove :: Maybe [Text]
autoMinorVersionUpgrade :: Maybe Bool
authTokenUpdateStrategy :: Maybe AuthTokenUpdateStrategyType
authToken :: Maybe Text
applyImmediately :: Maybe Bool
aZMode :: Maybe AZMode
$sel:cacheClusterId:ModifyCacheCluster' :: ModifyCacheCluster -> Text
$sel:snapshotWindow:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:snapshotRetentionLimit:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Int
$sel:securityGroupIds:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:preferredMaintenanceWindow:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:numCacheNodes:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Int
$sel:notificationTopicStatus:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:notificationTopicArn:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:newAvailabilityZones':ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:logDeliveryConfigurations:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [LogDeliveryConfigurationRequest]
$sel:ipDiscovery:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe IpDiscovery
$sel:engineVersion:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:cacheSecurityGroupNames:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:cacheParameterGroupName:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:cacheNodeType:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:cacheNodeIdsToRemove:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:autoMinorVersionUpgrade:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Bool
$sel:authTokenUpdateStrategy:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe AuthTokenUpdateStrategyType
$sel:authToken:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:applyImmediately:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Bool
$sel:aZMode:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe AZMode
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifyCacheCluster" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"AZMode" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe AZMode
aZMode,
        ByteString
"ApplyImmediately" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
applyImmediately,
        ByteString
"AuthToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
authToken,
        ByteString
"AuthTokenUpdateStrategy"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe AuthTokenUpdateStrategyType
authTokenUpdateStrategy,
        ByteString
"AutoMinorVersionUpgrade"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
autoMinorVersionUpgrade,
        ByteString
"CacheNodeIdsToRemove"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"CacheNodeId"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
cacheNodeIdsToRemove
            ),
        ByteString
"CacheNodeType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
cacheNodeType,
        ByteString
"CacheParameterGroupName"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
cacheParameterGroupName,
        ByteString
"CacheSecurityGroupNames"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"CacheSecurityGroupName"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
cacheSecurityGroupNames
            ),
        ByteString
"EngineVersion" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
engineVersion,
        ByteString
"IpDiscovery" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe IpDiscovery
ipDiscovery,
        ByteString
"LogDeliveryConfigurations"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"LogDeliveryConfigurationRequest"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations
            ),
        ByteString
"NewAvailabilityZones"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"PreferredAvailabilityZone"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
newAvailabilityZones'
            ),
        ByteString
"NotificationTopicArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
notificationTopicArn,
        ByteString
"NotificationTopicStatus"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
notificationTopicStatus,
        ByteString
"NumCacheNodes" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
numCacheNodes,
        ByteString
"PreferredMaintenanceWindow"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
preferredMaintenanceWindow,
        ByteString
"SecurityGroupIds"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"SecurityGroupId"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroupIds
            ),
        ByteString
"SnapshotRetentionLimit"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
snapshotRetentionLimit,
        ByteString
"SnapshotWindow" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
snapshotWindow,
        ByteString
"CacheClusterId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
cacheClusterId
      ]

-- | /See:/ 'newModifyCacheClusterResponse' smart constructor.
data ModifyCacheClusterResponse = ModifyCacheClusterResponse'
  { ModifyCacheClusterResponse -> Maybe CacheCluster
cacheCluster :: Prelude.Maybe CacheCluster,
    -- | The response's http status code.
    ModifyCacheClusterResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyCacheClusterResponse -> ModifyCacheClusterResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyCacheClusterResponse -> ModifyCacheClusterResponse -> Bool
$c/= :: ModifyCacheClusterResponse -> ModifyCacheClusterResponse -> Bool
== :: ModifyCacheClusterResponse -> ModifyCacheClusterResponse -> Bool
$c== :: ModifyCacheClusterResponse -> ModifyCacheClusterResponse -> Bool
Prelude.Eq, ReadPrec [ModifyCacheClusterResponse]
ReadPrec ModifyCacheClusterResponse
Int -> ReadS ModifyCacheClusterResponse
ReadS [ModifyCacheClusterResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyCacheClusterResponse]
$creadListPrec :: ReadPrec [ModifyCacheClusterResponse]
readPrec :: ReadPrec ModifyCacheClusterResponse
$creadPrec :: ReadPrec ModifyCacheClusterResponse
readList :: ReadS [ModifyCacheClusterResponse]
$creadList :: ReadS [ModifyCacheClusterResponse]
readsPrec :: Int -> ReadS ModifyCacheClusterResponse
$creadsPrec :: Int -> ReadS ModifyCacheClusterResponse
Prelude.Read, Int -> ModifyCacheClusterResponse -> ShowS
[ModifyCacheClusterResponse] -> ShowS
ModifyCacheClusterResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyCacheClusterResponse] -> ShowS
$cshowList :: [ModifyCacheClusterResponse] -> ShowS
show :: ModifyCacheClusterResponse -> String
$cshow :: ModifyCacheClusterResponse -> String
showsPrec :: Int -> ModifyCacheClusterResponse -> ShowS
$cshowsPrec :: Int -> ModifyCacheClusterResponse -> ShowS
Prelude.Show, forall x.
Rep ModifyCacheClusterResponse x -> ModifyCacheClusterResponse
forall x.
ModifyCacheClusterResponse -> Rep ModifyCacheClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyCacheClusterResponse x -> ModifyCacheClusterResponse
$cfrom :: forall x.
ModifyCacheClusterResponse -> Rep ModifyCacheClusterResponse x
Prelude.Generic)

-- |
-- Create a value of 'ModifyCacheClusterResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'cacheCluster', 'modifyCacheClusterResponse_cacheCluster' - Undocumented member.
--
-- 'httpStatus', 'modifyCacheClusterResponse_httpStatus' - The response's http status code.
newModifyCacheClusterResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyCacheClusterResponse
newModifyCacheClusterResponse :: Int -> ModifyCacheClusterResponse
newModifyCacheClusterResponse Int
pHttpStatus_ =
  ModifyCacheClusterResponse'
    { $sel:cacheCluster:ModifyCacheClusterResponse' :: Maybe CacheCluster
cacheCluster =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ModifyCacheClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
modifyCacheClusterResponse_cacheCluster :: Lens.Lens' ModifyCacheClusterResponse (Prelude.Maybe CacheCluster)
modifyCacheClusterResponse_cacheCluster :: Lens' ModifyCacheClusterResponse (Maybe CacheCluster)
modifyCacheClusterResponse_cacheCluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheClusterResponse' {Maybe CacheCluster
cacheCluster :: Maybe CacheCluster
$sel:cacheCluster:ModifyCacheClusterResponse' :: ModifyCacheClusterResponse -> Maybe CacheCluster
cacheCluster} -> Maybe CacheCluster
cacheCluster) (\s :: ModifyCacheClusterResponse
s@ModifyCacheClusterResponse' {} Maybe CacheCluster
a -> ModifyCacheClusterResponse
s {$sel:cacheCluster:ModifyCacheClusterResponse' :: Maybe CacheCluster
cacheCluster = Maybe CacheCluster
a} :: ModifyCacheClusterResponse)

-- | The response's http status code.
modifyCacheClusterResponse_httpStatus :: Lens.Lens' ModifyCacheClusterResponse Prelude.Int
modifyCacheClusterResponse_httpStatus :: Lens' ModifyCacheClusterResponse Int
modifyCacheClusterResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheClusterResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyCacheClusterResponse' :: ModifyCacheClusterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyCacheClusterResponse
s@ModifyCacheClusterResponse' {} Int
a -> ModifyCacheClusterResponse
s {$sel:httpStatus:ModifyCacheClusterResponse' :: Int
httpStatus = Int
a} :: ModifyCacheClusterResponse)

instance Prelude.NFData ModifyCacheClusterResponse where
  rnf :: ModifyCacheClusterResponse -> ()
rnf ModifyCacheClusterResponse' {Int
Maybe CacheCluster
httpStatus :: Int
cacheCluster :: Maybe CacheCluster
$sel:httpStatus:ModifyCacheClusterResponse' :: ModifyCacheClusterResponse -> Int
$sel:cacheCluster:ModifyCacheClusterResponse' :: ModifyCacheClusterResponse -> Maybe CacheCluster
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe CacheCluster
cacheCluster
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus