{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.ClusterConfiguration
-- 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)
module Amazonka.MemoryDb.Types.ClusterConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types.ShardDetail
import qualified Amazonka.Prelude as Prelude

-- | A list of cluster configuration options.
--
-- /See:/ 'newClusterConfiguration' smart constructor.
data ClusterConfiguration = ClusterConfiguration'
  { -- | The Redis engine version used by the cluster
    ClusterConfiguration -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | The ID of the VPC the cluster belongs to
    ClusterConfiguration -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The snapshot window set by the cluster
    ClusterConfiguration -> Maybe Text
snapshotWindow :: Prelude.Maybe Prelude.Text,
    -- | The name of the subnet group used by the cluster
    ClusterConfiguration -> Maybe Text
subnetGroupName :: Prelude.Maybe Prelude.Text,
    -- | The number of shards in the cluster
    ClusterConfiguration -> Maybe Int
numShards :: Prelude.Maybe Prelude.Int,
    -- | The specified maintenance window for the cluster
    ClusterConfiguration -> Maybe Text
maintenanceWindow :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the SNS notification topic for the
    -- cluster
    ClusterConfiguration -> Maybe Text
topicArn :: Prelude.Maybe Prelude.Text,
    -- | The list of shards in the cluster
    ClusterConfiguration -> Maybe [ShardDetail]
shards :: Prelude.Maybe [ShardDetail],
    -- | The name of the cluster
    ClusterConfiguration -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The snapshot retention limit set by the cluster
    ClusterConfiguration -> Maybe Int
snapshotRetentionLimit :: Prelude.Maybe Prelude.Int,
    -- | The node type used for the cluster
    ClusterConfiguration -> Maybe Text
nodeType :: Prelude.Maybe Prelude.Text,
    -- | The description of the cluster configuration
    ClusterConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The port used by the cluster
    ClusterConfiguration -> Maybe Int
port :: Prelude.Maybe Prelude.Int,
    -- | The name of parameter group used by the cluster
    ClusterConfiguration -> Maybe Text
parameterGroupName :: Prelude.Maybe Prelude.Text
  }
  deriving (ClusterConfiguration -> ClusterConfiguration -> Bool
(ClusterConfiguration -> ClusterConfiguration -> Bool)
-> (ClusterConfiguration -> ClusterConfiguration -> Bool)
-> Eq ClusterConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterConfiguration -> ClusterConfiguration -> Bool
$c/= :: ClusterConfiguration -> ClusterConfiguration -> Bool
== :: ClusterConfiguration -> ClusterConfiguration -> Bool
$c== :: ClusterConfiguration -> ClusterConfiguration -> Bool
Prelude.Eq, ReadPrec [ClusterConfiguration]
ReadPrec ClusterConfiguration
Int -> ReadS ClusterConfiguration
ReadS [ClusterConfiguration]
(Int -> ReadS ClusterConfiguration)
-> ReadS [ClusterConfiguration]
-> ReadPrec ClusterConfiguration
-> ReadPrec [ClusterConfiguration]
-> Read ClusterConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterConfiguration]
$creadListPrec :: ReadPrec [ClusterConfiguration]
readPrec :: ReadPrec ClusterConfiguration
$creadPrec :: ReadPrec ClusterConfiguration
readList :: ReadS [ClusterConfiguration]
$creadList :: ReadS [ClusterConfiguration]
readsPrec :: Int -> ReadS ClusterConfiguration
$creadsPrec :: Int -> ReadS ClusterConfiguration
Prelude.Read, Int -> ClusterConfiguration -> ShowS
[ClusterConfiguration] -> ShowS
ClusterConfiguration -> String
(Int -> ClusterConfiguration -> ShowS)
-> (ClusterConfiguration -> String)
-> ([ClusterConfiguration] -> ShowS)
-> Show ClusterConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterConfiguration] -> ShowS
$cshowList :: [ClusterConfiguration] -> ShowS
show :: ClusterConfiguration -> String
$cshow :: ClusterConfiguration -> String
showsPrec :: Int -> ClusterConfiguration -> ShowS
$cshowsPrec :: Int -> ClusterConfiguration -> ShowS
Prelude.Show, (forall x. ClusterConfiguration -> Rep ClusterConfiguration x)
-> (forall x. Rep ClusterConfiguration x -> ClusterConfiguration)
-> Generic ClusterConfiguration
forall x. Rep ClusterConfiguration x -> ClusterConfiguration
forall x. ClusterConfiguration -> Rep ClusterConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterConfiguration x -> ClusterConfiguration
$cfrom :: forall x. ClusterConfiguration -> Rep ClusterConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ClusterConfiguration' 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', 'clusterConfiguration_engineVersion' - The Redis engine version used by the cluster
--
-- 'vpcId', 'clusterConfiguration_vpcId' - The ID of the VPC the cluster belongs to
--
-- 'snapshotWindow', 'clusterConfiguration_snapshotWindow' - The snapshot window set by the cluster
--
-- 'subnetGroupName', 'clusterConfiguration_subnetGroupName' - The name of the subnet group used by the cluster
--
-- 'numShards', 'clusterConfiguration_numShards' - The number of shards in the cluster
--
-- 'maintenanceWindow', 'clusterConfiguration_maintenanceWindow' - The specified maintenance window for the cluster
--
-- 'topicArn', 'clusterConfiguration_topicArn' - The Amazon Resource Name (ARN) of the SNS notification topic for the
-- cluster
--
-- 'shards', 'clusterConfiguration_shards' - The list of shards in the cluster
--
-- 'name', 'clusterConfiguration_name' - The name of the cluster
--
-- 'snapshotRetentionLimit', 'clusterConfiguration_snapshotRetentionLimit' - The snapshot retention limit set by the cluster
--
-- 'nodeType', 'clusterConfiguration_nodeType' - The node type used for the cluster
--
-- 'description', 'clusterConfiguration_description' - The description of the cluster configuration
--
-- 'port', 'clusterConfiguration_port' - The port used by the cluster
--
-- 'parameterGroupName', 'clusterConfiguration_parameterGroupName' - The name of parameter group used by the cluster
newClusterConfiguration ::
  ClusterConfiguration
