{-# 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.Personalize.Types.DatasetExportJob
-- 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.Personalize.Types.DatasetExportJob where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Personalize.Types.DatasetExportJobOutput
import Amazonka.Personalize.Types.IngestionMode
import qualified Amazonka.Prelude as Prelude

-- | Describes a job that exports a dataset to an Amazon S3 bucket. For more
-- information, see CreateDatasetExportJob.
--
-- A dataset export job can be in one of the following states:
--
-- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
--
-- /See:/ 'newDatasetExportJob' smart constructor.
data DatasetExportJob = DatasetExportJob'
  { -- | If a dataset export job fails, provides the reason why.
    DatasetExportJob -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The status of the dataset export job.
    --
    -- A dataset export job can be in one of the following states:
    --
    -- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
    DatasetExportJob -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the dataset export job.
    DatasetExportJob -> Maybe Text
datasetExportJobArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the dataset to export.
    DatasetExportJob -> Maybe Text
datasetArn :: Prelude.Maybe Prelude.Text,
    -- | The path to the Amazon S3 bucket where the job\'s output is stored. For
    -- example:
    --
    -- @s3:\/\/bucket-name\/folder-name\/@
    DatasetExportJob -> Maybe DatasetExportJobOutput
jobOutput :: Prelude.Maybe DatasetExportJobOutput,
    -- | The name of the export job.
    DatasetExportJob -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
    -- | The date and time (in Unix time) the status of the dataset export job
    -- was last updated.
    DatasetExportJob -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Core.POSIX,
    -- | The data to export, based on how you imported the data. You can choose
    -- to export @BULK@ data that you imported using a dataset import job,
    -- @PUT@ data that you imported incrementally (using the console,
    -- PutEvents, PutUsers and PutItems operations), or @ALL@ for both types.
    -- The default value is @PUT@.
    DatasetExportJob -> Maybe IngestionMode
ingestionMode :: Prelude.Maybe IngestionMode,
    -- | The creation date and time (in Unix time) of the dataset export job.
    DatasetExportJob -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the IAM service role that has
    -- permissions to add data to your output Amazon S3 bucket.
    DatasetExportJob -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (DatasetExportJob -> DatasetExportJob -> Bool
(DatasetExportJob -> DatasetExportJob -> Bool)
-> (DatasetExportJob -> DatasetExportJob -> Bool)
-> Eq DatasetExportJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatasetExportJob -> DatasetExportJob -> Bool
$c/= :: DatasetExportJob -> DatasetExportJob -> Bool
== :: DatasetExportJob -> DatasetExportJob -> Bool
$c== :: DatasetExportJob -> DatasetExportJob -> Bool
Prelude.Eq, ReadPrec [DatasetExportJob]
ReadPrec DatasetExportJob
Int -> ReadS DatasetExportJob
ReadS [DatasetExportJob]
(Int -> ReadS DatasetExportJob)
-> ReadS [DatasetExportJob]
-> ReadPrec DatasetExportJob
-> ReadPrec [DatasetExportJob]
-> Read DatasetExportJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatasetExportJob]
$creadListPrec :: ReadPrec [DatasetExportJob]
readPrec :: ReadPrec DatasetExportJob
$creadPrec :: ReadPrec DatasetExportJob
readList :: ReadS [DatasetExportJob]
$creadList :: ReadS [DatasetExportJob]
readsPrec :: Int -> ReadS DatasetExportJob
$creadsPrec :: Int -> ReadS DatasetExportJob
Prelude.Read, Int -> DatasetExportJob -> ShowS
[DatasetExportJob] -> ShowS
DatasetExportJob -> String
(Int -> DatasetExportJob -> ShowS)
-> (DatasetExportJob -> String)
-> ([DatasetExportJob] -> ShowS)
-> Show DatasetExportJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatasetExportJob] -> ShowS
$cshowList :: [DatasetExportJob] -> ShowS
show :: DatasetExportJob -> String
$cshow :: DatasetExportJob -> String
showsPrec :: Int -> DatasetExportJob -> ShowS
$cshowsPrec :: Int -> DatasetExportJob -> ShowS
Prelude.Show, (forall x. DatasetExportJob -> Rep DatasetExportJob x)
-> (forall x. Rep DatasetExportJob x -> DatasetExportJob)
-> Generic DatasetExportJob
forall x. Rep DatasetExportJob x -> DatasetExportJob
forall x. DatasetExportJob -> Rep DatasetExportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatasetExportJob x -> DatasetExportJob
$cfrom :: forall x. DatasetExportJob -> Rep DatasetExportJob x
Prelude.Generic)

