{-# 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.MemoryDb.CreateCluster
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a cluster. All nodes in the cluster run the same
-- protocol-compliant engine software.
module Amazonka.MemoryDb.CreateCluster
  ( -- * Creating a Request
    CreateCluster (..),
    newCreateCluster,

    -- * Request Lenses
    createCluster_autoMinorVersionUpgrade,
    createCluster_dataTiering,
    createCluster_description,
    createCluster_engineVersion,
    createCluster_kmsKeyId,
    createCluster_maintenanceWindow,
    createCluster_numReplicasPerShard,
    createCluster_numShards,
    createCluster_parameterGroupName,
    createCluster_port,
    createCluster_securityGroupIds,
    createCluster_snapshotArns,
    createCluster_snapshotName,
    createCluster_snapshotRetentionLimit,
    createCluster_snapshotWindow,
    createCluster_snsTopicArn,
    createCluster_subnetGroupName,
    createCluster_tLSEnabled,
    createCluster_tags,
    createCluster_clusterName,
    createCluster_nodeType,
    createCluster_aCLName,

    -- * Destructuring the Response
    CreateClusterResponse (..),
    newCreateClusterResponse,

    -- * Response Lenses
    createClusterResponse_cluster,
    createClusterResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateCluster' smart constructor.
data CreateCluster = CreateCluster'
  { -- | When set to true, the cluster will automatically receive minor engine
    -- version upgrades after launch.
    CreateCluster -> Maybe Bool
autoMinorVersionUpgrade :: Prelude.Maybe Prelude.Bool,
    -- | Enables data tiering. Data tiering is only supported for clusters using
    -- the r6gd node type. This parameter must be set when using r6gd nodes.
    -- For more information, see
    -- <https://docs.aws.amazon.com/memorydb/latest/devguide/data-tiering.html Data tiering>.
    CreateCluster -> Maybe Bool
dataTiering :: Prelude.Maybe Prelude.Bool,
    -- | An optional description of the cluster.
    CreateCluster -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The version number of the Redis engine to be used for the cluster.
    CreateCluster -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | The ID of the KMS key used to encrypt the cluster.
    CreateCluster -> Maybe Text
kmsKeyId :: 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@
    CreateCluster -> Maybe Text
maintenanceWindow :: Prelude.Maybe Prelude.Text,
    -- | The number of replicas to apply to each shard. The default value is 1.
    -- The maximum is 5.
    CreateCluster -> Maybe Int
numReplicasPerShard :: Prelude.Maybe Prelude.Int,
    -- | The number of shards the cluster will contain. The default value is 1.
    CreateCluster -> Maybe Int
numShards :: Prelude.Maybe Prelude.Int,
    -- | The name of the parameter group associated with the cluster.
    CreateCluster -> Maybe Text
parameterGroupName :: Prelude.Maybe Prelude.Text,
    -- | The port number on which each of the nodes accepts connections.
    CreateCluster -> Maybe Int
port :: Prelude.Maybe Prelude.Int,
    -- | A list of security group names to associate with this cluster.
    CreateCluster -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | A list of Amazon Resource Names (ARN) that uniquely identify the RDB
    -- snapshot files stored in Amazon S3. The snapshot files are used to
    -- populate the new cluster. The Amazon S3 object name in the ARN cannot
    -- contain any commas.
    CreateCluster -> Maybe [Text]
snapshotArns :: Prelude.Maybe [Prelude.Text],
    -- | The name of a snapshot from which to restore data into the new cluster.
    -- The snapshot status changes to restoring while the new cluster is being
    -- created.
    CreateCluster -> Maybe Text
snapshotName :: Prelude.Maybe Prelude.Text,
    -- | The number of days for which MemoryDB retains automatic 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.
    CreateCluster -> Maybe Int
snapshotRetentionLimit :: Prelude.Maybe Prelude.Int,
    -- | The daily time range (in UTC) during which MemoryDB begins taking a
    -- daily snapshot of your shard.
    --
    -- Example: 05:00-09:00
    --
    -- If you do not specify this parameter, MemoryDB automatically chooses an
    -- appropriate time range.
    CreateCluster -> Maybe Text
snapshotWindow :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Amazon Simple Notification Service
    -- (SNS) topic to which notifications are sent.
    CreateCluster -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the subnet group to be used for the cluster.
    CreateCluster -> Maybe Text
subnetGroupName :: Prelude.Maybe Prelude.Text,
    -- | A flag to enable in-transit encryption on the cluster.
    CreateCluster -> Maybe Bool
tLSEnabled :: Prelude.Maybe Prelude.Bool,
    -- | A list of tags to be added to this resource. Tags are comma-separated
    -- key,value pairs (e.g. Key=myKey, Value=myKeyValue. You can include
    -- multiple tags as shown following: Key=myKey, Value=myKeyValue
    -- Key=mySecondKey, Value=mySecondKeyValue.
    CreateCluster -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the cluster. This value must be unique as it also serves as
    -- the cluster identifier.
    CreateCluster -> Text
clusterName :: Prelude.Text,
    -- | The compute and memory capacity of the nodes in the cluster.
    CreateCluster -> Text
nodeType :: Prelude.Text,
    -- | The name of the Access Control List to associate with the cluster.
    CreateCluster -> Text
aCLName :: Prelude.Text
  }
  deriving (CreateCluster -> CreateCluster -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCluster -> CreateCluster -> Bool
$c/= :: CreateCluster -> CreateCluster -> Bool
== :: CreateCluster -> CreateCluster -> Bool
$c== :: CreateCluster -> CreateCluster -> Bool
Prelude.Eq, ReadPrec [CreateCluster]
ReadPrec CreateCluster
Int -> ReadS CreateCluster
ReadS [CreateCluster]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCluster]
$creadListPrec :: ReadPrec [CreateCluster]
readPrec :: ReadPrec CreateCluster
$creadPrec :: ReadPrec CreateCluster
readList :: ReadS [CreateCluster]
$creadList :: ReadS [CreateCluster]
readsPrec :: Int -> ReadS CreateCluster
$creadsPrec :: Int -> ReadS CreateCluster
Prelude.Read, Int -> CreateCluster -> ShowS
[CreateCluster] -> ShowS
CreateCluster -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCluster] -> ShowS
$cshowList :: [CreateCluster] -> ShowS
show :: CreateCluster -> String
$cshow :: CreateCluster -> String
showsPrec :: Int -> CreateCluster -> ShowS
$cshowsPrec :: Int -> CreateCluster -> ShowS
Prelude.Show, forall x. Rep CreateCluster x -> CreateCluster
forall x. CreateCluster -> Rep CreateCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCluster x -> CreateCluster
$cfrom :: forall x. CreateCluster -> Rep CreateCluster x
Prelude.Generic)

-- |
-- Create a value of 'CreateCluster' 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:
--
-- 'autoMinorVersionUpgrade', 'createCluster_autoMinorVersionUpgrade' - When set to true, the cluster will automatically receive minor engine
-- version upgrades after launch.
--
-- 'dataTiering', 'createCluster_dataTiering' - Enables data tiering. Data tiering is only supported for clusters using
-- the r6gd node type. This parameter must be set when using r6gd nodes.
-- For more information, see
-- <https://docs.aws.amazon.com/memorydb/latest/devguide/data-tiering.html Data tiering>.
--
-- 'description', 'createCluster_description' - An optional description of the cluster.
--
-- 'engineVersion', 'createCluster_engineVersion' - The version number of the Redis engine to be used for the cluster.
--
-- 'kmsKeyId', 'createCluster_kmsKeyId' - The ID of the KMS key used to encrypt the cluster.
--
-- 'maintenanceWindow', 'createCluster_maintenanceWindow' - 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@
--
-- 'numReplicasPerShard', 'createCluster_numReplicasPerShard' - The number of replicas to apply to each shard. The default value is 1.
-- The maximum is 5.
--
-- 'numShards', 'createCluster_numShards' - The number of shards the cluster will contain. The default value is 1.
--
-- 'parameterGroupName', 'createCluster_parameterGroupName' - The name of the parameter group associated with the cluster.
--
-- 'port', 'createCluster_port' - The port number on which each of the nodes accepts connections.
--
-- 'securityGroupIds', 'createCluster_securityGroupIds' - A list of security group names to associate with this cluster.
--
-- 'snapshotArns', 'createCluster_snapshotArns' - A list of Amazon Resource Names (ARN) that uniquely identify the RDB
-- snapshot files stored in Amazon S3. The snapshot files are used to
-- populate the new cluster. The Amazon S3 object name in the ARN cannot
-- contain any commas.
--
-- 'snapshotName', 'createCluster_snapshotName' - The name of a snapshot from which to restore data into the new cluster.
-- The snapshot status changes to restoring while the new cluster is being
-- created.
--
-- 'snapshotRetentionLimit', 'createCluster_snapshotRetentionLimit' - The number of days for which MemoryDB retains automatic 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.
--
-- 'snapshotWindow', 'createCluster_snapshotWindow' - The daily time range (in UTC) during which MemoryDB begins taking a
-- daily snapshot of your shard.
--
-- Example: 05:00-09:00
--
-- If you do not specify this parameter, MemoryDB automatically chooses an
-- appropriate time range.
--
-- 'snsTopicArn', 'createCluster_snsTopicArn' - The Amazon Resource Name (ARN) of the Amazon Simple Notification Service
-- (SNS) topic to which notifications are sent.
--
-- 'subnetGroupName', 'createCluster_subnetGroupName' - The name of the subnet group to be used for the cluster.
--
-- 'tLSEnabled', 'createCluster_tLSEnabled' - A flag to enable in-transit encryption on the cluster.
--
-- 'tags', 'createCluster_tags' - A list of tags to be added to this resource. Tags are comma-separated
-- key,value pairs (e.g. Key=myKey, Value=myKeyValue. You can include
-- multiple tags as shown following: Key=myKey, Value=myKeyValue
-- Key=mySecondKey, Value=mySecondKeyValue.
--
-- 'clusterName', 'createCluster_clusterName' - The name of the cluster. This value must be unique as it also serves as
-- the cluster identifier.
--
-- 'nodeType', 'createCluster_nodeType' - The compute and memory capacity of the nodes in the cluster.
--
-- 'aCLName', 'createCluster_aCLName' - The name of the Access Control List to associate with the cluster.
newCreateCluster ::
  -- | 'clusterName'
  Prelude.Text ->
  -- | 'nodeType'
  Prelude.Text ->
  -- | 'aCLName'
  Prelude.Text ->
  CreateCluster
newCreateCluster :: Text -> Text -> Text -> CreateCluster
newCreateCluster Text
pClusterName_ Text
pNodeType_ Text
pACLName_ =
  CreateCluster'
    { $sel:autoMinorVersionUpgrade:CreateCluster' :: Maybe Bool
autoMinorVersionUpgrade =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dataTiering:CreateCluster' :: Maybe Bool
dataTiering = forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateCluster' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:engineVersion:CreateCluster' :: Maybe Text
engineVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:CreateCluster' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
      $sel:maintenanceWindow:CreateCluster' :: Maybe Text
maintenanceWindow = forall a. Maybe a
Prelude.Nothing,
      $sel:numReplicasPerShard:CreateCluster' :: Maybe Int
numReplicasPerShard = forall a. Maybe a
Prelude.Nothing,
      $sel:numShards:CreateCluster' :: Maybe Int
numShards = forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupName:CreateCluster' :: Maybe Text
parameterGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:port:CreateCluster' :: Maybe Int
port = forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroupIds:CreateCluster' :: Maybe [Text]
securityGroupIds = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotArns:CreateCluster' :: Maybe [Text]
snapshotArns = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotName:CreateCluster' :: Maybe Text
snapshotName = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotRetentionLimit:CreateCluster' :: Maybe Int
snapshotRetentionLimit = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotWindow:CreateCluster' :: Maybe Text
snapshotWindow = forall a. Maybe a
Prelude.Nothing,
      $sel:snsTopicArn:CreateCluster' :: Maybe Text
snsTopicArn = forall a. Maybe a
Prelude.Nothing,
      $sel:subnetGroupName:CreateCluster' :: Maybe Text
subnetGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:tLSEnabled:CreateCluster' :: Maybe Bool
tLSEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateCluster' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:clusterName:CreateCluster' :: Text
clusterName = Text
pClusterName_,
      $sel:nodeType:CreateCluster' :: Text
nodeType = Text
pNodeType_,
      $sel:aCLName:CreateCluster' :: Text
aCLName = Text
pACLName_
    }

-- | When set to true, the cluster will automatically receive minor engine
-- version upgrades after launch.
createCluster_autoMinorVersionUpgrade :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Bool)
createCluster_autoMinorVersionUpgrade :: Lens' CreateCluster (Maybe Bool)
createCluster_autoMinorVersionUpgrade = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Bool
autoMinorVersionUpgrade :: Maybe Bool
$sel:autoMinorVersionUpgrade:CreateCluster' :: CreateCluster -> Maybe Bool
autoMinorVersionUpgrade} -> Maybe Bool
autoMinorVersionUpgrade) (\s :: CreateCluster
s@CreateCluster' {} Maybe Bool
a -> CreateCluster
s {$sel:autoMinorVersionUpgrade:CreateCluster' :: Maybe Bool
autoMinorVersionUpgrade = Maybe Bool
a} :: CreateCluster)

