{-# 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.NodeFromTemplateJob
-- 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.NodeFromTemplateJob where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Panorama.Types.NodeFromTemplateJobStatus
import Amazonka.Panorama.Types.TemplateType
import qualified Amazonka.Prelude as Prelude

-- | A job to create a camera stream node.
--
-- /See:/ 'newNodeFromTemplateJob' smart constructor.
data NodeFromTemplateJob = NodeFromTemplateJob'
  { -- | The job\'s status.
    NodeFromTemplateJob -> Maybe NodeFromTemplateJobStatus
status :: Prelude.Maybe NodeFromTemplateJobStatus,
    -- | The job\'s ID.
    NodeFromTemplateJob -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | When the job was created.
    NodeFromTemplateJob -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | The job\'s template type.
    NodeFromTemplateJob -> Maybe TemplateType
templateType :: Prelude.Maybe TemplateType,
    -- | The node\'s name.
    NodeFromTemplateJob -> Maybe Text
nodeName :: Prelude.Maybe Prelude.Text,
    -- | The job\'s status message.
    NodeFromTemplateJob -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (NodeFromTemplateJob -> NodeFromTemplateJob -> Bool
(NodeFromTemplateJob -> NodeFromTemplateJob -> Bool)
-> (NodeFromTemplateJob -> NodeFromTemplateJob -> Bool)
-> Eq NodeFromTemplateJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NodeFromTemplateJob -> NodeFromTemplateJob -> Bool
$c/= :: NodeFromTemplateJob -> NodeFromTemplateJob -> Bool
== :: NodeFromTemplateJob -> NodeFromTemplateJob -> Bool
$c== :: NodeFromTemplateJob -> NodeFromTemplateJob -> Bool
Prelude.Eq, ReadPrec [NodeFromTemplateJob]
ReadPrec NodeFromTemplateJob
Int -> ReadS NodeFromTemplateJob
ReadS [NodeFromTemplateJob]
(Int -> ReadS NodeFromTemplateJob)
-> ReadS [NodeFromTemplateJob]
-> ReadPrec NodeFromTemplateJob
-> ReadPrec [NodeFromTemplateJob]
-> Read NodeFromTemplateJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NodeFromTemplateJob]
$creadListPrec :: ReadPrec [NodeFromTemplateJob]
readPrec :: ReadPrec NodeFromTemplateJob
$creadPrec :: ReadPrec NodeFromTemplateJob
readList :: ReadS [NodeFromTemplateJob]
$creadList :: ReadS [NodeFromTemplateJob]
readsPrec :: Int -> ReadS NodeFromTemplateJob
$creadsPrec :: Int -> ReadS NodeFromTemplateJob
Prelude.Read, Int -> NodeFromTemplateJob -> ShowS
[NodeFromTemplateJob] -> ShowS
NodeFromTemplateJob -> String
(Int -> NodeFromTemplateJob -> ShowS)
-> (NodeFromTemplateJob -> String)
-> ([NodeFromTemplateJob] -> ShowS)
-> Show NodeFromTemplateJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodeFromTemplateJob] -> ShowS
$cshowList :: [NodeFromTemplateJob] -> ShowS
show :: NodeFromTemplateJob -> String
$cshow :: NodeFromTemplateJob -> String
showsPrec :: Int -> NodeFromTemplateJob -> ShowS
$cshowsPrec :: Int -> NodeFromTemplateJob -> ShowS
Prelude.Show, (forall x. NodeFromTemplateJob -> Rep NodeFromTemplateJob x)
-> (forall x. Rep NodeFromTemplateJob x -> NodeFromTemplateJob)
-> Generic NodeFromTemplateJob
forall x. Rep NodeFromTemplateJob x -> NodeFromTemplateJob
forall x. NodeFromTemplateJob -> Rep NodeFromTemplateJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NodeFromTemplateJob x -> NodeFromTemplateJob
$cfrom :: forall x. NodeFromTemplateJob -> Rep NodeFromTemplateJob x
Prelude.Generic)

