{-# 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.CopyJob
-- 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.CopyJob where

import Amazonka.Backup.Types.CopyJobState
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 copy job.
--
-- /See:/ 'newCopyJob' smart constructor.
data CopyJob = CopyJob'
  { -- | Specifies the IAM role ARN used to copy the target recovery point; for
    -- example, @arn:aws:iam::123456789012:role\/S3Access@.
    CopyJob -> Maybe Text
iamRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The current state of a copy job.
    CopyJob -> Maybe CopyJobState
state :: Prelude.Maybe CopyJobState,
    -- | An ARN that uniquely identifies a source recovery point; for example,
    -- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
    CopyJob -> Maybe Text
sourceRecoveryPointArn :: Prelude.Maybe Prelude.Text,
    -- | The type of Amazon Web Services resource to be copied; for example, an
    -- Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational
    -- Database Service (Amazon RDS) database.
    CopyJob -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
    -- | An Amazon Resource Name (ARN) that uniquely identifies a destination
    -- copy vault; for example,
    -- @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
    CopyJob -> Maybe Text
destinationBackupVaultArn :: Prelude.Maybe Prelude.Text,
    CopyJob -> Maybe RecoveryPointCreator
createdBy :: Prelude.Maybe RecoveryPointCreator,
    -- | An ARN that uniquely identifies a destination recovery point; for
    -- example,
    -- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
    CopyJob -> Maybe Text
destinationRecoveryPointArn :: Prelude.Maybe Prelude.Text,
    -- | The account ID that owns the copy job.
    CopyJob -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | An Amazon Resource Name (ARN) that uniquely identifies a source copy
    -- vault; for example,
    -- @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
    CopyJob -> Maybe Text
sourceBackupVaultArn :: Prelude.Maybe Prelude.Text,
    -- | Uniquely identifies a copy job.
    CopyJob -> Maybe Text
copyJobId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services resource to be copied; for example, an Amazon
    -- Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database
    -- Service (Amazon RDS) database.
    CopyJob -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
    -- | A detailed message explaining the status of the job to copy a resource.
    CopyJob -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | The size, in bytes, of a copy job.
    CopyJob -> Maybe Integer
backupSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The date and time a copy 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.
    CopyJob -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | The date and time a copy 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.
    CopyJob -> Maybe POSIX
completionDate :: Prelude.Maybe Core.POSIX
  }
  deriving (CopyJob -> CopyJob -> Bool
(CopyJob -> CopyJob -> Bool)
-> (CopyJob -> CopyJob -> Bool) -> Eq CopyJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CopyJob -> CopyJob -> Bool
$c/= :: CopyJob -> CopyJob -> Bool
== :: CopyJob -> CopyJob -> Bool
$c== :: CopyJob -> CopyJob -> Bool
Prelude.Eq, ReadPrec [CopyJob]
ReadPrec CopyJob
Int -> ReadS CopyJob
ReadS [CopyJob]
(Int -> ReadS CopyJob)
-> ReadS [CopyJob]
-> ReadPrec CopyJob
-> ReadPrec [CopyJob]
-> Read CopyJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CopyJob]
$creadListPrec :: ReadPrec [CopyJob]
readPrec :: ReadPrec CopyJob
$creadPrec :: ReadPrec CopyJob
readList :: ReadS [CopyJob]
$creadList :: ReadS [CopyJob]
readsPrec :: Int -> ReadS CopyJob
$creadsPrec :: Int -> ReadS CopyJob
Prelude.Read, Int -> CopyJob -> ShowS
[CopyJob] -> ShowS
CopyJob -> String
(Int -> CopyJob -> ShowS)
-> (CopyJob -> String) -> ([CopyJob] -> ShowS) -> Show CopyJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CopyJob] -> ShowS
$cshowList :: [CopyJob] -> ShowS
show :: CopyJob -> String
$cshow :: CopyJob -> String
showsPrec :: Int -> CopyJob -> ShowS
$cshowsPrec :: Int -> CopyJob -> ShowS
Prelude.Show, (forall x. CopyJob -> Rep CopyJob x)
-> (forall x. Rep CopyJob x -> CopyJob) -> Generic CopyJob
forall x. Rep CopyJob x -> CopyJob
forall x. CopyJob -> Rep CopyJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CopyJob x -> CopyJob
$cfrom :: forall x. CopyJob -> Rep CopyJob x
Prelude.Generic)