-- | Enables data tiering. Data tiering is only supported for clusters using
-- the r6gd node type. This parameter must be set when using r6gd nodes.
-- For more information, see
-- <https://docs.aws.amazon.com/memorydb/latest/devguide/data-tiering.html Data tiering>.
createCluster_dataTiering :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Bool)
createCluster_dataTiering :: Lens' CreateCluster (Maybe Bool)
createCluster_dataTiering = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Bool
dataTiering :: Maybe Bool
$sel:dataTiering:CreateCluster' :: CreateCluster -> Maybe Bool
dataTiering} -> Maybe Bool
dataTiering) (\s :: CreateCluster
s@CreateCluster' {} Maybe Bool
a -> CreateCluster
s {$sel:dataTiering:CreateCluster' :: Maybe Bool
dataTiering = Maybe Bool
a} :: CreateCluster)

-- | An optional description of the cluster.
createCluster_description :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_description :: Lens' CreateCluster (Maybe Text)
createCluster_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
description :: Maybe Text
$sel:description:CreateCluster' :: CreateCluster -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:description:CreateCluster' :: Maybe Text
description = Maybe Text
a} :: CreateCluster)

-- | The version number of the Redis engine to be used for the cluster.
createCluster_engineVersion :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_engineVersion :: Lens' CreateCluster (Maybe Text)
createCluster_engineVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:CreateCluster' :: CreateCluster -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:engineVersion:CreateCluster' :: Maybe Text
engineVersion = Maybe Text
a} :: CreateCluster)

-- | The ID of the KMS key used to encrypt the cluster.
createCluster_kmsKeyId :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_kmsKeyId :: Lens' CreateCluster (Maybe Text)
createCluster_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:CreateCluster' :: CreateCluster -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:kmsKeyId:CreateCluster' :: Maybe Text
kmsKeyId = Maybe Text
a} :: CreateCluster)

-- | 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@
createCluster_maintenanceWindow :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_maintenanceWindow :: Lens' CreateCluster (Maybe Text)
createCluster_maintenanceWindow = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
maintenanceWindow :: Maybe Text
$sel:maintenanceWindow:CreateCluster' :: CreateCluster -> Maybe Text
maintenanceWindow} -> Maybe Text
maintenanceWindow) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:maintenanceWindow:CreateCluster' :: Maybe Text
maintenanceWindow = Maybe Text
a} :: CreateCluster)

-- | The number of replicas to apply to each shard. The default value is 1.
-- The maximum is 5.
createCluster_numReplicasPerShard :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Int)
createCluster_numReplicasPerShard :: Lens' CreateCluster (Maybe Int)
createCluster_numReplicasPerShard = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Int
numReplicasPerShard :: Maybe Int
$sel:numReplicasPerShard:CreateCluster' :: CreateCluster -> Maybe Int
numReplicasPerShard} -> Maybe Int
numReplicasPerShard) (\s :: CreateCluster
s@CreateCluster' {} Maybe Int
a -> CreateCluster
s {$sel:numReplicasPerShard:CreateCluster' :: Maybe Int
numReplicasPerShard = Maybe Int
a} :: CreateCluster)

