{-# 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.ElastiCache.Types.GlobalReplicationGroup
-- 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.ElastiCache.Types.GlobalReplicationGroup where

import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.Types.GlobalNodeGroup
import Amazonka.ElastiCache.Types.GlobalReplicationGroupMember
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Consists of a primary cluster that accepts writes and an associated
-- secondary cluster that resides in a different Amazon region. The
-- secondary cluster accepts only reads. The primary cluster automatically
-- replicates updates to the secondary cluster.
--
-- -   The __GlobalReplicationGroupIdSuffix__ represents the name of the
--     Global datastore, which is what you use to associate a secondary
--     cluster.
--
-- /See:/ 'newGlobalReplicationGroup' smart constructor.
data GlobalReplicationGroup = GlobalReplicationGroup'
  { -- | The Elasticache Redis engine version.
    GlobalReplicationGroup -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | The status of the Global datastore
    GlobalReplicationGroup -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The cache node type of the Global datastore
    GlobalReplicationGroup -> Maybe Text
cacheNodeType :: Prelude.Maybe Prelude.Text,
    -- | A flag that indicates whether the Global datastore is cluster enabled.
    GlobalReplicationGroup -> Maybe Bool
clusterEnabled :: Prelude.Maybe Prelude.Bool,
    -- | A flag that enables encryption at rest when set to @true@.
    --
    -- You cannot modify the value of @AtRestEncryptionEnabled@ after the
    -- replication group is created. To enable encryption at rest on a
    -- replication group you must set @AtRestEncryptionEnabled@ to @true@ when
    -- you create the replication group.
    --
    -- __Required:__ Only available when creating a replication group in an
    -- Amazon VPC using redis version @3.2.6@, @4.x@ or later.
    GlobalReplicationGroup -> Maybe Bool
atRestEncryptionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The ARN (Amazon Resource Name) of the global replication group.
    GlobalReplicationGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | A flag that enables in-transit encryption when set to true. You cannot
    -- modify the value of @TransitEncryptionEnabled@ after the cluster is
    -- created. To enable in-transit encryption on a cluster you must set
    -- @TransitEncryptionEnabled@ to true when you create a cluster.
    --
    -- __Required:__ Only available when creating a replication group in an
    -- Amazon VPC using redis version @3.2.6@, @4.x@ or later.
    GlobalReplicationGroup -> Maybe Bool
transitEncryptionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The replication groups that comprise the Global datastore.
    GlobalReplicationGroup -> Maybe [GlobalReplicationGroupMember]
members :: Prelude.Maybe [GlobalReplicationGroupMember],
    -- | The Elasticache engine. For Redis only.
    GlobalReplicationGroup -> Maybe Text
engine :: Prelude.Maybe Prelude.Text,
    -- | A flag that enables using an @AuthToken@ (password) when issuing Redis
    -- commands.
    --
    -- Default: @false@
    GlobalReplicationGroup -> Maybe Bool
authTokenEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Indicates the slot configuration and global identifier for each slice
    -- group.
    GlobalReplicationGroup -> Maybe [GlobalNodeGroup]
globalNodeGroups :: Prelude.Maybe [GlobalNodeGroup],
    -- | The name of the Global datastore
    GlobalReplicationGroup -> Maybe Text
globalReplicationGroupId :: Prelude.Maybe Prelude.Text,
    -- | The optional description of the Global datastore
    GlobalReplicationGroup -> Maybe Text
globalReplicationGroupDescription :: Prelude.Maybe Prelude.Text
  }
  deriving (GlobalReplicationGroup -> GlobalReplicationGroup -> Bool
(GlobalReplicationGroup -> GlobalReplicationGroup -> Bool)
-> (GlobalReplicationGroup -> GlobalReplicationGroup -> Bool)
-> Eq GlobalReplicationGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlobalReplicationGroup -> GlobalReplicationGroup -> Bool
$c/= :: GlobalReplicationGroup -> GlobalReplicationGroup -> Bool
== :: GlobalReplicationGroup -> GlobalReplicationGroup -> Bool
$c== :: GlobalReplicationGroup -> GlobalReplicationGroup -> Bool
Prelude.Eq, ReadPrec [GlobalReplicationGroup]
ReadPrec GlobalReplicationGroup
Int -> ReadS GlobalReplicationGroup
ReadS [GlobalReplicationGroup]
(Int -> ReadS GlobalReplicationGroup)
-> ReadS [GlobalReplicationGroup]
-> ReadPrec GlobalReplicationGroup
-> ReadPrec [GlobalReplicationGroup]
-> Read GlobalReplicationGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GlobalReplicationGroup]
$creadListPrec :: ReadPrec [GlobalReplicationGroup]
readPrec :: ReadPrec GlobalReplicationGroup
$creadPrec :: ReadPrec GlobalReplicationGroup
readList :: ReadS [GlobalReplicationGroup]
$creadList :: ReadS [GlobalReplicationGroup]
readsPrec :: Int -> ReadS GlobalReplicationGroup
$creadsPrec :: Int -> ReadS GlobalReplicationGroup
Prelude.Read, Int -> GlobalReplicationGroup -> ShowS
[GlobalReplicationGroup] -> ShowS
GlobalReplicationGroup -> String
(Int -> GlobalReplicationGroup -> ShowS)
-> (GlobalReplicationGroup -> String)
-> ([GlobalReplicationGroup] -> ShowS)
-> Show GlobalReplicationGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GlobalReplicationGroup] -> ShowS
$cshowList :: [GlobalReplicationGroup] -> ShowS
show :: GlobalReplicationGroup -> String
$cshow :: GlobalReplicationGroup -> String
showsPrec :: Int -> GlobalReplicationGroup -> ShowS
$cshowsPrec :: Int -> GlobalReplicationGroup -> ShowS
Prelude.Show, (forall x. GlobalReplicationGroup -> Rep GlobalReplicationGroup x)
-> (forall x.
    Rep GlobalReplicationGroup x -> GlobalReplicationGroup)
