{-# 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.SMS.Types.ReplicationRun
-- 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.SMS.Types.ReplicationRun where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SMS.Types.ReplicationRunStageDetails
import Amazonka.SMS.Types.ReplicationRunState
import Amazonka.SMS.Types.ReplicationRunType

-- | Represents a replication run.
--
-- /See:/ 'newReplicationRun' smart constructor.
data ReplicationRun = ReplicationRun'
  { -- | The state of the replication run.
    ReplicationRun -> Maybe ReplicationRunState
state :: Prelude.Maybe ReplicationRunState,
    -- | The ID of the replication run.
    ReplicationRun -> Maybe Text
replicationRunId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the replication run should produce an encrypted AMI.
    ReplicationRun -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
    -- | Details about the current stage of the replication run.
    ReplicationRun -> Maybe ReplicationRunStageDetails
stageDetails :: Prelude.Maybe ReplicationRunStageDetails,
    -- | The start time of the next replication run.
    ReplicationRun -> Maybe POSIX
scheduledStartTime :: Prelude.Maybe Core.POSIX,
    -- | The description of the current status of the replication job.
    ReplicationRun -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | The ID of the KMS key for replication jobs that produce encrypted AMIs.
    -- This value can be any of the following:
    --
    -- -   KMS key ID
    --
    -- -   KMS key alias
    --
    -- -   ARN referring to the KMS key ID
    --
    -- -   ARN referring to the KMS key alias
    --
    -- If encrypted is /true/ but a KMS key ID is not specified, the
    -- customer\'s default KMS key for Amazon EBS is used.
    ReplicationRun -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The completion time of the last replication run.
    ReplicationRun -> Maybe POSIX
completedTime :: Prelude.Maybe Core.POSIX,
    -- | The ID of the Amazon Machine Image (AMI) from the replication run.
    ReplicationRun -> Maybe Text
amiId :: Prelude.Maybe Prelude.Text,
    -- | The type of replication run.
    ReplicationRun -> Maybe ReplicationRunType
type' :: Prelude.Maybe ReplicationRunType,
    -- | The description of the replication run.
    ReplicationRun -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ReplicationRun -> ReplicationRun -> Bool
(ReplicationRun -> ReplicationRun -> Bool)
-> (ReplicationRun -> ReplicationRun -> Bool) -> Eq ReplicationRun
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicationRun -> ReplicationRun -> Bool
$c/= :: ReplicationRun -> ReplicationRun -> Bool
== :: ReplicationRun -> ReplicationRun -> Bool
$c== :: ReplicationRun -> ReplicationRun -> Bool
Prelude.Eq, ReadPrec [ReplicationRun]
ReadPrec ReplicationRun
Int -> ReadS ReplicationRun
ReadS [ReplicationRun]
(Int -> ReadS ReplicationRun)
-> ReadS [ReplicationRun]
-> ReadPrec ReplicationRun
-> ReadPrec [ReplicationRun]
-> Read ReplicationRun
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicationRun]
$creadListPrec :: ReadPrec [ReplicationRun]
readPrec :: ReadPrec ReplicationRun
$creadPrec :: ReadPrec ReplicationRun
readList :: ReadS [ReplicationRun]
$creadList :: ReadS [ReplicationRun]
readsPrec :: Int -> ReadS ReplicationRun
$creadsPrec :: Int -> ReadS ReplicationRun
Prelude.Read, Int -> ReplicationRun -> ShowS
[ReplicationRun] -> ShowS
ReplicationRun -> String
(Int -> ReplicationRun -> ShowS)
-> (ReplicationRun -> String)
-> ([ReplicationRun] -> ShowS)
-> Show ReplicationRun
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicationRun] -> ShowS
$cshowList :: [ReplicationRun] -> ShowS
show :: ReplicationRun -> String
$cshow :: ReplicationRun -> String
showsPrec :: Int -> ReplicationRun -> ShowS
$cshowsPrec :: Int -> ReplicationRun -> ShowS
Prelude.Show, (forall x. ReplicationRun -> Rep ReplicationRun x)
-> (forall x. Rep ReplicationRun x -> ReplicationRun)
-> Generic ReplicationRun
forall x. Rep ReplicationRun x -> ReplicationRun
forall x. ReplicationRun -> Rep ReplicationRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplicationRun x -> ReplicationRun
$cfrom :: forall x. ReplicationRun -> Rep ReplicationRun x
Prelude.Generic)

