{-# 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.CognitoIdentityProvider.Types.UserImportJobType
-- 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.CognitoIdentityProvider.Types.UserImportJobType where

import Amazonka.CognitoIdentityProvider.Types.UserImportJobStatusType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The user import job type.
--
-- /See:/ 'newUserImportJobType' smart constructor.
data UserImportJobType = UserImportJobType'
  { -- | The status of the user import job. One of the following:
    --
    -- -   @Created@ - The job was created but not started.
    --
    -- -   @Pending@ - A transition state. You have started the job, but it has
    --     not begun importing users yet.
    --
    -- -   @InProgress@ - The job has started, and users are being imported.
    --
    -- -   @Stopping@ - You have stopped the job, but the job has not stopped
    --     importing users yet.
    --
    -- -   @Stopped@ - You have stopped the job, and the job has stopped
    --     importing users.
    --
    -- -   @Succeeded@ - The job has completed successfully.
    --
    -- -   @Failed@ - The job has stopped due to an error.
    --
    -- -   @Expired@ - You created a job, but did not start the job within
    --     24-48 hours. All data associated with the job was deleted, and the
    --     job cannot be started.
    UserImportJobType -> Maybe UserImportJobStatusType
status :: Prelude.Maybe UserImportJobStatusType,
    -- | The number of users that were skipped.
    UserImportJobType -> Maybe Integer
skippedUsers :: Prelude.Maybe Prelude.Integer,
    -- | The job ID for the user import job.
    UserImportJobType -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | The user pool ID for the user pool that the users are being imported
    -- into.
    UserImportJobType -> Maybe Text
userPoolId :: Prelude.Maybe Prelude.Text,
    -- | The job name for the user import job.
    UserImportJobType -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
    -- | The pre-signed URL to be used to upload the @.csv@ file.
    UserImportJobType -> Maybe Text
preSignedUrl :: Prelude.Maybe Prelude.Text,
    -- | The number of users that could not be imported.
    UserImportJobType -> Maybe Integer
failedUsers :: Prelude.Maybe Prelude.Integer,
    -- | The date when the user import job was started.
    UserImportJobType -> Maybe POSIX
startDate :: Prelude.Maybe Core.POSIX,
    -- | The message returned when the user import job is completed.
    UserImportJobType -> Maybe Text
completionMessage :: Prelude.Maybe Prelude.Text,
    -- | The date the user import job was created.
    UserImportJobType -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | The date when the user import job was completed.
    UserImportJobType -> Maybe POSIX
completionDate :: Prelude.Maybe Core.POSIX,
    -- | The role ARN for the Amazon CloudWatch Logging role for the user import
    -- job. For more information, see \"Creating the CloudWatch Logs IAM Role\"
    -- in the Amazon Cognito Developer Guide.
    UserImportJobType -> Maybe Text
cloudWatchLogsRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The number of users that were successfully imported.
    UserImportJobType -> Maybe Integer
importedUsers :: Prelude.Maybe Prelude.Integer
  }
  deriving (UserImportJobType -> UserImportJobType -> Bool
(UserImportJobType -> UserImportJobType -> Bool)
-> (UserImportJobType -> UserImportJobType -> Bool)
-> Eq UserImportJobType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserImportJobType -> UserImportJobType -> Bool
$c/= :: UserImportJobType -> UserImportJobType -> Bool
== :: UserImportJobType -> UserImportJobType -> Bool
$c== :: UserImportJobType -> UserImportJobType -> Bool
Prelude.Eq, ReadPrec [UserImportJobType]
ReadPrec UserImportJobType
Int -> ReadS UserImportJobType
ReadS [UserImportJobType]
(Int -> ReadS UserImportJobType)
-> ReadS [UserImportJobType]
-> ReadPrec UserImportJobType
-> ReadPrec [UserImportJobType]
-> Read UserImportJobType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserImportJobType]
$creadListPrec :: ReadPrec [UserImportJobType]
readPrec :: ReadPrec UserImportJobType
$creadPrec :: ReadPrec UserImportJobType
readList :: ReadS [UserImportJobType]
$creadList :: ReadS [UserImportJobType]
readsPrec :: Int -> ReadS UserImportJobType
$creadsPrec :: Int -> ReadS UserImportJobType
Prelude.Read, Int -> UserImportJobType -> ShowS
[UserImportJobType] -> ShowS
UserImportJobType -> String
(Int -> UserImportJobType -> ShowS)
-> (UserImportJobType -> String)
-> ([UserImportJobType] -> ShowS)
-> Show UserImportJobType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserImportJobType] -> ShowS
$cshowList :: [UserImportJobType] -> ShowS
show :: UserImportJobType -> String
$cshow :: UserImportJobType -> String
showsPrec :: Int -> UserImportJobType -> ShowS
$cshowsPrec :: Int -> UserImportJobType -> ShowS
Prelude.Show, (forall x. UserImportJobType -> Rep UserImportJobType x)
-> (forall x. Rep UserImportJobType x -> UserImportJobType)
-> Generic UserImportJobType
forall x. Rep UserImportJobType x -> UserImportJobType
forall x. UserImportJobType -> Rep UserImportJobType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserImportJobType x -> UserImportJobType
$cfrom :: forall x. UserImportJobType -> Rep UserImportJobType x
Prelude.Generic)

