{-# 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.Discovery.Types.ImportTask
-- 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.Discovery.Types.ImportTask where

import qualified Amazonka.Core as Core
import Amazonka.Discovery.Types.ImportStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An array of information related to the import task request that includes
-- status information, times, IDs, the Amazon S3 Object URL for the import
-- file, and more.
--
-- /See:/ 'newImportTask' smart constructor.
data ImportTask = ImportTask'
  { -- | The total number of application records in the import file that were
    -- successfully imported.
    ImportTask -> Maybe Int
applicationImportSuccess :: Prelude.Maybe Prelude.Int,
    -- | The status of the import task. An import can have the status of
    -- @IMPORT_COMPLETE@ and still have some records fail to import from the
    -- overall request. More information can be found in the downloadable
    -- archive defined in the @errorsAndFailedEntriesZip@ field, or in the
    -- Migration Hub management console.
    ImportTask -> Maybe ImportStatus
status :: Prelude.Maybe ImportStatus,
    -- | The total number of server records in the import file that were
    -- successfully imported.
    ImportTask -> Maybe Int
serverImportSuccess :: Prelude.Maybe Prelude.Int,
    -- | The time that the import task request finished, presented in the Unix
    -- time stamp format.
    ImportTask -> Maybe POSIX
importCompletionTime :: Prelude.Maybe Core.POSIX,
    -- | A descriptive name for an import task. You can use this name to filter
    -- future requests related to this import task, such as identifying
    -- applications and servers that were included in this import task. We
    -- recommend that you use a meaningful name for each import task.
    ImportTask -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The total number of application records in the import file that failed
    -- to be imported.
    ImportTask -> Maybe Int
applicationImportFailure :: Prelude.Maybe Prelude.Int,
    -- | A link to a compressed archive folder (in the ZIP format) that contains
    -- an error log and a file of failed records. You can use these two files
    -- to quickly identify records that failed, why they failed, and correct
    -- those records. Afterward, you can upload the corrected file to your
    -- Amazon S3 bucket and create another import task request.
    --
    -- This field also includes authorization information so you can confirm
    -- the authenticity of the compressed archive before you download it.
    --
    -- If some records failed to be imported we recommend that you correct the
    -- records in the failed entries file and then imports that failed entries
    -- file. This prevents you from having to correct and update the larger
    -- original file and attempt importing it again.
    ImportTask -> Maybe Text
errorsAndFailedEntriesZip :: Prelude.Maybe Prelude.Text,
    -- | The unique ID for a specific import task. These IDs aren\'t globally
    -- unique, but they are unique within an AWS account.
    ImportTask -> Maybe Text
importTaskId :: Prelude.Maybe Prelude.Text,
    -- | The time that the import task request was deleted, presented in the Unix
    -- time stamp format.
    ImportTask -> Maybe POSIX
importDeletedTime :: Prelude.Maybe Core.POSIX,
    -- | The total number of server records in the import file that failed to be
    -- imported.
    ImportTask -> Maybe Int
serverImportFailure :: Prelude.Maybe Prelude.Int,
    -- | A unique token used to prevent the same import request from occurring
    -- more than once. If you didn\'t provide a token, a token was
    -- automatically generated when the import task request was sent.
    ImportTask -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The URL for your import file that you\'ve uploaded to Amazon S3.
    ImportTask -> Maybe Text
importUrl :: Prelude.Maybe Prelude.Text,
    -- | The time that the import task request was made, presented in the Unix
    -- time stamp format.
    ImportTask -> Maybe POSIX
importRequestTime :: Prelude.Maybe Core.POSIX
  }
  deriving (ImportTask -> ImportTask -> Bool
(ImportTask -> ImportTask -> Bool)
-> (ImportTask -> ImportTask -> Bool) -> Eq ImportTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportTask -> ImportTask -> Bool
$c/= :: ImportTask -> ImportTask -> Bool
== :: ImportTask -> ImportTask -> Bool
$c== :: ImportTask -> ImportTask -> Bool
Prelude.Eq, ReadPrec [ImportTask]
ReadPrec ImportTask
Int -> ReadS ImportTask
ReadS [ImportTask]
(Int -> ReadS ImportTask)
-> ReadS [ImportTask]
-> ReadPrec ImportTask
-> ReadPrec [ImportTask]
-> Read ImportTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportTask]
$creadListPrec :: ReadPrec [ImportTask]
readPrec :: ReadPrec ImportTask
$creadPrec :: ReadPrec ImportTask
readList :: ReadS [ImportTask]
$creadList :: ReadS [ImportTask]
readsPrec :: Int -> ReadS ImportTask
$creadsPrec :: Int -> ReadS ImportTask
Prelude.Read, Int -> ImportTask -> ShowS
[ImportTask] -> ShowS
ImportTask -> String
(Int -> ImportTask -> ShowS)
-> (ImportTask -> String)
-> ([ImportTask] -> ShowS)
-> Show ImportTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportTask] -> ShowS
$cshowList :: [ImportTask] -> ShowS
show :: ImportTask -> String
$cshow :: ImportTask -> String
showsPrec :: Int -> ImportTask -> ShowS
$cshowsPrec :: Int -> ImportTask -> ShowS
Prelude.Show, (forall x. ImportTask -> Rep ImportTask x)
-> (forall x. Rep ImportTask x -> ImportTask) -> Generic ImportTask
forall x. Rep ImportTask x -> ImportTask
forall x. ImportTask -> Rep ImportTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImportTask x -> ImportTask
$cfrom :: forall x. ImportTask -> Rep ImportTask x
Prelude.Generic)

