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

import Amazonka.Backup.Types.BackupJobState
import Amazonka.Backup.Types.RecoveryPointCreator
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains detailed information about a backup job.
--
-- /See:/ 'newBackupJob' smart constructor.
data BackupJob = BackupJob'
  { -- | Specifies the IAM role ARN used to create the target recovery point. IAM
    -- roles other than the default role must include either @AWSBackup@ or
    -- @AwsBackup@ in the role name. For example,
    -- @arn:aws:iam::123456789012:role\/AWSBackupRDSAccess@. Role names without
    -- those strings lack permissions to perform backup jobs.
    BackupJob -> Maybe Text
iamRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The current state of a resource recovery point.
    BackupJob -> Maybe BackupJobState
state :: Prelude.Maybe BackupJobState,
    -- | The type of Amazon Web Services resource to be backed up; for example,
    -- an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon
    -- Relational Database Service (Amazon RDS) database. For Windows Volume
    -- Shadow Copy Service (VSS) backups, the only supported resource type is
    -- Amazon EC2.
    BackupJob -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
    -- | Contains an estimated percentage complete of a job at the time the job
    -- status was queried.
    BackupJob -> Maybe Text
percentDone :: Prelude.Maybe Prelude.Text,
    -- | Specifies the time in Unix format and Coordinated Universal Time (UTC)
    -- when a backup job must be started before it is canceled. The value is
    -- calculated by adding the start window to the scheduled time. So if the
    -- scheduled time were 6:00 PM and the start window is 2 hours, the
    -- @StartBy@ time would be 8:00 PM on the date specified. The value of
    -- @StartBy@ is accurate to milliseconds. For example, the value
    -- 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
    BackupJob -> Maybe POSIX
startBy :: Prelude.Maybe Core.POSIX,
    -- | Contains identifying information about the creation of a backup job,
    -- including the @BackupPlanArn@, @BackupPlanId@, @BackupPlanVersion@, and
    -- @BackupRuleId@ of the backup plan used to create it.
    BackupJob -> Maybe RecoveryPointCreator
createdBy :: Prelude.Maybe RecoveryPointCreator,
    -- | The date and time a job to back up resources is expected to be
    -- completed, in Unix format and Coordinated Universal Time (UTC). The
    -- value of @ExpectedCompletionDate@ is accurate to milliseconds. For
    -- example, the value 1516925490.087 represents Friday, January 26, 2018
    -- 12:11:30.087 AM.
    BackupJob -> Maybe POSIX
expectedCompletionDate :: Prelude.Maybe Core.POSIX,
    -- | The size in bytes transferred to a backup vault at the time that the job
    -- status was queried.
    BackupJob -> Maybe Integer
bytesTransferred :: Prelude.Maybe Prelude.Integer,
    -- | An Amazon Resource Name (ARN) that uniquely identifies a backup vault;
    -- for example, @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
    BackupJob -> Maybe Text
backupVaultArn :: Prelude.Maybe Prelude.Text,
    -- | The account ID that owns the backup job.
    BackupJob -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | Uniquely identifies a request to Backup to back up a resource.
    BackupJob -> Maybe Text
backupJobId :: Prelude.Maybe Prelude.Text,
    -- | An ARN that uniquely identifies a resource. The format of the ARN
    -- depends on the resource type.
    BackupJob -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
    -- | A detailed message explaining the status of the job to back up a
    -- resource.
    BackupJob -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | An ARN that uniquely identifies a recovery point; for example,
    -- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
    BackupJob -> Maybe Text
recoveryPointArn :: Prelude.Maybe Prelude.Text,
    -- | The size, in bytes, of a backup.
    BackupJob -> Maybe Integer
backupSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The date and time a backup job is created, in Unix format and
    -- Coordinated Universal Time (UTC). The value of @CreationDate@ is
    -- accurate to milliseconds. For example, the value 1516925490.087
    -- represents Friday, January 26, 2018 12:11:30.087 AM.
    BackupJob -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | The date and time a job to create a backup job is completed, in Unix
    -- format and Coordinated Universal Time (UTC). The value of
    -- @CompletionDate@ is accurate to milliseconds. For example, the value
    -- 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
    BackupJob -> Maybe POSIX
completionDate :: Prelude.Maybe Core.POSIX,
    -- | The name of a logical container where backups are stored. Backup vaults
    -- are identified by names that are unique to the account used to create
    -- them and the Amazon Web Services Region where they are created. They
    -- consist of lowercase letters, numbers, and hyphens.
    BackupJob -> Maybe Text
backupVaultName :: Prelude.Maybe Prelude.Text,
    -- | Represents the type of backup for a backup job.
    BackupJob -> Maybe Text
backupType :: Prelude.Maybe Prelude.Text,
    -- | Specifies the backup option for a selected resource. This option is only
    -- available for Windows Volume Shadow Copy Service (VSS) backup jobs.
    --
    -- Valid values: Set to @\"WindowsVSS\":\"enabled\"@ to enable the
    -- @WindowsVSS@ backup option and create a Windows VSS backup. Set to
    -- @\"WindowsVSS\":\"disabled\"@ to create a regular backup. If you specify
    -- an invalid option, you get an @InvalidParameterValueException@
    -- exception.
    BackupJob -> Maybe (HashMap Text Text)
backupOptions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (BackupJob -> BackupJob -> Bool
(BackupJob -> BackupJob -> Bool)
-> (BackupJob -> BackupJob -> Bool) -> Eq BackupJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BackupJob -> BackupJob -> Bool
$c/= :: BackupJob -> BackupJob -> Bool
== :: BackupJob -> BackupJob -> Bool
$c== :: BackupJob -> BackupJob -> Bool
Prelude.Eq, ReadPrec [BackupJob]
ReadPrec BackupJob
Int -> ReadS BackupJob
ReadS [BackupJob]
(Int -> ReadS BackupJob)
-> ReadS [BackupJob]
-> ReadPrec BackupJob
-> ReadPrec [BackupJob]
-> Read BackupJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BackupJob]
$creadListPrec :: ReadPrec [BackupJob]
readPrec :: ReadPrec BackupJob
$creadPrec :: ReadPrec BackupJob
readList :: ReadS [BackupJob]
$creadList :: ReadS [BackupJob]
readsPrec :: Int -> ReadS BackupJob
$creadsPrec :: Int -> ReadS BackupJob
Prelude.Read, Int -> BackupJob -> ShowS
[BackupJob] -> ShowS
BackupJob -> String
(Int -> BackupJob -> ShowS)
-> (BackupJob -> String)
-> ([BackupJob] -> ShowS)
-> Show BackupJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BackupJob] -> ShowS
$cshowList :: [BackupJob] -> ShowS
show :: BackupJob -> String
$cshow :: BackupJob -> String
showsPrec :: Int -> BackupJob -> ShowS
$cshowsPrec :: Int -> BackupJob -> ShowS
Prelude.Show, (forall x. BackupJob -> Rep BackupJob x)
-> (forall x. Rep BackupJob x -> BackupJob) -> Generic BackupJob
forall x. Rep BackupJob x -> BackupJob
forall x. BackupJob -> Rep BackupJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BackupJob x -> BackupJob
$cfrom :: forall x. BackupJob -> Rep BackupJob x
Prelude.Generic)

-- |
-- Create a value of 'BackupJob' 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:
--
-- 'iamRoleArn', 'backupJob_iamRoleArn' - Specifies the IAM role ARN used to create the target recovery point. IAM
-- roles other than the default role must include either @AWSBackup@ or
-- @AwsBackup@ in the role name. For example,
-- @arn:aws:iam::123456789012:role\/AWSBackupRDSAccess@. Role names without
-- those strings lack permissions to perform backup jobs.
--
-- 'state', 'backupJob_state' - The current state of a resource recovery point.
--
-- 'resourceType', 'backupJob_resourceType' - The type of Amazon Web Services resource to be backed up; for example,
-- an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon
-- Relational Database Service (Amazon RDS) database. For Windows Volume
-- Shadow Copy Service (VSS) backups, the only supported resource type is
-- Amazon EC2.
--
-- 'percentDone', 'backupJob_percentDone' - Contains an estimated percentage complete of a job at the time the job
-- status was queried.
--
-- 'startBy', 'backupJob_startBy' - Specifies the time in Unix format and Coordinated Universal Time (UTC)
-- when a backup job must be started before it is canceled. The value is
-- calculated by adding the start window to the scheduled time. So if the
-- scheduled time were 6:00 PM and the start window is 2 hours, the
-- @StartBy@ time would be 8:00 PM on the date specified. The value of
-- @StartBy@ is accurate to milliseconds. For example, the value
-- 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
--
-- 'createdBy', 'backupJob_createdBy' - Contains identifying information about the creation of a backup job,
-- including the @BackupPlanArn@, @BackupPlanId@, @BackupPlanVersion@, and
-- @BackupRuleId@ of the backup plan used to create it.
--
-- 'expectedCompletionDate', 'backupJob_expectedCompletionDate' - The date and time a job to back up resources is expected to be
-- completed, in Unix format and Coordinated Universal Time (UTC). The
-- value of @ExpectedCompletionDate@ is accurate to milliseconds. For
-- example, the value 1516925490.087 represents Friday, January 26, 2018
-- 12:11:30.087 AM.
--
-- 'bytesTransferred', 'backupJob_bytesTransferred' - The size in bytes transferred to a backup vault at the time that the job
-- status was queried.
--
-- 'backupVaultArn', 'backupJob_backupVaultArn' - An Amazon Resource Name (ARN) that uniquely identifies a backup vault;
-- for example, @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
--
-- 'accountId', 'backupJob_accountId' - The account ID that owns the backup job.
--
-- 'backupJobId', 'backupJob_backupJobId' - Uniquely identifies a request to Backup to back up a resource.
--
-- 'resourceArn', 'backupJob_resourceArn' - An ARN that uniquely identifies a resource. The format of the ARN
-- depends on the resource type.
--
-- 'statusMessage', 'backupJob_statusMessage' - A detailed message explaining the status of the job to back up a
-- resource.
--
-- 'recoveryPointArn', 'backupJob_recoveryPointArn' - An ARN that uniquely identifies a recovery point; for example,
-- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
--
-- 'backupSizeInBytes', 'backupJob_backupSizeInBytes' - The size, in bytes, of a backup.
--
-- 'creationDate', 'backupJob_creationDate' - The date and time a backup job is created, in Unix format and
-- Coordinated Universal Time (UTC). The value of @CreationDate@ is
-- accurate to milliseconds. For example, the value 1516925490.087
-- represents Friday, January 26, 2018 12:11:30.087 AM.
--
-- 'completionDate', 'backupJob_completionDate' - The date and time a job to create a backup job is completed, in Unix
-- format and Coordinated Universal Time (UTC). The value of
-- @CompletionDate@ is accurate to milliseconds. For example, the value
-- 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
--
-- 'backupVaultName', 'backupJob_backupVaultName' - The name of a logical container where backups are stored. Backup vaults
-- are identified by names that are unique to the account used to create
-- them and the Amazon Web Services Region where they are created. They
-- consist of lowercase letters, numbers, and hyphens.
--
-- 'backupType', 'backupJob_backupType' - Represents the type of backup for a backup job.
--
-- 'backupOptions', 'backupJob_backupOptions' - Specifies the backup option for a selected resource. This option is only
-- available for Windows Volume Shadow Copy Service (VSS) backup jobs.
--
-- Valid values: Set to @\"WindowsVSS\":\"enabled\"@ to enable the
-- @WindowsVSS@ backup option and create a Windows VSS backup. Set to
-- @\"WindowsVSS\":\"disabled\"@ to create a regular backup. If you specify
-- an invalid option, you get an @InvalidParameterValueException@
-- exception.
newBackupJob ::
  BackupJob
