module Stratosphere.ARCRegionSwitch.Plan ( module Exports, Plan(..), mkPlan ) where import qualified Data.Aeson as JSON import qualified Stratosphere.Prelude as Prelude import Stratosphere.Property import {-# SOURCE #-} Stratosphere.ARCRegionSwitch.Plan.AssociatedAlarmProperty as Exports import {-# SOURCE #-} Stratosphere.ARCRegionSwitch.Plan.TriggerProperty as Exports import {-# SOURCE #-} Stratosphere.ARCRegionSwitch.Plan.WorkflowProperty as Exports import Stratosphere.ResourceProperties import Stratosphere.Value data Plan = -- | See: Plan {haddock_workaround_ :: (), -- | See: associatedAlarms :: (Prelude.Maybe (Prelude.Map Prelude.Text AssociatedAlarmProperty)), -- | See: description :: (Prelude.Maybe (Value Prelude.Text)), -- | See: executionRole :: (Value Prelude.Text), -- | See: name :: (Value Prelude.Text), -- | See: primaryRegion :: (Prelude.Maybe (Value Prelude.Text)), -- | See: recoveryApproach :: (Value Prelude.Text), -- | See: recoveryTimeObjectiveMinutes :: (Prelude.Maybe (Value Prelude.Double)), -- | See: regions :: (ValueList Prelude.Text), -- | See: tags :: (Prelude.Maybe (Prelude.Map Prelude.Text (Value Prelude.Text))), -- | See: triggers :: (Prelude.Maybe [TriggerProperty]), -- | See: workflows :: [WorkflowProperty]} deriving stock (Prelude.Eq, Prelude.Show) mkPlan :: Value Prelude.Text -> Value Prelude.Text -> Value Prelude.Text -> ValueList Prelude.Text -> [WorkflowProperty] -> Plan mkPlan executionRole name recoveryApproach regions workflows = Plan {haddock_workaround_ = (), executionRole = executionRole, name = name, recoveryApproach = recoveryApproach, regions = regions, workflows = workflows, associatedAlarms = Prelude.Nothing, description = Prelude.Nothing, primaryRegion = Prelude.Nothing, recoveryTimeObjectiveMinutes = Prelude.Nothing, tags = Prelude.Nothing, triggers = Prelude.Nothing} instance ToResourceProperties Plan where toResourceProperties Plan {..} = ResourceProperties {awsType = "AWS::ARCRegionSwitch::Plan", supportsTags = Prelude.True, properties = Prelude.fromList ((Prelude.<>) ["ExecutionRole" JSON..= executionRole, "Name" JSON..= name, "RecoveryApproach" JSON..= recoveryApproach, "Regions" JSON..= regions, "Workflows" JSON..= workflows] (Prelude.catMaybes [(JSON..=) "AssociatedAlarms" Prelude.<$> associatedAlarms, (JSON..=) "Description" Prelude.<$> description, (JSON..=) "PrimaryRegion" Prelude.<$> primaryRegion, (JSON..=) "RecoveryTimeObjectiveMinutes" Prelude.<$> recoveryTimeObjectiveMinutes, (JSON..=) "Tags" Prelude.<$> tags, (JSON..=) "Triggers" Prelude.<$> triggers]))} instance JSON.ToJSON Plan where toJSON Plan {..} = JSON.object (Prelude.fromList ((Prelude.<>) ["ExecutionRole" JSON..= executionRole, "Name" JSON..= name, "RecoveryApproach" JSON..= recoveryApproach, "Regions" JSON..= regions, "Workflows" JSON..= workflows] (Prelude.catMaybes [(JSON..=) "AssociatedAlarms" Prelude.<$> associatedAlarms, (JSON..=) "Description" Prelude.<$> description, (JSON..=) "PrimaryRegion" Prelude.<$> primaryRegion, (JSON..=) "RecoveryTimeObjectiveMinutes" Prelude.<$> recoveryTimeObjectiveMinutes, (JSON..=) "Tags" Prelude.<$> tags, (JSON..=) "Triggers" Prelude.<$> triggers]))) instance Property "AssociatedAlarms" Plan where type PropertyType "AssociatedAlarms" Plan = Prelude.Map Prelude.Text AssociatedAlarmProperty set newValue Plan {..} = Plan {associatedAlarms = Prelude.pure newValue, ..} instance Property "Description" Plan where type PropertyType "Description" Plan = Value Prelude.Text set newValue Plan {..} = Plan {description = Prelude.pure newValue, ..} instance Property "ExecutionRole" Plan where type PropertyType "ExecutionRole" Plan = Value Prelude.Text set newValue Plan {..} = Plan {executionRole = newValue, ..} instance Property "Name" Plan where type PropertyType "Name" Plan = Value Prelude.Text set newValue Plan {..} = Plan {name = newValue, ..} instance Property "PrimaryRegion" Plan where type PropertyType "PrimaryRegion" Plan = Value Prelude.Text set newValue Plan {..} = Plan {primaryRegion = Prelude.pure newValue, ..} instance Property "RecoveryApproach" Plan where type PropertyType "RecoveryApproach" Plan = Value Prelude.Text set newValue Plan {..} = Plan {recoveryApproach = newValue, ..} instance Property "RecoveryTimeObjectiveMinutes" Plan where type PropertyType "RecoveryTimeObjectiveMinutes" Plan = Value Prelude.Double set newValue Plan {..} = Plan {recoveryTimeObjectiveMinutes = Prelude.pure newValue, ..} instance Property "Regions" Plan where type PropertyType "Regions" Plan = ValueList Prelude.Text set newValue Plan {..} = Plan {regions = newValue, ..} instance Property "Tags" Plan where type PropertyType "Tags" Plan = Prelude.Map Prelude.Text (Value Prelude.Text) set newValue Plan {..} = Plan {tags = Prelude.pure newValue, ..} instance Property "Triggers" Plan where type PropertyType "Triggers" Plan = [TriggerProperty] set newValue Plan {..} = Plan {triggers = Prelude.pure newValue, ..} instance Property "Workflows" Plan where type PropertyType "Workflows" Plan = [WorkflowProperty] set newValue Plan {..} = Plan {workflows = newValue, ..}