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