module Stratosphere.SSMContacts.Plan.StageProperty (
        module Exports, StageProperty(..), mkStageProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.SSMContacts.Plan.TargetsProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data StageProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssmcontacts-plan-stage.html>
    StageProperty {StageProperty -> ()
haddock_workaround_ :: (),
                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssmcontacts-plan-stage.html#cfn-ssmcontacts-plan-stage-durationinminutes>
                   StageProperty -> Value Integer
durationInMinutes :: (Value Prelude.Integer),
                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssmcontacts-plan-stage.html#cfn-ssmcontacts-plan-stage-targets>
                   StageProperty -> Maybe [TargetsProperty]
targets :: (Prelude.Maybe [TargetsProperty])}
  deriving stock (StageProperty -> StageProperty -> Bool
(StageProperty -> StageProperty -> Bool)
-> (StageProperty -> StageProperty -> Bool) -> Eq StageProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StageProperty -> StageProperty -> Bool
== :: StageProperty -> StageProperty -> Bool
$c/= :: StageProperty -> StageProperty -> Bool
/= :: StageProperty -> StageProperty -> Bool
Prelude.Eq, Int -> StageProperty -> ShowS
[StageProperty] -> ShowS
StageProperty -> String
(Int -> StageProperty -> ShowS)
-> (StageProperty -> String)
-> ([StageProperty] -> ShowS)
-> Show StageProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StageProperty -> ShowS
showsPrec :: Int -> StageProperty -> ShowS
$cshow :: StageProperty -> String
show :: StageProperty -> String
$cshowList :: [StageProperty] -> ShowS
showList :: [StageProperty] -> ShowS
Prelude.Show)
mkStageProperty :: Value Prelude.Integer -> StageProperty
mkStageProperty :: Value Integer -> StageProperty
mkStageProperty Value Integer
durationInMinutes
  = StageProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), durationInMinutes :: Value Integer
durationInMinutes = Value Integer
durationInMinutes,
       targets :: Maybe [TargetsProperty]
targets = Maybe [TargetsProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties StageProperty where
  toResourceProperties :: StageProperty -> ResourceProperties
toResourceProperties StageProperty {Maybe [TargetsProperty]
()
Value Integer
haddock_workaround_ :: StageProperty -> ()
durationInMinutes :: StageProperty -> Value Integer
targets :: StageProperty -> Maybe [TargetsProperty]
haddock_workaround_ :: ()
durationInMinutes :: Value Integer
targets :: Maybe [TargetsProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::SSMContacts::Plan.Stage",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         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
"DurationInMinutes" Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Integer
durationInMinutes]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [TargetsProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Targets" ([TargetsProperty] -> (Key, Value))
-> Maybe [TargetsProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TargetsProperty]
targets]))}
instance JSON.ToJSON StageProperty where
  toJSON :: StageProperty -> Value
toJSON StageProperty {Maybe [TargetsProperty]
()
Value Integer
haddock_workaround_ :: StageProperty -> ()
durationInMinutes :: StageProperty -> Value Integer
targets :: StageProperty -> Maybe [TargetsProperty]
haddock_workaround_ :: ()
durationInMinutes :: Value Integer
targets :: Maybe [TargetsProperty]
..}
    = [(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
"DurationInMinutes" Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Integer
durationInMinutes]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [TargetsProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Targets" ([TargetsProperty] -> (Key, Value))
-> Maybe [TargetsProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TargetsProperty]
targets])))
instance Property "DurationInMinutes" StageProperty where
  type PropertyType "DurationInMinutes" StageProperty = Value Prelude.Integer
  set :: PropertyType "DurationInMinutes" StageProperty
-> StageProperty -> StageProperty
set PropertyType "DurationInMinutes" StageProperty
newValue StageProperty {Maybe [TargetsProperty]
()
Value Integer
haddock_workaround_ :: StageProperty -> ()
durationInMinutes :: StageProperty -> Value Integer
targets :: StageProperty -> Maybe [TargetsProperty]
haddock_workaround_ :: ()
durationInMinutes :: Value Integer
targets :: Maybe [TargetsProperty]
..}
    = StageProperty {durationInMinutes :: Value Integer
durationInMinutes = PropertyType "DurationInMinutes" StageProperty
Value Integer
newValue, Maybe [TargetsProperty]
()
haddock_workaround_ :: ()
targets :: Maybe [TargetsProperty]
haddock_workaround_ :: ()
targets :: Maybe [TargetsProperty]
..}
instance Property "Targets" StageProperty where
  type PropertyType "Targets" StageProperty = [TargetsProperty]
  set :: PropertyType "Targets" StageProperty
-> StageProperty -> StageProperty
set PropertyType "Targets" StageProperty
newValue StageProperty {Maybe [TargetsProperty]
()
Value Integer
haddock_workaround_ :: StageProperty -> ()
durationInMinutes :: StageProperty -> Value Integer
targets :: StageProperty -> Maybe [TargetsProperty]
haddock_workaround_ :: ()
durationInMinutes :: Value Integer
targets :: Maybe [TargetsProperty]
..}
    = StageProperty {targets :: Maybe [TargetsProperty]
targets = [TargetsProperty] -> Maybe [TargetsProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [TargetsProperty]
PropertyType "Targets" StageProperty
newValue, ()
Value Integer
haddock_workaround_ :: ()
durationInMinutes :: Value Integer
haddock_workaround_ :: ()
durationInMinutes :: Value Integer
..}