{-# 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.DynamoDB.Types.ReplicaDescription
-- 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.DynamoDB.Types.ReplicaDescription where

import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.ProvisionedThroughputOverride
import Amazonka.DynamoDB.Types.ReplicaGlobalSecondaryIndexDescription
import Amazonka.DynamoDB.Types.ReplicaStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains the details of the replica.
--
-- /See:/ 'newReplicaDescription' smart constructor.
data ReplicaDescription = ReplicaDescription'
  { -- | The current state of the replica:
    --
    -- -   @CREATING@ - The replica is being created.
    --
    -- -   @UPDATING@ - The replica is being updated.
    --
    -- -   @DELETING@ - The replica is being deleted.
    --
    -- -   @ACTIVE@ - The replica is ready for use.
    --
    -- -   @REGION_DISABLED@ - The replica is inaccessible because the AWS
    --     Region has been disabled.
    --
    --     If the AWS Region remains inaccessible for more than 20 hours,
    --     DynamoDB will remove this replica from the replication group. The
    --     replica will not be deleted and replication will stop from and to
    --     this region.
    --
    -- -   @INACCESSIBLE_ENCRYPTION_CREDENTIALS @ - The AWS KMS key used to
    --     encrypt the table is inaccessible.
    --
    --     If the AWS KMS key remains inaccessible for more than 20 hours,
    --     DynamoDB will remove this replica from the replication group. The
    --     replica will not be deleted and replication will stop from and to
    --     this region.
    ReplicaDescription -> Maybe ReplicaStatus
replicaStatus :: Prelude.Maybe ReplicaStatus,
    -- | The name of the Region.
    ReplicaDescription -> Maybe Text
regionName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the progress of a Create, Update, or Delete action on the
    -- replica as a percentage.
    ReplicaDescription -> Maybe Text
replicaStatusPercentProgress :: Prelude.Maybe Prelude.Text,
    -- | Detailed information about the replica status.
    ReplicaDescription -> Maybe Text
replicaStatusDescription :: Prelude.Maybe Prelude.Text,
    -- | The time at which the replica was first detected as inaccessible. To
    -- determine cause of inaccessibility check the @ReplicaStatus@ property.
    ReplicaDescription -> Maybe POSIX
replicaInaccessibleDateTime :: Prelude.Maybe Core.POSIX,
    -- | The AWS KMS customer master key (CMK) of the replica that will be used
    -- for AWS KMS encryption.
    ReplicaDescription -> Maybe Text
kmsMasterKeyId :: Prelude.Maybe Prelude.Text,
    -- | Replica-specific provisioned throughput. If not described, uses the
    -- source table\'s provisioned throughput settings.
    ReplicaDescription -> Maybe ProvisionedThroughputOverride
provisionedThroughputOverride :: Prelude.Maybe ProvisionedThroughputOverride,
    -- | Replica-specific global secondary index settings.
    ReplicaDescription
-> Maybe [ReplicaGlobalSecondaryIndexDescription]
globalSecondaryIndexes :: Prelude.Maybe [ReplicaGlobalSecondaryIndexDescription]
  }
  deriving (ReplicaDescription -> ReplicaDescription -> Bool
(ReplicaDescription -> ReplicaDescription -> Bool)
-> (ReplicaDescription -> ReplicaDescription -> Bool)
-> Eq ReplicaDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicaDescription -> ReplicaDescription -> Bool
$c/= :: ReplicaDescription -> ReplicaDescription -> Bool
== :: ReplicaDescription -> ReplicaDescription -> Bool
$c== :: ReplicaDescription -> ReplicaDescription -> Bool
Prelude.Eq, ReadPrec [ReplicaDescription]
ReadPrec ReplicaDescription
Int -> ReadS ReplicaDescription
ReadS [ReplicaDescription]
(Int -> ReadS ReplicaDescription)
-> ReadS [ReplicaDescription]
-> ReadPrec ReplicaDescription
-> ReadPrec [ReplicaDescription]
-> Read ReplicaDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicaDescription]
$creadListPrec :: ReadPrec [ReplicaDescription]
readPrec :: ReadPrec ReplicaDescription
$creadPrec :: ReadPrec ReplicaDescription
readList :: ReadS [ReplicaDescription]
$creadList :: ReadS [ReplicaDescription]
readsPrec :: Int -> ReadS ReplicaDescription
$creadsPrec :: Int -> ReadS ReplicaDescription
Prelude.Read, Int -> ReplicaDescription -> ShowS
[ReplicaDescription] -> ShowS
ReplicaDescription -> String
(Int -> ReplicaDescription -> ShowS)
-> (ReplicaDescription -> String)
-> ([ReplicaDescription] -> ShowS)
-> Show ReplicaDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicaDescription] -> ShowS
$cshowList :: [ReplicaDescription] -> ShowS
show :: ReplicaDescription -> String
$cshow :: ReplicaDescription -> String
showsPrec :: Int -> ReplicaDescription -> ShowS
$cshowsPrec :: Int -> ReplicaDescription -> ShowS
Prelude.Show, (forall x. ReplicaDescription -> Rep ReplicaDescription x)
-> (forall x. Rep ReplicaDescription x -> ReplicaDescription)
-> Generic ReplicaDescription
forall x. Rep ReplicaDescription x -> ReplicaDescription
forall x. ReplicaDescription -> Rep ReplicaDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplicaDescription x -> ReplicaDescription
$cfrom :: forall x. ReplicaDescription -> Rep ReplicaDescription x
Prelude.Generic)