-- |
-- Create a value of 'ReplicationRun' 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:
--
-- 'state', 'replicationRun_state' - The state of the replication run.
--
-- 'replicationRunId', 'replicationRun_replicationRunId' - The ID of the replication run.
--
-- 'encrypted', 'replicationRun_encrypted' - Indicates whether the replication run should produce an encrypted AMI.
--
-- 'stageDetails', 'replicationRun_stageDetails' - Details about the current stage of the replication run.
--
-- 'scheduledStartTime', 'replicationRun_scheduledStartTime' - The start time of the next replication run.
--
-- 'statusMessage', 'replicationRun_statusMessage' - The description of the current status of the replication job.
--
-- 'kmsKeyId', 'replicationRun_kmsKeyId' - The ID of the KMS key for replication jobs that produce encrypted AMIs.
-- This value can be any of the following:
--
-- -   KMS key ID
--
-- -   KMS key alias
--
-- -   ARN referring to the KMS key ID
--
-- -   ARN referring to the KMS key alias
--
-- If encrypted is /true/ but a KMS key ID is not specified, the
-- customer\'s default KMS key for Amazon EBS is used.
--
-- 'completedTime', 'replicationRun_completedTime' - The completion time of the last replication run.
--
-- 'amiId', 'replicationRun_amiId' - The ID of the Amazon Machine Image (AMI) from the replication run.
--
-- 'type'', 'replicationRun_type' - The type of replication run.
--
-- 'description', 'replicationRun_description' - The description of the replication run.
newReplicationRun ::
  ReplicationRun
newReplicationRun :: ReplicationRun
newReplicationRun =
  ReplicationRun' :: Maybe ReplicationRunState
-> Maybe Text
-> Maybe Bool
-> Maybe ReplicationRunStageDetails
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ReplicationRunType
-> Maybe Text
-> ReplicationRun
ReplicationRun'
    { $sel:state:ReplicationRun' :: Maybe ReplicationRunState
state = Maybe ReplicationRunState
forall a. Maybe a
Prelude.Nothing,
      $sel:replicationRunId:ReplicationRun' :: Maybe Text
replicationRunId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encrypted:ReplicationRun' :: Maybe Bool
encrypted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:stageDetails:ReplicationRun' :: Maybe ReplicationRunStageDetails
stageDetails = Maybe ReplicationRunStageDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduledStartTime:ReplicationRun' :: Maybe POSIX
scheduledStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:ReplicationRun' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:ReplicationRun' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:completedTime:ReplicationRun' :: Maybe POSIX
completedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:amiId:ReplicationRun' :: Maybe Text
amiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ReplicationRun' :: Maybe ReplicationRunType
type' = Maybe ReplicationRunType
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ReplicationRun' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The state of the replication run.
replicationRun_state :: Lens.Lens' ReplicationRun (Prelude.Maybe ReplicationRunState)
replicationRun_state :: (Maybe ReplicationRunState -> f (Maybe ReplicationRunState))
-> ReplicationRun -> f ReplicationRun
replicationRun_state = (ReplicationRun -> Maybe ReplicationRunState)
-> (ReplicationRun -> Maybe ReplicationRunState -> ReplicationRun)
-> Lens
     ReplicationRun
     ReplicationRun
     (Maybe ReplicationRunState)
     (Maybe ReplicationRunState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationRun' {Maybe ReplicationRunState
state :: Maybe ReplicationRunState
$sel:state:ReplicationRun' :: ReplicationRun -> Maybe ReplicationRunState
state} -> Maybe ReplicationRunState
state) (\s :: ReplicationRun
s@ReplicationRun' {} Maybe ReplicationRunState
a -> ReplicationRun
s {$sel:state:ReplicationRun' :: Maybe ReplicationRunState
state = Maybe ReplicationRunState
a} :: ReplicationRun)

