module Stratosphere.IoTEvents.AlarmModel.LambdaProperty (
        module Exports, LambdaProperty(..), mkLambdaProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoTEvents.AlarmModel.PayloadProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data LambdaProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotevents-alarmmodel-lambda.html>
    LambdaProperty {LambdaProperty -> ()
haddock_workaround_ :: (),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotevents-alarmmodel-lambda.html#cfn-iotevents-alarmmodel-lambda-functionarn>
                    LambdaProperty -> Value Text
functionArn :: (Value Prelude.Text),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotevents-alarmmodel-lambda.html#cfn-iotevents-alarmmodel-lambda-payload>
                    LambdaProperty -> Maybe PayloadProperty
payload :: (Prelude.Maybe PayloadProperty)}
  deriving stock (LambdaProperty -> LambdaProperty -> Bool
(LambdaProperty -> LambdaProperty -> Bool)
-> (LambdaProperty -> LambdaProperty -> Bool) -> Eq LambdaProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LambdaProperty -> LambdaProperty -> Bool
== :: LambdaProperty -> LambdaProperty -> Bool
$c/= :: LambdaProperty -> LambdaProperty -> Bool
/= :: LambdaProperty -> LambdaProperty -> Bool
Prelude.Eq, Int -> LambdaProperty -> ShowS
[LambdaProperty] -> ShowS
LambdaProperty -> String
(Int -> LambdaProperty -> ShowS)
-> (LambdaProperty -> String)
-> ([LambdaProperty] -> ShowS)
-> Show LambdaProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LambdaProperty -> ShowS
showsPrec :: Int -> LambdaProperty -> ShowS
$cshow :: LambdaProperty -> String
show :: LambdaProperty -> String
$cshowList :: [LambdaProperty] -> ShowS
showList :: [LambdaProperty] -> ShowS
Prelude.Show)
mkLambdaProperty :: Value Prelude.Text -> LambdaProperty
mkLambdaProperty :: Value Text -> LambdaProperty
mkLambdaProperty Value Text
functionArn
  = LambdaProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), functionArn :: Value Text
functionArn = Value Text
functionArn,
       payload :: Maybe PayloadProperty
payload = Maybe PayloadProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties LambdaProperty where
  toResourceProperties :: LambdaProperty -> ResourceProperties
toResourceProperties LambdaProperty {Maybe PayloadProperty
()
Value Text
haddock_workaround_ :: LambdaProperty -> ()
functionArn :: LambdaProperty -> Value Text
payload :: LambdaProperty -> Maybe PayloadProperty
haddock_workaround_ :: ()
functionArn :: Value Text
payload :: Maybe PayloadProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::IoTEvents::AlarmModel.Lambda",
         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
"FunctionArn" 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
functionArn]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> PayloadProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Payload" (PayloadProperty -> (Key, Value))
-> Maybe PayloadProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PayloadProperty
payload]))}
instance JSON.ToJSON LambdaProperty where
  toJSON :: LambdaProperty -> Value
toJSON LambdaProperty {Maybe PayloadProperty
()
Value Text
haddock_workaround_ :: LambdaProperty -> ()
functionArn :: LambdaProperty -> Value Text
payload :: LambdaProperty -> Maybe PayloadProperty
haddock_workaround_ :: ()
functionArn :: Value Text
payload :: Maybe PayloadProperty
..}
    = [(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
"FunctionArn" 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
functionArn]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> PayloadProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Payload" (PayloadProperty -> (Key, Value))
-> Maybe PayloadProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PayloadProperty
payload])))
instance Property "FunctionArn" LambdaProperty where
  type PropertyType "FunctionArn" LambdaProperty = Value Prelude.Text
  set :: PropertyType "FunctionArn" LambdaProperty
-> LambdaProperty -> LambdaProperty
set PropertyType "FunctionArn" LambdaProperty
newValue LambdaProperty {Maybe PayloadProperty
()
Value Text
haddock_workaround_ :: LambdaProperty -> ()
functionArn :: LambdaProperty -> Value Text
payload :: LambdaProperty -> Maybe PayloadProperty
haddock_workaround_ :: ()
functionArn :: Value Text
payload :: Maybe PayloadProperty
..}
    = LambdaProperty {functionArn :: Value Text
functionArn = PropertyType "FunctionArn" LambdaProperty
Value Text
newValue, Maybe PayloadProperty
()
haddock_workaround_ :: ()
payload :: Maybe PayloadProperty
haddock_workaround_ :: ()
payload :: Maybe PayloadProperty
..}
instance Property "Payload" LambdaProperty where
  type PropertyType "Payload" LambdaProperty = PayloadProperty
  set :: PropertyType "Payload" LambdaProperty
-> LambdaProperty -> LambdaProperty
set PropertyType "Payload" LambdaProperty
newValue LambdaProperty {Maybe PayloadProperty
()
Value Text
haddock_workaround_ :: LambdaProperty -> ()
functionArn :: LambdaProperty -> Value Text
payload :: LambdaProperty -> Maybe PayloadProperty
haddock_workaround_ :: ()
functionArn :: Value Text
payload :: Maybe PayloadProperty
..}
    = LambdaProperty {payload :: Maybe PayloadProperty
payload = PayloadProperty -> Maybe PayloadProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Payload" LambdaProperty
PayloadProperty
newValue, ()
Value Text
haddock_workaround_ :: ()
functionArn :: Value Text
haddock_workaround_ :: ()
functionArn :: Value Text
..}