-- | The number of shards the cluster will contain. The default value is 1.
createCluster_numShards :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Int)
createCluster_numShards :: Lens' CreateCluster (Maybe Int)
createCluster_numShards = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Int
numShards :: Maybe Int
$sel:numShards:CreateCluster' :: CreateCluster -> Maybe Int
numShards} -> Maybe Int
numShards) (\s :: CreateCluster
s@CreateCluster' {} Maybe Int
a -> CreateCluster
s {$sel:numShards:CreateCluster' :: Maybe Int
numShards = Maybe Int
a} :: CreateCluster)

-- | The name of the parameter group associated with the cluster.
createCluster_parameterGroupName :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_parameterGroupName :: Lens' CreateCluster (Maybe Text)
createCluster_parameterGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
parameterGroupName :: Maybe Text
$sel:parameterGroupName:CreateCluster' :: CreateCluster -> Maybe Text
parameterGroupName} -> Maybe Text
parameterGroupName) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:parameterGroupName:CreateCluster' :: Maybe Text
parameterGroupName = Maybe Text
a} :: CreateCluster)

-- | The port number on which each of the nodes accepts connections.
createCluster_port :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Int)
createCluster_port :: Lens' CreateCluster (Maybe Int)
createCluster_port = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Int
port :: Maybe Int
$sel:port:CreateCluster' :: CreateCluster -> Maybe Int
port} -> Maybe Int
port) (\s :: CreateCluster
s@CreateCluster' {} Maybe Int
a -> CreateCluster
s {$sel:port:CreateCluster' :: Maybe Int
port = Maybe Int
a} :: CreateCluster)