-- |
-- Create a value of 'DatasetExportJob' 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:
--
-- 'failureReason', 'datasetExportJob_failureReason' - If a dataset export job fails, provides the reason why.
--
-- 'status', 'datasetExportJob_status' - The status of the dataset export job.
--
-- A dataset export job can be in one of the following states:
--
-- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
--
-- 'datasetExportJobArn', 'datasetExportJob_datasetExportJobArn' - The Amazon Resource Name (ARN) of the dataset export job.
--
-- 'datasetArn', 'datasetExportJob_datasetArn' - The Amazon Resource Name (ARN) of the dataset to export.
--
-- 'jobOutput', 'datasetExportJob_jobOutput' - The path to the Amazon S3 bucket where the job\'s output is stored. For
-- example:
--
-- @s3:\/\/bucket-name\/folder-name\/@
--
-- 'jobName', 'datasetExportJob_jobName' - The name of the export job.
--
-- 'lastUpdatedDateTime', 'datasetExportJob_lastUpdatedDateTime' - The date and time (in Unix time) the status of the dataset export job
-- was last updated.
--
-- 'ingestionMode', 'datasetExportJob_ingestionMode' - The data to export, based on how you imported the data. You can choose
-- to export @BULK@ data that you imported using a dataset import job,
-- @PUT@ data that you imported incrementally (using the console,
-- PutEvents, PutUsers and PutItems operations), or @ALL@ for both types.
-- The default value is @PUT@.
--
-- 'creationDateTime', 'datasetExportJob_creationDateTime' - The creation date and time (in Unix time) of the dataset export job.
--
-- 'roleArn', 'datasetExportJob_roleArn' - The Amazon Resource Name (ARN) of the IAM service role that has
-- permissions to add data to your output Amazon S3 bucket.
newDatasetExportJob ::
  DatasetExportJob
newDatasetExportJob :: DatasetExportJob
newDatasetExportJob =
  DatasetExportJob' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DatasetExportJobOutput
-> Maybe Text
-> Maybe POSIX
-> Maybe IngestionMode
-> Maybe POSIX
-> Maybe Text
-> DatasetExportJob
DatasetExportJob'
    { $sel:failureReason:DatasetExportJob' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DatasetExportJob' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetExportJobArn:DatasetExportJob' :: Maybe Text
datasetExportJobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetArn:DatasetExportJob' :: Maybe Text
datasetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobOutput:DatasetExportJob' :: Maybe DatasetExportJobOutput
jobOutput = Maybe DatasetExportJobOutput
forall a. Maybe a
Prelude.Nothing,
      $sel:jobName:DatasetExportJob' :: Maybe Text
jobName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:DatasetExportJob' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:ingestionMode:DatasetExportJob' :: Maybe IngestionMode
ingestionMode = Maybe IngestionMode
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDateTime:DatasetExportJob' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:DatasetExportJob' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | If a dataset export job fails, provides the reason why.
datasetExportJob_failureReason :: Lens.Lens' DatasetExportJob (Prelude.Maybe Prelude.Text)
datasetExportJob_failureReason :: (Maybe Text -> f (Maybe Text))
-> DatasetExportJob -> f DatasetExportJob
datasetExportJob_failureReason = (DatasetExportJob -> Maybe Text)
-> (DatasetExportJob -> Maybe Text -> DatasetExportJob)
-> Lens DatasetExportJob DatasetExportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetExportJob' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:DatasetExportJob' :: DatasetExportJob -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: DatasetExportJob
s@DatasetExportJob' {} Maybe Text
a -> DatasetExportJob
s {$sel:failureReason:DatasetExportJob' :: Maybe Text
failureReason = Maybe Text
a} :: DatasetExportJob)

