{-# 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.RDS.Types.ExportTask
-- 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.RDS.Types.ExportTask where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains the details of a snapshot export to Amazon S3.
--
-- This data type is used as a response element in the
-- @DescribeExportTasks@ action.
--
-- /See:/ 'newExportTask' smart constructor.
data ExportTask = ExportTask'
  { -- | The total amount of data exported, in gigabytes.
    ExportTask -> Maybe Int
totalExtractedDataInGB :: Prelude.Maybe Prelude.Int,
    -- | The progress status of the export task.
    ExportTask -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The name of the IAM role that is used to write to Amazon S3 when
    -- exporting a snapshot.
    ExportTask -> Maybe Text
iamRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3.
    ExportTask -> Maybe Text
sourceArn :: Prelude.Maybe Prelude.Text,
    -- | The data exported from the snapshot. Valid values are the following:
    --
    -- -   @database@ - Export all the data from a specified database.
    --
    -- -   @database.table@ /table-name/ - Export a table of the snapshot. This
    --     format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora
    --     MySQL.
    --
    -- -   @database.schema@ /schema-name/ - Export a database schema of the
    --     snapshot. This format is valid only for RDS for PostgreSQL and
    --     Aurora PostgreSQL.
    --
    -- -   @database.schema.table@ /table-name/ - Export a table of the
    --     database schema. This format is valid only for RDS for PostgreSQL
    --     and Aurora PostgreSQL.
    ExportTask -> Maybe [Text]
exportOnly :: Prelude.Maybe [Prelude.Text],
    -- | The time that the snapshot export task started.
    ExportTask -> Maybe ISO8601
taskStartTime :: Prelude.Maybe Core.ISO8601,
    -- | A warning about the snapshot export task.
    ExportTask -> Maybe Text
warningMessage :: Prelude.Maybe Prelude.Text,
    -- | The time that the snapshot was created.
    ExportTask -> Maybe ISO8601
snapshotTime :: Prelude.Maybe Core.ISO8601,
    -- | The key identifier of the Amazon Web Services KMS customer master key
    -- (CMK) that is used to encrypt the snapshot when it\'s exported to Amazon
    -- S3. The Amazon Web Services KMS CMK identifier is its key ARN, key ID,
    -- alias ARN, or alias name. The IAM role used for the snapshot export must
    -- have encryption and decryption permissions to use this Amazon Web
    -- Services KMS CMK.
    ExportTask -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The time that the snapshot export task completed.
    ExportTask -> Maybe ISO8601
taskEndTime :: Prelude.Maybe Core.ISO8601,
    -- | A unique identifier for the snapshot export task. This ID isn\'t an
    -- identifier for the Amazon S3 bucket where the snapshot is exported to.
    ExportTask -> Maybe Text
exportTaskIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 bucket prefix that is the file name and path of the
    -- exported snapshot.
    ExportTask -> Maybe Text
s3Prefix :: Prelude.Maybe Prelude.Text,
    -- | The progress of the snapshot export task as a percentage.
    ExportTask -> Maybe Int
percentProgress :: Prelude.Maybe Prelude.Int,
    -- | The Amazon S3 bucket that the snapshot is exported to.
    ExportTask -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text,
    -- | The reason the export failed, if it failed.
    ExportTask -> Maybe Text
failureCause :: Prelude.Maybe Prelude.Text
  }
  deriving (ExportTask -> ExportTask -> Bool
(ExportTask -> ExportTask -> Bool)
-> (ExportTask -> ExportTask -> Bool) -> Eq ExportTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportTask -> ExportTask -> Bool
$c/= :: ExportTask -> ExportTask -> Bool
== :: ExportTask -> ExportTask -> Bool
$c== :: ExportTask -> ExportTask -> Bool
Prelude.Eq, ReadPrec [ExportTask]
ReadPrec ExportTask
Int -> ReadS ExportTask
ReadS [ExportTask]
(Int -> ReadS ExportTask)
-> ReadS [ExportTask]
-> ReadPrec ExportTask
-> ReadPrec [ExportTask]
-> Read ExportTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportTask]
$creadListPrec :: ReadPrec [ExportTask]
readPrec :: ReadPrec ExportTask
$creadPrec :: ReadPrec ExportTask
readList :: ReadS [ExportTask]
$creadList :: ReadS [ExportTask]
readsPrec :: Int -> ReadS ExportTask
$creadsPrec :: Int -> ReadS ExportTask
Prelude.Read, Int -> ExportTask -> ShowS
[ExportTask] -> ShowS
ExportTask -> String
(Int -> ExportTask -> ShowS)
-> (ExportTask -> String)
-> ([ExportTask] -> ShowS)
-> Show ExportTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportTask] -> ShowS
$cshowList :: [ExportTask] -> ShowS
show :: ExportTask -> String
$cshow :: ExportTask -> String
showsPrec :: Int -> ExportTask -> ShowS
$cshowsPrec :: Int -> ExportTask -> ShowS
Prelude.Show, (forall x. ExportTask -> Rep ExportTask x)
-> (forall x. Rep ExportTask x -> ExportTask) -> Generic ExportTask
forall x. Rep ExportTask x -> ExportTask
forall x. ExportTask -> Rep ExportTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportTask x -> ExportTask
$cfrom :: forall x. ExportTask -> Rep ExportTask x
Prelude.Generic)