-- | A list of security group names to associate with this cluster.
createCluster_securityGroupIds :: Lens.Lens' CreateCluster (Prelude.Maybe [Prelude.Text])
createCluster_securityGroupIds :: Lens' CreateCluster (Maybe [Text])
createCluster_securityGroupIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:CreateCluster' :: CreateCluster -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: CreateCluster
s@CreateCluster' {} Maybe [Text]
a -> CreateCluster
s {$sel:securityGroupIds:CreateCluster' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: CreateCluster) 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 list of Amazon Resource Names (ARN) that uniquely identify the RDB
-- snapshot files stored in Amazon S3. The snapshot files are used to
-- populate the new cluster. The Amazon S3 object name in the ARN cannot
-- contain any commas.
createCluster_snapshotArns :: Lens.Lens' CreateCluster (Prelude.Maybe [Prelude.Text])
createCluster_snapshotArns :: Lens' CreateCluster (Maybe [Text])
createCluster_snapshotArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe [Text]
snapshotArns :: Maybe [Text]
$sel:snapshotArns:CreateCluster' :: CreateCluster -> Maybe [Text]
snapshotArns} -> Maybe [Text]
snapshotArns) (\s :: CreateCluster
s@CreateCluster' {} Maybe [Text]
a -> CreateCluster
s {$sel:snapshotArns:CreateCluster' :: Maybe [Text]
snapshotArns = Maybe [Text]
a} :: CreateCluster) 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 name of a snapshot from which to restore data into the new cluster.
-- The snapshot status changes to restoring while the new cluster is being
-- created.
createCluster_snapshotName :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_snapshotName :: Lens' CreateCluster (Maybe Text)
createCluster_snapshotName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
snapshotName :: Maybe Text
$sel:snapshotName:CreateCluster' :: CreateCluster -> Maybe Text
snapshotName} -> Maybe Text
snapshotName) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:snapshotName:CreateCluster' :: Maybe Text
snapshotName = Maybe Text
a} :: CreateCluster)

-- | The number of days for which MemoryDB retains automatic 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.
createCluster_snapshotRetentionLimit :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Int)
createCluster_snapshotRetentionLimit :: Lens' CreateCluster (Maybe Int)
createCluster_snapshotRetentionLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Int
snapshotRetentionLimit :: Maybe Int
$sel:snapshotRetentionLimit:CreateCluster' :: CreateCluster -> Maybe Int
snapshotRetentionLimit} -> Maybe Int
snapshotRetentionLimit) (\s :: CreateCluster
s@CreateCluster' {} Maybe Int
a -> CreateCluster
s {$sel:snapshotRetentionLimit:CreateCluster' :: Maybe Int
snapshotRetentionLimit = Maybe Int
a} :: CreateCluster)

-- | The daily time range (in UTC) during which MemoryDB begins taking a
-- daily snapshot of your shard.
--
-- Example: 05:00-09:00
--
-- If you do not specify this parameter, MemoryDB automatically chooses an
-- appropriate time range.
createCluster_snapshotWindow :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_snapshotWindow :: Lens' CreateCluster (Maybe Text)
createCluster_snapshotWindow = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
snapshotWindow :: Maybe Text
$sel:snapshotWindow:CreateCluster' :: CreateCluster -> Maybe Text
snapshotWindow} -> Maybe Text
snapshotWindow) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:snapshotWindow:CreateCluster' :: Maybe Text
snapshotWindow = Maybe Text
a} :: CreateCluster)

-- | The Amazon Resource Name (ARN) of the Amazon Simple Notification Service
-- (SNS) topic to which notifications are sent.
createCluster_snsTopicArn :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_snsTopicArn :: Lens' CreateCluster (Maybe Text)
createCluster_snsTopicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
snsTopicArn :: Maybe Text
$sel:snsTopicArn:CreateCluster' :: CreateCluster -> Maybe Text
snsTopicArn} -> Maybe Text
snsTopicArn) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:snsTopicArn:CreateCluster' :: Maybe Text
snsTopicArn = Maybe Text
a} :: CreateCluster)

-- | The name of the subnet group to be used for the cluster.
createCluster_subnetGroupName :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_subnetGroupName :: Lens' CreateCluster (Maybe Text)
createCluster_subnetGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
subnetGroupName :: Maybe Text
$sel:subnetGroupName:CreateCluster' :: CreateCluster -> Maybe Text
subnetGroupName} -> Maybe Text
subnetGroupName) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:subnetGroupName:CreateCluster' :: Maybe Text
subnetGroupName = Maybe Text
a} :: CreateCluster)

