module Stratosphere.CloudFront.Distribution.FunctionAssociationProperty (
        FunctionAssociationProperty(..), mkFunctionAssociationProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data FunctionAssociationProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-functionassociation.html>
    FunctionAssociationProperty {FunctionAssociationProperty -> ()
haddock_workaround_ :: (),
                                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-functionassociation.html#cfn-cloudfront-distribution-functionassociation-eventtype>
                                 FunctionAssociationProperty -> Maybe (Value Text)
eventType :: (Prelude.Maybe (Value Prelude.Text)),
                                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-functionassociation.html#cfn-cloudfront-distribution-functionassociation-functionarn>
                                 FunctionAssociationProperty -> Maybe (Value Text)
functionARN :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (FunctionAssociationProperty -> FunctionAssociationProperty -> Bool
(FunctionAssociationProperty
 -> FunctionAssociationProperty -> Bool)
-> (FunctionAssociationProperty
    -> FunctionAssociationProperty -> Bool)
-> Eq FunctionAssociationProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FunctionAssociationProperty -> FunctionAssociationProperty -> Bool
== :: FunctionAssociationProperty -> FunctionAssociationProperty -> Bool
$c/= :: FunctionAssociationProperty -> FunctionAssociationProperty -> Bool
/= :: FunctionAssociationProperty -> FunctionAssociationProperty -> Bool
Prelude.Eq, Int -> FunctionAssociationProperty -> ShowS
[FunctionAssociationProperty] -> ShowS
FunctionAssociationProperty -> String
(Int -> FunctionAssociationProperty -> ShowS)
-> (FunctionAssociationProperty -> String)
-> ([FunctionAssociationProperty] -> ShowS)
-> Show FunctionAssociationProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FunctionAssociationProperty -> ShowS
showsPrec :: Int -> FunctionAssociationProperty -> ShowS
$cshow :: FunctionAssociationProperty -> String
show :: FunctionAssociationProperty -> String
$cshowList :: [FunctionAssociationProperty] -> ShowS
showList :: [FunctionAssociationProperty] -> ShowS
Prelude.Show)
mkFunctionAssociationProperty :: FunctionAssociationProperty
mkFunctionAssociationProperty :: FunctionAssociationProperty
mkFunctionAssociationProperty
  = FunctionAssociationProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), eventType :: Maybe (Value Text)
eventType = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       functionARN :: Maybe (Value Text)
functionARN = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties FunctionAssociationProperty where
  toResourceProperties :: FunctionAssociationProperty -> ResourceProperties
toResourceProperties FunctionAssociationProperty {Maybe (Value Text)
()
haddock_workaround_ :: FunctionAssociationProperty -> ()
eventType :: FunctionAssociationProperty -> Maybe (Value Text)
functionARN :: FunctionAssociationProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
eventType :: Maybe (Value Text)
functionARN :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CloudFront::Distribution.FunctionAssociation",
         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 -> 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..=) Key
"EventType" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
eventType,
                            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..=) Key
"FunctionARN" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
functionARN])}
instance JSON.ToJSON FunctionAssociationProperty where
  toJSON :: FunctionAssociationProperty -> Value
toJSON FunctionAssociationProperty {Maybe (Value Text)
()
haddock_workaround_ :: FunctionAssociationProperty -> ()
eventType :: FunctionAssociationProperty -> Maybe (Value Text)
functionARN :: FunctionAssociationProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
eventType :: Maybe (Value Text)
functionARN :: Maybe (Value Text)
..}
    = [(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 -> 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..=) Key
"EventType" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
eventType,
               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..=) Key
"FunctionARN" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
functionARN]))
instance Property "EventType" FunctionAssociationProperty where
  type PropertyType "EventType" FunctionAssociationProperty = Value Prelude.Text
  set :: PropertyType "EventType" FunctionAssociationProperty
-> FunctionAssociationProperty -> FunctionAssociationProperty
set PropertyType "EventType" FunctionAssociationProperty
newValue FunctionAssociationProperty {Maybe (Value Text)
()
haddock_workaround_ :: FunctionAssociationProperty -> ()
eventType :: FunctionAssociationProperty -> Maybe (Value Text)
functionARN :: FunctionAssociationProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
eventType :: Maybe (Value Text)
functionARN :: Maybe (Value Text)
..}
    = FunctionAssociationProperty
        {eventType :: Maybe (Value Text)
eventType = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "EventType" FunctionAssociationProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
functionARN :: Maybe (Value Text)
haddock_workaround_ :: ()
functionARN :: Maybe (Value Text)
..}
instance Property "FunctionARN" FunctionAssociationProperty where
  type PropertyType "FunctionARN" FunctionAssociationProperty = Value Prelude.Text
  set :: PropertyType "FunctionARN" FunctionAssociationProperty
-> FunctionAssociationProperty -> FunctionAssociationProperty
set PropertyType "FunctionARN" FunctionAssociationProperty
newValue FunctionAssociationProperty {Maybe (Value Text)
()
haddock_workaround_ :: FunctionAssociationProperty -> ()
eventType :: FunctionAssociationProperty -> Maybe (Value Text)
functionARN :: FunctionAssociationProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
eventType :: Maybe (Value Text)
functionARN :: Maybe (Value Text)
..}
    = FunctionAssociationProperty
        {functionARN :: Maybe (Value Text)
functionARN = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "FunctionARN" FunctionAssociationProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
eventType :: Maybe (Value Text)
haddock_workaround_ :: ()
eventType :: Maybe (Value Text)
..}