{-# 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.Pinpoint.Types.ExportJobResponse
-- 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.Pinpoint.Types.ExportJobResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.ExportJobResource
import Amazonka.Pinpoint.Types.JobStatus
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the status and settings of a job that exports
-- endpoint definitions to a file. The file can be added directly to an
-- Amazon Simple Storage Service (Amazon S3) bucket by using the Amazon
-- Pinpoint API or downloaded directly to a computer by using the Amazon
-- Pinpoint console.
--
-- /See:/ 'newExportJobResponse' smart constructor.
data ExportJobResponse = ExportJobResponse'
  { -- | The number of pieces that were processed successfully (completed) by the
    -- export job, as of the time of the request.
    ExportJobResponse -> Maybe Int
completedPieces :: Prelude.Maybe Prelude.Int,
    -- | The number of pieces that weren\'t processed successfully (failed) by
    -- the export job, as of the time of the request.
    ExportJobResponse -> Maybe Int
failedPieces :: Prelude.Maybe Prelude.Int,
    -- | The total number of endpoint definitions that were processed by the
    -- export job.
    ExportJobResponse -> Maybe Int
totalProcessed :: Prelude.Maybe Prelude.Int,
    -- | An array of entries, one for each of the first 100 entries that weren\'t
    -- processed successfully (failed) by the export job, if any.
    ExportJobResponse -> Maybe [Text]
failures :: Prelude.Maybe [Prelude.Text],
    -- | The total number of pieces that must be processed to complete the export
    -- job. Each piece consists of an approximately equal portion of the
    -- endpoint definitions that are part of the export job.
    ExportJobResponse -> Maybe Int
totalPieces :: Prelude.Maybe Prelude.Int,
    -- | The date, in ISO 8601 format, when the export job was completed.
    ExportJobResponse -> Maybe Text
completionDate :: Prelude.Maybe Prelude.Text,
    -- | The total number of endpoint definitions that weren\'t processed
    -- successfully (failed) by the export job, typically because an error,
    -- such as a syntax error, occurred.
    ExportJobResponse -> Maybe Int
totalFailures :: Prelude.Maybe Prelude.Int,
    -- | The status of the export job. The job status is FAILED if Amazon
    -- Pinpoint wasn\'t able to process one or more pieces in the job.
    ExportJobResponse -> JobStatus
jobStatus :: JobStatus,
    -- | The date, in ISO 8601 format, when the export job was created.
    ExportJobResponse -> Text
creationDate :: Prelude.Text,
    -- | The job type. This value is EXPORT for export jobs.
    ExportJobResponse -> Text
type' :: Prelude.Text,
    -- | The resource settings that apply to the export job.
    ExportJobResponse -> ExportJobResource
definition :: ExportJobResource,
    -- | The unique identifier for the export job.
    ExportJobResponse -> Text
id :: Prelude.Text,
    -- | The unique identifier for the application that\'s associated with the
    -- export job.
    ExportJobResponse -> Text
applicationId :: Prelude.Text
  }
  deriving (ExportJobResponse -> ExportJobResponse -> Bool
(ExportJobResponse -> ExportJobResponse -> Bool)
-> (ExportJobResponse -> ExportJobResponse -> Bool)
-> Eq ExportJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportJobResponse -> ExportJobResponse -> Bool
$c/= :: ExportJobResponse -> ExportJobResponse -> Bool
== :: ExportJobResponse -> ExportJobResponse -> Bool
$c== :: ExportJobResponse -> ExportJobResponse -> Bool
Prelude.Eq, ReadPrec [ExportJobResponse]
ReadPrec ExportJobResponse
Int -> ReadS ExportJobResponse
ReadS [ExportJobResponse]
(Int -> ReadS ExportJobResponse)
-> ReadS [ExportJobResponse]
-> ReadPrec ExportJobResponse
-> ReadPrec [ExportJobResponse]
-> Read ExportJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportJobResponse]
$creadListPrec :: ReadPrec [ExportJobResponse]
readPrec :: ReadPrec ExportJobResponse
$creadPrec :: ReadPrec ExportJobResponse
readList :: ReadS [ExportJobResponse]
$creadList :: ReadS [ExportJobResponse]
readsPrec :: Int -> ReadS ExportJobResponse
$creadsPrec :: Int -> ReadS ExportJobResponse
Prelude.Read, Int -> ExportJobResponse -> ShowS
[ExportJobResponse] -> ShowS
ExportJobResponse -> String
(Int -> ExportJobResponse -> ShowS)
-> (ExportJobResponse -> String)
-> ([ExportJobResponse] -> ShowS)
-> Show ExportJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportJobResponse] -> ShowS
$cshowList :: [ExportJobResponse] -> ShowS
show :: ExportJobResponse -> String
$cshow :: ExportJobResponse -> String
showsPrec :: Int -> ExportJobResponse -> ShowS
$cshowsPrec :: Int -> ExportJobResponse -> ShowS
Prelude.Show, (forall x. ExportJobResponse -> Rep ExportJobResponse x)
-> (forall x. Rep ExportJobResponse x -> ExportJobResponse)
-> Generic ExportJobResponse
forall x. Rep ExportJobResponse x -> ExportJobResponse
forall x. ExportJobResponse -> Rep ExportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportJobResponse x -> ExportJobResponse
$cfrom :: forall x. ExportJobResponse -> Rep ExportJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'ExportJobResponse' 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:
--
-- 'completedPieces', 'exportJobResponse_completedPieces' - The number of pieces that were processed successfully (completed) by the
-- export job, as of the time of the request.
--
-- 'failedPieces', 'exportJobResponse_failedPieces' - The number of pieces that weren\'t processed successfully (failed) by
-- the export job, as of the time of the request.
--
-- 'totalProcessed', 'exportJobResponse_totalProcessed' - The total number of endpoint definitions that were processed by the
-- export job.
--
-- 'failures', 'exportJobResponse_failures' - An array of entries, one for each of the first 100 entries that weren\'t
-- processed successfully (failed) by the export job, if any.
--
-- 'totalPieces', 'exportJobResponse_totalPieces' - The total number of pieces that must be processed to complete the export
-- job. Each piece consists of an approximately equal portion of the
-- endpoint definitions that are part of the export job.
--
-- 'completionDate', 'exportJobResponse_completionDate' - The date, in ISO 8601 format, when the export job was completed.
--
-- 'totalFailures', 'exportJobResponse_totalFailures' - The total number of endpoint definitions that weren\'t processed
-- successfully (failed) by the export job, typically because an error,
-- such as a syntax error, occurred.
--
-- 'jobStatus', 'exportJobResponse_jobStatus' - The status of the export job. The job status is FAILED if Amazon
-- Pinpoint wasn\'t able to process one or more pieces in the job.
--
-- 'creationDate', 'exportJobResponse_creationDate' - The date, in ISO 8601 format, when the export job was created.
--
-- 'type'', 'exportJobResponse_type' - The job type. This value is EXPORT for export jobs.
--
-- 'definition', 'exportJobResponse_definition' - The resource settings that apply to the export job.
--
-- 'id', 'exportJobResponse_id' - The unique identifier for the export job.
--
-- 'applicationId', 'exportJobResponse_applicationId' - The unique identifier for the application that\'s associated with the
-- export job.
newExportJobResponse ::
  -- | 'jobStatus'
  JobStatus ->
  -- | 'creationDate'
  Prelude.Text ->
  -- | 'type''
  Prelude.Text ->
  -- | 'definition'
  ExportJobResource ->
  -- | 'id'
  Prelude.Text ->
  -- | 'applicationId'
  Prelude.Text ->
  ExportJobResponse