newBackupJob :: BackupJob
newBackupJob =
  BackupJob' :: Maybe Text
-> Maybe BackupJobState
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe RecoveryPointCreator
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> BackupJob
BackupJob'
    { $sel:iamRoleArn:BackupJob' :: Maybe Text
iamRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:state:BackupJob' :: Maybe BackupJobState
state = Maybe BackupJobState
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:BackupJob' :: Maybe Text
resourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:percentDone:BackupJob' :: Maybe Text
percentDone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startBy:BackupJob' :: Maybe POSIX
startBy = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:BackupJob' :: Maybe RecoveryPointCreator
createdBy = Maybe RecoveryPointCreator
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedCompletionDate:BackupJob' :: Maybe POSIX
expectedCompletionDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:bytesTransferred:BackupJob' :: Maybe Integer
bytesTransferred = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:backupVaultArn:BackupJob' :: Maybe Text
backupVaultArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:BackupJob' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupJobId:BackupJob' :: Maybe Text
backupJobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:BackupJob' :: Maybe Text
resourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:BackupJob' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recoveryPointArn:BackupJob' :: Maybe Text
recoveryPointArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupSizeInBytes:BackupJob' :: Maybe Integer
backupSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:BackupJob' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:completionDate:BackupJob' :: Maybe POSIX
completionDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:backupVaultName:BackupJob' :: Maybe Text
backupVaultName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupType:BackupJob' :: Maybe Text
backupType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupOptions:BackupJob' :: Maybe (HashMap Text Text)
backupOptions = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the IAM role ARN used to create the target recovery point. IAM
-- roles other than the default role must include either @AWSBackup@ or
-- @AwsBackup@ in the role name. For example,
-- @arn:aws:iam::123456789012:role\/AWSBackupRDSAccess@. Role names without
-- those strings lack permissions to perform backup jobs.
backupJob_iamRoleArn :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Text)
backupJob_iamRoleArn :: (Maybe Text -> f (Maybe Text)) -> BackupJob -> f BackupJob
backupJob_iamRoleArn = (BackupJob -> Maybe Text)
-> (BackupJob -> Maybe Text -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Text
iamRoleArn :: Maybe Text
$sel:iamRoleArn:BackupJob' :: BackupJob -> Maybe Text
iamRoleArn} -> Maybe Text
iamRoleArn) (\s :: BackupJob
s@BackupJob' {} Maybe Text
a -> BackupJob
s {$sel:iamRoleArn:BackupJob' :: Maybe Text
iamRoleArn = Maybe Text
a} :: BackupJob)