-> Generic GlobalReplicationGroup
forall x. Rep GlobalReplicationGroup x -> GlobalReplicationGroup
forall x. GlobalReplicationGroup -> Rep GlobalReplicationGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GlobalReplicationGroup x -> GlobalReplicationGroup
$cfrom :: forall x. GlobalReplicationGroup -> Rep GlobalReplicationGroup x
Prelude.Generic)

-- |
-- Create a value of 'GlobalReplicationGroup' 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', 'globalReplicationGroup_engineVersion' - The Elasticache Redis engine version.
--
-- 'status', 'globalReplicationGroup_status' - The status of the Global datastore
--
-- 'cacheNodeType', 'globalReplicationGroup_cacheNodeType' - The cache node type of the Global datastore
--
-- 'clusterEnabled', 'globalReplicationGroup_clusterEnabled' - A flag that indicates whether the Global datastore is cluster enabled.
--
-- 'atRestEncryptionEnabled', 'globalReplicationGroup_atRestEncryptionEnabled' - A flag that enables encryption at rest when set to @true@.
--
-- You cannot modify the value of @AtRestEncryptionEnabled@ after the
-- replication group is created. To enable encryption at rest on a
-- replication group you must set @AtRestEncryptionEnabled@ to @true@ when
-- you create the replication group.
--
-- __Required:__ Only available when creating a replication group in an
-- Amazon VPC using redis version @3.2.6@, @4.x@ or later.
--
-- 'arn', 'globalReplicationGroup_arn' - The ARN (Amazon Resource Name) of the global replication group.
--
-- 'transitEncryptionEnabled', 'globalReplicationGroup_transitEncryptionEnabled' - A flag that enables in-transit encryption when set to true. You cannot
-- modify the value of @TransitEncryptionEnabled@ after the cluster is
-- created. To enable in-transit encryption on a cluster you must set
-- @TransitEncryptionEnabled@ to true when you create a cluster.
--
-- __Required:__ Only available when creating a replication group in an
-- Amazon VPC using redis version @3.2.6@, @4.x@ or later.
--
-- 'members', 'globalReplicationGroup_members' - The replication groups that comprise the Global datastore.
--
-- 'engine', 'globalReplicationGroup_engine' - The Elasticache engine. For Redis only.
--
-- 'authTokenEnabled', 'globalReplicationGroup_authTokenEnabled' - A flag that enables using an @AuthToken@ (password) when issuing Redis
-- commands.
--
-- Default: @false@
--
-- 'globalNodeGroups', 'globalReplicationGroup_globalNodeGroups' - Indicates the slot configuration and global identifier for each slice
-- group.
--
-- 'globalReplicationGroupId', 'globalReplicationGroup_globalReplicationGroupId' - The name of the Global datastore
--
-- 'globalReplicationGroupDescription', 'globalReplicationGroup_globalReplicationGroupDescription' - The optional description of the Global datastore
newGlobalReplicationGroup ::
  GlobalReplicationGroup
