{-# 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.SimSpaceWeaver.Types.LiveSimulationState where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SimSpaceWeaver.Types.Domain
import Amazonka.SimSpaceWeaver.Types.SimulationClock
data LiveSimulationState = LiveSimulationState'
{
LiveSimulationState -> Maybe [SimulationClock]
clocks :: Prelude.Maybe [SimulationClock],
LiveSimulationState -> Maybe [Domain]
domains :: Prelude.Maybe [Domain]
}
deriving (LiveSimulationState -> LiveSimulationState -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LiveSimulationState -> LiveSimulationState -> Bool
$c/= :: LiveSimulationState -> LiveSimulationState -> Bool
== :: LiveSimulationState -> LiveSimulationState -> Bool
$c== :: LiveSimulationState -> LiveSimulationState -> Bool
Prelude.Eq, ReadPrec [LiveSimulationState]
ReadPrec LiveSimulationState
Int -> ReadS LiveSimulationState
ReadS [LiveSimulationState]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LiveSimulationState]
$creadListPrec :: ReadPrec [LiveSimulationState]
readPrec :: ReadPrec LiveSimulationState
$creadPrec :: ReadPrec LiveSimulationState
readList :: ReadS [LiveSimulationState]
$creadList :: ReadS [LiveSimulationState]
readsPrec :: Int -> ReadS LiveSimulationState
$creadsPrec :: Int -> ReadS LiveSimulationState
Prelude.Read, Int -> LiveSimulationState -> ShowS
[LiveSimulationState] -> ShowS
LiveSimulationState -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LiveSimulationState] -> ShowS
$cshowList :: [LiveSimulationState] -> ShowS
show :: LiveSimulationState -> String
$cshow :: LiveSimulationState -> String
showsPrec :: Int -> LiveSimulationState -> ShowS
$cshowsPrec :: Int -> LiveSimulationState -> ShowS
Prelude.Show, forall x. Rep LiveSimulationState x -> LiveSimulationState
forall x. LiveSimulationState -> Rep LiveSimulationState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LiveSimulationState x -> LiveSimulationState
$cfrom :: forall x. LiveSimulationState -> Rep LiveSimulationState x
Prelude.Generic)
newLiveSimulationState ::
LiveSimulationState
newLiveSimulationState :: LiveSimulationState
newLiveSimulationState =
LiveSimulationState'
{ $sel:clocks:LiveSimulationState' :: Maybe [SimulationClock]
clocks = forall a. Maybe a
Prelude.Nothing,
$sel:domains:LiveSimulationState' :: Maybe [Domain]
domains = forall a. Maybe a
Prelude.Nothing
}
liveSimulationState_clocks :: Lens.Lens' LiveSimulationState (Prelude.Maybe [SimulationClock])
liveSimulationState_clocks :: Lens' LiveSimulationState (Maybe [SimulationClock])
liveSimulationState_clocks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LiveSimulationState' {Maybe [SimulationClock]
clocks :: Maybe [SimulationClock]
$sel:clocks:LiveSimulationState' :: LiveSimulationState -> Maybe [SimulationClock]
clocks} -> Maybe [SimulationClock]
clocks) (\s :: LiveSimulationState
s@LiveSimulationState' {} Maybe [SimulationClock]
a -> LiveSimulationState
s {$sel:clocks:LiveSimulationState' :: Maybe [SimulationClock]
clocks = Maybe [SimulationClock]
a} :: LiveSimulationState) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
liveSimulationState_domains :: Lens.Lens' LiveSimulationState (Prelude.Maybe [Domain])
liveSimulationState_domains :: Lens' LiveSimulationState (Maybe [Domain])
liveSimulationState_domains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LiveSimulationState' {Maybe [Domain]
domains :: Maybe [Domain]
$sel:domains:LiveSimulationState' :: LiveSimulationState -> Maybe [Domain]
domains} -> Maybe [Domain]
domains) (\s :: LiveSimulationState
s@LiveSimulationState' {} Maybe [Domain]
a -> LiveSimulationState
s {$sel:domains:LiveSimulationState' :: Maybe [Domain]
domains = Maybe [Domain]
a} :: LiveSimulationState) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON LiveSimulationState where
parseJSON :: Value -> Parser LiveSimulationState
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"LiveSimulationState"
( \Object
x ->
Maybe [SimulationClock] -> Maybe [Domain] -> LiveSimulationState
LiveSimulationState'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Clocks" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Domains" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable LiveSimulationState where
hashWithSalt :: Int -> LiveSimulationState -> Int
hashWithSalt Int
_salt LiveSimulationState' {Maybe [Domain]
Maybe [SimulationClock]
domains :: Maybe [Domain]
clocks :: Maybe [SimulationClock]
$sel:domains:LiveSimulationState' :: LiveSimulationState -> Maybe [Domain]
$sel:clocks:LiveSimulationState' :: LiveSimulationState -> Maybe [SimulationClock]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SimulationClock]
clocks
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Domain]
domains
instance Prelude.NFData LiveSimulationState where
rnf :: LiveSimulationState -> ()
rnf LiveSimulationState' {Maybe [Domain]
Maybe [SimulationClock]
domains :: Maybe [Domain]
clocks :: Maybe [SimulationClock]
$sel:domains:LiveSimulationState' :: LiveSimulationState -> Maybe [Domain]
$sel:clocks:LiveSimulationState' :: LiveSimulationState -> Maybe [SimulationClock]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [SimulationClock]
clocks
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Domain]
domains