-- | The status of the dataset export job.
--
-- A dataset export job can be in one of the following states:
--
-- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
datasetExportJob_status :: Lens.Lens' DatasetExportJob (Prelude.Maybe Prelude.Text)
datasetExportJob_status :: (Maybe Text -> f (Maybe Text))
-> DatasetExportJob -> f DatasetExportJob
datasetExportJob_status = (DatasetExportJob -> Maybe Text)
-> (DatasetExportJob -> Maybe Text -> DatasetExportJob)
-> Lens DatasetExportJob DatasetExportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetExportJob' {Maybe Text
status :: Maybe Text
$sel:status:DatasetExportJob' :: DatasetExportJob -> Maybe Text
status} -> Maybe Text
status) (\s :: DatasetExportJob
s@DatasetExportJob' {} Maybe Text
a -> DatasetExportJob
s {$sel:status:DatasetExportJob' :: Maybe Text
status = Maybe Text
a} :: DatasetExportJob)

-- | The Amazon Resource Name (ARN) of the dataset export job.
datasetExportJob_datasetExportJobArn :: Lens.Lens' DatasetExportJob (Prelude.Maybe Prelude.Text)
datasetExportJob_datasetExportJobArn :: (Maybe Text -> f (Maybe Text))
-> DatasetExportJob -> f DatasetExportJob
datasetExportJob_datasetExportJobArn = (DatasetExportJob -> Maybe Text)
-> (DatasetExportJob -> Maybe Text -> DatasetExportJob)
-> Lens DatasetExportJob DatasetExportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetExportJob' {Maybe Text
datasetExportJobArn :: Maybe Text
$sel:datasetExportJobArn:DatasetExportJob' :: DatasetExportJob -> Maybe Text
datasetExportJobArn} -> Maybe Text
datasetExportJobArn) (\s :: DatasetExportJob
s@DatasetExportJob' {} Maybe Text
a -> DatasetExportJob
s {$sel:datasetExportJobArn:DatasetExportJob' :: Maybe Text
datasetExportJobArn = Maybe Text
a} :: DatasetExportJob)

-- | The Amazon Resource Name (ARN) of the dataset to export.
datasetExportJob_datasetArn :: Lens.Lens' DatasetExportJob (Prelude.Maybe Prelude.Text)
datasetExportJob_datasetArn :: (Maybe Text -> f (Maybe Text))
-> DatasetExportJob -> f DatasetExportJob
datasetExportJob_datasetArn = (DatasetExportJob -> Maybe Text)
-> (DatasetExportJob -> Maybe Text -> DatasetExportJob)
-> Lens DatasetExportJob DatasetExportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetExportJob' {Maybe Text
datasetArn :: Maybe Text
$sel:datasetArn:DatasetExportJob' :: DatasetExportJob -> Maybe Text
datasetArn} -> Maybe Text
datasetArn) (\s :: DatasetExportJob
s@DatasetExportJob' {} Maybe Text
a -> DatasetExportJob
s {$sel:datasetArn:DatasetExportJob' :: Maybe Text
datasetArn = Maybe Text
a} :: DatasetExportJob)

-- | The path to the Amazon S3 bucket where the job\'s output is stored. For
-- example:
--
-- @s3:\/\/bucket-name\/folder-name\/@
datasetExportJob_jobOutput :: Lens.Lens' DatasetExportJob (Prelude.Maybe DatasetExportJobOutput)
datasetExportJob_jobOutput :: (Maybe DatasetExportJobOutput -> f (Maybe DatasetExportJobOutput))
-> DatasetExportJob -> f DatasetExportJob
datasetExportJob_jobOutput = (DatasetExportJob -> Maybe DatasetExportJobOutput)
-> (DatasetExportJob
    -> Maybe DatasetExportJobOutput -> DatasetExportJob)
-> Lens
     DatasetExportJob
     DatasetExportJob
     (Maybe DatasetExportJobOutput)
     (Maybe DatasetExportJobOutput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetExportJob' {Maybe DatasetExportJobOutput
jobOutput :: Maybe DatasetExportJobOutput
$sel:jobOutput:DatasetExportJob' :: DatasetExportJob -> Maybe DatasetExportJobOutput
jobOutput} -> Maybe DatasetExportJobOutput
jobOutput) (\s :: DatasetExportJob
s@DatasetExportJob' {} Maybe DatasetExportJobOutput
a -> DatasetExportJob
s {$sel:jobOutput:DatasetExportJob' :: Maybe DatasetExportJobOutput
jobOutput = Maybe DatasetExportJobOutput
a} :: DatasetExportJob)