newClusterConfiguration :: ClusterConfiguration
newClusterConfiguration =
  ClusterConfiguration' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe [ShardDetail]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ClusterConfiguration
ClusterConfiguration'
    { $sel:engineVersion:ClusterConfiguration' :: Maybe Text
engineVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:ClusterConfiguration' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotWindow:ClusterConfiguration' :: Maybe Text
snapshotWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetGroupName:ClusterConfiguration' :: Maybe Text
subnetGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:numShards:ClusterConfiguration' :: Maybe Int
numShards = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:maintenanceWindow:ClusterConfiguration' :: Maybe Text
maintenanceWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:topicArn:ClusterConfiguration' :: Maybe Text
topicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:shards:ClusterConfiguration' :: Maybe [ShardDetail]
shards = Maybe [ShardDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ClusterConfiguration' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotRetentionLimit:ClusterConfiguration' :: Maybe Int
snapshotRetentionLimit = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:nodeType:ClusterConfiguration' :: Maybe Text
nodeType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ClusterConfiguration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:port:ClusterConfiguration' :: Maybe Int
port = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupName:ClusterConfiguration' :: Maybe Text
parameterGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Redis engine version used by the cluster
clusterConfiguration_engineVersion :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Text)
clusterConfiguration_engineVersion :: (Maybe Text -> f (Maybe Text))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_engineVersion = (ClusterConfiguration -> Maybe Text)
-> (ClusterConfiguration -> Maybe Text -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:ClusterConfiguration' :: ClusterConfiguration -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Text
a -> ClusterConfiguration
s {$sel:engineVersion:ClusterConfiguration' :: Maybe Text
engineVersion = Maybe Text
a} :: ClusterConfiguration)

-- | The ID of the VPC the cluster belongs to
clusterConfiguration_vpcId :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Text)
clusterConfiguration_vpcId :: (Maybe Text -> f (Maybe Text))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_vpcId = (ClusterConfiguration -> Maybe Text)
-> (ClusterConfiguration -> Maybe Text -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:ClusterConfiguration' :: ClusterConfiguration -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Text
a -> ClusterConfiguration
s {$sel:vpcId:ClusterConfiguration' :: Maybe Text
vpcId = Maybe Text
a} :: ClusterConfiguration)

-- | The snapshot window set by the cluster
clusterConfiguration_snapshotWindow :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Text)
clusterConfiguration_snapshotWindow :: (Maybe Text -> f (Maybe Text))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_snapshotWindow = (ClusterConfiguration -> Maybe Text)
-> (ClusterConfiguration -> Maybe Text -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Text
snapshotWindow :: Maybe Text
$sel:snapshotWindow:ClusterConfiguration' :: ClusterConfiguration -> Maybe Text
snapshotWindow} -> Maybe Text
snapshotWindow) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Text
a -> ClusterConfiguration
s {$sel:snapshotWindow:ClusterConfiguration' :: Maybe Text
snapshotWindow = Maybe Text
a} :: ClusterConfiguration)

-- | The name of the subnet group used by the cluster
clusterConfiguration_subnetGroupName :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Text)
clusterConfiguration_subnetGroupName :: (Maybe Text -> f (Maybe Text))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_subnetGroupName = (ClusterConfiguration -> Maybe Text)
-> (ClusterConfiguration -> Maybe Text -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Text
subnetGroupName :: Maybe Text
$sel:subnetGroupName:ClusterConfiguration' :: ClusterConfiguration -> Maybe Text
subnetGroupName} -> Maybe Text
subnetGroupName) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Text
a -> ClusterConfiguration
s {$sel:subnetGroupName:ClusterConfiguration' :: Maybe Text
subnetGroupName = Maybe Text
a} :: ClusterConfiguration)

-- | The number of shards in the cluster
clusterConfiguration_numShards :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Int)
clusterConfiguration_numShards :: (Maybe Int -> f (Maybe Int))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_numShards = (ClusterConfiguration -> Maybe Int)
-> (ClusterConfiguration -> Maybe Int -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Int
numShards :: Maybe Int
$sel:numShards:ClusterConfiguration' :: ClusterConfiguration -> Maybe Int
numShards} -> Maybe Int
numShards) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Int
a -> ClusterConfiguration
s {$sel:numShards:ClusterConfiguration' :: Maybe Int
numShards = Maybe Int
a} :: ClusterConfiguration)

-- | The specified maintenance window for the cluster
clusterConfiguration_maintenanceWindow :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Text)
clusterConfiguration_maintenanceWindow :: (Maybe Text -> f (Maybe Text))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_maintenanceWindow = (ClusterConfiguration -> Maybe Text)
-> (ClusterConfiguration -> Maybe Text -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Text
maintenanceWindow :: Maybe Text
$sel:maintenanceWindow:ClusterConfiguration' :: ClusterConfiguration -> Maybe Text
maintenanceWindow} -> Maybe Text
maintenanceWindow) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Text
a -> ClusterConfiguration
s {$sel:maintenanceWindow:ClusterConfiguration' :: Maybe Text
maintenanceWindow = Maybe Text
a} :: ClusterConfiguration)

-- | The Amazon Resource Name (ARN) of the SNS notification topic for the
-- cluster
clusterConfiguration_topicArn :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Text)
clusterConfiguration_topicArn :: (Maybe Text -> f (Maybe Text))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_topicArn = (ClusterConfiguration -> Maybe Text)
-> (ClusterConfiguration -> Maybe Text -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Text
topicArn :: Maybe Text
$sel:topicArn:ClusterConfiguration' :: ClusterConfiguration -> Maybe Text
topicArn} -> Maybe Text
topicArn) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Text
a -> ClusterConfiguration
s {$sel:topicArn:ClusterConfiguration' :: Maybe Text
topicArn = Maybe Text
a} :: ClusterConfiguration)