-- |
-- Create a value of 'UserImportJobType' 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:
--
-- 'status', 'userImportJobType_status' - The status of the user import job. One of the following:
--
-- -   @Created@ - The job was created but not started.
--
-- -   @Pending@ - A transition state. You have started the job, but it has
--     not begun importing users yet.
--
-- -   @InProgress@ - The job has started, and users are being imported.
--
-- -   @Stopping@ - You have stopped the job, but the job has not stopped
--     importing users yet.
--
-- -   @Stopped@ - You have stopped the job, and the job has stopped
--     importing users.
--
-- -   @Succeeded@ - The job has completed successfully.
--
-- -   @Failed@ - The job has stopped due to an error.
--
-- -   @Expired@ - You created a job, but did not start the job within
--     24-48 hours. All data associated with the job was deleted, and the
--     job cannot be started.
--
-- 'skippedUsers', 'userImportJobType_skippedUsers' - The number of users that were skipped.
--
-- 'jobId', 'userImportJobType_jobId' - The job ID for the user import job.
--
-- 'userPoolId', 'userImportJobType_userPoolId' - The user pool ID for the user pool that the users are being imported
-- into.
--
-- 'jobName', 'userImportJobType_jobName' - The job name for the user import job.
--
-- 'preSignedUrl', 'userImportJobType_preSignedUrl' - The pre-signed URL to be used to upload the @.csv@ file.
--
-- 'failedUsers', 'userImportJobType_failedUsers' - The number of users that could not be imported.
--
-- 'startDate', 'userImportJobType_startDate' - The date when the user import job was started.
--
-- 'completionMessage', 'userImportJobType_completionMessage' - The message returned when the user import job is completed.
--
-- 'creationDate', 'userImportJobType_creationDate' - The date the user import job was created.
--
-- 'completionDate', 'userImportJobType_completionDate' - The date when the user import job was completed.
--
-- 'cloudWatchLogsRoleArn', 'userImportJobType_cloudWatchLogsRoleArn' - The role ARN for the Amazon CloudWatch Logging role for the user import
-- job. For more information, see \"Creating the CloudWatch Logs IAM Role\"
-- in the Amazon Cognito Developer Guide.
--
-- 'importedUsers', 'userImportJobType_importedUsers' - The number of users that were successfully imported.
newUserImportJobType ::
  UserImportJobType