-- |
-- Create a value of 'ReplicaDescription' 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', 'replicaDescription_replicaStatus' - The current state of the replica:
--
-- -   @CREATING@ - The replica is being created.
--
-- -   @UPDATING@ - The replica is being updated.
--
-- -   @DELETING@ - The replica is being deleted.
--
-- -   @ACTIVE@ - The replica is ready for use.
--
-- -   @REGION_DISABLED@ - The replica is inaccessible because the AWS
--     Region has been disabled.
--
--     If the AWS Region remains inaccessible for more than 20 hours,
--     DynamoDB will remove this replica from the replication group. The
--     replica will not be deleted and replication will stop from and to
--     this region.
--
-- -   @INACCESSIBLE_ENCRYPTION_CREDENTIALS @ - The AWS KMS key used to
--     encrypt the table is inaccessible.
--
--     If the AWS KMS key remains inaccessible for more than 20 hours,
--     DynamoDB will remove this replica from the replication group. The
--     replica will not be deleted and replication will stop from and to
--     this region.
--
-- 'regionName', 'replicaDescription_regionName' - The name of the Region.
--
-- 'replicaStatusPercentProgress', 'replicaDescription_replicaStatusPercentProgress' - Specifies the progress of a Create, Update, or Delete action on the
-- replica as a percentage.
--
-- 'replicaStatusDescription', 'replicaDescription_replicaStatusDescription' - Detailed information about the replica status.
--
-- 'replicaInaccessibleDateTime', 'replicaDescription_replicaInaccessibleDateTime' - The time at which the replica was first detected as inaccessible. To
-- determine cause of inaccessibility check the @ReplicaStatus@ property.
--
-- 'kmsMasterKeyId', 'replicaDescription_kmsMasterKeyId' - The AWS KMS customer master key (CMK) of the replica that will be used
-- for AWS KMS encryption.
--
-- 'provisionedThroughputOverride', 'replicaDescription_provisionedThroughputOverride' - Replica-specific provisioned throughput. If not described, uses the
-- source table\'s provisioned throughput settings.
--
-- 'globalSecondaryIndexes', 'replicaDescription_globalSecondaryIndexes' - Replica-specific global secondary index settings.
newReplicaDescription ::
  ReplicaDescription
newReplicaDescription :: ReplicaDescription
newReplicaDescription =
  ReplicaDescription' :: Maybe ReplicaStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ProvisionedThroughputOverride
-> Maybe [ReplicaGlobalSecondaryIndexDescription]
-> ReplicaDescription
ReplicaDescription'
    { $sel:replicaStatus:ReplicaDescription' :: Maybe ReplicaStatus
replicaStatus =
        Maybe ReplicaStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:regionName:ReplicaDescription' :: Maybe Text
regionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:replicaStatusPercentProgress:ReplicaDescription' :: Maybe Text
replicaStatusPercentProgress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:replicaStatusDescription:ReplicaDescription' :: Maybe Text
replicaStatusDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:replicaInaccessibleDateTime:ReplicaDescription' :: Maybe POSIX
replicaInaccessibleDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsMasterKeyId:ReplicaDescription' :: Maybe Text
kmsMasterKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedThroughputOverride:ReplicaDescription' :: Maybe ProvisionedThroughputOverride
provisionedThroughputOverride = Maybe ProvisionedThroughputOverride
forall a. Maybe a
Prelude.Nothing,
      $sel:globalSecondaryIndexes:ReplicaDescription' :: Maybe [ReplicaGlobalSecondaryIndexDescription]
globalSecondaryIndexes = Maybe [ReplicaGlobalSecondaryIndexDescription]
forall a. Maybe a
Prelude.Nothing
    }

-- | The current state of the replica:
--
-- -   @CREATING@ - The replica is being created.
--
-- -   @UPDATING@ - The replica is being updated.
--
-- -   @DELETING@ - The replica is being deleted.
--
-- -   @ACTIVE@ - The replica is ready for use.
--
-- -   @REGION_DISABLED@ - The replica is inaccessible because the AWS
--     Region has been disabled.
--
--     If the AWS Region remains inaccessible for more than 20 hours,
--     DynamoDB will remove this replica from the replication group. The
--     replica will not be deleted and replication will stop from and to
--     this region.
--
-- -   @INACCESSIBLE_ENCRYPTION_CREDENTIALS @ - The AWS KMS key used to
--     encrypt the table is inaccessible.
--
--     If the AWS KMS key remains inaccessible for more than 20 hours,
--     DynamoDB will remove this replica from the replication group. The
--     replica will not be deleted and replication will stop from and to
--     this region.
replicaDescription_replicaStatus :: Lens.Lens' ReplicaDescription (Prelude.Maybe ReplicaStatus)
replicaDescription_replicaStatus :: (Maybe ReplicaStatus -> f (Maybe ReplicaStatus))
-> ReplicaDescription -> f ReplicaDescription
replicaDescription_replicaStatus = (ReplicaDescription -> Maybe ReplicaStatus)
-> (ReplicaDescription
    -> Maybe ReplicaStatus -> ReplicaDescription)
-> Lens
     ReplicaDescription
     ReplicaDescription
     (Maybe ReplicaStatus)
     (Maybe ReplicaStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaDescription' {Maybe ReplicaStatus
replicaStatus :: Maybe ReplicaStatus
$sel:replicaStatus:ReplicaDescription' :: ReplicaDescription -> Maybe ReplicaStatus
replicaStatus} -> Maybe ReplicaStatus
replicaStatus) (\s :: ReplicaDescription
s@ReplicaDescription' {} Maybe ReplicaStatus
a -> ReplicaDescription
s {$sel:replicaStatus:ReplicaDescription' :: Maybe ReplicaStatus
replicaStatus = Maybe ReplicaStatus
a} :: ReplicaDescription)

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

-- | Specifies the progress of a Create, Update, or Delete action on the
-- replica as a percentage.
replicaDescription_replicaStatusPercentProgress :: Lens.Lens' ReplicaDescription (Prelude.Maybe Prelude.Text)
replicaDescription_replicaStatusPercentProgress :: (Maybe Text -> f (Maybe Text))
-> ReplicaDescription -> f ReplicaDescription
replicaDescription_replicaStatusPercentProgress = (ReplicaDescription -> Maybe Text)
-> (ReplicaDescription -> Maybe Text -> ReplicaDescription)
-> Lens
     ReplicaDescription ReplicaDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaDescription' {Maybe Text
replicaStatusPercentProgress :: Maybe Text
$sel:replicaStatusPercentProgress:ReplicaDescription' :: ReplicaDescription -> Maybe Text
replicaStatusPercentProgress} -> Maybe Text
replicaStatusPercentProgress) (\s :: ReplicaDescription
s@ReplicaDescription' {} Maybe Text
a -> ReplicaDescription
s {$sel:replicaStatusPercentProgress:ReplicaDescription' :: Maybe Text
replicaStatusPercentProgress = Maybe Text
a} :: ReplicaDescription)

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

-- | The time at which the replica was first detected as inaccessible. To
-- determine cause of inaccessibility check the @ReplicaStatus@ property.
replicaDescription_replicaInaccessibleDateTime :: Lens.Lens' ReplicaDescription (Prelude.Maybe Prelude.UTCTime)
replicaDescription_replicaInaccessibleDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicaDescription -> f ReplicaDescription
replicaDescription_replicaInaccessibleDateTime = (ReplicaDescription -> Maybe POSIX)
-> (ReplicaDescription -> Maybe POSIX -> ReplicaDescription)
-> Lens
     ReplicaDescription ReplicaDescription (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaDescription' {Maybe POSIX
replicaInaccessibleDateTime :: Maybe POSIX
$sel:replicaInaccessibleDateTime:ReplicaDescription' :: ReplicaDescription -> Maybe POSIX
replicaInaccessibleDateTime} -> Maybe POSIX
replicaInaccessibleDateTime) (\s :: ReplicaDescription
s@ReplicaDescription' {} Maybe POSIX
a -> ReplicaDescription
s {$sel:replicaInaccessibleDateTime:ReplicaDescription' :: Maybe POSIX
replicaInaccessibleDateTime = Maybe POSIX
a} :: ReplicaDescription) ((Maybe POSIX -> f (Maybe POSIX))
 -> ReplicaDescription -> f ReplicaDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicaDescription
-> f ReplicaDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

-- | Replica-specific provisioned throughput. If not described, uses the
-- source table\'s provisioned throughput settings.
replicaDescription_provisionedThroughputOverride :: Lens.Lens' ReplicaDescription (Prelude.Maybe ProvisionedThroughputOverride)
replicaDescription_provisionedThroughputOverride :: (Maybe ProvisionedThroughputOverride
 -> f (Maybe ProvisionedThroughputOverride))
-> ReplicaDescription -> f ReplicaDescription
replicaDescription_provisionedThroughputOverride = (ReplicaDescription -> Maybe ProvisionedThroughputOverride)
-> (ReplicaDescription
    -> Maybe ProvisionedThroughputOverride -> ReplicaDescription)
-> Lens
     ReplicaDescription
     ReplicaDescription
     (Maybe ProvisionedThroughputOverride)
     (Maybe ProvisionedThroughputOverride)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaDescription' {Maybe ProvisionedThroughputOverride
provisionedThroughputOverride :: Maybe ProvisionedThroughputOverride
$sel:provisionedThroughputOverride:ReplicaDescription' :: ReplicaDescription -> Maybe ProvisionedThroughputOverride
provisionedThroughputOverride} -> Maybe ProvisionedThroughputOverride
provisionedThroughputOverride) (\s :: ReplicaDescription
s@ReplicaDescription' {} Maybe ProvisionedThroughputOverride
a -> ReplicaDescription
s {$sel:provisionedThroughputOverride:ReplicaDescription' :: Maybe ProvisionedThroughputOverride
provisionedThroughputOverride = Maybe ProvisionedThroughputOverride
a} :: ReplicaDescription)

-- | Replica-specific global secondary index settings.
replicaDescription_globalSecondaryIndexes :: Lens.Lens' ReplicaDescription (Prelude.Maybe [ReplicaGlobalSecondaryIndexDescription])
replicaDescription_globalSecondaryIndexes :: (Maybe [ReplicaGlobalSecondaryIndexDescription]
 -> f (Maybe [ReplicaGlobalSecondaryIndexDescription]))
-> ReplicaDescription -> f ReplicaDescription
replicaDescription_globalSecondaryIndexes = (ReplicaDescription
 -> Maybe [ReplicaGlobalSecondaryIndexDescription])
-> (ReplicaDescription
    -> Maybe [ReplicaGlobalSecondaryIndexDescription]
    -> ReplicaDescription)
-> Lens
     ReplicaDescription
     ReplicaDescription
     (Maybe [ReplicaGlobalSecondaryIndexDescription])
     (Maybe [ReplicaGlobalSecondaryIndexDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicaDescription' {Maybe [ReplicaGlobalSecondaryIndexDescription]
globalSecondaryIndexes :: Maybe [ReplicaGlobalSecondaryIndexDescription]
$sel:globalSecondaryIndexes:ReplicaDescription' :: ReplicaDescription
-> Maybe [ReplicaGlobalSecondaryIndexDescription]
globalSecondaryIndexes} -> Maybe [ReplicaGlobalSecondaryIndexDescription]
globalSecondaryIndexes) (\s :: ReplicaDescription
s@ReplicaDescription' {} Maybe [ReplicaGlobalSecondaryIndexDescription]
a -> ReplicaDescription
s {$sel:globalSecondaryIndexes:ReplicaDescription' :: Maybe [ReplicaGlobalSecondaryIndexDescription]
globalSecondaryIndexes = Maybe [ReplicaGlobalSecondaryIndexDescription]
a} :: ReplicaDescription) ((Maybe [ReplicaGlobalSecondaryIndexDescription]
  -> f (Maybe [ReplicaGlobalSecondaryIndexDescription]))
 -> ReplicaDescription -> f ReplicaDescription)
-> ((Maybe [ReplicaGlobalSecondaryIndexDescription]
     -> f (Maybe [ReplicaGlobalSecondaryIndexDescription]))
    -> Maybe [ReplicaGlobalSecondaryIndexDescription]
    -> f (Maybe [ReplicaGlobalSecondaryIndexDescription]))
-> (Maybe [ReplicaGlobalSecondaryIndexDescription]
    -> f (Maybe [ReplicaGlobalSecondaryIndexDescription]))
