{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- 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_engineVersion,
    modifyCacheCluster_cacheNodeType,
    modifyCacheCluster_securityGroupIds,
    modifyCacheCluster_autoMinorVersionUpgrade,
    modifyCacheCluster_cacheParameterGroupName,
    modifyCacheCluster_snapshotWindow,
    modifyCacheCluster_newAvailabilityZones,
    modifyCacheCluster_logDeliveryConfigurations,
    modifyCacheCluster_authToken,
    modifyCacheCluster_preferredMaintenanceWindow,
    modifyCacheCluster_cacheNodeIdsToRemove,
    modifyCacheCluster_snapshotRetentionLimit,
    modifyCacheCluster_notificationTopicStatus,
    modifyCacheCluster_aZMode,
    modifyCacheCluster_applyImmediately,
    modifyCacheCluster_authTokenUpdateStrategy,
    modifyCacheCluster_notificationTopicArn,
    modifyCacheCluster_numCacheNodes,
    modifyCacheCluster_cacheSecurityGroupNames,
    modifyCacheCluster_cacheClusterId,

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

    -- * Response Lenses
    modifyCacheClusterResponse_cacheCluster,
    modifyCacheClusterResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.Types
import qualified Amazonka.Lens as Lens
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'
  { -- | 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,
    -- | A valid cache node type that you want to scale this cluster up to.
    ModifyCacheCluster -> Maybe Text
cacheNodeType :: 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],
    -- | This parameter is currently disabled.
    ModifyCacheCluster -> Maybe Bool
autoMinorVersionUpgrade :: Prelude.Maybe Prelude.Bool,
    -- | 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,
    -- | 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,
    -- | 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],
    -- | Specifies the destination, format and type of the logs.
    ModifyCacheCluster -> Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations :: Prelude.Maybe [LogDeliveryConfigurationRequest],
    -- | 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 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,
    -- | 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],
    -- | 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 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,
    -- | 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,
    -- | 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,
    -- | 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 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,
    -- | 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 cluster identifier. This value is stored as a lowercase string.
    ModifyCacheCluster -> Text
