module Stratosphere.Lambda.EventSourceMapping.DestinationConfigProperty (
        module Exports, DestinationConfigProperty(..),
        mkDestinationConfigProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Lambda.EventSourceMapping.OnFailureProperty as Exports
import Stratosphere.ResourceProperties
data DestinationConfigProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-destinationconfig.html>
    DestinationConfigProperty {DestinationConfigProperty -> ()
haddock_workaround_ :: (),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-destinationconfig.html#cfn-lambda-eventsourcemapping-destinationconfig-onfailure>
                               DestinationConfigProperty -> Maybe OnFailureProperty
onFailure :: (Prelude.Maybe OnFailureProperty)}
  deriving stock (DestinationConfigProperty -> DestinationConfigProperty -> Bool
(DestinationConfigProperty -> DestinationConfigProperty -> Bool)
-> (DestinationConfigProperty -> DestinationConfigProperty -> Bool)
-> Eq DestinationConfigProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DestinationConfigProperty -> DestinationConfigProperty -> Bool
== :: DestinationConfigProperty -> DestinationConfigProperty -> Bool
$c/= :: DestinationConfigProperty -> DestinationConfigProperty -> Bool
/= :: DestinationConfigProperty -> DestinationConfigProperty -> Bool
Prelude.Eq, Int -> DestinationConfigProperty -> ShowS
[DestinationConfigProperty] -> ShowS
DestinationConfigProperty -> String
(Int -> DestinationConfigProperty -> ShowS)
-> (DestinationConfigProperty -> String)
-> ([DestinationConfigProperty] -> ShowS)
-> Show DestinationConfigProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DestinationConfigProperty -> ShowS
showsPrec :: Int -> DestinationConfigProperty -> ShowS
$cshow :: DestinationConfigProperty -> String
show :: DestinationConfigProperty -> String
$cshowList :: [DestinationConfigProperty] -> ShowS
showList :: [DestinationConfigProperty] -> ShowS
Prelude.Show)
mkDestinationConfigProperty :: DestinationConfigProperty
mkDestinationConfigProperty :: DestinationConfigProperty
mkDestinationConfigProperty
  = DestinationConfigProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), onFailure :: Maybe OnFailureProperty
onFailure = Maybe OnFailureProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties DestinationConfigProperty where
  toResourceProperties :: DestinationConfigProperty -> ResourceProperties
toResourceProperties DestinationConfigProperty {Maybe OnFailureProperty
()
haddock_workaround_ :: DestinationConfigProperty -> ()
onFailure :: DestinationConfigProperty -> Maybe OnFailureProperty
haddock_workaround_ :: ()
onFailure :: Maybe OnFailureProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Lambda::EventSourceMapping.DestinationConfig",
         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 -> OnFailureProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"OnFailure" (OnFailureProperty -> (Key, Value))
-> Maybe OnFailureProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OnFailureProperty
onFailure])}
instance JSON.ToJSON DestinationConfigProperty where
  toJSON :: DestinationConfigProperty -> Value
toJSON DestinationConfigProperty {Maybe OnFailureProperty
()
haddock_workaround_ :: DestinationConfigProperty -> ()
onFailure :: DestinationConfigProperty -> Maybe OnFailureProperty
haddock_workaround_ :: ()
onFailure :: Maybe OnFailureProperty
..}
    = [(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 -> OnFailureProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"OnFailure" (OnFailureProperty -> (Key, Value))
-> Maybe OnFailureProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OnFailureProperty
onFailure]))
instance Property "OnFailure" DestinationConfigProperty where
  type PropertyType "OnFailure" DestinationConfigProperty = OnFailureProperty
  set :: PropertyType "OnFailure" DestinationConfigProperty
-> DestinationConfigProperty -> DestinationConfigProperty
set PropertyType "OnFailure" DestinationConfigProperty
newValue DestinationConfigProperty {Maybe OnFailureProperty
()
haddock_workaround_ :: DestinationConfigProperty -> ()
onFailure :: DestinationConfigProperty -> Maybe OnFailureProperty
haddock_workaround_ :: ()
onFailure :: Maybe OnFailureProperty
..}
    = DestinationConfigProperty {onFailure :: Maybe OnFailureProperty
onFailure = OnFailureProperty -> Maybe OnFailureProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "OnFailure" DestinationConfigProperty
OnFailureProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}