module Stratosphere.WAFv2.WebACL.AllowActionProperty (
        module Exports, AllowActionProperty(..), mkAllowActionProperty
    ) 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 AllowActionProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-allowaction.html>
    AllowActionProperty {AllowActionProperty -> ()
haddock_workaround_ :: (),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-allowaction.html#cfn-wafv2-webacl-allowaction-customrequesthandling>
                         AllowActionProperty -> Maybe CustomRequestHandlingProperty
customRequestHandling :: (Prelude.Maybe CustomRequestHandlingProperty)}
  deriving stock (AllowActionProperty -> AllowActionProperty -> Bool
(AllowActionProperty -> AllowActionProperty -> Bool)
-> (AllowActionProperty -> AllowActionProperty -> Bool)
-> Eq AllowActionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AllowActionProperty -> AllowActionProperty -> Bool
== :: AllowActionProperty -> AllowActionProperty -> Bool
$c/= :: AllowActionProperty -> AllowActionProperty -> Bool
/= :: AllowActionProperty -> AllowActionProperty -> Bool
Prelude.Eq, Int -> AllowActionProperty -> ShowS
[AllowActionProperty] -> ShowS
AllowActionProperty -> String
(Int -> AllowActionProperty -> ShowS)
-> (AllowActionProperty -> String)
-> ([AllowActionProperty] -> ShowS)
-> Show AllowActionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AllowActionProperty -> ShowS
showsPrec :: Int -> AllowActionProperty -> ShowS
$cshow :: AllowActionProperty -> String
show :: AllowActionProperty -> String
$cshowList :: [AllowActionProperty] -> ShowS
showList :: [AllowActionProperty] -> ShowS
Prelude.Show)
mkAllowActionProperty :: AllowActionProperty
mkAllowActionProperty :: AllowActionProperty
mkAllowActionProperty
  = AllowActionProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), customRequestHandling :: Maybe CustomRequestHandlingProperty
customRequestHandling = Maybe CustomRequestHandlingProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties AllowActionProperty where
  toResourceProperties :: AllowActionProperty -> ResourceProperties
toResourceProperties AllowActionProperty {Maybe CustomRequestHandlingProperty
()
haddock_workaround_ :: AllowActionProperty -> ()
customRequestHandling :: AllowActionProperty -> Maybe CustomRequestHandlingProperty
haddock_workaround_ :: ()
customRequestHandling :: Maybe CustomRequestHandlingProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::WAFv2::WebACL.AllowAction",
         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 AllowActionProperty where
  toJSON :: AllowActionProperty -> Value
toJSON AllowActionProperty {Maybe CustomRequestHandlingProperty
()
haddock_workaround_ :: AllowActionProperty -> ()
customRequestHandling :: AllowActionProperty -> 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" AllowActionProperty where
  type PropertyType "CustomRequestHandling" AllowActionProperty = CustomRequestHandlingProperty
  set :: PropertyType "CustomRequestHandling" AllowActionProperty
-> AllowActionProperty -> AllowActionProperty
set PropertyType "CustomRequestHandling" AllowActionProperty
newValue AllowActionProperty {Maybe CustomRequestHandlingProperty
()
haddock_workaround_ :: AllowActionProperty -> ()
customRequestHandling :: AllowActionProperty -> Maybe CustomRequestHandlingProperty
haddock_workaround_ :: ()
customRequestHandling :: Maybe CustomRequestHandlingProperty
..}
    = AllowActionProperty
        {customRequestHandling :: Maybe CustomRequestHandlingProperty
customRequestHandling = CustomRequestHandlingProperty
-> Maybe CustomRequestHandlingProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CustomRequestHandling" AllowActionProperty
CustomRequestHandlingProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}