module Stratosphere.WAFv2.RuleGroup.ByteMatchStatementProperty (
        module Exports, ByteMatchStatementProperty(..),
        mkByteMatchStatementProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.WAFv2.RuleGroup.FieldToMatchProperty as Exports
import {-# SOURCE #-} Stratosphere.WAFv2.RuleGroup.TextTransformationProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ByteMatchStatementProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html>
    ByteMatchStatementProperty {ByteMatchStatementProperty -> ()
haddock_workaround_ :: (),
                                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-fieldtomatch>
                                ByteMatchStatementProperty -> FieldToMatchProperty
fieldToMatch :: FieldToMatchProperty,
                                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-positionalconstraint>
                                ByteMatchStatementProperty -> Value Text
positionalConstraint :: (Value Prelude.Text),
                                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-searchstring>
                                ByteMatchStatementProperty -> Maybe (Value Text)
searchString :: (Prelude.Maybe (Value Prelude.Text)),
                                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-searchstringbase64>
                                ByteMatchStatementProperty -> Maybe (Value Text)
searchStringBase64 :: (Prelude.Maybe (Value Prelude.Text)),
                                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-rulegroup-bytematchstatement.html#cfn-wafv2-rulegroup-bytematchstatement-texttransformations>
                                ByteMatchStatementProperty -> [TextTransformationProperty]
textTransformations :: [TextTransformationProperty]}
  deriving stock (ByteMatchStatementProperty -> ByteMatchStatementProperty -> Bool
(ByteMatchStatementProperty -> ByteMatchStatementProperty -> Bool)
-> (ByteMatchStatementProperty
    -> ByteMatchStatementProperty -> Bool)
-> Eq ByteMatchStatementProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ByteMatchStatementProperty -> ByteMatchStatementProperty -> Bool
== :: ByteMatchStatementProperty -> ByteMatchStatementProperty -> Bool
$c/= :: ByteMatchStatementProperty -> ByteMatchStatementProperty -> Bool
/= :: ByteMatchStatementProperty -> ByteMatchStatementProperty -> Bool
Prelude.Eq, Int -> ByteMatchStatementProperty -> ShowS
[ByteMatchStatementProperty] -> ShowS
ByteMatchStatementProperty -> String
(Int -> ByteMatchStatementProperty -> ShowS)
-> (ByteMatchStatementProperty -> String)
-> ([ByteMatchStatementProperty] -> ShowS)
-> Show ByteMatchStatementProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ByteMatchStatementProperty -> ShowS
showsPrec :: Int -> ByteMatchStatementProperty -> ShowS
$cshow :: ByteMatchStatementProperty -> String
show :: ByteMatchStatementProperty -> String
$cshowList :: [ByteMatchStatementProperty] -> ShowS
showList :: [ByteMatchStatementProperty] -> ShowS
Prelude.Show)
mkByteMatchStatementProperty ::
  FieldToMatchProperty
  -> Value Prelude.Text
     -> [TextTransformationProperty] -> ByteMatchStatementProperty
mkByteMatchStatementProperty :: FieldToMatchProperty
-> Value Text
-> [TextTransformationProperty]
-> ByteMatchStatementProperty
mkByteMatchStatementProperty
  FieldToMatchProperty
fieldToMatch
  Value Text
positionalConstraint
  [TextTransformationProperty]
textTransformations
  = ByteMatchStatementProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), fieldToMatch :: FieldToMatchProperty
fieldToMatch = FieldToMatchProperty
fieldToMatch,
       positionalConstraint :: Value Text
positionalConstraint = Value Text
positionalConstraint,
       textTransformations :: [TextTransformationProperty]
textTransformations = [TextTransformationProperty]
textTransformations,
       searchString :: Maybe (Value Text)
searchString = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       searchStringBase64 :: Maybe (Value Text)
searchStringBase64 = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ByteMatchStatementProperty where
  toResourceProperties :: ByteMatchStatementProperty -> ResourceProperties
toResourceProperties ByteMatchStatementProperty {[TextTransformationProperty]
Maybe (Value Text)
()
Value Text
FieldToMatchProperty
haddock_workaround_ :: ByteMatchStatementProperty -> ()
fieldToMatch :: ByteMatchStatementProperty -> FieldToMatchProperty
positionalConstraint :: ByteMatchStatementProperty -> Value Text
searchString :: ByteMatchStatementProperty -> Maybe (Value Text)
searchStringBase64 :: ByteMatchStatementProperty -> Maybe (Value Text)
textTransformations :: ByteMatchStatementProperty -> [TextTransformationProperty]
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::WAFv2::RuleGroup.ByteMatchStatement",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"FieldToMatch" Key -> FieldToMatchProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= FieldToMatchProperty
fieldToMatch,
                            Key
"PositionalConstraint" 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..= Value Text
positionalConstraint,
                            Key
"TextTransformations" Key -> [TextTransformationProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [TextTransformationProperty]
textTransformations]
                           ([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
"SearchString" (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)
searchString,
                               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
"SearchStringBase64" (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)
searchStringBase64]))}
instance JSON.ToJSON ByteMatchStatementProperty where
  toJSON :: ByteMatchStatementProperty -> Value
toJSON ByteMatchStatementProperty {[TextTransformationProperty]
Maybe (Value Text)
()
Value Text
FieldToMatchProperty
haddock_workaround_ :: ByteMatchStatementProperty -> ()
fieldToMatch :: ByteMatchStatementProperty -> FieldToMatchProperty
positionalConstraint :: ByteMatchStatementProperty -> Value Text
searchString :: ByteMatchStatementProperty -> Maybe (Value Text)
searchStringBase64 :: ByteMatchStatementProperty -> Maybe (Value Text)
textTransformations :: ByteMatchStatementProperty -> [TextTransformationProperty]
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"FieldToMatch" Key -> FieldToMatchProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= FieldToMatchProperty
fieldToMatch,
               Key
"PositionalConstraint" 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..= Value Text
positionalConstraint,
               Key
"TextTransformations" Key -> [TextTransformationProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [TextTransformationProperty]
textTransformations]
              ([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
"SearchString" (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)
searchString,
                  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
"SearchStringBase64" (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)
searchStringBase64])))
instance Property "FieldToMatch" ByteMatchStatementProperty where
  type PropertyType "FieldToMatch" ByteMatchStatementProperty = FieldToMatchProperty
  set :: PropertyType "FieldToMatch" ByteMatchStatementProperty
-> ByteMatchStatementProperty -> ByteMatchStatementProperty
set PropertyType "FieldToMatch" ByteMatchStatementProperty
newValue ByteMatchStatementProperty {[TextTransformationProperty]
Maybe (Value Text)
()
Value Text
FieldToMatchProperty
haddock_workaround_ :: ByteMatchStatementProperty -> ()
fieldToMatch :: ByteMatchStatementProperty -> FieldToMatchProperty
positionalConstraint :: ByteMatchStatementProperty -> Value Text
searchString :: ByteMatchStatementProperty -> Maybe (Value Text)
searchStringBase64 :: ByteMatchStatementProperty -> Maybe (Value Text)
textTransformations :: ByteMatchStatementProperty -> [TextTransformationProperty]
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
..}
    = ByteMatchStatementProperty {fieldToMatch :: FieldToMatchProperty
fieldToMatch = PropertyType "FieldToMatch" ByteMatchStatementProperty
FieldToMatchProperty
newValue, [TextTransformationProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
haddock_workaround_ :: ()
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
..}
instance Property "PositionalConstraint" ByteMatchStatementProperty where
  type PropertyType "PositionalConstraint" ByteMatchStatementProperty = Value Prelude.Text
  set :: PropertyType "PositionalConstraint" ByteMatchStatementProperty
-> ByteMatchStatementProperty -> ByteMatchStatementProperty
set PropertyType "PositionalConstraint" ByteMatchStatementProperty
newValue ByteMatchStatementProperty {[TextTransformationProperty]
Maybe (Value Text)
()
Value Text
FieldToMatchProperty
haddock_workaround_ :: ByteMatchStatementProperty -> ()
fieldToMatch :: ByteMatchStatementProperty -> FieldToMatchProperty
positionalConstraint :: ByteMatchStatementProperty -> Value Text
searchString :: ByteMatchStatementProperty -> Maybe (Value Text)
searchStringBase64 :: ByteMatchStatementProperty -> Maybe (Value Text)
textTransformations :: ByteMatchStatementProperty -> [TextTransformationProperty]
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
..}
    = ByteMatchStatementProperty {positionalConstraint :: Value Text
positionalConstraint = PropertyType "PositionalConstraint" ByteMatchStatementProperty
Value Text
newValue, [TextTransformationProperty]
Maybe (Value Text)
()
FieldToMatchProperty
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
..}
instance Property "SearchString" ByteMatchStatementProperty where
  type PropertyType "SearchString" ByteMatchStatementProperty = Value Prelude.Text
  set :: PropertyType "SearchString" ByteMatchStatementProperty
-> ByteMatchStatementProperty -> ByteMatchStatementProperty
set PropertyType "SearchString" ByteMatchStatementProperty
newValue ByteMatchStatementProperty {[TextTransformationProperty]
Maybe (Value Text)
()
Value Text
FieldToMatchProperty
haddock_workaround_ :: ByteMatchStatementProperty -> ()
fieldToMatch :: ByteMatchStatementProperty -> FieldToMatchProperty
positionalConstraint :: ByteMatchStatementProperty -> Value Text
searchString :: ByteMatchStatementProperty -> Maybe (Value Text)
searchStringBase64 :: ByteMatchStatementProperty -> Maybe (Value Text)
textTransformations :: ByteMatchStatementProperty -> [TextTransformationProperty]
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
..}
    = ByteMatchStatementProperty
        {searchString :: Maybe (Value Text)
searchString = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SearchString" ByteMatchStatementProperty
Value Text
newValue, [TextTransformationProperty]
Maybe (Value Text)
()
Value Text
FieldToMatchProperty
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
..}
instance Property "SearchStringBase64" ByteMatchStatementProperty where
  type PropertyType "SearchStringBase64" ByteMatchStatementProperty = Value Prelude.Text
  set :: PropertyType "SearchStringBase64" ByteMatchStatementProperty
-> ByteMatchStatementProperty -> ByteMatchStatementProperty
set PropertyType "SearchStringBase64" ByteMatchStatementProperty
newValue ByteMatchStatementProperty {[TextTransformationProperty]
Maybe (Value Text)
()
Value Text
FieldToMatchProperty
haddock_workaround_ :: ByteMatchStatementProperty -> ()
fieldToMatch :: ByteMatchStatementProperty -> FieldToMatchProperty
positionalConstraint :: ByteMatchStatementProperty -> Value Text
searchString :: ByteMatchStatementProperty -> Maybe (Value Text)
searchStringBase64 :: ByteMatchStatementProperty -> Maybe (Value Text)
textTransformations :: ByteMatchStatementProperty -> [TextTransformationProperty]
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
..}
    = ByteMatchStatementProperty
        {searchStringBase64 :: Maybe (Value Text)
searchStringBase64 = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SearchStringBase64" ByteMatchStatementProperty
Value Text
newValue, [TextTransformationProperty]
Maybe (Value Text)
()
Value Text
FieldToMatchProperty
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
..}
instance Property "TextTransformations" ByteMatchStatementProperty where
  type PropertyType "TextTransformations" ByteMatchStatementProperty = [TextTransformationProperty]
  set :: PropertyType "TextTransformations" ByteMatchStatementProperty
-> ByteMatchStatementProperty -> ByteMatchStatementProperty
set PropertyType "TextTransformations" ByteMatchStatementProperty
newValue ByteMatchStatementProperty {[TextTransformationProperty]
Maybe (Value Text)
()
Value Text
FieldToMatchProperty
haddock_workaround_ :: ByteMatchStatementProperty -> ()
fieldToMatch :: ByteMatchStatementProperty -> FieldToMatchProperty
positionalConstraint :: ByteMatchStatementProperty -> Value Text
searchString :: ByteMatchStatementProperty -> Maybe (Value Text)
searchStringBase64 :: ByteMatchStatementProperty -> Maybe (Value Text)
textTransformations :: ByteMatchStatementProperty -> [TextTransformationProperty]
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
textTransformations :: [TextTransformationProperty]
..}
    = ByteMatchStatementProperty {textTransformations :: [TextTransformationProperty]
textTransformations = [TextTransformationProperty]
PropertyType "TextTransformations" ByteMatchStatementProperty
newValue, Maybe (Value Text)
()
Value Text
FieldToMatchProperty
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
haddock_workaround_ :: ()
fieldToMatch :: FieldToMatchProperty
positionalConstraint :: Value Text
searchString :: Maybe (Value Text)
searchStringBase64 :: Maybe (Value Text)
..}