{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SESV2.GetImportJob
-- 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)
--
-- Provides information about an import job.
module Amazonka.SESV2.GetImportJob
  ( -- * Creating a Request
    GetImportJob (..),
    newGetImportJob,

    -- * Request Lenses
    getImportJob_jobId,

    -- * Destructuring the Response
    GetImportJobResponse (..),
    newGetImportJobResponse,

    -- * Response Lenses
    getImportJobResponse_processedRecordsCount,
    getImportJobResponse_jobId,
    getImportJobResponse_importDataSource,
    getImportJobResponse_completedTimestamp,
    getImportJobResponse_failureInfo,
    getImportJobResponse_importDestination,
    getImportJobResponse_jobStatus,
    getImportJobResponse_failedRecordsCount,
    getImportJobResponse_createdTimestamp,
    getImportJobResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SESV2.Types

-- | Represents a request for information about an import job using the
-- import job ID.
--
-- /See:/ 'newGetImportJob' smart constructor.
data GetImportJob = GetImportJob'
  { -- | The ID of the import job.
    GetImportJob -> Text
jobId :: Prelude.Text
  }
  deriving (GetImportJob -> GetImportJob -> Bool
(GetImportJob -> GetImportJob -> Bool)
-> (GetImportJob -> GetImportJob -> Bool) -> Eq GetImportJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetImportJob -> GetImportJob -> Bool
$c/= :: GetImportJob -> GetImportJob -> Bool
== :: GetImportJob -> GetImportJob -> Bool
$c== :: GetImportJob -> GetImportJob -> Bool
Prelude.Eq, ReadPrec [GetImportJob]
ReadPrec GetImportJob
Int -> ReadS GetImportJob
ReadS [GetImportJob]
(Int -> ReadS GetImportJob)
-> ReadS [GetImportJob]
-> ReadPrec GetImportJob
-> ReadPrec [GetImportJob]
-> Read GetImportJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetImportJob]
$creadListPrec :: ReadPrec [GetImportJob]
readPrec :: ReadPrec GetImportJob
$creadPrec :: ReadPrec GetImportJob
readList :: ReadS [GetImportJob]
$creadList :: ReadS [GetImportJob]
readsPrec :: Int -> ReadS GetImportJob
$creadsPrec :: Int -> ReadS GetImportJob
Prelude.Read, Int -> GetImportJob -> ShowS
[GetImportJob] -> ShowS
GetImportJob -> String
(Int -> GetImportJob -> ShowS)
-> (GetImportJob -> String)
-> ([GetImportJob] -> ShowS)
-> Show GetImportJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetImportJob] -> ShowS
$cshowList :: [GetImportJob] -> ShowS
show :: GetImportJob -> String
$cshow :: GetImportJob -> String
showsPrec :: Int -> GetImportJob -> ShowS
$cshowsPrec :: Int -> GetImportJob -> ShowS
Prelude.Show, (forall x. GetImportJob -> Rep GetImportJob x)
-> (forall x. Rep GetImportJob x -> GetImportJob)
-> Generic GetImportJob
forall x. Rep GetImportJob x -> GetImportJob
forall x. GetImportJob -> Rep GetImportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetImportJob x -> GetImportJob
$cfrom :: forall x. GetImportJob -> Rep GetImportJob x
Prelude.Generic)

-- |
-- Create a value of 'GetImportJob' 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:
--
-- 'jobId', 'getImportJob_jobId' - The ID of the import job.
newGetImportJob ::
  -- | 'jobId'
  Prelude.Text ->
  GetImportJob
newGetImportJob :: Text -> GetImportJob
newGetImportJob Text
pJobId_ =
  GetImportJob' :: Text -> GetImportJob
GetImportJob' {$sel:jobId:GetImportJob' :: Text
jobId = Text
pJobId_}

-- | The ID of the import job.
getImportJob_jobId :: Lens.Lens' GetImportJob Prelude.Text
getImportJob_jobId :: (Text -> f Text) -> GetImportJob -> f GetImportJob
getImportJob_jobId = (GetImportJob -> Text)
-> (GetImportJob -> Text -> GetImportJob)
-> Lens GetImportJob GetImportJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportJob' {Text
jobId :: Text
$sel:jobId:GetImportJob' :: GetImportJob -> Text
jobId} -> Text
jobId) (\s :: GetImportJob
s@GetImportJob' {} Text
a -> GetImportJob
s {$sel:jobId:GetImportJob' :: Text
jobId = Text
a} :: GetImportJob)

