{-# 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.GatingRuleUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GatingRuleUpdate = GatingRuleUpdate'
{
GatingRuleUpdate -> Text
safetyRuleArn :: Prelude.Text,
GatingRuleUpdate -> Int
waitPeriodMs :: Prelude.Int,
GatingRuleUpdate -> Text
name :: Prelude.Text
}
deriving (GatingRuleUpdate -> GatingRuleUpdate -> Bool
(GatingRuleUpdate -> GatingRuleUpdate -> Bool)
-> (GatingRuleUpdate -> GatingRuleUpdate -> Bool)
-> Eq GatingRuleUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GatingRuleUpdate -> GatingRuleUpdate -> Bool
$c/= :: GatingRuleUpdate -> GatingRuleUpdate -> Bool
== :: GatingRuleUpdate -> GatingRuleUpdate -> Bool
$c== :: GatingRuleUpdate -> GatingRuleUpdate -> Bool
Prelude.Eq, ReadPrec [GatingRuleUpdate]
ReadPrec GatingRuleUpdate
Int -> ReadS GatingRuleUpdate
ReadS [GatingRuleUpdate]
(Int -> ReadS GatingRuleUpdate)
-> ReadS [GatingRuleUpdate]
-> ReadPrec GatingRuleUpdate
-> ReadPrec [GatingRuleUpdate]
-> Read GatingRuleUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GatingRuleUpdate]
$creadListPrec :: ReadPrec [GatingRuleUpdate]
readPrec :: ReadPrec GatingRuleUpdate
$creadPrec :: ReadPrec GatingRuleUpdate
readList :: ReadS [GatingRuleUpdate]
$creadList :: ReadS [GatingRuleUpdate]
readsPrec :: Int -> ReadS GatingRuleUpdate
$creadsPrec :: Int -> ReadS GatingRuleUpdate
Prelude.Read, Int -> GatingRuleUpdate -> ShowS
[GatingRuleUpdate] -> ShowS
GatingRuleUpdate -> String
(Int -> GatingRuleUpdate -> ShowS)
-> (GatingRuleUpdate -> String)
-> ([GatingRuleUpdate] -> ShowS)
-> Show GatingRuleUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GatingRuleUpdate] -> ShowS
$cshowList :: [GatingRuleUpdate] -> ShowS
show :: GatingRuleUpdate -> String
$cshow :: GatingRuleUpdate -> String
showsPrec :: Int -> GatingRuleUpdate -> ShowS
$cshowsPrec :: Int -> GatingRuleUpdate -> ShowS
Prelude.Show, (forall x. GatingRuleUpdate -> Rep GatingRuleUpdate x)
-> (forall x. Rep GatingRuleUpdate x -> GatingRuleUpdate)
-> Generic GatingRuleUpdate
forall x. Rep GatingRuleUpdate x -> GatingRuleUpdate
forall x. GatingRuleUpdate -> Rep GatingRuleUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GatingRuleUpdate x -> GatingRuleUpdate
$cfrom :: forall x. GatingRuleUpdate -> Rep GatingRuleUpdate x
Prelude.Generic)
newGatingRuleUpdate ::
Prelude.Text ->
Prelude.Int ->
Prelude.Text ->
GatingRuleUpdate
newGatingRuleUpdate :: Text -> Int -> Text -> GatingRuleUpdate
newGatingRuleUpdate
Text
pSafetyRuleArn_
Int
pWaitPeriodMs_
Text
pName_ =
GatingRuleUpdate' :: Text -> Int -> Text -> GatingRuleUpdate
GatingRuleUpdate'
{ $sel:safetyRuleArn:GatingRuleUpdate' :: Text
safetyRuleArn = Text
pSafetyRuleArn_,
$sel:waitPeriodMs:GatingRuleUpdate' :: Int
waitPeriodMs = Int
pWaitPeriodMs_,
$sel:name:GatingRuleUpdate' :: Text
name = Text
pName_
}
gatingRuleUpdate_safetyRuleArn :: Lens.Lens' GatingRuleUpdate Prelude.Text
gatingRuleUpdate_safetyRuleArn :: (Text -> f Text) -> GatingRuleUpdate -> f GatingRuleUpdate
gatingRuleUpdate_safetyRuleArn = (GatingRuleUpdate -> Text)
-> (GatingRuleUpdate -> Text -> GatingRuleUpdate)
-> Lens GatingRuleUpdate GatingRuleUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatingRuleUpdate' {Text
safetyRuleArn :: Text
$sel:safetyRuleArn:GatingRuleUpdate' :: GatingRuleUpdate -> Text
safetyRuleArn} -> Text
safetyRuleArn) (\s :: GatingRuleUpdate
s@GatingRuleUpdate' {} Text
a -> GatingRuleUpdate
s {$sel:safetyRuleArn:GatingRuleUpdate' :: Text
safetyRuleArn = Text
a} :: GatingRuleUpdate)
gatingRuleUpdate_waitPeriodMs :: Lens.Lens' GatingRuleUpdate Prelude.Int
gatingRuleUpdate_waitPeriodMs :: (Int -> f Int) -> GatingRuleUpdate -> f GatingRuleUpdate
gatingRuleUpdate_waitPeriodMs = (GatingRuleUpdate -> Int)
-> (GatingRuleUpdate -> Int -> GatingRuleUpdate)
-> Lens GatingRuleUpdate GatingRuleUpdate Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatingRuleUpdate' {Int
waitPeriodMs :: Int
$sel:waitPeriodMs:GatingRuleUpdate' :: GatingRuleUpdate -> Int
waitPeriodMs} -> Int
waitPeriodMs) (\s :: GatingRuleUpdate
s@GatingRuleUpdate' {} Int
a -> GatingRuleUpdate
s {$sel:waitPeriodMs:GatingRuleUpdate' :: Int
waitPeriodMs = Int
a} :: GatingRuleUpdate)
gatingRuleUpdate_name :: Lens.Lens' GatingRuleUpdate Prelude.Text
gatingRuleUpdate_name :: (Text -> f Text) -> GatingRuleUpdate -> f GatingRuleUpdate
gatingRuleUpdate_name = (GatingRuleUpdate -> Text)
-> (GatingRuleUpdate -> Text -> GatingRuleUpdate)
-> Lens GatingRuleUpdate GatingRuleUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatingRuleUpdate' {Text
name :: Text
$sel:name:GatingRuleUpdate' :: GatingRuleUpdate -> Text
name} -> Text
name) (\s :: GatingRuleUpdate
s@GatingRuleUpdate' {} Text
a -> GatingRuleUpdate
s {$sel:name:GatingRuleUpdate' :: Text
name = Text
a} :: GatingRuleUpdate)
instance Prelude.Hashable GatingRuleUpdate
instance Prelude.NFData GatingRuleUpdate
instance Core.ToJSON GatingRuleUpdate where
toJSON :: GatingRuleUpdate -> Value
toJSON GatingRuleUpdate' {Int
Text
name :: Text
waitPeriodMs :: Int
safetyRuleArn :: Text
$sel:name:GatingRuleUpdate' :: GatingRuleUpdate -> Text
$sel:waitPeriodMs:GatingRuleUpdate' :: GatingRuleUpdate -> Int
$sel:safetyRuleArn:GatingRuleUpdate' :: GatingRuleUpdate -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SafetyRuleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
safetyRuleArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WaitPeriodMs" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
waitPeriodMs),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)