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