{-# 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.FirewallPolicy where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkFirewall.Types.CustomAction
import Amazonka.NetworkFirewall.Types.StatefulEngineOptions
import Amazonka.NetworkFirewall.Types.StatefulRuleGroupReference
import Amazonka.NetworkFirewall.Types.StatelessRuleGroupReference
import qualified Amazonka.Prelude as Prelude
data FirewallPolicy = FirewallPolicy'
{
FirewallPolicy -> Maybe StatefulEngineOptions
statefulEngineOptions :: Prelude.Maybe StatefulEngineOptions,
FirewallPolicy -> Maybe [StatefulRuleGroupReference]
statefulRuleGroupReferences :: Prelude.Maybe [StatefulRuleGroupReference],
FirewallPolicy -> Maybe [StatelessRuleGroupReference]
statelessRuleGroupReferences :: Prelude.Maybe [StatelessRuleGroupReference],
FirewallPolicy -> Maybe [CustomAction]
statelessCustomActions :: Prelude.Maybe [CustomAction],
FirewallPolicy -> Maybe [Text]
statefulDefaultActions :: Prelude.Maybe [Prelude.Text],
FirewallPolicy -> [Text]
statelessDefaultActions :: [Prelude.Text],
FirewallPolicy -> [Text]
statelessFragmentDefaultActions :: [Prelude.Text]
}
deriving (FirewallPolicy -> FirewallPolicy -> Bool
(FirewallPolicy -> FirewallPolicy -> Bool)
-> (FirewallPolicy -> FirewallPolicy -> Bool) -> Eq FirewallPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FirewallPolicy -> FirewallPolicy -> Bool
$c/= :: FirewallPolicy -> FirewallPolicy -> Bool
== :: FirewallPolicy -> FirewallPolicy -> Bool
$c== :: FirewallPolicy -> FirewallPolicy -> Bool
Prelude.Eq, ReadPrec [FirewallPolicy]
ReadPrec FirewallPolicy
Int -> ReadS FirewallPolicy
ReadS [FirewallPolicy]
(Int -> ReadS FirewallPolicy)
-> ReadS [FirewallPolicy]
-> ReadPrec FirewallPolicy
-> ReadPrec [FirewallPolicy]
-> Read FirewallPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FirewallPolicy]
$creadListPrec :: ReadPrec [FirewallPolicy]
readPrec :: ReadPrec FirewallPolicy
$creadPrec :: ReadPrec FirewallPolicy
readList :: ReadS [FirewallPolicy]
$creadList :: ReadS [FirewallPolicy]
readsPrec :: Int -> ReadS FirewallPolicy
$creadsPrec :: Int -> ReadS FirewallPolicy
Prelude.Read, Int -> FirewallPolicy -> ShowS
[FirewallPolicy] -> ShowS
FirewallPolicy -> String
(Int -> FirewallPolicy -> ShowS)
-> (FirewallPolicy -> String)
-> ([FirewallPolicy] -> ShowS)
-> Show FirewallPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FirewallPolicy] -> ShowS
$cshowList :: [FirewallPolicy] -> ShowS
show :: FirewallPolicy -> String
$cshow :: FirewallPolicy -> String
showsPrec :: Int -> FirewallPolicy -> ShowS
$cshowsPrec :: Int -> FirewallPolicy -> ShowS
Prelude.Show, (forall x. FirewallPolicy -> Rep FirewallPolicy x)
-> (forall x. Rep FirewallPolicy x -> FirewallPolicy)
-> Generic FirewallPolicy
forall x. Rep FirewallPolicy x -> FirewallPolicy
forall x. FirewallPolicy -> Rep FirewallPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FirewallPolicy x -> FirewallPolicy
$cfrom :: forall x. FirewallPolicy -> Rep FirewallPolicy x
Prelude.Generic)
newFirewallPolicy ::
FirewallPolicy
newFirewallPolicy :: FirewallPolicy
newFirewallPolicy =
FirewallPolicy' :: Maybe StatefulEngineOptions
-> Maybe [StatefulRuleGroupReference]
-> Maybe [StatelessRuleGroupReference]
-> Maybe [CustomAction]
-> Maybe [Text]
-> [Text]
-> [Text]
-> FirewallPolicy
FirewallPolicy'
{ $sel:statefulEngineOptions:FirewallPolicy' :: Maybe StatefulEngineOptions
statefulEngineOptions =
Maybe StatefulEngineOptions
forall a. Maybe a
Prelude.Nothing,
$sel:statefulRuleGroupReferences:FirewallPolicy' :: Maybe [StatefulRuleGroupReference]
statefulRuleGroupReferences = Maybe [StatefulRuleGroupReference]
forall a. Maybe a
Prelude.Nothing,
$sel:statelessRuleGroupReferences:FirewallPolicy' :: Maybe [StatelessRuleGroupReference]
statelessRuleGroupReferences = Maybe [StatelessRuleGroupReference]
forall a. Maybe a
Prelude.Nothing,
$sel:statelessCustomActions:FirewallPolicy' :: Maybe [CustomAction]
statelessCustomActions = Maybe [CustomAction]
forall a. Maybe a
Prelude.Nothing,
$sel:statefulDefaultActions:FirewallPolicy' :: Maybe [Text]
statefulDefaultActions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:statelessDefaultActions:FirewallPolicy' :: [Text]
statelessDefaultActions = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:statelessFragmentDefaultActions:FirewallPolicy' :: [Text]
statelessFragmentDefaultActions = [Text]
forall a. Monoid a => a
Prelude.mempty
}
firewallPolicy_statefulEngineOptions :: Lens.Lens' FirewallPolicy (Prelude.Maybe StatefulEngineOptions)
firewallPolicy_statefulEngineOptions :: (Maybe StatefulEngineOptions -> f (Maybe StatefulEngineOptions))
-> FirewallPolicy -> f FirewallPolicy
firewallPolicy_statefulEngineOptions = (FirewallPolicy -> Maybe StatefulEngineOptions)
-> (FirewallPolicy
-> Maybe StatefulEngineOptions -> FirewallPolicy)
-> Lens
FirewallPolicy
FirewallPolicy
(Maybe StatefulEngineOptions)
(Maybe StatefulEngineOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallPolicy' {Maybe StatefulEngineOptions
statefulEngineOptions :: Maybe StatefulEngineOptions
$sel:statefulEngineOptions:FirewallPolicy' :: FirewallPolicy -> Maybe StatefulEngineOptions
statefulEngineOptions} -> Maybe StatefulEngineOptions
statefulEngineOptions) (\s :: FirewallPolicy
s@FirewallPolicy' {} Maybe StatefulEngineOptions
a -> FirewallPolicy
s {$sel:statefulEngineOptions:FirewallPolicy' :: Maybe StatefulEngineOptions
statefulEngineOptions = Maybe StatefulEngineOptions
a} :: FirewallPolicy)
firewallPolicy_statefulRuleGroupReferences :: Lens.Lens' FirewallPolicy (Prelude.Maybe [StatefulRuleGroupReference])
firewallPolicy_statefulRuleGroupReferences :: (Maybe [StatefulRuleGroupReference]
-> f (Maybe [StatefulRuleGroupReference]))
-> FirewallPolicy -> f FirewallPolicy
firewallPolicy_statefulRuleGroupReferences = (FirewallPolicy -> Maybe [StatefulRuleGroupReference])
-> (FirewallPolicy
-> Maybe [StatefulRuleGroupReference] -> FirewallPolicy)
-> Lens
FirewallPolicy
FirewallPolicy
(Maybe [StatefulRuleGroupReference])
(Maybe [StatefulRuleGroupReference])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallPolicy' {Maybe [StatefulRuleGroupReference]
statefulRuleGroupReferences :: Maybe [StatefulRuleGroupReference]
$sel:statefulRuleGroupReferences:FirewallPolicy' :: FirewallPolicy -> Maybe [StatefulRuleGroupReference]
statefulRuleGroupReferences} -> Maybe [StatefulRuleGroupReference]
statefulRuleGroupReferences) (\s :: FirewallPolicy
s@FirewallPolicy' {} Maybe [StatefulRuleGroupReference]
a -> FirewallPolicy
s {$sel:statefulRuleGroupReferences:FirewallPolicy' :: Maybe [StatefulRuleGroupReference]
statefulRuleGroupReferences = Maybe [StatefulRuleGroupReference]
a} :: FirewallPolicy) ((Maybe [StatefulRuleGroupReference]
-> f (Maybe [StatefulRuleGroupReference]))
-> FirewallPolicy -> f FirewallPolicy)
-> ((Maybe [StatefulRuleGroupReference]
-> f (Maybe [StatefulRuleGroupReference]))
-> Maybe [StatefulRuleGroupReference]
-> f (Maybe [StatefulRuleGroupReference]))
-> (Maybe [StatefulRuleGroupReference]
-> f (Maybe [StatefulRuleGroupReference]))
-> FirewallPolicy
-> f FirewallPolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[StatefulRuleGroupReference]
[StatefulRuleGroupReference]
[StatefulRuleGroupReference]
[StatefulRuleGroupReference]
-> Iso
(Maybe [StatefulRuleGroupReference])
(Maybe [StatefulRuleGroupReference])
(Maybe [StatefulRuleGroupReference])
(Maybe [StatefulRuleGroupReference])
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
[StatefulRuleGroupReference]
[StatefulRuleGroupReference]
[StatefulRuleGroupReference]
[StatefulRuleGroupReference]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
firewallPolicy_statelessRuleGroupReferences :: Lens.Lens' FirewallPolicy (Prelude.Maybe [StatelessRuleGroupReference])
firewallPolicy_statelessRuleGroupReferences :: (Maybe [StatelessRuleGroupReference]
-> f (Maybe [StatelessRuleGroupReference]))
-> FirewallPolicy -> f FirewallPolicy
firewallPolicy_statelessRuleGroupReferences = (FirewallPolicy -> Maybe [StatelessRuleGroupReference])
-> (FirewallPolicy
-> Maybe [StatelessRuleGroupReference] -> FirewallPolicy)
-> Lens
FirewallPolicy
FirewallPolicy
(Maybe [StatelessRuleGroupReference])
(Maybe [StatelessRuleGroupReference])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallPolicy' {Maybe [StatelessRuleGroupReference]
statelessRuleGroupReferences :: Maybe [StatelessRuleGroupReference]
$sel:statelessRuleGroupReferences:FirewallPolicy' :: FirewallPolicy -> Maybe [StatelessRuleGroupReference]
statelessRuleGroupReferences} -> Maybe [StatelessRuleGroupReference]
statelessRuleGroupReferences) (\s :: FirewallPolicy
s@FirewallPolicy' {} Maybe [StatelessRuleGroupReference]
a -> FirewallPolicy
s {$sel:statelessRuleGroupReferences:FirewallPolicy' :: Maybe [StatelessRuleGroupReference]
statelessRuleGroupReferences = Maybe [StatelessRuleGroupReference]
a} :: FirewallPolicy) ((Maybe [StatelessRuleGroupReference]
-> f (Maybe [StatelessRuleGroupReference]))
-> FirewallPolicy -> f FirewallPolicy)
-> ((Maybe [StatelessRuleGroupReference]
-> f (Maybe [StatelessRuleGroupReference]))
-> Maybe [StatelessRuleGroupReference]
-> f (Maybe [StatelessRuleGroupReference]))
-> (Maybe [StatelessRuleGroupReference]
-> f (Maybe [StatelessRuleGroupReference]))
-> FirewallPolicy
-> f FirewallPolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[StatelessRuleGroupReference]
[StatelessRuleGroupReference]
[StatelessRuleGroupReference]
[StatelessRuleGroupReference]
-> Iso
(Maybe [StatelessRuleGroupReference])
(Maybe [StatelessRuleGroupReference])
(Maybe [StatelessRuleGroupReference])
(Maybe [StatelessRuleGroupReference])
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
[StatelessRuleGroupReference]
[StatelessRuleGroupReference]
[StatelessRuleGroupReference]
[StatelessRuleGroupReference]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
firewallPolicy_statelessCustomActions :: Lens.Lens' FirewallPolicy (Prelude.Maybe [CustomAction])
firewallPolicy_statelessCustomActions :: (Maybe [CustomAction] -> f (Maybe [CustomAction]))
-> FirewallPolicy -> f FirewallPolicy
firewallPolicy_statelessCustomActions = (FirewallPolicy -> Maybe [CustomAction])
-> (FirewallPolicy -> Maybe [CustomAction] -> FirewallPolicy)
-> Lens
FirewallPolicy
FirewallPolicy
(Maybe [CustomAction])
(Maybe [CustomAction])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallPolicy' {Maybe [CustomAction]
statelessCustomActions :: Maybe [CustomAction]
$sel:statelessCustomActions:FirewallPolicy' :: FirewallPolicy -> Maybe [CustomAction]
statelessCustomActions} -> Maybe [CustomAction]
statelessCustomActions) (\s :: FirewallPolicy
s@FirewallPolicy' {} Maybe [CustomAction]
a -> FirewallPolicy
s {$sel:statelessCustomActions:FirewallPolicy' :: Maybe [CustomAction]
statelessCustomActions = Maybe [CustomAction]
a} :: FirewallPolicy) ((Maybe [CustomAction] -> f (Maybe [CustomAction]))
-> FirewallPolicy -> f FirewallPolicy)
-> ((Maybe [CustomAction] -> f (Maybe [CustomAction]))
-> Maybe [CustomAction] -> f (Maybe [CustomAction]))
-> (Maybe [CustomAction] -> f (Maybe [CustomAction]))
-> FirewallPolicy
-> f FirewallPolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [CustomAction] [CustomAction] [CustomAction] [CustomAction]
-> Iso
(Maybe [CustomAction])
(Maybe [CustomAction])
(Maybe [CustomAction])
(Maybe [CustomAction])
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 [CustomAction] [CustomAction] [CustomAction] [CustomAction]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
firewallPolicy_statefulDefaultActions :: Lens.Lens' FirewallPolicy (Prelude.Maybe [Prelude.Text])
firewallPolicy_statefulDefaultActions :: (Maybe [Text] -> f (Maybe [Text]))
-> FirewallPolicy -> f FirewallPolicy
firewallPolicy_statefulDefaultActions = (FirewallPolicy -> Maybe [Text])
-> (FirewallPolicy -> Maybe [Text] -> FirewallPolicy)
-> Lens FirewallPolicy FirewallPolicy (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallPolicy' {Maybe [Text]
statefulDefaultActions :: Maybe [Text]
$sel:statefulDefaultActions:FirewallPolicy' :: FirewallPolicy -> Maybe [Text]
statefulDefaultActions} -> Maybe [Text]
statefulDefaultActions) (\s :: FirewallPolicy
s@FirewallPolicy' {} Maybe [Text]
a -> FirewallPolicy
s {$sel:statefulDefaultActions:FirewallPolicy' :: Maybe [Text]
statefulDefaultActions = Maybe [Text]
a} :: FirewallPolicy) ((Maybe [Text] -> f (Maybe [Text]))
-> FirewallPolicy -> f FirewallPolicy)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> FirewallPolicy
-> f FirewallPolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
firewallPolicy_statelessDefaultActions :: Lens.Lens' FirewallPolicy [Prelude.Text]
firewallPolicy_statelessDefaultActions :: ([Text] -> f [Text]) -> FirewallPolicy -> f FirewallPolicy
firewallPolicy_statelessDefaultActions = (FirewallPolicy -> [Text])
-> (FirewallPolicy -> [Text] -> FirewallPolicy)
-> Lens FirewallPolicy FirewallPolicy [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallPolicy' {[Text]
statelessDefaultActions :: [Text]
$sel:statelessDefaultActions:FirewallPolicy' :: FirewallPolicy -> [Text]
statelessDefaultActions} -> [Text]
statelessDefaultActions) (\s :: FirewallPolicy
s@FirewallPolicy' {} [Text]
a -> FirewallPolicy
s {$sel:statelessDefaultActions:FirewallPolicy' :: [Text]
statelessDefaultActions = [Text]
a} :: FirewallPolicy) (([Text] -> f [Text]) -> FirewallPolicy -> f FirewallPolicy)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> FirewallPolicy
-> f FirewallPolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
firewallPolicy_statelessFragmentDefaultActions :: Lens.Lens' FirewallPolicy [Prelude.Text]
firewallPolicy_statelessFragmentDefaultActions :: ([Text] -> f [Text]) -> FirewallPolicy -> f FirewallPolicy
firewallPolicy_statelessFragmentDefaultActions = (FirewallPolicy -> [Text])
-> (FirewallPolicy -> [Text] -> FirewallPolicy)
-> Lens FirewallPolicy FirewallPolicy [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallPolicy' {[Text]
statelessFragmentDefaultActions :: [Text]
$sel:statelessFragmentDefaultActions:FirewallPolicy' :: FirewallPolicy -> [Text]
statelessFragmentDefaultActions} -> [Text]
statelessFragmentDefaultActions) (\s :: FirewallPolicy
s@FirewallPolicy' {} [Text]
a -> FirewallPolicy
s {$sel:statelessFragmentDefaultActions:FirewallPolicy' :: [Text]
statelessFragmentDefaultActions = [Text]
a} :: FirewallPolicy) (([Text] -> f [Text]) -> FirewallPolicy -> f FirewallPolicy)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> FirewallPolicy
-> f FirewallPolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON FirewallPolicy where
parseJSON :: Value -> Parser FirewallPolicy
parseJSON =
String
-> (Object -> Parser FirewallPolicy)
-> Value
-> Parser FirewallPolicy
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FirewallPolicy"
( \Object
x ->
Maybe StatefulEngineOptions
-> Maybe [StatefulRuleGroupReference]
-> Maybe [StatelessRuleGroupReference]
-> Maybe [CustomAction]
-> Maybe [Text]
-> [Text]
-> [Text]
-> FirewallPolicy
FirewallPolicy'
(Maybe StatefulEngineOptions
-> Maybe [StatefulRuleGroupReference]
-> Maybe [StatelessRuleGroupReference]
-> Maybe [CustomAction]
-> Maybe [Text]
-> [Text]
-> [Text]
-> FirewallPolicy)
-> Parser (Maybe StatefulEngineOptions)
-> Parser
(Maybe [StatefulRuleGroupReference]
-> Maybe [StatelessRuleGroupReference]
-> Maybe [CustomAction]
-> Maybe [Text]
-> [Text]
-> [Text]
-> FirewallPolicy)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe StatefulEngineOptions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatefulEngineOptions")
Parser
(Maybe [StatefulRuleGroupReference]
-> Maybe [StatelessRuleGroupReference]
-> Maybe [CustomAction]
-> Maybe [Text]
-> [Text]
-> [Text]
-> FirewallPolicy)
-> Parser (Maybe [StatefulRuleGroupReference])
-> Parser
(Maybe [StatelessRuleGroupReference]
-> Maybe [CustomAction]
-> Maybe [Text]
-> [Text]
-> [Text]
-> FirewallPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [StatefulRuleGroupReference]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatefulRuleGroupReferences"
Parser (Maybe (Maybe [StatefulRuleGroupReference]))
-> Maybe [StatefulRuleGroupReference]
-> Parser (Maybe [StatefulRuleGroupReference])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [StatefulRuleGroupReference]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe [StatelessRuleGroupReference]
-> Maybe [CustomAction]
-> Maybe [Text]
-> [Text]
-> [Text]
-> FirewallPolicy)
-> Parser (Maybe [StatelessRuleGroupReference])
-> Parser
(Maybe [CustomAction]
-> Maybe [Text] -> [Text] -> [Text] -> FirewallPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [StatelessRuleGroupReference]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatelessRuleGroupReferences"
Parser (Maybe (Maybe [StatelessRuleGroupReference]))
-> Maybe [StatelessRuleGroupReference]
-> Parser (Maybe [StatelessRuleGroupReference])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [StatelessRuleGroupReference]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe [CustomAction]
-> Maybe [Text] -> [Text] -> [Text] -> FirewallPolicy)
-> Parser (Maybe [CustomAction])
-> Parser (Maybe [Text] -> [Text] -> [Text] -> FirewallPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [CustomAction]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatelessCustomActions"
Parser (Maybe (Maybe [CustomAction]))
-> Maybe [CustomAction] -> Parser (Maybe [CustomAction])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [CustomAction]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe [Text] -> [Text] -> [Text] -> FirewallPolicy)
-> Parser (Maybe [Text])
-> Parser ([Text] -> [Text] -> FirewallPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatefulDefaultActions"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser ([Text] -> [Text] -> FirewallPolicy)
-> Parser [Text] -> Parser ([Text] -> FirewallPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatelessDefaultActions"
Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser ([Text] -> FirewallPolicy)
-> Parser [Text] -> Parser FirewallPolicy
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatelessFragmentDefaultActions"
Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable FirewallPolicy
instance Prelude.NFData FirewallPolicy
instance Core.ToJSON FirewallPolicy where
toJSON :: FirewallPolicy -> Value
toJSON FirewallPolicy' {[Text]
Maybe [Text]
Maybe [CustomAction]
Maybe [StatefulRuleGroupReference]
Maybe [StatelessRuleGroupReference]
Maybe StatefulEngineOptions
statelessFragmentDefaultActions :: [Text]
statelessDefaultActions :: [Text]
statefulDefaultActions :: Maybe [Text]
statelessCustomActions :: Maybe [CustomAction]
statelessRuleGroupReferences :: Maybe [StatelessRuleGroupReference]
statefulRuleGroupReferences :: Maybe [StatefulRuleGroupReference]
statefulEngineOptions :: Maybe StatefulEngineOptions
$sel:statelessFragmentDefaultActions:FirewallPolicy' :: FirewallPolicy -> [Text]
$sel:statelessDefaultActions:FirewallPolicy' :: FirewallPolicy -> [Text]
$sel:statefulDefaultActions:FirewallPolicy' :: FirewallPolicy -> Maybe [Text]
$sel:statelessCustomActions:FirewallPolicy' :: FirewallPolicy -> Maybe [CustomAction]
$sel:statelessRuleGroupReferences:FirewallPolicy' :: FirewallPolicy -> Maybe [StatelessRuleGroupReference]
$sel:statefulRuleGroupReferences:FirewallPolicy' :: FirewallPolicy -> Maybe [StatefulRuleGroupReference]
$sel:statefulEngineOptions:FirewallPolicy' :: FirewallPolicy -> Maybe StatefulEngineOptions
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"StatefulEngineOptions" Text -> StatefulEngineOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(StatefulEngineOptions -> Pair)
-> Maybe StatefulEngineOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StatefulEngineOptions
statefulEngineOptions,
(Text
"StatefulRuleGroupReferences" Text -> [StatefulRuleGroupReference] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([StatefulRuleGroupReference] -> Pair)
-> Maybe [StatefulRuleGroupReference] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [StatefulRuleGroupReference]
statefulRuleGroupReferences,
(Text
"StatelessRuleGroupReferences" Text -> [StatelessRuleGroupReference] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([StatelessRuleGroupReference] -> Pair)
-> Maybe [StatelessRuleGroupReference] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [StatelessRuleGroupReference]
statelessRuleGroupReferences,
(Text
"StatelessCustomActions" Text -> [CustomAction] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([CustomAction] -> Pair) -> Maybe [CustomAction] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CustomAction]
statelessCustomActions,
(Text
"StatefulDefaultActions" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
statefulDefaultActions,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"StatelessDefaultActions"
Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
statelessDefaultActions
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"StatelessFragmentDefaultActions"
Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
statelessFragmentDefaultActions
)
]
)