{-# 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.DAX.Types.Cluster
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DAX.Types.Cluster where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.DAX.Types.ClusterEndpointEncryptionType
import Amazonka.DAX.Types.Endpoint
import Amazonka.DAX.Types.Node
import Amazonka.DAX.Types.NotificationConfiguration
import Amazonka.DAX.Types.ParameterGroupStatus
import Amazonka.DAX.Types.SSEDescription
import Amazonka.DAX.Types.SecurityGroupMembership
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Contains all of the attributes of a specific DAX cluster.
--
-- /See:/ 'newCluster' smart constructor.
data Cluster = Cluster'
  { -- | The number of nodes in the cluster that are active (i.e., capable of
    -- serving requests).
    Cluster -> Maybe Int
activeNodes :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Resource Name (ARN) that uniquely identifies the cluster.
    Cluster -> Maybe Text
clusterArn :: Prelude.Maybe Prelude.Text,
    -- | The endpoint for this DAX cluster, consisting of a DNS name, a port
    -- number, and a URL. Applications should use the URL to configure the DAX
    -- client to find their cluster.
    Cluster -> Maybe Endpoint
clusterDiscoveryEndpoint :: Prelude.Maybe Endpoint,
    -- | The type of encryption supported by the cluster\'s endpoint. Values are:
    --
    -- -   @NONE@ for no encryption
    --
    --     @TLS@ for Transport Layer Security
    Cluster -> Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType :: Prelude.Maybe ClusterEndpointEncryptionType,
    -- | The name of the DAX cluster.
    Cluster -> Maybe Text
clusterName :: Prelude.Maybe Prelude.Text,
    -- | The description of the cluster.
    Cluster -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A valid Amazon Resource Name (ARN) that identifies an IAM role. At
    -- runtime, DAX will assume this role and use the role\'s permissions to
    -- access DynamoDB on your behalf.
    Cluster -> Maybe Text
iamRoleArn :: Prelude.Maybe Prelude.Text,
    -- | A list of nodes to be removed from the cluster.
    Cluster -> Maybe [Text]
nodeIdsToRemove :: Prelude.Maybe [Prelude.Text],
    -- | The node type for the nodes in the cluster. (All nodes in a DAX cluster
    -- are of the same type.)
    Cluster -> Maybe Text
nodeType :: Prelude.Maybe Prelude.Text,
    -- | A list of nodes that are currently in the cluster.
    Cluster -> Maybe [Node]
nodes :: Prelude.Maybe [Node],
    -- | Describes a notification topic and its status. Notification topics are
    -- used for publishing DAX events to subscribers using Amazon Simple
    -- Notification Service (SNS).
    Cluster -> Maybe NotificationConfiguration
notificationConfiguration :: Prelude.Maybe NotificationConfiguration,
    -- | The parameter group being used by nodes in the cluster.
    Cluster -> Maybe ParameterGroupStatus
parameterGroup :: Prelude.Maybe ParameterGroupStatus,
    -- | A range of time when maintenance of DAX cluster software will be
    -- performed. For example: @sun:01:00-sun:09:00@. Cluster maintenance
    -- normally takes less than 30 minutes, and is performed automatically
    -- within the maintenance window.
    Cluster -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
    -- | The description of the server-side encryption status on the specified
    -- DAX cluster.
    Cluster -> Maybe SSEDescription
sSEDescription :: Prelude.Maybe SSEDescription,
    -- | A list of security groups, and the status of each, for the nodes in the
    -- cluster.
    Cluster -> Maybe [SecurityGroupMembership]
securityGroups :: Prelude.Maybe [SecurityGroupMembership],
    -- | The current status of the cluster.
    Cluster -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The subnet group where the DAX cluster is running.
    Cluster -> Maybe Text
subnetGroup :: Prelude.Maybe Prelude.Text,
    -- | The total number of nodes in the cluster.
    Cluster -> Maybe Int
totalNodes :: Prelude.Maybe Prelude.Int
  }
  deriving (Cluster -> Cluster -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Cluster -> Cluster -> Bool
$c/= :: Cluster -> Cluster -> Bool
== :: Cluster -> Cluster -> Bool
$c== :: Cluster -> Cluster -> Bool
Prelude.Eq, ReadPrec [Cluster]
ReadPrec Cluster
Int -> ReadS Cluster
ReadS [Cluster]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Cluster]
$creadListPrec :: ReadPrec [Cluster]
readPrec :: ReadPrec Cluster
$creadPrec :: ReadPrec Cluster
readList :: ReadS [Cluster]
$creadList :: ReadS [Cluster]
readsPrec :: Int -> ReadS Cluster
$creadsPrec :: Int -> ReadS Cluster
Prelude.Read, Int -> Cluster -> ShowS
[Cluster] -> ShowS
Cluster -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Cluster] -> ShowS
$cshowList :: [Cluster] -> ShowS
show :: Cluster -> String
$cshow :: Cluster -> String
showsPrec :: Int -> Cluster -> ShowS
$cshowsPrec :: Int -> Cluster -> ShowS
Prelude.Show, forall x. Rep Cluster x -> Cluster
forall x. Cluster -> Rep Cluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Cluster x -> Cluster
$cfrom :: forall x. Cluster -> Rep Cluster x
Prelude.Generic)

-- |
-- Create a value of 'Cluster' 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:
--
-- 'activeNodes', 'cluster_activeNodes' - The number of nodes in the cluster that are active (i.e., capable of
-- serving requests).
--
-- 'clusterArn', 'cluster_clusterArn' - The Amazon Resource Name (ARN) that uniquely identifies the cluster.
--
-- 'clusterDiscoveryEndpoint', 'cluster_clusterDiscoveryEndpoint' - The endpoint for this DAX cluster, consisting of a DNS name, a port
-- number, and a URL. Applications should use the URL to configure the DAX
-- client to find their cluster.
--
-- 'clusterEndpointEncryptionType', 'cluster_clusterEndpointEncryptionType' - The type of encryption supported by the cluster\'s endpoint. Values are:
--
-- -   @NONE@ for no encryption
--
--     @TLS@ for Transport Layer Security
--
-- 'clusterName', 'cluster_clusterName' - The name of the DAX cluster.
--
-- 'description', 'cluster_description' - The description of the cluster.
--
-- 'iamRoleArn', 'cluster_iamRoleArn' - A valid Amazon Resource Name (ARN) that identifies an IAM role. At
-- runtime, DAX will assume this role and use the role\'s permissions to
-- access DynamoDB on your behalf.
--
-- 'nodeIdsToRemove', 'cluster_nodeIdsToRemove' - A list of nodes to be removed from the cluster.
--
-- 'nodeType', 'cluster_nodeType' - The node type for the nodes in the cluster. (All nodes in a DAX cluster
-- are of the same type.)
--
-- 'nodes', 'cluster_nodes' - A list of nodes that are currently in the cluster.
--
-- 'notificationConfiguration', 'cluster_notificationConfiguration' - Describes a notification topic and its status. Notification topics are
-- used for publishing DAX events to subscribers using Amazon Simple
-- Notification Service (SNS).
--
-- 'parameterGroup', 'cluster_parameterGroup' - The parameter group being used by nodes in the cluster.
--
-- 'preferredMaintenanceWindow', 'cluster_preferredMaintenanceWindow' - A range of time when maintenance of DAX cluster software will be
-- performed. For example: @sun:01:00-sun:09:00@. Cluster maintenance
-- normally takes less than 30 minutes, and is performed automatically
-- within the maintenance window.
--
-- 'sSEDescription', 'cluster_sSEDescription' - The description of the server-side encryption status on the specified
-- DAX cluster.
--
-- 'securityGroups', 'cluster_securityGroups' - A list of security groups, and the status of each, for the nodes in the
-- cluster.
--
-- 'status', 'cluster_status' - The current status of the cluster.
--
-- 'subnetGroup', 'cluster_subnetGroup' - The subnet group where the DAX cluster is running.
--
-- 'totalNodes', 'cluster_totalNodes' - The total number of nodes in the cluster.
newCluster ::
  Cluster
newCluster :: Cluster
newCluster =
  Cluster'
    { $sel:activeNodes:Cluster' :: Maybe Int
activeNodes = forall a. Maybe a
Prelude.Nothing,
      $sel:clusterArn:Cluster' :: Maybe Text
clusterArn = forall a. Maybe a
Prelude.Nothing,
      $sel:clusterDiscoveryEndpoint:Cluster' :: Maybe Endpoint
clusterDiscoveryEndpoint = forall a. Maybe a
Prelude.Nothing,
      $sel:clusterEndpointEncryptionType:Cluster' :: Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType = forall a. Maybe a
Prelude.Nothing,
      $sel:clusterName:Cluster' :: Maybe Text
clusterName = forall a. Maybe a
Prelude.Nothing,
      $sel:description:Cluster' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:iamRoleArn:Cluster' :: Maybe Text
iamRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:nodeIdsToRemove:Cluster' :: Maybe [Text]
nodeIdsToRemove = forall a. Maybe a
Prelude.Nothing,
      $sel:nodeType:Cluster' :: Maybe Text
nodeType = forall a. Maybe a
Prelude.Nothing,
      $sel:nodes:Cluster' :: Maybe [Node]
nodes = forall a. Maybe a
Prelude.Nothing,
      $sel:notificationConfiguration:Cluster' :: Maybe NotificationConfiguration
notificationConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroup:Cluster' :: Maybe ParameterGroupStatus
parameterGroup = forall a. Maybe a
Prelude.Nothing,
      $sel:preferredMaintenanceWindow:Cluster' :: Maybe Text
preferredMaintenanceWindow = forall a. Maybe a
Prelude.Nothing,
      $sel:sSEDescription:Cluster' :: Maybe SSEDescription
sSEDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroups:Cluster' :: Maybe [SecurityGroupMembership]
securityGroups = forall a. Maybe a
Prelude.Nothing,
      $sel:status:Cluster' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing,
      $sel:subnetGroup:Cluster' :: Maybe Text
subnetGroup = forall a. Maybe a
Prelude.Nothing,
      $sel:totalNodes:Cluster' :: Maybe Int
totalNodes = forall a. Maybe a
Prelude.Nothing
    }

-- | The number of nodes in the cluster that are active (i.e., capable of
-- serving requests).
cluster_activeNodes :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Int)
cluster_activeNodes :: Lens' Cluster (Maybe Int)
cluster_activeNodes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Int
activeNodes :: Maybe Int
$sel:activeNodes:Cluster' :: Cluster -> Maybe Int
activeNodes} -> Maybe Int
activeNodes) (\s :: Cluster
s@Cluster' {} Maybe Int
a -> Cluster
s {$sel:activeNodes:Cluster' :: Maybe Int
activeNodes = Maybe Int
a} :: Cluster)

-- | The Amazon Resource Name (ARN) that uniquely identifies the cluster.
cluster_clusterArn :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_clusterArn :: Lens' Cluster (Maybe Text)
cluster_clusterArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
clusterArn :: Maybe Text
$sel:clusterArn:Cluster' :: Cluster -> Maybe Text
clusterArn} -> Maybe Text
clusterArn) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:clusterArn:Cluster' :: Maybe Text
clusterArn = Maybe Text
a} :: Cluster)

-- | The endpoint for this DAX cluster, consisting of a DNS name, a port
-- number, and a URL. Applications should use the URL to configure the DAX
-- client to find their cluster.
cluster_clusterDiscoveryEndpoint :: Lens.Lens' Cluster (Prelude.Maybe Endpoint)
cluster_clusterDiscoveryEndpoint :: Lens' Cluster (Maybe Endpoint)
cluster_clusterDiscoveryEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Endpoint
clusterDiscoveryEndpoint :: Maybe Endpoint
$sel:clusterDiscoveryEndpoint:Cluster' :: Cluster -> Maybe Endpoint
clusterDiscoveryEndpoint} -> Maybe Endpoint
clusterDiscoveryEndpoint) (\s :: Cluster
s@Cluster' {} Maybe Endpoint
a -> Cluster
s {$sel:clusterDiscoveryEndpoint:Cluster' :: Maybe Endpoint
clusterDiscoveryEndpoint = Maybe Endpoint
a} :: Cluster)

-- | The type of encryption supported by the cluster\'s endpoint. Values are:
--
-- -   @NONE@ for no encryption
--
--     @TLS@ for Transport Layer Security
cluster_clusterEndpointEncryptionType :: Lens.Lens' Cluster (Prelude.Maybe ClusterEndpointEncryptionType)
cluster_clusterEndpointEncryptionType :: Lens' Cluster (Maybe ClusterEndpointEncryptionType)
cluster_clusterEndpointEncryptionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType :: Maybe ClusterEndpointEncryptionType
$sel:clusterEndpointEncryptionType:Cluster' :: Cluster -> Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType} -> Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType) (\s :: Cluster
s@Cluster' {} Maybe ClusterEndpointEncryptionType
a -> Cluster
s {$sel:clusterEndpointEncryptionType:Cluster' :: Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType = Maybe ClusterEndpointEncryptionType
a} :: Cluster)

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

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

-- | A valid Amazon Resource Name (ARN) that identifies an IAM role. At
-- runtime, DAX will assume this role and use the role\'s permissions to
-- access DynamoDB on your behalf.
cluster_iamRoleArn :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_iamRoleArn :: Lens' Cluster (Maybe Text)
cluster_iamRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
iamRoleArn :: Maybe Text
$sel:iamRoleArn:Cluster' :: Cluster -> Maybe Text
iamRoleArn} -> Maybe Text
iamRoleArn) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:iamRoleArn:Cluster' :: Maybe Text
iamRoleArn = Maybe Text
a} :: Cluster)

-- | A list of nodes to be removed from the cluster.
cluster_nodeIdsToRemove :: Lens.Lens' Cluster (Prelude.Maybe [Prelude.Text])
cluster_nodeIdsToRemove :: Lens' Cluster (Maybe [Text])
cluster_nodeIdsToRemove = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe [Text]
nodeIdsToRemove :: Maybe [Text]
$sel:nodeIdsToRemove:Cluster' :: Cluster -> Maybe [Text]
nodeIdsToRemove} -> Maybe [Text]
nodeIdsToRemove) (\s :: Cluster
s@Cluster' {} Maybe [Text]
a -> Cluster
s {$sel:nodeIdsToRemove:Cluster' :: Maybe [Text]
nodeIdsToRemove = Maybe [Text]
a} :: Cluster) 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 node type for the nodes in the cluster. (All nodes in a DAX cluster
-- are of the same type.)
cluster_nodeType :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_nodeType :: Lens' Cluster (Maybe Text)
cluster_nodeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
nodeType :: Maybe Text
$sel:nodeType:Cluster' :: Cluster -> Maybe Text
nodeType} -> Maybe Text
nodeType) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:nodeType:Cluster' :: Maybe Text
nodeType = Maybe Text
a} :: Cluster)

-- | A list of nodes that are currently in the cluster.
cluster_nodes :: Lens.Lens' Cluster (Prelude.Maybe [Node])
cluster_nodes :: Lens' Cluster (Maybe [Node])
cluster_nodes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe [Node]
nodes :: Maybe [Node]
$sel:nodes:Cluster' :: Cluster -> Maybe [Node]
nodes} -> Maybe [Node]
nodes) (\s :: Cluster
s@Cluster' {} Maybe [Node]
a -> Cluster
s {$sel:nodes:Cluster' :: Maybe [Node]
nodes = Maybe [Node]
a} :: Cluster) 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

-- | Describes a notification topic and its status. Notification topics are
-- used for publishing DAX events to subscribers using Amazon Simple
-- Notification Service (SNS).
cluster_notificationConfiguration :: Lens.Lens' Cluster (Prelude.Maybe NotificationConfiguration)
cluster_notificationConfiguration :: Lens' Cluster (Maybe NotificationConfiguration)
cluster_notificationConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe NotificationConfiguration
notificationConfiguration :: Maybe NotificationConfiguration
$sel:notificationConfiguration:Cluster' :: Cluster -> Maybe NotificationConfiguration
notificationConfiguration} -> Maybe NotificationConfiguration
notificationConfiguration) (\s :: Cluster
s@Cluster' {} Maybe NotificationConfiguration
a -> Cluster
s {$sel:notificationConfiguration:Cluster' :: Maybe NotificationConfiguration
notificationConfiguration = Maybe NotificationConfiguration
a} :: Cluster)

-- | The parameter group being used by nodes in the cluster.
cluster_parameterGroup :: Lens.Lens' Cluster (Prelude.Maybe ParameterGroupStatus)
cluster_parameterGroup :: Lens' Cluster (Maybe ParameterGroupStatus)
cluster_parameterGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe ParameterGroupStatus
parameterGroup :: Maybe ParameterGroupStatus
$sel:parameterGroup:Cluster' :: Cluster -> Maybe ParameterGroupStatus
parameterGroup} -> Maybe ParameterGroupStatus
parameterGroup) (\s :: Cluster
s@Cluster' {} Maybe ParameterGroupStatus
a -> Cluster
s {$sel:parameterGroup:Cluster' :: Maybe ParameterGroupStatus
parameterGroup = Maybe ParameterGroupStatus
a} :: Cluster)

-- | A range of time when maintenance of DAX cluster software will be
-- performed. For example: @sun:01:00-sun:09:00@. Cluster maintenance
-- normally takes less than 30 minutes, and is performed automatically
-- within the maintenance window.
cluster_preferredMaintenanceWindow :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_preferredMaintenanceWindow :: Lens' Cluster (Maybe Text)
cluster_preferredMaintenanceWindow = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
preferredMaintenanceWindow :: Maybe Text
$sel:preferredMaintenanceWindow:Cluster' :: Cluster -> Maybe Text
preferredMaintenanceWindow} -> Maybe Text
preferredMaintenanceWindow) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:preferredMaintenanceWindow:Cluster' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
a} :: Cluster)

-- | The description of the server-side encryption status on the specified
-- DAX cluster.
cluster_sSEDescription :: Lens.Lens' Cluster (Prelude.Maybe SSEDescription)
cluster_sSEDescription :: Lens' Cluster (Maybe SSEDescription)
cluster_sSEDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe SSEDescription
sSEDescription :: Maybe SSEDescription
$sel:sSEDescription:Cluster' :: Cluster -> Maybe SSEDescription
sSEDescription} -> Maybe SSEDescription
sSEDescription) (\s :: Cluster
s@Cluster' {} Maybe SSEDescription
a -> Cluster
s {$sel:sSEDescription:Cluster' :: Maybe SSEDescription
sSEDescription = Maybe SSEDescription
a} :: Cluster)

-- | A list of security groups, and the status of each, for the nodes in the
-- cluster.
cluster_securityGroups :: Lens.Lens' Cluster (Prelude.Maybe [SecurityGroupMembership])
cluster_securityGroups :: Lens' Cluster (Maybe [SecurityGroupMembership])
cluster_securityGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe [SecurityGroupMembership]
securityGroups :: Maybe [SecurityGroupMembership]
$sel:securityGroups:Cluster' :: Cluster -> Maybe [SecurityGroupMembership]
securityGroups} -> Maybe [SecurityGroupMembership]
securityGroups) (\s :: Cluster
s@Cluster' {} Maybe [SecurityGroupMembership]
a -> Cluster
s {$sel:securityGroups:Cluster' :: Maybe [SecurityGroupMembership]
securityGroups = Maybe [SecurityGroupMembership]
a} :: Cluster) 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 current status of the cluster.
cluster_status :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_status :: Lens' Cluster (Maybe Text)
cluster_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
status :: Maybe Text
$sel:status:Cluster' :: Cluster -> Maybe Text
status} -> Maybe Text
status) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:status:Cluster' :: Maybe Text
status = Maybe Text
a} :: Cluster)

-- | The subnet group where the DAX cluster is running.
cluster_subnetGroup :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_subnetGroup :: Lens' Cluster (Maybe Text)
cluster_subnetGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
subnetGroup :: Maybe Text
$sel:subnetGroup:Cluster' :: Cluster -> Maybe Text
subnetGroup} -> Maybe Text
subnetGroup) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:subnetGroup:Cluster' :: Maybe Text
subnetGroup = Maybe Text
a} :: Cluster)

-- | The total number of nodes in the cluster.
cluster_totalNodes :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Int)
cluster_totalNodes :: Lens' Cluster (Maybe Int)
cluster_totalNodes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Int
totalNodes :: Maybe Int
$sel:totalNodes:Cluster' :: Cluster -> Maybe Int
totalNodes} -> Maybe Int
totalNodes) (\s :: Cluster
s@Cluster' {} Maybe Int
a -> Cluster
s {$sel:totalNodes:Cluster' :: Maybe Int
totalNodes = Maybe Int
a} :: Cluster)

instance Data.FromJSON Cluster where
  parseJSON :: Value -> Parser Cluster
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Cluster"
      ( \Object
x ->
          Maybe Int
-> Maybe Text
-> Maybe Endpoint
-> Maybe ClusterEndpointEncryptionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe [Node]
-> Maybe NotificationConfiguration
-> Maybe ParameterGroupStatus
-> Maybe Text
-> Maybe SSEDescription
-> Maybe [SecurityGroupMembership]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Cluster
Cluster'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ActiveNodes")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ClusterArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ClusterDiscoveryEndpoint")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ClusterEndpointEncryptionType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ClusterName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IamRoleArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NodeIdsToRemove"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NodeType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Nodes" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NotificationConfiguration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ParameterGroup")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PreferredMaintenanceWindow")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SSEDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SecurityGroups" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SubnetGroup")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TotalNodes")
      )

instance Prelude.Hashable Cluster where
  hashWithSalt :: Int -> Cluster -> Int
hashWithSalt Int
_salt Cluster' {Maybe Int
Maybe [Text]
Maybe [Node]
Maybe [SecurityGroupMembership]
Maybe Text
Maybe ClusterEndpointEncryptionType
Maybe Endpoint
Maybe NotificationConfiguration
Maybe ParameterGroupStatus
Maybe SSEDescription
totalNodes :: Maybe Int
subnetGroup :: Maybe Text
status :: Maybe Text
securityGroups :: Maybe [SecurityGroupMembership]
sSEDescription :: Maybe SSEDescription
preferredMaintenanceWindow :: Maybe Text
parameterGroup :: Maybe ParameterGroupStatus
notificationConfiguration :: Maybe NotificationConfiguration
nodes :: Maybe [Node]
nodeType :: Maybe Text
nodeIdsToRemove :: Maybe [Text]
iamRoleArn :: Maybe Text
description :: Maybe Text
clusterName :: Maybe Text
clusterEndpointEncryptionType :: Maybe ClusterEndpointEncryptionType
clusterDiscoveryEndpoint :: Maybe Endpoint
clusterArn :: Maybe Text
activeNodes :: Maybe Int
$sel:totalNodes:Cluster' :: Cluster -> Maybe Int
$sel:subnetGroup:Cluster' :: Cluster -> Maybe Text
$sel:status:Cluster' :: Cluster -> Maybe Text
$sel:securityGroups:Cluster' :: Cluster -> Maybe [SecurityGroupMembership]
$sel:sSEDescription:Cluster' :: Cluster -> Maybe SSEDescription
$sel:preferredMaintenanceWindow:Cluster' :: Cluster -> Maybe Text
$sel:parameterGroup:Cluster' :: Cluster -> Maybe ParameterGroupStatus
$sel:notificationConfiguration:Cluster' :: Cluster -> Maybe NotificationConfiguration
$sel:nodes:Cluster' :: Cluster -> Maybe [Node]
$sel:nodeType:Cluster' :: Cluster -> Maybe Text
$sel:nodeIdsToRemove:Cluster' :: Cluster -> Maybe [Text]
$sel:iamRoleArn:Cluster' :: Cluster -> Maybe Text
$sel:description:Cluster' :: Cluster -> Maybe Text
$sel:clusterName:Cluster' :: Cluster -> Maybe Text
$sel:clusterEndpointEncryptionType:Cluster' :: Cluster -> Maybe ClusterEndpointEncryptionType
$sel:clusterDiscoveryEndpoint:Cluster' :: Cluster -> Maybe Endpoint
$sel:clusterArn:Cluster' :: Cluster -> Maybe Text
$sel:activeNodes:Cluster' :: Cluster -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
activeNodes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clusterArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Endpoint
clusterDiscoveryEndpoint
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clusterName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
iamRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
nodeIdsToRemove
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nodeType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Node]
nodes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NotificationConfiguration
notificationConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ParameterGroupStatus
parameterGroup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
preferredMaintenanceWindow
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SSEDescription
sSEDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SecurityGroupMembership]
securityGroups
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subnetGroup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
totalNodes

