{-# 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.Lens as Lens
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
(GetSqlInjectionMatchSet -> GetSqlInjectionMatchSet -> Bool)
-> (GetSqlInjectionMatchSet -> GetSqlInjectionMatchSet -> Bool)
-> Eq GetSqlInjectionMatchSet
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]
(Int -> ReadS GetSqlInjectionMatchSet)
-> ReadS [GetSqlInjectionMatchSet]
-> ReadPrec GetSqlInjectionMatchSet
-> ReadPrec [GetSqlInjectionMatchSet]
-> Read 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
(Int -> GetSqlInjectionMatchSet -> ShowS)
-> (GetSqlInjectionMatchSet -> String)
-> ([GetSqlInjectionMatchSet] -> ShowS)
-> Show GetSqlInjectionMatchSet
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.
GetSqlInjectionMatchSet -> Rep GetSqlInjectionMatchSet x)
-> (forall x.
Rep GetSqlInjectionMatchSet x -> GetSqlInjectionMatchSet)
-> Generic GetSqlInjectionMatchSet
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' :: Text -> GetSqlInjectionMatchSet
GetSqlInjectionMatchSet'
{ $sel:sqlInjectionMatchSetId:GetSqlInjectionMatchSet' :: Text
sqlInjectionMatchSetId =
Text
pSqlInjectionMatchSetId_
}
getSqlInjectionMatchSet_sqlInjectionMatchSetId :: Lens.Lens' GetSqlInjectionMatchSet Prelude.Text
getSqlInjectionMatchSet_sqlInjectionMatchSetId :: (Text -> f Text)
-> GetSqlInjectionMatchSet -> f GetSqlInjectionMatchSet
getSqlInjectionMatchSet_sqlInjectionMatchSetId = (GetSqlInjectionMatchSet -> Text)
-> (GetSqlInjectionMatchSet -> Text -> GetSqlInjectionMatchSet)
-> Lens GetSqlInjectionMatchSet GetSqlInjectionMatchSet Text Text
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 :: GetSqlInjectionMatchSet -> Request GetSqlInjectionMatchSet
request = Service
-> GetSqlInjectionMatchSet -> Request GetSqlInjectionMatchSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetSqlInjectionMatchSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSqlInjectionMatchSet)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetSqlInjectionMatchSet))
-> Logger
-> Service
-> Proxy GetSqlInjectionMatchSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSqlInjectionMatchSet)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe SqlInjectionMatchSet
-> Int -> GetSqlInjectionMatchSetResponse
GetSqlInjectionMatchSetResponse'
(Maybe SqlInjectionMatchSet
-> Int -> GetSqlInjectionMatchSetResponse)
-> Either String (Maybe SqlInjectionMatchSet)
-> Either String (Int -> GetSqlInjectionMatchSetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe SqlInjectionMatchSet)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SqlInjectionMatchSet")
Either String (Int -> GetSqlInjectionMatchSetResponse)
-> Either String Int
-> Either String GetSqlInjectionMatchSetResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetSqlInjectionMatchSet
instance Prelude.NFData GetSqlInjectionMatchSet
instance Core.ToHeaders GetSqlInjectionMatchSet where
toHeaders :: GetSqlInjectionMatchSet -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetSqlInjectionMatchSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSWAF_Regional_20161128.GetSqlInjectionMatchSet" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON GetSqlInjectionMatchSet where
toJSON :: GetSqlInjectionMatchSet -> Value
toJSON GetSqlInjectionMatchSet' {Text
sqlInjectionMatchSetId :: Text
$sel:sqlInjectionMatchSetId:GetSqlInjectionMatchSet' :: GetSqlInjectionMatchSet -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"SqlInjectionMatchSetId"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sqlInjectionMatchSetId
)
]
)
instance Core.ToPath GetSqlInjectionMatchSet where
toPath :: GetSqlInjectionMatchSet -> ByteString
toPath = ByteString -> GetSqlInjectionMatchSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetSqlInjectionMatchSet where
toQuery :: GetSqlInjectionMatchSet -> QueryString
toQuery = QueryString -> GetSqlInjectionMatchSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(GetSqlInjectionMatchSetResponse
-> GetSqlInjectionMatchSetResponse -> Bool)
-> (GetSqlInjectionMatchSetResponse
-> GetSqlInjectionMatchSetResponse -> Bool)
-> Eq GetSqlInjectionMatchSetResponse
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]
(Int -> ReadS GetSqlInjectionMatchSetResponse)
-> ReadS [GetSqlInjectionMatchSetResponse]
-> ReadPrec GetSqlInjectionMatchSetResponse
-> ReadPrec [GetSqlInjectionMatchSetResponse]
-> Read 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
(Int -> GetSqlInjectionMatchSetResponse -> ShowS)
-> (GetSqlInjectionMatchSetResponse -> String)
-> ([GetSqlInjectionMatchSetResponse] -> ShowS)
-> Show GetSqlInjectionMatchSetResponse
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.
GetSqlInjectionMatchSetResponse
-> Rep GetSqlInjectionMatchSetResponse x)
-> (forall x.
Rep GetSqlInjectionMatchSetResponse x
-> GetSqlInjectionMatchSetResponse)
-> Generic GetSqlInjectionMatchSetResponse
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' :: Maybe SqlInjectionMatchSet
-> Int -> GetSqlInjectionMatchSetResponse
GetSqlInjectionMatchSetResponse'
{ $sel:sqlInjectionMatchSet:GetSqlInjectionMatchSetResponse' :: Maybe SqlInjectionMatchSet
sqlInjectionMatchSet =
Maybe SqlInjectionMatchSet
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetSqlInjectionMatchSetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getSqlInjectionMatchSetResponse_sqlInjectionMatchSet :: Lens.Lens' GetSqlInjectionMatchSetResponse (Prelude.Maybe SqlInjectionMatchSet)
getSqlInjectionMatchSetResponse_sqlInjectionMatchSet :: (Maybe SqlInjectionMatchSet -> f (Maybe SqlInjectionMatchSet))
-> GetSqlInjectionMatchSetResponse
-> f GetSqlInjectionMatchSetResponse
getSqlInjectionMatchSetResponse_sqlInjectionMatchSet = (GetSqlInjectionMatchSetResponse -> Maybe SqlInjectionMatchSet)
-> (GetSqlInjectionMatchSetResponse
-> Maybe SqlInjectionMatchSet -> GetSqlInjectionMatchSetResponse)
-> Lens
GetSqlInjectionMatchSetResponse
GetSqlInjectionMatchSetResponse
(Maybe SqlInjectionMatchSet)
(Maybe 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 :: (Int -> f Int)
-> GetSqlInjectionMatchSetResponse
-> f GetSqlInjectionMatchSetResponse
getSqlInjectionMatchSetResponse_httpStatus = (GetSqlInjectionMatchSetResponse -> Int)
-> (GetSqlInjectionMatchSetResponse
-> Int -> GetSqlInjectionMatchSetResponse)
-> Lens
GetSqlInjectionMatchSetResponse
GetSqlInjectionMatchSetResponse
Int
Int
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