-- | The ID of the replication run.
replicationRun_replicationRunId :: Lens.Lens' ReplicationRun (Prelude.Maybe Prelude.Text)
replicationRun_replicationRunId :: (Maybe Text -> f (Maybe Text))
-> ReplicationRun -> f ReplicationRun
replicationRun_replicationRunId = (ReplicationRun -> Maybe Text)
-> (ReplicationRun -> Maybe Text -> ReplicationRun)
-> Lens ReplicationRun ReplicationRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationRun' {Maybe Text
replicationRunId :: Maybe Text
$sel:replicationRunId:ReplicationRun' :: ReplicationRun -> Maybe Text
replicationRunId} -> Maybe Text
replicationRunId) (\s :: ReplicationRun
s@ReplicationRun' {} Maybe Text
a -> ReplicationRun
s {$sel:replicationRunId:ReplicationRun' :: Maybe Text
replicationRunId = Maybe Text
a} :: ReplicationRun)

-- | Indicates whether the replication run should produce an encrypted AMI.
replicationRun_encrypted :: Lens.Lens' ReplicationRun (Prelude.Maybe Prelude.Bool)
replicationRun_encrypted :: (Maybe Bool -> f (Maybe Bool))
-> ReplicationRun -> f ReplicationRun
replicationRun_encrypted = (ReplicationRun -> Maybe Bool)
-> (ReplicationRun -> Maybe Bool -> ReplicationRun)
-> Lens ReplicationRun ReplicationRun (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationRun' {Maybe Bool
encrypted :: Maybe Bool
$sel:encrypted:ReplicationRun' :: ReplicationRun -> Maybe Bool
encrypted} -> Maybe Bool
encrypted) (\s :: ReplicationRun
s@ReplicationRun' {} Maybe Bool
a -> ReplicationRun
s {$sel:encrypted:ReplicationRun' :: Maybe Bool
encrypted = Maybe Bool
a} :: ReplicationRun)

-- | Details about the current stage of the replication run.
replicationRun_stageDetails :: Lens.Lens' ReplicationRun (Prelude.Maybe ReplicationRunStageDetails)
replicationRun_stageDetails :: (Maybe ReplicationRunStageDetails
 -> f (Maybe ReplicationRunStageDetails))
-> ReplicationRun -> f ReplicationRun
replicationRun_stageDetails = (ReplicationRun -> Maybe ReplicationRunStageDetails)
-> (ReplicationRun
    -> Maybe ReplicationRunStageDetails -> ReplicationRun)
-> Lens
     ReplicationRun
     ReplicationRun
     (Maybe ReplicationRunStageDetails)
     (Maybe ReplicationRunStageDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationRun' {Maybe ReplicationRunStageDetails
stageDetails :: Maybe ReplicationRunStageDetails
$sel:stageDetails:ReplicationRun' :: ReplicationRun -> Maybe ReplicationRunStageDetails
stageDetails} -> Maybe ReplicationRunStageDetails
stageDetails) (\s :: ReplicationRun
s@ReplicationRun' {} Maybe ReplicationRunStageDetails
a -> ReplicationRun
s {$sel:stageDetails:ReplicationRun' :: Maybe ReplicationRunStageDetails
stageDetails = Maybe ReplicationRunStageDetails
a} :: ReplicationRun)

-- | The start time of the next replication run.
replicationRun_scheduledStartTime :: Lens.Lens' ReplicationRun (Prelude.Maybe Prelude.UTCTime)
replicationRun_scheduledStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationRun -> f ReplicationRun
replicationRun_scheduledStartTime = (ReplicationRun -> Maybe POSIX)
-> (ReplicationRun -> Maybe POSIX -> ReplicationRun)
-> Lens ReplicationRun ReplicationRun (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationRun' {Maybe POSIX
scheduledStartTime :: Maybe POSIX
$sel:scheduledStartTime:ReplicationRun' :: ReplicationRun -> Maybe POSIX
scheduledStartTime} -> Maybe POSIX
scheduledStartTime) (\s :: ReplicationRun
s@ReplicationRun' {} Maybe POSIX
a -> ReplicationRun
s {$sel:scheduledStartTime:ReplicationRun' :: Maybe POSIX
scheduledStartTime = Maybe POSIX
a} :: ReplicationRun) ((Maybe POSIX -> f (Maybe POSIX))
 -> ReplicationRun -> f ReplicationRun)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationRun
-> f ReplicationRun
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 description of the current status of the replication job.
replicationRun_statusMessage :: Lens.Lens' ReplicationRun (Prelude.Maybe Prelude.Text)
replicationRun_statusMessage :: (Maybe Text -> f (Maybe Text))
-> ReplicationRun -> f ReplicationRun
replicationRun_statusMessage = (ReplicationRun -> Maybe Text)
-> (ReplicationRun -> Maybe Text -> ReplicationRun)
-> Lens ReplicationRun ReplicationRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationRun' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:ReplicationRun' :: ReplicationRun -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: ReplicationRun
s@ReplicationRun' {} Maybe Text
a -> ReplicationRun
s {$sel:statusMessage:ReplicationRun' :: Maybe Text
statusMessage = Maybe Text
a} :: ReplicationRun)

-- | The ID of the KMS key for replication jobs that produce encrypted AMIs.
-- This value can be any of the following:
--
-- -   KMS key ID
--
-- -   KMS key alias
--
-- -   ARN referring to the KMS key ID
--
-- -   ARN referring to the KMS key alias
--
-- If encrypted is /true/ but a KMS key ID is not specified, the
-- customer\'s default KMS key for Amazon EBS is used.
replicationRun_kmsKeyId :: Lens.Lens' ReplicationRun (Prelude.Maybe Prelude.Text)
replicationRun_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> ReplicationRun -> f ReplicationRun
replicationRun_kmsKeyId = (ReplicationRun -> Maybe Text)
-> (ReplicationRun -> Maybe Text -> ReplicationRun)
-> Lens ReplicationRun ReplicationRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationRun' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:ReplicationRun' :: ReplicationRun -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: ReplicationRun
s@ReplicationRun' {} Maybe Text
a -> ReplicationRun
s {$sel:kmsKeyId:ReplicationRun' :: Maybe Text
kmsKeyId = Maybe Text
a} :: ReplicationRun)

-- | The completion time of the last replication run.
replicationRun_completedTime :: Lens.Lens' ReplicationRun (Prelude.Maybe Prelude.UTCTime)
replicationRun_completedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationRun -> f ReplicationRun
replicationRun_completedTime = (ReplicationRun -> Maybe POSIX)
-> (ReplicationRun -> Maybe POSIX -> ReplicationRun)
-> Lens ReplicationRun ReplicationRun (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationRun' {Maybe POSIX
completedTime :: Maybe POSIX
$sel:completedTime:ReplicationRun' :: ReplicationRun -> Maybe POSIX
completedTime} -> Maybe POSIX
completedTime) (\s :: ReplicationRun
s@ReplicationRun' {} Maybe POSIX
a -> ReplicationRun
s {$sel:completedTime:ReplicationRun' :: Maybe POSIX
completedTime = Maybe POSIX
a} :: ReplicationRun) ((Maybe POSIX -> f (Maybe POSIX))
 -> ReplicationRun -> f ReplicationRun)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReplicationRun
-> f ReplicationRun
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 ID of the Amazon Machine Image (AMI) from the replication run.
replicationRun_amiId :: Lens.Lens' ReplicationRun (Prelude.Maybe Prelude.Text)
replicationRun_amiId :: (Maybe Text -> f (Maybe Text))
-> ReplicationRun -> f ReplicationRun
replicationRun_amiId = (ReplicationRun -> Maybe Text)
-> (ReplicationRun -> Maybe Text -> ReplicationRun)
-> Lens ReplicationRun ReplicationRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationRun' {Maybe Text
amiId :: Maybe Text
$sel:amiId:ReplicationRun' :: ReplicationRun -> Maybe Text
amiId} -> Maybe Text
amiId) (\s :: ReplicationRun
s@ReplicationRun' {} Maybe Text
a -> ReplicationRun
s {$sel:amiId:ReplicationRun' :: Maybe Text
amiId = Maybe Text
a} :: ReplicationRun)

-- | The type of replication run.
replicationRun_type :: Lens.Lens' ReplicationRun (Prelude.Maybe ReplicationRunType)
replicationRun_type :: (Maybe ReplicationRunType -> f (Maybe ReplicationRunType))
-> ReplicationRun -> f ReplicationRun
replicationRun_type = (ReplicationRun -> Maybe ReplicationRunType)
-> (ReplicationRun -> Maybe ReplicationRunType -> ReplicationRun)
-> Lens
     ReplicationRun
     ReplicationRun
     (Maybe ReplicationRunType)
     (Maybe ReplicationRunType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationRun' {Maybe ReplicationRunType
type' :: Maybe ReplicationRunType
$sel:type':ReplicationRun' :: ReplicationRun -> Maybe ReplicationRunType
type'} -> Maybe ReplicationRunType
type') (\s :: ReplicationRun
s@ReplicationRun' {} Maybe ReplicationRunType
a -> ReplicationRun
s {$sel:type':ReplicationRun' :: Maybe ReplicationRunType
type' = Maybe ReplicationRunType
a} :: ReplicationRun)

