{-# 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.DocumentDB.Types.GlobalCluster
-- 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.DocumentDB.Types.GlobalCluster where

import qualified Amazonka.Core as Core
import Amazonka.DocumentDB.Types.GlobalClusterMember
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A data type representing an Amazon DocumentDB global cluster.
--
-- /See:/ 'newGlobalCluster' smart constructor.
data GlobalCluster = GlobalCluster'
  { -- | Indicates the database engine version.
    GlobalCluster -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | Specifies the current state of this global cluster.
    GlobalCluster -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The deletion protection setting for the new global cluster.
    GlobalCluster -> Maybe Bool
deletionProtection :: Prelude.Maybe Prelude.Bool,
    -- | The storage encryption setting for the global cluster.
    GlobalCluster -> Maybe Bool
storageEncrypted :: Prelude.Maybe Prelude.Bool,
    -- | Contains a user-supplied global cluster identifier. This identifier is
    -- the unique key that identifies a global cluster.
    GlobalCluster -> Maybe Text
globalClusterIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The Amazon DocumentDB database engine used by the global cluster.
    GlobalCluster -> Maybe Text
engine :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the global cluster.
    GlobalCluster -> Maybe Text
globalClusterArn :: Prelude.Maybe Prelude.Text,
    -- | The default database name within the new global cluster.
    GlobalCluster -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
    -- | The list of cluster IDs for secondary clusters within the global
    -- cluster. Currently limited to one item.
    GlobalCluster -> Maybe [GlobalClusterMember]
globalClusterMembers :: Prelude.Maybe [GlobalClusterMember],
    -- | The Region-unique, immutable identifier for the global database cluster.
    -- This identifier is found in AWS CloudTrail log entries whenever the AWS
    -- KMS customer master key (CMK) for the cluster is accessed.
    GlobalCluster -> Maybe Text
globalClusterResourceId :: Prelude.Maybe Prelude.Text
  }
  deriving (GlobalCluster -> GlobalCluster -> Bool
(GlobalCluster -> GlobalCluster -> Bool)
-> (GlobalCluster -> GlobalCluster -> Bool) -> Eq GlobalCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlobalCluster -> GlobalCluster -> Bool
$c/= :: GlobalCluster -> GlobalCluster -> Bool
== :: GlobalCluster -> GlobalCluster -> Bool
$c== :: GlobalCluster -> GlobalCluster -> Bool
Prelude.Eq, ReadPrec [GlobalCluster]
ReadPrec GlobalCluster
Int -> ReadS GlobalCluster
ReadS [GlobalCluster]
(Int -> ReadS GlobalCluster)
-> ReadS [GlobalCluster]
-> ReadPrec GlobalCluster
-> ReadPrec [GlobalCluster]
-> Read GlobalCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GlobalCluster]
$creadListPrec :: ReadPrec [GlobalCluster]
readPrec :: ReadPrec GlobalCluster
$creadPrec :: ReadPrec GlobalCluster
readList :: ReadS [GlobalCluster]
$creadList :: ReadS [GlobalCluster]
readsPrec :: Int -> ReadS GlobalCluster
$creadsPrec :: Int -> ReadS GlobalCluster
Prelude.Read, Int -> GlobalCluster -> ShowS
[GlobalCluster] -> ShowS
GlobalCluster -> String
(Int -> GlobalCluster -> ShowS)
-> (GlobalCluster -> String)
-> ([GlobalCluster] -> ShowS)
-> Show GlobalCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GlobalCluster] -> ShowS
$cshowList :: [GlobalCluster] -> ShowS
show :: GlobalCluster -> String
$cshow :: GlobalCluster -> String
showsPrec :: Int -> GlobalCluster -> ShowS
$cshowsPrec :: Int -> GlobalCluster -> ShowS
Prelude.Show, (forall x. GlobalCluster -> Rep GlobalCluster x)
-> (forall x. Rep GlobalCluster x -> GlobalCluster)
-> Generic GlobalCluster
forall x. Rep GlobalCluster x -> GlobalCluster
forall x. GlobalCluster -> Rep GlobalCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GlobalCluster x -> GlobalCluster
$cfrom :: forall x. GlobalCluster -> Rep GlobalCluster x
Prelude.Generic)

