{-# 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.CloudHSMV2.Types.Backup
-- 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.CloudHSMV2.Types.Backup where

import Amazonka.CloudHSMV2.Types.BackupState
import Amazonka.CloudHSMV2.Types.Tag
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a backup of an AWS CloudHSM cluster. All
-- backup objects contain the @BackupId@, @BackupState@, @ClusterId@, and
-- @CreateTimestamp@ parameters. Backups that were copied into a
-- destination region additionally contain the @CopyTimestamp@,
-- @SourceBackup@, @SourceCluster@, and @SourceRegion@ parameters. A backup
-- that is pending deletion will include the @DeleteTimestamp@ parameter.
--
-- /See:/ 'newBackup' smart constructor.
data Backup = Backup'
  { -- | The date and time when the backup will be permanently deleted.
    Backup -> Maybe POSIX
deleteTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The identifier (ID) of the cluster containing the source backup from
    -- which the new backup was copied.
    Backup -> Maybe Text
sourceCluster :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the service should exempt a backup from the retention
    -- policy for the cluster. @True@ exempts a backup from the retention
    -- policy. @False@ means the service applies the backup retention policy
    -- defined at the cluster.
    Backup -> Maybe Bool
neverExpires :: Prelude.Maybe Prelude.Bool,
    -- | The AWS Region that contains the source backup from which the new backup
    -- was copied.
    Backup -> Maybe Text
sourceRegion :: Prelude.Maybe Prelude.Text,
    -- | The list of tags for the backup.
    Backup -> Maybe [Tag]
tagList :: Prelude.Maybe [Tag],
    -- | The identifier (ID) of the source backup from which the new backup was
    -- copied.
    Backup -> Maybe Text
sourceBackup :: Prelude.Maybe Prelude.Text,
    -- | The identifier (ID) of the cluster that was backed up.
    Backup -> Maybe Text
clusterId :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the backup was created.
    Backup -> Maybe POSIX
createTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The date and time when the backup was copied from a source backup.
    Backup -> Maybe POSIX
copyTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The state of the backup.
    Backup -> Maybe BackupState
backupState :: Prelude.Maybe BackupState,
    -- | The identifier (ID) of the backup.
    Backup -> Text
backupId :: Prelude.Text
  }
  deriving (Backup -> Backup -> Bool
(Backup -> Backup -> Bool)
-> (Backup -> Backup -> Bool) -> Eq Backup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Backup -> Backup -> Bool
$c/= :: Backup -> Backup -> Bool
== :: Backup -> Backup -> Bool
$c== :: Backup -> Backup -> Bool
Prelude.Eq, ReadPrec [Backup]
ReadPrec Backup
Int -> ReadS Backup
ReadS [Backup]
(Int -> ReadS Backup)
-> ReadS [Backup]
-> ReadPrec Backup
-> ReadPrec [Backup]
-> Read Backup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Backup]
$creadListPrec :: ReadPrec [Backup]
readPrec :: ReadPrec Backup
$creadPrec :: ReadPrec Backup
readList :: ReadS [Backup]
$creadList :: ReadS [Backup]
readsPrec :: Int -> ReadS Backup
$creadsPrec :: Int -> ReadS Backup
Prelude.Read, Int -> Backup -> ShowS
[Backup] -> ShowS
Backup -> String
(Int -> Backup -> ShowS)
-> (Backup -> String) -> ([Backup] -> ShowS) -> Show Backup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Backup] -> ShowS
$cshowList :: [Backup] -> ShowS
show :: Backup -> String
$cshow :: Backup -> String
showsPrec :: Int -> Backup -> ShowS
$cshowsPrec :: Int -> Backup -> ShowS
Prelude.Show, (forall x. Backup -> Rep Backup x)
-> (forall x. Rep Backup x -> Backup) -> Generic Backup
forall x. Rep Backup x -> Backup
forall x. Backup -> Rep Backup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Backup x -> Backup
$cfrom :: forall x. Backup -> Rep Backup x
Prelude.Generic)

-- |
-- Create a value of 'Backup' 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:
--
-- 'deleteTimestamp', 'backup_deleteTimestamp' - The date and time when the backup will be permanently deleted.
--
-- 'sourceCluster', 'backup_sourceCluster' - The identifier (ID) of the cluster containing the source backup from
-- which the new backup was copied.
--
-- 'neverExpires', 'backup_neverExpires' - Specifies whether the service should exempt a backup from the retention
-- policy for the cluster. @True@ exempts a backup from the retention
-- policy. @False@ means the service applies the backup retention policy
-- defined at the cluster.
--
-- 'sourceRegion', 'backup_sourceRegion' - The AWS Region that contains the source backup from which the new backup
-- was copied.
--
-- 'tagList', 'backup_tagList' - The list of tags for the backup.
--
-- 'sourceBackup', 'backup_sourceBackup' - The identifier (ID) of the source backup from which the new backup was
-- copied.
--
-- 'clusterId', 'backup_clusterId' - The identifier (ID) of the cluster that was backed up.
--
-- 'createTimestamp', 'backup_createTimestamp' - The date and time when the backup was created.
--
-- 'copyTimestamp', 'backup_copyTimestamp' - The date and time when the backup was copied from a source backup.
--
-- 'backupState', 'backup_backupState' - The state of the backup.
--
-- 'backupId', 'backup_backupId' - The identifier (ID) of the backup.
newBackup ::
  -- | 'backupId'
  Prelude.Text ->
  Backup
newBackup :: Text -> Backup
newBackup Text
pBackupId_ =
  Backup' :: Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [Tag]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe BackupState
-> Text
-> Backup
Backup'
    { $sel:deleteTimestamp:Backup' :: Maybe POSIX
deleteTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceCluster:Backup' :: Maybe Text
sourceCluster = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:neverExpires:Backup' :: Maybe Bool
neverExpires = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceRegion:Backup' :: Maybe Text
sourceRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tagList:Backup' :: Maybe [Tag]
tagList = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceBackup:Backup' :: Maybe Text
sourceBackup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterId:Backup' :: Maybe Text
clusterId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createTimestamp:Backup' :: Maybe POSIX
createTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:copyTimestamp:Backup' :: Maybe POSIX
copyTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:backupState:Backup' :: Maybe BackupState
backupState = Maybe BackupState
forall a. Maybe a
Prelude.Nothing,
      $sel:backupId:Backup' :: Text
backupId = Text
pBackupId_
    }

-- | The date and time when the backup will be permanently deleted.
backup_deleteTimestamp :: Lens.Lens' Backup (Prelude.Maybe Prelude.UTCTime)
backup_deleteTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Backup -> f Backup
backup_deleteTimestamp = (Backup -> Maybe POSIX)
-> (Backup -> Maybe POSIX -> Backup)
-> Lens Backup Backup (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Backup' {Maybe POSIX
deleteTimestamp :: Maybe POSIX
$sel:deleteTimestamp:Backup' :: Backup -> Maybe POSIX
deleteTimestamp} -> Maybe POSIX
deleteTimestamp) (\s :: Backup
s@Backup' {} Maybe POSIX
a -> Backup
s {$sel:deleteTimestamp:Backup' :: Maybe POSIX
deleteTimestamp = Maybe POSIX
a} :: Backup) ((Maybe POSIX -> f (Maybe POSIX)) -> Backup -> f Backup)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Backup
-> f Backup
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 identifier (ID) of the cluster containing the source backup from
-- which the new backup was copied.
backup_sourceCluster :: Lens.Lens' Backup (Prelude.Maybe Prelude.Text)
backup_sourceCluster :: (Maybe Text -> f (Maybe Text)) -> Backup -> f Backup
backup_sourceCluster = (Backup -> Maybe Text)
-> (Backup -> Maybe Text -> Backup)
-> Lens Backup Backup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Backup' {Maybe Text
sourceCluster :: Maybe Text
$sel:sourceCluster:Backup' :: Backup -> Maybe Text
sourceCluster} -> Maybe Text
sourceCluster) (\s :: Backup
s@Backup' {} Maybe Text
a -> Backup
s {$sel:sourceCluster:Backup' :: Maybe Text
sourceCluster = Maybe Text
a} :: Backup)

-- | Specifies whether the service should exempt a backup from the retention
-- policy for the cluster. @True@ exempts a backup from the retention
-- policy. @False@ means the service applies the backup retention policy
-- defined at the cluster.
backup_neverExpires :: Lens.Lens' Backup (Prelude.Maybe Prelude.Bool)
backup_neverExpires :: (Maybe Bool -> f (Maybe Bool)) -> Backup -> f Backup
backup_neverExpires = (Backup -> Maybe Bool)
-> (Backup -> Maybe Bool -> Backup)
-> Lens Backup Backup (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Backup' {Maybe Bool
neverExpires :: Maybe Bool
$sel:neverExpires:Backup' :: Backup -> Maybe Bool
neverExpires} -> Maybe Bool
neverExpires) (\s :: Backup
s@Backup' {} Maybe Bool
a -> Backup
s {$sel:neverExpires:Backup' :: Maybe Bool
neverExpires = Maybe Bool
a} :: Backup)