-- |
-- Create a value of 'ExportTask' 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:
--
-- 'totalExtractedDataInGB', 'exportTask_totalExtractedDataInGB' - The total amount of data exported, in gigabytes.
--
-- 'status', 'exportTask_status' - The progress status of the export task.
--
-- 'iamRoleArn', 'exportTask_iamRoleArn' - The name of the IAM role that is used to write to Amazon S3 when
-- exporting a snapshot.
--
-- 'sourceArn', 'exportTask_sourceArn' - The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3.
--
-- 'exportOnly', 'exportTask_exportOnly' - The data exported from the snapshot. Valid values are the following:
--
-- -   @database@ - Export all the data from a specified database.
--
-- -   @database.table@ /table-name/ - Export a table of the snapshot. This
--     format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora
--     MySQL.
--
-- -   @database.schema@ /schema-name/ - Export a database schema of the
--     snapshot. This format is valid only for RDS for PostgreSQL and
--     Aurora PostgreSQL.
--
-- -   @database.schema.table@ /table-name/ - Export a table of the
--     database schema. This format is valid only for RDS for PostgreSQL
--     and Aurora PostgreSQL.
--
-- 'taskStartTime', 'exportTask_taskStartTime' - The time that the snapshot export task started.
--
-- 'warningMessage', 'exportTask_warningMessage' - A warning about the snapshot export task.
--
-- 'snapshotTime', 'exportTask_snapshotTime' - The time that the snapshot was created.
--
-- 'kmsKeyId', 'exportTask_kmsKeyId' - The key identifier of the Amazon Web Services KMS customer master key
-- (CMK) that is used to encrypt the snapshot when it\'s exported to Amazon
-- S3. The Amazon Web Services KMS CMK identifier is its key ARN, key ID,
-- alias ARN, or alias name. The IAM role used for the snapshot export must
-- have encryption and decryption permissions to use this Amazon Web
-- Services KMS CMK.
--
-- 'taskEndTime', 'exportTask_taskEndTime' - The time that the snapshot export task completed.
--
-- 'exportTaskIdentifier', 'exportTask_exportTaskIdentifier' - A unique identifier for the snapshot export task. This ID isn\'t an
-- identifier for the Amazon S3 bucket where the snapshot is exported to.
--
-- 's3Prefix', 'exportTask_s3Prefix' - The Amazon S3 bucket prefix that is the file name and path of the
-- exported snapshot.
--
-- 'percentProgress', 'exportTask_percentProgress' - The progress of the snapshot export task as a percentage.
--
-- 's3Bucket', 'exportTask_s3Bucket' - The Amazon S3 bucket that the snapshot is exported to.
--
-- 'failureCause', 'exportTask_failureCause' - The reason the export failed, if it failed.
newExportTask ::
  ExportTask
newExportTask :: ExportTask
newExportTask =
  ExportTask' :: Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe ISO8601
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> ExportTask
ExportTask'
    { $sel:totalExtractedDataInGB:ExportTask' :: Maybe Int
totalExtractedDataInGB =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ExportTask' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:iamRoleArn:ExportTask' :: Maybe Text
iamRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:ExportTask' :: Maybe Text
sourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:exportOnly:ExportTask' :: Maybe [Text]
exportOnly = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:taskStartTime:ExportTask' :: Maybe ISO8601
taskStartTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:warningMessage:ExportTask' :: Maybe Text
warningMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotTime:ExportTask' :: Maybe ISO8601
snapshotTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:ExportTask' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskEndTime:ExportTask' :: Maybe ISO8601
taskEndTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:exportTaskIdentifier:ExportTask' :: Maybe Text
exportTaskIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Prefix:ExportTask' :: Maybe Text
s3Prefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:percentProgress:ExportTask' :: Maybe Int
percentProgress = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Bucket:ExportTask' :: Maybe Text
s3Bucket = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:failureCause:ExportTask' :: Maybe Text
failureCause = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The total amount of data exported, in gigabytes.
exportTask_totalExtractedDataInGB :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Int)
exportTask_totalExtractedDataInGB :: (Maybe Int -> f (Maybe Int)) -> ExportTask -> f ExportTask
exportTask_totalExtractedDataInGB = (ExportTask -> Maybe Int)
-> (ExportTask -> Maybe Int -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Int
totalExtractedDataInGB :: Maybe Int
$sel:totalExtractedDataInGB:ExportTask' :: ExportTask -> Maybe Int
totalExtractedDataInGB} -> Maybe Int
totalExtractedDataInGB) (\s :: ExportTask
s@ExportTask' {} Maybe Int
a -> ExportTask
s {$sel:totalExtractedDataInGB:ExportTask' :: Maybe Int
totalExtractedDataInGB = Maybe Int
a} :: ExportTask)

-- | The progress status of the export task.
exportTask_status :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_status :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_status = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
status :: Maybe Text
$sel:status:ExportTask' :: ExportTask -> Maybe Text
status} -> Maybe Text
status) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:status:ExportTask' :: Maybe Text
status = Maybe Text
a} :: ExportTask)

-- | The name of the IAM role that is used to write to Amazon S3 when
-- exporting a snapshot.
exportTask_iamRoleArn :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_iamRoleArn :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_iamRoleArn = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
iamRoleArn :: Maybe Text
$sel:iamRoleArn:ExportTask' :: ExportTask -> Maybe Text
iamRoleArn} -> Maybe Text
iamRoleArn) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:iamRoleArn:ExportTask' :: Maybe Text
iamRoleArn = Maybe Text
a} :: ExportTask)

-- | The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3.
exportTask_sourceArn :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_sourceArn :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_sourceArn = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
sourceArn :: Maybe Text
$sel:sourceArn:ExportTask' :: ExportTask -> Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:sourceArn:ExportTask' :: Maybe Text
sourceArn = Maybe Text
a} :: ExportTask)

