{-# 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.Panorama.Types.PackageImportJob
-- 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.Panorama.Types.PackageImportJob where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Panorama.Types.PackageImportJobStatus
import Amazonka.Panorama.Types.PackageImportJobType
import qualified Amazonka.Prelude as Prelude

-- | A job to import a package version.
--
-- /See:/ 'newPackageImportJob' smart constructor.
data PackageImportJob = PackageImportJob'
  { -- | The job\'s status.
    PackageImportJob -> Maybe PackageImportJobStatus
status :: Prelude.Maybe PackageImportJobStatus,
    -- | The job\'s type.
    PackageImportJob -> Maybe PackageImportJobType
jobType :: Prelude.Maybe PackageImportJobType,
    -- | When the job was updated.
    PackageImportJob -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | The job\'s ID.
    PackageImportJob -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | When the job was created.
    PackageImportJob -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | The job\'s status message.
    PackageImportJob -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (PackageImportJob -> PackageImportJob -> Bool
(PackageImportJob -> PackageImportJob -> Bool)
-> (PackageImportJob -> PackageImportJob -> Bool)
-> Eq PackageImportJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageImportJob -> PackageImportJob -> Bool
$c/= :: PackageImportJob -> PackageImportJob -> Bool
== :: PackageImportJob -> PackageImportJob -> Bool
$c== :: PackageImportJob -> PackageImportJob -> Bool
Prelude.Eq, ReadPrec [PackageImportJob]
ReadPrec PackageImportJob
Int -> ReadS PackageImportJob
ReadS [PackageImportJob]
(Int -> ReadS PackageImportJob)
-> ReadS [PackageImportJob]
-> ReadPrec PackageImportJob
-> ReadPrec [PackageImportJob]
-> Read PackageImportJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PackageImportJob]
$creadListPrec :: ReadPrec [PackageImportJob]
readPrec :: ReadPrec PackageImportJob
$creadPrec :: ReadPrec PackageImportJob
readList :: ReadS [PackageImportJob]
$creadList :: ReadS [PackageImportJob]
readsPrec :: Int -> ReadS PackageImportJob
$creadsPrec :: Int -> ReadS PackageImportJob
Prelude.Read, Int -> PackageImportJob -> ShowS
[PackageImportJob] -> ShowS
PackageImportJob -> String
(Int -> PackageImportJob -> ShowS)
-> (PackageImportJob -> String)
-> ([PackageImportJob] -> ShowS)
-> Show PackageImportJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackageImportJob] -> ShowS
$cshowList :: [PackageImportJob] -> ShowS
show :: PackageImportJob -> String
$cshow :: PackageImportJob -> String
showsPrec :: Int -> PackageImportJob -> ShowS
$cshowsPrec :: Int -> PackageImportJob -> ShowS
Prelude.Show, (forall x. PackageImportJob -> Rep PackageImportJob x)
-> (forall x. Rep PackageImportJob x -> PackageImportJob)
-> Generic PackageImportJob
forall x. Rep PackageImportJob x -> PackageImportJob
forall x. PackageImportJob -> Rep PackageImportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PackageImportJob x -> PackageImportJob
$cfrom :: forall x. PackageImportJob -> Rep PackageImportJob x
Prelude.Generic)

-- |
-- Create a value of 'PackageImportJob' 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', 'packageImportJob_status' - The job\'s status.
--
-- 'jobType', 'packageImportJob_jobType' - The job\'s type.
--
-- 'lastUpdatedTime', 'packageImportJob_lastUpdatedTime' - When the job was updated.
--
-- 'jobId', 'packageImportJob_jobId' - The job\'s ID.
--
-- 'createdTime', 'packageImportJob_createdTime' - When the job was created.
--
-- 'statusMessage', 'packageImportJob_statusMessage' - The job\'s status message.
newPackageImportJob ::
  PackageImportJob
newPackageImportJob :: PackageImportJob
newPackageImportJob =
  PackageImportJob' :: Maybe PackageImportJobStatus
-> Maybe PackageImportJobType
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> PackageImportJob
PackageImportJob'
    { $sel:status:PackageImportJob' :: Maybe PackageImportJobStatus
status = Maybe PackageImportJobStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:jobType:PackageImportJob' :: Maybe PackageImportJobType
jobType = Maybe PackageImportJobType
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:PackageImportJob' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:PackageImportJob' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:PackageImportJob' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:PackageImportJob' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The job\'s status.
packageImportJob_status :: Lens.Lens' PackageImportJob (Prelude.Maybe PackageImportJobStatus)
packageImportJob_status :: (Maybe PackageImportJobStatus -> f (Maybe PackageImportJobStatus))
-> PackageImportJob -> f PackageImportJob
packageImportJob_status = (PackageImportJob -> Maybe PackageImportJobStatus)
-> (PackageImportJob
    -> Maybe PackageImportJobStatus -> PackageImportJob)
-> Lens
     PackageImportJob
     PackageImportJob
     (Maybe PackageImportJobStatus)
     (Maybe PackageImportJobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageImportJob' {Maybe PackageImportJobStatus
status :: Maybe PackageImportJobStatus
$sel:status:PackageImportJob' :: PackageImportJob -> Maybe PackageImportJobStatus
status} -> Maybe PackageImportJobStatus
status) (\s :: PackageImportJob
s@PackageImportJob' {} Maybe PackageImportJobStatus
a -> PackageImportJob
s {$sel:status:PackageImportJob' :: Maybe PackageImportJobStatus
status = Maybe PackageImportJobStatus
a} :: PackageImportJob)

-- | The job\'s type.
packageImportJob_jobType :: Lens.Lens' PackageImportJob (Prelude.Maybe PackageImportJobType)
packageImportJob_jobType :: (Maybe PackageImportJobType -> f (Maybe PackageImportJobType))
-> PackageImportJob -> f PackageImportJob
packageImportJob_jobType = (PackageImportJob -> Maybe PackageImportJobType)
-> (PackageImportJob
    -> Maybe PackageImportJobType -> PackageImportJob)
-> Lens
     PackageImportJob
     PackageImportJob
     (Maybe PackageImportJobType)
     (Maybe PackageImportJobType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageImportJob' {Maybe PackageImportJobType
jobType :: Maybe PackageImportJobType
$sel:jobType:PackageImportJob' :: PackageImportJob -> Maybe PackageImportJobType
jobType} -> Maybe PackageImportJobType
jobType) (\s :: PackageImportJob
s@PackageImportJob' {} Maybe PackageImportJobType
a -> PackageImportJob
s {$sel:jobType:PackageImportJob' :: Maybe PackageImportJobType
jobType = Maybe PackageImportJobType
a} :: PackageImportJob)

-- | When the job was updated.
packageImportJob_lastUpdatedTime :: Lens.Lens' PackageImportJob (Prelude.Maybe Prelude.UTCTime)
packageImportJob_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PackageImportJob -> f PackageImportJob
packageImportJob_lastUpdatedTime = (PackageImportJob -> Maybe POSIX)
-> (PackageImportJob -> Maybe POSIX -> PackageImportJob)
-> Lens
     PackageImportJob PackageImportJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageImportJob' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:PackageImportJob' :: PackageImportJob -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: PackageImportJob
s@PackageImportJob' {} Maybe POSIX
a -> PackageImportJob
s {$sel:lastUpdatedTime:PackageImportJob' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: PackageImportJob) ((Maybe POSIX -> f (Maybe POSIX))
 -> PackageImportJob -> f PackageImportJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PackageImportJob
-> f PackageImportJob
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 job\'s ID.
packageImportJob_jobId :: Lens.Lens' PackageImportJob (Prelude.Maybe Prelude.Text)
packageImportJob_jobId :: (Maybe Text -> f (Maybe Text))
-> PackageImportJob -> f PackageImportJob
packageImportJob_jobId = (PackageImportJob -> Maybe Text)
-> (PackageImportJob -> Maybe Text -> PackageImportJob)
-> Lens PackageImportJob PackageImportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageImportJob' {Maybe Text
jobId :: Maybe Text
$sel:jobId:PackageImportJob' :: PackageImportJob -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: PackageImportJob
s@PackageImportJob' {} Maybe Text
a -> PackageImportJob
s {$sel:jobId:PackageImportJob' :: Maybe Text
jobId = Maybe Text
a} :: PackageImportJob)

-- | When the job was created.
packageImportJob_createdTime :: Lens.Lens' PackageImportJob (Prelude.Maybe Prelude.UTCTime)
packageImportJob_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PackageImportJob -> f PackageImportJob
packageImportJob_createdTime = (PackageImportJob -> Maybe POSIX)
-> (PackageImportJob -> Maybe POSIX -> PackageImportJob)
-> Lens
     PackageImportJob PackageImportJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageImportJob' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:PackageImportJob' :: PackageImportJob -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: PackageImportJob
s@PackageImportJob' {} Maybe POSIX
a -> PackageImportJob
s {$sel:createdTime:PackageImportJob' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: PackageImportJob) ((Maybe POSIX -> f (Maybe POSIX))
 -> PackageImportJob -> f PackageImportJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PackageImportJob
-> f PackageImportJob
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 job\'s status message.
packageImportJob_statusMessage :: Lens.Lens' PackageImportJob (Prelude.Maybe Prelude.Text)
packageImportJob_statusMessage :: (Maybe Text -> f (Maybe Text))
-> PackageImportJob -> f PackageImportJob
packageImportJob_statusMessage = (PackageImportJob -> Maybe Text)
-> (PackageImportJob -> Maybe Text -> PackageImportJob)
-> Lens PackageImportJob PackageImportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageImportJob' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:PackageImportJob' :: PackageImportJob -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: PackageImportJob
s@PackageImportJob' {} Maybe Text
a -> PackageImportJob
s {$sel:statusMessage:PackageImportJob' :: Maybe Text
statusMessage = Maybe Text
a} :: PackageImportJob)

instance Core.FromJSON PackageImportJob where
  parseJSON :: Value -> Parser PackageImportJob
parseJSON =
    String
-> (Object -> Parser PackageImportJob)
-> Value
-> Parser PackageImportJob
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PackageImportJob"
      ( \Object
x ->
          Maybe PackageImportJobStatus
-> Maybe PackageImportJobType
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> PackageImportJob
PackageImportJob'
            (Maybe PackageImportJobStatus
 -> Maybe PackageImportJobType
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> PackageImportJob)
-> Parser (Maybe PackageImportJobStatus)
-> Parser
     (Maybe PackageImportJobType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> PackageImportJob)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe PackageImportJobStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe PackageImportJobType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> PackageImportJob)
-> Parser (Maybe PackageImportJobType)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe POSIX -> Maybe Text -> PackageImportJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PackageImportJobType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"JobType")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe POSIX -> Maybe Text -> PackageImportJob)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe POSIX -> Maybe Text -> PackageImportJob)
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
"LastUpdatedTime")
            Parser
  (Maybe Text -> Maybe POSIX -> Maybe Text -> PackageImportJob)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> PackageImportJob)
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 POSIX -> Maybe Text -> PackageImportJob)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> PackageImportJob)
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
"CreatedTime")
            Parser (Maybe Text -> PackageImportJob)
-> Parser (Maybe Text) -> Parser PackageImportJob
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
"StatusMessage")
      )

instance Prelude.Hashable PackageImportJob

instance Prelude.NFData PackageImportJob