-- |
-- Create a value of 'GlobalCluster' 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', 'globalCluster_engineVersion' - Indicates the database engine version.
--
-- 'status', 'globalCluster_status' - Specifies the current state of this global cluster.
--
-- 'deletionProtection', 'globalCluster_deletionProtection' - The deletion protection setting for the new global cluster.
--
-- 'storageEncrypted', 'globalCluster_storageEncrypted' - The storage encryption setting for the global cluster.
--
-- 'globalClusterIdentifier', 'globalCluster_globalClusterIdentifier' - Contains a user-supplied global cluster identifier. This identifier is
-- the unique key that identifies a global cluster.
--
-- 'engine', 'globalCluster_engine' - The Amazon DocumentDB database engine used by the global cluster.
--
-- 'globalClusterArn', 'globalCluster_globalClusterArn' - The Amazon Resource Name (ARN) for the global cluster.
--
-- 'databaseName', 'globalCluster_databaseName' - The default database name within the new global cluster.
--
-- 'globalClusterMembers', 'globalCluster_globalClusterMembers' - The list of cluster IDs for secondary clusters within the global
-- cluster. Currently limited to one item.
--
-- 'globalClusterResourceId', 'globalCluster_globalClusterResourceId' - The Region-unique, immutable identifier for the global database cluster.
-- This identifier is found in AWS CloudTrail log entries whenever the AWS
-- KMS customer master key (CMK) for the cluster is accessed.
newGlobalCluster ::
  GlobalCluster
newGlobalCluster :: GlobalCluster
newGlobalCluster =
  GlobalCluster' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [GlobalClusterMember]
-> Maybe Text
-> GlobalCluster
GlobalCluster'
    { $sel:engineVersion:GlobalCluster' :: Maybe Text
engineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:GlobalCluster' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deletionProtection:GlobalCluster' :: Maybe Bool
deletionProtection = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:storageEncrypted:GlobalCluster' :: Maybe Bool
storageEncrypted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:globalClusterIdentifier:GlobalCluster' :: Maybe Text
globalClusterIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:engine:GlobalCluster' :: Maybe Text
engine = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:globalClusterArn:GlobalCluster' :: Maybe Text
globalClusterArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:GlobalCluster' :: Maybe Text
databaseName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:globalClusterMembers:GlobalCluster' :: Maybe [GlobalClusterMember]
globalClusterMembers = Maybe [GlobalClusterMember]
forall a. Maybe a
Prelude.Nothing,
      $sel:globalClusterResourceId:GlobalCluster' :: Maybe Text
globalClusterResourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates the database engine version.
globalCluster_engineVersion :: Lens.Lens' GlobalCluster (Prelude.Maybe Prelude.Text)
globalCluster_engineVersion :: (Maybe Text -> f (Maybe Text)) -> GlobalCluster -> f GlobalCluster
globalCluster_engineVersion = (GlobalCluster -> Maybe Text)
-> (GlobalCluster -> Maybe Text -> GlobalCluster)
-> Lens GlobalCluster GlobalCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalCluster' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:GlobalCluster' :: GlobalCluster -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: GlobalCluster
s@GlobalCluster' {} Maybe Text
a -> GlobalCluster
s {$sel:engineVersion:GlobalCluster' :: Maybe Text
engineVersion = Maybe Text
a} :: GlobalCluster)

-- | Specifies the current state of this global cluster.
globalCluster_status :: Lens.Lens' GlobalCluster (Prelude.Maybe Prelude.Text)
globalCluster_status :: (Maybe Text -> f (Maybe Text)) -> GlobalCluster -> f GlobalCluster
globalCluster_status = (GlobalCluster -> Maybe Text)
-> (GlobalCluster -> Maybe Text -> GlobalCluster)
-> Lens GlobalCluster GlobalCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalCluster' {Maybe Text
status :: Maybe Text
$sel:status:GlobalCluster' :: GlobalCluster -> Maybe Text
status} -> Maybe Text
status) (\s :: GlobalCluster
s@GlobalCluster' {} Maybe Text
a -> GlobalCluster
s {$sel:status:GlobalCluster' :: Maybe Text
status = Maybe Text
a} :: GlobalCluster)