-- | The data exported from the snapshot. Valid values are the following:
--
-- -   @database@ - Export all the data from a specified database.
--
-- -   @database.table@ /table-name/ - Export a table of the snapshot. This
--     format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora
--     MySQL.
--
-- -   @database.schema@ /schema-name/ - Export a database schema of the
--     snapshot. This format is valid only for RDS for PostgreSQL and
--     Aurora PostgreSQL.
--
-- -   @database.schema.table@ /table-name/ - Export a table of the
--     database schema. This format is valid only for RDS for PostgreSQL
--     and Aurora PostgreSQL.
exportTask_exportOnly :: Lens.Lens' ExportTask (Prelude.Maybe [Prelude.Text])
exportTask_exportOnly :: (Maybe [Text] -> f (Maybe [Text])) -> ExportTask -> f ExportTask
exportTask_exportOnly = (ExportTask -> Maybe [Text])
-> (ExportTask -> Maybe [Text] -> ExportTask)
-> Lens ExportTask ExportTask (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe [Text]
exportOnly :: Maybe [Text]
$sel:exportOnly:ExportTask' :: ExportTask -> Maybe [Text]
exportOnly} -> Maybe [Text]
exportOnly) (\s :: ExportTask
s@ExportTask' {} Maybe [Text]
a -> ExportTask
s {$sel:exportOnly:ExportTask' :: Maybe [Text]
exportOnly = Maybe [Text]
a} :: ExportTask) ((Maybe [Text] -> f (Maybe [Text])) -> ExportTask -> f ExportTask)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ExportTask
-> f ExportTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time that the snapshot export task started.
exportTask_taskStartTime :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.UTCTime)
exportTask_taskStartTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ExportTask -> f ExportTask
exportTask_taskStartTime = (ExportTask -> Maybe ISO8601)
-> (ExportTask -> Maybe ISO8601 -> ExportTask)
-> Lens ExportTask ExportTask (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe ISO8601
taskStartTime :: Maybe ISO8601
$sel:taskStartTime:ExportTask' :: ExportTask -> Maybe ISO8601
taskStartTime} -> Maybe ISO8601
taskStartTime) (\s :: ExportTask
s@ExportTask' {} Maybe ISO8601
a -> ExportTask
s {$sel:taskStartTime:ExportTask' :: Maybe ISO8601
taskStartTime = Maybe ISO8601
a} :: ExportTask) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> ExportTask -> f ExportTask)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ExportTask
-> f ExportTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A warning about the snapshot export task.
exportTask_warningMessage :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_warningMessage :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_warningMessage = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
warningMessage :: Maybe Text
$sel:warningMessage:ExportTask' :: ExportTask -> Maybe Text
warningMessage} -> Maybe Text
warningMessage) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:warningMessage:ExportTask' :: Maybe Text
warningMessage = Maybe Text
a} :: ExportTask)

-- | The time that the snapshot was created.
exportTask_snapshotTime :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.UTCTime)
exportTask_snapshotTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ExportTask -> f ExportTask
exportTask_snapshotTime = (ExportTask -> Maybe ISO8601)
-> (ExportTask -> Maybe ISO8601 -> ExportTask)
-> Lens ExportTask ExportTask (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe ISO8601
snapshotTime :: Maybe ISO8601
$sel:snapshotTime:ExportTask' :: ExportTask -> Maybe ISO8601
snapshotTime} -> Maybe ISO8601
snapshotTime) (\s :: ExportTask
s@ExportTask' {} Maybe ISO8601
a -> ExportTask
s {$sel:snapshotTime:ExportTask' :: Maybe ISO8601
snapshotTime = Maybe ISO8601
a} :: ExportTask) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> ExportTask -> f ExportTask)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ExportTask
-> f ExportTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The key identifier of the Amazon Web Services KMS customer master key
-- (CMK) that is used to encrypt the snapshot when it\'s exported to Amazon
-- S3. The Amazon Web Services KMS CMK identifier is its key ARN, key ID,
-- alias ARN, or alias name. The IAM role used for the snapshot export must
-- have encryption and decryption permissions to use this Amazon Web
-- Services KMS CMK.
exportTask_kmsKeyId :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_kmsKeyId :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_kmsKeyId = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:ExportTask' :: ExportTask -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:kmsKeyId:ExportTask' :: Maybe Text
kmsKeyId = Maybe Text
a} :: ExportTask)

-- | The time that the snapshot export task completed.
exportTask_taskEndTime :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.UTCTime)
exportTask_taskEndTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ExportTask -> f ExportTask
exportTask_taskEndTime = (ExportTask -> Maybe ISO8601)
-> (ExportTask -> Maybe ISO8601 -> ExportTask)
-> Lens ExportTask ExportTask (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe ISO8601
taskEndTime :: Maybe ISO8601
$sel:taskEndTime:ExportTask' :: ExportTask -> Maybe ISO8601
taskEndTime} -> Maybe ISO8601
taskEndTime) (\s :: ExportTask
s@ExportTask' {} Maybe ISO8601
a -> ExportTask
s {$sel:taskEndTime:ExportTask' :: Maybe ISO8601
taskEndTime = Maybe ISO8601
a} :: ExportTask) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> ExportTask -> f ExportTask)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ExportTask
-> f ExportTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A unique identifier for the snapshot export task. This ID isn\'t an
-- identifier for the Amazon S3 bucket where the snapshot is exported to.
exportTask_exportTaskIdentifier :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_exportTaskIdentifier :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_exportTaskIdentifier = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
exportTaskIdentifier :: Maybe Text
$sel:exportTaskIdentifier:ExportTask' :: ExportTask -> Maybe Text
exportTaskIdentifier} -> Maybe Text
exportTaskIdentifier) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:exportTaskIdentifier:ExportTask' :: Maybe Text
exportTaskIdentifier = Maybe Text
a} :: ExportTask)

