module Stratosphere.WAFv2.WebACL.ChallengeActionProperty (
        module Exports, ChallengeActionProperty(..),
        mkChallengeActionProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.WAFv2.WebACL.CustomRequestHandlingProperty as Exports
import Stratosphere.ResourceProperties
data ChallengeActionProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-challengeaction.html>
    ChallengeActionProperty {ChallengeActionProperty -> ()
haddock_workaround_ :: (),
                             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-challengeaction.html#cfn-wafv2-webacl-challengeaction-customrequesthandling>
                             ChallengeActionProperty -> Maybe CustomRequestHandlingProperty
customRequestHandling :: (Prelude.Maybe CustomRequestHandlingProperty)}
  deriving stock (ChallengeActionProperty -> ChallengeActionProperty -> Bool
(ChallengeActionProperty -> ChallengeActionProperty -> Bool)
-> (ChallengeActionProperty -> ChallengeActionProperty -> Bool)
-> Eq ChallengeActionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ChallengeActionProperty -> ChallengeActionProperty -> Bool
== :: ChallengeActionProperty -> ChallengeActionProperty -> Bool
$c/= :: ChallengeActionProperty -> ChallengeActionProperty -> Bool
/= :: ChallengeActionProperty -> ChallengeActionProperty -> Bool
Prelude.Eq, Int -> ChallengeActionProperty -> ShowS
[ChallengeActionProperty] -> ShowS
ChallengeActionProperty -> String
(Int -> ChallengeActionProperty -> ShowS)
-> (ChallengeActionProperty -> String)
-> ([ChallengeActionProperty] -> ShowS)
-> Show ChallengeActionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChallengeActionProperty -> ShowS
showsPrec :: Int -> ChallengeActionProperty -> ShowS
$cshow :: ChallengeActionProperty -> String
show :: ChallengeActionProperty -> String
$cshowList :: [ChallengeActionProperty] -> ShowS
showList :: [ChallengeActionProperty] -> ShowS
Prelude.Show)
mkChallengeActionProperty :: ChallengeActionProperty
mkChallengeActionProperty :: ChallengeActionProperty
mkChallengeActionProperty
  = ChallengeActionProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), customRequestHandling :: Maybe CustomRequestHandlingProperty
customRequestHandling = Maybe CustomRequestHandlingProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ChallengeActionProperty where
  toResourceProperties :: ChallengeActionProperty -> ResourceProperties
toResourceProperties ChallengeActionProperty {Maybe CustomRequestHandlingProperty
()
haddock_workaround_ :: ChallengeActionProperty -> ()
customRequestHandling :: ChallengeActionProperty -> Maybe CustomRequestHandlingProperty
haddock_workaround_ :: ()
customRequestHandling :: Maybe CustomRequestHandlingProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::WAFv2::WebACL.ChallengeAction",
         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 -> CustomRequestHandlingProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CustomRequestHandling"
                              (CustomRequestHandlingProperty -> (Key, Value))
-> Maybe CustomRequestHandlingProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomRequestHandlingProperty
customRequestHandling])}
instance JSON.ToJSON ChallengeActionProperty where
  toJSON :: ChallengeActionProperty -> Value
toJSON ChallengeActionProperty {Maybe CustomRequestHandlingProperty
()
haddock_workaround_ :: ChallengeActionProperty -> ()
customRequestHandling :: ChallengeActionProperty -> Maybe CustomRequestHandlingProperty
haddock_workaround_ :: ()
customRequestHandling :: Maybe CustomRequestHandlingProperty
..}
    = [(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 -> CustomRequestHandlingProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CustomRequestHandling"
                 (CustomRequestHandlingProperty -> (Key, Value))
-> Maybe CustomRequestHandlingProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomRequestHandlingProperty
customRequestHandling]))
instance Property "CustomRequestHandling" ChallengeActionProperty where
  type PropertyType "CustomRequestHandling" ChallengeActionProperty = CustomRequestHandlingProperty
  set :: PropertyType "CustomRequestHandling" ChallengeActionProperty
-> ChallengeActionProperty -> ChallengeActionProperty
set PropertyType "CustomRequestHandling" ChallengeActionProperty
newValue ChallengeActionProperty {Maybe CustomRequestHandlingProperty
()
haddock_workaround_ :: ChallengeActionProperty -> ()
customRequestHandling :: ChallengeActionProperty -> Maybe CustomRequestHandlingProperty
haddock_workaround_ :: ()
customRequestHandling :: Maybe CustomRequestHandlingProperty
..}
    = ChallengeActionProperty
        {customRequestHandling :: Maybe CustomRequestHandlingProperty
customRequestHandling = CustomRequestHandlingProperty
-> Maybe CustomRequestHandlingProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CustomRequestHandling" ChallengeActionProperty
CustomRequestHandlingProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}