-- | The deletion protection setting for the new global cluster.
globalCluster_deletionProtection :: Lens.Lens' GlobalCluster (Prelude.Maybe Prelude.Bool)
globalCluster_deletionProtection :: (Maybe Bool -> f (Maybe Bool)) -> GlobalCluster -> f GlobalCluster
globalCluster_deletionProtection = (GlobalCluster -> Maybe Bool)
-> (GlobalCluster -> Maybe Bool -> GlobalCluster)
-> Lens GlobalCluster GlobalCluster (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalCluster' {Maybe Bool
deletionProtection :: Maybe Bool
$sel:deletionProtection:GlobalCluster' :: GlobalCluster -> Maybe Bool
deletionProtection} -> Maybe Bool
deletionProtection) (\s :: GlobalCluster
s@GlobalCluster' {} Maybe Bool
a -> GlobalCluster
s {$sel:deletionProtection:GlobalCluster' :: Maybe Bool
deletionProtection = Maybe Bool
a} :: GlobalCluster)

-- | The storage encryption setting for the global cluster.
globalCluster_storageEncrypted :: Lens.Lens' GlobalCluster (Prelude.Maybe Prelude.Bool)
globalCluster_storageEncrypted :: (Maybe Bool -> f (Maybe Bool)) -> GlobalCluster -> f GlobalCluster
globalCluster_storageEncrypted = (GlobalCluster -> Maybe Bool)
-> (GlobalCluster -> Maybe Bool -> GlobalCluster)
-> Lens GlobalCluster GlobalCluster (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalCluster' {Maybe Bool
storageEncrypted :: Maybe Bool
$sel:storageEncrypted:GlobalCluster' :: GlobalCluster -> Maybe Bool
storageEncrypted} -> Maybe Bool
storageEncrypted) (\s :: GlobalCluster
s@GlobalCluster' {} Maybe Bool
a -> GlobalCluster
s {$sel:storageEncrypted:GlobalCluster' :: Maybe Bool
storageEncrypted = Maybe Bool
a} :: GlobalCluster)

-- | Contains a user-supplied global cluster identifier. This identifier is
-- the unique key that identifies a global cluster.
globalCluster_globalClusterIdentifier :: Lens.Lens' GlobalCluster (Prelude.Maybe Prelude.Text)
globalCluster_globalClusterIdentifier :: (Maybe Text -> f (Maybe Text)) -> GlobalCluster -> f GlobalCluster
globalCluster_globalClusterIdentifier = (GlobalCluster -> Maybe Text)
-> (GlobalCluster -> Maybe Text -> GlobalCluster)
-> Lens GlobalCluster GlobalCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalCluster' {Maybe Text
globalClusterIdentifier :: Maybe Text
$sel:globalClusterIdentifier:GlobalCluster' :: GlobalCluster -> Maybe Text
globalClusterIdentifier} -> Maybe Text
globalClusterIdentifier) (\s :: GlobalCluster
s@GlobalCluster' {} Maybe Text
a -> GlobalCluster
s {$sel:globalClusterIdentifier:GlobalCluster' :: Maybe Text
globalClusterIdentifier = Maybe Text
a} :: GlobalCluster)

-- | The Amazon DocumentDB database engine used by the global cluster.
globalCluster_engine :: Lens.Lens' GlobalCluster (Prelude.Maybe Prelude.Text)
globalCluster_engine :: (Maybe Text -> f (Maybe Text)) -> GlobalCluster -> f GlobalCluster
globalCluster_engine = (GlobalCluster -> Maybe Text)
-> (GlobalCluster -> Maybe Text -> GlobalCluster)
-> Lens GlobalCluster GlobalCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalCluster' {Maybe Text
engine :: Maybe Text
$sel:engine:GlobalCluster' :: GlobalCluster -> Maybe Text
engine} -> Maybe Text
engine) (\s :: GlobalCluster
s@GlobalCluster' {} Maybe Text
a -> GlobalCluster
s {$sel:engine:GlobalCluster' :: Maybe Text
engine = Maybe Text
a} :: GlobalCluster)