-- | The Amazon S3 bucket prefix that is the file name and path of the
-- exported snapshot.
exportTask_s3Prefix :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_s3Prefix :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_s3Prefix = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
s3Prefix :: Maybe Text
$sel:s3Prefix:ExportTask' :: ExportTask -> Maybe Text
s3Prefix} -> Maybe Text
s3Prefix) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:s3Prefix:ExportTask' :: Maybe Text
s3Prefix = Maybe Text
a} :: ExportTask)

-- | The progress of the snapshot export task as a percentage.
exportTask_percentProgress :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Int)
exportTask_percentProgress :: (Maybe Int -> f (Maybe Int)) -> ExportTask -> f ExportTask
exportTask_percentProgress = (ExportTask -> Maybe Int)
-> (ExportTask -> Maybe Int -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Int
percentProgress :: Maybe Int
$sel:percentProgress:ExportTask' :: ExportTask -> Maybe Int
percentProgress} -> Maybe Int
percentProgress) (\s :: ExportTask
s@ExportTask' {} Maybe Int
a -> ExportTask
s {$sel:percentProgress:ExportTask' :: Maybe Int
percentProgress = Maybe Int
a} :: ExportTask)

-- | The Amazon S3 bucket that the snapshot is exported to.
exportTask_s3Bucket :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_s3Bucket :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_s3Bucket = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
s3Bucket :: Maybe Text
$sel:s3Bucket:ExportTask' :: ExportTask -> Maybe Text
s3Bucket} -> Maybe Text
s3Bucket) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:s3Bucket:ExportTask' :: Maybe Text
s3Bucket = Maybe Text
a} :: ExportTask)

-- | The reason the export failed, if it failed.
exportTask_failureCause :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_failureCause :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_failureCause = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
failureCause :: Maybe Text
$sel:failureCause:ExportTask' :: ExportTask -> Maybe Text
failureCause} -> Maybe Text
failureCause) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:failureCause:ExportTask' :: Maybe Text
failureCause = Maybe Text
a} :: ExportTask)

instance Core.FromXML ExportTask where
  parseXML :: [Node] -> Either String ExportTask
parseXML [Node]
x =
    Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe ISO8601
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> ExportTask
ExportTask'
      (Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> ExportTask)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> ExportTask)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TotalExtractedDataInGB")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> ExportTask)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> ExportTask)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [Text]
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IamRoleArn")
      Either
  String
  (Maybe Text
   -> Maybe [Text]
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> ExportTask)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SourceArn")
      Either
  String
  (Maybe [Text]
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> ExportTask)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ExportOnly" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> ExportTask)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TaskStartTime")
      Either
  String
  (Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> ExportTask)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"WarningMessage")
      Either
  String
  (Maybe ISO8601
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> ExportTask)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SnapshotTime")
      Either
  String
  (Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> ExportTask)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"KmsKeyId")
      Either
  String
  (Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> ExportTask)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TaskEndTime")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> ExportTask)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Int -> Maybe Text -> Maybe Text -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ExportTaskIdentifier")
      Either
  String
  (Maybe Text -> Maybe Int -> Maybe Text -> Maybe Text -> ExportTask)
-> Either String (Maybe Text)
-> Either
     String (Maybe Int -> Maybe Text -> Maybe Text -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"S3Prefix")
      Either String (Maybe Int -> Maybe Text -> Maybe Text -> ExportTask)
-> Either String (Maybe Int)
-> Either String (Maybe Text -> Maybe Text -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PercentProgress")
      Either String (Maybe Text -> Maybe Text -> ExportTask)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"S3Bucket")
      Either String (Maybe Text -> ExportTask)
-> Either String (Maybe Text) -> Either String ExportTask
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FailureCause")

instance Prelude.Hashable ExportTask

instance Prelude.NFData ExportTask