newExportJobResponse :: JobStatus
-> Text
-> Text
-> ExportJobResource
-> Text
-> Text
-> ExportJobResponse
newExportJobResponse
  JobStatus
pJobStatus_
  Text
pCreationDate_
  Text
pType_
  ExportJobResource
pDefinition_
  Text
pId_
  Text
pApplicationId_ =
    ExportJobResponse' :: Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> JobStatus
-> Text
-> Text
-> ExportJobResource
-> Text
-> Text
-> ExportJobResponse
ExportJobResponse'
      { $sel:completedPieces:ExportJobResponse' :: Maybe Int
completedPieces =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:failedPieces:ExportJobResponse' :: Maybe Int
failedPieces = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:totalProcessed:ExportJobResponse' :: Maybe Int
totalProcessed = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:failures:ExportJobResponse' :: Maybe [Text]
failures = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:totalPieces:ExportJobResponse' :: Maybe Int
totalPieces = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:completionDate:ExportJobResponse' :: Maybe Text
completionDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:totalFailures:ExportJobResponse' :: Maybe Int
totalFailures = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:jobStatus:ExportJobResponse' :: JobStatus
jobStatus = JobStatus
pJobStatus_,
        $sel:creationDate:ExportJobResponse' :: Text
creationDate = Text
pCreationDate_,
        $sel:type':ExportJobResponse' :: Text
type' = Text
pType_,
        $sel:definition:ExportJobResponse' :: ExportJobResource
definition = ExportJobResource
pDefinition_,
        $sel:id:ExportJobResponse' :: Text
id = Text
pId_,
        $sel:applicationId:ExportJobResponse' :: Text
applicationId = Text
pApplicationId_
      }