instance Core.AWSRequest GetImportJob where
  type AWSResponse GetImportJob = GetImportJobResponse
  request :: GetImportJob -> Request GetImportJob
request = Service -> GetImportJob -> Request GetImportJob
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetImportJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetImportJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetImportJob))
-> Logger
-> Service
-> Proxy GetImportJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetImportJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Int
-> Maybe Text
-> Maybe ImportDataSource
-> Maybe POSIX
-> Maybe FailureInfo
-> Maybe ImportDestination
-> Maybe JobStatus
-> Maybe Int
-> Maybe POSIX
-> Int
-> GetImportJobResponse
GetImportJobResponse'
            (Maybe Int
 -> Maybe Text
 -> Maybe ImportDataSource
 -> Maybe POSIX
 -> Maybe FailureInfo
 -> Maybe ImportDestination
 -> Maybe JobStatus
 -> Maybe Int
 -> Maybe POSIX
 -> Int
 -> GetImportJobResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text
      -> Maybe ImportDataSource
      -> Maybe POSIX
      -> Maybe FailureInfo
      -> Maybe ImportDestination
      -> Maybe JobStatus
      -> Maybe Int
      -> Maybe POSIX
      -> Int
      -> GetImportJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Int)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProcessedRecordsCount")
            Either
  String
  (Maybe Text
   -> Maybe ImportDataSource
   -> Maybe POSIX
   -> Maybe FailureInfo
   -> Maybe ImportDestination
   -> Maybe JobStatus
   -> Maybe Int
   -> Maybe POSIX
   -> Int
   -> GetImportJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ImportDataSource
      -> Maybe POSIX
      -> Maybe FailureInfo
      -> Maybe ImportDestination
      -> Maybe JobStatus
      -> Maybe Int
      -> Maybe POSIX
      -> Int
      -> GetImportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"JobId")
            Either
  String
  (Maybe ImportDataSource
   -> Maybe POSIX
   -> Maybe FailureInfo
   -> Maybe ImportDestination
   -> Maybe JobStatus
   -> Maybe Int
   -> Maybe POSIX
   -> Int
   -> GetImportJobResponse)
