{-# 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.CloudWatch.Types.ManagedRuleState 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 ManagedRuleState = ManagedRuleState'
{
ManagedRuleState -> Text
ruleName :: Prelude.Text,
ManagedRuleState -> Text
state :: Prelude.Text
}
deriving (ManagedRuleState -> ManagedRuleState -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManagedRuleState -> ManagedRuleState -> Bool
$c/= :: ManagedRuleState -> ManagedRuleState -> Bool
== :: ManagedRuleState -> ManagedRuleState -> Bool
$c== :: ManagedRuleState -> ManagedRuleState -> Bool
Prelude.Eq, ReadPrec [ManagedRuleState]
ReadPrec ManagedRuleState
Int -> ReadS ManagedRuleState
ReadS [ManagedRuleState]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManagedRuleState]
$creadListPrec :: ReadPrec [ManagedRuleState]
readPrec :: ReadPrec ManagedRuleState
$creadPrec :: ReadPrec ManagedRuleState
readList :: ReadS [ManagedRuleState]
$creadList :: ReadS [ManagedRuleState]
readsPrec :: Int -> ReadS ManagedRuleState
$creadsPrec :: Int -> ReadS ManagedRuleState
Prelude.Read, Int -> ManagedRuleState -> ShowS
[ManagedRuleState] -> ShowS
ManagedRuleState -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManagedRuleState] -> ShowS
$cshowList :: [ManagedRuleState] -> ShowS
show :: ManagedRuleState -> String
$cshow :: ManagedRuleState -> String
showsPrec :: Int -> ManagedRuleState -> ShowS
$cshowsPrec :: Int -> ManagedRuleState -> ShowS
Prelude.Show, forall x. Rep ManagedRuleState x -> ManagedRuleState
forall x. ManagedRuleState -> Rep ManagedRuleState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ManagedRuleState x -> ManagedRuleState
$cfrom :: forall x. ManagedRuleState -> Rep ManagedRuleState x
Prelude.Generic)
newManagedRuleState ::
Prelude.Text ->
Prelude.Text ->
ManagedRuleState
newManagedRuleState :: Text -> Text -> ManagedRuleState
newManagedRuleState Text
pRuleName_ Text
pState_ =
ManagedRuleState'
{ $sel:ruleName:ManagedRuleState' :: Text
ruleName = Text
pRuleName_,
$sel:state:ManagedRuleState' :: Text
state = Text
pState_
}
managedRuleState_ruleName :: Lens.Lens' ManagedRuleState Prelude.Text
managedRuleState_ruleName :: Lens' ManagedRuleState Text
managedRuleState_ruleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleState' {Text
ruleName :: Text
$sel:ruleName:ManagedRuleState' :: ManagedRuleState -> Text
ruleName} -> Text
ruleName) (\s :: ManagedRuleState
s@ManagedRuleState' {} Text
a -> ManagedRuleState
s {$sel:ruleName:ManagedRuleState' :: Text
ruleName = Text
a} :: ManagedRuleState)
managedRuleState_state :: Lens.Lens' ManagedRuleState Prelude.Text
managedRuleState_state :: Lens' ManagedRuleState Text
managedRuleState_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleState' {Text
state :: Text
$sel:state:ManagedRuleState' :: ManagedRuleState -> Text
state} -> Text
state) (\s :: ManagedRuleState
s@ManagedRuleState' {} Text
a -> ManagedRuleState
s {$sel:state:ManagedRuleState' :: Text
state = Text
a} :: ManagedRuleState)
instance Data.FromXML ManagedRuleState where
parseXML :: [Node] -> Either String ManagedRuleState
parseXML [Node]
x =
Text -> Text -> ManagedRuleState
ManagedRuleState'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"RuleName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"State")
instance Prelude.Hashable ManagedRuleState where
hashWithSalt :: Int -> ManagedRuleState -> Int
hashWithSalt Int
_salt ManagedRuleState' {Text
state :: Text
ruleName :: Text
$sel:state:ManagedRuleState' :: ManagedRuleState -> Text
$sel:ruleName:ManagedRuleState' :: ManagedRuleState -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
state
instance Prelude.NFData ManagedRuleState where
rnf :: ManagedRuleState -> ()
rnf ManagedRuleState' {Text
state :: Text
ruleName :: Text
$sel:state:ManagedRuleState' :: ManagedRuleState -> Text
$sel:ruleName:ManagedRuleState' :: ManagedRuleState -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
state