-- | The description of the replication run.
replicationRun_description :: Lens.Lens' ReplicationRun (Prelude.Maybe Prelude.Text)
replicationRun_description :: (Maybe Text -> f (Maybe Text))
-> ReplicationRun -> f ReplicationRun
replicationRun_description = (ReplicationRun -> Maybe Text)
-> (ReplicationRun -> Maybe Text -> ReplicationRun)
-> Lens ReplicationRun ReplicationRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationRun' {Maybe Text
description :: Maybe Text
$sel:description:ReplicationRun' :: ReplicationRun -> Maybe Text
description} -> Maybe Text
description) (\s :: ReplicationRun
s@ReplicationRun' {} Maybe Text
a -> ReplicationRun
s {$sel:description:ReplicationRun' :: Maybe Text
description = Maybe Text
a} :: ReplicationRun)

instance Core.FromJSON ReplicationRun where
  parseJSON :: Value -> Parser ReplicationRun
parseJSON =
    String
-> (Object -> Parser ReplicationRun)
-> Value
-> Parser ReplicationRun
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReplicationRun"
      ( \Object
x ->
          Maybe ReplicationRunState
-> Maybe Text
-> Maybe Bool
-> Maybe ReplicationRunStageDetails
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ReplicationRunType
-> Maybe Text
-> ReplicationRun
ReplicationRun'
            (Maybe ReplicationRunState
 -> Maybe Text
 -> Maybe Bool
 -> Maybe ReplicationRunStageDetails
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe ReplicationRunType
 -> Maybe Text
 -> ReplicationRun)
-> Parser (Maybe ReplicationRunState)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe ReplicationRunStageDetails
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ReplicationRunType
      -> Maybe Text
      -> ReplicationRun)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ReplicationRunState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe ReplicationRunStageDetails
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ReplicationRunType
   -> Maybe Text
   -> ReplicationRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe ReplicationRunStageDetails
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ReplicationRunType
      -> Maybe Text
      -> ReplicationRun)
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
"replicationRunId")
            Parser
  (Maybe Bool
   -> Maybe ReplicationRunStageDetails
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ReplicationRunType
   -> Maybe Text
   -> ReplicationRun)
-> Parser (Maybe Bool)
-> Parser
     (Maybe ReplicationRunStageDetails
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ReplicationRunType
      -> Maybe Text
      -> ReplicationRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"encrypted")
            Parser
  (Maybe ReplicationRunStageDetails
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ReplicationRunType
   -> Maybe Text
   -> ReplicationRun)
-> Parser (Maybe ReplicationRunStageDetails)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ReplicationRunType
      -> Maybe Text
      -> ReplicationRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ReplicationRunStageDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"stageDetails")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ReplicationRunType
   -> Maybe Text
   -> ReplicationRun)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ReplicationRunType
      -> Maybe Text
      -> ReplicationRun)
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
"scheduledStartTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ReplicationRunType
   -> Maybe Text
   -> ReplicationRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ReplicationRunType
      -> Maybe Text
      -> ReplicationRun)
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
"statusMessage")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ReplicationRunType
   -> Maybe Text
   -> ReplicationRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe ReplicationRunType
      -> Maybe Text
      -> ReplicationRun)
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
"kmsKeyId")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe ReplicationRunType
   -> Maybe Text
   -> ReplicationRun)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe ReplicationRunType -> Maybe Text -> ReplicationRun)
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
"completedTime")
            Parser
  (Maybe Text
   -> Maybe ReplicationRunType -> Maybe Text -> ReplicationRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe ReplicationRunType -> Maybe Text -> ReplicationRun)
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
"amiId")
            Parser (Maybe ReplicationRunType -> Maybe Text -> ReplicationRun)
-> Parser (Maybe ReplicationRunType)
-> Parser (Maybe Text -> ReplicationRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ReplicationRunType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
            Parser (Maybe Text -> ReplicationRun)
-> Parser (Maybe Text) -> Parser ReplicationRun
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
"description")
      )

instance Prelude.Hashable ReplicationRun

instance Prelude.NFData ReplicationRun