{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.WAFRegional.GetSqlInjectionMatchSet
(
GetSqlInjectionMatchSet (..),
newGetSqlInjectionMatchSet,
getSqlInjectionMatchSet_sqlInjectionMatchSetId,
GetSqlInjectionMatchSetResponse (..),
newGetSqlInjectionMatchSetResponse,
getSqlInjectionMatchSetResponse_sqlInjectionMatchSet,
getSqlInjectionMatchSetResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WAFRegional.Types
data GetSqlInjectionMatchSet = GetSqlInjectionMatchSet'
{
GetSqlInjectionMatchSet -> Text
sqlInjectionMatchSetId :: Prelude.Text
}
deriving (GetSqlInjectionMatchSet -> GetSqlInjectionMatchSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSqlInjectionMatchSet -> GetSqlInjectionMatchSet -> Bool
$c/= :: GetSqlInjectionMatchSet -> GetSqlInjectionMatchSet -> Bool
== :: GetSqlInjectionMatchSet -> GetSqlInjectionMatchSet -> Bool
$c== :: GetSqlInjectionMatchSet -> GetSqlInjectionMatchSet -> Bool
Prelude.Eq, ReadPrec [GetSqlInjectionMatchSet]
ReadPrec GetSqlInjectionMatchSet
Int -> ReadS GetSqlInjectionMatchSet
ReadS [GetSqlInjectionMatchSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSqlInjectionMatchSet]
$creadListPrec :: ReadPrec [GetSqlInjectionMatchSet]
readPrec :: ReadPrec GetSqlInjectionMatchSet
$creadPrec :: ReadPrec GetSqlInjectionMatchSet
readList :: ReadS [GetSqlInjectionMatchSet]
$creadList :: ReadS [GetSqlInjectionMatchSet]
readsPrec :: Int -> ReadS GetSqlInjectionMatchSet
$creadsPrec :: Int -> ReadS GetSqlInjectionMatchSet
Prelude.Read, Int -> GetSqlInjectionMatchSet -> ShowS
[GetSqlInjectionMatchSet] -> ShowS
GetSqlInjectionMatchSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSqlInjectionMatchSet] -> ShowS
$cshowList :: [GetSqlInjectionMatchSet] -> ShowS
show :: GetSqlInjectionMatchSet -> String
$cshow :: GetSqlInjectionMatchSet -> String
showsPrec :: Int -> GetSqlInjectionMatchSet -> ShowS
$cshowsPrec :: Int -> GetSqlInjectionMatchSet -> ShowS
Prelude.Show, forall x. Rep GetSqlInjectionMatchSet x -> GetSqlInjectionMatchSet
forall x. GetSqlInjectionMatchSet -> Rep GetSqlInjectionMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSqlInjectionMatchSet x -> GetSqlInjectionMatchSet
$cfrom :: forall x. GetSqlInjectionMatchSet -> Rep GetSqlInjectionMatchSet x
Prelude.Generic)
newGetSqlInjectionMatchSet ::
Prelude.Text ->
GetSqlInjectionMatchSet
newGetSqlInjectionMatchSet :: Text -> GetSqlInjectionMatchSet
newGetSqlInjectionMatchSet Text
pSqlInjectionMatchSetId_ =
GetSqlInjectionMatchSet'
{ $sel:sqlInjectionMatchSetId:GetSqlInjectionMatchSet' :: Text
sqlInjectionMatchSetId =
Text
pSqlInjectionMatchSetId_
}
getSqlInjectionMatchSet_sqlInjectionMatchSetId :: Lens.Lens' GetSqlInjectionMatchSet Prelude.Text
getSqlInjectionMatchSet_sqlInjectionMatchSetId :: Lens' GetSqlInjectionMatchSet Text
getSqlInjectionMatchSet_sqlInjectionMatchSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSqlInjectionMatchSet' {Text
sqlInjectionMatchSetId :: Text
$sel:sqlInjectionMatchSetId:GetSqlInjectionMatchSet' :: GetSqlInjectionMatchSet -> Text
sqlInjectionMatchSetId} -> Text
sqlInjectionMatchSetId) (\s :: GetSqlInjectionMatchSet
s@GetSqlInjectionMatchSet' {} Text
a -> GetSqlInjectionMatchSet
s {$sel:sqlInjectionMatchSetId:GetSqlInjectionMatchSet' :: Text
sqlInjectionMatchSetId = Text
a} :: GetSqlInjectionMatchSet)
instance Core.AWSRequest GetSqlInjectionMatchSet where
type
AWSResponse GetSqlInjectionMatchSet =
GetSqlInjectionMatchSetResponse
request :: (Service -> Service)
-> GetSqlInjectionMatchSet -> Request GetSqlInjectionMatchSet
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetSqlInjectionMatchSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSqlInjectionMatchSet)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe SqlInjectionMatchSet
-> Int -> GetSqlInjectionMatchSetResponse
GetSqlInjectionMatchSetResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SqlInjectionMatchSet")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetSqlInjectionMatchSet where
hashWithSalt :: Int -> GetSqlInjectionMatchSet -> Int
hashWithSalt Int
_salt GetSqlInjectionMatchSet' {Text
sqlInjectionMatchSetId :: Text
$sel:sqlInjectionMatchSetId:GetSqlInjectionMatchSet' :: GetSqlInjectionMatchSet -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sqlInjectionMatchSetId
instance Prelude.NFData GetSqlInjectionMatchSet where
rnf :: GetSqlInjectionMatchSet -> ()
rnf GetSqlInjectionMatchSet' {Text
sqlInjectionMatchSetId :: Text
$sel:sqlInjectionMatchSetId:GetSqlInjectionMatchSet' :: GetSqlInjectionMatchSet -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
sqlInjectionMatchSetId
instance Data.ToHeaders GetSqlInjectionMatchSet where
toHeaders :: GetSqlInjectionMatchSet -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSWAF_Regional_20161128.GetSqlInjectionMatchSet" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetSqlInjectionMatchSet where
toJSON :: GetSqlInjectionMatchSet -> Value
toJSON GetSqlInjectionMatchSet' {Text
sqlInjectionMatchSetId :: Text
$sel:sqlInjectionMatchSetId:GetSqlInjectionMatchSet' :: GetSqlInjectionMatchSet -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"SqlInjectionMatchSetId"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sqlInjectionMatchSetId
)
]
)
instance Data.ToPath GetSqlInjectionMatchSet where
toPath :: GetSqlInjectionMatchSet -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetSqlInjectionMatchSet where
toQuery :: GetSqlInjectionMatchSet -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetSqlInjectionMatchSetResponse = GetSqlInjectionMatchSetResponse'
{
GetSqlInjectionMatchSetResponse -> Maybe SqlInjectionMatchSet
sqlInjectionMatchSet :: Prelude.Maybe SqlInjectionMatchSet,
GetSqlInjectionMatchSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetSqlInjectionMatchSetResponse
-> GetSqlInjectionMatchSetResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSqlInjectionMatchSetResponse
-> GetSqlInjectionMatchSetResponse -> Bool
$c/= :: GetSqlInjectionMatchSetResponse
-> GetSqlInjectionMatchSetResponse -> Bool
== :: GetSqlInjectionMatchSetResponse
-> GetSqlInjectionMatchSetResponse -> Bool
$c== :: GetSqlInjectionMatchSetResponse
-> GetSqlInjectionMatchSetResponse -> Bool
Prelude.Eq, ReadPrec [GetSqlInjectionMatchSetResponse]
ReadPrec GetSqlInjectionMatchSetResponse
Int -> ReadS GetSqlInjectionMatchSetResponse
ReadS [GetSqlInjectionMatchSetResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSqlInjectionMatchSetResponse]
$creadListPrec :: ReadPrec [GetSqlInjectionMatchSetResponse]
readPrec :: ReadPrec GetSqlInjectionMatchSetResponse
$creadPrec :: ReadPrec GetSqlInjectionMatchSetResponse
readList :: ReadS [GetSqlInjectionMatchSetResponse]
$creadList :: ReadS [GetSqlInjectionMatchSetResponse]
readsPrec :: Int -> ReadS GetSqlInjectionMatchSetResponse
$creadsPrec :: Int -> ReadS GetSqlInjectionMatchSetResponse
Prelude.Read, Int -> GetSqlInjectionMatchSetResponse -> ShowS
[GetSqlInjectionMatchSetResponse] -> ShowS
GetSqlInjectionMatchSetResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSqlInjectionMatchSetResponse] -> ShowS
$cshowList :: [GetSqlInjectionMatchSetResponse] -> ShowS
show :: GetSqlInjectionMatchSetResponse -> String
$cshow :: GetSqlInjectionMatchSetResponse -> String
showsPrec :: Int -> GetSqlInjectionMatchSetResponse -> ShowS
$cshowsPrec :: Int -> GetSqlInjectionMatchSetResponse -> ShowS
Prelude.Show, forall x.
Rep GetSqlInjectionMatchSetResponse x
-> GetSqlInjectionMatchSetResponse
forall x.
GetSqlInjectionMatchSetResponse
-> Rep GetSqlInjectionMatchSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSqlInjectionMatchSetResponse x
-> GetSqlInjectionMatchSetResponse
$cfrom :: forall x.
GetSqlInjectionMatchSetResponse
-> Rep GetSqlInjectionMatchSetResponse x
Prelude.Generic)
newGetSqlInjectionMatchSetResponse ::
Prelude.Int ->
GetSqlInjectionMatchSetResponse
newGetSqlInjectionMatchSetResponse :: Int -> GetSqlInjectionMatchSetResponse
newGetSqlInjectionMatchSetResponse Int
pHttpStatus_ =
GetSqlInjectionMatchSetResponse'
{ $sel:sqlInjectionMatchSet:GetSqlInjectionMatchSetResponse' :: Maybe SqlInjectionMatchSet
sqlInjectionMatchSet =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetSqlInjectionMatchSetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getSqlInjectionMatchSetResponse_sqlInjectionMatchSet :: Lens.Lens' GetSqlInjectionMatchSetResponse (Prelude.Maybe SqlInjectionMatchSet)
getSqlInjectionMatchSetResponse_sqlInjectionMatchSet :: Lens' GetSqlInjectionMatchSetResponse (Maybe SqlInjectionMatchSet)
getSqlInjectionMatchSetResponse_sqlInjectionMatchSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSqlInjectionMatchSetResponse' {Maybe SqlInjectionMatchSet
sqlInjectionMatchSet :: Maybe SqlInjectionMatchSet
$sel:sqlInjectionMatchSet:GetSqlInjectionMatchSetResponse' :: GetSqlInjectionMatchSetResponse -> Maybe SqlInjectionMatchSet
sqlInjectionMatchSet} -> Maybe SqlInjectionMatchSet
sqlInjectionMatchSet) (\s :: GetSqlInjectionMatchSetResponse
s@GetSqlInjectionMatchSetResponse' {} Maybe SqlInjectionMatchSet
a -> GetSqlInjectionMatchSetResponse
s {$sel:sqlInjectionMatchSet:GetSqlInjectionMatchSetResponse' :: Maybe SqlInjectionMatchSet
sqlInjectionMatchSet = Maybe SqlInjectionMatchSet
a} :: GetSqlInjectionMatchSetResponse)
getSqlInjectionMatchSetResponse_httpStatus :: Lens.Lens' GetSqlInjectionMatchSetResponse Prelude.Int
getSqlInjectionMatchSetResponse_httpStatus :: Lens' GetSqlInjectionMatchSetResponse Int
getSqlInjectionMatchSetResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSqlInjectionMatchSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSqlInjectionMatchSetResponse' :: GetSqlInjectionMatchSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSqlInjectionMatchSetResponse
s@GetSqlInjectionMatchSetResponse' {} Int
a -> GetSqlInjectionMatchSetResponse
s {$sel:httpStatus:GetSqlInjectionMatchSetResponse' :: Int
httpStatus = Int
a} :: GetSqlInjectionMatchSetResponse)
instance
Prelude.NFData
GetSqlInjectionMatchSetResponse
where
rnf :: GetSqlInjectionMatchSetResponse -> ()
rnf GetSqlInjectionMatchSetResponse' {Int
Maybe SqlInjectionMatchSet
httpStatus :: Int
sqlInjectionMatchSet :: Maybe SqlInjectionMatchSet
$sel:httpStatus:GetSqlInjectionMatchSetResponse' :: GetSqlInjectionMatchSetResponse -> Int
$sel:sqlInjectionMatchSet:GetSqlInjectionMatchSetResponse' :: GetSqlInjectionMatchSetResponse -> Maybe SqlInjectionMatchSet
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SqlInjectionMatchSet
sqlInjectionMatchSet
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus