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