newUserImportJobType :: UserImportJobType
newUserImportJobType =
  UserImportJobType' :: Maybe UserImportJobStatusType
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> UserImportJobType
UserImportJobType'
    { $sel:status:UserImportJobType' :: Maybe UserImportJobStatusType
status = Maybe UserImportJobStatusType
forall a. Maybe a
Prelude.Nothing,
      $sel:skippedUsers:UserImportJobType' :: Maybe Integer
skippedUsers = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:UserImportJobType' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:UserImportJobType' :: Maybe Text
userPoolId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobName:UserImportJobType' :: Maybe Text
jobName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preSignedUrl:UserImportJobType' :: Maybe Text
preSignedUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:failedUsers:UserImportJobType' :: Maybe Integer
failedUsers = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:UserImportJobType' :: Maybe POSIX
startDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:completionMessage:UserImportJobType' :: Maybe Text
completionMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:UserImportJobType' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:completionDate:UserImportJobType' :: Maybe POSIX
completionDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudWatchLogsRoleArn:UserImportJobType' :: Maybe Text
cloudWatchLogsRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:importedUsers:UserImportJobType' :: Maybe Integer
importedUsers = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the user import job. One of the following:
--
-- -   @Created@ - The job was created but not started.
--
-- -   @Pending@ - A transition state. You have started the job, but it has
--     not begun importing users yet.
--
-- -   @InProgress@ - The job has started, and users are being imported.
--
-- -   @Stopping@ - You have stopped the job, but the job has not stopped
--     importing users yet.
--
-- -   @Stopped@ - You have stopped the job, and the job has stopped
--     importing users.
--
-- -   @Succeeded@ - The job has completed successfully.
--
-- -   @Failed@ - The job has stopped due to an error.
--
-- -   @Expired@ - You created a job, but did not start the job within
--     24-48 hours. All data associated with the job was deleted, and the
--     job cannot be started.
userImportJobType_status :: Lens.Lens' UserImportJobType (Prelude.Maybe UserImportJobStatusType)
userImportJobType_status :: (Maybe UserImportJobStatusType
 -> f (Maybe UserImportJobStatusType))
-> UserImportJobType -> f UserImportJobType
userImportJobType_status = (UserImportJobType -> Maybe UserImportJobStatusType)
-> (UserImportJobType
    -> Maybe UserImportJobStatusType -> UserImportJobType)
-> Lens
     UserImportJobType
     UserImportJobType
     (Maybe UserImportJobStatusType)
     (Maybe UserImportJobStatusType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe UserImportJobStatusType
status :: Maybe UserImportJobStatusType
$sel:status:UserImportJobType' :: UserImportJobType -> Maybe UserImportJobStatusType
status} -> Maybe UserImportJobStatusType
status) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe UserImportJobStatusType
a -> UserImportJobType
s {$sel:status:UserImportJobType' :: Maybe UserImportJobStatusType
status = Maybe UserImportJobStatusType
a} :: UserImportJobType)

-- | The number of users that were skipped.
userImportJobType_skippedUsers :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.Integer)
userImportJobType_skippedUsers :: (Maybe Integer -> f (Maybe Integer))
-> UserImportJobType -> f UserImportJobType
userImportJobType_skippedUsers = (UserImportJobType -> Maybe Integer)
-> (UserImportJobType -> Maybe Integer -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe Integer
skippedUsers :: Maybe Integer
$sel:skippedUsers:UserImportJobType' :: UserImportJobType -> Maybe Integer
skippedUsers} -> Maybe Integer
skippedUsers) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe Integer
a -> UserImportJobType
s {$sel:skippedUsers:UserImportJobType' :: Maybe Integer
skippedUsers = Maybe Integer
a} :: UserImportJobType)

-- | The job ID for the user import job.
userImportJobType_jobId :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.Text)
userImportJobType_jobId :: (Maybe Text -> f (Maybe Text))
-> UserImportJobType -> f UserImportJobType
userImportJobType_jobId = (UserImportJobType -> Maybe Text)
-> (UserImportJobType -> Maybe Text -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe Text
jobId :: Maybe Text
$sel:jobId:UserImportJobType' :: UserImportJobType -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe Text
a -> UserImportJobType
s {$sel:jobId:UserImportJobType' :: Maybe Text
jobId = Maybe Text
a} :: UserImportJobType)

-- | The user pool ID for the user pool that the users are being imported
-- into.
userImportJobType_userPoolId :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.Text)
userImportJobType_userPoolId :: (Maybe Text -> f (Maybe Text))
-> UserImportJobType -> f UserImportJobType
userImportJobType_userPoolId = (UserImportJobType -> Maybe Text)
-> (UserImportJobType -> Maybe Text -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe Text
userPoolId :: Maybe Text
$sel:userPoolId:UserImportJobType' :: UserImportJobType -> Maybe Text
userPoolId} -> Maybe Text
userPoolId) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe Text
a -> UserImportJobType
s {$sel:userPoolId:UserImportJobType' :: Maybe Text
userPoolId = Maybe Text
a} :: UserImportJobType)

-- | The job name for the user import job.
userImportJobType_jobName :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.Text)
userImportJobType_jobName :: (Maybe Text -> f (Maybe Text))
-> UserImportJobType -> f UserImportJobType
userImportJobType_jobName = (UserImportJobType -> Maybe Text)
-> (UserImportJobType -> Maybe Text -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe Text
jobName :: Maybe Text
$sel:jobName:UserImportJobType' :: UserImportJobType -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe Text
a -> UserImportJobType
s {$sel:jobName:UserImportJobType' :: Maybe Text
jobName = Maybe Text
a} :: UserImportJobType)

-- | The pre-signed URL to be used to upload the @.csv@ file.
userImportJobType_preSignedUrl :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.Text)
userImportJobType_preSignedUrl :: (Maybe Text -> f (Maybe Text))
-> UserImportJobType -> f UserImportJobType
userImportJobType_preSignedUrl = (UserImportJobType -> Maybe Text)
-> (UserImportJobType -> Maybe Text -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe Text
preSignedUrl :: Maybe Text
$sel:preSignedUrl:UserImportJobType' :: UserImportJobType -> Maybe Text
preSignedUrl} -> Maybe Text
preSignedUrl) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe Text
a -> UserImportJobType
s {$sel:preSignedUrl:UserImportJobType' :: Maybe Text
preSignedUrl = Maybe Text
a} :: UserImportJobType)

-- | The number of users that could not be imported.
userImportJobType_failedUsers :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.Integer)
userImportJobType_failedUsers :: (Maybe Integer -> f (Maybe Integer))
-> UserImportJobType -> f UserImportJobType
userImportJobType_failedUsers = (UserImportJobType -> Maybe Integer)
-> (UserImportJobType -> Maybe Integer -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe Integer
failedUsers :: Maybe Integer
$sel:failedUsers:UserImportJobType' :: UserImportJobType -> Maybe Integer
failedUsers} -> Maybe Integer
failedUsers) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe Integer
a -> UserImportJobType
s {$sel:failedUsers:UserImportJobType' :: Maybe Integer
failedUsers = Maybe Integer
a} :: UserImportJobType)

-- | The date when the user import job was started.
userImportJobType_startDate :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.UTCTime)
userImportJobType_startDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UserImportJobType -> f UserImportJobType
userImportJobType_startDate = (UserImportJobType -> Maybe POSIX)
-> (UserImportJobType -> Maybe POSIX -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe POSIX
startDate :: Maybe POSIX
$sel:startDate:UserImportJobType' :: UserImportJobType -> Maybe POSIX
startDate} -> Maybe POSIX
startDate) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe POSIX
a -> UserImportJobType
s {$sel:startDate:UserImportJobType' :: Maybe POSIX
startDate = Maybe POSIX
a} :: UserImportJobType) ((Maybe POSIX -> f (Maybe POSIX))
 -> UserImportJobType -> f UserImportJobType)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UserImportJobType
-> f UserImportJobType
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 message returned when the user import job is completed.
userImportJobType_completionMessage :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.Text)
userImportJobType_completionMessage :: (Maybe Text -> f (Maybe Text))
-> UserImportJobType -> f UserImportJobType
userImportJobType_completionMessage = (UserImportJobType -> Maybe Text)
-> (UserImportJobType -> Maybe Text -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe Text
completionMessage :: Maybe Text
$sel:completionMessage:UserImportJobType' :: UserImportJobType -> Maybe Text
completionMessage} -> Maybe Text
completionMessage) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe Text
a -> UserImportJobType
s {$sel:completionMessage:UserImportJobType' :: Maybe Text
completionMessage = Maybe Text
a} :: UserImportJobType)

-- | The date the user import job was created.
userImportJobType_creationDate :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.UTCTime)
userImportJobType_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UserImportJobType -> f UserImportJobType
userImportJobType_creationDate = (UserImportJobType -> Maybe POSIX)
-> (UserImportJobType -> Maybe POSIX -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:UserImportJobType' :: UserImportJobType -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe POSIX
a -> UserImportJobType
s {$sel:creationDate:UserImportJobType' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: UserImportJobType) ((Maybe POSIX -> f (Maybe POSIX))
 -> UserImportJobType -> f UserImportJobType)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UserImportJobType
-> f UserImportJobType
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 date when the user import job was completed.
userImportJobType_completionDate :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.UTCTime)
userImportJobType_completionDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UserImportJobType -> f UserImportJobType
userImportJobType_completionDate = (UserImportJobType -> Maybe POSIX)
-> (UserImportJobType -> Maybe POSIX -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe POSIX
completionDate :: Maybe POSIX
$sel:completionDate:UserImportJobType' :: UserImportJobType -> Maybe POSIX
completionDate} -> Maybe POSIX
completionDate) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe POSIX
a -> UserImportJobType
s {$sel:completionDate:UserImportJobType' :: Maybe POSIX
completionDate = Maybe POSIX
a} :: UserImportJobType) ((Maybe POSIX -> f (Maybe POSIX))
 -> UserImportJobType -> f UserImportJobType)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UserImportJobType
-> f UserImportJobType
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 role ARN for the Amazon CloudWatch Logging role for the user import
-- job. For more information, see \"Creating the CloudWatch Logs IAM Role\"
-- in the Amazon Cognito Developer Guide.
userImportJobType_cloudWatchLogsRoleArn :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.Text)
userImportJobType_cloudWatchLogsRoleArn :: (Maybe Text -> f (Maybe Text))
-> UserImportJobType -> f UserImportJobType
userImportJobType_cloudWatchLogsRoleArn = (UserImportJobType -> Maybe Text)
-> (UserImportJobType -> Maybe Text -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe Text
cloudWatchLogsRoleArn :: Maybe Text
$sel:cloudWatchLogsRoleArn:UserImportJobType' :: UserImportJobType -> Maybe Text
cloudWatchLogsRoleArn} -> Maybe Text
cloudWatchLogsRoleArn) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe Text
a -> UserImportJobType
s {$sel:cloudWatchLogsRoleArn:UserImportJobType' :: Maybe Text
cloudWatchLogsRoleArn = Maybe Text
a} :: UserImportJobType)

-- | The number of users that were successfully imported.
userImportJobType_importedUsers :: Lens.Lens' UserImportJobType (Prelude.Maybe Prelude.Integer)
userImportJobType_importedUsers :: (Maybe Integer -> f (Maybe Integer))
-> UserImportJobType -> f UserImportJobType
userImportJobType_importedUsers = (UserImportJobType -> Maybe Integer)
-> (UserImportJobType -> Maybe Integer -> UserImportJobType)
-> Lens
     UserImportJobType UserImportJobType (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserImportJobType' {Maybe Integer
importedUsers :: Maybe Integer
$sel:importedUsers:UserImportJobType' :: UserImportJobType -> Maybe Integer
importedUsers} -> Maybe Integer
importedUsers) (\s :: UserImportJobType
s@UserImportJobType' {} Maybe Integer
a -> UserImportJobType
s {$sel:importedUsers:UserImportJobType' :: Maybe Integer
importedUsers = Maybe Integer
a} :: UserImportJobType)

instance Core.FromJSON UserImportJobType where
  parseJSON :: Value -> Parser UserImportJobType
parseJSON =
    String
-> (Object -> Parser UserImportJobType)
-> Value
-> Parser UserImportJobType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"UserImportJobType"
      ( \Object
x ->
          Maybe UserImportJobStatusType
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> UserImportJobType
UserImportJobType'
            (Maybe UserImportJobStatusType
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Integer
 -> UserImportJobType)
-> Parser (Maybe UserImportJobStatusType)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Integer
      -> UserImportJobType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe UserImportJobStatusType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Integer
   -> UserImportJobType)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Integer
      -> UserImportJobType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SkippedUsers")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Integer
   -> UserImportJobType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Integer
      -> UserImportJobType)
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
"JobId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Integer
   -> UserImportJobType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Integer
      -> UserImportJobType)
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
"UserPoolId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Integer
   -> UserImportJobType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Integer
      -> UserImportJobType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"JobName")
            Parser
  (Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Integer
   -> UserImportJobType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Integer
      -> UserImportJobType)
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
"PreSignedUrl")
            Parser
  (Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Integer
   -> UserImportJobType)
-> Parser (Maybe Integer)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Integer
      -> UserImportJobType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FailedUsers")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Integer
   -> UserImportJobType)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Integer
      -> UserImportJobType)
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
"StartDate")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Integer
   -> UserImportJobType)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX -> Maybe Text -> Maybe Integer -> UserImportJobType)
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
"CompletionMessage")
            Parser
  (Maybe POSIX
   -> Maybe POSIX -> Maybe Text -> Maybe Integer -> UserImportJobType)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX -> Maybe Text -> Maybe Integer -> UserImportJobType)
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
"CreationDate")
            Parser
  (Maybe POSIX -> Maybe Text -> Maybe Integer -> UserImportJobType)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Integer -> UserImportJobType)
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
"CompletionDate")
            Parser (Maybe Text -> Maybe Integer -> UserImportJobType)
-> Parser (Maybe Text)
-> Parser (Maybe Integer -> UserImportJobType)
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
"CloudWatchLogsRoleArn")
            Parser (Maybe Integer -> UserImportJobType)
-> Parser (Maybe Integer) -> Parser UserImportJobType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImportedUsers")
      )

instance Prelude.Hashable UserImportJobType

instance Prelude.NFData UserImportJobType