module Stratosphere.Greengrass.FunctionDefinitionVersion (
        module Exports, FunctionDefinitionVersion(..),
        mkFunctionDefinitionVersion
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Greengrass.FunctionDefinitionVersion.DefaultConfigProperty as Exports
import {-# SOURCE #-} Stratosphere.Greengrass.FunctionDefinitionVersion.FunctionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data FunctionDefinitionVersion
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-functiondefinitionversion.html>
    FunctionDefinitionVersion {FunctionDefinitionVersion -> ()
haddock_workaround_ :: (),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-functiondefinitionversion.html#cfn-greengrass-functiondefinitionversion-defaultconfig>
                               FunctionDefinitionVersion -> Maybe DefaultConfigProperty
defaultConfig :: (Prelude.Maybe DefaultConfigProperty),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-functiondefinitionversion.html#cfn-greengrass-functiondefinitionversion-functiondefinitionid>
                               FunctionDefinitionVersion -> Value Text
functionDefinitionId :: (Value Prelude.Text),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-functiondefinitionversion.html#cfn-greengrass-functiondefinitionversion-functions>
                               FunctionDefinitionVersion -> [FunctionProperty]
functions :: [FunctionProperty]}
  deriving stock (FunctionDefinitionVersion -> FunctionDefinitionVersion -> Bool
(FunctionDefinitionVersion -> FunctionDefinitionVersion -> Bool)
-> (FunctionDefinitionVersion -> FunctionDefinitionVersion -> Bool)
-> Eq FunctionDefinitionVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FunctionDefinitionVersion -> FunctionDefinitionVersion -> Bool
== :: FunctionDefinitionVersion -> FunctionDefinitionVersion -> Bool
$c/= :: FunctionDefinitionVersion -> FunctionDefinitionVersion -> Bool
/= :: FunctionDefinitionVersion -> FunctionDefinitionVersion -> Bool
Prelude.Eq, Int -> FunctionDefinitionVersion -> ShowS
[FunctionDefinitionVersion] -> ShowS
FunctionDefinitionVersion -> String
(Int -> FunctionDefinitionVersion -> ShowS)
-> (FunctionDefinitionVersion -> String)
-> ([FunctionDefinitionVersion] -> ShowS)
-> Show FunctionDefinitionVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FunctionDefinitionVersion -> ShowS
showsPrec :: Int -> FunctionDefinitionVersion -> ShowS
$cshow :: FunctionDefinitionVersion -> String
show :: FunctionDefinitionVersion -> String
$cshowList :: [FunctionDefinitionVersion] -> ShowS
showList :: [FunctionDefinitionVersion] -> ShowS
Prelude.Show)
mkFunctionDefinitionVersion ::
  Value Prelude.Text
  -> [FunctionProperty] -> FunctionDefinitionVersion
mkFunctionDefinitionVersion :: Value Text -> [FunctionProperty] -> FunctionDefinitionVersion
mkFunctionDefinitionVersion Value Text
functionDefinitionId [FunctionProperty]
functions
  = FunctionDefinitionVersion
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       functionDefinitionId :: Value Text
functionDefinitionId = Value Text
functionDefinitionId, functions :: [FunctionProperty]
functions = [FunctionProperty]
functions,
       defaultConfig :: Maybe DefaultConfigProperty
defaultConfig = Maybe DefaultConfigProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties FunctionDefinitionVersion where
  toResourceProperties :: FunctionDefinitionVersion -> ResourceProperties
toResourceProperties FunctionDefinitionVersion {[FunctionProperty]
Maybe DefaultConfigProperty
()
Value Text
haddock_workaround_ :: FunctionDefinitionVersion -> ()
defaultConfig :: FunctionDefinitionVersion -> Maybe DefaultConfigProperty
functionDefinitionId :: FunctionDefinitionVersion -> Value Text
functions :: FunctionDefinitionVersion -> [FunctionProperty]
haddock_workaround_ :: ()
defaultConfig :: Maybe DefaultConfigProperty
functionDefinitionId :: Value Text
functions :: [FunctionProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Greengrass::FunctionDefinitionVersion",
         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
"FunctionDefinitionId" 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
functionDefinitionId,
                            Key
"Functions" Key -> [FunctionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [FunctionProperty]
functions]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> DefaultConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DefaultConfig" (DefaultConfigProperty -> (Key, Value))
-> Maybe DefaultConfigProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DefaultConfigProperty
defaultConfig]))}
instance JSON.ToJSON FunctionDefinitionVersion where
  toJSON :: FunctionDefinitionVersion -> Value