-- |
-- Create a value of 'CopyJob' 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', 'copyJob_iamRoleArn' - Specifies the IAM role ARN used to copy the target recovery point; for
-- example, @arn:aws:iam::123456789012:role\/S3Access@.
--
-- 'state', 'copyJob_state' - The current state of a copy job.
--
-- 'sourceRecoveryPointArn', 'copyJob_sourceRecoveryPointArn' - An ARN that uniquely identifies a source recovery point; for example,
-- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
--
-- 'resourceType', 'copyJob_resourceType' - The type of Amazon Web Services resource to be copied; for example, an
-- Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational
-- Database Service (Amazon RDS) database.
--
-- 'destinationBackupVaultArn', 'copyJob_destinationBackupVaultArn' - An Amazon Resource Name (ARN) that uniquely identifies a destination
-- copy vault; for example,
-- @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
--
-- 'createdBy', 'copyJob_createdBy' - Undocumented member.
--
-- 'destinationRecoveryPointArn', 'copyJob_destinationRecoveryPointArn' - An ARN that uniquely identifies a destination recovery point; for
-- example,
-- @arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45@.
--
-- 'accountId', 'copyJob_accountId' - The account ID that owns the copy job.
--
-- 'sourceBackupVaultArn', 'copyJob_sourceBackupVaultArn' - An Amazon Resource Name (ARN) that uniquely identifies a source copy
-- vault; for example,
-- @arn:aws:backup:us-east-1:123456789012:vault:aBackupVault@.
--
-- 'copyJobId', 'copyJob_copyJobId' - Uniquely identifies a copy job.
--
-- 'resourceArn', 'copyJob_resourceArn' - The Amazon Web Services resource to be copied; for example, an Amazon
-- Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database
-- Service (Amazon RDS) database.
--
-- 'statusMessage', 'copyJob_statusMessage' - A detailed message explaining the status of the job to copy a resource.
--
-- 'backupSizeInBytes', 'copyJob_backupSizeInBytes' - The size, in bytes, of a copy job.
--
-- 'creationDate', 'copyJob_creationDate' - The date and time a copy 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', 'copyJob_completionDate' - The date and time a copy 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.
newCopyJob ::
  CopyJob
newCopyJob :: CopyJob
newCopyJob =
  CopyJob' :: Maybe Text
-> Maybe CopyJobState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe RecoveryPointCreator
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe POSIX
-> Maybe POSIX
-> CopyJob
CopyJob'
    { $sel:iamRoleArn:CopyJob' :: Maybe Text
iamRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:state:CopyJob' :: Maybe CopyJobState
state = Maybe CopyJobState
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceRecoveryPointArn:CopyJob' :: Maybe Text
sourceRecoveryPointArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:CopyJob' :: Maybe Text
resourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationBackupVaultArn:CopyJob' :: Maybe Text
destinationBackupVaultArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:CopyJob' :: Maybe RecoveryPointCreator
createdBy = Maybe RecoveryPointCreator
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationRecoveryPointArn:CopyJob' :: Maybe Text
destinationRecoveryPointArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:CopyJob' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceBackupVaultArn:CopyJob' :: Maybe Text
sourceBackupVaultArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:copyJobId:CopyJob' :: Maybe Text
copyJobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:CopyJob' :: Maybe Text
resourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:CopyJob' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupSizeInBytes:CopyJob' :: Maybe Integer
backupSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:CopyJob' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:completionDate:CopyJob' :: Maybe POSIX
completionDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the IAM role ARN used to copy the target recovery point; for
-- example, @arn:aws:iam::123456789012:role\/S3Access@.
copyJob_iamRoleArn :: Lens.Lens' CopyJob (Prelude.Maybe Prelude.Text)
copyJob_iamRoleArn :: (Maybe Text -> f (Maybe Text)) -> CopyJob -> f CopyJob
copyJob_iamRoleArn = (CopyJob -> Maybe Text)
-> (CopyJob -> Maybe Text -> CopyJob)
-> Lens CopyJob CopyJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyJob' {Maybe Text
iamRoleArn :: Maybe Text
$sel:iamRoleArn:CopyJob' :: CopyJob -> Maybe Text
iamRoleArn} -> Maybe Text
iamRoleArn) (\s :: CopyJob
s@CopyJob' {} Maybe Text
a -> CopyJob
s {$sel:iamRoleArn:CopyJob' :: Maybe Text
iamRoleArn = Maybe Text
a} :: CopyJob)

-- | The current state of a copy job.
copyJob_state :: Lens.Lens' CopyJob (Prelude.Maybe CopyJobState)
copyJob_state :: (Maybe CopyJobState -> f (Maybe CopyJobState))
-> CopyJob -> f CopyJob
copyJob_state = (CopyJob -> Maybe CopyJobState)
-> (CopyJob -> Maybe CopyJobState -> CopyJob)
-> Lens CopyJob CopyJob (Maybe CopyJobState) (Maybe CopyJobState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyJob' {Maybe CopyJobState
state :: Maybe CopyJobState
$sel:state:CopyJob' :: CopyJob -> Maybe CopyJobState
state} -> Maybe CopyJobState
state) (\s :: CopyJob
s@CopyJob' {} Maybe CopyJobState
a -> CopyJob
s {$sel:state:CopyJob' :: Maybe CopyJobState
state = Maybe CopyJobState
a} :: CopyJob)

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

-- | The type of Amazon Web Services resource to be copied; for example, an
-- Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational
-- Database Service (Amazon RDS) database.
copyJob_resourceType :: Lens.Lens' CopyJob (Prelude.Maybe Prelude.Text)
copyJob_resourceType :: (Maybe Text -> f (Maybe Text)) -> CopyJob -> f CopyJob
copyJob_resourceType = (CopyJob -> Maybe Text)
-> (CopyJob -> Maybe Text -> CopyJob)
-> Lens CopyJob CopyJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyJob' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:CopyJob' :: CopyJob -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: CopyJob
s@CopyJob' {} Maybe Text
a -> CopyJob
s {$sel:resourceType:CopyJob' :: Maybe Text
resourceType = Maybe Text
a} :: CopyJob)

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

-- | Undocumented member.
copyJob_createdBy :: Lens.Lens' CopyJob (Prelude.Maybe RecoveryPointCreator)
copyJob_createdBy :: (Maybe RecoveryPointCreator -> f (Maybe RecoveryPointCreator))
-> CopyJob -> f CopyJob
copyJob_createdBy = (CopyJob -> Maybe RecoveryPointCreator)
-> (CopyJob -> Maybe RecoveryPointCreator -> CopyJob)
-> Lens
     CopyJob
     CopyJob
     (Maybe RecoveryPointCreator)
     (Maybe RecoveryPointCreator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyJob' {Maybe RecoveryPointCreator
createdBy :: Maybe RecoveryPointCreator
$sel:createdBy:CopyJob' :: CopyJob -> Maybe RecoveryPointCreator
createdBy} -> Maybe RecoveryPointCreator
createdBy) (\s :: CopyJob
s@CopyJob' {} Maybe RecoveryPointCreator
a -> CopyJob
s {$sel:createdBy:CopyJob' :: Maybe RecoveryPointCreator
createdBy = Maybe RecoveryPointCreator
a} :: CopyJob)

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

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

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

-- | Uniquely identifies a copy job.
copyJob_copyJobId :: Lens.Lens' CopyJob (Prelude.Maybe Prelude.Text)
copyJob_copyJobId :: (Maybe Text -> f (Maybe Text)) -> CopyJob -> f CopyJob
copyJob_copyJobId = (CopyJob -> Maybe Text)
-> (CopyJob -> Maybe Text -> CopyJob)
-> Lens CopyJob CopyJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyJob' {Maybe Text
copyJobId :: Maybe Text
$sel:copyJobId:CopyJob' :: CopyJob -> Maybe Text
copyJobId} -> Maybe Text
copyJobId) (\s :: CopyJob
s@CopyJob' {} Maybe Text
a -> CopyJob
s {$sel:copyJobId:CopyJob' :: Maybe Text
copyJobId = Maybe Text
a} :: CopyJob)

-- | The Amazon Web Services resource to be copied; for example, an Amazon
-- Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database
-- Service (Amazon RDS) database.
copyJob_resourceArn :: Lens.Lens' CopyJob (Prelude.Maybe Prelude.Text)
copyJob_resourceArn :: (Maybe Text -> f (Maybe Text)) -> CopyJob -> f CopyJob
copyJob_resourceArn = (CopyJob -> Maybe Text)
-> (CopyJob -> Maybe Text -> CopyJob)
-> Lens CopyJob CopyJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyJob' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:CopyJob' :: CopyJob -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: CopyJob
s@CopyJob' {} Maybe Text
a -> CopyJob
s {$sel:resourceArn:CopyJob' :: Maybe Text
resourceArn = Maybe Text
a} :: CopyJob)

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

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

-- | The date and time a copy 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.
copyJob_creationDate :: Lens.Lens' CopyJob (Prelude.Maybe Prelude.UTCTime)
copyJob_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> CopyJob -> f CopyJob
copyJob_creationDate = (CopyJob -> Maybe POSIX)
-> (CopyJob -> Maybe POSIX -> CopyJob)
-> Lens CopyJob CopyJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyJob' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:CopyJob' :: CopyJob -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: CopyJob
s@CopyJob' {} Maybe POSIX
a -> CopyJob
s {$sel:creationDate:CopyJob' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: CopyJob) ((Maybe POSIX -> f (Maybe POSIX)) -> CopyJob -> f CopyJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CopyJob
-> f CopyJob
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 copy 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.
copyJob_completionDate :: Lens.Lens' CopyJob (Prelude.Maybe Prelude.UTCTime)
copyJob_completionDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> CopyJob -> f CopyJob
copyJob_completionDate = (CopyJob -> Maybe POSIX)
-> (CopyJob -> Maybe POSIX -> CopyJob)
-> Lens CopyJob CopyJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyJob' {Maybe POSIX
completionDate :: Maybe POSIX
$sel:completionDate:CopyJob' :: CopyJob -> Maybe POSIX
completionDate} -> Maybe POSIX
completionDate) (\s :: CopyJob
s@CopyJob' {} Maybe POSIX
a -> CopyJob
s {$sel:completionDate:CopyJob' :: Maybe POSIX
completionDate = Maybe POSIX
a} :: CopyJob) ((Maybe POSIX -> f (Maybe POSIX)) -> CopyJob -> f CopyJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CopyJob
-> f CopyJob
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

instance Core.FromJSON CopyJob where
  parseJSON :: Value -> Parser CopyJob
parseJSON =
    String -> (Object -> Parser CopyJob) -> Value -> Parser CopyJob
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CopyJob"
      ( \Object
x ->
          Maybe Text
-> Maybe CopyJobState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe RecoveryPointCreator
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe POSIX
-> Maybe POSIX
-> CopyJob
CopyJob'
            (Maybe Text
 -> Maybe CopyJobState
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe RecoveryPointCreator
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> Maybe POSIX
 -> Maybe POSIX
 -> CopyJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe CopyJobState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RecoveryPointCreator
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> CopyJob)
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 CopyJobState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RecoveryPointCreator
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> CopyJob)
-> Parser (Maybe CopyJobState)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RecoveryPointCreator
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> CopyJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CopyJobState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RecoveryPointCreator
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> CopyJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe RecoveryPointCreator
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> CopyJob)
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
"SourceRecoveryPointArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe RecoveryPointCreator
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> CopyJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe RecoveryPointCreator
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> CopyJob)
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 RecoveryPointCreator
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> CopyJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe RecoveryPointCreator
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> CopyJob)
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
"DestinationBackupVaultArn")
            Parser
  (Maybe RecoveryPointCreator
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> CopyJob)
-> Parser (Maybe RecoveryPointCreator)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> CopyJob)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> CopyJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> CopyJob)
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
"DestinationRecoveryPointArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> CopyJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> CopyJob)
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
   -> CopyJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> CopyJob)
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
"SourceBackupVaultArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> CopyJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> CopyJob)
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
"CopyJobId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> CopyJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Integer -> Maybe POSIX -> Maybe POSIX -> CopyJob)
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 Integer -> Maybe POSIX -> Maybe POSIX -> CopyJob)
-> Parser (Maybe Text)
-> Parser (Maybe Integer -> Maybe POSIX -> Maybe POSIX -> CopyJob)
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 Integer -> Maybe POSIX -> Maybe POSIX -> CopyJob)
-> Parser (Maybe Integer)
-> Parser (Maybe POSIX -> Maybe POSIX -> CopyJob)
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 -> CopyJob)
-> Parser (Maybe POSIX) -> Parser (Maybe POSIX -> CopyJob)
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 -> CopyJob)
-> Parser (Maybe POSIX) -> Parser CopyJob
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")
      )

instance Prelude.Hashable CopyJob

instance Prelude.NFData CopyJob