-- | The name of the export job.
datasetExportJob_jobName :: Lens.Lens' DatasetExportJob (Prelude.Maybe Prelude.Text)
datasetExportJob_jobName :: (Maybe Text -> f (Maybe Text))
-> DatasetExportJob -> f DatasetExportJob
datasetExportJob_jobName = (DatasetExportJob -> Maybe Text)
-> (DatasetExportJob -> Maybe Text -> DatasetExportJob)
-> Lens DatasetExportJob DatasetExportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetExportJob' {Maybe Text
jobName :: Maybe Text
$sel:jobName:DatasetExportJob' :: DatasetExportJob -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: DatasetExportJob
s@DatasetExportJob' {} Maybe Text
a -> DatasetExportJob
s {$sel:jobName:DatasetExportJob' :: Maybe Text
jobName = Maybe Text
a} :: DatasetExportJob)

-- | The date and time (in Unix time) the status of the dataset export job
-- was last updated.
datasetExportJob_lastUpdatedDateTime :: Lens.Lens' DatasetExportJob (Prelude.Maybe Prelude.UTCTime)
datasetExportJob_lastUpdatedDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetExportJob -> f DatasetExportJob
datasetExportJob_lastUpdatedDateTime = (DatasetExportJob -> Maybe POSIX)
-> (DatasetExportJob -> Maybe POSIX -> DatasetExportJob)
-> Lens
     DatasetExportJob DatasetExportJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetExportJob' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:DatasetExportJob' :: DatasetExportJob -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: DatasetExportJob
s@DatasetExportJob' {} Maybe POSIX
a -> DatasetExportJob
s {$sel:lastUpdatedDateTime:DatasetExportJob' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: DatasetExportJob) ((Maybe POSIX -> f (Maybe POSIX))
 -> DatasetExportJob -> f DatasetExportJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetExportJob
-> f DatasetExportJob
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 data to export, based on how you imported the data. You can choose
-- to export @BULK@ data that you imported using a dataset import job,
-- @PUT@ data that you imported incrementally (using the console,
-- PutEvents, PutUsers and PutItems operations), or @ALL@ for both types.
-- The default value is @PUT@.
datasetExportJob_ingestionMode :: Lens.Lens' DatasetExportJob (Prelude.Maybe IngestionMode)
datasetExportJob_ingestionMode :: (Maybe IngestionMode -> f (Maybe IngestionMode))
-> DatasetExportJob -> f DatasetExportJob
datasetExportJob_ingestionMode = (DatasetExportJob -> Maybe IngestionMode)
-> (DatasetExportJob -> Maybe IngestionMode -> DatasetExportJob)
-> Lens
     DatasetExportJob
     DatasetExportJob
     (Maybe IngestionMode)
     (Maybe IngestionMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetExportJob' {Maybe IngestionMode
ingestionMode :: Maybe IngestionMode
$sel:ingestionMode:DatasetExportJob' :: DatasetExportJob -> Maybe IngestionMode
ingestionMode} -> Maybe IngestionMode
ingestionMode) (\s :: DatasetExportJob
s@DatasetExportJob' {} Maybe IngestionMode
a -> DatasetExportJob
s {$sel:ingestionMode:DatasetExportJob' :: Maybe IngestionMode
ingestionMode = Maybe IngestionMode
a} :: DatasetExportJob)

-- | The creation date and time (in Unix time) of the dataset export job.
datasetExportJob_creationDateTime :: Lens.Lens' DatasetExportJob (Prelude.Maybe Prelude.UTCTime)
datasetExportJob_creationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetExportJob -> f DatasetExportJob
datasetExportJob_creationDateTime = (DatasetExportJob -> Maybe POSIX)
-> (DatasetExportJob -> Maybe POSIX -> DatasetExportJob)
-> Lens
     DatasetExportJob DatasetExportJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetExportJob' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:DatasetExportJob' :: DatasetExportJob -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: DatasetExportJob
