{-# 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.Device where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Panorama.Types.DeviceStatus
import qualified Amazonka.Prelude as Prelude
data Device = Device'
{
Device -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
Device -> Maybe DeviceStatus
provisioningStatus :: Prelude.Maybe DeviceStatus,
Device -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
Device -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Device -> Maybe Text
deviceId :: Prelude.Maybe Prelude.Text,
Device -> Maybe POSIX
leaseExpirationTime :: Prelude.Maybe Core.POSIX
}
deriving (Device -> Device -> Bool
(Device -> Device -> Bool)
-> (Device -> Device -> Bool) -> Eq Device
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Device -> Device -> Bool
$c/= :: Device -> Device -> Bool
== :: Device -> Device -> Bool
$c== :: Device -> Device -> Bool
Prelude.Eq, ReadPrec [Device]
ReadPrec Device
Int -> ReadS Device
ReadS [Device]
(Int -> ReadS Device)
-> ReadS [Device]
-> ReadPrec Device
-> ReadPrec [Device]
-> Read Device
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Device]
$creadListPrec :: ReadPrec [Device]
readPrec :: ReadPrec Device
$creadPrec :: ReadPrec Device
readList :: ReadS [Device]
$creadList :: ReadS [Device]
readsPrec :: Int -> ReadS Device
$creadsPrec :: Int -> ReadS Device
Prelude.Read, Int -> Device -> ShowS
[Device] -> ShowS
Device -> String
(Int -> Device -> ShowS)
-> (Device -> String) -> ([Device] -> ShowS) -> Show Device
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Device] -> ShowS
$cshowList :: [Device] -> ShowS
show :: Device -> String
$cshow :: Device -> String
showsPrec :: Int -> Device -> ShowS
$cshowsPrec :: Int -> Device -> ShowS
Prelude.Show, (forall x. Device -> Rep Device x)
-> (forall x. Rep Device x -> Device) -> Generic Device
forall x. Rep Device x -> Device
forall x. Device -> Rep Device x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Device x -> Device
$cfrom :: forall x. Device -> Rep Device x
Prelude.Generic)
newDevice ::
Device
newDevice :: Device
newDevice =
Device' :: Maybe POSIX
-> Maybe DeviceStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Device
Device'
{ $sel:lastUpdatedTime:Device' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:provisioningStatus:Device' :: Maybe DeviceStatus
provisioningStatus = Maybe DeviceStatus
forall a. Maybe a
Prelude.Nothing,
$sel:createdTime:Device' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:name:Device' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deviceId:Device' :: Maybe Text
deviceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:leaseExpirationTime:Device' :: Maybe POSIX
leaseExpirationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
device_lastUpdatedTime :: Lens.Lens' Device (Prelude.Maybe Prelude.UTCTime)
device_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Device -> f Device
device_lastUpdatedTime = (Device -> Maybe POSIX)
-> (Device -> Maybe POSIX -> Device)
-> Lens Device Device (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:Device' :: Device -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: Device
s@Device' {} Maybe POSIX
a -> Device
s {$sel:lastUpdatedTime:Device' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: Device) ((Maybe POSIX -> f (Maybe POSIX)) -> Device -> f Device)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Device
-> f Device
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
device_provisioningStatus :: Lens.Lens' Device (Prelude.Maybe DeviceStatus)
device_provisioningStatus :: (Maybe DeviceStatus -> f (Maybe DeviceStatus))
-> Device -> f Device
device_provisioningStatus = (Device -> Maybe DeviceStatus)
-> (Device -> Maybe DeviceStatus -> Device)
-> Lens Device Device (Maybe DeviceStatus) (Maybe DeviceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe DeviceStatus
provisioningStatus :: Maybe DeviceStatus
$sel:provisioningStatus:Device' :: Device -> Maybe DeviceStatus
provisioningStatus} -> Maybe DeviceStatus
provisioningStatus) (\s :: Device
s@Device' {} Maybe DeviceStatus
a -> Device
s {$sel:provisioningStatus:Device' :: Maybe DeviceStatus
provisioningStatus = Maybe DeviceStatus
a} :: Device)
device_createdTime :: Lens.Lens' Device (Prelude.Maybe Prelude.UTCTime)
device_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Device -> f Device
device_createdTime = (Device -> Maybe POSIX)
-> (Device -> Maybe POSIX -> Device)
-> Lens Device Device (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:Device' :: Device -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: Device
s@Device' {} Maybe POSIX
a -> Device
s {$sel:createdTime:Device' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: Device) ((Maybe POSIX -> f (Maybe POSIX)) -> Device -> f Device)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Device
-> f Device
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
device_name :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_name :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_name = (Device -> Maybe Text)
-> (Device -> Maybe Text -> Device)
-> Lens Device Device (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe Text
name :: Maybe Text
$sel:name:Device' :: Device -> Maybe Text
name} -> Maybe Text
name) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:name:Device' :: Maybe Text
name = Maybe Text
a} :: Device)
device_deviceId :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_deviceId :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_deviceId = (Device -> Maybe Text)
-> (Device -> Maybe Text -> Device)
-> Lens Device Device (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe Text
deviceId :: Maybe Text
$sel:deviceId:Device' :: Device -> Maybe Text
deviceId} -> Maybe Text
deviceId) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:deviceId:Device' :: Maybe Text
deviceId = Maybe Text
a} :: Device)
device_leaseExpirationTime :: Lens.Lens' Device (Prelude.Maybe Prelude.UTCTime)
device_leaseExpirationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Device -> f Device
device_leaseExpirationTime = (Device -> Maybe POSIX)
-> (Device -> Maybe POSIX -> Device)
-> Lens Device Device (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe POSIX
leaseExpirationTime :: Maybe POSIX
$sel:leaseExpirationTime:Device' :: Device -> Maybe POSIX
leaseExpirationTime} -> Maybe POSIX
leaseExpirationTime) (\s :: Device
s@Device' {} Maybe POSIX
a -> Device
s {$sel:leaseExpirationTime:Device' :: Maybe POSIX
leaseExpirationTime = Maybe POSIX
a} :: Device) ((Maybe POSIX -> f (Maybe POSIX)) -> Device -> f Device)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Device
-> f Device
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 Device where
parseJSON :: Value -> Parser Device
parseJSON =
String -> (Object -> Parser Device) -> Value -> Parser Device
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Device"
( \Object
x ->
Maybe POSIX
-> Maybe DeviceStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Device
Device'
(Maybe POSIX
-> Maybe DeviceStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Device)
-> Parser (Maybe POSIX)
-> Parser
(Maybe DeviceStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Device)
forall (f :: * -> *) a b. Functor 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 DeviceStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Device)
-> Parser (Maybe DeviceStatus)
-> Parser
(Maybe POSIX -> Maybe Text -> Maybe Text -> Maybe POSIX -> Device)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeviceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProvisioningStatus")
Parser
(Maybe POSIX -> Maybe Text -> Maybe Text -> Maybe POSIX -> Device)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> Device)
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 -> Maybe POSIX -> Device)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> Device)
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
"Name")
Parser (Maybe Text -> Maybe POSIX -> Device)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> Device)
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")
Parser (Maybe POSIX -> Device)
-> Parser (Maybe POSIX) -> Parser Device
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
"LeaseExpirationTime")
)
instance Prelude.Hashable Device
instance Prelude.NFData Device