cacheClusterId :: Prelude.Text
  }
  deriving (ModifyCacheCluster -> ModifyCacheCluster -> Bool
(ModifyCacheCluster -> ModifyCacheCluster -> Bool)
-> (ModifyCacheCluster -> ModifyCacheCluster -> Bool)
-> Eq ModifyCacheCluster
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]
(Int -> ReadS ModifyCacheCluster)
-> ReadS [ModifyCacheCluster]
-> ReadPrec ModifyCacheCluster
-> ReadPrec [ModifyCacheCluster]
-> Read 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
(Int -> ModifyCacheCluster -> ShowS)
-> (ModifyCacheCluster -> String)
-> ([ModifyCacheCluster] -> ShowS)
-> Show ModifyCacheCluster
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. ModifyCacheCluster -> Rep ModifyCacheCluster x)
-> (forall x. Rep ModifyCacheCluster x -> ModifyCacheCluster)
-> Generic ModifyCacheCluster
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:
--
-- '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.
--
-- 'cacheNodeType', 'modifyCacheCluster_cacheNodeType' - A valid cache node type that you want to scale this cluster up to.
--
-- '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).
--
-- 'autoMinorVersionUpgrade', 'modifyCacheCluster_autoMinorVersionUpgrade' - This parameter is currently disabled.
--
-- '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.
--
-- 'snapshotWindow', 'modifyCacheCluster_snapshotWindow' - The daily time range (in UTC) during which ElastiCache begins taking a
-- daily snapshot of your cluster.
--
-- '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.
--
-- 'logDeliveryConfigurations', 'modifyCacheCluster_logDeliveryConfigurations' - Specifies the destination, format and type of the logs.
--
-- '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>.
--
-- '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@
--
-- '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.
--
-- '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.
--
-- 'notificationTopicStatus', 'modifyCacheCluster_notificationTopicStatus' - The status of the Amazon SNS notification topic. Notifications are sent
-- only if the status is @active@.
--
-- Valid values: @active@ | @inactive@
--
-- '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@
--
-- '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>
--
-- '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.
--
-- '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.
--
-- '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\".
--
-- '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' :: Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [LogDeliveryConfigurationRequest]
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> Maybe AZMode
-> Maybe Bool
-> Maybe AuthTokenUpdateStrategyType
-> Maybe Text
-> Maybe Int
-> Maybe [Text]
-> Text
-> ModifyCacheCluster
ModifyCacheCluster'
    { $sel:engineVersion:ModifyCacheCluster' :: Maybe Text
engineVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheNodeType:ModifyCacheCluster' :: Maybe Text
cacheNodeType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroupIds:ModifyCacheCluster' :: Maybe [Text]
securityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:autoMinorVersionUpgrade:ModifyCacheCluster' :: Maybe Bool
autoMinorVersionUpgrade = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheParameterGroupName:ModifyCacheCluster' :: Maybe Text
cacheParameterGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotWindow:ModifyCacheCluster' :: Maybe Text
snapshotWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:newAvailabilityZones':ModifyCacheCluster' :: Maybe [Text]
newAvailabilityZones' = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:logDeliveryConfigurations:ModifyCacheCluster' :: Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations = Maybe [LogDeliveryConfigurationRequest]
forall a. Maybe a
Prelude.Nothing,
      $sel:authToken:ModifyCacheCluster' :: Maybe Text
authToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preferredMaintenanceWindow:ModifyCacheCluster' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheNodeIdsToRemove:ModifyCacheCluster' :: Maybe [Text]
cacheNodeIdsToRemove = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotRetentionLimit:ModifyCacheCluster' :: Maybe Int
snapshotRetentionLimit = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationTopicStatus:ModifyCacheCluster' :: Maybe Text
notificationTopicStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:aZMode:ModifyCacheCluster' :: Maybe AZMode
aZMode = Maybe AZMode
forall a. Maybe a
Prelude.Nothing,
      $sel:applyImmediately:ModifyCacheCluster' :: Maybe Bool
applyImmediately = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:authTokenUpdateStrategy:ModifyCacheCluster' :: Maybe AuthTokenUpdateStrategyType
authTokenUpdateStrategy = Maybe AuthTokenUpdateStrategyType
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationTopicArn:ModifyCacheCluster' :: Maybe Text
notificationTopicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:numCacheNodes:ModifyCacheCluster' :: Maybe Int
numCacheNodes = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheSecurityGroupNames:ModifyCacheCluster' :: Maybe [Text]
cacheSecurityGroupNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheClusterId:ModifyCacheCluster' :: Text
cacheClusterId = Text
pCacheClusterId_
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_engineVersion = (ModifyCacheCluster -> Maybe Text)
-> (ModifyCacheCluster -> Maybe Text -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_cacheNodeType = (ModifyCacheCluster -> Maybe Text)
-> (ModifyCacheCluster -> Maybe Text -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe [Text] -> f (Maybe [Text]))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_securityGroupIds = (ModifyCacheCluster -> Maybe [Text])
-> (ModifyCacheCluster -> Maybe [Text] -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> ModifyCacheCluster -> f ModifyCacheCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ModifyCacheCluster
-> f ModifyCacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | This parameter is currently disabled.
modifyCacheCluster_autoMinorVersionUpgrade :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe Prelude.Bool)
modifyCacheCluster_autoMinorVersionUpgrade :: (Maybe Bool -> f (Maybe Bool))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_autoMinorVersionUpgrade = (ModifyCacheCluster -> Maybe Bool)
-> (ModifyCacheCluster -> Maybe Bool -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Bool) (Maybe Bool)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_cacheParameterGroupName = (ModifyCacheCluster -> Maybe Text)
-> (ModifyCacheCluster -> Maybe Text -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_snapshotWindow = (ModifyCacheCluster -> Maybe Text)
-> (ModifyCacheCluster -> Maybe Text -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe [Text] -> f (Maybe [Text]))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_newAvailabilityZones = (ModifyCacheCluster -> Maybe [Text])
-> (ModifyCacheCluster -> Maybe [Text] -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> ModifyCacheCluster -> f ModifyCacheCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ModifyCacheCluster
-> f ModifyCacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the destination, format and type of the logs.
modifyCacheCluster_logDeliveryConfigurations :: Lens.Lens' ModifyCacheCluster (Prelude.Maybe [LogDeliveryConfigurationRequest])
modifyCacheCluster_logDeliveryConfigurations :: (Maybe [LogDeliveryConfigurationRequest]
 -> f (Maybe [LogDeliveryConfigurationRequest]))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_logDeliveryConfigurations = (ModifyCacheCluster -> Maybe [LogDeliveryConfigurationRequest])
-> (ModifyCacheCluster
    -> Maybe [LogDeliveryConfigurationRequest] -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster
     ModifyCacheCluster
     (Maybe [LogDeliveryConfigurationRequest])
     (Maybe [LogDeliveryConfigurationRequest])
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) ((Maybe [LogDeliveryConfigurationRequest]
  -> f (Maybe [LogDeliveryConfigurationRequest]))
 -> ModifyCacheCluster -> f ModifyCacheCluster)
-> ((Maybe [LogDeliveryConfigurationRequest]
     -> f (Maybe [LogDeliveryConfigurationRequest]))
    -> Maybe [LogDeliveryConfigurationRequest]
    -> f (Maybe [LogDeliveryConfigurationRequest]))
-> (Maybe [LogDeliveryConfigurationRequest]
    -> f (Maybe [LogDeliveryConfigurationRequest]))
-> ModifyCacheCluster
-> f ModifyCacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LogDeliveryConfigurationRequest]
  [LogDeliveryConfigurationRequest]
  [LogDeliveryConfigurationRequest]
  [LogDeliveryConfigurationRequest]
-> Iso
     (Maybe [LogDeliveryConfigurationRequest])
     (Maybe [LogDeliveryConfigurationRequest])
     (Maybe [LogDeliveryConfigurationRequest])
     (Maybe [LogDeliveryConfigurationRequest])
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 AnIso
  [LogDeliveryConfigurationRequest]
  [LogDeliveryConfigurationRequest]
  [LogDeliveryConfigurationRequest]
  [LogDeliveryConfigurationRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_authToken = (ModifyCacheCluster -> Maybe Text)
-> (ModifyCacheCluster -> Maybe Text -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Text) (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_preferredMaintenanceWindow = (ModifyCacheCluster -> Maybe Text)
-> (ModifyCacheCluster -> Maybe Text -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe [Text] -> f (Maybe [Text]))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_cacheNodeIdsToRemove = (ModifyCacheCluster -> Maybe [Text])
-> (ModifyCacheCluster -> Maybe [Text] -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> ModifyCacheCluster -> f ModifyCacheCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ModifyCacheCluster
-> f ModifyCacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
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 :: (Maybe Int -> f (Maybe Int))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_snapshotRetentionLimit = (ModifyCacheCluster -> Maybe Int)
-> (ModifyCacheCluster -> Maybe Int -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Int) (Maybe Int)
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 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 :: (Maybe Text -> f (Maybe Text))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_notificationTopicStatus = (ModifyCacheCluster -> Maybe Text)
-> (ModifyCacheCluster -> Maybe Text -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe AZMode -> f (Maybe AZMode))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_aZMode = (ModifyCacheCluster -> Maybe AZMode)
-> (ModifyCacheCluster -> Maybe AZMode -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe AZMode) (Maybe 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 :: (Maybe Bool -> f (Maybe Bool))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_applyImmediately = (ModifyCacheCluster -> Maybe Bool)
-> (ModifyCacheCluster -> Maybe Bool -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Bool) (Maybe Bool)
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)

-- | 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 :: (Maybe AuthTokenUpdateStrategyType
 -> f (Maybe AuthTokenUpdateStrategyType))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_authTokenUpdateStrategy = (ModifyCacheCluster -> Maybe AuthTokenUpdateStrategyType)
-> (ModifyCacheCluster
    -> Maybe AuthTokenUpdateStrategyType -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster
     ModifyCacheCluster
     (Maybe AuthTokenUpdateStrategyType)
     (Maybe AuthTokenUpdateStrategyType)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_notificationTopicArn = (ModifyCacheCluster -> Maybe Text)
-> (ModifyCacheCluster -> Maybe Text -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Text) (Maybe Text)
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 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 :: (Maybe Int -> f (Maybe Int))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_numCacheNodes = (ModifyCacheCluster -> Maybe Int)
-> (ModifyCacheCluster -> Maybe Int -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe Int) (Maybe Int)
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)

-- | 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 :: (Maybe [Text] -> f (Maybe [Text]))
-> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_cacheSecurityGroupNames = (ModifyCacheCluster -> Maybe [Text])
-> (ModifyCacheCluster -> Maybe [Text] -> ModifyCacheCluster)
-> Lens
     ModifyCacheCluster ModifyCacheCluster (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> ModifyCacheCluster -> f ModifyCacheCluster)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ModifyCacheCluster
-> f ModifyCacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The cluster identifier. This value is stored as a lowercase string.
modifyCacheCluster_cacheClusterId :: Lens.Lens' ModifyCacheCluster Prelude.Text
modifyCacheCluster_cacheClusterId :: (Text -> f Text) -> ModifyCacheCluster -> f ModifyCacheCluster
modifyCacheCluster_cacheClusterId = (ModifyCacheCluster -> Text)
-> (ModifyCacheCluster -> Text -> ModifyCacheCluster)
-> Lens ModifyCacheCluster ModifyCacheCluster Text Text
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 :: ModifyCacheCluster -> Request ModifyCacheCluster
request = Service -> ModifyCacheCluster -> Request ModifyCacheCluster
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ModifyCacheCluster
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyCacheCluster)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ModifyCacheCluster))
-> Logger
-> Service
-> Proxy ModifyCacheCluster
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyCacheCluster)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> 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'
            (Maybe CacheCluster -> Int -> ModifyCacheClusterResponse)
-> Either String (Maybe CacheCluster)
-> Either String (Int -> ModifyCacheClusterResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe CacheCluster)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CacheCluster")
            Either String (Int -> ModifyCacheClusterResponse)
-> Either String Int -> Either String ModifyCacheClusterResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ModifyCacheCluster

instance Prelude.NFData ModifyCacheCluster

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

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

instance Core.ToQuery ModifyCacheCluster where
  toQuery :: ModifyCacheCluster -> QueryString
toQuery ModifyCacheCluster' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [LogDeliveryConfigurationRequest]
Maybe Text
Maybe AZMode
Maybe AuthTokenUpdateStrategyType
Text
cacheClusterId :: Text
cacheSecurityGroupNames :: Maybe [Text]
numCacheNodes :: Maybe Int
notificationTopicArn :: Maybe Text
authTokenUpdateStrategy :: Maybe AuthTokenUpdateStrategyType
applyImmediately :: Maybe Bool
aZMode :: Maybe AZMode
notificationTopicStatus :: Maybe Text
snapshotRetentionLimit :: Maybe Int
cacheNodeIdsToRemove :: Maybe [Text]
preferredMaintenanceWindow :: Maybe Text
authToken :: Maybe Text
logDeliveryConfigurations :: Maybe [LogDeliveryConfigurationRequest]
newAvailabilityZones' :: Maybe [Text]
snapshotWindow :: Maybe Text
cacheParameterGroupName :: Maybe Text
autoMinorVersionUpgrade :: Maybe Bool
securityGroupIds :: Maybe [Text]
cacheNodeType :: Maybe Text
engineVersion :: Maybe Text
$sel:cacheClusterId:ModifyCacheCluster' :: ModifyCacheCluster -> Text
$sel:cacheSecurityGroupNames:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:numCacheNodes:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Int
$sel:notificationTopicArn:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:authTokenUpdateStrategy:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe AuthTokenUpdateStrategyType
$sel:applyImmediately:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Bool
$sel:aZMode:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe AZMode
$sel:notificationTopicStatus:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:snapshotRetentionLimit:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Int
$sel:cacheNodeIdsToRemove:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:preferredMaintenanceWindow:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:authToken:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:logDeliveryConfigurations:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [LogDeliveryConfigurationRequest]
$sel:newAvailabilityZones':ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:snapshotWindow:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:cacheParameterGroupName:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:autoMinorVersionUpgrade:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Bool
$sel:securityGroupIds:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe [Text]
$sel:cacheNodeType:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
$sel:engineVersion:ModifyCacheCluster' :: ModifyCacheCluster -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ModifyCacheCluster" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"EngineVersion" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
engineVersion,
        ByteString
"CacheNodeType" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
cacheNodeType,
        ByteString
"SecurityGroupIds"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"SecurityGroupId"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroupIds
            ),
        ByteString
"AutoMinorVersionUpgrade"
          ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
autoMinorVersionUpgrade,
        ByteString
"CacheParameterGroupName"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
cacheParameterGroupName,
        ByteString
"SnapshotWindow" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
snapshotWindow,
        ByteString
"NewAvailabilityZones"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"PreferredAvailabilityZone"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
newAvailabilityZones'
            ),
        ByteString
"LogDeliveryConfigurations"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [LogDeliveryConfigurationRequest] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"LogDeliveryConfigurationRequest"
                ([LogDeliveryConfigurationRequest] -> QueryString)
-> Maybe [LogDeliveryConfigurationRequest] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [LogDeliveryConfigurationRequest]
logDeliveryConfigurations
            ),
        ByteString
"AuthToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
authToken,
        ByteString
"PreferredMaintenanceWindow"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
preferredMaintenanceWindow,
        ByteString
"CacheNodeIdsToRemove"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"CacheNodeId"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
cacheNodeIdsToRemove
            ),
        ByteString
"SnapshotRetentionLimit"
          ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
snapshotRetentionLimit,
        ByteString
"NotificationTopicStatus"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
notificationTopicStatus,
        ByteString
"AZMode" ByteString -> Maybe AZMode -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AZMode
aZMode,
        ByteString
"ApplyImmediately" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
applyImmediately,
        ByteString
"AuthTokenUpdateStrategy"
          ByteString -> Maybe AuthTokenUpdateStrategyType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AuthTokenUpdateStrategyType
authTokenUpdateStrategy,
        ByteString
"NotificationTopicArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
notificationTopicArn,
        ByteString
"NumCacheNodes" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
numCacheNodes,
        ByteString
"CacheSecurityGroupNames"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"CacheSecurityGroupName"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
cacheSecurityGroupNames
            ),
        ByteString
"CacheClusterId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: 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
(ModifyCacheClusterResponse -> ModifyCacheClusterResponse -> Bool)
-> (ModifyCacheClusterResponse
    -> ModifyCacheClusterResponse -> Bool)
-> Eq ModifyCacheClusterResponse
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]
(Int -> ReadS ModifyCacheClusterResponse)
-> ReadS [ModifyCacheClusterResponse]
-> ReadPrec ModifyCacheClusterResponse
-> ReadPrec [ModifyCacheClusterResponse]
-> Read 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
(Int -> ModifyCacheClusterResponse -> ShowS)
-> (ModifyCacheClusterResponse -> String)
-> ([ModifyCacheClusterResponse] -> ShowS)
-> Show ModifyCacheClusterResponse
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.
 ModifyCacheClusterResponse -> Rep ModifyCacheClusterResponse x)
-> (forall x.
    Rep ModifyCacheClusterResponse x -> ModifyCacheClusterResponse)
-> Generic ModifyCacheClusterResponse
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' :: Maybe CacheCluster -> Int -> ModifyCacheClusterResponse
ModifyCacheClusterResponse'
    { $sel:cacheCluster:ModifyCacheClusterResponse' :: Maybe CacheCluster
cacheCluster =
        Maybe 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 :: (Maybe CacheCluster -> f (Maybe CacheCluster))
-> ModifyCacheClusterResponse -> f ModifyCacheClusterResponse
modifyCacheClusterResponse_cacheCluster = (ModifyCacheClusterResponse -> Maybe CacheCluster)
-> (ModifyCacheClusterResponse
    -> Maybe CacheCluster -> ModifyCacheClusterResponse)
-> Lens
     ModifyCacheClusterResponse
     ModifyCacheClusterResponse
     (Maybe CacheCluster)
     (Maybe 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 :: (Int -> f Int)
-> ModifyCacheClusterResponse -> f ModifyCacheClusterResponse
modifyCacheClusterResponse_httpStatus = (ModifyCacheClusterResponse -> Int)
-> (ModifyCacheClusterResponse
    -> Int -> ModifyCacheClusterResponse)
-> Lens
     ModifyCacheClusterResponse ModifyCacheClusterResponse Int Int
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