-- | The current state of a resource recovery point.
backupJob_state :: Lens.Lens' BackupJob (Prelude.Maybe BackupJobState)
backupJob_state :: (Maybe BackupJobState -> f (Maybe BackupJobState))
-> BackupJob -> f BackupJob
backupJob_state = (BackupJob -> Maybe BackupJobState)
-> (BackupJob -> Maybe BackupJobState -> BackupJob)
-> Lens
     BackupJob BackupJob (Maybe BackupJobState) (Maybe BackupJobState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe BackupJobState
state :: Maybe BackupJobState
$sel:state:BackupJob' :: BackupJob -> Maybe BackupJobState
state} -> Maybe BackupJobState
state) (\s :: BackupJob
s@BackupJob' {} Maybe BackupJobState
a -> BackupJob
s {$sel:state:BackupJob' :: Maybe BackupJobState
state = Maybe BackupJobState
a} :: BackupJob)

-- | The type of Amazon Web Services resource to be backed up; for example,
-- an Amazon Elastic Block Store (Amazon EBS) volume or an Amazon
-- Relational Database Service (Amazon RDS) database. For Windows Volume
-- Shadow Copy Service (VSS) backups, the only supported resource type is
-- Amazon EC2.
backupJob_resourceType :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Text)
backupJob_resourceType :: (Maybe Text -> f (Maybe Text)) -> BackupJob -> f BackupJob
backupJob_resourceType = (BackupJob -> Maybe Text)
-> (BackupJob -> Maybe Text -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:BackupJob' :: BackupJob -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: BackupJob
s@BackupJob' {} Maybe Text
a -> BackupJob
s {$sel:resourceType:BackupJob' :: Maybe Text
resourceType = Maybe Text
a} :: BackupJob)

-- | Contains an estimated percentage complete of a job at the time the job
-- status was queried.
backupJob_percentDone :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Text)
backupJob_percentDone :: (Maybe Text -> f (Maybe Text)) -> BackupJob -> f BackupJob
backupJob_percentDone = (BackupJob -> Maybe Text)
-> (BackupJob -> Maybe Text -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Text
percentDone :: Maybe Text
$sel:percentDone:BackupJob' :: BackupJob -> Maybe Text
percentDone} -> Maybe Text
percentDone) (\s :: BackupJob
s@BackupJob' {} Maybe Text
a -> BackupJob
s {$sel:percentDone:BackupJob' :: Maybe Text
percentDone = Maybe Text
a} :: BackupJob)

-- | Specifies the time in Unix format and Coordinated Universal Time (UTC)
-- when a backup job must be started before it is canceled. The value is
-- calculated by adding the start window to the scheduled time. So if the
-- scheduled time were 6:00 PM and the start window is 2 hours, the
-- @StartBy@ time would be 8:00 PM on the date specified. The value of
-- @StartBy@ is accurate to milliseconds. For example, the value
-- 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
backupJob_startBy :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.UTCTime)
backupJob_startBy :: (Maybe UTCTime -> f (Maybe UTCTime)) -> BackupJob -> f BackupJob
backupJob_startBy = (BackupJob -> Maybe POSIX)
-> (BackupJob -> Maybe POSIX -> BackupJob)
-> Lens BackupJob BackupJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe POSIX
startBy :: Maybe POSIX
$sel:startBy:BackupJob' :: BackupJob -> Maybe POSIX
startBy} -> Maybe POSIX
startBy) (\s :: BackupJob
s@BackupJob' {} Maybe POSIX
a -> BackupJob
s {$sel:startBy:BackupJob' :: Maybe POSIX
startBy = Maybe POSIX
a} :: BackupJob) ((Maybe POSIX -> f (Maybe POSIX)) -> BackupJob -> f BackupJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BackupJob
-> f BackupJob
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

-- | Contains identifying information about the creation of a backup job,
-- including the @BackupPlanArn@, @BackupPlanId@, @BackupPlanVersion@, and
-- @BackupRuleId@ of the backup plan used to create it.
backupJob_createdBy :: Lens.Lens' BackupJob (Prelude.Maybe RecoveryPointCreator)
backupJob_createdBy :: (Maybe RecoveryPointCreator -> f (Maybe RecoveryPointCreator))
-> BackupJob -> f BackupJob
backupJob_createdBy = (BackupJob -> Maybe RecoveryPointCreator)
-> (BackupJob -> Maybe RecoveryPointCreator -> BackupJob)
-> Lens
     BackupJob
     BackupJob
     (Maybe RecoveryPointCreator)
     (Maybe RecoveryPointCreator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe RecoveryPointCreator
createdBy :: Maybe RecoveryPointCreator
$sel:createdBy:BackupJob' :: BackupJob -> Maybe RecoveryPointCreator
createdBy} -> Maybe RecoveryPointCreator
createdBy) (\s :: BackupJob
s@BackupJob' {} Maybe RecoveryPointCreator
a -> BackupJob
s {$sel:createdBy:BackupJob' :: Maybe RecoveryPointCreator
createdBy = Maybe RecoveryPointCreator
a} :: BackupJob)

-- | The date and time a job to back up resources is expected to be
-- completed, in Unix format and Coordinated Universal Time (UTC). The
-- value of @ExpectedCompletionDate@ is accurate to milliseconds. For
-- example, the value 1516925490.087 represents Friday, January 26, 2018
-- 12:11:30.087 AM.
backupJob_expectedCompletionDate :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.UTCTime)
backupJob_expectedCompletionDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> BackupJob -> f BackupJob
backupJob_expectedCompletionDate = (BackupJob -> Maybe POSIX)
-> (BackupJob -> Maybe POSIX -> BackupJob)
-> Lens BackupJob BackupJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe POSIX
expectedCompletionDate :: Maybe POSIX
$sel:expectedCompletionDate:BackupJob' :: BackupJob -> Maybe POSIX
expectedCompletionDate} -> Maybe POSIX
expectedCompletionDate) (\s :: BackupJob
s@BackupJob' {} Maybe POSIX
a -> BackupJob
s {$sel:expectedCompletionDate:BackupJob' :: Maybe POSIX
expectedCompletionDate = Maybe POSIX
a} :: BackupJob) ((Maybe POSIX -> f (Maybe POSIX)) -> BackupJob -> f BackupJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BackupJob
-> f BackupJob
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 size in bytes transferred to a backup vault at the time that the job
-- status was queried.
backupJob_bytesTransferred :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Integer)
backupJob_bytesTransferred :: (Maybe Integer -> f (Maybe Integer)) -> BackupJob -> f BackupJob
backupJob_bytesTransferred = (BackupJob -> Maybe Integer)
-> (BackupJob -> Maybe Integer -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Integer
bytesTransferred :: Maybe Integer
$sel:bytesTransferred:BackupJob' :: BackupJob -> Maybe Integer
bytesTransferred} -> Maybe Integer
bytesTransferred) (\s :: BackupJob
s@BackupJob' {} Maybe Integer
a -> BackupJob
s {$sel:bytesTransferred:BackupJob' :: Maybe Integer
bytesTransferred = Maybe Integer
a} :: BackupJob)