-> ReplicaDescription
-> f ReplicaDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ReplicaGlobalSecondaryIndexDescription]
  [ReplicaGlobalSecondaryIndexDescription]
  [ReplicaGlobalSecondaryIndexDescription]
  [ReplicaGlobalSecondaryIndexDescription]
-> Iso
     (Maybe [ReplicaGlobalSecondaryIndexDescription])
     (Maybe [ReplicaGlobalSecondaryIndexDescription])
     (Maybe [ReplicaGlobalSecondaryIndexDescription])
     (Maybe [ReplicaGlobalSecondaryIndexDescription])
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
  [ReplicaGlobalSecondaryIndexDescription]
  [ReplicaGlobalSecondaryIndexDescription]
  [ReplicaGlobalSecondaryIndexDescription]
  [ReplicaGlobalSecondaryIndexDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON ReplicaDescription where
  parseJSON :: Value -> Parser ReplicaDescription
parseJSON =
    String
-> (Object -> Parser ReplicaDescription)
-> Value
-> Parser ReplicaDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReplicaDescription"
      ( \Object
x ->
          Maybe ReplicaStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ProvisionedThroughputOverride
-> Maybe [ReplicaGlobalSecondaryIndexDescription]
-> ReplicaDescription
ReplicaDescription'
            (Maybe ReplicaStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe ProvisionedThroughputOverride
 -> Maybe [ReplicaGlobalSecondaryIndexDescription]
 -> ReplicaDescription)
-> Parser (Maybe ReplicaStatus)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ProvisionedThroughputOverride
      -> Maybe [ReplicaGlobalSecondaryIndexDescription]
      -> ReplicaDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ReplicaStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReplicaStatus")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ProvisionedThroughputOverride
   -> Maybe [ReplicaGlobalSecondaryIndexDescription]
   -> ReplicaDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ProvisionedThroughputOverride
      -> Maybe [ReplicaGlobalSecondaryIndexDescription]
      -> ReplicaDescription)
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 POSIX
   -> Maybe Text
   -> Maybe ProvisionedThroughputOverride
   -> Maybe [ReplicaGlobalSecondaryIndexDescription]
   -> ReplicaDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ProvisionedThroughputOverride
      -> Maybe [ReplicaGlobalSecondaryIndexDescription]
      -> ReplicaDescription)
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
"ReplicaStatusPercentProgress")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ProvisionedThroughputOverride
   -> Maybe [ReplicaGlobalSecondaryIndexDescription]
   -> ReplicaDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe ProvisionedThroughputOverride
      -> Maybe [ReplicaGlobalSecondaryIndexDescription]
      -> ReplicaDescription)
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 POSIX
   -> Maybe Text
   -> Maybe ProvisionedThroughputOverride
   -> Maybe [ReplicaGlobalSecondaryIndexDescription]
   -> ReplicaDescription)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe ProvisionedThroughputOverride
      -> Maybe [ReplicaGlobalSecondaryIndexDescription]
      -> ReplicaDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReplicaInaccessibleDateTime")
            Parser
  (Maybe Text
   -> Maybe ProvisionedThroughputOverride
   -> Maybe [ReplicaGlobalSecondaryIndexDescription]
   -> ReplicaDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe ProvisionedThroughputOverride
      -> Maybe [ReplicaGlobalSecondaryIndexDescription]
      -> ReplicaDescription)
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 ProvisionedThroughputOverride
   -> Maybe [ReplicaGlobalSecondaryIndexDescription]
   -> ReplicaDescription)
-> Parser (Maybe ProvisionedThroughputOverride)
-> Parser
     (Maybe [ReplicaGlobalSecondaryIndexDescription]
      -> ReplicaDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProvisionedThroughputOverride)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProvisionedThroughputOverride")
            Parser
  (Maybe [ReplicaGlobalSecondaryIndexDescription]
   -> ReplicaDescription)
-> Parser (Maybe [ReplicaGlobalSecondaryIndexDescription])
-> Parser ReplicaDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser (Maybe (Maybe [ReplicaGlobalSecondaryIndexDescription]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GlobalSecondaryIndexes"
                            Parser (Maybe (Maybe [ReplicaGlobalSecondaryIndexDescription]))
-> Maybe [ReplicaGlobalSecondaryIndexDescription]
-> Parser (Maybe [ReplicaGlobalSecondaryIndexDescription])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ReplicaGlobalSecondaryIndexDescription]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ReplicaDescription

instance Prelude.NFData ReplicaDescription