{-# 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.SESV2.Types.ImportJobSummary
-- 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.SESV2.Types.ImportJobSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SESV2.Types.ImportDestination
import Amazonka.SESV2.Types.JobStatus

-- | A summary of the import job.
--
-- /See:/ 'newImportJobSummary' smart constructor.
data ImportJobSummary = ImportJobSummary'
  { ImportJobSummary -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    ImportJobSummary -> Maybe ImportDestination
importDestination :: Prelude.Maybe ImportDestination,
    ImportJobSummary -> Maybe JobStatus
jobStatus :: Prelude.Maybe JobStatus,
    -- | The date and time when the import job was created.
    ImportJobSummary -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Core.POSIX
  }
  deriving (ImportJobSummary -> ImportJobSummary -> Bool
(ImportJobSummary -> ImportJobSummary -> Bool)
-> (ImportJobSummary -> ImportJobSummary -> Bool)
-> Eq ImportJobSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportJobSummary -> ImportJobSummary -> Bool
$c/= :: ImportJobSummary -> ImportJobSummary -> Bool
== :: ImportJobSummary -> ImportJobSummary -> Bool
$c== :: ImportJobSummary -> ImportJobSummary -> Bool
Prelude.Eq, ReadPrec [ImportJobSummary]
ReadPrec ImportJobSummary
Int -> ReadS ImportJobSummary
ReadS [ImportJobSummary]
(Int -> ReadS ImportJobSummary)
-> ReadS [ImportJobSummary]
-> ReadPrec ImportJobSummary
-> ReadPrec [ImportJobSummary]
-> Read ImportJobSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportJobSummary]
$creadListPrec :: ReadPrec [ImportJobSummary]
readPrec :: ReadPrec ImportJobSummary
$creadPrec :: ReadPrec ImportJobSummary
readList :: ReadS [ImportJobSummary]
$creadList :: ReadS [ImportJobSummary]
readsPrec :: Int -> ReadS ImportJobSummary
$creadsPrec :: Int -> ReadS ImportJobSummary
Prelude.Read, Int -> ImportJobSummary -> ShowS
[ImportJobSummary] -> ShowS
ImportJobSummary -> String
(Int -> ImportJobSummary -> ShowS)
-> (ImportJobSummary -> String)
-> ([ImportJobSummary] -> ShowS)
-> Show ImportJobSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportJobSummary] -> ShowS
$cshowList :: [ImportJobSummary] -> ShowS
show :: ImportJobSummary -> String
$cshow :: ImportJobSummary -> String
showsPrec :: Int -> ImportJobSummary -> ShowS
$cshowsPrec :: Int -> ImportJobSummary -> ShowS
Prelude.Show, (forall x. ImportJobSummary -> Rep ImportJobSummary x)
-> (forall x. Rep ImportJobSummary x -> ImportJobSummary)
-> Generic ImportJobSummary
forall x. Rep ImportJobSummary x -> ImportJobSummary
forall x. ImportJobSummary -> Rep ImportJobSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImportJobSummary x -> ImportJobSummary
$cfrom :: forall x. ImportJobSummary -> Rep ImportJobSummary x
Prelude.Generic)

-- |
-- Create a value of 'ImportJobSummary' 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', 'importJobSummary_jobId' - Undocumented member.
--
-- 'importDestination', 'importJobSummary_importDestination' - Undocumented member.
--
-- 'jobStatus', 'importJobSummary_jobStatus' - Undocumented member.
--
-- 'createdTimestamp', 'importJobSummary_createdTimestamp' - The date and time when the import job was created.
newImportJobSummary ::
  ImportJobSummary
newImportJobSummary :: ImportJobSummary
newImportJobSummary =
  ImportJobSummary' :: Maybe Text
-> Maybe ImportDestination
-> Maybe JobStatus
-> Maybe POSIX
-> ImportJobSummary
ImportJobSummary'
    { $sel:jobId:ImportJobSummary' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:importDestination:ImportJobSummary' :: Maybe ImportDestination
importDestination = Maybe ImportDestination
forall a. Maybe a
Prelude.Nothing,
      $sel:jobStatus:ImportJobSummary' :: Maybe JobStatus
jobStatus = Maybe JobStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTimestamp:ImportJobSummary' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
importJobSummary_jobId :: Lens.Lens' ImportJobSummary (Prelude.Maybe Prelude.Text)
importJobSummary_jobId :: (Maybe Text -> f (Maybe Text))
-> ImportJobSummary -> f ImportJobSummary
importJobSummary_jobId = (ImportJobSummary -> Maybe Text)
-> (ImportJobSummary -> Maybe Text -> ImportJobSummary)
-> Lens ImportJobSummary ImportJobSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobSummary' {Maybe Text
jobId :: Maybe Text
$sel:jobId:ImportJobSummary' :: ImportJobSummary -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: ImportJobSummary
s@ImportJobSummary' {} Maybe Text
a -> ImportJobSummary
s {$sel:jobId:ImportJobSummary' :: Maybe Text
jobId = Maybe Text
a} :: ImportJobSummary)

