{-# 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 #-}
module Amazonka.Panorama.Types.DeviceJob where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DeviceJob = DeviceJob'
{
DeviceJob -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
DeviceJob -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
DeviceJob -> Maybe Text
deviceName :: Prelude.Maybe Prelude.Text,
DeviceJob -> Maybe Text
deviceId :: Prelude.Maybe Prelude.Text
}
deriving (DeviceJob -> DeviceJob -> Bool
(DeviceJob -> DeviceJob -> Bool)
-> (DeviceJob -> DeviceJob -> Bool) -> Eq DeviceJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceJob -> DeviceJob -> Bool
$c/= :: DeviceJob -> DeviceJob -> Bool
== :: DeviceJob -> DeviceJob -> Bool
$c== :: DeviceJob -> DeviceJob -> Bool
Prelude.Eq, ReadPrec [DeviceJob]
ReadPrec DeviceJob
Int -> ReadS DeviceJob
ReadS [DeviceJob]
(Int -> ReadS DeviceJob)
-> ReadS [DeviceJob]
-> ReadPrec DeviceJob
-> ReadPrec [DeviceJob]
-> Read DeviceJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeviceJob]
$creadListPrec :: ReadPrec [DeviceJob]
readPrec :: ReadPrec DeviceJob
$creadPrec :: ReadPrec DeviceJob
readList :: ReadS [DeviceJob]
$creadList :: ReadS [DeviceJob]
readsPrec :: Int -> ReadS DeviceJob
$creadsPrec :: Int -> ReadS DeviceJob
Prelude.Read, Int -> DeviceJob -> ShowS
[DeviceJob] -> ShowS
DeviceJob -> String
(Int -> DeviceJob -> ShowS)
-> (DeviceJob -> String)
-> ([DeviceJob] -> ShowS)
-> Show DeviceJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceJob] -> ShowS
$cshowList :: [DeviceJob] -> ShowS
show :: DeviceJob -> String
$cshow :: DeviceJob -> String
showsPrec :: Int -> DeviceJob -> ShowS
$cshowsPrec :: Int -> DeviceJob -> ShowS
Prelude.Show, (forall x. DeviceJob -> Rep DeviceJob x)
-> (forall x. Rep DeviceJob x -> DeviceJob) -> Generic DeviceJob
forall x. Rep DeviceJob x -> DeviceJob
forall x. DeviceJob -> Rep DeviceJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeviceJob x -> DeviceJob
$cfrom :: forall x. DeviceJob -> Rep DeviceJob x
Prelude.Generic)
newDeviceJob ::
DeviceJob
newDeviceJob :: DeviceJob
newDeviceJob =
DeviceJob' :: Maybe Text -> Maybe POSIX -> Maybe Text -> Maybe Text -> DeviceJob
DeviceJob'
{ $sel:jobId:DeviceJob' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdTime:DeviceJob' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:deviceName:DeviceJob' :: Maybe Text
deviceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deviceId:DeviceJob' :: Maybe Text
deviceId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deviceJob_jobId :: Lens.Lens' DeviceJob (Prelude.Maybe Prelude.Text)
deviceJob_jobId :: (Maybe Text -> f (Maybe Text)) -> DeviceJob -> f DeviceJob
deviceJob_jobId = (DeviceJob -> Maybe Text)
-> (DeviceJob -> Maybe Text -> DeviceJob)
-> Lens DeviceJob DeviceJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceJob' {Maybe Text
jobId :: Maybe Text
$sel:jobId:DeviceJob' :: DeviceJob -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: DeviceJob
s@DeviceJob' {} Maybe Text
a -> DeviceJob
s {$sel:jobId:DeviceJob' :: Maybe Text
jobId = Maybe Text
a} :: DeviceJob)
deviceJob_createdTime :: Lens.Lens' DeviceJob (Prelude.Maybe Prelude.UTCTime)
deviceJob_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> DeviceJob -> f DeviceJob
deviceJob_createdTime = (DeviceJob -> Maybe POSIX)
-> (DeviceJob -> Maybe POSIX -> DeviceJob)
-> Lens DeviceJob DeviceJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceJob' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:DeviceJob' :: DeviceJob -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: DeviceJob
s@DeviceJob' {} Maybe POSIX
a -> DeviceJob
s {$sel:createdTime:DeviceJob' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: DeviceJob) ((Maybe POSIX -> f (Maybe POSIX)) -> DeviceJob -> f DeviceJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DeviceJob
-> f DeviceJob
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
deviceJob_deviceName :: Lens.Lens' DeviceJob (Prelude.Maybe Prelude.Text)
deviceJob_deviceName :: (Maybe Text -> f (Maybe Text)) -> DeviceJob -> f DeviceJob
deviceJob_deviceName = (DeviceJob -> Maybe Text)
-> (DeviceJob -> Maybe Text -> DeviceJob)
-> Lens DeviceJob DeviceJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceJob' {Maybe Text
deviceName :: Maybe Text
$sel:deviceName:DeviceJob' :: DeviceJob -> Maybe Text
deviceName} -> Maybe Text
deviceName) (\s :: DeviceJob
s@DeviceJob' {} Maybe Text
a -> DeviceJob
s {$sel:deviceName:DeviceJob' :: Maybe Text
deviceName = Maybe Text
a} :: DeviceJob)
deviceJob_deviceId :: Lens.Lens' DeviceJob (Prelude.Maybe Prelude.Text)
deviceJob_deviceId :: (Maybe Text -> f (Maybe Text)) -> DeviceJob -> f DeviceJob
deviceJob_deviceId = (DeviceJob -> Maybe Text)
-> (DeviceJob -> Maybe Text -> DeviceJob)
-> Lens DeviceJob DeviceJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceJob' {Maybe Text
deviceId :: Maybe Text
$sel:deviceId:DeviceJob' :: DeviceJob -> Maybe Text
deviceId} -> Maybe Text
deviceId) (\s :: DeviceJob
s@DeviceJob' {} Maybe Text
a -> DeviceJob
s {$sel:deviceId:DeviceJob' :: Maybe Text
deviceId = Maybe Text
a} :: DeviceJob)
instance Core.FromJSON DeviceJob where
parseJSON :: Value -> Parser DeviceJob
parseJSON =
String -> (Object -> Parser DeviceJob) -> Value -> Parser DeviceJob
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DeviceJob"
( \Object
x ->
Maybe Text -> Maybe POSIX -> Maybe Text -> Maybe Text -> DeviceJob
DeviceJob'
(Maybe Text
-> Maybe POSIX -> Maybe Text -> Maybe Text -> DeviceJob)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> DeviceJob)
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 POSIX -> Maybe Text -> Maybe Text -> DeviceJob)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> DeviceJob)
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 -> Maybe Text -> DeviceJob)
-> Parser (Maybe Text) -> Parser (Maybe Text -> DeviceJob)
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
"DeviceName")
Parser (Maybe Text -> DeviceJob)
-> Parser (Maybe Text) -> Parser DeviceJob
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
"DeviceId")
)
instance Prelude.Hashable DeviceJob
instance Prelude.NFData DeviceJob