{-# 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.Lens as Lens
import Amazonka.NetworkFirewall.Types.Attachment
import Amazonka.NetworkFirewall.Types.PerObjectStatus
import qualified Amazonka.Prelude as Prelude
data SyncState = SyncState'
{
SyncState -> Maybe (HashMap Text PerObjectStatus)
config :: Prelude.Maybe (Prelude.HashMap Prelude.Text PerObjectStatus),
SyncState -> Maybe Attachment
attachment :: Prelude.Maybe Attachment
}
deriving (SyncState -> SyncState -> Bool
(SyncState -> SyncState -> Bool)
-> (SyncState -> SyncState -> Bool) -> Eq SyncState
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]
(Int -> ReadS SyncState)
-> ReadS [SyncState]
-> ReadPrec SyncState
-> ReadPrec [SyncState]
-> Read 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
(Int -> SyncState -> ShowS)
-> (SyncState -> String)
-> ([SyncState] -> ShowS)
-> Show SyncState
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. SyncState -> Rep SyncState x)
-> (forall x. Rep SyncState x -> SyncState) -> Generic SyncState
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' :: Maybe (HashMap Text PerObjectStatus)
-> Maybe Attachment -> SyncState
SyncState'
{ $sel:config:SyncState' :: Maybe (HashMap Text PerObjectStatus)
config = Maybe (HashMap Text PerObjectStatus)
forall a. Maybe a
Prelude.Nothing,
$sel:attachment:SyncState' :: Maybe Attachment
attachment = Maybe Attachment
forall a. Maybe a
Prelude.Nothing
}
syncState_config :: Lens.Lens' SyncState (Prelude.Maybe (Prelude.HashMap Prelude.Text PerObjectStatus))
syncState_config :: (Maybe (HashMap Text PerObjectStatus)
-> f (Maybe (HashMap Text PerObjectStatus)))
-> SyncState -> f SyncState
syncState_config = (SyncState -> Maybe (HashMap Text PerObjectStatus))
-> (SyncState -> Maybe (HashMap Text PerObjectStatus) -> SyncState)
-> Lens
SyncState
SyncState
(Maybe (HashMap Text PerObjectStatus))
(Maybe (HashMap Text PerObjectStatus))
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) ((Maybe (HashMap Text PerObjectStatus)
-> f (Maybe (HashMap Text PerObjectStatus)))
-> SyncState -> f SyncState)
-> ((Maybe (HashMap Text PerObjectStatus)
-> f (Maybe (HashMap Text PerObjectStatus)))
-> Maybe (HashMap Text PerObjectStatus)
-> f (Maybe (HashMap Text PerObjectStatus)))
-> (Maybe (HashMap Text PerObjectStatus)
-> f (Maybe (HashMap Text PerObjectStatus)))
-> SyncState
-> f SyncState
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text PerObjectStatus)
(HashMap Text PerObjectStatus)
(HashMap Text PerObjectStatus)
(HashMap Text PerObjectStatus)
-> Iso
(Maybe (HashMap Text PerObjectStatus))
(Maybe (HashMap Text PerObjectStatus))
(Maybe (HashMap Text PerObjectStatus))
(Maybe (HashMap Text PerObjectStatus))
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
(HashMap Text PerObjectStatus)
(HashMap Text PerObjectStatus)
(HashMap Text PerObjectStatus)
(HashMap Text PerObjectStatus)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
syncState_attachment :: Lens.Lens' SyncState (Prelude.Maybe Attachment)
syncState_attachment :: (Maybe Attachment -> f (Maybe Attachment))
-> SyncState -> f SyncState
syncState_attachment = (SyncState -> Maybe Attachment)
-> (SyncState -> Maybe Attachment -> SyncState)
-> Lens SyncState SyncState (Maybe Attachment) (Maybe 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)
instance Core.FromJSON SyncState where
parseJSON :: Value -> Parser SyncState
parseJSON =
String -> (Object -> Parser SyncState) -> Value -> Parser SyncState
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SyncState"
( \Object
x ->
Maybe (HashMap Text PerObjectStatus)
-> Maybe Attachment -> SyncState
SyncState'
(Maybe (HashMap Text PerObjectStatus)
-> Maybe Attachment -> SyncState)
-> Parser (Maybe (HashMap Text PerObjectStatus))
-> Parser (Maybe Attachment -> SyncState)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe (Maybe (HashMap Text PerObjectStatus)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Config" Parser (Maybe (Maybe (HashMap Text PerObjectStatus)))
-> Maybe (HashMap Text PerObjectStatus)
-> Parser (Maybe (HashMap Text PerObjectStatus))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text PerObjectStatus)
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Attachment -> SyncState)
-> Parser (Maybe Attachment) -> Parser SyncState
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Attachment)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Attachment")
)
instance Prelude.Hashable SyncState
instance Prelude.NFData SyncState