{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $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 :: Lens' GatingRuleUpdate Text
gatingRuleUpdate_safetyRuleArn = 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 :: Lens' GatingRuleUpdate Int
gatingRuleUpdate_waitPeriodMs = 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 :: Lens' GatingRuleUpdate Text
gatingRuleUpdate_name = 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 where
hashWithSalt :: Int -> GatingRuleUpdate -> Int
hashWithSalt Int
_salt GatingRuleUpdate' {Int
Text
name :: Text
waitPeriodMs :: Int
safetyRuleArn :: Text
$sel:name:GatingRuleUpdate' :: GatingRuleUpdate -> Text
$sel:waitPeriodMs:GatingRuleUpdate' :: GatingRuleUpdate -> Int
$sel:safetyRuleArn:GatingRuleUpdate' :: GatingRuleUpdate -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
safetyRuleArn
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 GatingRuleUpdate where
rnf :: GatingRuleUpdate -> ()
rnf GatingRuleUpdate' {Int
Text
name :: Text
waitPeriodMs :: Int
safetyRuleArn :: Text
$sel:name:GatingRuleUpdate' :: GatingRuleUpdate -> Text
$sel:waitPeriodMs:GatingRuleUpdate' :: GatingRuleUpdate -> Int
$sel:safetyRuleArn:GatingRuleUpdate' :: GatingRuleUpdate -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
safetyRuleArn
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 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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"SafetyRuleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
safetyRuleArn),
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)
]
)