-> Either String (Maybe ImportDataSource)
-> Either
     String
     (Maybe POSIX
      -> Maybe FailureInfo
      -> Maybe ImportDestination
      -> Maybe JobStatus
      -> Maybe Int
      -> Maybe POSIX
      -> Int
      -> GetImportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ImportDataSource)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ImportDataSource")
            Either
  String
  (Maybe POSIX
   -> Maybe FailureInfo
   -> Maybe ImportDestination
   -> Maybe JobStatus
   -> Maybe Int
   -> Maybe POSIX
   -> Int
   -> GetImportJobResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe FailureInfo
      -> Maybe ImportDestination
      -> Maybe JobStatus
      -> Maybe Int
      -> Maybe POSIX
      -> Int
      -> GetImportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CompletedTimestamp")
            Either
  String
  (Maybe FailureInfo
   -> Maybe ImportDestination
   -> Maybe JobStatus
   -> Maybe Int
   -> Maybe POSIX
   -> Int
   -> GetImportJobResponse)
-> Either String (Maybe FailureInfo)
-> Either
     String
     (Maybe ImportDestination
      -> Maybe JobStatus
      -> Maybe Int
      -> Maybe POSIX
      -> Int
      -> GetImportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe FailureInfo)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FailureInfo")
            Either
  String
  (Maybe ImportDestination
   -> Maybe JobStatus
   -> Maybe Int
   -> Maybe POSIX
   -> Int
   -> GetImportJobResponse)
-> Either String (Maybe ImportDestination)
-> Either
     String
     (Maybe JobStatus
      -> Maybe Int -> Maybe POSIX -> Int -> GetImportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ImportDestination)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ImportDestination")
            Either
  String
  (Maybe JobStatus
   -> Maybe Int -> Maybe POSIX -> Int -> GetImportJobResponse)
-> Either String (Maybe JobStatus)
-> Either
     String (Maybe Int -> Maybe POSIX -> Int -> GetImportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe JobStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"JobStatus")
            Either
  String (Maybe Int -> Maybe POSIX -> Int -> GetImportJobResponse)
-> Either String (Maybe Int)
-> Either String (Maybe POSIX -> Int -> GetImportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Int)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FailedRecordsCount")
            Either String (Maybe POSIX -> Int -> GetImportJobResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> GetImportJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreatedTimestamp")
            Either String (Int -> GetImportJobResponse)
-> Either String Int -> Either String GetImportJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetImportJob

instance Prelude.NFData GetImportJob

instance Core.ToHeaders GetImportJob where
  toHeaders :: GetImportJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetImportJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath GetImportJob where
  toPath :: GetImportJob -> ByteString
toPath GetImportJob' {Text
jobId :: Text
$sel:jobId:GetImportJob' :: GetImportJob -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v2/email/import-jobs/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
jobId]

instance Core.ToQuery GetImportJob where
  toQuery :: GetImportJob -> QueryString
toQuery = QueryString -> GetImportJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | An HTTP 200 response if the request succeeds, or an error message if the
-- request fails.
--
-- /See:/ 'newGetImportJobResponse' smart constructor.
data GetImportJobResponse = GetImportJobResponse'
  { -- | The current number of records processed.
    GetImportJobResponse -> Maybe Int
processedRecordsCount :: Prelude.Maybe Prelude.Int,
    -- | A string that represents the import job ID.
    GetImportJobResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | The data source of the import job.
    GetImportJobResponse -> Maybe ImportDataSource
importDataSource :: Prelude.Maybe ImportDataSource,
    -- | The time stamp of when the import job was completed.
    GetImportJobResponse -> Maybe POSIX
completedTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The failure details about an import job.
    GetImportJobResponse -> Maybe FailureInfo
failureInfo :: Prelude.Maybe FailureInfo,
    -- | The destination of the import job.
    GetImportJobResponse -> Maybe ImportDestination
importDestination :: Prelude.Maybe ImportDestination,
    -- | The status of the import job.
    GetImportJobResponse -> Maybe JobStatus
jobStatus :: Prelude.Maybe JobStatus,
    -- | The number of records that failed processing because of invalid input or
    -- other reasons.
    GetImportJobResponse -> Maybe Int
failedRecordsCount :: Prelude.Maybe Prelude.Int,
    -- | The time stamp of when the import job was created.
    GetImportJobResponse -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    GetImportJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetImportJobResponse -> GetImportJobResponse -> Bool
(GetImportJobResponse -> GetImportJobResponse -> Bool)
-> (GetImportJobResponse -> GetImportJobResponse -> Bool)
-> Eq GetImportJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetImportJobResponse -> GetImportJobResponse -> Bool
$c/= :: GetImportJobResponse -> GetImportJobResponse -> Bool
== :: GetImportJobResponse -> GetImportJobResponse -> Bool
$c== :: GetImportJobResponse -> GetImportJobResponse -> Bool
Prelude.Eq, ReadPrec [GetImportJobResponse]
ReadPrec GetImportJobResponse
Int -> ReadS GetImportJobResponse
ReadS [GetImportJobResponse]
(Int -> ReadS GetImportJobResponse)
-> ReadS [GetImportJobResponse]
-> ReadPrec GetImportJobResponse
-> ReadPrec [GetImportJobResponse]
-> Read GetImportJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetImportJobResponse]
$creadListPrec :: ReadPrec [GetImportJobResponse]
readPrec :: ReadPrec GetImportJobResponse
$creadPrec :: ReadPrec GetImportJobResponse
readList :: ReadS [GetImportJobResponse]
$creadList :: ReadS [GetImportJobResponse]
readsPrec :: Int -> ReadS GetImportJobResponse
$creadsPrec :: Int -> ReadS GetImportJobResponse
Prelude.Read, Int -> GetImportJobResponse -> ShowS
[GetImportJobResponse] -> ShowS
GetImportJobResponse -> String
(Int -> GetImportJobResponse -> ShowS)
-> (GetImportJobResponse -> String)
-> ([GetImportJobResponse] -> ShowS)
-> Show GetImportJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetImportJobResponse] -> ShowS
$cshowList :: [GetImportJobResponse] -> ShowS
show :: GetImportJobResponse -> String
$cshow :: GetImportJobResponse -> String
showsPrec :: Int -> GetImportJobResponse -> ShowS
$cshowsPrec :: Int -> GetImportJobResponse -> ShowS
Prelude.Show, (forall x. GetImportJobResponse -> Rep GetImportJobResponse x)
-> (forall x. Rep GetImportJobResponse x -> GetImportJobResponse)
-> Generic GetImportJobResponse
forall x. Rep GetImportJobResponse x -> GetImportJobResponse
forall x. GetImportJobResponse -> Rep GetImportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetImportJobResponse x -> GetImportJobResponse
$cfrom :: forall x. GetImportJobResponse -> Rep GetImportJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetImportJobResponse' 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:
--
-- 'processedRecordsCount', 'getImportJobResponse_processedRecordsCount' - The current number of records processed.
--
-- 'jobId', 'getImportJobResponse_jobId' - A string that represents the import job ID.
--
-- 'importDataSource', 'getImportJobResponse_importDataSource' - The data source of the import job.
--
-- 'completedTimestamp', 'getImportJobResponse_completedTimestamp' - The time stamp of when the import job was completed.
--
-- 'failureInfo', 'getImportJobResponse_failureInfo' - The failure details about an import job.
--
-- 'importDestination', 'getImportJobResponse_importDestination' - The destination of the import job.
--
-- 'jobStatus', 'getImportJobResponse_jobStatus' - The status of the import job.
--
-- 'failedRecordsCount', 'getImportJobResponse_failedRecordsCount' - The number of records that failed processing because of invalid input or
-- other reasons.
--
-- 'createdTimestamp', 'getImportJobResponse_createdTimestamp' - The time stamp of when the import job was created.
--
-- 'httpStatus', 'getImportJobResponse_httpStatus' - The response's http status code.
newGetImportJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetImportJobResponse
newGetImportJobResponse :: Int -> GetImportJobResponse
newGetImportJobResponse Int
pHttpStatus_ =
  GetImportJobResponse' :: Maybe Int
-> Maybe Text
-> Maybe ImportDataSource
-> Maybe POSIX
-> Maybe FailureInfo
-> Maybe ImportDestination
-> Maybe JobStatus
-> Maybe Int
-> Maybe POSIX
-> Int
-> GetImportJobResponse
GetImportJobResponse'
    { $sel:processedRecordsCount:GetImportJobResponse' :: Maybe Int
processedRecordsCount =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:GetImportJobResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:importDataSource:GetImportJobResponse' :: Maybe ImportDataSource
importDataSource = Maybe ImportDataSource
forall a. Maybe a
Prelude.Nothing,
      $sel:completedTimestamp:GetImportJobResponse' :: Maybe POSIX
completedTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:failureInfo:GetImportJobResponse' :: Maybe FailureInfo
failureInfo = Maybe FailureInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:importDestination:GetImportJobResponse' :: Maybe ImportDestination
importDestination = Maybe ImportDestination
forall a. Maybe a
Prelude.Nothing,
      $sel:jobStatus:GetImportJobResponse' :: Maybe JobStatus
jobStatus = Maybe JobStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:failedRecordsCount:GetImportJobResponse' :: Maybe Int
failedRecordsCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTimestamp:GetImportJobResponse' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetImportJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current number of records processed.
getImportJobResponse_processedRecordsCount :: Lens.Lens' GetImportJobResponse (Prelude.Maybe Prelude.Int)
getImportJobResponse_processedRecordsCount :: (Maybe Int -> f (Maybe Int))
-> GetImportJobResponse -> f GetImportJobResponse
getImportJobResponse_processedRecordsCount = (GetImportJobResponse -> Maybe Int)
-> (GetImportJobResponse -> Maybe Int -> GetImportJobResponse)
-> Lens
     GetImportJobResponse GetImportJobResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportJobResponse' {Maybe Int
processedRecordsCount :: Maybe Int
$sel:processedRecordsCount:GetImportJobResponse' :: GetImportJobResponse -> Maybe Int
processedRecordsCount} -> Maybe Int
processedRecordsCount) (\s :: GetImportJobResponse
s@GetImportJobResponse' {} Maybe Int
a -> GetImportJobResponse
s {$sel:processedRecordsCount:GetImportJobResponse' :: Maybe Int
processedRecordsCount = Maybe Int
a} :: GetImportJobResponse)

-- | A string that represents the import job ID.
getImportJobResponse_jobId :: Lens.Lens' GetImportJobResponse (Prelude.Maybe Prelude.Text)
getImportJobResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> GetImportJobResponse -> f GetImportJobResponse
getImportJobResponse_jobId = (GetImportJobResponse -> Maybe Text)
-> (GetImportJobResponse -> Maybe Text -> GetImportJobResponse)
-> Lens
     GetImportJobResponse GetImportJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportJobResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:GetImportJobResponse' :: GetImportJobResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: GetImportJobResponse
s@GetImportJobResponse' {} Maybe Text
a -> GetImportJobResponse
s {$sel:jobId:GetImportJobResponse' :: Maybe Text
jobId = Maybe Text
a} :: GetImportJobResponse)

