{-# 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.FirewallStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkFirewall.Types.ConfigurationSyncState
import Amazonka.NetworkFirewall.Types.FirewallStatusValue
import Amazonka.NetworkFirewall.Types.SyncState
import qualified Amazonka.Prelude as Prelude
data FirewallStatus = FirewallStatus'
{
FirewallStatus -> Maybe (HashMap Text SyncState)
syncStates :: Prelude.Maybe (Prelude.HashMap Prelude.Text SyncState),
FirewallStatus -> FirewallStatusValue
status :: FirewallStatusValue,
FirewallStatus -> ConfigurationSyncState
configurationSyncStateSummary :: ConfigurationSyncState
}
deriving (FirewallStatus -> FirewallStatus -> Bool
(FirewallStatus -> FirewallStatus -> Bool)
-> (FirewallStatus -> FirewallStatus -> Bool) -> Eq FirewallStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FirewallStatus -> FirewallStatus -> Bool
$c/= :: FirewallStatus -> FirewallStatus -> Bool
== :: FirewallStatus -> FirewallStatus -> Bool
$c== :: FirewallStatus -> FirewallStatus -> Bool
Prelude.Eq, ReadPrec [FirewallStatus]
ReadPrec FirewallStatus
Int -> ReadS FirewallStatus
ReadS [FirewallStatus]
(Int -> ReadS FirewallStatus)
-> ReadS [FirewallStatus]
-> ReadPrec FirewallStatus
-> ReadPrec [FirewallStatus]
-> Read FirewallStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FirewallStatus]
$creadListPrec :: ReadPrec [FirewallStatus]
readPrec :: ReadPrec FirewallStatus
$creadPrec :: ReadPrec FirewallStatus
readList :: ReadS [FirewallStatus]
$creadList :: ReadS [FirewallStatus]
readsPrec :: Int -> ReadS FirewallStatus
$creadsPrec :: Int -> ReadS FirewallStatus
Prelude.Read, Int -> FirewallStatus -> ShowS
[FirewallStatus] -> ShowS
FirewallStatus -> String
(Int -> FirewallStatus -> ShowS)
-> (FirewallStatus -> String)
-> ([FirewallStatus] -> ShowS)
-> Show FirewallStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FirewallStatus] -> ShowS
$cshowList :: [FirewallStatus] -> ShowS
show :: FirewallStatus -> String
$cshow :: FirewallStatus -> String
showsPrec :: Int -> FirewallStatus -> ShowS
$cshowsPrec :: Int -> FirewallStatus -> ShowS
Prelude.Show, (forall x. FirewallStatus -> Rep FirewallStatus x)
-> (forall x. Rep FirewallStatus x -> FirewallStatus)
-> Generic FirewallStatus
forall x. Rep FirewallStatus x -> FirewallStatus
forall x. FirewallStatus -> Rep FirewallStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FirewallStatus x -> FirewallStatus
$cfrom :: forall x. FirewallStatus -> Rep FirewallStatus x
Prelude.Generic)
newFirewallStatus ::
FirewallStatusValue ->
ConfigurationSyncState ->
FirewallStatus
newFirewallStatus :: FirewallStatusValue -> ConfigurationSyncState -> FirewallStatus
newFirewallStatus
FirewallStatusValue
pStatus_
ConfigurationSyncState
pConfigurationSyncStateSummary_ =
FirewallStatus' :: Maybe (HashMap Text SyncState)
-> FirewallStatusValue -> ConfigurationSyncState -> FirewallStatus
FirewallStatus'
{ $sel:syncStates:FirewallStatus' :: Maybe (HashMap Text SyncState)
syncStates = Maybe (HashMap Text SyncState)
forall a. Maybe a
Prelude.Nothing,
$sel:status:FirewallStatus' :: FirewallStatusValue
status = FirewallStatusValue
pStatus_,
$sel:configurationSyncStateSummary:FirewallStatus' :: ConfigurationSyncState
configurationSyncStateSummary =
ConfigurationSyncState
pConfigurationSyncStateSummary_
}
firewallStatus_syncStates :: Lens.Lens' FirewallStatus (Prelude.Maybe (Prelude.HashMap Prelude.Text SyncState))
firewallStatus_syncStates :: (Maybe (HashMap Text SyncState)
-> f (Maybe (HashMap Text SyncState)))
-> FirewallStatus -> f FirewallStatus
firewallStatus_syncStates = (FirewallStatus -> Maybe (HashMap Text SyncState))
-> (FirewallStatus
-> Maybe (HashMap Text SyncState) -> FirewallStatus)
-> Lens
FirewallStatus
FirewallStatus
(Maybe (HashMap Text SyncState))
(Maybe (HashMap Text SyncState))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallStatus' {Maybe (HashMap Text SyncState)
syncStates :: Maybe (HashMap Text SyncState)
$sel:syncStates:FirewallStatus' :: FirewallStatus -> Maybe (HashMap Text SyncState)
syncStates} -> Maybe (HashMap Text SyncState)
syncStates) (\s :: FirewallStatus
s@FirewallStatus' {} Maybe (HashMap Text SyncState)
a -> FirewallStatus
s {$sel:syncStates:FirewallStatus' :: Maybe (HashMap Text SyncState)
syncStates = Maybe (HashMap Text SyncState)
a} :: FirewallStatus) ((Maybe (HashMap Text SyncState)
-> f (Maybe (HashMap Text SyncState)))
-> FirewallStatus -> f FirewallStatus)
-> ((Maybe (HashMap Text SyncState)
-> f (Maybe (HashMap Text SyncState)))
-> Maybe (HashMap Text SyncState)
-> f (Maybe (HashMap Text SyncState)))
-> (Maybe (HashMap Text SyncState)
-> f (Maybe (HashMap Text SyncState)))
-> FirewallStatus
-> f FirewallStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text SyncState)
(HashMap Text SyncState)
(HashMap Text SyncState)
(HashMap Text SyncState)
-> Iso
(Maybe (HashMap Text SyncState))
(Maybe (HashMap Text SyncState))
(Maybe (HashMap Text SyncState))
(Maybe (HashMap Text SyncState))
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 SyncState)
(HashMap Text SyncState)
(HashMap Text SyncState)
(HashMap Text SyncState)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
firewallStatus_status :: Lens.Lens' FirewallStatus FirewallStatusValue
firewallStatus_status :: (FirewallStatusValue -> f FirewallStatusValue)
-> FirewallStatus -> f FirewallStatus
firewallStatus_status = (FirewallStatus -> FirewallStatusValue)
-> (FirewallStatus -> FirewallStatusValue -> FirewallStatus)
-> Lens
FirewallStatus
FirewallStatus
FirewallStatusValue
FirewallStatusValue
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallStatus' {FirewallStatusValue
status :: FirewallStatusValue
$sel:status:FirewallStatus' :: FirewallStatus -> FirewallStatusValue
status} -> FirewallStatusValue
status) (\s :: FirewallStatus
s@FirewallStatus' {} FirewallStatusValue
a -> FirewallStatus
s {$sel:status:FirewallStatus' :: FirewallStatusValue
status = FirewallStatusValue
a} :: FirewallStatus)
firewallStatus_configurationSyncStateSummary :: Lens.Lens' FirewallStatus ConfigurationSyncState
firewallStatus_configurationSyncStateSummary :: (ConfigurationSyncState -> f ConfigurationSyncState)
-> FirewallStatus -> f FirewallStatus
firewallStatus_configurationSyncStateSummary = (FirewallStatus -> ConfigurationSyncState)
-> (FirewallStatus -> ConfigurationSyncState -> FirewallStatus)
-> Lens
FirewallStatus
FirewallStatus
ConfigurationSyncState
ConfigurationSyncState
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallStatus' {ConfigurationSyncState
configurationSyncStateSummary :: ConfigurationSyncState
$sel:configurationSyncStateSummary:FirewallStatus' :: FirewallStatus -> ConfigurationSyncState
configurationSyncStateSummary} -> ConfigurationSyncState
configurationSyncStateSummary) (\s :: FirewallStatus
s@FirewallStatus' {} ConfigurationSyncState
a -> FirewallStatus
s {$sel:configurationSyncStateSummary:FirewallStatus' :: ConfigurationSyncState
configurationSyncStateSummary = ConfigurationSyncState
a} :: FirewallStatus)
instance Core.FromJSON FirewallStatus where
parseJSON :: Value -> Parser FirewallStatus
parseJSON =
String
-> (Object -> Parser FirewallStatus)
-> Value
-> Parser FirewallStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FirewallStatus"
( \Object
x ->
Maybe (HashMap Text SyncState)
-> FirewallStatusValue -> ConfigurationSyncState -> FirewallStatus
FirewallStatus'
(Maybe (HashMap Text SyncState)
-> FirewallStatusValue -> ConfigurationSyncState -> FirewallStatus)
-> Parser (Maybe (HashMap Text SyncState))
-> Parser
(FirewallStatusValue -> ConfigurationSyncState -> FirewallStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text SyncState)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SyncStates" Parser (Maybe (Maybe (HashMap Text SyncState)))
-> Maybe (HashMap Text SyncState)
-> Parser (Maybe (HashMap Text SyncState))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text SyncState)
forall a. Monoid a => a
Prelude.mempty)
Parser
(FirewallStatusValue -> ConfigurationSyncState -> FirewallStatus)
-> Parser FirewallStatusValue
-> Parser (ConfigurationSyncState -> FirewallStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser FirewallStatusValue
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Status")
Parser (ConfigurationSyncState -> FirewallStatus)
-> Parser ConfigurationSyncState -> Parser FirewallStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ConfigurationSyncState
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ConfigurationSyncStateSummary")
)
instance Prelude.Hashable FirewallStatus
instance Prelude.NFData FirewallStatus