-- | Undocumented member.
importJobSummary_importDestination :: Lens.Lens' ImportJobSummary (Prelude.Maybe ImportDestination)
importJobSummary_importDestination :: (Maybe ImportDestination -> f (Maybe ImportDestination))
-> ImportJobSummary -> f ImportJobSummary
importJobSummary_importDestination = (ImportJobSummary -> Maybe ImportDestination)
-> (ImportJobSummary
    -> Maybe ImportDestination -> ImportJobSummary)
-> Lens
     ImportJobSummary
     ImportJobSummary
     (Maybe ImportDestination)
     (Maybe ImportDestination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobSummary' {Maybe ImportDestination
importDestination :: Maybe ImportDestination
$sel:importDestination:ImportJobSummary' :: ImportJobSummary -> Maybe ImportDestination
importDestination} -> Maybe ImportDestination
importDestination) (\s :: ImportJobSummary
s@ImportJobSummary' {} Maybe ImportDestination
a -> ImportJobSummary
s {$sel:importDestination:ImportJobSummary' :: Maybe ImportDestination
importDestination = Maybe ImportDestination
a} :: ImportJobSummary)

-- | Undocumented member.
importJobSummary_jobStatus :: Lens.Lens' ImportJobSummary (Prelude.Maybe JobStatus)
importJobSummary_jobStatus :: (Maybe JobStatus -> f (Maybe JobStatus))
-> ImportJobSummary -> f ImportJobSummary
importJobSummary_jobStatus = (ImportJobSummary -> Maybe JobStatus)
-> (ImportJobSummary -> Maybe JobStatus -> ImportJobSummary)
-> Lens
     ImportJobSummary
     ImportJobSummary
     (Maybe JobStatus)
     (Maybe JobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobSummary' {Maybe JobStatus
jobStatus :: Maybe JobStatus
$sel:jobStatus:ImportJobSummary' :: ImportJobSummary -> Maybe JobStatus
jobStatus} -> Maybe JobStatus
jobStatus) (\s :: ImportJobSummary
s@ImportJobSummary' {} Maybe JobStatus
a -> ImportJobSummary
s {$sel:jobStatus:ImportJobSummary' :: Maybe JobStatus
jobStatus = Maybe JobStatus
a} :: ImportJobSummary)

-- | The date and time when the import job was created.
importJobSummary_createdTimestamp :: Lens.Lens' ImportJobSummary (Prelude.Maybe Prelude.UTCTime)
importJobSummary_createdTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ImportJobSummary -> f ImportJobSummary
importJobSummary_createdTimestamp = (ImportJobSummary -> Maybe POSIX)
-> (ImportJobSummary -> Maybe POSIX -> ImportJobSummary)
-> Lens
     ImportJobSummary ImportJobSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportJobSummary' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:ImportJobSummary' :: ImportJobSummary -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: ImportJobSummary
s@ImportJobSummary' {} Maybe POSIX
a -> ImportJobSummary
s {$sel:createdTimestamp:ImportJobSummary' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: ImportJobSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ImportJobSummary -> f ImportJobSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ImportJobSummary
-> f ImportJobSummary
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 ImportJobSummary where
  parseJSON :: Value -> Parser ImportJobSummary
parseJSON =
    String
-> (Object -> Parser ImportJobSummary)
-> Value
-> Parser ImportJobSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ImportJobSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe ImportDestination
-> Maybe JobStatus
-> Maybe POSIX
-> ImportJobSummary
ImportJobSummary'
            (Maybe Text
 -> Maybe ImportDestination
 -> Maybe JobStatus
 -> Maybe POSIX
 -> ImportJobSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe ImportDestination
      -> Maybe JobStatus -> Maybe POSIX -> ImportJobSummary)
forall (f :: * -> *) a b. Functor 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 ImportDestination
   -> Maybe JobStatus -> Maybe POSIX -> ImportJobSummary)
-> Parser (Maybe ImportDestination)
-> Parser (Maybe JobStatus -> Maybe POSIX -> ImportJobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ImportDestination)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImportDestination")
            Parser (Maybe JobStatus -> Maybe POSIX -> ImportJobSummary)
-> Parser (Maybe JobStatus)
-> Parser (Maybe POSIX -> ImportJobSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"JobStatus")
            Parser (Maybe POSIX -> ImportJobSummary)
-> Parser (Maybe POSIX) -> Parser ImportJobSummary
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
"CreatedTimestamp")
      )

instance Prelude.Hashable ImportJobSummary

instance Prelude.NFData ImportJobSummary