-- | An Amazon Resource Name (ARN) that uniquely identifies a backup vault;
-- for example, @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
backupJob_backupVaultArn :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Text)
backupJob_backupVaultArn :: (Maybe Text -> f (Maybe Text)) -> BackupJob -> f BackupJob
backupJob_backupVaultArn = (BackupJob -> Maybe Text)
-> (BackupJob -> Maybe Text -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Text
backupVaultArn :: Maybe Text
$sel:backupVaultArn:BackupJob' :: BackupJob -> Maybe Text
backupVaultArn} -> Maybe Text
backupVaultArn) (\s :: BackupJob
s@BackupJob' {} Maybe Text
a -> BackupJob
s {$sel:backupVaultArn:BackupJob' :: Maybe Text
backupVaultArn = Maybe Text
a} :: BackupJob)

-- | The account ID that owns the backup job.
backupJob_accountId :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Text)
backupJob_accountId :: (Maybe Text -> f (Maybe Text)) -> BackupJob -> f BackupJob
backupJob_accountId = (BackupJob -> Maybe Text)
-> (BackupJob -> Maybe Text -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Text
accountId :: Maybe Text
$sel:accountId:BackupJob' :: BackupJob -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: BackupJob
s@BackupJob' {} Maybe Text
a -> BackupJob
s {$sel:accountId:BackupJob' :: Maybe Text
accountId = Maybe Text
a} :: BackupJob)

-- | Uniquely identifies a request to Backup to back up a resource.
backupJob_backupJobId :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Text)
backupJob_backupJobId :: (Maybe Text -> f (Maybe Text)) -> BackupJob -> f BackupJob
backupJob_backupJobId = (BackupJob -> Maybe Text)
-> (BackupJob -> Maybe Text -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Text
backupJobId :: Maybe Text
$sel:backupJobId:BackupJob' :: BackupJob -> Maybe Text
backupJobId} -> Maybe Text
backupJobId) (\s :: BackupJob
s@BackupJob' {} Maybe Text
a -> BackupJob
s {$sel:backupJobId:BackupJob' :: Maybe Text
backupJobId = Maybe Text
a} :: BackupJob)

-- | An ARN that uniquely identifies a resource. The format of the ARN
-- depends on the resource type.
backupJob_resourceArn :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Text)
backupJob_resourceArn :: (Maybe Text -> f (Maybe Text)) -> BackupJob -> f BackupJob
backupJob_resourceArn = (BackupJob -> Maybe Text)
-> (BackupJob -> Maybe Text -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:BackupJob' :: BackupJob -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: BackupJob
s@BackupJob' {} Maybe Text
a -> BackupJob
s {$sel:resourceArn:BackupJob' :: Maybe Text
resourceArn = Maybe Text
a} :: BackupJob)

-- | A detailed message explaining the status of the job to back up a
-- resource.
backupJob_statusMessage :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Text)
backupJob_statusMessage :: (Maybe Text -> f (Maybe Text)) -> BackupJob -> f BackupJob
backupJob_statusMessage = (BackupJob -> Maybe Text)
-> (BackupJob -> Maybe Text -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:BackupJob' :: BackupJob -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: BackupJob
s@BackupJob' {} Maybe Text
a -> BackupJob
s {$sel:statusMessage:BackupJob' :: Maybe Text
statusMessage = Maybe Text
a} :: BackupJob)

