{-# 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.SecurityHub.Types.AwsDynamoDbTableReplica
-- 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.SecurityHub.Types.AwsDynamoDbTableReplica where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsDynamoDbTableProvisionedThroughputOverride
import Amazonka.SecurityHub.Types.AwsDynamoDbTableReplicaGlobalSecondaryIndex

-- | Information about a replica of a DynamoDB table.
--
-- /See:/ 'newAwsDynamoDbTableReplica' smart constructor.
data AwsDynamoDbTableReplica = AwsDynamoDbTableReplica'
  { -- | The current status of the replica.
    AwsDynamoDbTableReplica -> Maybe Text
replicaStatus :: Prelude.Maybe Prelude.Text,
    -- | The name of the Region where the replica is located.
    AwsDynamoDbTableReplica -> Maybe Text
regionName :: Prelude.Maybe Prelude.Text,
    -- | Detailed information about the replica status.
    AwsDynamoDbTableReplica -> Maybe Text
replicaStatusDescription :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the KMS key that will be used for KMS encryption for
    -- the replica.
    AwsDynamoDbTableReplica -> Maybe Text
kmsMasterKeyId :: Prelude.Maybe Prelude.Text,
    -- | Replica-specific configuration for the provisioned throughput.
    AwsDynamoDbTableReplica
-> Maybe AwsDynamoDbTableProvisionedThroughputOverride
provisionedThroughputOverride :: Prelude.Maybe AwsDynamoDbTableProvisionedThroughputOverride,
    -- | List of global secondary indexes for the replica.
    AwsDynamoDbTableReplica
-> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
globalSecondaryIndexes :: Prelude.Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
  }
  deriving (AwsDynamoDbTableReplica -> AwsDynamoDbTableReplica -> Bool
(AwsDynamoDbTableReplica -> AwsDynamoDbTableReplica -> Bool)
-> (AwsDynamoDbTableReplica -> AwsDynamoDbTableReplica -> Bool)
-> Eq AwsDynamoDbTableReplica
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsDynamoDbTableReplica -> AwsDynamoDbTableReplica -> Bool
$c/= :: AwsDynamoDbTableReplica -> AwsDynamoDbTableReplica -> Bool
== :: AwsDynamoDbTableReplica -> AwsDynamoDbTableReplica -> Bool
$c== :: AwsDynamoDbTableReplica -> AwsDynamoDbTableReplica -> Bool
Prelude.Eq, ReadPrec [AwsDynamoDbTableReplica]
ReadPrec AwsDynamoDbTableReplica
Int -> ReadS AwsDynamoDbTableReplica
ReadS [AwsDynamoDbTableReplica]
(Int -> ReadS AwsDynamoDbTableReplica)
-> ReadS [AwsDynamoDbTableReplica]
-> ReadPrec AwsDynamoDbTableReplica
-> ReadPrec [AwsDynamoDbTableReplica]
-> Read AwsDynamoDbTableReplica
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsDynamoDbTableReplica]
$creadListPrec :: ReadPrec [AwsDynamoDbTableReplica]
readPrec :: ReadPrec AwsDynamoDbTableReplica
$creadPrec :: ReadPrec AwsDynamoDbTableReplica
readList :: ReadS [AwsDynamoDbTableReplica]
$creadList :: ReadS [AwsDynamoDbTableReplica]
readsPrec :: Int -> ReadS AwsDynamoDbTableReplica
$creadsPrec :: Int -> ReadS AwsDynamoDbTableReplica
Prelude.Read, Int -> AwsDynamoDbTableReplica -> ShowS
[AwsDynamoDbTableReplica] -> ShowS
AwsDynamoDbTableReplica -> String
(Int -> AwsDynamoDbTableReplica -> ShowS)
-> (AwsDynamoDbTableReplica -> String)
-> ([AwsDynamoDbTableReplica] -> ShowS)
-> Show AwsDynamoDbTableReplica
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsDynamoDbTableReplica] -> ShowS
$cshowList :: [AwsDynamoDbTableReplica] -> ShowS
show :: AwsDynamoDbTableReplica -> String
$cshow :: AwsDynamoDbTableReplica -> String
showsPrec :: Int -> AwsDynamoDbTableReplica -> ShowS
$cshowsPrec :: Int -> AwsDynamoDbTableReplica -> ShowS
Prelude.Show, (forall x.
 AwsDynamoDbTableReplica -> Rep AwsDynamoDbTableReplica x)