-- | The number of pieces that were processed successfully (completed) by the
-- export job, as of the time of the request.
exportJobResponse_completedPieces :: Lens.Lens' ExportJobResponse (Prelude.Maybe Prelude.Int)
exportJobResponse_completedPieces :: (Maybe Int -> f (Maybe Int))
-> ExportJobResponse -> f ExportJobResponse
exportJobResponse_completedPieces = (ExportJobResponse -> Maybe Int)
-> (ExportJobResponse -> Maybe Int -> ExportJobResponse)
-> Lens ExportJobResponse ExportJobResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {Maybe Int
completedPieces :: Maybe Int
$sel:completedPieces:ExportJobResponse' :: ExportJobResponse -> Maybe Int
completedPieces} -> Maybe Int
completedPieces) (\s :: ExportJobResponse
s@ExportJobResponse' {} Maybe Int
a -> ExportJobResponse
s {$sel:completedPieces:ExportJobResponse' :: Maybe Int
completedPieces = Maybe Int
a} :: ExportJobResponse)

-- | The number of pieces that weren\'t processed successfully (failed) by
-- the export job, as of the time of the request.
exportJobResponse_failedPieces :: Lens.Lens' ExportJobResponse (Prelude.Maybe Prelude.Int)
exportJobResponse_failedPieces :: (Maybe Int -> f (Maybe Int))
-> ExportJobResponse -> f ExportJobResponse
exportJobResponse_failedPieces = (ExportJobResponse -> Maybe Int)
-> (ExportJobResponse -> Maybe Int -> ExportJobResponse)
-> Lens ExportJobResponse ExportJobResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {Maybe Int
failedPieces :: Maybe Int
$sel:failedPieces:ExportJobResponse' :: ExportJobResponse -> Maybe Int
failedPieces} -> Maybe Int
failedPieces) (\s :: ExportJobResponse
s@ExportJobResponse' {} Maybe Int
a -> ExportJobResponse
s {$sel:failedPieces:ExportJobResponse' :: Maybe Int
failedPieces = Maybe Int
a} :: ExportJobResponse)

-- | The total number of endpoint definitions that were processed by the
-- export job.
exportJobResponse_totalProcessed :: Lens.Lens' ExportJobResponse (Prelude.Maybe Prelude.Int)
exportJobResponse_totalProcessed :: (Maybe Int -> f (Maybe Int))
-> ExportJobResponse -> f ExportJobResponse
exportJobResponse_totalProcessed = (ExportJobResponse -> Maybe Int)
-> (ExportJobResponse -> Maybe Int -> ExportJobResponse)
-> Lens ExportJobResponse ExportJobResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {Maybe Int
totalProcessed :: Maybe Int
$sel:totalProcessed:ExportJobResponse' :: ExportJobResponse -> Maybe Int
totalProcessed} -> Maybe Int
totalProcessed) (\s :: ExportJobResponse
s@ExportJobResponse' {} Maybe Int
a -> ExportJobResponse
s {$sel:totalProcessed:ExportJobResponse' :: Maybe Int
totalProcessed = Maybe Int
a} :: ExportJobResponse)