s@DatasetExportJob' {} Maybe POSIX
a -> DatasetExportJob
s {$sel:creationDateTime:DatasetExportJob' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: DatasetExportJob) ((Maybe POSIX -> f (Maybe POSIX))
 -> DatasetExportJob -> f DatasetExportJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetExportJob
-> f DatasetExportJob
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 Amazon Resource Name (ARN) of the IAM service role that has
-- permissions to add data to your output Amazon S3 bucket.
datasetExportJob_roleArn :: Lens.Lens' DatasetExportJob (Prelude.Maybe Prelude.Text)
datasetExportJob_roleArn :: (Maybe Text -> f (Maybe Text))
-> DatasetExportJob -> f DatasetExportJob
datasetExportJob_roleArn = (DatasetExportJob -> Maybe Text)
-> (DatasetExportJob -> Maybe Text -> DatasetExportJob)
-> Lens DatasetExportJob DatasetExportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetExportJob' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:DatasetExportJob' :: DatasetExportJob -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: DatasetExportJob
s@DatasetExportJob' {} Maybe Text
a -> DatasetExportJob
s {$sel:roleArn:DatasetExportJob' :: Maybe Text
roleArn = Maybe Text
a} :: DatasetExportJob)

instance Core.FromJSON DatasetExportJob where
  parseJSON :: Value -> Parser DatasetExportJob
parseJSON =
    String
-> (Object -> Parser DatasetExportJob)
-> Value
-> Parser DatasetExportJob
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DatasetExportJob"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe DatasetExportJobOutput
-> Maybe Text
-> Maybe POSIX
-> Maybe IngestionMode
-> Maybe POSIX
-> Maybe Text
-> DatasetExportJob
DatasetExportJob'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe DatasetExportJobOutput
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe IngestionMode
 -> Maybe POSIX
 -> Maybe Text
 -> DatasetExportJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe DatasetExportJobOutput
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe IngestionMode
      -> Maybe POSIX
      -> Maybe Text
      -> DatasetExportJob)
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
"failureReason")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe DatasetExportJobOutput
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe IngestionMode
   -> Maybe POSIX
   -> Maybe Text
   -> DatasetExportJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe DatasetExportJobOutput
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe IngestionMode
      -> Maybe POSIX
      -> Maybe Text
      -> DatasetExportJob)
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
"status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe DatasetExportJobOutput
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe IngestionMode
   -> Maybe POSIX
   -> Maybe Text
   -> DatasetExportJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe DatasetExportJobOutput
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe IngestionMode
      -> Maybe POSIX
      -> Maybe Text
      -> DatasetExportJob)
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
"datasetExportJobArn")
            Parser
  (Maybe Text
   -> Maybe DatasetExportJobOutput
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe IngestionMode
   -> Maybe POSIX
   -> Maybe Text
   -> DatasetExportJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe DatasetExportJobOutput
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe IngestionMode
      -> Maybe POSIX
      -> Maybe Text
      -> DatasetExportJob)
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
"datasetArn")
            Parser
  (Maybe DatasetExportJobOutput
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe IngestionMode
   -> Maybe POSIX
   -> Maybe Text
   -> DatasetExportJob)
-> Parser (Maybe DatasetExportJobOutput)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe IngestionMode
      -> Maybe POSIX
      -> Maybe Text
      -> DatasetExportJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DatasetExportJobOutput)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"jobOutput")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe IngestionMode
   -> Maybe POSIX
   -> Maybe Text
   -> DatasetExportJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe IngestionMode
      -> Maybe POSIX
      -> Maybe Text
      -> DatasetExportJob)
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
"jobName")
            Parser
  (Maybe POSIX
   -> Maybe IngestionMode
   -> Maybe POSIX
   -> Maybe Text
   -> DatasetExportJob)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe IngestionMode
      -> Maybe POSIX -> Maybe Text -> DatasetExportJob)
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
"lastUpdatedDateTime")
            Parser
  (Maybe IngestionMode
   -> Maybe POSIX -> Maybe Text -> DatasetExportJob)
-> Parser (Maybe IngestionMode)
-> Parser (Maybe POSIX -> Maybe Text -> DatasetExportJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe IngestionMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ingestionMode")
            Parser (Maybe POSIX -> Maybe Text -> DatasetExportJob)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> DatasetExportJob)
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
"creationDateTime")
            Parser (Maybe Text -> DatasetExportJob)
-> Parser (Maybe Text) -> Parser DatasetExportJob
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
"roleArn")
      )

instance Prelude.Hashable DatasetExportJob

instance Prelude.NFData DatasetExportJob