-- |
-- Create a value of 'ImportTask' 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:
--
-- 'applicationImportSuccess', 'importTask_applicationImportSuccess' - The total number of application records in the import file that were
-- successfully imported.
--
-- 'status', 'importTask_status' - The status of the import task. An import can have the status of
-- @IMPORT_COMPLETE@ and still have some records fail to import from the
-- overall request. More information can be found in the downloadable
-- archive defined in the @errorsAndFailedEntriesZip@ field, or in the
-- Migration Hub management console.
--
-- 'serverImportSuccess', 'importTask_serverImportSuccess' - The total number of server records in the import file that were
-- successfully imported.
--
-- 'importCompletionTime', 'importTask_importCompletionTime' - The time that the import task request finished, presented in the Unix
-- time stamp format.
--
-- 'name', 'importTask_name' - A descriptive name for an import task. You can use this name to filter
-- future requests related to this import task, such as identifying
-- applications and servers that were included in this import task. We
-- recommend that you use a meaningful name for each import task.
--
-- 'applicationImportFailure', 'importTask_applicationImportFailure' - The total number of application records in the import file that failed
-- to be imported.
--
-- 'errorsAndFailedEntriesZip', 'importTask_errorsAndFailedEntriesZip' - A link to a compressed archive folder (in the ZIP format) that contains
-- an error log and a file of failed records. You can use these two files
-- to quickly identify records that failed, why they failed, and correct
-- those records. Afterward, you can upload the corrected file to your
-- Amazon S3 bucket and create another import task request.
--
-- This field also includes authorization information so you can confirm
-- the authenticity of the compressed archive before you download it.
--
-- If some records failed to be imported we recommend that you correct the
-- records in the failed entries file and then imports that failed entries
-- file. This prevents you from having to correct and update the larger
-- original file and attempt importing it again.
--
-- 'importTaskId', 'importTask_importTaskId' - The unique ID for a specific import task. These IDs aren\'t globally
-- unique, but they are unique within an AWS account.
--
-- 'importDeletedTime', 'importTask_importDeletedTime' - The time that the import task request was deleted, presented in the Unix
-- time stamp format.
--
-- 'serverImportFailure', 'importTask_serverImportFailure' - The total number of server records in the import file that failed to be
-- imported.
--
-- 'clientRequestToken', 'importTask_clientRequestToken' - A unique token used to prevent the same import request from occurring
-- more than once. If you didn\'t provide a token, a token was
-- automatically generated when the import task request was sent.
--
-- 'importUrl', 'importTask_importUrl' - The URL for your import file that you\'ve uploaded to Amazon S3.
--
-- 'importRequestTime', 'importTask_importRequestTime' - The time that the import task request was made, presented in the Unix
-- time stamp format.
newImportTask ::
  ImportTask
