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