{-# 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.FMS.Types.StatefulRuleGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FMS.Types.NetworkFirewallStatefulRuleGroupOverride
import qualified Amazonka.Prelude as Prelude
data StatefulRuleGroup = StatefulRuleGroup'
{
StatefulRuleGroup -> Maybe NetworkFirewallStatefulRuleGroupOverride
override :: Prelude.Maybe NetworkFirewallStatefulRuleGroupOverride,
StatefulRuleGroup -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
StatefulRuleGroup -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
StatefulRuleGroup -> Maybe Text
ruleGroupName :: Prelude.Maybe Prelude.Text
}
deriving (StatefulRuleGroup -> StatefulRuleGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StatefulRuleGroup -> StatefulRuleGroup -> Bool
$c/= :: StatefulRuleGroup -> StatefulRuleGroup -> Bool
== :: StatefulRuleGroup -> StatefulRuleGroup -> Bool
$c== :: StatefulRuleGroup -> StatefulRuleGroup -> Bool
Prelude.Eq, ReadPrec [StatefulRuleGroup]
ReadPrec StatefulRuleGroup
Int -> ReadS StatefulRuleGroup
ReadS [StatefulRuleGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StatefulRuleGroup]
$creadListPrec :: ReadPrec [StatefulRuleGroup]
readPrec :: ReadPrec StatefulRuleGroup
$creadPrec :: ReadPrec StatefulRuleGroup
readList :: ReadS [StatefulRuleGroup]
$creadList :: ReadS [StatefulRuleGroup]
readsPrec :: Int -> ReadS StatefulRuleGroup
$creadsPrec :: Int -> ReadS StatefulRuleGroup
Prelude.Read, Int -> StatefulRuleGroup -> ShowS
[StatefulRuleGroup] -> ShowS
StatefulRuleGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StatefulRuleGroup] -> ShowS
$cshowList :: [StatefulRuleGroup] -> ShowS
show :: StatefulRuleGroup -> String
$cshow :: StatefulRuleGroup -> String
showsPrec :: Int -> StatefulRuleGroup -> ShowS
$cshowsPrec :: Int -> StatefulRuleGroup -> ShowS
Prelude.Show, forall x. Rep StatefulRuleGroup x -> StatefulRuleGroup
forall x. StatefulRuleGroup -> Rep StatefulRuleGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StatefulRuleGroup x -> StatefulRuleGroup
$cfrom :: forall x. StatefulRuleGroup -> Rep StatefulRuleGroup x
Prelude.Generic)
newStatefulRuleGroup ::
StatefulRuleGroup
newStatefulRuleGroup :: StatefulRuleGroup
newStatefulRuleGroup =
StatefulRuleGroup'
{ $sel:override:StatefulRuleGroup' :: Maybe NetworkFirewallStatefulRuleGroupOverride
override = forall a. Maybe a
Prelude.Nothing,
$sel:priority:StatefulRuleGroup' :: Maybe Int
priority = forall a. Maybe a
Prelude.Nothing,
$sel:resourceId:StatefulRuleGroup' :: Maybe Text
resourceId = forall a. Maybe a
Prelude.Nothing,
$sel:ruleGroupName:StatefulRuleGroup' :: Maybe Text
ruleGroupName = forall a. Maybe a
Prelude.Nothing
}
statefulRuleGroup_override :: Lens.Lens' StatefulRuleGroup (Prelude.Maybe NetworkFirewallStatefulRuleGroupOverride)
statefulRuleGroup_override :: Lens'
StatefulRuleGroup (Maybe NetworkFirewallStatefulRuleGroupOverride)
statefulRuleGroup_override = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatefulRuleGroup' {Maybe NetworkFirewallStatefulRuleGroupOverride
override :: Maybe NetworkFirewallStatefulRuleGroupOverride
$sel:override:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe NetworkFirewallStatefulRuleGroupOverride
override} -> Maybe NetworkFirewallStatefulRuleGroupOverride
override) (\s :: StatefulRuleGroup
s@StatefulRuleGroup' {} Maybe NetworkFirewallStatefulRuleGroupOverride
a -> StatefulRuleGroup
s {$sel:override:StatefulRuleGroup' :: Maybe NetworkFirewallStatefulRuleGroupOverride
override = Maybe NetworkFirewallStatefulRuleGroupOverride
a} :: StatefulRuleGroup)
statefulRuleGroup_priority :: Lens.Lens' StatefulRuleGroup (Prelude.Maybe Prelude.Int)
statefulRuleGroup_priority :: Lens' StatefulRuleGroup (Maybe Int)
statefulRuleGroup_priority = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatefulRuleGroup' {Maybe Int
priority :: Maybe Int
$sel:priority:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe Int
priority} -> Maybe Int
priority) (\s :: StatefulRuleGroup
s@StatefulRuleGroup' {} Maybe Int
a -> StatefulRuleGroup
s {$sel:priority:StatefulRuleGroup' :: Maybe Int
priority = Maybe Int
a} :: StatefulRuleGroup)
statefulRuleGroup_resourceId :: Lens.Lens' StatefulRuleGroup (Prelude.Maybe Prelude.Text)
statefulRuleGroup_resourceId :: Lens' StatefulRuleGroup (Maybe Text)
statefulRuleGroup_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatefulRuleGroup' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: StatefulRuleGroup
s@StatefulRuleGroup' {} Maybe Text
a -> StatefulRuleGroup
s {$sel:resourceId:StatefulRuleGroup' :: Maybe Text
resourceId = Maybe Text
a} :: StatefulRuleGroup)
statefulRuleGroup_ruleGroupName :: Lens.Lens' StatefulRuleGroup (Prelude.Maybe Prelude.Text)
statefulRuleGroup_ruleGroupName :: Lens' StatefulRuleGroup (Maybe Text)
statefulRuleGroup_ruleGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatefulRuleGroup' {Maybe Text
ruleGroupName :: Maybe Text
$sel:ruleGroupName:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe Text
ruleGroupName} -> Maybe Text
ruleGroupName) (\s :: StatefulRuleGroup
s@StatefulRuleGroup' {} Maybe Text
a -> StatefulRuleGroup
s {$sel:ruleGroupName:StatefulRuleGroup' :: Maybe Text
ruleGroupName = Maybe Text
a} :: StatefulRuleGroup)
instance Data.FromJSON StatefulRuleGroup where
parseJSON :: Value -> Parser StatefulRuleGroup
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StatefulRuleGroup"
( \Object
x ->
Maybe NetworkFirewallStatefulRuleGroupOverride
-> Maybe Int -> Maybe Text -> Maybe Text -> StatefulRuleGroup
StatefulRuleGroup'
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
"Override")
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
"Priority")
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
"ResourceId")
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
"RuleGroupName")
)
instance Prelude.Hashable StatefulRuleGroup where
hashWithSalt :: Int -> StatefulRuleGroup -> Int
hashWithSalt Int
_salt StatefulRuleGroup' {Maybe Int
Maybe Text
Maybe NetworkFirewallStatefulRuleGroupOverride
ruleGroupName :: Maybe Text
resourceId :: Maybe Text
priority :: Maybe Int
override :: Maybe NetworkFirewallStatefulRuleGroupOverride
$sel:ruleGroupName:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe Text
$sel:resourceId:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe Text
$sel:priority:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe Int
$sel:override:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe NetworkFirewallStatefulRuleGroupOverride
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NetworkFirewallStatefulRuleGroupOverride
override
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
priority
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleGroupName
instance Prelude.NFData StatefulRuleGroup where
rnf :: StatefulRuleGroup -> ()
rnf StatefulRuleGroup' {Maybe Int
Maybe Text
Maybe NetworkFirewallStatefulRuleGroupOverride
ruleGroupName :: Maybe Text
resourceId :: Maybe Text
priority :: Maybe Int
override :: Maybe NetworkFirewallStatefulRuleGroupOverride
$sel:ruleGroupName:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe Text
$sel:resourceId:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe Text
$sel:priority:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe Int
$sel:override:StatefulRuleGroup' :: StatefulRuleGroup -> Maybe NetworkFirewallStatefulRuleGroupOverride
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe NetworkFirewallStatefulRuleGroupOverride
override
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
priority
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleGroupName