{-# 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.Route53RecoveryControlConfig.Types.NewAssertionRule 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
import Amazonka.Route53RecoveryControlConfig.Types.RuleConfig
data NewAssertionRule = NewAssertionRule'
{
NewAssertionRule -> Text
controlPanelArn :: Prelude.Text,
NewAssertionRule -> [Text]
assertedControls :: [Prelude.Text],
NewAssertionRule -> RuleConfig
ruleConfig :: RuleConfig,
NewAssertionRule -> Int
waitPeriodMs :: Prelude.Int,
NewAssertionRule -> Text
name :: Prelude.Text
}
deriving (NewAssertionRule -> NewAssertionRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewAssertionRule -> NewAssertionRule -> Bool
$c/= :: NewAssertionRule -> NewAssertionRule -> Bool
== :: NewAssertionRule -> NewAssertionRule -> Bool
$c== :: NewAssertionRule -> NewAssertionRule -> Bool
Prelude.Eq, ReadPrec [NewAssertionRule]
ReadPrec NewAssertionRule
Int -> ReadS NewAssertionRule
ReadS [NewAssertionRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NewAssertionRule]
$creadListPrec :: ReadPrec [NewAssertionRule]
readPrec :: ReadPrec NewAssertionRule
$creadPrec :: ReadPrec NewAssertionRule
readList :: ReadS [NewAssertionRule]
$creadList :: ReadS [NewAssertionRule]
readsPrec :: Int -> ReadS NewAssertionRule
$creadsPrec :: Int -> ReadS NewAssertionRule
Prelude.Read, Int -> NewAssertionRule -> ShowS
[NewAssertionRule] -> ShowS
NewAssertionRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NewAssertionRule] -> ShowS
$cshowList :: [NewAssertionRule] -> ShowS
show :: NewAssertionRule -> String
$cshow :: NewAssertionRule -> String
showsPrec :: Int -> NewAssertionRule -> ShowS
$cshowsPrec :: Int -> NewAssertionRule -> ShowS
Prelude.Show, forall x. Rep NewAssertionRule x -> NewAssertionRule
forall x. NewAssertionRule -> Rep NewAssertionRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NewAssertionRule x -> NewAssertionRule
$cfrom :: forall x. NewAssertionRule -> Rep NewAssertionRule x
Prelude.Generic)
newNewAssertionRule ::
Prelude.Text ->
RuleConfig ->
Prelude.Int ->
Prelude.Text ->
NewAssertionRule
newNewAssertionRule :: Text -> RuleConfig -> Int -> Text -> NewAssertionRule
newNewAssertionRule
Text
pControlPanelArn_
RuleConfig
pRuleConfig_
Int
pWaitPeriodMs_
Text
pName_ =
NewAssertionRule'
{ $sel:controlPanelArn:NewAssertionRule' :: Text
controlPanelArn =
Text
pControlPanelArn_,
$sel:assertedControls:NewAssertionRule' :: [Text]
assertedControls = forall a. Monoid a => a
Prelude.mempty,
$sel:ruleConfig:NewAssertionRule' :: RuleConfig
ruleConfig = RuleConfig
pRuleConfig_,
$sel:waitPeriodMs:NewAssertionRule' :: Int
waitPeriodMs = Int
pWaitPeriodMs_,
$sel:name:NewAssertionRule' :: Text
name = Text
pName_
}
newAssertionRule_controlPanelArn :: Lens.Lens' NewAssertionRule Prelude.Text
newAssertionRule_controlPanelArn :: Lens' NewAssertionRule Text
newAssertionRule_controlPanelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewAssertionRule' {Text
controlPanelArn :: Text
$sel:controlPanelArn:NewAssertionRule' :: NewAssertionRule -> Text
controlPanelArn} -> Text
controlPanelArn) (\s :: NewAssertionRule
s@NewAssertionRule' {} Text
a -> NewAssertionRule
s {$sel:controlPanelArn:NewAssertionRule' :: Text
controlPanelArn = Text
a} :: NewAssertionRule)
newAssertionRule_assertedControls :: Lens.Lens' NewAssertionRule [Prelude.Text]
newAssertionRule_assertedControls :: Lens' NewAssertionRule [Text]
newAssertionRule_assertedControls = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewAssertionRule' {[Text]
assertedControls :: [Text]
$sel:assertedControls:NewAssertionRule' :: NewAssertionRule -> [Text]
assertedControls} -> [Text]
assertedControls) (\s :: NewAssertionRule
s@NewAssertionRule' {} [Text]
a -> NewAssertionRule
s {$sel:assertedControls:NewAssertionRule' :: [Text]
assertedControls = [Text]
a} :: NewAssertionRule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
newAssertionRule_ruleConfig :: Lens.Lens' NewAssertionRule RuleConfig
newAssertionRule_ruleConfig :: Lens' NewAssertionRule RuleConfig
newAssertionRule_ruleConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewAssertionRule' {RuleConfig
ruleConfig :: RuleConfig
$sel:ruleConfig:NewAssertionRule' :: NewAssertionRule -> RuleConfig
ruleConfig} -> RuleConfig
ruleConfig) (\s :: NewAssertionRule
s@NewAssertionRule' {} RuleConfig
a -> NewAssertionRule
s {$sel:ruleConfig:NewAssertionRule' :: RuleConfig
ruleConfig = RuleConfig
a} :: NewAssertionRule)
newAssertionRule_waitPeriodMs :: Lens.Lens' NewAssertionRule Prelude.Int
newAssertionRule_waitPeriodMs :: Lens' NewAssertionRule Int
newAssertionRule_waitPeriodMs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewAssertionRule' {Int
waitPeriodMs :: Int
$sel:waitPeriodMs:NewAssertionRule' :: NewAssertionRule -> Int
waitPeriodMs} -> Int
waitPeriodMs) (\s :: NewAssertionRule
s@NewAssertionRule' {} Int
a -> NewAssertionRule
s {$sel:waitPeriodMs:NewAssertionRule' :: Int
waitPeriodMs = Int
a} :: NewAssertionRule)
newAssertionRule_name :: Lens.Lens' NewAssertionRule Prelude.Text
newAssertionRule_name :: Lens' NewAssertionRule Text
newAssertionRule_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewAssertionRule' {Text
name :: Text
$sel:name:NewAssertionRule' :: NewAssertionRule -> Text
name} -> Text
name) (\s :: NewAssertionRule
s@NewAssertionRule' {} Text
a -> NewAssertionRule
s {$sel:name:NewAssertionRule' :: Text
name = Text
a} :: NewAssertionRule)
instance Prelude.Hashable NewAssertionRule where
hashWithSalt :: Int -> NewAssertionRule -> Int
hashWithSalt Int
_salt NewAssertionRule' {Int
[Text]
Text
RuleConfig
name :: Text
waitPeriodMs :: Int
ruleConfig :: RuleConfig
assertedControls :: [Text]
controlPanelArn :: Text
$sel:name:NewAssertionRule' :: NewAssertionRule -> Text
$sel:waitPeriodMs:NewAssertionRule' :: NewAssertionRule -> Int
$sel:ruleConfig:NewAssertionRule' :: NewAssertionRule -> RuleConfig
$sel:assertedControls:NewAssertionRule' :: NewAssertionRule -> [Text]
$sel:controlPanelArn:NewAssertionRule' :: NewAssertionRule -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
controlPanelArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
assertedControls
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RuleConfig
ruleConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
waitPeriodMs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData NewAssertionRule where
rnf :: NewAssertionRule -> ()
rnf NewAssertionRule' {Int
[Text]
Text
RuleConfig
name :: Text
waitPeriodMs :: Int
ruleConfig :: RuleConfig
assertedControls :: [Text]
controlPanelArn :: Text
$sel:name:NewAssertionRule' :: NewAssertionRule -> Text
$sel:waitPeriodMs:NewAssertionRule' :: NewAssertionRule -> Int
$sel:ruleConfig:NewAssertionRule' :: NewAssertionRule -> RuleConfig
$sel:assertedControls:NewAssertionRule' :: NewAssertionRule -> [Text]
$sel:controlPanelArn:NewAssertionRule' :: NewAssertionRule -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
controlPanelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
assertedControls
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RuleConfig
ruleConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
waitPeriodMs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToJSON NewAssertionRule where
toJSON :: NewAssertionRule -> Value
toJSON NewAssertionRule' {Int
[Text]
Text
RuleConfig
name :: Text
waitPeriodMs :: Int
ruleConfig :: RuleConfig
assertedControls :: [Text]
controlPanelArn :: Text
$sel:name:NewAssertionRule' :: NewAssertionRule -> Text
$sel:waitPeriodMs:NewAssertionRule' :: NewAssertionRule -> Int
$sel:ruleConfig:NewAssertionRule' :: NewAssertionRule -> RuleConfig
$sel:assertedControls:NewAssertionRule' :: NewAssertionRule -> [Text]
$sel:controlPanelArn:NewAssertionRule' :: NewAssertionRule -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"ControlPanelArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
controlPanelArn),
forall a. a -> Maybe a
Prelude.Just
(Key
"AssertedControls" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
assertedControls),
forall a. a -> Maybe a
Prelude.Just (Key
"RuleConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RuleConfig
ruleConfig),
forall a. a -> Maybe a
Prelude.Just (Key
"WaitPeriodMs" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
waitPeriodMs),
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
]
)