module Stratosphere.WAFv2.WebACL.DefaultActionProperty (
module Exports, DefaultActionProperty(..), mkDefaultActionProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.WAFv2.WebACL.AllowActionProperty as Exports
import {-# SOURCE #-} Stratosphere.WAFv2.WebACL.BlockActionProperty as Exports
import Stratosphere.ResourceProperties
data DefaultActionProperty
=
DefaultActionProperty {DefaultActionProperty -> ()
haddock_workaround_ :: (),
DefaultActionProperty -> Maybe AllowActionProperty
allow :: (Prelude.Maybe AllowActionProperty),
DefaultActionProperty -> Maybe BlockActionProperty
block :: (Prelude.Maybe BlockActionProperty)}
deriving stock (DefaultActionProperty -> DefaultActionProperty -> Bool
(DefaultActionProperty -> DefaultActionProperty -> Bool)
-> (DefaultActionProperty -> DefaultActionProperty -> Bool)
-> Eq DefaultActionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DefaultActionProperty -> DefaultActionProperty -> Bool
== :: DefaultActionProperty -> DefaultActionProperty -> Bool
$c/= :: DefaultActionProperty -> DefaultActionProperty -> Bool
/= :: DefaultActionProperty -> DefaultActionProperty -> Bool
Prelude.Eq, Int -> DefaultActionProperty -> ShowS
[DefaultActionProperty] -> ShowS
DefaultActionProperty -> String
(Int -> DefaultActionProperty -> ShowS)
-> (DefaultActionProperty -> String)
-> ([DefaultActionProperty] -> ShowS)
-> Show DefaultActionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DefaultActionProperty -> ShowS
showsPrec :: Int -> DefaultActionProperty -> ShowS
$cshow :: DefaultActionProperty -> String
show :: DefaultActionProperty -> String
$cshowList :: [DefaultActionProperty] -> ShowS
showList :: [DefaultActionProperty] -> ShowS
Prelude.Show)
mkDefaultActionProperty :: DefaultActionProperty
mkDefaultActionProperty :: DefaultActionProperty
mkDefaultActionProperty
= DefaultActionProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), allow :: Maybe AllowActionProperty
allow = Maybe AllowActionProperty
forall a. Maybe a
Prelude.Nothing,
block :: Maybe BlockActionProperty
block = Maybe BlockActionProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties DefaultActionProperty where
toResourceProperties :: DefaultActionProperty -> ResourceProperties
toResourceProperties DefaultActionProperty {Maybe AllowActionProperty
Maybe BlockActionProperty
()
haddock_workaround_ :: DefaultActionProperty -> ()
allow :: DefaultActionProperty -> Maybe AllowActionProperty
block :: DefaultActionProperty -> Maybe BlockActionProperty
haddock_workaround_ :: ()
allow :: Maybe AllowActionProperty
block :: Maybe BlockActionProperty
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::WAFv2::WebACL.DefaultAction",
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 -> AllowActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Allow" (AllowActionProperty -> (Key, Value))
-> Maybe AllowActionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AllowActionProperty
allow,
Key -> BlockActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Block" (BlockActionProperty -> (Key, Value))
-> Maybe BlockActionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BlockActionProperty
block])}
instance JSON.ToJSON DefaultActionProperty where
toJSON :: DefaultActionProperty -> Value
toJSON DefaultActionProperty {Maybe AllowActionProperty
Maybe BlockActionProperty
()
haddock_workaround_ :: DefaultActionProperty -> ()
allow :: DefaultActionProperty -> Maybe AllowActionProperty
block :: DefaultActionProperty -> Maybe BlockActionProperty
haddock_workaround_ :: ()
allow :: Maybe AllowActionProperty
block :: Maybe BlockActionProperty
..}
= [(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 -> AllowActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Allow" (AllowActionProperty -> (Key, Value))
-> Maybe AllowActionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AllowActionProperty
allow,
Key -> BlockActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Block" (BlockActionProperty -> (Key, Value))
-> Maybe BlockActionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BlockActionProperty
block]))
instance Property "Allow" DefaultActionProperty where
type PropertyType "Allow" DefaultActionProperty = AllowActionProperty
set :: PropertyType "Allow" DefaultActionProperty
-> DefaultActionProperty -> DefaultActionProperty
set PropertyType "Allow" DefaultActionProperty
newValue DefaultActionProperty {Maybe AllowActionProperty
Maybe BlockActionProperty
()
haddock_workaround_ :: DefaultActionProperty -> ()
allow :: DefaultActionProperty -> Maybe AllowActionProperty
block :: DefaultActionProperty -> Maybe BlockActionProperty
haddock_workaround_ :: ()
allow :: Maybe AllowActionProperty
block :: Maybe BlockActionProperty
..}
= DefaultActionProperty {allow :: Maybe AllowActionProperty
allow = AllowActionProperty -> Maybe AllowActionProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Allow" DefaultActionProperty
AllowActionProperty
newValue, Maybe BlockActionProperty
()
haddock_workaround_ :: ()
block :: Maybe BlockActionProperty
haddock_workaround_ :: ()
block :: Maybe BlockActionProperty
..}
instance Property "Block" DefaultActionProperty where
type PropertyType "Block" DefaultActionProperty = BlockActionProperty
set :: PropertyType "Block" DefaultActionProperty
-> DefaultActionProperty -> DefaultActionProperty
set PropertyType "Block" DefaultActionProperty
newValue DefaultActionProperty {Maybe AllowActionProperty
Maybe BlockActionProperty
()
haddock_workaround_ :: DefaultActionProperty -> ()
allow :: DefaultActionProperty -> Maybe AllowActionProperty
block :: DefaultActionProperty -> Maybe BlockActionProperty
haddock_workaround_ :: ()
allow :: Maybe AllowActionProperty
block :: Maybe BlockActionProperty
..}
= DefaultActionProperty {block :: Maybe BlockActionProperty
block = BlockActionProperty -> Maybe BlockActionProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Block" DefaultActionProperty
BlockActionProperty
newValue, Maybe AllowActionProperty
()
haddock_workaround_ :: ()
allow :: Maybe AllowActionProperty
haddock_workaround_ :: ()
allow :: Maybe AllowActionProperty
..}