{-# 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.NewGatingRule 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 NewGatingRule = NewGatingRule'
{
NewGatingRule -> [Text]
targetControls :: [Prelude.Text],
NewGatingRule -> Text
controlPanelArn :: Prelude.Text,
NewGatingRule -> [Text]
gatingControls :: [Prelude.Text],
NewGatingRule -> RuleConfig
ruleConfig :: RuleConfig,
NewGatingRule -> Int
waitPeriodMs :: Prelude.Int,
NewGatingRule -> Text
name :: Prelude.Text
}
deriving (NewGatingRule -> NewGatingRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewGatingRule -> NewGatingRule -> Bool
$c/= :: NewGatingRule -> NewGatingRule -> Bool
== :: NewGatingRule -> NewGatingRule -> Bool
$c== :: NewGatingRule -> NewGatingRule -> Bool
Prelude.Eq, ReadPrec [NewGatingRule]
ReadPrec NewGatingRule
Int -> ReadS NewGatingRule
ReadS [NewGatingRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NewGatingRule]
$creadListPrec :: ReadPrec [NewGatingRule]
readPrec :: ReadPrec NewGatingRule
$creadPrec :: ReadPrec NewGatingRule
readList :: ReadS [NewGatingRule]
$creadList :: ReadS [NewGatingRule]
readsPrec :: Int -> ReadS NewGatingRule
$creadsPrec :: Int -> ReadS NewGatingRule
Prelude.Read, Int -> NewGatingRule -> ShowS
[NewGatingRule] -> ShowS
NewGatingRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NewGatingRule] -> ShowS
$cshowList :: [NewGatingRule] -> ShowS
show :: NewGatingRule -> String
$cshow :: NewGatingRule -> String
showsPrec :: Int -> NewGatingRule -> ShowS
$cshowsPrec :: Int -> NewGatingRule -> ShowS
Prelude.Show, forall x. Rep NewGatingRule x -> NewGatingRule
forall x. NewGatingRule -> Rep NewGatingRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NewGatingRule x -> NewGatingRule
$cfrom :: forall x. NewGatingRule -> Rep NewGatingRule x
Prelude.Generic)
newNewGatingRule ::
Prelude.Text ->
RuleConfig ->
Prelude.Int ->
Prelude.Text ->
NewGatingRule
newNewGatingRule :: Text -> RuleConfig -> Int -> Text -> NewGatingRule
newNewGatingRule
Text
pControlPanelArn_
RuleConfig
pRuleConfig_
Int
pWaitPeriodMs_
Text
pName_ =
NewGatingRule'
{ $sel:targetControls:NewGatingRule' :: [Text]
targetControls = forall a. Monoid a => a
Prelude.mempty,
$sel:controlPanelArn:NewGatingRule' :: Text
controlPanelArn = Text
pControlPanelArn_,
$sel:gatingControls:NewGatingRule' :: [Text]
gatingControls = forall a. Monoid a => a
Prelude.mempty,
$sel:ruleConfig:NewGatingRule' :: RuleConfig
ruleConfig = RuleConfig
pRuleConfig_,
$sel:waitPeriodMs:NewGatingRule' :: Int
waitPeriodMs = Int
pWaitPeriodMs_,
$sel:name:NewGatingRule' :: Text
name = Text
pName_
}
newGatingRule_targetControls :: Lens.Lens' NewGatingRule [Prelude.Text]
newGatingRule_targetControls :: Lens' NewGatingRule [Text]
newGatingRule_targetControls = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewGatingRule' {[Text]
targetControls :: [Text]
$sel:targetControls:NewGatingRule' :: NewGatingRule -> [Text]
targetControls} -> [Text]
targetControls) (\s :: NewGatingRule
s@NewGatingRule' {} [Text]
a -> NewGatingRule
s {$sel:targetControls:NewGatingRule' :: [Text]
targetControls = [Text]
a} :: NewGatingRule) 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
newGatingRule_controlPanelArn :: Lens.Lens' NewGatingRule Prelude.Text
newGatingRule_controlPanelArn :: Lens' NewGatingRule Text
newGatingRule_controlPanelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewGatingRule' {Text
controlPanelArn :: Text
$sel:controlPanelArn:NewGatingRule' :: NewGatingRule -> Text
controlPanelArn} -> Text
controlPanelArn) (\s :: NewGatingRule
s@NewGatingRule' {} Text
a -> NewGatingRule
s {$sel:controlPanelArn:NewGatingRule' :: Text
controlPanelArn = Text
a} :: NewGatingRule)
newGatingRule_gatingControls :: Lens.Lens' NewGatingRule [Prelude.Text]
newGatingRule_gatingControls :: Lens' NewGatingRule [Text]
newGatingRule_gatingControls = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewGatingRule' {[Text]
gatingControls :: [Text]
$sel:gatingControls:NewGatingRule' :: NewGatingRule -> [Text]
gatingControls} -> [Text]
gatingControls) (\s :: NewGatingRule
s@NewGatingRule' {} [Text]
a -> NewGatingRule
s {$sel:gatingControls:NewGatingRule' :: [Text]
gatingControls = [Text]
a} :: NewGatingRule) 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
newGatingRule_ruleConfig :: Lens.Lens' NewGatingRule RuleConfig
newGatingRule_ruleConfig :: Lens' NewGatingRule RuleConfig
newGatingRule_ruleConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewGatingRule' {RuleConfig
ruleConfig :: RuleConfig
$sel:ruleConfig:NewGatingRule' :: NewGatingRule -> RuleConfig
ruleConfig} -> RuleConfig
ruleConfig) (\s :: NewGatingRule
s@NewGatingRule' {} RuleConfig
a -> NewGatingRule
s {$sel:ruleConfig:NewGatingRule' :: RuleConfig
ruleConfig = RuleConfig
a} :: NewGatingRule)
newGatingRule_waitPeriodMs :: Lens.Lens' NewGatingRule Prelude.Int
newGatingRule_waitPeriodMs :: Lens' NewGatingRule Int
newGatingRule_waitPeriodMs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewGatingRule' {Int
waitPeriodMs :: Int
$sel:waitPeriodMs:NewGatingRule' :: NewGatingRule -> Int
waitPeriodMs} -> Int
waitPeriodMs) (\s :: NewGatingRule
s@NewGatingRule' {} Int
a -> NewGatingRule
s {$sel:waitPeriodMs:NewGatingRule' :: Int
waitPeriodMs = Int
a} :: NewGatingRule)
newGatingRule_name :: Lens.Lens' NewGatingRule Prelude.Text
newGatingRule_name :: Lens' NewGatingRule Text
newGatingRule_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NewGatingRule' {Text
name :: Text
$sel:name:NewGatingRule' :: NewGatingRule -> Text
name} -> Text
name) (\s :: NewGatingRule
s@NewGatingRule' {} Text
a -> NewGatingRule
s {$sel:name:NewGatingRule' :: Text
name = Text
a} :: NewGatingRule)
instance Prelude.Hashable NewGatingRule where
hashWithSalt :: Int -> NewGatingRule -> Int
hashWithSalt Int
_salt NewGatingRule' {Int
[Text]
Text
RuleConfig
name :: Text
waitPeriodMs :: Int
ruleConfig :: RuleConfig
gatingControls :: [Text]
controlPanelArn :: Text
targetControls :: [Text]
$sel:name:NewGatingRule' :: NewGatingRule -> Text
$sel:waitPeriodMs:NewGatingRule' :: NewGatingRule -> Int
$sel:ruleConfig:NewGatingRule' :: NewGatingRule -> RuleConfig
$sel:gatingControls:NewGatingRule' :: NewGatingRule -> [Text]
$sel:controlPanelArn:NewGatingRule' :: NewGatingRule -> Text
$sel:targetControls:NewGatingRule' :: NewGatingRule -> [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
targetControls
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
controlPanelArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
gatingControls
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 NewGatingRule where
rnf :: NewGatingRule -> ()
rnf NewGatingRule' {Int
[Text]
Text
RuleConfig
name :: Text
waitPeriodMs :: Int
ruleConfig :: RuleConfig
gatingControls :: [Text]
controlPanelArn :: Text
targetControls :: [Text]
$sel:name:NewGatingRule' :: NewGatingRule -> Text
$sel:waitPeriodMs:NewGatingRule' :: NewGatingRule -> Int
$sel:ruleConfig:NewGatingRule' :: NewGatingRule -> RuleConfig
$sel:gatingControls:NewGatingRule' :: NewGatingRule -> [Text]
$sel:controlPanelArn:NewGatingRule' :: NewGatingRule -> Text
$sel:targetControls:NewGatingRule' :: NewGatingRule -> [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf [Text]
targetControls
seq :: forall a b. a -> b -> b
`Prelude.seq` 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]
gatingControls
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 NewGatingRule where
toJSON :: NewGatingRule -> Value
toJSON NewGatingRule' {Int
[Text]
Text
RuleConfig
name :: Text
waitPeriodMs :: Int
ruleConfig :: RuleConfig
gatingControls :: [Text]
controlPanelArn :: Text
targetControls :: [Text]
$sel:name:NewGatingRule' :: NewGatingRule -> Text
$sel:waitPeriodMs:NewGatingRule' :: NewGatingRule -> Int
$sel:ruleConfig:NewGatingRule' :: NewGatingRule -> RuleConfig
$sel:gatingControls:NewGatingRule' :: NewGatingRule -> [Text]
$sel:controlPanelArn:NewGatingRule' :: NewGatingRule -> Text
$sel:targetControls:NewGatingRule' :: NewGatingRule -> [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"TargetControls" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
targetControls),
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
"GatingControls" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
gatingControls),
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)
]
)