-- | An ARN that uniquely identifies a recovery point; for example,
-- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
backupJob_recoveryPointArn :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Text)
backupJob_recoveryPointArn :: (Maybe Text -> f (Maybe Text)) -> BackupJob -> f BackupJob
backupJob_recoveryPointArn = (BackupJob -> Maybe Text)
-> (BackupJob -> Maybe Text -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Text
recoveryPointArn :: Maybe Text
$sel:recoveryPointArn:BackupJob' :: BackupJob -> Maybe Text
recoveryPointArn} -> Maybe Text
recoveryPointArn) (\s :: BackupJob
s@BackupJob' {} Maybe Text
a -> BackupJob
s {$sel:recoveryPointArn:BackupJob' :: Maybe Text
recoveryPointArn = Maybe Text
a} :: BackupJob)

-- | The size, in bytes, of a backup.
backupJob_backupSizeInBytes :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Integer)
backupJob_backupSizeInBytes :: (Maybe Integer -> f (Maybe Integer)) -> BackupJob -> f BackupJob
backupJob_backupSizeInBytes = (BackupJob -> Maybe Integer)
-> (BackupJob -> Maybe Integer -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Integer
backupSizeInBytes :: Maybe Integer
$sel:backupSizeInBytes:BackupJob' :: BackupJob -> Maybe Integer
backupSizeInBytes} -> Maybe Integer
backupSizeInBytes) (\s :: BackupJob
s@BackupJob' {} Maybe Integer
a -> BackupJob
s {$sel:backupSizeInBytes:BackupJob' :: Maybe Integer
backupSizeInBytes = Maybe Integer
a} :: BackupJob)

-- | The date and time a backup job is created, in Unix format and
-- Coordinated Universal Time (UTC). The value of @CreationDate@ is
-- accurate to milliseconds. For example, the value 1516925490.087
-- represents Friday, January 26, 2018 12:11:30.087 AM.
backupJob_creationDate :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.UTCTime)
backupJob_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> BackupJob -> f BackupJob
backupJob_creationDate = (BackupJob -> Maybe POSIX)
-> (BackupJob -> Maybe POSIX -> BackupJob)
-> Lens BackupJob BackupJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:BackupJob' :: BackupJob -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: BackupJob
s@BackupJob' {} Maybe POSIX
a -> BackupJob
s {$sel:creationDate:BackupJob' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: BackupJob) ((Maybe POSIX -> f (Maybe POSIX)) -> BackupJob -> f BackupJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BackupJob
-> f BackupJob
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 a job to create a backup job is completed, in Unix
-- format and Coordinated Universal Time (UTC). The value of
-- @CompletionDate@ is accurate to milliseconds. For example, the value
-- 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
backupJob_completionDate :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.UTCTime)
backupJob_completionDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> BackupJob -> f BackupJob
backupJob_completionDate = (BackupJob -> Maybe POSIX)
-> (BackupJob -> Maybe POSIX -> BackupJob)
-> Lens BackupJob BackupJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe POSIX
completionDate :: Maybe POSIX
$sel:completionDate:BackupJob' :: BackupJob -> Maybe POSIX
completionDate} -> Maybe POSIX
completionDate) (\s :: BackupJob
s@BackupJob' {} Maybe POSIX
a -> BackupJob
s {$sel:completionDate:BackupJob' :: Maybe POSIX
completionDate = Maybe POSIX
a} :: BackupJob) ((Maybe POSIX -> f (Maybe POSIX)) -> BackupJob -> f BackupJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BackupJob
-> f BackupJob
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 name of a logical container where backups are stored. Backup vaults
-- are identified by names that are unique to the account used to create
-- them and the Amazon Web Services Region where they are created. They
-- consist of lowercase letters, numbers, and hyphens.
backupJob_backupVaultName :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Text)
backupJob_backupVaultName :: (Maybe Text -> f (Maybe Text)) -> BackupJob -> f BackupJob
backupJob_backupVaultName = (BackupJob -> Maybe Text)
-> (BackupJob -> Maybe Text -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Text
backupVaultName :: Maybe Text
$sel:backupVaultName:BackupJob' :: BackupJob -> Maybe Text
backupVaultName} -> Maybe Text
backupVaultName) (\s :: BackupJob
s@BackupJob' {} Maybe Text
a -> BackupJob
s {$sel:backupVaultName:BackupJob' :: Maybe Text
backupVaultName = Maybe Text
a} :: BackupJob)