newGlobalReplicationGroup :: GlobalReplicationGroup
newGlobalReplicationGroup =
  GlobalReplicationGroup' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe [GlobalReplicationGroupMember]
-> Maybe Text
-> Maybe Bool
-> Maybe [GlobalNodeGroup]
-> Maybe Text
-> Maybe Text
-> GlobalReplicationGroup
GlobalReplicationGroup'
    { $sel:engineVersion:GlobalReplicationGroup' :: Maybe Text
engineVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:GlobalReplicationGroup' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheNodeType:GlobalReplicationGroup' :: Maybe Text
cacheNodeType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterEnabled:GlobalReplicationGroup' :: Maybe Bool
clusterEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:atRestEncryptionEnabled:GlobalReplicationGroup' :: Maybe Bool
atRestEncryptionEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:GlobalReplicationGroup' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:transitEncryptionEnabled:GlobalReplicationGroup' :: Maybe Bool
transitEncryptionEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:members:GlobalReplicationGroup' :: Maybe [GlobalReplicationGroupMember]
members = Maybe [GlobalReplicationGroupMember]
forall a. Maybe a
Prelude.Nothing,
      $sel:engine:GlobalReplicationGroup' :: Maybe Text
engine = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authTokenEnabled:GlobalReplicationGroup' :: Maybe Bool
authTokenEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:globalNodeGroups:GlobalReplicationGroup' :: Maybe [GlobalNodeGroup]
globalNodeGroups = Maybe [GlobalNodeGroup]
forall a. Maybe a
Prelude.Nothing,
      $sel:globalReplicationGroupId:GlobalReplicationGroup' :: Maybe Text
globalReplicationGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:globalReplicationGroupDescription:GlobalReplicationGroup' :: Maybe Text
globalReplicationGroupDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Elasticache Redis engine version.
globalReplicationGroup_engineVersion :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe Prelude.Text)
globalReplicationGroup_engineVersion :: (Maybe Text -> f (Maybe Text))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_engineVersion = (GlobalReplicationGroup -> Maybe Text)
-> (GlobalReplicationGroup -> Maybe Text -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe Text
a -> GlobalReplicationGroup
s {$sel:engineVersion:GlobalReplicationGroup' :: Maybe Text
engineVersion = Maybe Text
a} :: GlobalReplicationGroup)

-- | The status of the Global datastore
globalReplicationGroup_status :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe Prelude.Text)
globalReplicationGroup_status :: (Maybe Text -> f (Maybe Text))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_status = (GlobalReplicationGroup -> Maybe Text)
-> (GlobalReplicationGroup -> Maybe Text -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe Text
status :: Maybe Text
$sel:status:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe Text
status} -> Maybe Text
status) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe Text
a -> GlobalReplicationGroup
s {$sel:status:GlobalReplicationGroup' :: Maybe Text
status = Maybe Text
a} :: GlobalReplicationGroup)

-- | The cache node type of the Global datastore
globalReplicationGroup_cacheNodeType :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe Prelude.Text)
globalReplicationGroup_cacheNodeType :: (Maybe Text -> f (Maybe Text))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_cacheNodeType = (GlobalReplicationGroup -> Maybe Text)
-> (GlobalReplicationGroup -> Maybe Text -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe Text
cacheNodeType :: Maybe Text
$sel:cacheNodeType:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe Text
cacheNodeType} -> Maybe Text
cacheNodeType) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe Text
a -> GlobalReplicationGroup
s {$sel:cacheNodeType:GlobalReplicationGroup' :: Maybe Text
cacheNodeType = Maybe Text
a} :: GlobalReplicationGroup)

-- | A flag that indicates whether the Global datastore is cluster enabled.
globalReplicationGroup_clusterEnabled :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe Prelude.Bool)
globalReplicationGroup_clusterEnabled :: (Maybe Bool -> f (Maybe Bool))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_clusterEnabled = (GlobalReplicationGroup -> Maybe Bool)
-> (GlobalReplicationGroup -> Maybe Bool -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe Bool
clusterEnabled :: Maybe Bool
$sel:clusterEnabled:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe Bool
clusterEnabled} -> Maybe Bool
clusterEnabled) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe Bool
a -> GlobalReplicationGroup
s {$sel:clusterEnabled:GlobalReplicationGroup' :: Maybe Bool
clusterEnabled = Maybe Bool
a} :: GlobalReplicationGroup)

-- | A flag that enables encryption at rest when set to @true@.
--
-- You cannot modify the value of @AtRestEncryptionEnabled@ after the
-- replication group is created. To enable encryption at rest on a
-- replication group you must set @AtRestEncryptionEnabled@ to @true@ when
-- you create the replication group.
--
-- __Required:__ Only available when creating a replication group in an
-- Amazon VPC using redis version @3.2.6@, @4.x@ or later.
globalReplicationGroup_atRestEncryptionEnabled :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe Prelude.Bool)
globalReplicationGroup_atRestEncryptionEnabled :: (Maybe Bool -> f (Maybe Bool))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_atRestEncryptionEnabled = (GlobalReplicationGroup -> Maybe Bool)
-> (GlobalReplicationGroup -> Maybe Bool -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe Bool
atRestEncryptionEnabled :: Maybe Bool
$sel:atRestEncryptionEnabled:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe Bool
atRestEncryptionEnabled} -> Maybe Bool
atRestEncryptionEnabled) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe Bool
a -> GlobalReplicationGroup
s {$sel:atRestEncryptionEnabled:GlobalReplicationGroup' :: Maybe Bool
atRestEncryptionEnabled = Maybe Bool
a} :: GlobalReplicationGroup)

-- | The ARN (Amazon Resource Name) of the global replication group.
globalReplicationGroup_arn :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe Prelude.Text)
globalReplicationGroup_arn :: (Maybe Text -> f (Maybe Text))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_arn = (GlobalReplicationGroup -> Maybe Text)
-> (GlobalReplicationGroup -> Maybe Text -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe Text
arn :: Maybe Text
$sel:arn:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe Text
a -> GlobalReplicationGroup
s {$sel:arn:GlobalReplicationGroup' :: Maybe Text
arn = Maybe Text
a} :: GlobalReplicationGroup)

-- | A flag that enables in-transit encryption when set to true. You cannot
-- modify the value of @TransitEncryptionEnabled@ after the cluster is
-- created. To enable in-transit encryption on a cluster you must set
-- @TransitEncryptionEnabled@ to true when you create a cluster.
--
-- __Required:__ Only available when creating a replication group in an
-- Amazon VPC using redis version @3.2.6@, @4.x@ or later.
globalReplicationGroup_transitEncryptionEnabled :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe Prelude.Bool)
globalReplicationGroup_transitEncryptionEnabled :: (Maybe Bool -> f (Maybe Bool))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_transitEncryptionEnabled = (GlobalReplicationGroup -> Maybe Bool)
-> (GlobalReplicationGroup -> Maybe Bool -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe Bool
transitEncryptionEnabled :: Maybe Bool
$sel:transitEncryptionEnabled:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe Bool
transitEncryptionEnabled} -> Maybe Bool
transitEncryptionEnabled) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe Bool
a -> GlobalReplicationGroup
s {$sel:transitEncryptionEnabled:GlobalReplicationGroup' :: Maybe Bool
transitEncryptionEnabled = Maybe Bool
a} :: GlobalReplicationGroup)

-- | The replication groups that comprise the Global datastore.
globalReplicationGroup_members :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe [GlobalReplicationGroupMember])
globalReplicationGroup_members :: (Maybe [GlobalReplicationGroupMember]
 -> f (Maybe [GlobalReplicationGroupMember]))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_members = (GlobalReplicationGroup -> Maybe [GlobalReplicationGroupMember])
-> (GlobalReplicationGroup
    -> Maybe [GlobalReplicationGroupMember] -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe [GlobalReplicationGroupMember])
     (Maybe [GlobalReplicationGroupMember])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe [GlobalReplicationGroupMember]
members :: Maybe [GlobalReplicationGroupMember]
$sel:members:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe [GlobalReplicationGroupMember]
members} -> Maybe [GlobalReplicationGroupMember]
members) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe [GlobalReplicationGroupMember]
a -> GlobalReplicationGroup
s {$sel:members:GlobalReplicationGroup' :: Maybe [GlobalReplicationGroupMember]
members = Maybe [GlobalReplicationGroupMember]
a} :: GlobalReplicationGroup) ((Maybe [GlobalReplicationGroupMember]
  -> f (Maybe [GlobalReplicationGroupMember]))
 -> GlobalReplicationGroup -> f GlobalReplicationGroup)
-> ((Maybe [GlobalReplicationGroupMember]
     -> f (Maybe [GlobalReplicationGroupMember]))
    -> Maybe [GlobalReplicationGroupMember]
    -> f (Maybe [GlobalReplicationGroupMember]))
-> (Maybe [GlobalReplicationGroupMember]
    -> f (Maybe [GlobalReplicationGroupMember]))
-> GlobalReplicationGroup
-> f GlobalReplicationGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [GlobalReplicationGroupMember]
  [GlobalReplicationGroupMember]
  [GlobalReplicationGroupMember]
  [GlobalReplicationGroupMember]
-> Iso
     (Maybe [GlobalReplicationGroupMember])
     (Maybe [GlobalReplicationGroupMember])
     (Maybe [GlobalReplicationGroupMember])
     (Maybe [GlobalReplicationGroupMember])
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
  [GlobalReplicationGroupMember]
  [GlobalReplicationGroupMember]
  [GlobalReplicationGroupMember]
  [GlobalReplicationGroupMember]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Elasticache engine. For Redis only.
globalReplicationGroup_engine :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe Prelude.Text)
globalReplicationGroup_engine :: (Maybe Text -> f (Maybe Text))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_engine = (GlobalReplicationGroup -> Maybe Text)
-> (GlobalReplicationGroup -> Maybe Text -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe Text
engine :: Maybe Text
$sel:engine:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe Text
engine} -> Maybe Text
engine) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe Text
a -> GlobalReplicationGroup
s {$sel:engine:GlobalReplicationGroup' :: Maybe Text
engine = Maybe Text
a} :: GlobalReplicationGroup)

-- | A flag that enables using an @AuthToken@ (password) when issuing Redis
-- commands.
--
-- Default: @false@
globalReplicationGroup_authTokenEnabled :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe Prelude.Bool)
globalReplicationGroup_authTokenEnabled :: (Maybe Bool -> f (Maybe Bool))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_authTokenEnabled = (GlobalReplicationGroup -> Maybe Bool)
-> (GlobalReplicationGroup -> Maybe Bool -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe Bool
authTokenEnabled :: Maybe Bool
$sel:authTokenEnabled:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe Bool
authTokenEnabled} -> Maybe Bool
authTokenEnabled) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe Bool
a -> GlobalReplicationGroup
s {$sel:authTokenEnabled:GlobalReplicationGroup' :: Maybe Bool
authTokenEnabled = Maybe Bool
a} :: GlobalReplicationGroup)

-- | Indicates the slot configuration and global identifier for each slice
-- group.
globalReplicationGroup_globalNodeGroups :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe [GlobalNodeGroup])
globalReplicationGroup_globalNodeGroups :: (Maybe [GlobalNodeGroup] -> f (Maybe [GlobalNodeGroup]))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_globalNodeGroups = (GlobalReplicationGroup -> Maybe [GlobalNodeGroup])
-> (GlobalReplicationGroup
    -> Maybe [GlobalNodeGroup] -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe [GlobalNodeGroup])
     (Maybe [GlobalNodeGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe [GlobalNodeGroup]
globalNodeGroups :: Maybe [GlobalNodeGroup]
$sel:globalNodeGroups:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe [GlobalNodeGroup]
globalNodeGroups} -> Maybe [GlobalNodeGroup]
globalNodeGroups) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe [GlobalNodeGroup]
a -> GlobalReplicationGroup
s {$sel:globalNodeGroups:GlobalReplicationGroup' :: Maybe [GlobalNodeGroup]
globalNodeGroups = Maybe [GlobalNodeGroup]
a} :: GlobalReplicationGroup) ((Maybe [GlobalNodeGroup] -> f (Maybe [GlobalNodeGroup]))
 -> GlobalReplicationGroup -> f GlobalReplicationGroup)
