{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StatefulRuleGroup = StatefulRuleGroup'
{
StatefulRuleGroup -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
StatefulRuleGroup -> Maybe Text
ruleGroupName :: Prelude.Maybe Prelude.Text
}
deriving (StatefulRuleGroup -> StatefulRuleGroup -> Bool
(StatefulRuleGroup -> StatefulRuleGroup -> Bool)
-> (StatefulRuleGroup -> StatefulRuleGroup -> Bool)
-> Eq StatefulRuleGroup
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]
(Int -> ReadS StatefulRuleGroup)
-> ReadS [StatefulRuleGroup]
-> ReadPrec StatefulRuleGroup
-> ReadPrec [StatefulRuleGroup]
-> Read 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
(Int -> StatefulRuleGroup -> ShowS)
-> (StatefulRuleGroup -> String)
-> ([StatefulRuleGroup] -> ShowS)
-> Show StatefulRuleGroup
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. StatefulRuleGroup -> Rep StatefulRuleGroup x)
-> (forall x. Rep StatefulRuleGroup x -> StatefulRuleGroup)
-> Generic StatefulRuleGroup
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' :: Maybe Text -> Maybe Text -> StatefulRuleGroup
StatefulRuleGroup'
{ $sel:resourceId:StatefulRuleGroup' :: Maybe Text
resourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ruleGroupName:StatefulRuleGroup' :: Maybe Text
ruleGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
statefulRuleGroup_resourceId :: Lens.Lens' StatefulRuleGroup (Prelude.Maybe Prelude.Text)
statefulRuleGroup_resourceId :: (Maybe Text -> f (Maybe Text))
-> StatefulRuleGroup -> f StatefulRuleGroup
statefulRuleGroup_resourceId = (StatefulRuleGroup -> Maybe Text)
-> (StatefulRuleGroup -> Maybe Text -> StatefulRuleGroup)
-> Lens
StatefulRuleGroup StatefulRuleGroup (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> StatefulRuleGroup -> f StatefulRuleGroup
statefulRuleGroup_ruleGroupName = (StatefulRuleGroup -> Maybe Text)
-> (StatefulRuleGroup -> Maybe Text -> StatefulRuleGroup)
-> Lens
StatefulRuleGroup StatefulRuleGroup (Maybe Text) (Maybe Text)
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 Core.FromJSON StatefulRuleGroup where
parseJSON :: Value -> Parser StatefulRuleGroup
parseJSON =
String
-> (Object -> Parser StatefulRuleGroup)
-> Value
-> Parser StatefulRuleGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StatefulRuleGroup"
( \Object
x ->
Maybe Text -> Maybe Text -> StatefulRuleGroup
StatefulRuleGroup'
(Maybe Text -> Maybe Text -> StatefulRuleGroup)
-> Parser (Maybe Text) -> Parser (Maybe Text -> StatefulRuleGroup)
forall (f :: * -> *) a b. Functor 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
"ResourceId")
Parser (Maybe Text -> StatefulRuleGroup)
-> Parser (Maybe Text) -> Parser StatefulRuleGroup
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
"RuleGroupName")
)
instance Prelude.Hashable StatefulRuleGroup
instance Prelude.NFData StatefulRuleGroup