-- | Represents the type of backup for a backup job.
backupJob_backupType :: Lens.Lens' BackupJob (Prelude.Maybe Prelude.Text)
backupJob_backupType :: (Maybe Text -> f (Maybe Text)) -> BackupJob -> f BackupJob
backupJob_backupType = (BackupJob -> Maybe Text)
-> (BackupJob -> Maybe Text -> BackupJob)
-> Lens BackupJob BackupJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe Text
backupType :: Maybe Text
$sel:backupType:BackupJob' :: BackupJob -> Maybe Text
backupType} -> Maybe Text
backupType) (\s :: BackupJob
s@BackupJob' {} Maybe Text
a -> BackupJob
s {$sel:backupType:BackupJob' :: Maybe Text
backupType = Maybe Text
a} :: BackupJob)

-- | Specifies the backup option for a selected resource. This option is only
-- available for Windows Volume Shadow Copy Service (VSS) backup jobs.
--
-- Valid values: Set to @\"WindowsVSS\":\"enabled\"@ to enable the
-- @WindowsVSS@ backup option and create a Windows VSS backup. Set to
-- @\"WindowsVSS\":\"disabled\"@ to create a regular backup. If you specify
-- an invalid option, you get an @InvalidParameterValueException@
-- exception.
backupJob_backupOptions :: Lens.Lens' BackupJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
backupJob_backupOptions :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> BackupJob -> f BackupJob
backupJob_backupOptions = (BackupJob -> Maybe (HashMap Text Text))
-> (BackupJob -> Maybe (HashMap Text Text) -> BackupJob)
-> Lens
     BackupJob
     BackupJob
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackupJob' {Maybe (HashMap Text Text)
backupOptions :: Maybe (HashMap Text Text)
$sel:backupOptions:BackupJob' :: BackupJob -> Maybe (HashMap Text Text)
backupOptions} -> Maybe (HashMap Text Text)
backupOptions) (\s :: BackupJob
s@BackupJob' {} Maybe (HashMap Text Text)
a -> BackupJob
s {$sel:backupOptions:BackupJob' :: Maybe (HashMap Text Text)
backupOptions = Maybe (HashMap Text Text)
a} :: BackupJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> BackupJob -> f BackupJob)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> BackupJob
-> f BackupJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON BackupJob where
  parseJSON :: Value -> Parser BackupJob
parseJSON =
    String -> (Object -> Parser BackupJob) -> Value -> Parser BackupJob
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BackupJob"
      ( \Object
x ->
          Maybe Text
-> Maybe BackupJobState
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe RecoveryPointCreator
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> BackupJob
BackupJob'
            (Maybe Text
 -> Maybe BackupJobState
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe RecoveryPointCreator
 -> Maybe POSIX
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> BackupJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe BackupJobState
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe RecoveryPointCreator
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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
"IamRoleArn")
            Parser
  (Maybe BackupJobState
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe RecoveryPointCreator
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe BackupJobState)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe RecoveryPointCreator
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BackupJobState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe RecoveryPointCreator
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe RecoveryPointCreator
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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
"ResourceType")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe RecoveryPointCreator
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe RecoveryPointCreator
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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
"PercentDone")
            Parser
  (Maybe POSIX
   -> Maybe RecoveryPointCreator
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe RecoveryPointCreator
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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
"StartBy")
            Parser
  (Maybe RecoveryPointCreator
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe RecoveryPointCreator)
-> Parser
     (Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RecoveryPointCreator)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedBy")
            Parser
  (Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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
"ExpectedCompletionDate")
            Parser
  (Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BytesTransferred")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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
"BackupVaultArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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
"AccountId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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
"BackupJobId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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
"ResourceArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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 Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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
"RecoveryPointArn")
            Parser
  (Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe Integer)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BackupSizeInBytes")
            Parser
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> BackupJob)
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
"CreationDate")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> BackupJob)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe (HashMap Text Text) -> BackupJob)
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
"CompletionDate")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe (HashMap Text Text) -> BackupJob)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe (HashMap Text Text) -> BackupJob)
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
"BackupVaultName")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> BackupJob)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> BackupJob)
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
"BackupType")
            Parser (Maybe (HashMap Text Text) -> BackupJob)
-> Parser (Maybe (HashMap Text Text)) -> Parser BackupJob
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BackupOptions" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable BackupJob

instance Prelude.NFData BackupJob