{-# 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.StatefulEngineOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkFirewall.Types.RuleOrder
import qualified Amazonka.Prelude as Prelude
data StatefulEngineOptions = StatefulEngineOptions'
{
StatefulEngineOptions -> Maybe RuleOrder
ruleOrder :: Prelude.Maybe RuleOrder
}
deriving (StatefulEngineOptions -> StatefulEngineOptions -> Bool
(StatefulEngineOptions -> StatefulEngineOptions -> Bool)
-> (StatefulEngineOptions -> StatefulEngineOptions -> Bool)
-> Eq StatefulEngineOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StatefulEngineOptions -> StatefulEngineOptions -> Bool
$c/= :: StatefulEngineOptions -> StatefulEngineOptions -> Bool
== :: StatefulEngineOptions -> StatefulEngineOptions -> Bool
$c== :: StatefulEngineOptions -> StatefulEngineOptions -> Bool
Prelude.Eq, ReadPrec [StatefulEngineOptions]
ReadPrec StatefulEngineOptions
Int -> ReadS StatefulEngineOptions
ReadS [StatefulEngineOptions]
(Int -> ReadS StatefulEngineOptions)
-> ReadS [StatefulEngineOptions]
-> ReadPrec StatefulEngineOptions
-> ReadPrec [StatefulEngineOptions]
-> Read StatefulEngineOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StatefulEngineOptions]
$creadListPrec :: ReadPrec [StatefulEngineOptions]
readPrec :: ReadPrec StatefulEngineOptions
$creadPrec :: ReadPrec StatefulEngineOptions
readList :: ReadS [StatefulEngineOptions]
$creadList :: ReadS [StatefulEngineOptions]
readsPrec :: Int -> ReadS StatefulEngineOptions
$creadsPrec :: Int -> ReadS StatefulEngineOptions
Prelude.Read, Int -> StatefulEngineOptions -> ShowS
[StatefulEngineOptions] -> ShowS
StatefulEngineOptions -> String
(Int -> StatefulEngineOptions -> ShowS)
-> (StatefulEngineOptions -> String)
-> ([StatefulEngineOptions] -> ShowS)
-> Show StatefulEngineOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StatefulEngineOptions] -> ShowS
$cshowList :: [StatefulEngineOptions] -> ShowS
show :: StatefulEngineOptions -> String
$cshow :: StatefulEngineOptions -> String
showsPrec :: Int -> StatefulEngineOptions -> ShowS
$cshowsPrec :: Int -> StatefulEngineOptions -> ShowS
Prelude.Show, (forall x. StatefulEngineOptions -> Rep StatefulEngineOptions x)
-> (forall x. Rep StatefulEngineOptions x -> StatefulEngineOptions)
-> Generic StatefulEngineOptions
forall x. Rep StatefulEngineOptions x -> StatefulEngineOptions
forall x. StatefulEngineOptions -> Rep StatefulEngineOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StatefulEngineOptions x -> StatefulEngineOptions
$cfrom :: forall x. StatefulEngineOptions -> Rep StatefulEngineOptions x
Prelude.Generic)
newStatefulEngineOptions ::
StatefulEngineOptions
newStatefulEngineOptions :: StatefulEngineOptions
newStatefulEngineOptions =
StatefulEngineOptions' :: Maybe RuleOrder -> StatefulEngineOptions
StatefulEngineOptions' {$sel:ruleOrder:StatefulEngineOptions' :: Maybe RuleOrder
ruleOrder = Maybe RuleOrder
forall a. Maybe a
Prelude.Nothing}
statefulEngineOptions_ruleOrder :: Lens.Lens' StatefulEngineOptions (Prelude.Maybe RuleOrder)
statefulEngineOptions_ruleOrder :: (Maybe RuleOrder -> f (Maybe RuleOrder))
-> StatefulEngineOptions -> f StatefulEngineOptions
statefulEngineOptions_ruleOrder = (StatefulEngineOptions -> Maybe RuleOrder)
-> (StatefulEngineOptions
-> Maybe RuleOrder -> StatefulEngineOptions)
-> Lens
StatefulEngineOptions
StatefulEngineOptions
(Maybe RuleOrder)
(Maybe RuleOrder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatefulEngineOptions' {Maybe RuleOrder
ruleOrder :: Maybe RuleOrder
$sel:ruleOrder:StatefulEngineOptions' :: StatefulEngineOptions -> Maybe RuleOrder
ruleOrder} -> Maybe RuleOrder
ruleOrder) (\s :: StatefulEngineOptions
s@StatefulEngineOptions' {} Maybe RuleOrder
a -> StatefulEngineOptions
s {$sel:ruleOrder:StatefulEngineOptions' :: Maybe RuleOrder
ruleOrder = Maybe RuleOrder
a} :: StatefulEngineOptions)
instance Core.FromJSON StatefulEngineOptions where
parseJSON :: Value -> Parser StatefulEngineOptions
parseJSON =
String
-> (Object -> Parser StatefulEngineOptions)
-> Value
-> Parser StatefulEngineOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StatefulEngineOptions"
( \Object
x ->
Maybe RuleOrder -> StatefulEngineOptions
StatefulEngineOptions'
(Maybe RuleOrder -> StatefulEngineOptions)
-> Parser (Maybe RuleOrder) -> Parser StatefulEngineOptions
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe RuleOrder)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RuleOrder")
)
instance Prelude.Hashable StatefulEngineOptions
instance Prelude.NFData StatefulEngineOptions
instance Core.ToJSON StatefulEngineOptions where
toJSON :: StatefulEngineOptions -> Value
toJSON StatefulEngineOptions' {Maybe RuleOrder
ruleOrder :: Maybe RuleOrder
$sel:ruleOrder:StatefulEngineOptions' :: StatefulEngineOptions -> Maybe RuleOrder
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"RuleOrder" Text -> RuleOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RuleOrder -> Pair) -> Maybe RuleOrder -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RuleOrder
ruleOrder]
)