newImportTask :: ImportTask
newImportTask =
  ImportTask' :: Maybe Int
-> Maybe ImportStatus
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> ImportTask
ImportTask'
    { $sel:applicationImportSuccess:ImportTask' :: Maybe Int
applicationImportSuccess =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ImportTask' :: Maybe ImportStatus
status = Maybe ImportStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:serverImportSuccess:ImportTask' :: Maybe Int
serverImportSuccess = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:importCompletionTime:ImportTask' :: Maybe POSIX
importCompletionTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ImportTask' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationImportFailure:ImportTask' :: Maybe Int
applicationImportFailure = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:errorsAndFailedEntriesZip:ImportTask' :: Maybe Text
errorsAndFailedEntriesZip = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:importTaskId:ImportTask' :: Maybe Text
importTaskId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:importDeletedTime:ImportTask' :: Maybe POSIX
importDeletedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:serverImportFailure:ImportTask' :: Maybe Int
serverImportFailure = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:ImportTask' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:importUrl:ImportTask' :: Maybe Text
importUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:importRequestTime:ImportTask' :: Maybe POSIX
importRequestTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | The total number of application records in the import file that were
-- successfully imported.
importTask_applicationImportSuccess :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.Int)
importTask_applicationImportSuccess :: (Maybe Int -> f (Maybe Int)) -> ImportTask -> f ImportTask
importTask_applicationImportSuccess = (ImportTask -> Maybe Int)
-> (ImportTask -> Maybe Int -> ImportTask)
-> Lens ImportTask ImportTask (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe Int
applicationImportSuccess :: Maybe Int
$sel:applicationImportSuccess:ImportTask' :: ImportTask -> Maybe Int
applicationImportSuccess} -> Maybe Int
applicationImportSuccess) (\s :: ImportTask
s@ImportTask' {} Maybe Int
a -> ImportTask
s {$sel:applicationImportSuccess:ImportTask' :: Maybe Int
applicationImportSuccess = Maybe Int
a} :: ImportTask)

-- | The status of the import task. An import can have the status of
-- @IMPORT_COMPLETE@ and still have some records fail to import from the
-- overall request. More information can be found in the downloadable
-- archive defined in the @errorsAndFailedEntriesZip@ field, or in the
-- Migration Hub management console.
importTask_status :: Lens.Lens' ImportTask (Prelude.Maybe ImportStatus)
importTask_status :: (Maybe ImportStatus -> f (Maybe ImportStatus))
-> ImportTask -> f ImportTask
importTask_status = (ImportTask -> Maybe ImportStatus)
-> (ImportTask -> Maybe ImportStatus -> ImportTask)
-> Lens
     ImportTask ImportTask (Maybe ImportStatus) (Maybe ImportStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe ImportStatus
status :: Maybe ImportStatus
$sel:status:ImportTask' :: ImportTask -> Maybe ImportStatus
status} -> Maybe ImportStatus
status) (\s :: ImportTask
s@ImportTask' {} Maybe ImportStatus
a -> ImportTask
s {$sel:status:ImportTask' :: Maybe ImportStatus
status = Maybe ImportStatus
a} :: ImportTask)

-- | The total number of server records in the import file that were
-- successfully imported.
importTask_serverImportSuccess :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.Int)
importTask_serverImportSuccess :: (Maybe Int -> f (Maybe Int)) -> ImportTask -> f ImportTask
importTask_serverImportSuccess = (ImportTask -> Maybe Int)
-> (ImportTask -> Maybe Int -> ImportTask)
-> Lens ImportTask ImportTask (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe Int
serverImportSuccess :: Maybe Int
$sel:serverImportSuccess:ImportTask' :: ImportTask -> Maybe Int
serverImportSuccess} -> Maybe Int
serverImportSuccess) (\s :: ImportTask
s@ImportTask' {} Maybe Int
a -> ImportTask
s {$sel:serverImportSuccess:ImportTask' :: Maybe Int
serverImportSuccess = Maybe Int
a} :: ImportTask)

-- | The time that the import task request finished, presented in the Unix
-- time stamp format.
importTask_importCompletionTime :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.UTCTime)
importTask_importCompletionTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ImportTask -> f ImportTask
importTask_importCompletionTime = (ImportTask -> Maybe POSIX)
-> (ImportTask -> Maybe POSIX -> ImportTask)
-> Lens ImportTask ImportTask (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe POSIX
importCompletionTime :: Maybe POSIX
$sel:importCompletionTime:ImportTask' :: ImportTask -> Maybe POSIX
importCompletionTime} -> Maybe POSIX
importCompletionTime) (\s :: ImportTask
s@ImportTask' {} Maybe POSIX
a -> ImportTask
s {$sel:importCompletionTime:ImportTask' :: Maybe POSIX
importCompletionTime = Maybe POSIX
a} :: ImportTask) ((Maybe POSIX -> f (Maybe POSIX)) -> ImportTask -> f ImportTask)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ImportTask
-> f ImportTask
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

-- | A descriptive name for an import task. You can use this name to filter
-- future requests related to this import task, such as identifying
-- applications and servers that were included in this import task. We
-- recommend that you use a meaningful name for each import task.
importTask_name :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.Text)
importTask_name :: (Maybe Text -> f (Maybe Text)) -> ImportTask -> f ImportTask
importTask_name = (ImportTask -> Maybe Text)
-> (ImportTask -> Maybe Text -> ImportTask)
-> Lens ImportTask ImportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe Text
name :: Maybe Text
$sel:name:ImportTask' :: ImportTask -> Maybe Text
name} -> Maybe Text
name) (\s :: ImportTask
s@ImportTask' {} Maybe Text
a -> ImportTask
s {$sel:name:ImportTask' :: Maybe Text
name = Maybe Text
a} :: ImportTask)

-- | The total number of application records in the import file that failed
-- to be imported.
importTask_applicationImportFailure :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.Int)
importTask_applicationImportFailure :: (Maybe Int -> f (Maybe Int)) -> ImportTask -> f ImportTask
importTask_applicationImportFailure = (ImportTask -> Maybe Int)
-> (ImportTask -> Maybe Int -> ImportTask)
-> Lens ImportTask ImportTask (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe Int
applicationImportFailure :: Maybe Int
$sel:applicationImportFailure:ImportTask' :: ImportTask -> Maybe Int
applicationImportFailure} -> Maybe Int
applicationImportFailure) (\s :: ImportTask
s@ImportTask' {} Maybe Int
a -> ImportTask
s {$sel:applicationImportFailure:ImportTask' :: Maybe Int
applicationImportFailure = Maybe Int
a} :: ImportTask)

-- | A link to a compressed archive folder (in the ZIP format) that contains
-- an error log and a file of failed records. You can use these two files
-- to quickly identify records that failed, why they failed, and correct
-- those records. Afterward, you can upload the corrected file to your
-- Amazon S3 bucket and create another import task request.
--
-- This field also includes authorization information so you can confirm
-- the authenticity of the compressed archive before you download it.
--
-- If some records failed to be imported we recommend that you correct the
-- records in the failed entries file and then imports that failed entries
-- file. This prevents you from having to correct and update the larger
-- original file and attempt importing it again.
importTask_errorsAndFailedEntriesZip :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.Text)
importTask_errorsAndFailedEntriesZip :: (Maybe Text -> f (Maybe Text)) -> ImportTask -> f ImportTask
importTask_errorsAndFailedEntriesZip = (ImportTask -> Maybe Text)
-> (ImportTask -> Maybe Text -> ImportTask)
-> Lens ImportTask ImportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe Text
errorsAndFailedEntriesZip :: Maybe Text
$sel:errorsAndFailedEntriesZip:ImportTask' :: ImportTask -> Maybe Text
errorsAndFailedEntriesZip} -> Maybe Text
errorsAndFailedEntriesZip) (\s :: ImportTask
s@ImportTask' {} Maybe Text
a -> ImportTask
s {$sel:errorsAndFailedEntriesZip:ImportTask' :: Maybe Text
errorsAndFailedEntriesZip = Maybe Text
a} :: ImportTask)

