{-# 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.NetworkFirewall.Types.SyncState where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.NetworkFirewall.Types.Attachment
import Amazonka.NetworkFirewall.Types.PerObjectStatus
import qualified Amazonka.Prelude as Prelude
data SyncState = SyncState'
{
SyncState -> Maybe Attachment
attachment :: Prelude.Maybe Attachment,
SyncState -> Maybe (HashMap Text PerObjectStatus)
config :: Prelude.Maybe (Prelude.HashMap Prelude.Text PerObjectStatus)
}
deriving (SyncState -> SyncState -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SyncState -> SyncState -> Bool
$c/= :: SyncState -> SyncState -> Bool
== :: SyncState -> SyncState -> Bool
$c== :: SyncState -> SyncState -> Bool
Prelude.Eq, ReadPrec [SyncState]
ReadPrec SyncState
Int -> ReadS SyncState
ReadS [SyncState]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SyncState]
$creadListPrec :: ReadPrec [SyncState]
readPrec :: ReadPrec SyncState
$creadPrec :: ReadPrec SyncState
readList :: ReadS [SyncState]
$creadList :: ReadS [SyncState]
readsPrec :: Int -> ReadS SyncState
$creadsPrec :: Int -> ReadS SyncState
Prelude.Read, Int -> SyncState -> ShowS
[SyncState] -> ShowS
SyncState -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SyncState] -> ShowS
$cshowList :: [SyncState] -> ShowS
show :: SyncState -> String
$cshow :: SyncState -> String
showsPrec :: Int -> SyncState -> ShowS
$cshowsPrec :: Int -> SyncState -> ShowS
Prelude.Show, forall x. Rep SyncState x -> SyncState
forall x. SyncState -> Rep SyncState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SyncState x -> SyncState
$cfrom :: forall x. SyncState -> Rep SyncState x
Prelude.Generic)
newSyncState ::
SyncState
newSyncState :: SyncState
newSyncState =
SyncState'
{ $sel:attachment:SyncState' :: Maybe Attachment
attachment = forall a. Maybe a
Prelude.Nothing,
$sel:config:SyncState' :: Maybe (HashMap Text PerObjectStatus)
config = forall a. Maybe a
Prelude.Nothing
}
syncState_attachment :: Lens.Lens' SyncState (Prelude.Maybe Attachment)
syncState_attachment :: Lens' SyncState (Maybe Attachment)
syncState_attachment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SyncState' {Maybe Attachment
attachment :: Maybe Attachment
$sel:attachment:SyncState' :: SyncState -> Maybe Attachment
attachment} -> Maybe Attachment
attachment) (\s :: SyncState
s@SyncState' {} Maybe Attachment
a -> SyncState
s {$sel:attachment:SyncState' :: Maybe Attachment
attachment = Maybe Attachment
a} :: SyncState)
syncState_config :: Lens.Lens' SyncState (Prelude.Maybe (Prelude.HashMap Prelude.Text PerObjectStatus))
syncState_config :: Lens' SyncState (Maybe (HashMap Text PerObjectStatus))
syncState_config = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SyncState' {Maybe (HashMap Text PerObjectStatus)
config :: Maybe (HashMap Text PerObjectStatus)
$sel:config:SyncState' :: SyncState -> Maybe (HashMap Text PerObjectStatus)
config} -> Maybe (HashMap Text PerObjectStatus)
config) (\s :: SyncState
s@SyncState' {} Maybe (HashMap Text PerObjectStatus)
a -> SyncState
s {$sel:config:SyncState' :: Maybe (HashMap Text PerObjectStatus)
config = Maybe (HashMap Text PerObjectStatus)
a} :: SyncState) 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 SyncState where
parseJSON :: Value -> Parser SyncState
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SyncState"
( \Object
x ->
Maybe Attachment
-> Maybe (HashMap Text PerObjectStatus) -> SyncState
SyncState'
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
"Attachment")
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
"Config" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable SyncState where
hashWithSalt :: Int -> SyncState -> Int
hashWithSalt Int
_salt SyncState' {Maybe (HashMap Text PerObjectStatus)
Maybe Attachment
config :: Maybe (HashMap Text PerObjectStatus)
attachment :: Maybe Attachment
$sel:config:SyncState' :: SyncState -> Maybe (HashMap Text PerObjectStatus)
$sel:attachment:SyncState' :: SyncState -> Maybe Attachment
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Attachment
attachment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text PerObjectStatus)
config
instance Prelude.NFData SyncState where
rnf :: SyncState -> ()
rnf SyncState' {Maybe (HashMap Text PerObjectStatus)
Maybe Attachment
config :: Maybe (HashMap Text PerObjectStatus)
attachment :: Maybe Attachment
$sel:config:SyncState' :: SyncState -> Maybe (HashMap Text PerObjectStatus)
$sel:attachment:SyncState' :: SyncState -> Maybe Attachment
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Attachment
attachment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text PerObjectStatus)
config