{-# 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.AssertionRuleUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssertionRuleUpdate = AssertionRuleUpdate'
{
AssertionRuleUpdate -> Text
safetyRuleArn :: Prelude.Text,
AssertionRuleUpdate -> Int
waitPeriodMs :: Prelude.Int,
AssertionRuleUpdate -> Text
name :: Prelude.Text
}
deriving (AssertionRuleUpdate -> AssertionRuleUpdate -> Bool
(AssertionRuleUpdate -> AssertionRuleUpdate -> Bool)
-> (AssertionRuleUpdate -> AssertionRuleUpdate -> Bool)
-> Eq AssertionRuleUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssertionRuleUpdate -> AssertionRuleUpdate -> Bool
$c/= :: AssertionRuleUpdate -> AssertionRuleUpdate -> Bool
== :: AssertionRuleUpdate -> AssertionRuleUpdate -> Bool
$c== :: AssertionRuleUpdate -> AssertionRuleUpdate -> Bool
Prelude.Eq, ReadPrec [AssertionRuleUpdate]
ReadPrec AssertionRuleUpdate
Int -> ReadS AssertionRuleUpdate
ReadS [AssertionRuleUpdate]
(Int -> ReadS AssertionRuleUpdate)
-> ReadS [AssertionRuleUpdate]
-> ReadPrec AssertionRuleUpdate
-> ReadPrec [AssertionRuleUpdate]
-> Read AssertionRuleUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssertionRuleUpdate]
$creadListPrec :: ReadPrec [AssertionRuleUpdate]
readPrec :: ReadPrec AssertionRuleUpdate
$creadPrec :: ReadPrec AssertionRuleUpdate
readList :: ReadS [AssertionRuleUpdate]
$creadList :: ReadS [AssertionRuleUpdate]
readsPrec :: Int -> ReadS AssertionRuleUpdate
$creadsPrec :: Int -> ReadS AssertionRuleUpdate
Prelude.Read, Int -> AssertionRuleUpdate -> ShowS
[AssertionRuleUpdate] -> ShowS
AssertionRuleUpdate -> String
(Int -> AssertionRuleUpdate -> ShowS)
-> (AssertionRuleUpdate -> String)
-> ([AssertionRuleUpdate] -> ShowS)
-> Show AssertionRuleUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssertionRuleUpdate] -> ShowS
$cshowList :: [AssertionRuleUpdate] -> ShowS
show :: AssertionRuleUpdate -> String
$cshow :: AssertionRuleUpdate -> String
showsPrec :: Int -> AssertionRuleUpdate -> ShowS
$cshowsPrec :: Int -> AssertionRuleUpdate -> ShowS
Prelude.Show, (forall x. AssertionRuleUpdate -> Rep AssertionRuleUpdate x)
-> (forall x. Rep AssertionRuleUpdate x -> AssertionRuleUpdate)
-> Generic AssertionRuleUpdate
forall x. Rep AssertionRuleUpdate x -> AssertionRuleUpdate
forall x. AssertionRuleUpdate -> Rep AssertionRuleUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssertionRuleUpdate x -> AssertionRuleUpdate
$cfrom :: forall x. AssertionRuleUpdate -> Rep AssertionRuleUpdate x
Prelude.Generic)
newAssertionRuleUpdate ::
Prelude.Text ->
Prelude.Int ->
Prelude.Text ->
AssertionRuleUpdate
newAssertionRuleUpdate :: Text -> Int -> Text -> AssertionRuleUpdate
newAssertionRuleUpdate
Text
pSafetyRuleArn_
Int
pWaitPeriodMs_
Text
pName_ =
AssertionRuleUpdate' :: Text -> Int -> Text -> AssertionRuleUpdate
AssertionRuleUpdate'
{ $sel:safetyRuleArn:AssertionRuleUpdate' :: Text
safetyRuleArn =
Text
pSafetyRuleArn_,
$sel:waitPeriodMs:AssertionRuleUpdate' :: Int
waitPeriodMs = Int
pWaitPeriodMs_,
$sel:name:AssertionRuleUpdate' :: Text
name = Text
pName_
}
assertionRuleUpdate_safetyRuleArn :: Lens.Lens' AssertionRuleUpdate Prelude.Text
assertionRuleUpdate_safetyRuleArn :: (Text -> f Text) -> AssertionRuleUpdate -> f AssertionRuleUpdate
assertionRuleUpdate_safetyRuleArn = (AssertionRuleUpdate -> Text)
-> (AssertionRuleUpdate -> Text -> AssertionRuleUpdate)
-> Lens AssertionRuleUpdate AssertionRuleUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssertionRuleUpdate' {Text
safetyRuleArn :: Text
$sel:safetyRuleArn:AssertionRuleUpdate' :: AssertionRuleUpdate -> Text
safetyRuleArn} -> Text
safetyRuleArn) (\s :: AssertionRuleUpdate
s@AssertionRuleUpdate' {} Text
a -> AssertionRuleUpdate
s {$sel:safetyRuleArn:AssertionRuleUpdate' :: Text
safetyRuleArn = Text
a} :: AssertionRuleUpdate)
assertionRuleUpdate_waitPeriodMs :: Lens.Lens' AssertionRuleUpdate Prelude.Int
assertionRuleUpdate_waitPeriodMs :: (Int -> f Int) -> AssertionRuleUpdate -> f AssertionRuleUpdate
assertionRuleUpdate_waitPeriodMs = (AssertionRuleUpdate -> Int)
-> (AssertionRuleUpdate -> Int -> AssertionRuleUpdate)
-> Lens AssertionRuleUpdate AssertionRuleUpdate Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssertionRuleUpdate' {Int
waitPeriodMs :: Int
$sel:waitPeriodMs:AssertionRuleUpdate' :: AssertionRuleUpdate -> Int
waitPeriodMs} -> Int
waitPeriodMs) (\s :: AssertionRuleUpdate
s@AssertionRuleUpdate' {} Int
a -> AssertionRuleUpdate
s {$sel:waitPeriodMs:AssertionRuleUpdate' :: Int
waitPeriodMs = Int
a} :: AssertionRuleUpdate)
assertionRuleUpdate_name :: Lens.Lens' AssertionRuleUpdate Prelude.Text
assertionRuleUpdate_name :: (Text -> f Text) -> AssertionRuleUpdate -> f AssertionRuleUpdate
assertionRuleUpdate_name = (AssertionRuleUpdate -> Text)
-> (AssertionRuleUpdate -> Text -> AssertionRuleUpdate)
-> Lens AssertionRuleUpdate AssertionRuleUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssertionRuleUpdate' {Text
name :: Text
$sel:name:AssertionRuleUpdate' :: AssertionRuleUpdate -> Text
name} -> Text
name) (\s :: AssertionRuleUpdate
s@AssertionRuleUpdate' {} Text
a -> AssertionRuleUpdate
s {$sel:name:AssertionRuleUpdate' :: Text
name = Text
a} :: AssertionRuleUpdate)
instance Prelude.Hashable AssertionRuleUpdate
instance Prelude.NFData AssertionRuleUpdate
instance Core.ToJSON AssertionRuleUpdate where
toJSON :: AssertionRuleUpdate -> Value
toJSON AssertionRuleUpdate' {Int
Text
name :: Text
waitPeriodMs :: Int
safetyRuleArn :: Text
$sel:name:AssertionRuleUpdate' :: AssertionRuleUpdate -> Text
$sel:waitPeriodMs:AssertionRuleUpdate' :: AssertionRuleUpdate -> Int
$sel:safetyRuleArn:AssertionRuleUpdate' :: AssertionRuleUpdate -> 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)
]
)