instance Prelude.NFData Cluster where
  rnf :: Cluster -> ()
rnf Cluster' {Maybe Int
Maybe [Text]
Maybe [Node]
Maybe [SecurityGroupMembership]
Maybe Text
Maybe ClusterEndpointEncryptionType
Maybe Endpoint
Maybe NotificationConfiguration
Maybe ParameterGroupStatus
Maybe SSEDescription
totalNodes :: Maybe Int
subnetGroup :: Maybe Text
status :: Maybe Text
securityGroups :: Maybe [SecurityGroupMembership]
sSEDescription :: Maybe SSEDescription
preferredMaintenanceWindow :: Maybe Text
parameterGroup :: Maybe ParameterGroupStatus
notificationConfiguration :: Maybe NotificationConfiguration
nodes :: Maybe [Node]
nodeType :: Maybe Text
nodeIdsToRemove :: Maybe [Text]
iamRoleArn :: Maybe Text
description :: Maybe Text
clusterName :: Maybe Text
clusterEndpointEncryptionType :: Maybe ClusterEndpointEncryptionType
clusterDiscoveryEndpoint :: Maybe Endpoint
clusterArn :: Maybe Text
activeNodes :: Maybe Int
$sel:totalNodes:Cluster' :: Cluster -> Maybe Int
$sel:subnetGroup:Cluster' :: Cluster -> Maybe Text
$sel:status:Cluster' :: Cluster -> Maybe Text
$sel:securityGroups:Cluster' :: Cluster -> Maybe [SecurityGroupMembership]
$sel:sSEDescription:Cluster' :: Cluster -> Maybe SSEDescription
$sel:preferredMaintenanceWindow:Cluster' :: Cluster -> Maybe Text
$sel:parameterGroup:Cluster' :: Cluster -> Maybe ParameterGroupStatus
$sel:notificationConfiguration:Cluster' :: Cluster -> Maybe NotificationConfiguration
$sel:nodes:Cluster' :: Cluster -> Maybe [Node]
$sel:nodeType:Cluster' :: Cluster -> Maybe Text
$sel:nodeIdsToRemove:Cluster' :: Cluster -> Maybe [Text]
$sel:iamRoleArn:Cluster' :: Cluster -> Maybe Text
$sel:description:Cluster' :: Cluster -> Maybe Text
$sel:clusterName:Cluster' :: Cluster -> Maybe Text
$sel:clusterEndpointEncryptionType:Cluster' :: Cluster -> Maybe ClusterEndpointEncryptionType
$sel:clusterDiscoveryEndpoint:Cluster' :: Cluster -> Maybe Endpoint
$sel:clusterArn:Cluster' :: Cluster -> Maybe Text
$sel:activeNodes:Cluster' :: Cluster -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
activeNodes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clusterArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Endpoint
clusterDiscoveryEndpoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ClusterEndpointEncryptionType
clusterEndpointEncryptionType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clusterName
      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
iamRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
nodeIdsToRemove
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nodeType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Node]
nodes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NotificationConfiguration
notificationConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ParameterGroupStatus
parameterGroup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
preferredMaintenanceWindow
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SSEDescription
sSEDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SecurityGroupMembership]
securityGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subnetGroup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalNodes