module Stratosphere.Greengrass.FunctionDefinition (
module Exports, FunctionDefinition(..), mkFunctionDefinition
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Greengrass.FunctionDefinition.FunctionDefinitionVersionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data FunctionDefinition
=
FunctionDefinition {FunctionDefinition -> ()
haddock_workaround_ :: (),
FunctionDefinition -> Maybe FunctionDefinitionVersionProperty
initialVersion :: (Prelude.Maybe FunctionDefinitionVersionProperty),
FunctionDefinition -> Value Text
name :: (Value Prelude.Text),
FunctionDefinition -> Maybe Object
tags :: (Prelude.Maybe JSON.Object)}
deriving stock (FunctionDefinition -> FunctionDefinition -> Bool
(FunctionDefinition -> FunctionDefinition -> Bool)
-> (FunctionDefinition -> FunctionDefinition -> Bool)
-> Eq FunctionDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FunctionDefinition -> FunctionDefinition -> Bool
== :: FunctionDefinition -> FunctionDefinition -> Bool
$c/= :: FunctionDefinition -> FunctionDefinition -> Bool
/= :: FunctionDefinition -> FunctionDefinition -> Bool
Prelude.Eq, Int -> FunctionDefinition -> ShowS
[FunctionDefinition] -> ShowS
FunctionDefinition -> String
(Int -> FunctionDefinition -> ShowS)
-> (FunctionDefinition -> String)
-> ([FunctionDefinition] -> ShowS)
-> Show FunctionDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FunctionDefinition -> ShowS
showsPrec :: Int -> FunctionDefinition -> ShowS
$cshow :: FunctionDefinition -> String
show :: FunctionDefinition -> String
$cshowList :: [FunctionDefinition] -> ShowS
showList :: [FunctionDefinition] -> ShowS
Prelude.Show)
mkFunctionDefinition :: Value Prelude.Text -> FunctionDefinition
mkFunctionDefinition :: Value Text -> FunctionDefinition
mkFunctionDefinition Value Text
name
= FunctionDefinition
{haddock_workaround_ :: ()
haddock_workaround_ = (), name :: Value Text
name = Value Text
name,
initialVersion :: Maybe FunctionDefinitionVersionProperty
initialVersion = Maybe FunctionDefinitionVersionProperty
forall a. Maybe a
Prelude.Nothing, tags :: Maybe Object
tags = Maybe Object
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties FunctionDefinition where
toResourceProperties :: FunctionDefinition -> ResourceProperties
toResourceProperties FunctionDefinition {Maybe Object
Maybe FunctionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: FunctionDefinition -> ()
initialVersion :: FunctionDefinition -> Maybe FunctionDefinitionVersionProperty
name :: FunctionDefinition -> Value Text
tags :: FunctionDefinition -> Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe FunctionDefinitionVersionProperty
name :: Value Text
tags :: Maybe Object
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::Greengrass::FunctionDefinition",
supportsTags :: Bool
supportsTags = Bool
Prelude.True,
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
"Name" 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
name]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> FunctionDefinitionVersionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"InitialVersion" (FunctionDefinitionVersionProperty -> (Key, Value))
-> Maybe FunctionDefinitionVersionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FunctionDefinitionVersionProperty
initialVersion,
Key -> Object -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" (Object -> (Key, Value)) -> Maybe Object -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Object
tags]))}
instance JSON.ToJSON FunctionDefinition where
toJSON :: FunctionDefinition -> Value
toJSON FunctionDefinition {Maybe Object
Maybe FunctionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: FunctionDefinition -> ()
initialVersion :: FunctionDefinition -> Maybe FunctionDefinitionVersionProperty
name :: FunctionDefinition -> Value Text
tags :: FunctionDefinition -> Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe FunctionDefinitionVersionProperty
name :: Value Text
tags :: Maybe Object
..}
= [(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
"Name" 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
name]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> FunctionDefinitionVersionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"InitialVersion" (FunctionDefinitionVersionProperty -> (Key, Value))
-> Maybe FunctionDefinitionVersionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FunctionDefinitionVersionProperty
initialVersion,
Key -> Object -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" (Object -> (Key, Value)) -> Maybe Object -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Object
tags])))
instance Property "InitialVersion" FunctionDefinition where
type PropertyType "InitialVersion" FunctionDefinition = FunctionDefinitionVersionProperty
set :: PropertyType "InitialVersion" FunctionDefinition
-> FunctionDefinition -> FunctionDefinition
set PropertyType "InitialVersion" FunctionDefinition
newValue FunctionDefinition {Maybe Object
Maybe FunctionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: FunctionDefinition -> ()
initialVersion :: FunctionDefinition -> Maybe FunctionDefinitionVersionProperty
name :: FunctionDefinition -> Value Text
tags :: FunctionDefinition -> Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe FunctionDefinitionVersionProperty
name :: Value Text
tags :: Maybe Object
..}
= FunctionDefinition {initialVersion :: Maybe FunctionDefinitionVersionProperty
initialVersion = FunctionDefinitionVersionProperty
-> Maybe FunctionDefinitionVersionProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "InitialVersion" FunctionDefinition
FunctionDefinitionVersionProperty
newValue, Maybe Object
()
Value Text
haddock_workaround_ :: ()
name :: Value Text
tags :: Maybe Object
haddock_workaround_ :: ()
name :: Value Text
tags :: Maybe Object
..}
instance Property "Name" FunctionDefinition where
type PropertyType "Name" FunctionDefinition = Value Prelude.Text
set :: PropertyType "Name" FunctionDefinition
-> FunctionDefinition -> FunctionDefinition
set PropertyType "Name" FunctionDefinition
newValue FunctionDefinition {Maybe Object
Maybe FunctionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: FunctionDefinition -> ()
initialVersion :: FunctionDefinition -> Maybe FunctionDefinitionVersionProperty
name :: FunctionDefinition -> Value Text
tags :: FunctionDefinition -> Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe FunctionDefinitionVersionProperty
name :: Value Text
tags :: Maybe Object
..}
= FunctionDefinition {name :: Value Text
name = PropertyType "Name" FunctionDefinition
Value Text
newValue, Maybe Object
Maybe FunctionDefinitionVersionProperty
()
haddock_workaround_ :: ()
initialVersion :: Maybe FunctionDefinitionVersionProperty
tags :: Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe FunctionDefinitionVersionProperty
tags :: Maybe Object
..}
instance Property "Tags" FunctionDefinition where
type PropertyType "Tags" FunctionDefinition = JSON.Object
set :: PropertyType "Tags" FunctionDefinition
-> FunctionDefinition -> FunctionDefinition
set PropertyType "Tags" FunctionDefinition
newValue FunctionDefinition {Maybe Object
Maybe FunctionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: FunctionDefinition -> ()
initialVersion :: FunctionDefinition -> Maybe FunctionDefinitionVersionProperty
name :: FunctionDefinition -> Value Text
tags :: FunctionDefinition -> Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe FunctionDefinitionVersionProperty
name :: Value Text
tags :: Maybe Object
..}
= FunctionDefinition {tags :: Maybe Object
tags = Object -> Maybe Object
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure Object
PropertyType "Tags" FunctionDefinition
newValue, Maybe FunctionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: ()
initialVersion :: Maybe FunctionDefinitionVersionProperty
name :: Value Text
haddock_workaround_ :: ()
initialVersion :: Maybe FunctionDefinitionVersionProperty
name :: Value Text
..}