module Stratosphere.Route53RecoveryControl.SafetyRule (
        module Exports, SafetyRule(..), mkSafetyRule
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Route53RecoveryControl.SafetyRule.AssertionRuleProperty as Exports
import {-# SOURCE #-} Stratosphere.Route53RecoveryControl.SafetyRule.GatingRuleProperty as Exports
import {-# SOURCE #-} Stratosphere.Route53RecoveryControl.SafetyRule.RuleConfigProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data SafetyRule
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html>
    SafetyRule {SafetyRule -> ()
haddock_workaround_ :: (),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html#cfn-route53recoverycontrol-safetyrule-assertionrule>
                SafetyRule -> Maybe AssertionRuleProperty
assertionRule :: (Prelude.Maybe AssertionRuleProperty),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html#cfn-route53recoverycontrol-safetyrule-controlpanelarn>
                SafetyRule -> Value Text
controlPanelArn :: (Value Prelude.Text),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html#cfn-route53recoverycontrol-safetyrule-gatingrule>
                SafetyRule -> Maybe GatingRuleProperty
gatingRule :: (Prelude.Maybe GatingRuleProperty),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html#cfn-route53recoverycontrol-safetyrule-name>
                SafetyRule -> Value Text
name :: (Value Prelude.Text),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html#cfn-route53recoverycontrol-safetyrule-ruleconfig>
                SafetyRule -> RuleConfigProperty
ruleConfig :: RuleConfigProperty,
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53recoverycontrol-safetyrule.html#cfn-route53recoverycontrol-safetyrule-tags>
                SafetyRule -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (SafetyRule -> SafetyRule -> Bool
(SafetyRule -> SafetyRule -> Bool)
-> (SafetyRule -> SafetyRule -> Bool) -> Eq SafetyRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SafetyRule -> SafetyRule -> Bool
== :: SafetyRule -> SafetyRule -> Bool
$c/= :: SafetyRule -> SafetyRule -> Bool
/= :: SafetyRule -> SafetyRule -> Bool
Prelude.Eq, Int -> SafetyRule -> ShowS
[SafetyRule] -> ShowS
SafetyRule -> String
(Int -> SafetyRule -> ShowS)
-> (SafetyRule -> String)
-> ([SafetyRule] -> ShowS)
-> Show SafetyRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SafetyRule -> ShowS
showsPrec :: Int -> SafetyRule -> ShowS
$cshow :: SafetyRule -> String
show :: SafetyRule -> String
$cshowList :: [SafetyRule] -> ShowS
showList :: [SafetyRule] -> ShowS
Prelude.Show)
mkSafetyRule ::
  Value Prelude.Text
  -> Value Prelude.Text -> RuleConfigProperty -> SafetyRule
mkSafetyRule :: Value Text -> Value Text -> RuleConfigProperty -> SafetyRule
mkSafetyRule Value Text
controlPanelArn Value Text
name RuleConfigProperty
ruleConfig
  = SafetyRule
      {haddock_workaround_ :: ()
haddock_workaround_ = (), controlPanelArn :: Value Text
controlPanelArn = Value Text
controlPanelArn,
       name :: Value Text
name = Value Text
name, ruleConfig :: RuleConfigProperty
ruleConfig = RuleConfigProperty
ruleConfig,
       assertionRule :: Maybe AssertionRuleProperty
assertionRule = Maybe AssertionRuleProperty
forall a. Maybe a
Prelude.Nothing, gatingRule :: Maybe GatingRuleProperty
gatingRule = Maybe GatingRuleProperty
forall a. Maybe a
Prelude.Nothing,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SafetyRule where
  toResourceProperties :: SafetyRule -> ResourceProperties
toResourceProperties SafetyRule {Maybe [Tag]
Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: SafetyRule -> ()
assertionRule :: SafetyRule -> Maybe AssertionRuleProperty
controlPanelArn :: SafetyRule -> Value Text
gatingRule :: SafetyRule -> Maybe GatingRuleProperty
name :: SafetyRule -> Value Text
ruleConfig :: SafetyRule -> RuleConfigProperty
tags :: SafetyRule -> Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Route53RecoveryControl::SafetyRule",
         supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"ControlPanelArn" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
controlPanelArn, Key
"Name" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
name,
                            Key
"RuleConfig" Key -> RuleConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= RuleConfigProperty
ruleConfig]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> AssertionRuleProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AssertionRule" (AssertionRuleProperty -> (Key, Value))
-> Maybe AssertionRuleProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AssertionRuleProperty
assertionRule,
                               Key -> GatingRuleProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"GatingRule" (GatingRuleProperty -> (Key, Value))
-> Maybe GatingRuleProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GatingRuleProperty
gatingRule,
                               Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON SafetyRule where
  toJSON :: SafetyRule -> Value
toJSON SafetyRule {Maybe [Tag]
Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: SafetyRule -> ()
assertionRule :: SafetyRule -> Maybe AssertionRuleProperty
controlPanelArn :: SafetyRule -> Value Text
gatingRule :: SafetyRule -> Maybe GatingRuleProperty
name :: SafetyRule -> Value Text
ruleConfig :: SafetyRule -> RuleConfigProperty
tags :: SafetyRule -> Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"ControlPanelArn" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
controlPanelArn, Key
"Name" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
name,
               Key
"RuleConfig" Key -> RuleConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= RuleConfigProperty
ruleConfig]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> AssertionRuleProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AssertionRule" (AssertionRuleProperty -> (Key, Value))
-> Maybe AssertionRuleProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AssertionRuleProperty
assertionRule,
                  Key -> GatingRuleProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"GatingRule" (GatingRuleProperty -> (Key, Value))
-> Maybe GatingRuleProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GatingRuleProperty
gatingRule,
                  Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "AssertionRule" SafetyRule where
  type PropertyType "AssertionRule" SafetyRule = AssertionRuleProperty
  set :: PropertyType "AssertionRule" SafetyRule -> SafetyRule -> SafetyRule
set PropertyType "AssertionRule" SafetyRule
newValue SafetyRule {Maybe [Tag]
Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: SafetyRule -> ()
assertionRule :: SafetyRule -> Maybe AssertionRuleProperty
controlPanelArn :: SafetyRule -> Value Text
gatingRule :: SafetyRule -> Maybe GatingRuleProperty
name :: SafetyRule -> Value Text
ruleConfig :: SafetyRule -> RuleConfigProperty
tags :: SafetyRule -> Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..}
    = SafetyRule {assertionRule :: Maybe AssertionRuleProperty
assertionRule = AssertionRuleProperty -> Maybe AssertionRuleProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AssertionRule" SafetyRule
AssertionRuleProperty
newValue, Maybe [Tag]
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: ()
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..}
instance Property "ControlPanelArn" SafetyRule where
  type PropertyType "ControlPanelArn" SafetyRule = Value Prelude.Text
  set :: PropertyType "ControlPanelArn" SafetyRule
-> SafetyRule -> SafetyRule
set PropertyType "ControlPanelArn" SafetyRule
newValue SafetyRule {Maybe [Tag]
Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: SafetyRule -> ()
assertionRule :: SafetyRule -> Maybe AssertionRuleProperty
controlPanelArn :: SafetyRule -> Value Text
gatingRule :: SafetyRule -> Maybe GatingRuleProperty
name :: SafetyRule -> Value Text
ruleConfig :: SafetyRule -> RuleConfigProperty
tags :: SafetyRule -> Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..}
    = SafetyRule {controlPanelArn :: Value Text
controlPanelArn = PropertyType "ControlPanelArn" SafetyRule
Value Text
newValue, Maybe [Tag]
Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..}
instance Property "GatingRule" SafetyRule where
  type PropertyType "GatingRule" SafetyRule = GatingRuleProperty
  set :: PropertyType "GatingRule" SafetyRule -> SafetyRule -> SafetyRule
set PropertyType "GatingRule" SafetyRule
newValue SafetyRule {Maybe [Tag]
Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: SafetyRule -> ()
assertionRule :: SafetyRule -> Maybe AssertionRuleProperty
controlPanelArn :: SafetyRule -> Value Text
gatingRule :: SafetyRule -> Maybe GatingRuleProperty
name :: SafetyRule -> Value Text
ruleConfig :: SafetyRule -> RuleConfigProperty
tags :: SafetyRule -> Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..}
    = SafetyRule {gatingRule :: Maybe GatingRuleProperty
gatingRule = GatingRuleProperty -> Maybe GatingRuleProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "GatingRule" SafetyRule
GatingRuleProperty
newValue, Maybe [Tag]
Maybe AssertionRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..}
instance Property "Name" SafetyRule where
  type PropertyType "Name" SafetyRule = Value Prelude.Text
  set :: PropertyType "Name" SafetyRule -> SafetyRule -> SafetyRule
set PropertyType "Name" SafetyRule
newValue SafetyRule {Maybe [Tag]
Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: SafetyRule -> ()
assertionRule :: SafetyRule -> Maybe AssertionRuleProperty
controlPanelArn :: SafetyRule -> Value Text
gatingRule :: SafetyRule -> Maybe GatingRuleProperty
name :: SafetyRule -> Value Text
ruleConfig :: SafetyRule -> RuleConfigProperty
tags :: SafetyRule -> Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..} = SafetyRule {name :: Value Text
name = PropertyType "Name" SafetyRule
Value Text
newValue, Maybe [Tag]
Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..}
instance Property "RuleConfig" SafetyRule where
  type PropertyType "RuleConfig" SafetyRule = RuleConfigProperty
  set :: PropertyType "RuleConfig" SafetyRule -> SafetyRule -> SafetyRule
set PropertyType "RuleConfig" SafetyRule
newValue SafetyRule {Maybe [Tag]
Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: SafetyRule -> ()
assertionRule :: SafetyRule -> Maybe AssertionRuleProperty
controlPanelArn :: SafetyRule -> Value Text
gatingRule :: SafetyRule -> Maybe GatingRuleProperty
name :: SafetyRule -> Value Text
ruleConfig :: SafetyRule -> RuleConfigProperty
tags :: SafetyRule -> Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..}
    = SafetyRule {ruleConfig :: RuleConfigProperty
ruleConfig = PropertyType "RuleConfig" SafetyRule
RuleConfigProperty
newValue, Maybe [Tag]
Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Tags" SafetyRule where
  type PropertyType "Tags" SafetyRule = [Tag]
  set :: PropertyType "Tags" SafetyRule -> SafetyRule -> SafetyRule
set PropertyType "Tags" SafetyRule
newValue SafetyRule {Maybe [Tag]
Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: SafetyRule -> ()
assertionRule :: SafetyRule -> Maybe AssertionRuleProperty
controlPanelArn :: SafetyRule -> Value Text
gatingRule :: SafetyRule -> Maybe GatingRuleProperty
name :: SafetyRule -> Value Text
ruleConfig :: SafetyRule -> RuleConfigProperty
tags :: SafetyRule -> Maybe [Tag]
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
tags :: Maybe [Tag]
..}
    = SafetyRule {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" SafetyRule
newValue, Maybe AssertionRuleProperty
Maybe GatingRuleProperty
()
Value Text
RuleConfigProperty
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
haddock_workaround_ :: ()
assertionRule :: Maybe AssertionRuleProperty
controlPanelArn :: Value Text
gatingRule :: Maybe GatingRuleProperty
name :: Value Text
ruleConfig :: RuleConfigProperty
..}