-- | The data source of the import job.
getImportJobResponse_importDataSource :: Lens.Lens' GetImportJobResponse (Prelude.Maybe ImportDataSource)
getImportJobResponse_importDataSource :: (Maybe ImportDataSource -> f (Maybe ImportDataSource))
-> GetImportJobResponse -> f GetImportJobResponse
getImportJobResponse_importDataSource = (GetImportJobResponse -> Maybe ImportDataSource)
-> (GetImportJobResponse
    -> Maybe ImportDataSource -> GetImportJobResponse)
-> Lens
     GetImportJobResponse
     GetImportJobResponse
     (Maybe ImportDataSource)
     (Maybe ImportDataSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportJobResponse' {Maybe ImportDataSource
importDataSource :: Maybe ImportDataSource
$sel:importDataSource:GetImportJobResponse' :: GetImportJobResponse -> Maybe ImportDataSource
importDataSource} -> Maybe ImportDataSource
importDataSource) (\s :: GetImportJobResponse
s@GetImportJobResponse' {} Maybe ImportDataSource
a -> GetImportJobResponse
s {$sel:importDataSource:GetImportJobResponse' :: Maybe ImportDataSource
importDataSource = Maybe ImportDataSource
a} :: GetImportJobResponse)

-- | The time stamp of when the import job was completed.
getImportJobResponse_completedTimestamp :: Lens.Lens' GetImportJobResponse (Prelude.Maybe Prelude.UTCTime)
getImportJobResponse_completedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetImportJobResponse -> f GetImportJobResponse
getImportJobResponse_completedTimestamp = (GetImportJobResponse -> Maybe POSIX)
-> (GetImportJobResponse -> Maybe POSIX -> GetImportJobResponse)
-> Lens
     GetImportJobResponse
     GetImportJobResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportJobResponse' {Maybe POSIX
completedTimestamp :: Maybe POSIX
$sel:completedTimestamp:GetImportJobResponse' :: GetImportJobResponse -> Maybe POSIX
completedTimestamp} -> Maybe POSIX
completedTimestamp) (\s :: GetImportJobResponse
s@GetImportJobResponse' {} Maybe POSIX
a -> GetImportJobResponse
s {$sel:completedTimestamp:GetImportJobResponse' :: Maybe POSIX
completedTimestamp = Maybe POSIX
a} :: GetImportJobResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetImportJobResponse -> f GetImportJobResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetImportJobResponse
-> f GetImportJobResponse
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 failure details about an import job.
getImportJobResponse_failureInfo :: Lens.Lens' GetImportJobResponse (Prelude.Maybe FailureInfo)
getImportJobResponse_failureInfo :: (Maybe FailureInfo -> f (Maybe FailureInfo))
-> GetImportJobResponse -> f GetImportJobResponse
getImportJobResponse_failureInfo = (GetImportJobResponse -> Maybe FailureInfo)
-> (GetImportJobResponse
    -> Maybe FailureInfo -> GetImportJobResponse)
-> Lens
     GetImportJobResponse
     GetImportJobResponse
     (Maybe FailureInfo)
     (Maybe FailureInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportJobResponse' {Maybe FailureInfo
failureInfo :: Maybe FailureInfo
$sel:failureInfo:GetImportJobResponse' :: GetImportJobResponse -> Maybe FailureInfo
failureInfo} -> Maybe FailureInfo
failureInfo) (\s :: GetImportJobResponse
s@GetImportJobResponse' {} Maybe FailureInfo
a -> GetImportJobResponse
s {$sel:failureInfo:GetImportJobResponse' :: Maybe FailureInfo
failureInfo = Maybe FailureInfo
a} :: GetImportJobResponse)

-- | The destination of the import job.
getImportJobResponse_importDestination :: Lens.Lens' GetImportJobResponse (Prelude.Maybe ImportDestination)
getImportJobResponse_importDestination :: (Maybe ImportDestination -> f (Maybe ImportDestination))
-> GetImportJobResponse -> f GetImportJobResponse
getImportJobResponse_importDestination = (GetImportJobResponse -> Maybe ImportDestination)
-> (GetImportJobResponse
    -> Maybe ImportDestination -> GetImportJobResponse)
