{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $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 :: Lens' AssertionRuleUpdate Text
assertionRuleUpdate_safetyRuleArn = 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 :: Lens' AssertionRuleUpdate Int
assertionRuleUpdate_waitPeriodMs = 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 :: Lens' AssertionRuleUpdate Text
assertionRuleUpdate_name = 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 where
hashWithSalt :: Int -> AssertionRuleUpdate -> Int
hashWithSalt Int
_salt AssertionRuleUpdate' {Int
Text
name :: Text
waitPeriodMs :: Int
safetyRuleArn :: Text
$sel:name:AssertionRuleUpdate' :: AssertionRuleUpdate -> Text
$sel:waitPeriodMs:AssertionRuleUpdate' :: AssertionRuleUpdate -> Int
$sel:safetyRuleArn:AssertionRuleUpdate' :: AssertionRuleUpdate -> 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 AssertionRuleUpdate where
rnf :: AssertionRuleUpdate -> ()
rnf AssertionRuleUpdate' {Int
Text
name :: Text
waitPeriodMs :: Int
safetyRuleArn :: Text
$sel:name:AssertionRuleUpdate' :: AssertionRuleUpdate -> Text
$sel:waitPeriodMs:AssertionRuleUpdate' :: AssertionRuleUpdate -> Int
$sel:safetyRuleArn:AssertionRuleUpdate' :: AssertionRuleUpdate -> 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 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
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)
]
)