module Stratosphere.Greengrass.SubscriptionDefinition (
        module Exports, SubscriptionDefinition(..),
        mkSubscriptionDefinition
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Greengrass.SubscriptionDefinition.SubscriptionDefinitionVersionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data SubscriptionDefinition
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-subscriptiondefinition.html>
    SubscriptionDefinition {SubscriptionDefinition -> ()
haddock_workaround_ :: (),
                            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-subscriptiondefinition.html#cfn-greengrass-subscriptiondefinition-initialversion>
                            SubscriptionDefinition
-> Maybe SubscriptionDefinitionVersionProperty
initialVersion :: (Prelude.Maybe SubscriptionDefinitionVersionProperty),
                            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-subscriptiondefinition.html#cfn-greengrass-subscriptiondefinition-name>
                            SubscriptionDefinition -> Value Text
name :: (Value Prelude.Text),
                            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-subscriptiondefinition.html#cfn-greengrass-subscriptiondefinition-tags>
                            SubscriptionDefinition -> Maybe Object
tags :: (Prelude.Maybe JSON.Object)}
  deriving stock (SubscriptionDefinition -> SubscriptionDefinition -> Bool
(SubscriptionDefinition -> SubscriptionDefinition -> Bool)
-> (SubscriptionDefinition -> SubscriptionDefinition -> Bool)
-> Eq SubscriptionDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionDefinition -> SubscriptionDefinition -> Bool
== :: SubscriptionDefinition -> SubscriptionDefinition -> Bool
$c/= :: SubscriptionDefinition -> SubscriptionDefinition -> Bool
/= :: SubscriptionDefinition -> SubscriptionDefinition -> Bool
Prelude.Eq, Int -> SubscriptionDefinition -> ShowS
[SubscriptionDefinition] -> ShowS
SubscriptionDefinition -> String
(Int -> SubscriptionDefinition -> ShowS)
-> (SubscriptionDefinition -> String)
-> ([SubscriptionDefinition] -> ShowS)
-> Show SubscriptionDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionDefinition -> ShowS
showsPrec :: Int -> SubscriptionDefinition -> ShowS
$cshow :: SubscriptionDefinition -> String
show :: SubscriptionDefinition -> String
$cshowList :: [SubscriptionDefinition] -> ShowS
showList :: [SubscriptionDefinition] -> ShowS
Prelude.Show)
mkSubscriptionDefinition ::
  Value Prelude.Text -> SubscriptionDefinition
mkSubscriptionDefinition :: Value Text -> SubscriptionDefinition
mkSubscriptionDefinition Value Text
name
  = SubscriptionDefinition
      {haddock_workaround_ :: ()
haddock_workaround_ = (), name :: Value Text
name = Value Text
name,
       initialVersion :: Maybe SubscriptionDefinitionVersionProperty
initialVersion = Maybe SubscriptionDefinitionVersionProperty
forall a. Maybe a
Prelude.Nothing, tags :: Maybe Object
tags = Maybe Object
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SubscriptionDefinition where
  toResourceProperties :: SubscriptionDefinition -> ResourceProperties
toResourceProperties SubscriptionDefinition {Maybe Object
Maybe SubscriptionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: SubscriptionDefinition -> ()
initialVersion :: SubscriptionDefinition
-> Maybe SubscriptionDefinitionVersionProperty
name :: SubscriptionDefinition -> Value Text
tags :: SubscriptionDefinition -> Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe SubscriptionDefinitionVersionProperty
name :: Value Text
tags :: Maybe Object
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Greengrass::SubscriptionDefinition",
         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 -> SubscriptionDefinitionVersionProperty -> (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" (SubscriptionDefinitionVersionProperty -> (Key, Value))
-> Maybe SubscriptionDefinitionVersionProperty
-> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SubscriptionDefinitionVersionProperty
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 SubscriptionDefinition where
  toJSON :: SubscriptionDefinition -> Value
toJSON SubscriptionDefinition {Maybe Object
Maybe SubscriptionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: SubscriptionDefinition -> ()
initialVersion :: SubscriptionDefinition
-> Maybe SubscriptionDefinitionVersionProperty
name :: SubscriptionDefinition -> Value Text
tags :: SubscriptionDefinition -> Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe SubscriptionDefinitionVersionProperty
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 -> SubscriptionDefinitionVersionProperty -> (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" (SubscriptionDefinitionVersionProperty -> (Key, Value))
-> Maybe SubscriptionDefinitionVersionProperty
-> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SubscriptionDefinitionVersionProperty
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" SubscriptionDefinition where
  type PropertyType "InitialVersion" SubscriptionDefinition = SubscriptionDefinitionVersionProperty
  set :: PropertyType "InitialVersion" SubscriptionDefinition
-> SubscriptionDefinition -> SubscriptionDefinition
set PropertyType "InitialVersion" SubscriptionDefinition
newValue SubscriptionDefinition {Maybe Object
Maybe SubscriptionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: SubscriptionDefinition -> ()
initialVersion :: SubscriptionDefinition
-> Maybe SubscriptionDefinitionVersionProperty
name :: SubscriptionDefinition -> Value Text
tags :: SubscriptionDefinition -> Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe SubscriptionDefinitionVersionProperty
name :: Value Text
tags :: Maybe Object
..}
    = SubscriptionDefinition
        {initialVersion :: Maybe SubscriptionDefinitionVersionProperty
initialVersion = SubscriptionDefinitionVersionProperty
-> Maybe SubscriptionDefinitionVersionProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "InitialVersion" SubscriptionDefinition
SubscriptionDefinitionVersionProperty
newValue, Maybe Object
()
Value Text
haddock_workaround_ :: ()
name :: Value Text
tags :: Maybe Object
haddock_workaround_ :: ()
name :: Value Text
tags :: Maybe Object
..}
instance Property "Name" SubscriptionDefinition where
  type PropertyType "Name" SubscriptionDefinition = Value Prelude.Text
  set :: PropertyType "Name" SubscriptionDefinition
-> SubscriptionDefinition -> SubscriptionDefinition
set PropertyType "Name" SubscriptionDefinition
newValue SubscriptionDefinition {Maybe Object
Maybe SubscriptionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: SubscriptionDefinition -> ()
initialVersion :: SubscriptionDefinition
-> Maybe SubscriptionDefinitionVersionProperty
name :: SubscriptionDefinition -> Value Text
tags :: SubscriptionDefinition -> Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe SubscriptionDefinitionVersionProperty
name :: Value Text
tags :: Maybe Object
..}
    = SubscriptionDefinition {name :: Value Text
name = PropertyType "Name" SubscriptionDefinition
Value Text
newValue, Maybe Object
Maybe SubscriptionDefinitionVersionProperty
()
haddock_workaround_ :: ()
initialVersion :: Maybe SubscriptionDefinitionVersionProperty
tags :: Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe SubscriptionDefinitionVersionProperty
tags :: Maybe Object
..}
instance Property "Tags" SubscriptionDefinition where
  type PropertyType "Tags" SubscriptionDefinition = JSON.Object
  set :: PropertyType "Tags" SubscriptionDefinition
-> SubscriptionDefinition -> SubscriptionDefinition
set PropertyType "Tags" SubscriptionDefinition
newValue SubscriptionDefinition {Maybe Object
Maybe SubscriptionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: SubscriptionDefinition -> ()
initialVersion :: SubscriptionDefinition
-> Maybe SubscriptionDefinitionVersionProperty
name :: SubscriptionDefinition -> Value Text
tags :: SubscriptionDefinition -> Maybe Object
haddock_workaround_ :: ()
initialVersion :: Maybe SubscriptionDefinitionVersionProperty
name :: Value Text
tags :: Maybe Object
..}
    = SubscriptionDefinition {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" SubscriptionDefinition
newValue, Maybe SubscriptionDefinitionVersionProperty
()
Value Text
haddock_workaround_ :: ()
initialVersion :: Maybe SubscriptionDefinitionVersionProperty
name :: Value Text
haddock_workaround_ :: ()
initialVersion :: Maybe SubscriptionDefinitionVersionProperty
name :: Value Text
..}