-- | A flag to enable in-transit encryption on the cluster.
createCluster_tLSEnabled :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Bool)
createCluster_tLSEnabled :: Lens' CreateCluster (Maybe Bool)
createCluster_tLSEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Bool
tLSEnabled :: Maybe Bool
$sel:tLSEnabled:CreateCluster' :: CreateCluster -> Maybe Bool
tLSEnabled} -> Maybe Bool
tLSEnabled) (\s :: CreateCluster
s@CreateCluster' {} Maybe Bool
a -> CreateCluster
s {$sel:tLSEnabled:CreateCluster' :: Maybe Bool
tLSEnabled = Maybe Bool
a} :: CreateCluster)

-- | A list of tags to be added to this resource. Tags are comma-separated
-- key,value pairs (e.g. Key=myKey, Value=myKeyValue. You can include
-- multiple tags as shown following: Key=myKey, Value=myKeyValue
-- Key=mySecondKey, Value=mySecondKeyValue.
createCluster_tags :: Lens.Lens' CreateCluster (Prelude.Maybe [Tag])
createCluster_tags :: Lens' CreateCluster (Maybe [Tag])
createCluster_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateCluster' :: CreateCluster -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateCluster
s@CreateCluster' {} Maybe [Tag]
a -> CreateCluster
s {$sel:tags:CreateCluster' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateCluster) 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 name of the cluster. This value must be unique as it also serves as
-- the cluster identifier.
createCluster_clusterName :: Lens.Lens' CreateCluster Prelude.Text
createCluster_clusterName :: Lens' CreateCluster Text
createCluster_clusterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Text
clusterName :: Text
$sel:clusterName:CreateCluster' :: CreateCluster -> Text
clusterName} -> Text
clusterName) (\s :: CreateCluster
s@CreateCluster' {} Text
a -> CreateCluster
s {$sel:clusterName:CreateCluster' :: Text
clusterName = Text
a} :: CreateCluster)

-- | The compute and memory capacity of the nodes in the cluster.
createCluster_nodeType :: Lens.Lens' CreateCluster Prelude.Text
createCluster_nodeType :: Lens' CreateCluster Text
createCluster_nodeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Text
nodeType :: Text
$sel:nodeType:CreateCluster' :: CreateCluster -> Text
nodeType} -> Text
nodeType) (\s :: CreateCluster
s@CreateCluster' {} Text
a -> CreateCluster
s {$sel:nodeType:CreateCluster' :: Text
nodeType = Text
a} :: CreateCluster)

-- | The name of the Access Control List to associate with the cluster.
createCluster_aCLName :: Lens.Lens' CreateCluster Prelude.Text
createCluster_aCLName :: Lens' CreateCluster Text
createCluster_aCLName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Text
aCLName :: Text
$sel:aCLName:CreateCluster' :: CreateCluster -> Text
aCLName} -> Text
aCLName) (\s :: CreateCluster
s@CreateCluster' {} Text
a -> CreateCluster
s {$sel:aCLName:CreateCluster' :: Text
aCLName = Text
a} :: CreateCluster)

instance Core.AWSRequest CreateCluster where
  type
    AWSResponse CreateCluster =
      CreateClusterResponse
  request :: (Service -> Service) -> CreateCluster -> Request CreateCluster
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateCluster)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Cluster -> Int -> CreateClusterResponse
CreateClusterResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Cluster")
            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 CreateCluster where
  hashWithSalt :: Int -> CreateCluster -> Int
hashWithSalt Int
_salt CreateCluster' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Text
aCLName :: Text
nodeType :: Text
clusterName :: Text
tags :: Maybe [Tag]
tLSEnabled :: Maybe Bool
subnetGroupName :: Maybe Text
snsTopicArn :: Maybe Text
snapshotWindow :: Maybe Text
snapshotRetentionLimit :: Maybe Int
snapshotName :: Maybe Text
snapshotArns :: Maybe [Text]
securityGroupIds :: Maybe [Text]
port :: Maybe Int
parameterGroupName :: Maybe Text
numShards :: Maybe Int
numReplicasPerShard :: Maybe Int
maintenanceWindow :: Maybe Text
kmsKeyId :: Maybe Text
engineVersion :: Maybe Text
description :: Maybe Text
dataTiering :: Maybe Bool
autoMinorVersionUpgrade :: Maybe Bool
$sel:aCLName:CreateCluster' :: CreateCluster -> Text
$sel:nodeType:CreateCluster' :: CreateCluster -> Text
$sel:clusterName:CreateCluster' :: CreateCluster -> Text
$sel:tags:CreateCluster' :: CreateCluster -> Maybe [Tag]
$sel:tLSEnabled:CreateCluster' :: CreateCluster -> Maybe Bool
$sel:subnetGroupName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snsTopicArn:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snapshotWindow:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snapshotRetentionLimit:CreateCluster' :: CreateCluster -> Maybe Int
$sel:snapshotName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snapshotArns:CreateCluster' :: CreateCluster -> Maybe [Text]
$sel:securityGroupIds:CreateCluster' :: CreateCluster -> Maybe [Text]
$sel:port:CreateCluster' :: CreateCluster -> Maybe Int
$sel:parameterGroupName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:numShards:CreateCluster' :: CreateCluster -> Maybe Int
$sel:numReplicasPerShard:CreateCluster' :: CreateCluster -> Maybe Int
$sel:maintenanceWindow:CreateCluster' :: CreateCluster -> Maybe Text
$sel:kmsKeyId:CreateCluster' :: CreateCluster -> Maybe Text
$sel:engineVersion:CreateCluster' :: CreateCluster -> Maybe Text
$sel:description:CreateCluster' :: CreateCluster -> Maybe Text
$sel:dataTiering:CreateCluster' :: CreateCluster -> Maybe Bool
$sel:autoMinorVersionUpgrade:CreateCluster' :: CreateCluster -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
autoMinorVersionUpgrade
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dataTiering
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
engineVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maintenanceWindow
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numReplicasPerShard
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numShards
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
port
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
securityGroupIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
snapshotArns
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotName
      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` Maybe Text
snsTopicArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subnetGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
tLSEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clusterName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
nodeType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
aCLName

instance Prelude.NFData CreateCluster where
  rnf :: CreateCluster -> ()
rnf CreateCluster' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Text
aCLName :: Text
nodeType :: Text
clusterName :: Text
tags :: Maybe [Tag]
tLSEnabled :: Maybe Bool
subnetGroupName :: Maybe Text
snsTopicArn :: Maybe Text
snapshotWindow :: Maybe Text
snapshotRetentionLimit :: Maybe Int
snapshotName :: Maybe Text
snapshotArns :: Maybe [Text]
securityGroupIds :: Maybe [Text]
port :: Maybe Int
parameterGroupName :: Maybe Text
numShards :: Maybe Int
numReplicasPerShard :: Maybe Int
maintenanceWindow :: Maybe Text
kmsKeyId :: Maybe Text
engineVersion :: Maybe Text
description :: Maybe Text
dataTiering :: Maybe Bool
autoMinorVersionUpgrade :: Maybe Bool
$sel:aCLName:CreateCluster' :: CreateCluster -> Text
$sel:nodeType:CreateCluster' :: CreateCluster -> Text
$sel:clusterName:CreateCluster' :: CreateCluster -> Text
$sel:tags:CreateCluster' :: CreateCluster -> Maybe [Tag]
$sel:tLSEnabled:CreateCluster' :: CreateCluster -> Maybe Bool
$sel:subnetGroupName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snsTopicArn:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snapshotWindow:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snapshotRetentionLimit:CreateCluster' :: CreateCluster -> Maybe Int
$sel:snapshotName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snapshotArns:CreateCluster' :: CreateCluster -> Maybe [Text]
$sel:securityGroupIds:CreateCluster' :: CreateCluster -> Maybe [Text]
$sel:port:CreateCluster' :: CreateCluster -> Maybe Int
$sel:parameterGroupName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:numShards:CreateCluster' :: CreateCluster -> Maybe Int
$sel:numReplicasPerShard:CreateCluster' :: CreateCluster -> Maybe Int
$sel:maintenanceWindow:CreateCluster' :: CreateCluster -> Maybe Text
$sel:kmsKeyId:CreateCluster' :: CreateCluster -> Maybe Text
$sel:engineVersion:CreateCluster' :: CreateCluster -> Maybe Text
$sel:description:CreateCluster' :: CreateCluster -> Maybe Text
$sel:dataTiering:CreateCluster' :: CreateCluster -> Maybe Bool
$sel:autoMinorVersionUpgrade:CreateCluster' :: CreateCluster -> Maybe Bool
..} =
    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 Bool
dataTiering
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      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 Text
kmsKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maintenanceWindow
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
numReplicasPerShard
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
numShards
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
port
      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 [Text]
snapshotArns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotName
      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 Maybe Text
snsTopicArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subnetGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
tLSEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clusterName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
nodeType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
aCLName

instance Data.ToHeaders CreateCluster where
  toHeaders :: CreateCluster -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonMemoryDB.CreateCluster" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateCluster where
  toJSON :: CreateCluster -> Value
toJSON CreateCluster' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Tag]
Maybe Text
Text
aCLName :: Text
nodeType :: Text
clusterName :: Text
tags :: Maybe [Tag]
tLSEnabled :: Maybe Bool
subnetGroupName :: Maybe Text
snsTopicArn :: Maybe Text
snapshotWindow :: Maybe Text
snapshotRetentionLimit :: Maybe Int
snapshotName :: Maybe Text
snapshotArns :: Maybe [Text]
securityGroupIds :: Maybe [Text]
port :: Maybe Int
parameterGroupName :: Maybe Text
numShards :: Maybe Int
numReplicasPerShard :: Maybe Int
maintenanceWindow :: Maybe Text
kmsKeyId :: Maybe Text
engineVersion :: Maybe Text
description :: Maybe Text
dataTiering :: Maybe Bool
autoMinorVersionUpgrade :: Maybe Bool
$sel:aCLName:CreateCluster' :: CreateCluster -> Text
$sel:nodeType:CreateCluster' :: CreateCluster -> Text
$sel:clusterName:CreateCluster' :: CreateCluster -> Text
$sel:tags:CreateCluster' :: CreateCluster -> Maybe [Tag]
$sel:tLSEnabled:CreateCluster' :: CreateCluster -> Maybe Bool
$sel:subnetGroupName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snsTopicArn:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snapshotWindow:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snapshotRetentionLimit:CreateCluster' :: CreateCluster -> Maybe Int
$sel:snapshotName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:snapshotArns:CreateCluster' :: CreateCluster -> Maybe [Text]
$sel:securityGroupIds:CreateCluster' :: CreateCluster -> Maybe [Text]
$sel:port:CreateCluster' :: CreateCluster -> Maybe Int
$sel:parameterGroupName:CreateCluster' :: CreateCluster -> Maybe Text
$sel:numShards:CreateCluster' :: CreateCluster -> Maybe Int
$sel:numReplicasPerShard:CreateCluster' :: CreateCluster -> Maybe Int
$sel:maintenanceWindow:CreateCluster' :: CreateCluster -> Maybe Text
$sel:kmsKeyId:CreateCluster' :: CreateCluster -> Maybe Text
$sel:engineVersion:CreateCluster' :: CreateCluster -> Maybe Text
$sel:description:CreateCluster' :: CreateCluster -> Maybe Text
$sel:dataTiering:CreateCluster' :: CreateCluster -> Maybe Bool
$sel:autoMinorVersionUpgrade:CreateCluster' :: CreateCluster -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AutoMinorVersionUpgrade" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
autoMinorVersionUpgrade,
            (Key
"DataTiering" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
dataTiering,
            (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"EngineVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
engineVersion,
            (Key
"KmsKeyId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
            (Key
"MaintenanceWindow" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
maintenanceWindow,
            (Key
"NumReplicasPerShard" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
numReplicasPerShard,
            (Key
"NumShards" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
numShards,
            (Key
"ParameterGroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameterGroupName,
            (Key
"Port" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
port,
            (Key
"SecurityGroupIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroupIds,
            (Key
"SnapshotArns" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
snapshotArns,
            (Key
"SnapshotName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
snapshotName,
            (Key
"SnapshotRetentionLimit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
snapshotRetentionLimit,
            (Key
"SnapshotWindow" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
snapshotWindow,
            (Key
"SnsTopicArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
snsTopicArn,
            (Key
"SubnetGroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
subnetGroupName,
            (Key
"TLSEnabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
tLSEnabled,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"ClusterName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clusterName),
            forall a. a -> Maybe a
Prelude.Just (Key
"NodeType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
nodeType),
            forall a. a -> Maybe a
Prelude.Just (Key
"ACLName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
aCLName)
          ]
      )

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

instance Data.ToQuery CreateCluster where
  toQuery :: CreateCluster -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

-- |
-- Create a value of 'CreateClusterResponse' 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:
--
-- 'cluster', 'createClusterResponse_cluster' - The newly-created cluster.
--
-- 'httpStatus', 'createClusterResponse_httpStatus' - The response's http status code.
newCreateClusterResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateClusterResponse
newCreateClusterResponse :: Int -> CreateClusterResponse
newCreateClusterResponse Int
pHttpStatus_ =
  CreateClusterResponse'
    { $sel:cluster:CreateClusterResponse' :: Maybe Cluster
cluster = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The newly-created cluster.
createClusterResponse_cluster :: Lens.Lens' CreateClusterResponse (Prelude.Maybe Cluster)
createClusterResponse_cluster :: Lens' CreateClusterResponse (Maybe Cluster)
createClusterResponse_cluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:CreateClusterResponse' :: CreateClusterResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: CreateClusterResponse
s@CreateClusterResponse' {} Maybe Cluster
a -> CreateClusterResponse
s {$sel:cluster:CreateClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: CreateClusterResponse)

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

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