-- | The AWS Region that contains the source backup from which the new backup
-- was copied.
backup_sourceRegion :: Lens.Lens' Backup (Prelude.Maybe Prelude.Text)
backup_sourceRegion :: (Maybe Text -> f (Maybe Text)) -> Backup -> f Backup
backup_sourceRegion = (Backup -> Maybe Text)
-> (Backup -> Maybe Text -> Backup)
-> Lens Backup Backup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Backup' {Maybe Text
sourceRegion :: Maybe Text
$sel:sourceRegion:Backup' :: Backup -> Maybe Text
sourceRegion} -> Maybe Text
sourceRegion) (\s :: Backup
s@Backup' {} Maybe Text
a -> Backup
s {$sel:sourceRegion:Backup' :: Maybe Text
sourceRegion = Maybe Text
a} :: Backup)

-- | The list of tags for the backup.
backup_tagList :: Lens.Lens' Backup (Prelude.Maybe [Tag])
backup_tagList :: (Maybe [Tag] -> f (Maybe [Tag])) -> Backup -> f Backup
backup_tagList = (Backup -> Maybe [Tag])
-> (Backup -> Maybe [Tag] -> Backup)
-> Lens Backup Backup (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Backup' {Maybe [Tag]
tagList :: Maybe [Tag]
$sel:tagList:Backup' :: Backup -> Maybe [Tag]
tagList} -> Maybe [Tag]
tagList) (\s :: Backup
s@Backup' {} Maybe [Tag]
a -> Backup
s {$sel:tagList:Backup' :: Maybe [Tag]
tagList = Maybe [Tag]
a} :: Backup) ((Maybe [Tag] -> f (Maybe [Tag])) -> Backup -> f Backup)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> Backup
-> f Backup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier (ID) of the source backup from which the new backup was
-- copied.
backup_sourceBackup :: Lens.Lens' Backup (Prelude.Maybe Prelude.Text)
backup_sourceBackup :: (Maybe Text -> f (Maybe Text)) -> Backup -> f Backup
backup_sourceBackup = (Backup -> Maybe Text)
-> (Backup -> Maybe Text -> Backup)
-> Lens Backup Backup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Backup' {Maybe Text
sourceBackup :: Maybe Text
$sel:sourceBackup:Backup' :: Backup -> Maybe Text
sourceBackup} -> Maybe Text
sourceBackup) (\s :: Backup
s@Backup' {} Maybe Text
a -> Backup
s {$sel:sourceBackup:Backup' :: Maybe Text
sourceBackup = Maybe Text
a} :: Backup)

-- | The identifier (ID) of the cluster that was backed up.
backup_clusterId :: Lens.Lens' Backup (Prelude.Maybe Prelude.Text)
backup_clusterId :: (Maybe Text -> f (Maybe Text)) -> Backup -> f Backup
backup_clusterId = (Backup -> Maybe Text)
-> (Backup -> Maybe Text -> Backup)
-> Lens Backup Backup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Backup' {Maybe Text
clusterId :: Maybe Text
$sel:clusterId:Backup' :: Backup -> Maybe Text
clusterId} -> Maybe Text
clusterId) (\s :: Backup
s@Backup' {} Maybe Text
a -> Backup
s {$sel:clusterId:Backup' :: Maybe Text
clusterId = Maybe Text
a} :: Backup)

