module Stratosphere.CloudFront.Distribution.DefinitionProperty (
        module Exports, DefinitionProperty(..), mkDefinitionProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.CloudFront.Distribution.StringSchemaProperty as Exports
import Stratosphere.ResourceProperties
data DefinitionProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-definition.html>
    DefinitionProperty {DefinitionProperty -> ()
haddock_workaround_ :: (),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-definition.html#cfn-cloudfront-distribution-definition-stringschema>
                        DefinitionProperty -> Maybe StringSchemaProperty
stringSchema :: (Prelude.Maybe StringSchemaProperty)}
  deriving stock (DefinitionProperty -> DefinitionProperty -> Bool
(DefinitionProperty -> DefinitionProperty -> Bool)
-> (DefinitionProperty -> DefinitionProperty -> Bool)
-> Eq DefinitionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DefinitionProperty -> DefinitionProperty -> Bool
== :: DefinitionProperty -> DefinitionProperty -> Bool
$c/= :: DefinitionProperty -> DefinitionProperty -> Bool
/= :: DefinitionProperty -> DefinitionProperty -> Bool
Prelude.Eq, Int -> DefinitionProperty -> ShowS
[DefinitionProperty] -> ShowS
DefinitionProperty -> String
(Int -> DefinitionProperty -> ShowS)
-> (DefinitionProperty -> String)
-> ([DefinitionProperty] -> ShowS)
-> Show DefinitionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DefinitionProperty -> ShowS
showsPrec :: Int -> DefinitionProperty -> ShowS
$cshow :: DefinitionProperty -> String
show :: DefinitionProperty -> String
$cshowList :: [DefinitionProperty] -> ShowS
showList :: [DefinitionProperty] -> ShowS
Prelude.Show)
mkDefinitionProperty :: DefinitionProperty
mkDefinitionProperty :: DefinitionProperty
mkDefinitionProperty
  = DefinitionProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), stringSchema :: Maybe StringSchemaProperty
stringSchema = Maybe StringSchemaProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties DefinitionProperty where
  toResourceProperties :: DefinitionProperty -> ResourceProperties
toResourceProperties DefinitionProperty {Maybe StringSchemaProperty
()
haddock_workaround_ :: DefinitionProperty -> ()
stringSchema :: DefinitionProperty -> Maybe StringSchemaProperty
haddock_workaround_ :: ()
stringSchema :: Maybe StringSchemaProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CloudFront::Distribution.Definition",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> StringSchemaProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"StringSchema" (StringSchemaProperty -> (Key, Value))
-> Maybe StringSchemaProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StringSchemaProperty
stringSchema])}
instance JSON.ToJSON DefinitionProperty where
  toJSON :: DefinitionProperty -> Value
toJSON DefinitionProperty {Maybe StringSchemaProperty
()
haddock_workaround_ :: DefinitionProperty -> ()
stringSchema :: DefinitionProperty -> Maybe StringSchemaProperty
haddock_workaround_ :: ()
stringSchema :: Maybe StringSchemaProperty
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> StringSchemaProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"StringSchema" (StringSchemaProperty -> (Key, Value))
-> Maybe StringSchemaProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StringSchemaProperty
stringSchema]))
instance Property "StringSchema" DefinitionProperty where
  type PropertyType "StringSchema" DefinitionProperty = StringSchemaProperty
  set :: PropertyType "StringSchema" DefinitionProperty
-> DefinitionProperty -> DefinitionProperty
set PropertyType "StringSchema" DefinitionProperty
newValue DefinitionProperty {Maybe StringSchemaProperty
()
haddock_workaround_ :: DefinitionProperty -> ()
stringSchema :: DefinitionProperty -> Maybe StringSchemaProperty
haddock_workaround_ :: ()
stringSchema :: Maybe StringSchemaProperty
..}
    = DefinitionProperty {stringSchema :: Maybe StringSchemaProperty
stringSchema = StringSchemaProperty -> Maybe StringSchemaProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "StringSchema" DefinitionProperty
StringSchemaProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}