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