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

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

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

-- |
-- Create a value of 'ImportJobResponse' 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', 'importJobResponse_completedPieces' - The number of pieces that were processed successfully (completed) by the
-- import job, as of the time of the request.
--
-- 'failedPieces', 'importJobResponse_failedPieces' - The number of pieces that weren\'t processed successfully (failed) by
-- the import job, as of the time of the request.
--
-- 'totalProcessed', 'importJobResponse_totalProcessed' - The total number of endpoint definitions that were processed by the
-- import job.
--
-- 'failures', 'importJobResponse_failures' - An array of entries, one for each of the first 100 entries that weren\'t
-- processed successfully (failed) by the import job, if any.
--
-- 'totalPieces', 'importJobResponse_totalPieces' - The total number of pieces that must be processed to complete the import
-- job. Each piece consists of an approximately equal portion of the
-- endpoint definitions that are part of the import job.
--
-- 'completionDate', 'importJobResponse_completionDate' - The date, in ISO 8601 format, when the import job was completed.
--
-- 'totalFailures', 'importJobResponse_totalFailures' - The total number of endpoint definitions that weren\'t processed
-- successfully (failed) by the import job, typically because an error,
-- such as a syntax error, occurred.
--
-- 'jobStatus', 'importJobResponse_jobStatus' - The status of the import job. The job status is FAILED if Amazon
-- Pinpoint wasn\'t able to process one or more pieces in the job.
--
-- 'creationDate', 'importJobResponse_creationDate' - The date, in ISO 8601 format, when the import job was created.
--
-- 'type'', 'importJobResponse_type' - The job type. This value is IMPORT for import jobs.
--
-- 'definition', 'importJobResponse_definition' - The resource settings that apply to the import job.
--
-- 'id', 'importJobResponse_id' - The unique identifier for the import job.
--
-- 'applicationId', 'importJobResponse_applicationId' - The unique identifier for the application that\'s associated with the
-- import job.
newImportJobResponse ::
  -- | 'jobStatus'
  JobStatus ->
  -- | 'creationDate'
  Prelude.Text ->
  -- | 'type''
  Prelude.Text ->
  -- | 'definition'
  ImportJobResource ->
  -- | 'id'
  Prelude.Text ->
  -- | 'applicationId'
  Prelude.Text ->
  ImportJobResponse
newImportJobResponse :: JobStatus
-> Text
-> Text
-> ImportJobResource
-> Text
-> Text
-> ImportJobResponse
newImportJobResponse
  JobStatus
pJobStatus_
  Text
pCreationDate_
  Text
pType_
  ImportJobResource
pDefinition_
  Text
pId_
  Text
pApplicationId_ =
    ImportJobResponse' :: Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> JobStatus
-> Text
-> Text
-> ImportJobResource
-> Text
-> Text
-> ImportJobResponse
ImportJobResponse'
      { $sel:completedPieces:ImportJobResponse' :: Maybe Int
completedPieces =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:failedPieces:ImportJobResponse' :: Maybe Int
failedPieces = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:totalProcessed:ImportJobResponse' :: Maybe Int
totalProcessed = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:failures:ImportJobResponse' :: Maybe [Text]
failures = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:totalPieces:ImportJobResponse' :: Maybe Int
totalPieces = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:completionDate:ImportJobResponse' :: Maybe Text
completionDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:totalFailures:ImportJobResponse' :: Maybe Int
totalFailures = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:jobStatus:ImportJobResponse' :: JobStatus
jobStatus = JobStatus
pJobStatus_,
        $sel:creationDate:ImportJobResponse' :: Text
creationDate = Text
pCreationDate_,
        $sel:type':ImportJobResponse' :: Text
type' = Text
pType_,
        $sel:definition:ImportJobResponse' :: ImportJobResource
definition = ImportJobResource
pDefinition_,
        $sel:id:ImportJobResponse' :: Text
id = Text
pId_,
        $sel:applicationId:ImportJobResponse' :: Text
applicationId = Text
pApplicationId_
      }

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

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

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

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

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

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

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

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

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

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

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

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

instance Core.FromJSON ImportJobResponse where
  parseJSON :: Value -> Parser ImportJobResponse
parseJSON =
    String
-> (Object -> Parser ImportJobResponse)
-> Value
-> Parser ImportJobResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ImportJobResponse"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> JobStatus
-> Text
-> Text
-> ImportJobResource
-> Text
-> Text
-> ImportJobResponse
ImportJobResponse'
            (Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe [Text]
 -> Maybe Int
 -> Maybe Text
 -> Maybe Int
 -> JobStatus
 -> Text
 -> Text
 -> ImportJobResource
 -> Text
 -> Text
 -> ImportJobResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ImportJobResource
      -> Text
      -> Text
      -> ImportJobResponse)
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
   -> ImportJobResource
   -> Text
   -> Text
   -> ImportJobResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ImportJobResource
      -> Text
      -> Text
      -> ImportJobResponse)
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
   -> ImportJobResource
   -> Text
   -> Text
   -> ImportJobResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ImportJobResource
      -> Text
      -> Text
      -> ImportJobResponse)
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
   -> ImportJobResource
   -> Text
   -> Text
   -> ImportJobResponse)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ImportJobResource
      -> Text
      -> Text
      -> ImportJobResponse)
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
   -> ImportJobResource
   -> Text
   -> Text
   -> ImportJobResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ImportJobResource
      -> Text
      -> Text
      -> ImportJobResponse)
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
   -> ImportJobResource
   -> Text
   -> Text
   -> ImportJobResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> JobStatus
      -> Text
      -> Text
      -> ImportJobResource
      -> Text
      -> Text
      -> ImportJobResponse)
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
   -> ImportJobResource
   -> Text
   -> Text
   -> ImportJobResponse)
-> Parser (Maybe Int)
-> Parser
     (JobStatus
      -> Text
      -> Text
      -> ImportJobResource
      -> Text
      -> Text
      -> ImportJobResponse)
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
   -> ImportJobResource
   -> Text
   -> Text
   -> ImportJobResponse)
-> Parser JobStatus
-> Parser
     (Text
      -> Text -> ImportJobResource -> Text -> Text -> ImportJobResponse)
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 -> ImportJobResource -> Text -> Text -> ImportJobResponse)
-> Parser Text
-> Parser
     (Text -> ImportJobResource -> Text -> Text -> ImportJobResponse)
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 -> ImportJobResource -> Text -> Text -> ImportJobResponse)
-> Parser Text
-> Parser (ImportJobResource -> Text -> Text -> ImportJobResponse)
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 (ImportJobResource -> Text -> Text -> ImportJobResponse)
-> Parser ImportJobResource
-> Parser (Text -> Text -> ImportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ImportJobResource
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Definition")
            Parser (Text -> Text -> ImportJobResponse)
-> Parser Text -> Parser (Text -> ImportJobResponse)
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 -> ImportJobResponse)
-> Parser Text -> Parser ImportJobResponse
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 ImportJobResponse

instance Prelude.NFData ImportJobResponse