-- | The date and time when the backup was created.
backup_createTimestamp :: Lens.Lens' Backup (Prelude.Maybe Prelude.UTCTime)
backup_createTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Backup -> f Backup
backup_createTimestamp = (Backup -> Maybe POSIX)
-> (Backup -> Maybe POSIX -> Backup)
-> Lens Backup Backup (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Backup' {Maybe POSIX
createTimestamp :: Maybe POSIX
$sel:createTimestamp:Backup' :: Backup -> Maybe POSIX
createTimestamp} -> Maybe POSIX
createTimestamp) (\s :: Backup
s@Backup' {} Maybe POSIX
a -> Backup
s {$sel:createTimestamp:Backup' :: Maybe POSIX
createTimestamp = Maybe POSIX
a} :: Backup) ((Maybe POSIX -> f (Maybe POSIX)) -> Backup -> f Backup)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Backup
-> f Backup
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 date and time when the backup was copied from a source backup.
backup_copyTimestamp :: Lens.Lens' Backup (Prelude.Maybe Prelude.UTCTime)
backup_copyTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Backup -> f Backup
backup_copyTimestamp = (Backup -> Maybe POSIX)
-> (Backup -> Maybe POSIX -> Backup)
-> Lens Backup Backup (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Backup' {Maybe POSIX
copyTimestamp :: Maybe POSIX
$sel:copyTimestamp:Backup' :: Backup -> Maybe POSIX
copyTimestamp} -> Maybe POSIX
copyTimestamp) (\s :: Backup
s@Backup' {} Maybe POSIX
a -> Backup
s {$sel:copyTimestamp:Backup' :: Maybe POSIX
copyTimestamp = Maybe POSIX
a} :: Backup) ((Maybe POSIX -> f (Maybe POSIX)) -> Backup -> f Backup)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Backup
-> f Backup
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 state of the backup.
backup_backupState :: Lens.Lens' Backup (Prelude.Maybe BackupState)
backup_backupState :: (Maybe BackupState -> f (Maybe BackupState)) -> Backup -> f Backup
backup_backupState = (Backup -> Maybe BackupState)
-> (Backup -> Maybe BackupState -> Backup)
-> Lens Backup Backup (Maybe BackupState) (Maybe BackupState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Backup' {Maybe BackupState
backupState :: Maybe BackupState
$sel:backupState:Backup' :: Backup -> Maybe BackupState
backupState} -> Maybe BackupState
backupState) (\s :: Backup
s@Backup' {} Maybe BackupState
a -> Backup
s {$sel:backupState:Backup' :: Maybe BackupState
backupState = Maybe BackupState
a} :: Backup)

-- | The identifier (ID) of the backup.
backup_backupId :: Lens.Lens' Backup Prelude.Text
backup_backupId :: (Text -> f Text) -> Backup -> f Backup
backup_backupId = (Backup -> Text)
-> (Backup -> Text -> Backup) -> Lens Backup Backup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Backup' {Text
backupId :: Text
$sel:backupId:Backup' :: Backup -> Text
backupId} -> Text
backupId) (\s :: Backup
s@Backup' {} Text
a -> Backup
s {$sel:backupId:Backup' :: Text
backupId = Text
a} :: Backup)

instance Core.FromJSON Backup where
  parseJSON :: Value -> Parser Backup
parseJSON =
    String -> (Object -> Parser Backup) -> Value -> Parser Backup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Backup"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [Tag]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe BackupState
-> Text
-> Backup
Backup'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe [Tag]
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe BackupState
 -> Text
 -> Backup)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe BackupState
      -> Text
      -> Backup)
forall (f :: * -> *) a b. Functor 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
"DeleteTimestamp")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe BackupState
   -> Text
   -> Backup)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe BackupState
      -> Text
      -> Backup)
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
"SourceCluster")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe BackupState
   -> Text
   -> Backup)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe BackupState
      -> Text
      -> Backup)
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
"NeverExpires")
            Parser
  (Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe BackupState
   -> Text
   -> Backup)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Tag]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe BackupState
      -> Text
      -> Backup)
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
"SourceRegion")
            Parser
  (Maybe [Tag]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe BackupState
   -> Text
   -> Backup)
-> Parser (Maybe [Tag])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe BackupState
      -> Text
      -> Backup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TagList" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe BackupState
   -> Text
   -> Backup)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe BackupState
      -> Text
      -> Backup)
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
"SourceBackup")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe BackupState
   -> Text
   -> Backup)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe POSIX -> Maybe BackupState -> Text -> Backup)
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
"ClusterId")
            Parser
  (Maybe POSIX -> Maybe POSIX -> Maybe BackupState -> Text -> Backup)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> Maybe BackupState -> Text -> Backup)
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
"CreateTimestamp")
            Parser (Maybe POSIX -> Maybe BackupState -> Text -> Backup)
-> Parser (Maybe POSIX)
-> Parser (Maybe BackupState -> Text -> Backup)
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
"CopyTimestamp")
            Parser (Maybe BackupState -> Text -> Backup)
-> Parser (Maybe BackupState) -> Parser (Text -> Backup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BackupState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BackupState")
            Parser (Text -> Backup) -> Parser Text -> Parser Backup
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"BackupId")
      )

instance Prelude.Hashable Backup

instance Prelude.NFData Backup