-- | The Amazon Resource Name (ARN) for the global cluster.
globalCluster_globalClusterArn :: Lens.Lens' GlobalCluster (Prelude.Maybe Prelude.Text)
globalCluster_globalClusterArn :: (Maybe Text -> f (Maybe Text)) -> GlobalCluster -> f GlobalCluster
globalCluster_globalClusterArn = (GlobalCluster -> Maybe Text)
-> (GlobalCluster -> Maybe Text -> GlobalCluster)
-> Lens GlobalCluster GlobalCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalCluster' {Maybe Text
globalClusterArn :: Maybe Text
$sel:globalClusterArn:GlobalCluster' :: GlobalCluster -> Maybe Text
globalClusterArn} -> Maybe Text
globalClusterArn) (\s :: GlobalCluster
s@GlobalCluster' {} Maybe Text
a -> GlobalCluster
s {$sel:globalClusterArn:GlobalCluster' :: Maybe Text
globalClusterArn = Maybe Text
a} :: GlobalCluster)

-- | The default database name within the new global cluster.
globalCluster_databaseName :: Lens.Lens' GlobalCluster (Prelude.Maybe Prelude.Text)
globalCluster_databaseName :: (Maybe Text -> f (Maybe Text)) -> GlobalCluster -> f GlobalCluster
globalCluster_databaseName = (GlobalCluster -> Maybe Text)
-> (GlobalCluster -> Maybe Text -> GlobalCluster)
-> Lens GlobalCluster GlobalCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalCluster' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:GlobalCluster' :: GlobalCluster -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: GlobalCluster
s@GlobalCluster' {} Maybe Text
a -> GlobalCluster
s {$sel:databaseName:GlobalCluster' :: Maybe Text
databaseName = Maybe Text
a} :: GlobalCluster)

-- | The list of cluster IDs for secondary clusters within the global
-- cluster. Currently limited to one item.
globalCluster_globalClusterMembers :: Lens.Lens' GlobalCluster (Prelude.Maybe [GlobalClusterMember])
globalCluster_globalClusterMembers :: (Maybe [GlobalClusterMember] -> f (Maybe [GlobalClusterMember]))
-> GlobalCluster -> f GlobalCluster
globalCluster_globalClusterMembers = (GlobalCluster -> Maybe [GlobalClusterMember])
-> (GlobalCluster -> Maybe [GlobalClusterMember] -> GlobalCluster)
-> Lens
     GlobalCluster
     GlobalCluster
     (Maybe [GlobalClusterMember])
     (Maybe [GlobalClusterMember])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalCluster' {Maybe [GlobalClusterMember]
globalClusterMembers :: Maybe [GlobalClusterMember]
$sel:globalClusterMembers:GlobalCluster' :: GlobalCluster -> Maybe [GlobalClusterMember]
globalClusterMembers} -> Maybe [GlobalClusterMember]
globalClusterMembers) (\s :: GlobalCluster
s@GlobalCluster' {} Maybe [GlobalClusterMember]
a -> GlobalCluster
s {$sel:globalClusterMembers:GlobalCluster' :: Maybe [GlobalClusterMember]
globalClusterMembers = Maybe [GlobalClusterMember]
a} :: GlobalCluster) ((Maybe [GlobalClusterMember] -> f (Maybe [GlobalClusterMember]))
 -> GlobalCluster -> f GlobalCluster)
-> ((Maybe [GlobalClusterMember]
     -> f (Maybe [GlobalClusterMember]))
    -> Maybe [GlobalClusterMember] -> f (Maybe [GlobalClusterMember]))
-> (Maybe [GlobalClusterMember] -> f (Maybe [GlobalClusterMember]))
-> GlobalCluster
-> f GlobalCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [GlobalClusterMember]
  [GlobalClusterMember]
  [GlobalClusterMember]
  [GlobalClusterMember]