-> Lens
     GetImportJobResponse
     GetImportJobResponse
     (Maybe ImportDestination)
     (Maybe ImportDestination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportJobResponse' {Maybe ImportDestination
importDestination :: Maybe ImportDestination
$sel:importDestination:GetImportJobResponse' :: GetImportJobResponse -> Maybe ImportDestination
importDestination} -> Maybe ImportDestination
importDestination) (\s :: GetImportJobResponse
s@GetImportJobResponse' {} Maybe ImportDestination
a -> GetImportJobResponse
s {$sel:importDestination:GetImportJobResponse' :: Maybe ImportDestination
importDestination = Maybe ImportDestination
a} :: GetImportJobResponse)

-- | The status of the import job.
getImportJobResponse_jobStatus :: Lens.Lens' GetImportJobResponse (Prelude.Maybe JobStatus)
getImportJobResponse_jobStatus :: (Maybe JobStatus -> f (Maybe JobStatus))
-> GetImportJobResponse -> f GetImportJobResponse
getImportJobResponse_jobStatus = (GetImportJobResponse -> Maybe JobStatus)
-> (GetImportJobResponse
    -> Maybe JobStatus -> GetImportJobResponse)
-> Lens
     GetImportJobResponse
     GetImportJobResponse
     (Maybe JobStatus)
     (Maybe JobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportJobResponse' {Maybe JobStatus
jobStatus :: Maybe JobStatus
$sel:jobStatus:GetImportJobResponse' :: GetImportJobResponse -> Maybe JobStatus
jobStatus} -> Maybe JobStatus
jobStatus) (\s :: GetImportJobResponse
s@GetImportJobResponse' {} Maybe JobStatus
a -> GetImportJobResponse
s {$sel:jobStatus:GetImportJobResponse' :: Maybe JobStatus
jobStatus = Maybe JobStatus
a} :: GetImportJobResponse)

-- | The number of records that failed processing because of invalid input or
-- other reasons.
getImportJobResponse_failedRecordsCount :: Lens.Lens' GetImportJobResponse (Prelude.Maybe Prelude.Int)
getImportJobResponse_failedRecordsCount :: (Maybe Int -> f (Maybe Int))
-> GetImportJobResponse -> f GetImportJobResponse
getImportJobResponse_failedRecordsCount = (GetImportJobResponse -> Maybe Int)
-> (GetImportJobResponse -> Maybe Int -> GetImportJobResponse)
-> Lens
     GetImportJobResponse GetImportJobResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportJobResponse' {Maybe Int
failedRecordsCount :: Maybe Int
$sel:failedRecordsCount:GetImportJobResponse' :: GetImportJobResponse -> Maybe Int
failedRecordsCount} -> Maybe Int
failedRecordsCount) (\s :: GetImportJobResponse
s@GetImportJobResponse' {} Maybe Int
a -> GetImportJobResponse
s {$sel:failedRecordsCount:GetImportJobResponse' :: Maybe Int
failedRecordsCount = Maybe Int
a} :: GetImportJobResponse)

-- | The time stamp of when the import job was created.
getImportJobResponse_createdTimestamp :: Lens.Lens' GetImportJobResponse (Prelude.Maybe Prelude.UTCTime)
getImportJobResponse_createdTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetImportJobResponse -> f GetImportJobResponse
getImportJobResponse_createdTimestamp = (GetImportJobResponse -> Maybe POSIX)
-> (GetImportJobResponse -> Maybe POSIX -> GetImportJobResponse)
-> Lens
     GetImportJobResponse
     GetImportJobResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportJobResponse' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:GetImportJobResponse' :: GetImportJobResponse -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: GetImportJobResponse
s@GetImportJobResponse' {} Maybe POSIX
a -> GetImportJobResponse
s {$sel:createdTimestamp:GetImportJobResponse' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: GetImportJobResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetImportJobResponse -> f GetImportJobResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetImportJobResponse
-> f GetImportJobResponse
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 response's http status code.
getImportJobResponse_httpStatus :: Lens.Lens' GetImportJobResponse Prelude.Int
getImportJobResponse_httpStatus :: (Int -> f Int) -> GetImportJobResponse -> f GetImportJobResponse
getImportJobResponse_httpStatus = (GetImportJobResponse -> Int)
-> (GetImportJobResponse -> Int -> GetImportJobResponse)
-> Lens GetImportJobResponse GetImportJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetImportJobResponse' :: GetImportJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetImportJobResponse
s@GetImportJobResponse' {} Int
a -> GetImportJobResponse
s {$sel:httpStatus:GetImportJobResponse' :: Int
httpStatus = Int
a} :: GetImportJobResponse)

instance Prelude.NFData GetImportJobResponse