-> (forall x.
    Rep AwsDynamoDbTableReplica x -> AwsDynamoDbTableReplica)
-> Generic AwsDynamoDbTableReplica
forall x. Rep AwsDynamoDbTableReplica x -> AwsDynamoDbTableReplica
forall x. AwsDynamoDbTableReplica -> Rep AwsDynamoDbTableReplica x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsDynamoDbTableReplica x -> AwsDynamoDbTableReplica
$cfrom :: forall x. AwsDynamoDbTableReplica -> Rep AwsDynamoDbTableReplica x
Prelude.Generic)

-- |
-- Create a value of 'AwsDynamoDbTableReplica' 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:
--
-- 'replicaStatus', 'awsDynamoDbTableReplica_replicaStatus' - The current status of the replica.
--
-- 'regionName', 'awsDynamoDbTableReplica_regionName' - The name of the Region where the replica is located.
--
-- 'replicaStatusDescription', 'awsDynamoDbTableReplica_replicaStatusDescription' - Detailed information about the replica status.
--
-- 'kmsMasterKeyId', 'awsDynamoDbTableReplica_kmsMasterKeyId' - The identifier of the KMS key that will be used for KMS encryption for
-- the replica.
--
-- 'provisionedThroughputOverride', 'awsDynamoDbTableReplica_provisionedThroughputOverride' - Replica-specific configuration for the provisioned throughput.
--
-- 'globalSecondaryIndexes', 'awsDynamoDbTableReplica_globalSecondaryIndexes' - List of global secondary indexes for the replica.
newAwsDynamoDbTableReplica ::
  AwsDynamoDbTableReplica
newAwsDynamoDbTableReplica :: AwsDynamoDbTableReplica
newAwsDynamoDbTableReplica =
  AwsDynamoDbTableReplica' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AwsDynamoDbTableProvisionedThroughputOverride
-> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
-> AwsDynamoDbTableReplica
AwsDynamoDbTableReplica'
    { $sel:replicaStatus:AwsDynamoDbTableReplica' :: Maybe Text
replicaStatus =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:regionName:AwsDynamoDbTableReplica' :: Maybe Text
regionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:replicaStatusDescription:AwsDynamoDbTableReplica' :: Maybe Text
replicaStatusDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsMasterKeyId:AwsDynamoDbTableReplica' :: Maybe Text
kmsMasterKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedThroughputOverride:AwsDynamoDbTableReplica' :: Maybe AwsDynamoDbTableProvisionedThroughputOverride
provisionedThroughputOverride = Maybe AwsDynamoDbTableProvisionedThroughputOverride
forall a. Maybe a
Prelude.Nothing,
      $sel:globalSecondaryIndexes:AwsDynamoDbTableReplica' :: Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
globalSecondaryIndexes = Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
forall a. Maybe a
Prelude.Nothing
    }

-- | The current status of the replica.
awsDynamoDbTableReplica_replicaStatus :: Lens.Lens' AwsDynamoDbTableReplica (Prelude.Maybe Prelude.Text)
awsDynamoDbTableReplica_replicaStatus :: (Maybe Text -> f (Maybe Text))
-> AwsDynamoDbTableReplica -> f AwsDynamoDbTableReplica
awsDynamoDbTableReplica_replicaStatus = (AwsDynamoDbTableReplica -> Maybe Text)
-> (AwsDynamoDbTableReplica
    -> Maybe Text -> AwsDynamoDbTableReplica)
-> Lens
     AwsDynamoDbTableReplica
     AwsDynamoDbTableReplica
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableReplica' {Maybe Text
replicaStatus :: Maybe Text
$sel:replicaStatus:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica -> Maybe Text
replicaStatus} -> Maybe Text
replicaStatus) (\s :: AwsDynamoDbTableReplica
s@AwsDynamoDbTableReplica' {} Maybe Text
a -> AwsDynamoDbTableReplica
s {$sel:replicaStatus:AwsDynamoDbTableReplica' :: Maybe Text
replicaStatus = Maybe Text
a} :: AwsDynamoDbTableReplica)

-- | The name of the Region where the replica is located.
awsDynamoDbTableReplica_regionName :: Lens.Lens' AwsDynamoDbTableReplica (Prelude.Maybe Prelude.Text)
awsDynamoDbTableReplica_regionName :: (Maybe Text -> f (Maybe Text))
-> AwsDynamoDbTableReplica -> f AwsDynamoDbTableReplica
awsDynamoDbTableReplica_regionName = (AwsDynamoDbTableReplica -> Maybe Text)
-> (AwsDynamoDbTableReplica
    -> Maybe Text -> AwsDynamoDbTableReplica)
-> Lens
     AwsDynamoDbTableReplica
     AwsDynamoDbTableReplica
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableReplica' {Maybe Text
regionName :: Maybe Text
$sel:regionName:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica -> Maybe Text
regionName} -> Maybe Text
regionName) (\s :: AwsDynamoDbTableReplica
s@AwsDynamoDbTableReplica' {} Maybe Text
a -> AwsDynamoDbTableReplica
s {$sel:regionName:AwsDynamoDbTableReplica' :: Maybe Text
regionName = Maybe Text
a} :: AwsDynamoDbTableReplica)

-- | Detailed information about the replica status.
awsDynamoDbTableReplica_replicaStatusDescription :: Lens.Lens' AwsDynamoDbTableReplica (Prelude.Maybe Prelude.Text)
awsDynamoDbTableReplica_replicaStatusDescription :: (Maybe Text -> f (Maybe Text))
-> AwsDynamoDbTableReplica -> f AwsDynamoDbTableReplica
awsDynamoDbTableReplica_replicaStatusDescription = (AwsDynamoDbTableReplica -> Maybe Text)
-> (AwsDynamoDbTableReplica
    -> Maybe Text -> AwsDynamoDbTableReplica)
-> Lens
     AwsDynamoDbTableReplica
     AwsDynamoDbTableReplica
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableReplica' {Maybe Text
replicaStatusDescription :: Maybe Text
$sel:replicaStatusDescription:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica -> Maybe Text
replicaStatusDescription} -> Maybe Text
replicaStatusDescription) (\s :: AwsDynamoDbTableReplica
s@AwsDynamoDbTableReplica' {} Maybe Text
a -> AwsDynamoDbTableReplica
s {$sel:replicaStatusDescription:AwsDynamoDbTableReplica' :: Maybe Text
replicaStatusDescription = Maybe Text
a} :: AwsDynamoDbTableReplica)

-- | The identifier of the KMS key that will be used for KMS encryption for
-- the replica.
awsDynamoDbTableReplica_kmsMasterKeyId :: Lens.Lens' AwsDynamoDbTableReplica (Prelude.Maybe Prelude.Text)
awsDynamoDbTableReplica_kmsMasterKeyId :: (Maybe Text -> f (Maybe Text))
-> AwsDynamoDbTableReplica -> f AwsDynamoDbTableReplica
awsDynamoDbTableReplica_kmsMasterKeyId = (AwsDynamoDbTableReplica -> Maybe Text)
-> (AwsDynamoDbTableReplica
    -> Maybe Text -> AwsDynamoDbTableReplica)
-> Lens
     AwsDynamoDbTableReplica
     AwsDynamoDbTableReplica
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableReplica' {Maybe Text
kmsMasterKeyId :: Maybe Text
$sel:kmsMasterKeyId:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica -> Maybe Text
kmsMasterKeyId} -> Maybe Text
kmsMasterKeyId) (\s :: AwsDynamoDbTableReplica
s@AwsDynamoDbTableReplica' {} Maybe Text
a -> AwsDynamoDbTableReplica
s {$sel:kmsMasterKeyId:AwsDynamoDbTableReplica' :: Maybe Text
kmsMasterKeyId = Maybe Text
a} :: AwsDynamoDbTableReplica)

-- | Replica-specific configuration for the provisioned throughput.
awsDynamoDbTableReplica_provisionedThroughputOverride :: Lens.Lens' AwsDynamoDbTableReplica (Prelude.Maybe AwsDynamoDbTableProvisionedThroughputOverride)
awsDynamoDbTableReplica_provisionedThroughputOverride :: (Maybe AwsDynamoDbTableProvisionedThroughputOverride
 -> f (Maybe AwsDynamoDbTableProvisionedThroughputOverride))
-> AwsDynamoDbTableReplica -> f AwsDynamoDbTableReplica
awsDynamoDbTableReplica_provisionedThroughputOverride = (AwsDynamoDbTableReplica
 -> Maybe AwsDynamoDbTableProvisionedThroughputOverride)
-> (AwsDynamoDbTableReplica
    -> Maybe AwsDynamoDbTableProvisionedThroughputOverride
    -> AwsDynamoDbTableReplica)
-> Lens
     AwsDynamoDbTableReplica
     AwsDynamoDbTableReplica
     (Maybe AwsDynamoDbTableProvisionedThroughputOverride)
     (Maybe AwsDynamoDbTableProvisionedThroughputOverride)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableReplica' {Maybe AwsDynamoDbTableProvisionedThroughputOverride
provisionedThroughputOverride :: Maybe AwsDynamoDbTableProvisionedThroughputOverride
$sel:provisionedThroughputOverride:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica
-> Maybe AwsDynamoDbTableProvisionedThroughputOverride
provisionedThroughputOverride} -> Maybe AwsDynamoDbTableProvisionedThroughputOverride
provisionedThroughputOverride) (\s :: AwsDynamoDbTableReplica
s@AwsDynamoDbTableReplica' {} Maybe AwsDynamoDbTableProvisionedThroughputOverride
a -> AwsDynamoDbTableReplica
s {$sel:provisionedThroughputOverride:AwsDynamoDbTableReplica' :: Maybe AwsDynamoDbTableProvisionedThroughputOverride
provisionedThroughputOverride = Maybe AwsDynamoDbTableProvisionedThroughputOverride
a} :: AwsDynamoDbTableReplica)

-- | List of global secondary indexes for the replica.
awsDynamoDbTableReplica_globalSecondaryIndexes :: Lens.Lens' AwsDynamoDbTableReplica (Prelude.Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex])
awsDynamoDbTableReplica_globalSecondaryIndexes :: (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
 -> f (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]))
-> AwsDynamoDbTableReplica -> f AwsDynamoDbTableReplica
awsDynamoDbTableReplica_globalSecondaryIndexes = (AwsDynamoDbTableReplica
 -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex])
-> (AwsDynamoDbTableReplica
    -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
    -> AwsDynamoDbTableReplica)
-> Lens
     AwsDynamoDbTableReplica
     AwsDynamoDbTableReplica
     (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex])
     (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableReplica' {Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
globalSecondaryIndexes :: Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
$sel:globalSecondaryIndexes:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica
-> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
globalSecondaryIndexes} -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
globalSecondaryIndexes) (\s :: AwsDynamoDbTableReplica
s@AwsDynamoDbTableReplica' {} Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
a -> AwsDynamoDbTableReplica
s {$sel:globalSecondaryIndexes:AwsDynamoDbTableReplica' :: Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
globalSecondaryIndexes = Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
a} :: AwsDynamoDbTableReplica) ((Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
  -> f (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]))
 -> AwsDynamoDbTableReplica -> f AwsDynamoDbTableReplica)
-> ((Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
     -> f (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]))
    -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
    -> f (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]))
-> (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
    -> f (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]))
-> AwsDynamoDbTableReplica
-> f AwsDynamoDbTableReplica
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
  [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
  [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
  [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
-> Iso
     (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex])
     (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex])
     (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex])
     (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex])
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
  [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
  [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
  [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
  [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON AwsDynamoDbTableReplica where
  parseJSON :: Value -> Parser AwsDynamoDbTableReplica
parseJSON =
    String
-> (Object -> Parser AwsDynamoDbTableReplica)
-> Value
-> Parser AwsDynamoDbTableReplica
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsDynamoDbTableReplica"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AwsDynamoDbTableProvisionedThroughputOverride
-> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
-> AwsDynamoDbTableReplica
AwsDynamoDbTableReplica'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AwsDynamoDbTableProvisionedThroughputOverride
 -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
 -> AwsDynamoDbTableReplica)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AwsDynamoDbTableProvisionedThroughputOverride
      -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
      -> AwsDynamoDbTableReplica)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReplicaStatus")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AwsDynamoDbTableProvisionedThroughputOverride
   -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
   -> AwsDynamoDbTableReplica)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AwsDynamoDbTableProvisionedThroughputOverride
      -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
      -> AwsDynamoDbTableReplica)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RegionName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe AwsDynamoDbTableProvisionedThroughputOverride
   -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
   -> AwsDynamoDbTableReplica)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AwsDynamoDbTableProvisionedThroughputOverride
      -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
      -> AwsDynamoDbTableReplica)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReplicaStatusDescription")
            Parser
  (Maybe Text
   -> Maybe AwsDynamoDbTableProvisionedThroughputOverride
   -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
   -> AwsDynamoDbTableReplica)
-> Parser (Maybe Text)
-> Parser
     (Maybe AwsDynamoDbTableProvisionedThroughputOverride
      -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
      -> AwsDynamoDbTableReplica)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KmsMasterKeyId")
            Parser
  (Maybe AwsDynamoDbTableProvisionedThroughputOverride
   -> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
   -> AwsDynamoDbTableReplica)
-> Parser (Maybe AwsDynamoDbTableProvisionedThroughputOverride)
-> Parser
     (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
      -> AwsDynamoDbTableReplica)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe AwsDynamoDbTableProvisionedThroughputOverride)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProvisionedThroughputOverride")
            Parser
  (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
   -> AwsDynamoDbTableReplica)
-> Parser (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex])
-> Parser AwsDynamoDbTableReplica
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser
     (Maybe (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GlobalSecondaryIndexes"
                            Parser
  (Maybe (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]))
-> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
-> Parser (Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable AwsDynamoDbTableReplica

instance Prelude.NFData AwsDynamoDbTableReplica

instance Core.ToJSON AwsDynamoDbTableReplica where
  toJSON :: AwsDynamoDbTableReplica -> Value
toJSON AwsDynamoDbTableReplica' {Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
Maybe Text
Maybe AwsDynamoDbTableProvisionedThroughputOverride
globalSecondaryIndexes :: Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
provisionedThroughputOverride :: Maybe AwsDynamoDbTableProvisionedThroughputOverride
kmsMasterKeyId :: Maybe Text
replicaStatusDescription :: Maybe Text
regionName :: Maybe Text
replicaStatus :: Maybe Text
$sel:globalSecondaryIndexes:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica
-> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
$sel:provisionedThroughputOverride:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica
-> Maybe AwsDynamoDbTableProvisionedThroughputOverride
$sel:kmsMasterKeyId:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica -> Maybe Text
$sel:replicaStatusDescription:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica -> Maybe Text
$sel:regionName:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica -> Maybe Text
$sel:replicaStatus:AwsDynamoDbTableReplica' :: AwsDynamoDbTableReplica -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ReplicaStatus" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
replicaStatus,
            (Text
"RegionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
regionName,
            (Text
"ReplicaStatusDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
replicaStatusDescription,
            (Text
"KmsMasterKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsMasterKeyId,
            (Text
"ProvisionedThroughputOverride" Text -> AwsDynamoDbTableProvisionedThroughputOverride -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AwsDynamoDbTableProvisionedThroughputOverride -> Pair)
-> Maybe AwsDynamoDbTableProvisionedThroughputOverride
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsDynamoDbTableProvisionedThroughputOverride
provisionedThroughputOverride,
            (Text
"GlobalSecondaryIndexes" Text -> [AwsDynamoDbTableReplicaGlobalSecondaryIndex] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AwsDynamoDbTableReplicaGlobalSecondaryIndex] -> Pair)
-> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsDynamoDbTableReplicaGlobalSecondaryIndex]
globalSecondaryIndexes
          ]
      )