module Stratosphere.CloudFront.Function (
        module Exports, Function(..), mkFunction
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.CloudFront.Function.FunctionConfigProperty as Exports
import {-# SOURCE #-} Stratosphere.CloudFront.Function.FunctionMetadataProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Function
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html>
    Function {Function -> ()
haddock_workaround_ :: (),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-autopublish>
              Function -> Maybe (Value Bool)
autoPublish :: (Prelude.Maybe (Value Prelude.Bool)),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-functioncode>
              Function -> Value Text
functionCode :: (Value Prelude.Text),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-functionconfig>
              Function -> FunctionConfigProperty
functionConfig :: FunctionConfigProperty,
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-functionmetadata>
              Function -> Maybe FunctionMetadataProperty
functionMetadata :: (Prelude.Maybe FunctionMetadataProperty),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-name>
              Function -> Value Text
name :: (Value Prelude.Text)}
  deriving stock (Function -> Function -> Bool
(Function -> Function -> Bool)
-> (Function -> Function -> Bool) -> Eq Function
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Function -> Function -> Bool
== :: Function -> Function -> Bool
$c/= :: Function -> Function -> Bool
/= :: Function -> Function -> Bool
Prelude.Eq, Int -> Function -> ShowS
[Function] -> ShowS
Function -> String
(Int -> Function -> ShowS)
-> (Function -> String) -> ([Function] -> ShowS) -> Show Function
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Function -> ShowS
showsPrec :: Int -> Function -> ShowS
$cshow :: Function -> String
show :: Function -> String
$cshowList :: [Function] -> ShowS
showList :: [Function] -> ShowS
Prelude.Show)
mkFunction ::
  Value Prelude.Text
  -> FunctionConfigProperty -> Value Prelude.Text -> Function
mkFunction :: Value Text -> FunctionConfigProperty -> Value Text -> Function
mkFunction Value Text
functionCode FunctionConfigProperty
functionConfig Value Text
name
  = Function
      {haddock_workaround_ :: ()
haddock_workaround_ = (), functionCode :: Value Text
functionCode = Value Text
functionCode,
       functionConfig :: FunctionConfigProperty
functionConfig = FunctionConfigProperty
functionConfig, name :: Value Text
name = Value Text
name,
       autoPublish :: Maybe (Value Bool)
autoPublish = Maybe (Value Bool)
forall a. Maybe a
Prelude.Nothing, functionMetadata :: Maybe FunctionMetadataProperty
functionMetadata = Maybe FunctionMetadataProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Function where
  toResourceProperties :: Function -> ResourceProperties
toResourceProperties Function {Maybe (Value Bool)
Maybe FunctionMetadataProperty
()
Value Text
FunctionConfigProperty
haddock_workaround_ :: Function -> ()
autoPublish :: Function -> Maybe (Value Bool)
functionCode :: Function -> Value Text
functionConfig :: Function -> FunctionConfigProperty
functionMetadata :: Function -> Maybe FunctionMetadataProperty
name :: Function -> Value Text
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CloudFront::Function",
         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
"FunctionCode" 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
functionCode,
                            Key
"FunctionConfig" Key -> FunctionConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= FunctionConfigProperty
functionConfig, 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 -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AutoPublish" (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
autoPublish,
                               Key -> FunctionMetadataProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"FunctionMetadata" (FunctionMetadataProperty -> (Key, Value))
-> Maybe FunctionMetadataProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FunctionMetadataProperty
functionMetadata]))}
instance JSON.ToJSON Function where
  toJSON :: Function -> Value
toJSON Function {Maybe (Value Bool)
Maybe FunctionMetadataProperty
()
Value Text
FunctionConfigProperty
haddock_workaround_ :: Function -> ()
autoPublish :: Function -> Maybe (Value Bool)
functionCode :: Function -> Value Text
functionConfig :: Function -> FunctionConfigProperty
functionMetadata :: Function -> Maybe FunctionMetadataProperty
name :: Function -> Value Text
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
..}
    = [(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
"FunctionCode" 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
functionCode,
               Key
"FunctionConfig" Key -> FunctionConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= FunctionConfigProperty
functionConfig, 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 -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AutoPublish" (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
autoPublish,
                  Key -> FunctionMetadataProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"FunctionMetadata" (FunctionMetadataProperty -> (Key, Value))
-> Maybe FunctionMetadataProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FunctionMetadataProperty
functionMetadata])))
instance Property "AutoPublish" Function where
  type PropertyType "AutoPublish" Function = Value Prelude.Bool
  set :: PropertyType "AutoPublish" Function -> Function -> Function
