module Stratosphere.IoTThingsGraph.FlowTemplate (
        module Exports, FlowTemplate(..), mkFlowTemplate
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoTThingsGraph.FlowTemplate.DefinitionDocumentProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data FlowTemplate
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotthingsgraph-flowtemplate.html>
    FlowTemplate {FlowTemplate -> ()
haddock_workaround_ :: (),
                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotthingsgraph-flowtemplate.html#cfn-iotthingsgraph-flowtemplate-compatiblenamespaceversion>
                  FlowTemplate -> Maybe (Value Double)
compatibleNamespaceVersion :: (Prelude.Maybe (Value Prelude.Double)),
                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotthingsgraph-flowtemplate.html#cfn-iotthingsgraph-flowtemplate-definition>
                  FlowTemplate -> DefinitionDocumentProperty
definition :: DefinitionDocumentProperty}
  deriving stock (FlowTemplate -> FlowTemplate -> Bool
(FlowTemplate -> FlowTemplate -> Bool)
-> (FlowTemplate -> FlowTemplate -> Bool) -> Eq FlowTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FlowTemplate -> FlowTemplate -> Bool
== :: FlowTemplate -> FlowTemplate -> Bool
$c/= :: FlowTemplate -> FlowTemplate -> Bool
/= :: FlowTemplate -> FlowTemplate -> Bool
Prelude.Eq, Int -> FlowTemplate -> ShowS
[FlowTemplate] -> ShowS
FlowTemplate -> String
(Int -> FlowTemplate -> ShowS)
-> (FlowTemplate -> String)
-> ([FlowTemplate] -> ShowS)
-> Show FlowTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FlowTemplate -> ShowS
showsPrec :: Int -> FlowTemplate -> ShowS
$cshow :: FlowTemplate -> String
show :: FlowTemplate -> String
$cshowList :: [FlowTemplate] -> ShowS
showList :: [FlowTemplate] -> ShowS
Prelude.Show)
mkFlowTemplate :: DefinitionDocumentProperty -> FlowTemplate
mkFlowTemplate :: DefinitionDocumentProperty -> FlowTemplate
mkFlowTemplate DefinitionDocumentProperty
definition
  = FlowTemplate
      {haddock_workaround_ :: ()
haddock_workaround_ = (), definition :: DefinitionDocumentProperty
definition = DefinitionDocumentProperty
definition,
       compatibleNamespaceVersion :: Maybe (Value Double)
compatibleNamespaceVersion = Maybe (Value Double)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties FlowTemplate where
  toResourceProperties :: FlowTemplate -> ResourceProperties
toResourceProperties FlowTemplate {Maybe (Value Double)
()
DefinitionDocumentProperty
haddock_workaround_ :: FlowTemplate -> ()
compatibleNamespaceVersion :: FlowTemplate -> Maybe (Value Double)
definition :: FlowTemplate -> DefinitionDocumentProperty
haddock_workaround_ :: ()
compatibleNamespaceVersion :: Maybe (Value Double)
definition :: DefinitionDocumentProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::IoTThingsGraph::FlowTemplate",
         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
"Definition" Key -> DefinitionDocumentProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= DefinitionDocumentProperty
definition]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CompatibleNamespaceVersion"
                                 (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
compatibleNamespaceVersion]))}
instance JSON.ToJSON FlowTemplate where
  toJSON :: FlowTemplate -> Value
toJSON FlowTemplate {Maybe (Value Double)
()
DefinitionDocumentProperty
haddock_workaround_ :: FlowTemplate -> ()
compatibleNamespaceVersion :: FlowTemplate -> Maybe (Value Double)
definition :: FlowTemplate -> DefinitionDocumentProperty
haddock_workaround_ :: ()
compatibleNamespaceVersion :: Maybe (Value Double)
definition :: DefinitionDocumentProperty
..}
    = [(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
"Definition" Key -> DefinitionDocumentProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= DefinitionDocumentProperty
definition]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CompatibleNamespaceVersion"
                    (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
compatibleNamespaceVersion])))
instance Property "CompatibleNamespaceVersion" FlowTemplate where
  type PropertyType "CompatibleNamespaceVersion" FlowTemplate = Value Prelude.Double
  set :: PropertyType "CompatibleNamespaceVersion" FlowTemplate
-> FlowTemplate -> FlowTemplate
set PropertyType "CompatibleNamespaceVersion" FlowTemplate
newValue FlowTemplate {Maybe (Value Double)
()
DefinitionDocumentProperty
haddock_workaround_ :: FlowTemplate -> ()
compatibleNamespaceVersion :: FlowTemplate -> Maybe (Value Double)
definition :: FlowTemplate -> DefinitionDocumentProperty
haddock_workaround_ :: ()
compatibleNamespaceVersion :: Maybe (Value Double)
definition :: DefinitionDocumentProperty
..}
    = FlowTemplate
        {compatibleNamespaceVersion :: Maybe (Value Double)
compatibleNamespaceVersion = Value Double -> Maybe (Value Double)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CompatibleNamespaceVersion" FlowTemplate
Value Double
newValue, ()
DefinitionDocumentProperty
haddock_workaround_ :: ()
definition :: DefinitionDocumentProperty
haddock_workaround_ :: ()
definition :: DefinitionDocumentProperty
..}
instance Property "Definition" FlowTemplate where
  type PropertyType "Definition" FlowTemplate = DefinitionDocumentProperty
  set :: PropertyType "Definition" FlowTemplate
-> FlowTemplate -> FlowTemplate
set PropertyType "Definition" FlowTemplate
newValue FlowTemplate {Maybe (Value Double)
()
DefinitionDocumentProperty
haddock_workaround_ :: FlowTemplate -> ()
compatibleNamespaceVersion :: FlowTemplate -> Maybe (Value Double)
definition :: FlowTemplate -> DefinitionDocumentProperty
haddock_workaround_ :: ()
compatibleNamespaceVersion :: Maybe (Value Double)
definition :: DefinitionDocumentProperty
..}
    = FlowTemplate {definition :: DefinitionDocumentProperty
definition = PropertyType "Definition" FlowTemplate
DefinitionDocumentProperty
newValue, Maybe (Value Double)
()
haddock_workaround_ :: ()
compatibleNamespaceVersion :: Maybe (Value Double)
haddock_workaround_ :: ()
compatibleNamespaceVersion :: Maybe (Value Double)
..}