-- | The unique ID for a specific import task. These IDs aren\'t globally
-- unique, but they are unique within an AWS account.
importTask_importTaskId :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.Text)
importTask_importTaskId :: (Maybe Text -> f (Maybe Text)) -> ImportTask -> f ImportTask
importTask_importTaskId = (ImportTask -> Maybe Text)
-> (ImportTask -> Maybe Text -> ImportTask)
-> Lens ImportTask ImportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe Text
importTaskId :: Maybe Text
$sel:importTaskId:ImportTask' :: ImportTask -> Maybe Text
importTaskId} -> Maybe Text
importTaskId) (\s :: ImportTask
s@ImportTask' {} Maybe Text
a -> ImportTask
s {$sel:importTaskId:ImportTask' :: Maybe Text
importTaskId = Maybe Text
a} :: ImportTask)

-- | The time that the import task request was deleted, presented in the Unix
-- time stamp format.
importTask_importDeletedTime :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.UTCTime)
importTask_importDeletedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ImportTask -> f ImportTask
importTask_importDeletedTime = (ImportTask -> Maybe POSIX)
-> (ImportTask -> Maybe POSIX -> ImportTask)
-> Lens ImportTask ImportTask (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe POSIX
importDeletedTime :: Maybe POSIX
$sel:importDeletedTime:ImportTask' :: ImportTask -> Maybe POSIX
importDeletedTime} -> Maybe POSIX
importDeletedTime) (\s :: ImportTask
s@ImportTask' {} Maybe POSIX
a -> ImportTask
s {$sel:importDeletedTime:ImportTask' :: Maybe POSIX
importDeletedTime = Maybe POSIX
a} :: ImportTask) ((Maybe POSIX -> f (Maybe POSIX)) -> ImportTask -> f ImportTask)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ImportTask
-> f ImportTask
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 total number of server records in the import file that failed to be
-- imported.
importTask_serverImportFailure :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.Int)
importTask_serverImportFailure :: (Maybe Int -> f (Maybe Int)) -> ImportTask -> f ImportTask
importTask_serverImportFailure = (ImportTask -> Maybe Int)
-> (ImportTask -> Maybe Int -> ImportTask)
-> Lens ImportTask ImportTask (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe Int
serverImportFailure :: Maybe Int
$sel:serverImportFailure:ImportTask' :: ImportTask -> Maybe Int
serverImportFailure} -> Maybe Int
serverImportFailure) (\s :: ImportTask
s@ImportTask' {} Maybe Int
a -> ImportTask
s {$sel:serverImportFailure:ImportTask' :: Maybe Int
serverImportFailure = Maybe Int
a} :: ImportTask)

-- | A unique token used to prevent the same import request from occurring
-- more than once. If you didn\'t provide a token, a token was
-- automatically generated when the import task request was sent.
importTask_clientRequestToken :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.Text)
importTask_clientRequestToken :: (Maybe Text -> f (Maybe Text)) -> ImportTask -> f ImportTask
importTask_clientRequestToken = (ImportTask -> Maybe Text)
-> (ImportTask -> Maybe Text -> ImportTask)
-> Lens ImportTask ImportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:ImportTask' :: ImportTask -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: ImportTask
s@ImportTask' {} Maybe Text
a -> ImportTask
s {$sel:clientRequestToken:ImportTask' :: Maybe Text
clientRequestToken = Maybe Text
a} :: ImportTask)