-> ((Maybe [GlobalNodeGroup] -> f (Maybe [GlobalNodeGroup]))
    -> Maybe [GlobalNodeGroup] -> f (Maybe [GlobalNodeGroup]))
-> (Maybe [GlobalNodeGroup] -> f (Maybe [GlobalNodeGroup]))
-> GlobalReplicationGroup
-> f GlobalReplicationGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [GlobalNodeGroup]
  [GlobalNodeGroup]
  [GlobalNodeGroup]
  [GlobalNodeGroup]
-> Iso
     (Maybe [GlobalNodeGroup])
     (Maybe [GlobalNodeGroup])
     (Maybe [GlobalNodeGroup])
     (Maybe [GlobalNodeGroup])
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
  [GlobalNodeGroup]
  [GlobalNodeGroup]
  [GlobalNodeGroup]
  [GlobalNodeGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the Global datastore
globalReplicationGroup_globalReplicationGroupId :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe Prelude.Text)
globalReplicationGroup_globalReplicationGroupId :: (Maybe Text -> f (Maybe Text))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_globalReplicationGroupId = (GlobalReplicationGroup -> Maybe Text)
-> (GlobalReplicationGroup -> Maybe Text -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe Text
globalReplicationGroupId :: Maybe Text
$sel:globalReplicationGroupId:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe Text
globalReplicationGroupId} -> Maybe Text
globalReplicationGroupId) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe Text
a -> GlobalReplicationGroup
s {$sel:globalReplicationGroupId:GlobalReplicationGroup' :: Maybe Text
globalReplicationGroupId = Maybe Text
a} :: GlobalReplicationGroup)

-- | The optional description of the Global datastore
globalReplicationGroup_globalReplicationGroupDescription :: Lens.Lens' GlobalReplicationGroup (Prelude.Maybe Prelude.Text)
globalReplicationGroup_globalReplicationGroupDescription :: (Maybe Text -> f (Maybe Text))
-> GlobalReplicationGroup -> f GlobalReplicationGroup
globalReplicationGroup_globalReplicationGroupDescription = (GlobalReplicationGroup -> Maybe Text)
-> (GlobalReplicationGroup -> Maybe Text -> GlobalReplicationGroup)
-> Lens
     GlobalReplicationGroup
     GlobalReplicationGroup
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalReplicationGroup' {Maybe Text
globalReplicationGroupDescription :: Maybe Text
$sel:globalReplicationGroupDescription:GlobalReplicationGroup' :: GlobalReplicationGroup -> Maybe Text
globalReplicationGroupDescription} -> Maybe Text
globalReplicationGroupDescription) (\s :: GlobalReplicationGroup
s@GlobalReplicationGroup' {} Maybe Text
a -> GlobalReplicationGroup
s {$sel:globalReplicationGroupDescription:GlobalReplicationGroup' :: Maybe Text
globalReplicationGroupDescription = Maybe Text
a} :: GlobalReplicationGroup)

