{-# 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.SnowDeviceManagement.Types.InstanceSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SnowDeviceManagement.Types.Instance
data InstanceSummary = InstanceSummary'
{
InstanceSummary -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
InstanceSummary -> Maybe Instance
instance' :: Prelude.Maybe Instance
}
deriving (InstanceSummary -> InstanceSummary -> Bool
(InstanceSummary -> InstanceSummary -> Bool)
-> (InstanceSummary -> InstanceSummary -> Bool)
-> Eq InstanceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceSummary -> InstanceSummary -> Bool
$c/= :: InstanceSummary -> InstanceSummary -> Bool
== :: InstanceSummary -> InstanceSummary -> Bool
$c== :: InstanceSummary -> InstanceSummary -> Bool
Prelude.Eq, ReadPrec [InstanceSummary]
ReadPrec InstanceSummary
Int -> ReadS InstanceSummary
ReadS [InstanceSummary]
(Int -> ReadS InstanceSummary)
-> ReadS [InstanceSummary]
-> ReadPrec InstanceSummary
-> ReadPrec [InstanceSummary]
-> Read InstanceSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceSummary]
$creadListPrec :: ReadPrec [InstanceSummary]
readPrec :: ReadPrec InstanceSummary
$creadPrec :: ReadPrec InstanceSummary
readList :: ReadS [InstanceSummary]
$creadList :: ReadS [InstanceSummary]
readsPrec :: Int -> ReadS InstanceSummary
$creadsPrec :: Int -> ReadS InstanceSummary
Prelude.Read, Int -> InstanceSummary -> ShowS
[InstanceSummary] -> ShowS
InstanceSummary -> String
(Int -> InstanceSummary -> ShowS)
-> (InstanceSummary -> String)
-> ([InstanceSummary] -> ShowS)
-> Show InstanceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceSummary] -> ShowS
$cshowList :: [InstanceSummary] -> ShowS
show :: InstanceSummary -> String
$cshow :: InstanceSummary -> String
showsPrec :: Int -> InstanceSummary -> ShowS
$cshowsPrec :: Int -> InstanceSummary -> ShowS
Prelude.Show, (forall x. InstanceSummary -> Rep InstanceSummary x)
-> (forall x. Rep InstanceSummary x -> InstanceSummary)
-> Generic InstanceSummary
forall x. Rep InstanceSummary x -> InstanceSummary
forall x. InstanceSummary -> Rep InstanceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceSummary x -> InstanceSummary
$cfrom :: forall x. InstanceSummary -> Rep InstanceSummary x
Prelude.Generic)
newInstanceSummary ::
InstanceSummary
newInstanceSummary :: InstanceSummary
newInstanceSummary =
InstanceSummary' :: Maybe POSIX -> Maybe Instance -> InstanceSummary
InstanceSummary'
{ $sel:lastUpdatedAt:InstanceSummary' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:instance':InstanceSummary' :: Maybe Instance
instance' = Maybe Instance
forall a. Maybe a
Prelude.Nothing
}
instanceSummary_lastUpdatedAt :: Lens.Lens' InstanceSummary (Prelude.Maybe Prelude.UTCTime)
instanceSummary_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> InstanceSummary -> f InstanceSummary
instanceSummary_lastUpdatedAt = (InstanceSummary -> Maybe POSIX)
-> (InstanceSummary -> Maybe POSIX -> InstanceSummary)
-> Lens InstanceSummary InstanceSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSummary' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:InstanceSummary' :: InstanceSummary -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: InstanceSummary
s@InstanceSummary' {} Maybe POSIX
a -> InstanceSummary
s {$sel:lastUpdatedAt:InstanceSummary' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: InstanceSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> InstanceSummary -> f InstanceSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> InstanceSummary
-> f InstanceSummary
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
instanceSummary_instance :: Lens.Lens' InstanceSummary (Prelude.Maybe Instance)
instanceSummary_instance :: (Maybe Instance -> f (Maybe Instance))
-> InstanceSummary -> f InstanceSummary
instanceSummary_instance = (InstanceSummary -> Maybe Instance)
-> (InstanceSummary -> Maybe Instance -> InstanceSummary)
-> Lens
InstanceSummary InstanceSummary (Maybe Instance) (Maybe Instance)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSummary' {Maybe Instance
instance' :: Maybe Instance
$sel:instance':InstanceSummary' :: InstanceSummary -> Maybe Instance
instance'} -> Maybe Instance
instance') (\s :: InstanceSummary
s@InstanceSummary' {} Maybe Instance
a -> InstanceSummary
s {$sel:instance':InstanceSummary' :: Maybe Instance
instance' = Maybe Instance
a} :: InstanceSummary)
instance Core.FromJSON InstanceSummary where
parseJSON :: Value -> Parser InstanceSummary
parseJSON =
String
-> (Object -> Parser InstanceSummary)
-> Value
-> Parser InstanceSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceSummary"
( \Object
x ->
Maybe POSIX -> Maybe Instance -> InstanceSummary
InstanceSummary'
(Maybe POSIX -> Maybe Instance -> InstanceSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Instance -> InstanceSummary)
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
"lastUpdatedAt")
Parser (Maybe Instance -> InstanceSummary)
-> Parser (Maybe Instance) -> Parser InstanceSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Instance)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"instance")
)
instance Prelude.Hashable InstanceSummary
instance Prelude.NFData InstanceSummary