-- | The list of shards in the cluster
clusterConfiguration_shards :: Lens.Lens' ClusterConfiguration (Prelude.Maybe [ShardDetail])
clusterConfiguration_shards :: (Maybe [ShardDetail] -> f (Maybe [ShardDetail]))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_shards = (ClusterConfiguration -> Maybe [ShardDetail])
-> (ClusterConfiguration
    -> Maybe [ShardDetail] -> ClusterConfiguration)
-> Lens
     ClusterConfiguration
     ClusterConfiguration
     (Maybe [ShardDetail])
     (Maybe [ShardDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe [ShardDetail]
shards :: Maybe [ShardDetail]
$sel:shards:ClusterConfiguration' :: ClusterConfiguration -> Maybe [ShardDetail]
shards} -> Maybe [ShardDetail]
shards) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe [ShardDetail]
a -> ClusterConfiguration
s {$sel:shards:ClusterConfiguration' :: Maybe [ShardDetail]
shards = Maybe [ShardDetail]
a} :: ClusterConfiguration) ((Maybe [ShardDetail] -> f (Maybe [ShardDetail]))
 -> ClusterConfiguration -> f ClusterConfiguration)
-> ((Maybe [ShardDetail] -> f (Maybe [ShardDetail]))
    -> Maybe [ShardDetail] -> f (Maybe [ShardDetail]))
-> (Maybe [ShardDetail] -> f (Maybe [ShardDetail]))
-> ClusterConfiguration
-> f ClusterConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ShardDetail] [ShardDetail] [ShardDetail] [ShardDetail]
-> Iso
     (Maybe [ShardDetail])
     (Maybe [ShardDetail])
     (Maybe [ShardDetail])
     (Maybe [ShardDetail])
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 [ShardDetail] [ShardDetail] [ShardDetail] [ShardDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the cluster
clusterConfiguration_name :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Text)
clusterConfiguration_name :: (Maybe Text -> f (Maybe Text))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_name = (ClusterConfiguration -> Maybe Text)
-> (ClusterConfiguration -> Maybe Text -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Text
name :: Maybe Text
$sel:name:ClusterConfiguration' :: ClusterConfiguration -> Maybe Text
name} -> Maybe Text
name) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Text
a -> ClusterConfiguration
s {$sel:name:ClusterConfiguration' :: Maybe Text
name = Maybe Text
a} :: ClusterConfiguration)

-- | The snapshot retention limit set by the cluster
clusterConfiguration_snapshotRetentionLimit :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Int)
clusterConfiguration_snapshotRetentionLimit :: (Maybe Int -> f (Maybe Int))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_snapshotRetentionLimit = (ClusterConfiguration -> Maybe Int)
-> (ClusterConfiguration -> Maybe Int -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Int
snapshotRetentionLimit :: Maybe Int
$sel:snapshotRetentionLimit:ClusterConfiguration' :: ClusterConfiguration -> Maybe Int
snapshotRetentionLimit} -> Maybe Int
snapshotRetentionLimit) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Int
a -> ClusterConfiguration
s {$sel:snapshotRetentionLimit:ClusterConfiguration' :: Maybe Int
snapshotRetentionLimit = Maybe Int
a} :: ClusterConfiguration)

-- | The node type used for the cluster
clusterConfiguration_nodeType :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Text)
clusterConfiguration_nodeType :: (Maybe Text -> f (Maybe Text))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_nodeType = (ClusterConfiguration -> Maybe Text)
-> (ClusterConfiguration -> Maybe Text -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Text
nodeType :: Maybe Text
$sel:nodeType:ClusterConfiguration' :: ClusterConfiguration -> Maybe Text
nodeType} -> Maybe Text
nodeType) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Text
a -> ClusterConfiguration
s {$sel:nodeType:ClusterConfiguration' :: Maybe Text
nodeType = Maybe Text
a} :: ClusterConfiguration)

-- | The description of the cluster configuration
clusterConfiguration_description :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Text)
clusterConfiguration_description :: (Maybe Text -> f (Maybe Text))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_description = (ClusterConfiguration -> Maybe Text)
-> (ClusterConfiguration -> Maybe Text -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:ClusterConfiguration' :: ClusterConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Text
a -> ClusterConfiguration
s {$sel:description:ClusterConfiguration' :: Maybe Text
description = Maybe Text
a} :: ClusterConfiguration)

-- | The port used by the cluster
clusterConfiguration_port :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Int)
clusterConfiguration_port :: (Maybe Int -> f (Maybe Int))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_port = (ClusterConfiguration -> Maybe Int)
-> (ClusterConfiguration -> Maybe Int -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Int
port :: Maybe Int
$sel:port:ClusterConfiguration' :: ClusterConfiguration -> Maybe Int
port} -> Maybe Int
port) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Int
a -> ClusterConfiguration
s {$sel:port:ClusterConfiguration' :: Maybe Int
port = Maybe Int
a} :: ClusterConfiguration)

-- | The name of parameter group used by the cluster
clusterConfiguration_parameterGroupName :: Lens.Lens' ClusterConfiguration (Prelude.Maybe Prelude.Text)
clusterConfiguration_parameterGroupName :: (Maybe Text -> f (Maybe Text))
-> ClusterConfiguration -> f ClusterConfiguration
clusterConfiguration_parameterGroupName = (ClusterConfiguration -> Maybe Text)
-> (ClusterConfiguration -> Maybe Text -> ClusterConfiguration)
-> Lens
     ClusterConfiguration ClusterConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterConfiguration' {Maybe Text
parameterGroupName :: Maybe Text
$sel:parameterGroupName:ClusterConfiguration' :: ClusterConfiguration -> Maybe Text
parameterGroupName} -> Maybe Text
parameterGroupName) (\s :: ClusterConfiguration
s@ClusterConfiguration' {} Maybe Text
a -> ClusterConfiguration
s {$sel:parameterGroupName:ClusterConfiguration' :: Maybe Text
parameterGroupName = Maybe Text
a} :: ClusterConfiguration)

instance Core.FromJSON ClusterConfiguration where
  parseJSON :: Value -> Parser ClusterConfiguration
parseJSON =
    String
-> (Object -> Parser ClusterConfiguration)
-> Value
-> Parser ClusterConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ClusterConfiguration"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe [ShardDetail]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ClusterConfiguration
ClusterConfiguration'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe [ShardDetail]
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> ClusterConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ShardDetail]
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ClusterConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EngineVersion")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ShardDetail]
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ClusterConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ShardDetail]
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VpcId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ShardDetail]
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ClusterConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ShardDetail]
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SnapshotWindow")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ShardDetail]
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ClusterConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ShardDetail]
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubnetGroupName")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ShardDetail]
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ClusterConfiguration)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [ShardDetail]
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumShards")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [ShardDetail]
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ClusterConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [ShardDetail]
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaintenanceWindow")
            Parser
  (Maybe Text
   -> Maybe [ShardDetail]
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ClusterConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe [ShardDetail]
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TopicArn")
            Parser
  (Maybe [ShardDetail]
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ClusterConfiguration)
-> Parser (Maybe [ShardDetail])
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ShardDetail]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Shards" Parser (Maybe (Maybe [ShardDetail]))
-> Maybe [ShardDetail] -> Parser (Maybe [ShardDetail])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ShardDetail]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ClusterConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ClusterConfiguration)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Int -> Maybe Text -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SnapshotRetentionLimit")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Int -> Maybe Text -> ClusterConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Int -> Maybe Text -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NodeType")
            Parser
  (Maybe Text -> Maybe Int -> Maybe Text -> ClusterConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Text -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
            Parser (Maybe Int -> Maybe Text -> ClusterConfiguration)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> ClusterConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Port")
            Parser (Maybe Text -> ClusterConfiguration)
-> Parser (Maybe Text) -> Parser ClusterConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ParameterGroupName")
      )

instance Prelude.Hashable ClusterConfiguration

instance Prelude.NFData ClusterConfiguration