-- | An array of entries, one for each of the first 100 entries that weren\'t
-- processed successfully (failed) by the export job, if any.
exportJobResponse_failures :: Lens.Lens' ExportJobResponse (Prelude.Maybe [Prelude.Text])
exportJobResponse_failures :: (Maybe [Text] -> f (Maybe [Text]))
-> ExportJobResponse -> f ExportJobResponse
exportJobResponse_failures = (ExportJobResponse -> Maybe [Text])
-> (ExportJobResponse -> Maybe [Text] -> ExportJobResponse)
-> Lens
     ExportJobResponse ExportJobResponse (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {Maybe [Text]
failures :: Maybe [Text]
$sel:failures:ExportJobResponse' :: ExportJobResponse -> Maybe [Text]
failures} -> Maybe [Text]
failures) (\s :: ExportJobResponse
s@ExportJobResponse' {} Maybe [Text]
a -> ExportJobResponse
s {$sel:failures:ExportJobResponse' :: Maybe [Text]
failures = Maybe [Text]
a} :: ExportJobResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ExportJobResponse -> f ExportJobResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ExportJobResponse
-> f ExportJobResponse
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 total number of pieces that must be processed to complete the export
-- job. Each piece consists of an approximately equal portion of the
-- endpoint definitions that are part of the export job.
exportJobResponse_totalPieces :: Lens.Lens' ExportJobResponse (Prelude.Maybe Prelude.Int)
exportJobResponse_totalPieces :: (Maybe Int -> f (Maybe Int))
-> ExportJobResponse -> f ExportJobResponse
exportJobResponse_totalPieces = (ExportJobResponse -> Maybe Int)
-> (ExportJobResponse -> Maybe Int -> ExportJobResponse)
-> Lens ExportJobResponse ExportJobResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {Maybe Int
totalPieces :: Maybe Int
$sel:totalPieces:ExportJobResponse' :: ExportJobResponse -> Maybe Int
totalPieces} -> Maybe Int
totalPieces) (\s :: ExportJobResponse
s@ExportJobResponse' {} Maybe Int
a -> ExportJobResponse
s {$sel:totalPieces:ExportJobResponse' :: Maybe Int
totalPieces = Maybe Int
a} :: ExportJobResponse)

-- | The date, in ISO 8601 format, when the export job was completed.
exportJobResponse_completionDate :: Lens.Lens' ExportJobResponse (Prelude.Maybe Prelude.Text)
exportJobResponse_completionDate :: (Maybe Text -> f (Maybe Text))
-> ExportJobResponse -> f ExportJobResponse
exportJobResponse_completionDate = (ExportJobResponse -> Maybe Text)
-> (ExportJobResponse -> Maybe Text -> ExportJobResponse)
-> Lens
     ExportJobResponse ExportJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {Maybe Text
completionDate :: Maybe Text
$sel:completionDate:ExportJobResponse' :: ExportJobResponse -> Maybe Text
completionDate} -> Maybe Text
completionDate) (\s :: ExportJobResponse
s@ExportJobResponse' {} Maybe Text
a -> ExportJobResponse
s {$sel:completionDate:ExportJobResponse' :: Maybe Text
completionDate = Maybe Text
a} :: ExportJobResponse)

-- | The total number of endpoint definitions that weren\'t processed
-- successfully (failed) by the export job, typically because an error,
-- such as a syntax error, occurred.
exportJobResponse_totalFailures :: Lens.Lens' ExportJobResponse (Prelude.Maybe Prelude.Int)
exportJobResponse_totalFailures :: (Maybe Int -> f (Maybe Int))
-> ExportJobResponse -> f ExportJobResponse
exportJobResponse_totalFailures = (ExportJobResponse -> Maybe Int)
-> (ExportJobResponse -> Maybe Int -> ExportJobResponse)
-> Lens ExportJobResponse ExportJobResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {Maybe Int
totalFailures :: Maybe Int
$sel:totalFailures:ExportJobResponse' :: ExportJobResponse -> Maybe Int
totalFailures} -> Maybe Int
totalFailures) (\s :: ExportJobResponse
s@ExportJobResponse' {} Maybe Int
a -> ExportJobResponse
s {$sel:totalFailures:ExportJobResponse' :: Maybe Int
totalFailures = Maybe Int
a} :: ExportJobResponse)

-- | The status of the export job. The job status is FAILED if Amazon
-- Pinpoint wasn\'t able to process one or more pieces in the job.
exportJobResponse_jobStatus :: Lens.Lens' ExportJobResponse JobStatus
exportJobResponse_jobStatus :: (JobStatus -> f JobStatus)
-> ExportJobResponse -> f ExportJobResponse
exportJobResponse_jobStatus = (ExportJobResponse -> JobStatus)
-> (ExportJobResponse -> JobStatus -> ExportJobResponse)
-> Lens ExportJobResponse ExportJobResponse JobStatus JobStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {JobStatus
jobStatus :: JobStatus
$sel:jobStatus:ExportJobResponse' :: ExportJobResponse -> JobStatus
jobStatus} -> JobStatus
jobStatus) (\s :: ExportJobResponse
s@ExportJobResponse' {} JobStatus
a -> ExportJobResponse
s {$sel:jobStatus:ExportJobResponse' :: JobStatus
jobStatus = JobStatus
a} :: ExportJobResponse)

-- | The date, in ISO 8601 format, when the export job was created.
exportJobResponse_creationDate :: Lens.Lens' ExportJobResponse Prelude.Text
exportJobResponse_creationDate :: (Text -> f Text) -> ExportJobResponse -> f ExportJobResponse
exportJobResponse_creationDate = (ExportJobResponse -> Text)
-> (ExportJobResponse -> Text -> ExportJobResponse)
-> Lens ExportJobResponse ExportJobResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {Text
creationDate :: Text
$sel:creationDate:ExportJobResponse' :: ExportJobResponse -> Text
creationDate} -> Text
creationDate) (\s :: ExportJobResponse
s@ExportJobResponse' {} Text
a -> ExportJobResponse
s {$sel:creationDate:ExportJobResponse' :: Text
creationDate = Text
a} :: ExportJobResponse)

-- | The job type. This value is EXPORT for export jobs.
exportJobResponse_type :: Lens.Lens' ExportJobResponse Prelude.Text
exportJobResponse_type :: (Text -> f Text) -> ExportJobResponse -> f ExportJobResponse
exportJobResponse_type = (ExportJobResponse -> Text)
-> (ExportJobResponse -> Text -> ExportJobResponse)
-> Lens ExportJobResponse ExportJobResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {Text
type' :: Text
$sel:type':ExportJobResponse' :: ExportJobResponse -> Text
type'} -> Text
type') (\s :: ExportJobResponse
s@ExportJobResponse' {} Text
a -> ExportJobResponse
s {$sel:type':ExportJobResponse' :: Text
type' = Text
a} :: ExportJobResponse)

-- | The resource settings that apply to the export job.
exportJobResponse_definition :: Lens.Lens' ExportJobResponse ExportJobResource
exportJobResponse_definition :: (ExportJobResource -> f ExportJobResource)
-> ExportJobResponse -> f ExportJobResponse
exportJobResponse_definition = (ExportJobResponse -> ExportJobResource)
-> (ExportJobResponse -> ExportJobResource -> ExportJobResponse)
-> Lens
     ExportJobResponse
     ExportJobResponse
     ExportJobResource
     ExportJobResource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {ExportJobResource
definition :: ExportJobResource
$sel:definition:ExportJobResponse' :: ExportJobResponse -> ExportJobResource
definition} -> ExportJobResource
definition) (\s :: ExportJobResponse
s@ExportJobResponse' {} ExportJobResource
a -> ExportJobResponse
s {$sel:definition:ExportJobResponse' :: ExportJobResource
definition = ExportJobResource
a} :: ExportJobResponse)

-- | The unique identifier for the export job.
exportJobResponse_id :: Lens.Lens' ExportJobResponse Prelude.Text
exportJobResponse_id :: (Text -> f Text) -> ExportJobResponse -> f ExportJobResponse
exportJobResponse_id = (ExportJobResponse -> Text)
-> (ExportJobResponse -> Text -> ExportJobResponse)
-> Lens ExportJobResponse ExportJobResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {Text
id :: Text
$sel:id:ExportJobResponse' :: ExportJobResponse -> Text
id} -> Text
id) (\s :: ExportJobResponse
s@ExportJobResponse' {} Text
a -> ExportJobResponse
s {$sel:id:ExportJobResponse' :: Text
id = Text
a} :: ExportJobResponse)

-- | The unique identifier for the application that\'s associated with the
-- export job.
exportJobResponse_applicationId :: Lens.Lens' ExportJobResponse Prelude.Text
exportJobResponse_applicationId :: (Text -> f Text) -> ExportJobResponse -> f ExportJobResponse
exportJobResponse_applicationId = (ExportJobResponse -> Text)
-> (ExportJobResponse -> Text -> ExportJobResponse)
-> Lens ExportJobResponse ExportJobResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportJobResponse' {Text
applicationId :: Text
$sel:applicationId:ExportJobResponse' :: ExportJobResponse -> Text
applicationId} -> Text
applicationId) (\s :: ExportJobResponse
s@ExportJobResponse' {} Text
a -> ExportJobResponse
s {$sel:applicationId:ExportJobResponse' :: Text
applicationId = Text
a} :: ExportJobResponse)

instance Core.FromJSON ExportJobResponse where
  parseJSON :: Value -> Parser ExportJobResponse
parseJSON =
    String
-> (Object -> Parser ExportJobResponse)
-> Value
-> Parser ExportJobResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExportJobResponse"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> JobStatus
-> Text
-> Text
-> ExportJobResource
-> Text
-> Text
-> ExportJobResponse
ExportJobResponse'
            (Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe [Text]
 -> Maybe Int
 -> Maybe Text
 -> Maybe Int
 -> JobStatus
 -> Text
 -> Text
 -> ExportJobResource
 -> Text
 -> Text
 -> ExportJobResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ExportJobResource
      -> Text
      -> Text
      -> ExportJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CompletedPieces")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> JobStatus
   -> Text
   -> Text
   -> ExportJobResource
   -> Text
   -> Text
   -> ExportJobResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ExportJobResource
      -> Text
      -> Text
      -> ExportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FailedPieces")
            Parser
  (Maybe Int
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> JobStatus
   -> Text
   -> Text
   -> ExportJobResource
   -> Text
   -> Text
   -> ExportJobResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ExportJobResource
      -> Text
      -> Text
      -> ExportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TotalProcessed")
            Parser
  (Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> JobStatus
   -> Text
   -> Text
   -> ExportJobResource
   -> Text
   -> Text
   -> ExportJobResponse)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ExportJobResource
      -> Text
      -> Text
      -> ExportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Failures" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> JobStatus
   -> Text
   -> Text
   -> ExportJobResource
   -> Text
   -> Text
   -> ExportJobResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ExportJobResource
      -> Text
      -> Text
      -> ExportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TotalPieces")
            Parser
  (Maybe Text
   -> Maybe Int
   -> JobStatus
   -> Text
   -> Text
   -> ExportJobResource
   -> Text
   -> Text
   -> ExportJobResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ExportJobResource
      -> Text
      -> Text
      -> ExportJobResponse)
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
"CompletionDate")
            Parser
  (Maybe Int
   -> JobStatus
   -> Text
   -> Text
   -> ExportJobResource
   -> Text
   -> Text
   -> ExportJobResponse)
-> Parser (Maybe Int)
-> Parser
     (JobStatus
      -> Text
      -> Text
      -> ExportJobResource
      -> Text
      -> Text
      -> ExportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TotalFailures")
            Parser
  (JobStatus
   -> Text
   -> Text
   -> ExportJobResource
   -> Text
   -> Text
   -> ExportJobResponse)
-> Parser JobStatus
-> Parser
     (Text
      -> Text -> ExportJobResource -> Text -> Text -> ExportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser JobStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"JobStatus")
            Parser
  (Text
   -> Text -> ExportJobResource -> Text -> Text -> ExportJobResponse)
-> Parser Text
-> Parser
     (Text -> ExportJobResource -> Text -> Text -> ExportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreationDate")
            Parser
  (Text -> ExportJobResource -> Text -> Text -> ExportJobResponse)
-> Parser Text
-> Parser (ExportJobResource -> Text -> Text -> ExportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Type")
            Parser (ExportJobResource -> Text -> Text -> ExportJobResponse)
-> Parser ExportJobResource
-> Parser (Text -> Text -> ExportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ExportJobResource
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Definition")
            Parser (Text -> Text -> ExportJobResponse)
-> Parser Text -> Parser (Text -> ExportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Id")
            Parser (Text -> ExportJobResponse)
-> Parser Text -> Parser ExportJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ApplicationId")
      )

instance Prelude.Hashable ExportJobResponse

instance Prelude.NFData ExportJobResponse