-- | The URL for your import file that you\'ve uploaded to Amazon S3.
importTask_importUrl :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.Text)
importTask_importUrl :: (Maybe Text -> f (Maybe Text)) -> ImportTask -> f ImportTask
importTask_importUrl = (ImportTask -> Maybe Text)
-> (ImportTask -> Maybe Text -> ImportTask)
-> Lens ImportTask ImportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe Text
importUrl :: Maybe Text
$sel:importUrl:ImportTask' :: ImportTask -> Maybe Text
importUrl} -> Maybe Text
importUrl) (\s :: ImportTask
s@ImportTask' {} Maybe Text
a -> ImportTask
s {$sel:importUrl:ImportTask' :: Maybe Text
importUrl = Maybe Text
a} :: ImportTask)

-- | The time that the import task request was made, presented in the Unix
-- time stamp format.
importTask_importRequestTime :: Lens.Lens' ImportTask (Prelude.Maybe Prelude.UTCTime)
importTask_importRequestTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ImportTask -> f ImportTask
importTask_importRequestTime = (ImportTask -> Maybe POSIX)
-> (ImportTask -> Maybe POSIX -> ImportTask)
-> Lens ImportTask ImportTask (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportTask' {Maybe POSIX
importRequestTime :: Maybe POSIX
$sel:importRequestTime:ImportTask' :: ImportTask -> Maybe POSIX
importRequestTime} -> Maybe POSIX
importRequestTime) (\s :: ImportTask
s@ImportTask' {} Maybe POSIX
a -> ImportTask
s {$sel:importRequestTime:ImportTask' :: Maybe POSIX
importRequestTime = Maybe POSIX
a} :: ImportTask) ((Maybe POSIX -> f (Maybe POSIX)) -> ImportTask -> f ImportTask)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ImportTask
-> f ImportTask
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

instance Core.FromJSON ImportTask where
  parseJSON :: Value -> Parser ImportTask
parseJSON =
    String
-> (Object -> Parser ImportTask) -> Value -> Parser ImportTask
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ImportTask"
      ( \Object
x ->
          Maybe Int
-> Maybe ImportStatus
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> ImportTask
ImportTask'
            (Maybe Int
 -> Maybe ImportStatus
 -> Maybe Int
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> ImportTask)
-> Parser (Maybe Int)
-> Parser
     (Maybe ImportStatus
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> ImportTask)
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
"applicationImportSuccess")
            Parser
  (Maybe ImportStatus
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> ImportTask)
-> Parser (Maybe ImportStatus)
-> Parser
     (Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> ImportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ImportStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> ImportTask)
-> Parser (Maybe Int)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> ImportTask)
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
"serverImportSuccess")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> ImportTask)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> ImportTask)
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
"importCompletionTime")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> ImportTask)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> ImportTask)
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
"name")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> ImportTask)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> ImportTask)
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
"applicationImportFailure")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> ImportTask)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> ImportTask)
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
"errorsAndFailedEntriesZip")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> ImportTask)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> ImportTask)
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
"importTaskId")
            Parser
  (Maybe POSIX
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> ImportTask)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Int
      -> Maybe Text -> Maybe Text -> Maybe POSIX -> ImportTask)
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
"importDeletedTime")
            Parser
  (Maybe Int
   -> Maybe Text -> Maybe Text -> Maybe POSIX -> ImportTask)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> ImportTask)
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
"serverImportFailure")
            Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> ImportTask)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> ImportTask)
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
"clientRequestToken")
            Parser (Maybe Text -> Maybe POSIX -> ImportTask)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> ImportTask)
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
"importUrl")
            Parser (Maybe POSIX -> ImportTask)
-> Parser (Maybe POSIX) -> Parser ImportTask
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
"importRequestTime")
      )

instance Prelude.Hashable ImportTask

instance Prelude.NFData ImportTask