-- |
-- Create a value of 'NodeFromTemplateJob' 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', 'nodeFromTemplateJob_status' - The job\'s status.
--
-- 'jobId', 'nodeFromTemplateJob_jobId' - The job\'s ID.
--
-- 'createdTime', 'nodeFromTemplateJob_createdTime' - When the job was created.
--
-- 'templateType', 'nodeFromTemplateJob_templateType' - The job\'s template type.
--
-- 'nodeName', 'nodeFromTemplateJob_nodeName' - The node\'s name.
--
-- 'statusMessage', 'nodeFromTemplateJob_statusMessage' - The job\'s status message.
newNodeFromTemplateJob ::
  NodeFromTemplateJob
newNodeFromTemplateJob :: NodeFromTemplateJob
newNodeFromTemplateJob =
  NodeFromTemplateJob' :: Maybe NodeFromTemplateJobStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe TemplateType
-> Maybe Text
-> Maybe Text
-> NodeFromTemplateJob
NodeFromTemplateJob'
    { $sel:status:NodeFromTemplateJob' :: Maybe NodeFromTemplateJobStatus
status = Maybe NodeFromTemplateJobStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:NodeFromTemplateJob' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:NodeFromTemplateJob' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:templateType:NodeFromTemplateJob' :: Maybe TemplateType
templateType = Maybe TemplateType
forall a. Maybe a
Prelude.Nothing,
      $sel:nodeName:NodeFromTemplateJob' :: Maybe Text
nodeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:NodeFromTemplateJob' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The job\'s ID.
nodeFromTemplateJob_jobId :: Lens.Lens' NodeFromTemplateJob (Prelude.Maybe Prelude.Text)
nodeFromTemplateJob_jobId :: (Maybe Text -> f (Maybe Text))
-> NodeFromTemplateJob -> f NodeFromTemplateJob
nodeFromTemplateJob_jobId = (NodeFromTemplateJob -> Maybe Text)
-> (NodeFromTemplateJob -> Maybe Text -> NodeFromTemplateJob)
-> Lens
     NodeFromTemplateJob NodeFromTemplateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeFromTemplateJob' {Maybe Text
jobId :: Maybe Text
$sel:jobId:NodeFromTemplateJob' :: NodeFromTemplateJob -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: NodeFromTemplateJob
s@NodeFromTemplateJob' {} Maybe Text
a -> NodeFromTemplateJob
s {$sel:jobId:NodeFromTemplateJob' :: Maybe Text
jobId = Maybe Text
a} :: NodeFromTemplateJob)

-- | When the job was created.
nodeFromTemplateJob_createdTime :: Lens.Lens' NodeFromTemplateJob (Prelude.Maybe Prelude.UTCTime)
nodeFromTemplateJob_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> NodeFromTemplateJob -> f NodeFromTemplateJob
nodeFromTemplateJob_createdTime = (NodeFromTemplateJob -> Maybe POSIX)
-> (NodeFromTemplateJob -> Maybe POSIX -> NodeFromTemplateJob)
-> Lens
     NodeFromTemplateJob NodeFromTemplateJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeFromTemplateJob' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:NodeFromTemplateJob' :: NodeFromTemplateJob -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: NodeFromTemplateJob
s@NodeFromTemplateJob' {} Maybe POSIX
a -> NodeFromTemplateJob
s {$sel:createdTime:NodeFromTemplateJob' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: NodeFromTemplateJob) ((Maybe POSIX -> f (Maybe POSIX))
 -> NodeFromTemplateJob -> f NodeFromTemplateJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> NodeFromTemplateJob
-> f NodeFromTemplateJob
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 template type.
nodeFromTemplateJob_templateType :: Lens.Lens' NodeFromTemplateJob (Prelude.Maybe TemplateType)
nodeFromTemplateJob_templateType :: (Maybe TemplateType -> f (Maybe TemplateType))
-> NodeFromTemplateJob -> f NodeFromTemplateJob
nodeFromTemplateJob_templateType = (NodeFromTemplateJob -> Maybe TemplateType)
-> (NodeFromTemplateJob
    -> Maybe TemplateType -> NodeFromTemplateJob)
-> Lens
     NodeFromTemplateJob
     NodeFromTemplateJob
     (Maybe TemplateType)
     (Maybe TemplateType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeFromTemplateJob' {Maybe TemplateType
templateType :: Maybe TemplateType
$sel:templateType:NodeFromTemplateJob' :: NodeFromTemplateJob -> Maybe TemplateType
templateType} -> Maybe TemplateType
templateType) (\s :: NodeFromTemplateJob
s@NodeFromTemplateJob' {} Maybe TemplateType
a -> NodeFromTemplateJob
s {$sel:templateType:NodeFromTemplateJob' :: Maybe TemplateType
templateType = Maybe TemplateType
a} :: NodeFromTemplateJob)

-- | The node\'s name.
nodeFromTemplateJob_nodeName :: Lens.Lens' NodeFromTemplateJob (Prelude.Maybe Prelude.Text)
nodeFromTemplateJob_nodeName :: (Maybe Text -> f (Maybe Text))
-> NodeFromTemplateJob -> f NodeFromTemplateJob
nodeFromTemplateJob_nodeName = (NodeFromTemplateJob -> Maybe Text)
-> (NodeFromTemplateJob -> Maybe Text -> NodeFromTemplateJob)
-> Lens
     NodeFromTemplateJob NodeFromTemplateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeFromTemplateJob' {Maybe Text
nodeName :: Maybe Text
$sel:nodeName:NodeFromTemplateJob' :: NodeFromTemplateJob -> Maybe Text
nodeName} -> Maybe Text
nodeName) (\s :: NodeFromTemplateJob
s@NodeFromTemplateJob' {} Maybe Text
a -> NodeFromTemplateJob
s {$sel:nodeName:NodeFromTemplateJob' :: Maybe Text
nodeName = Maybe Text
a} :: NodeFromTemplateJob)

-- | The job\'s status message.
nodeFromTemplateJob_statusMessage :: Lens.Lens' NodeFromTemplateJob (Prelude.Maybe Prelude.Text)
nodeFromTemplateJob_statusMessage :: (Maybe Text -> f (Maybe Text))
-> NodeFromTemplateJob -> f NodeFromTemplateJob
nodeFromTemplateJob_statusMessage = (NodeFromTemplateJob -> Maybe Text)
-> (NodeFromTemplateJob -> Maybe Text -> NodeFromTemplateJob)
-> Lens
     NodeFromTemplateJob NodeFromTemplateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeFromTemplateJob' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:NodeFromTemplateJob' :: NodeFromTemplateJob -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: NodeFromTemplateJob
s@NodeFromTemplateJob' {} Maybe Text
a -> NodeFromTemplateJob
s {$sel:statusMessage:NodeFromTemplateJob' :: Maybe Text
statusMessage = Maybe Text
a} :: NodeFromTemplateJob)

instance Core.FromJSON NodeFromTemplateJob where
  parseJSON :: Value -> Parser NodeFromTemplateJob
parseJSON =
    String
-> (Object -> Parser NodeFromTemplateJob)
-> Value
-> Parser NodeFromTemplateJob
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NodeFromTemplateJob"
      ( \Object
x ->
          Maybe NodeFromTemplateJobStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe TemplateType
-> Maybe Text
-> Maybe Text
-> NodeFromTemplateJob
NodeFromTemplateJob'
            (Maybe NodeFromTemplateJobStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe TemplateType
 -> Maybe Text
 -> Maybe Text
 -> NodeFromTemplateJob)
-> Parser (Maybe NodeFromTemplateJobStatus)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe TemplateType
      -> Maybe Text
      -> Maybe Text
      -> NodeFromTemplateJob)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe NodeFromTemplateJobStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe TemplateType
   -> Maybe Text
   -> Maybe Text
   -> NodeFromTemplateJob)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe TemplateType
      -> Maybe Text
      -> Maybe Text
      -> NodeFromTemplateJob)
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 TemplateType
   -> Maybe Text
   -> Maybe Text
   -> NodeFromTemplateJob)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe TemplateType
      -> Maybe Text -> Maybe Text -> NodeFromTemplateJob)
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 TemplateType
   -> Maybe Text -> Maybe Text -> NodeFromTemplateJob)
-> Parser (Maybe TemplateType)
-> Parser (Maybe Text -> Maybe Text -> NodeFromTemplateJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TemplateType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TemplateType")
            Parser (Maybe Text -> Maybe Text -> NodeFromTemplateJob)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> NodeFromTemplateJob)
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
"NodeName")
            Parser (Maybe Text -> NodeFromTemplateJob)
-> Parser (Maybe Text) -> Parser NodeFromTemplateJob
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 NodeFromTemplateJob

instance Prelude.NFData NodeFromTemplateJob