-> Iso
     (Maybe [GlobalClusterMember])
     (Maybe [GlobalClusterMember])
     (Maybe [GlobalClusterMember])
     (Maybe [GlobalClusterMember])
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
  [GlobalClusterMember]
  [GlobalClusterMember]
  [GlobalClusterMember]
  [GlobalClusterMember]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Region-unique, immutable identifier for the global database cluster.
-- This identifier is found in AWS CloudTrail log entries whenever the AWS
-- KMS customer master key (CMK) for the cluster is accessed.
globalCluster_globalClusterResourceId :: Lens.Lens' GlobalCluster (Prelude.Maybe Prelude.Text)
globalCluster_globalClusterResourceId :: (Maybe Text -> f (Maybe Text)) -> GlobalCluster -> f GlobalCluster
globalCluster_globalClusterResourceId = (GlobalCluster -> Maybe Text)
-> (GlobalCluster -> Maybe Text -> GlobalCluster)
-> Lens GlobalCluster GlobalCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalCluster' {Maybe Text
globalClusterResourceId :: Maybe Text
$sel:globalClusterResourceId:GlobalCluster' :: GlobalCluster -> Maybe Text
globalClusterResourceId} -> Maybe Text
globalClusterResourceId) (\s :: GlobalCluster
s@GlobalCluster' {} Maybe Text
a -> GlobalCluster
s {$sel:globalClusterResourceId:GlobalCluster' :: Maybe Text
globalClusterResourceId = Maybe Text
a} :: GlobalCluster)

instance Core.FromXML GlobalCluster where
  parseXML :: [Node] -> Either String GlobalCluster
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [GlobalClusterMember]
-> Maybe Text
-> GlobalCluster
GlobalCluster'
      (Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [GlobalClusterMember]
 -> Maybe Text
 -> GlobalCluster)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [GlobalClusterMember]
      -> Maybe Text
      -> GlobalCluster)
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 Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [GlobalClusterMember]
   -> Maybe Text
   -> GlobalCluster)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [GlobalClusterMember]
      -> Maybe Text
      -> GlobalCluster)
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 Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [GlobalClusterMember]
   -> Maybe Text
   -> GlobalCluster)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [GlobalClusterMember]
      -> Maybe Text
      -> GlobalCluster)
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
"DeletionProtection")
      Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [GlobalClusterMember]
   -> Maybe Text
   -> GlobalCluster)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [GlobalClusterMember]
      -> Maybe Text
      -> GlobalCluster)
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
"StorageEncrypted")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [GlobalClusterMember]
   -> Maybe Text
   -> GlobalCluster)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [GlobalClusterMember]
      -> Maybe Text
      -> GlobalCluster)
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
"GlobalClusterIdentifier")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [GlobalClusterMember]
   -> Maybe Text
   -> GlobalCluster)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe [GlobalClusterMember]
      -> Maybe Text
      -> GlobalCluster)
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 Text
   -> Maybe Text
   -> Maybe [GlobalClusterMember]
   -> Maybe Text
   -> GlobalCluster)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [GlobalClusterMember] -> Maybe Text -> GlobalCluster)
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
"GlobalClusterArn")
      Either
  String
  (Maybe Text
   -> Maybe [GlobalClusterMember] -> Maybe Text -> GlobalCluster)
-> Either String (Maybe Text)
-> Either
     String (Maybe [GlobalClusterMember] -> Maybe Text -> GlobalCluster)
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
"DatabaseName")
      Either
  String (Maybe [GlobalClusterMember] -> Maybe Text -> GlobalCluster)
-> Either String (Maybe [GlobalClusterMember])
-> Either String (Maybe Text -> GlobalCluster)
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
"GlobalClusterMembers"
                      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 [GlobalClusterMember]))
-> Either String (Maybe [GlobalClusterMember])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [GlobalClusterMember])
-> [Node] -> Either String (Maybe [GlobalClusterMember])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [GlobalClusterMember]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"GlobalClusterMember")
                  )
      Either String (Maybe Text -> GlobalCluster)
-> Either String (Maybe Text) -> Either String GlobalCluster
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
"GlobalClusterResourceId")

instance Prelude.Hashable GlobalCluster

instance Prelude.NFData GlobalCluster