set PropertyType "AutoPublish" Function
newValue Function {Maybe (Value Bool)
Maybe FunctionMetadataProperty
()
Value Text
FunctionConfigProperty
haddock_workaround_ :: Function -> ()
autoPublish :: Function -> Maybe (Value Bool)
functionCode :: Function -> Value Text
functionConfig :: Function -> FunctionConfigProperty
functionMetadata :: Function -> Maybe FunctionMetadataProperty
name :: Function -> Value Text
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
..}
    = Function {autoPublish :: Maybe (Value Bool)
autoPublish = Value Bool -> Maybe (Value Bool)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AutoPublish" Function
Value Bool
newValue, Maybe FunctionMetadataProperty
()
Value Text
FunctionConfigProperty
haddock_workaround_ :: ()
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
haddock_workaround_ :: ()
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
..}
instance Property "FunctionCode" Function where
  type PropertyType "FunctionCode" Function = Value Prelude.Text
  set :: PropertyType "FunctionCode" Function -> Function -> Function
set PropertyType "FunctionCode" Function
newValue Function {Maybe (Value Bool)
Maybe FunctionMetadataProperty
()
Value Text
FunctionConfigProperty
haddock_workaround_ :: Function -> ()
autoPublish :: Function -> Maybe (Value Bool)
functionCode :: Function -> Value Text
functionConfig :: Function -> FunctionConfigProperty
functionMetadata :: Function -> Maybe FunctionMetadataProperty
name :: Function -> Value Text
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
..} = Function {functionCode :: Value Text
functionCode = PropertyType "FunctionCode" Function
Value Text
newValue, Maybe (Value Bool)
Maybe FunctionMetadataProperty
()
Value Text
FunctionConfigProperty
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
..}
instance Property "FunctionConfig" Function where
  type PropertyType "FunctionConfig" Function = FunctionConfigProperty
  set :: PropertyType "FunctionConfig" Function -> Function -> Function
set PropertyType "FunctionConfig" Function
newValue Function {Maybe (Value Bool)
Maybe FunctionMetadataProperty
()
Value Text
FunctionConfigProperty
haddock_workaround_ :: Function -> ()
autoPublish :: Function -> Maybe (Value Bool)
functionCode :: Function -> Value Text
functionConfig :: Function -> FunctionConfigProperty
functionMetadata :: Function -> Maybe FunctionMetadataProperty
name :: Function -> Value Text
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
..}
    = Function {functionConfig :: FunctionConfigProperty
functionConfig = PropertyType "FunctionConfig" Function
FunctionConfigProperty
newValue, Maybe (Value Bool)
Maybe FunctionMetadataProperty
()
Value Text
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
..}
instance Property "FunctionMetadata" Function where
  type PropertyType "FunctionMetadata" Function = FunctionMetadataProperty
  set :: PropertyType "FunctionMetadata" Function -> Function -> Function
set PropertyType "FunctionMetadata" Function
newValue Function {Maybe (Value Bool)
Maybe FunctionMetadataProperty
()
Value Text
FunctionConfigProperty
haddock_workaround_ :: Function -> ()
autoPublish :: Function -> Maybe (Value Bool)
functionCode :: Function -> Value Text
functionConfig :: Function -> FunctionConfigProperty
functionMetadata :: Function -> Maybe FunctionMetadataProperty
name :: Function -> Value Text
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
..}
    = Function {functionMetadata :: Maybe FunctionMetadataProperty
functionMetadata = FunctionMetadataProperty -> Maybe FunctionMetadataProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "FunctionMetadata" Function
FunctionMetadataProperty
newValue, Maybe (Value Bool)
()
Value Text
FunctionConfigProperty
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
name :: Value Text
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
name :: Value Text
..}
instance Property "Name" Function where
  type PropertyType "Name" Function = Value Prelude.Text
  set :: PropertyType "Name" Function -> Function -> Function
set PropertyType "Name" Function
newValue Function {Maybe (Value Bool)
Maybe FunctionMetadataProperty
()
Value Text
FunctionConfigProperty
haddock_workaround_ :: Function -> ()
autoPublish :: Function -> Maybe (Value Bool)
functionCode :: Function -> Value Text
functionConfig :: Function -> FunctionConfigProperty
functionMetadata :: Function -> Maybe FunctionMetadataProperty
name :: Function -> Value Text
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
name :: Value Text
..} = Function {name :: Value Text
name = PropertyType "Name" Function
Value Text
newValue, Maybe (Value Bool)
Maybe FunctionMetadataProperty
()
Value Text
FunctionConfigProperty
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
haddock_workaround_ :: ()
autoPublish :: Maybe (Value Bool)
functionCode :: Value Text
functionConfig :: FunctionConfigProperty
functionMetadata :: Maybe FunctionMetadataProperty
..}