toJSON FunctionDefinitionVersion {[FunctionProperty]
Maybe DefaultConfigProperty
()
Value Text
haddock_workaround_ :: FunctionDefinitionVersion -> ()
defaultConfig :: FunctionDefinitionVersion -> Maybe DefaultConfigProperty
functionDefinitionId :: FunctionDefinitionVersion -> Value Text
functions :: FunctionDefinitionVersion -> [FunctionProperty]
haddock_workaround_ :: ()
defaultConfig :: Maybe DefaultConfigProperty
functionDefinitionId :: Value Text
functions :: [FunctionProperty]
..}
    = [(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
"FunctionDefinitionId" 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
functionDefinitionId,
               Key
"Functions" Key -> [FunctionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [FunctionProperty]
functions]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> DefaultConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DefaultConfig" (DefaultConfigProperty -> (Key, Value))
-> Maybe DefaultConfigProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DefaultConfigProperty
defaultConfig])))
instance Property "DefaultConfig" FunctionDefinitionVersion where
  type PropertyType "DefaultConfig" FunctionDefinitionVersion = DefaultConfigProperty
  set :: PropertyType "DefaultConfig" FunctionDefinitionVersion
-> FunctionDefinitionVersion -> FunctionDefinitionVersion
set PropertyType "DefaultConfig" FunctionDefinitionVersion
newValue FunctionDefinitionVersion {[FunctionProperty]
Maybe DefaultConfigProperty
()
Value Text
haddock_workaround_ :: FunctionDefinitionVersion -> ()
defaultConfig :: FunctionDefinitionVersion -> Maybe DefaultConfigProperty
functionDefinitionId :: FunctionDefinitionVersion -> Value Text
functions :: FunctionDefinitionVersion -> [FunctionProperty]
haddock_workaround_ :: ()
defaultConfig :: Maybe DefaultConfigProperty
functionDefinitionId :: Value Text
functions :: [FunctionProperty]
..}
    = FunctionDefinitionVersion
        {defaultConfig :: Maybe DefaultConfigProperty
defaultConfig = DefaultConfigProperty -> Maybe DefaultConfigProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "DefaultConfig" FunctionDefinitionVersion
DefaultConfigProperty
newValue, [FunctionProperty]
()
Value Text
haddock_workaround_ :: ()
functionDefinitionId :: Value Text
functions :: [FunctionProperty]
haddock_workaround_ :: ()
functionDefinitionId :: Value Text
functions :: [FunctionProperty]
..}
instance Property "FunctionDefinitionId" FunctionDefinitionVersion where
  type PropertyType "FunctionDefinitionId" FunctionDefinitionVersion = Value Prelude.Text
  set :: PropertyType "FunctionDefinitionId" FunctionDefinitionVersion
-> FunctionDefinitionVersion -> FunctionDefinitionVersion
set PropertyType "FunctionDefinitionId" FunctionDefinitionVersion
newValue FunctionDefinitionVersion {[FunctionProperty]
Maybe DefaultConfigProperty
()
Value Text
haddock_workaround_ :: FunctionDefinitionVersion -> ()
defaultConfig :: FunctionDefinitionVersion -> Maybe DefaultConfigProperty
functionDefinitionId :: FunctionDefinitionVersion -> Value Text
functions :: FunctionDefinitionVersion -> [FunctionProperty]
haddock_workaround_ :: ()
defaultConfig :: Maybe DefaultConfigProperty
functionDefinitionId :: Value Text
functions :: [FunctionProperty]
..}
    = FunctionDefinitionVersion {functionDefinitionId :: Value Text
functionDefinitionId = PropertyType "FunctionDefinitionId" FunctionDefinitionVersion
Value Text
newValue, [FunctionProperty]
Maybe DefaultConfigProperty
()
haddock_workaround_ :: ()
defaultConfig :: Maybe DefaultConfigProperty
functions :: [FunctionProperty]
haddock_workaround_ :: ()
defaultConfig :: Maybe DefaultConfigProperty
functions :: [FunctionProperty]
..}
instance Property "Functions" FunctionDefinitionVersion where
  type PropertyType "Functions" FunctionDefinitionVersion = [FunctionProperty]
  set :: PropertyType "Functions" FunctionDefinitionVersion
-> FunctionDefinitionVersion -> FunctionDefinitionVersion
set PropertyType "Functions" FunctionDefinitionVersion
newValue FunctionDefinitionVersion {[FunctionProperty]
Maybe DefaultConfigProperty
()
Value Text
haddock_workaround_ :: FunctionDefinitionVersion -> ()
defaultConfig :: FunctionDefinitionVersion -> Maybe DefaultConfigProperty
functionDefinitionId :: FunctionDefinitionVersion -> Value Text
functions :: FunctionDefinitionVersion -> [FunctionProperty]
haddock_workaround_ :: ()
defaultConfig :: Maybe DefaultConfigProperty
functionDefinitionId :: Value Text
functions :: [FunctionProperty]
..}
    = FunctionDefinitionVersion {functions :: [FunctionProperty]
functions = [FunctionProperty]
PropertyType "Functions" FunctionDefinitionVersion
newValue, Maybe DefaultConfigProperty
()
Value Text
haddock_workaround_ :: ()
defaultConfig :: Maybe DefaultConfigProperty
functionDefinitionId :: Value Text
haddock_workaround_ :: ()
defaultConfig :: Maybe DefaultConfigProperty
functionDefinitionId :: Value Text
..}