instance Core.FromXML GlobalReplicationGroup where
  parseXML :: [Node] -> Either String GlobalReplicationGroup
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe [GlobalReplicationGroupMember]
-> Maybe Text
-> Maybe Bool
-> Maybe [GlobalNodeGroup]
-> Maybe Text
-> Maybe Text
-> GlobalReplicationGroup
GlobalReplicationGroup'
      (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Bool
 -> Maybe [GlobalReplicationGroupMember]
 -> Maybe Text
 -> Maybe Bool
 -> Maybe [GlobalNodeGroup]
 -> Maybe Text
 -> Maybe Text
 -> GlobalReplicationGroup)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalReplicationGroupMember]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalNodeGroup]
      -> Maybe Text
      -> Maybe Text
      -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EngineVersion")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalReplicationGroupMember]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalNodeGroup]
   -> Maybe Text
   -> Maybe Text
   -> GlobalReplicationGroup)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalReplicationGroupMember]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalNodeGroup]
      -> Maybe Text
      -> Maybe Text
      -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
      Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalReplicationGroupMember]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalNodeGroup]
   -> Maybe Text
   -> Maybe Text
   -> GlobalReplicationGroup)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalReplicationGroupMember]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalNodeGroup]
      -> Maybe Text
      -> Maybe Text
      -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CacheNodeType")
      Either
  String
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalReplicationGroupMember]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalNodeGroup]
   -> Maybe Text
   -> Maybe Text
   -> GlobalReplicationGroup)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalReplicationGroupMember]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalNodeGroup]
      -> Maybe Text
      -> Maybe Text
      -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ClusterEnabled")
      Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalReplicationGroupMember]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalNodeGroup]
   -> Maybe Text
   -> Maybe Text
   -> GlobalReplicationGroup)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalReplicationGroupMember]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalNodeGroup]
      -> Maybe Text
      -> Maybe Text
      -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AtRestEncryptionEnabled")
      Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalReplicationGroupMember]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalNodeGroup]
   -> Maybe Text
   -> Maybe Text
   -> GlobalReplicationGroup)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe [GlobalReplicationGroupMember]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalNodeGroup]
      -> Maybe Text
      -> Maybe Text
      -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ARN")
      Either
  String
  (Maybe Bool
   -> Maybe [GlobalReplicationGroupMember]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalNodeGroup]
   -> Maybe Text
   -> Maybe Text
   -> GlobalReplicationGroup)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe [GlobalReplicationGroupMember]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalNodeGroup]
      -> Maybe Text
      -> Maybe Text
      -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TransitEncryptionEnabled")
      Either
  String
  (Maybe [GlobalReplicationGroupMember]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalNodeGroup]
   -> Maybe Text
   -> Maybe Text
   -> GlobalReplicationGroup)
-> Either String (Maybe [GlobalReplicationGroupMember])
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe [GlobalNodeGroup]
      -> Maybe Text
      -> Maybe Text
      -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Members" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [GlobalReplicationGroupMember]))
-> Either String (Maybe [GlobalReplicationGroupMember])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [GlobalReplicationGroupMember])
-> [Node] -> Either String (Maybe [GlobalReplicationGroupMember])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                        (Text -> [Node] -> Either String [GlobalReplicationGroupMember]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"GlobalReplicationGroupMember")
                  )
      Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe [GlobalNodeGroup]
   -> Maybe Text
   -> Maybe Text
   -> GlobalReplicationGroup)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe [GlobalNodeGroup]
      -> Maybe Text
      -> Maybe Text
      -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Engine")
      Either
  String
  (Maybe Bool
   -> Maybe [GlobalNodeGroup]
   -> Maybe Text
   -> Maybe Text
   -> GlobalReplicationGroup)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe [GlobalNodeGroup]
      -> Maybe Text -> Maybe Text -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AuthTokenEnabled")
      Either
  String
  (Maybe [GlobalNodeGroup]
   -> Maybe Text -> Maybe Text -> GlobalReplicationGroup)
-> Either String (Maybe [GlobalNodeGroup])
-> Either
     String (Maybe Text -> Maybe Text -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"GlobalNodeGroups"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [GlobalNodeGroup]))
-> Either String (Maybe [GlobalNodeGroup])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [GlobalNodeGroup])
-> [Node] -> Either String (Maybe [GlobalNodeGroup])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [GlobalNodeGroup]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"GlobalNodeGroup")
                  )
      Either String (Maybe Text -> Maybe Text -> GlobalReplicationGroup)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> GlobalReplicationGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"GlobalReplicationGroupId")
      Either String (Maybe Text -> GlobalReplicationGroup)
-> Either String (Maybe Text)
-> Either String GlobalReplicationGroup
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"GlobalReplicationGroupDescription")

instance Prelude.Hashable GlobalReplicationGroup

instance Prelude.NFData GlobalReplicationGroup