{-# 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.WAF.DeleteSqlInjectionMatchSet
(
DeleteSqlInjectionMatchSet (..),
newDeleteSqlInjectionMatchSet,
deleteSqlInjectionMatchSet_sqlInjectionMatchSetId,
deleteSqlInjectionMatchSet_changeToken,
DeleteSqlInjectionMatchSetResponse (..),
newDeleteSqlInjectionMatchSetResponse,
deleteSqlInjectionMatchSetResponse_changeToken,
deleteSqlInjectionMatchSetResponse_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.WAF.Types
data DeleteSqlInjectionMatchSet = DeleteSqlInjectionMatchSet'
{
DeleteSqlInjectionMatchSet -> Text
sqlInjectionMatchSetId :: Prelude.Text,
DeleteSqlInjectionMatchSet -> Text
changeToken :: Prelude.Text
}
deriving (DeleteSqlInjectionMatchSet -> DeleteSqlInjectionMatchSet -> Bool
(DeleteSqlInjectionMatchSet -> DeleteSqlInjectionMatchSet -> Bool)
-> (DeleteSqlInjectionMatchSet
-> DeleteSqlInjectionMatchSet -> Bool)
-> Eq DeleteSqlInjectionMatchSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSqlInjectionMatchSet -> DeleteSqlInjectionMatchSet -> Bool
$c/= :: DeleteSqlInjectionMatchSet -> DeleteSqlInjectionMatchSet -> Bool
== :: DeleteSqlInjectionMatchSet -> DeleteSqlInjectionMatchSet -> Bool
$c== :: DeleteSqlInjectionMatchSet -> DeleteSqlInjectionMatchSet -> Bool
Prelude.Eq, ReadPrec [DeleteSqlInjectionMatchSet]
ReadPrec DeleteSqlInjectionMatchSet
Int -> ReadS DeleteSqlInjectionMatchSet
ReadS [DeleteSqlInjectionMatchSet]
(Int -> ReadS DeleteSqlInjectionMatchSet)
-> ReadS [DeleteSqlInjectionMatchSet]
-> ReadPrec DeleteSqlInjectionMatchSet
-> ReadPrec [DeleteSqlInjectionMatchSet]
-> Read DeleteSqlInjectionMatchSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSqlInjectionMatchSet]
$creadListPrec :: ReadPrec [DeleteSqlInjectionMatchSet]
readPrec :: ReadPrec DeleteSqlInjectionMatchSet
$creadPrec :: ReadPrec DeleteSqlInjectionMatchSet
readList :: ReadS [DeleteSqlInjectionMatchSet]
$creadList :: ReadS [DeleteSqlInjectionMatchSet]
readsPrec :: Int -> ReadS DeleteSqlInjectionMatchSet
$creadsPrec :: Int -> ReadS DeleteSqlInjectionMatchSet
Prelude.Read, Int -> DeleteSqlInjectionMatchSet -> ShowS
[DeleteSqlInjectionMatchSet] -> ShowS
DeleteSqlInjectionMatchSet -> String
(Int -> DeleteSqlInjectionMatchSet -> ShowS)
-> (DeleteSqlInjectionMatchSet -> String)
-> ([DeleteSqlInjectionMatchSet] -> ShowS)
-> Show DeleteSqlInjectionMatchSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSqlInjectionMatchSet] -> ShowS
$cshowList :: [DeleteSqlInjectionMatchSet] -> ShowS
show :: DeleteSqlInjectionMatchSet -> String
$cshow :: DeleteSqlInjectionMatchSet -> String
showsPrec :: Int -> DeleteSqlInjectionMatchSet -> ShowS
$cshowsPrec :: Int -> DeleteSqlInjectionMatchSet -> ShowS
Prelude.Show, (forall x.
DeleteSqlInjectionMatchSet -> Rep DeleteSqlInjectionMatchSet x)
-> (forall x.
Rep DeleteSqlInjectionMatchSet x -> DeleteSqlInjectionMatchSet)
-> Generic DeleteSqlInjectionMatchSet
forall x.
Rep DeleteSqlInjectionMatchSet x -> DeleteSqlInjectionMatchSet
forall x.
DeleteSqlInjectionMatchSet -> Rep DeleteSqlInjectionMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteSqlInjectionMatchSet x -> DeleteSqlInjectionMatchSet
$cfrom :: forall x.
DeleteSqlInjectionMatchSet -> Rep DeleteSqlInjectionMatchSet x
Prelude.Generic)
newDeleteSqlInjectionMatchSet ::
Prelude.Text ->
Prelude.Text ->
DeleteSqlInjectionMatchSet
newDeleteSqlInjectionMatchSet :: Text -> Text -> DeleteSqlInjectionMatchSet
newDeleteSqlInjectionMatchSet
Text
pSqlInjectionMatchSetId_
Text
pChangeToken_ =
DeleteSqlInjectionMatchSet' :: Text -> Text -> DeleteSqlInjectionMatchSet
DeleteSqlInjectionMatchSet'
{ $sel:sqlInjectionMatchSetId:DeleteSqlInjectionMatchSet' :: Text
sqlInjectionMatchSetId =
Text
pSqlInjectionMatchSetId_,
$sel:changeToken:DeleteSqlInjectionMatchSet' :: Text
changeToken = Text
pChangeToken_
}
deleteSqlInjectionMatchSet_sqlInjectionMatchSetId :: Lens.Lens' DeleteSqlInjectionMatchSet Prelude.Text
deleteSqlInjectionMatchSet_sqlInjectionMatchSetId :: (Text -> f Text)
-> DeleteSqlInjectionMatchSet -> f DeleteSqlInjectionMatchSet
deleteSqlInjectionMatchSet_sqlInjectionMatchSetId = (DeleteSqlInjectionMatchSet -> Text)
-> (DeleteSqlInjectionMatchSet
-> Text -> DeleteSqlInjectionMatchSet)
-> Lens
DeleteSqlInjectionMatchSet DeleteSqlInjectionMatchSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSqlInjectionMatchSet' {Text
sqlInjectionMatchSetId :: Text
$sel:sqlInjectionMatchSetId:DeleteSqlInjectionMatchSet' :: DeleteSqlInjectionMatchSet -> Text
sqlInjectionMatchSetId} -> Text
sqlInjectionMatchSetId) (\s :: DeleteSqlInjectionMatchSet
s@DeleteSqlInjectionMatchSet' {} Text
a -> DeleteSqlInjectionMatchSet
s {$sel:sqlInjectionMatchSetId:DeleteSqlInjectionMatchSet' :: Text
sqlInjectionMatchSetId = Text
a} :: DeleteSqlInjectionMatchSet)
deleteSqlInjectionMatchSet_changeToken :: Lens.Lens' DeleteSqlInjectionMatchSet Prelude.Text
deleteSqlInjectionMatchSet_changeToken :: (Text -> f Text)
-> DeleteSqlInjectionMatchSet -> f DeleteSqlInjectionMatchSet
deleteSqlInjectionMatchSet_changeToken = (DeleteSqlInjectionMatchSet -> Text)
-> (DeleteSqlInjectionMatchSet
-> Text -> DeleteSqlInjectionMatchSet)
-> Lens
DeleteSqlInjectionMatchSet DeleteSqlInjectionMatchSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSqlInjectionMatchSet' {Text
changeToken :: Text
$sel:changeToken:DeleteSqlInjectionMatchSet' :: DeleteSqlInjectionMatchSet -> Text
changeToken} -> Text
changeToken) (\s :: DeleteSqlInjectionMatchSet
s@DeleteSqlInjectionMatchSet' {} Text
a -> DeleteSqlInjectionMatchSet
s {$sel:changeToken:DeleteSqlInjectionMatchSet' :: Text
changeToken = Text
a} :: DeleteSqlInjectionMatchSet)
instance Core.AWSRequest DeleteSqlInjectionMatchSet where
type
AWSResponse DeleteSqlInjectionMatchSet =
DeleteSqlInjectionMatchSetResponse
request :: DeleteSqlInjectionMatchSet -> Request DeleteSqlInjectionMatchSet
request = Service
-> DeleteSqlInjectionMatchSet -> Request DeleteSqlInjectionMatchSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteSqlInjectionMatchSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteSqlInjectionMatchSet)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteSqlInjectionMatchSet))
-> Logger
-> Service
-> Proxy DeleteSqlInjectionMatchSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteSqlInjectionMatchSet)))
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 Text -> Int -> DeleteSqlInjectionMatchSetResponse
DeleteSqlInjectionMatchSetResponse'
(Maybe Text -> Int -> DeleteSqlInjectionMatchSetResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteSqlInjectionMatchSetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChangeToken")
Either String (Int -> DeleteSqlInjectionMatchSetResponse)
-> Either String Int
-> Either String DeleteSqlInjectionMatchSetResponse
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 DeleteSqlInjectionMatchSet
instance Prelude.NFData DeleteSqlInjectionMatchSet
instance Core.ToHeaders DeleteSqlInjectionMatchSet where
toHeaders :: DeleteSqlInjectionMatchSet -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteSqlInjectionMatchSet -> 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_20150824.DeleteSqlInjectionMatchSet" ::
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 DeleteSqlInjectionMatchSet where
toJSON :: DeleteSqlInjectionMatchSet -> Value
toJSON DeleteSqlInjectionMatchSet' {Text
changeToken :: Text
sqlInjectionMatchSetId :: Text
$sel:changeToken:DeleteSqlInjectionMatchSet' :: DeleteSqlInjectionMatchSet -> Text
$sel:sqlInjectionMatchSetId:DeleteSqlInjectionMatchSet' :: DeleteSqlInjectionMatchSet -> 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
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ChangeToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
changeToken)
]
)
instance Core.ToPath DeleteSqlInjectionMatchSet where
toPath :: DeleteSqlInjectionMatchSet -> ByteString
toPath = ByteString -> DeleteSqlInjectionMatchSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteSqlInjectionMatchSet where
toQuery :: DeleteSqlInjectionMatchSet -> QueryString
toQuery = QueryString -> DeleteSqlInjectionMatchSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteSqlInjectionMatchSetResponse = DeleteSqlInjectionMatchSetResponse'
{
DeleteSqlInjectionMatchSetResponse -> Maybe Text
changeToken :: Prelude.Maybe Prelude.Text,
DeleteSqlInjectionMatchSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteSqlInjectionMatchSetResponse
-> DeleteSqlInjectionMatchSetResponse -> Bool
(DeleteSqlInjectionMatchSetResponse
-> DeleteSqlInjectionMatchSetResponse -> Bool)
-> (DeleteSqlInjectionMatchSetResponse
-> DeleteSqlInjectionMatchSetResponse -> Bool)
-> Eq DeleteSqlInjectionMatchSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSqlInjectionMatchSetResponse
-> DeleteSqlInjectionMatchSetResponse -> Bool
$c/= :: DeleteSqlInjectionMatchSetResponse
-> DeleteSqlInjectionMatchSetResponse -> Bool
== :: DeleteSqlInjectionMatchSetResponse
-> DeleteSqlInjectionMatchSetResponse -> Bool
$c== :: DeleteSqlInjectionMatchSetResponse
-> DeleteSqlInjectionMatchSetResponse -> Bool
Prelude.Eq, ReadPrec [DeleteSqlInjectionMatchSetResponse]
ReadPrec DeleteSqlInjectionMatchSetResponse
Int -> ReadS DeleteSqlInjectionMatchSetResponse
ReadS [DeleteSqlInjectionMatchSetResponse]
(Int -> ReadS DeleteSqlInjectionMatchSetResponse)
-> ReadS [DeleteSqlInjectionMatchSetResponse]
-> ReadPrec DeleteSqlInjectionMatchSetResponse
-> ReadPrec [DeleteSqlInjectionMatchSetResponse]
-> Read DeleteSqlInjectionMatchSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSqlInjectionMatchSetResponse]
$creadListPrec :: ReadPrec [DeleteSqlInjectionMatchSetResponse]
readPrec :: ReadPrec DeleteSqlInjectionMatchSetResponse
$creadPrec :: ReadPrec DeleteSqlInjectionMatchSetResponse
readList :: ReadS [DeleteSqlInjectionMatchSetResponse]
$creadList :: ReadS [DeleteSqlInjectionMatchSetResponse]
readsPrec :: Int -> ReadS DeleteSqlInjectionMatchSetResponse
$creadsPrec :: Int -> ReadS DeleteSqlInjectionMatchSetResponse
Prelude.Read, Int -> DeleteSqlInjectionMatchSetResponse -> ShowS
[DeleteSqlInjectionMatchSetResponse] -> ShowS
DeleteSqlInjectionMatchSetResponse -> String
(Int -> DeleteSqlInjectionMatchSetResponse -> ShowS)
-> (DeleteSqlInjectionMatchSetResponse -> String)
-> ([DeleteSqlInjectionMatchSetResponse] -> ShowS)
-> Show DeleteSqlInjectionMatchSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSqlInjectionMatchSetResponse] -> ShowS
$cshowList :: [DeleteSqlInjectionMatchSetResponse] -> ShowS
show :: DeleteSqlInjectionMatchSetResponse -> String
$cshow :: DeleteSqlInjectionMatchSetResponse -> String
showsPrec :: Int -> DeleteSqlInjectionMatchSetResponse -> ShowS
$cshowsPrec :: Int -> DeleteSqlInjectionMatchSetResponse -> ShowS
Prelude.Show, (forall x.
DeleteSqlInjectionMatchSetResponse
-> Rep DeleteSqlInjectionMatchSetResponse x)
-> (forall x.
Rep DeleteSqlInjectionMatchSetResponse x
-> DeleteSqlInjectionMatchSetResponse)
-> Generic DeleteSqlInjectionMatchSetResponse
forall x.
Rep DeleteSqlInjectionMatchSetResponse x
-> DeleteSqlInjectionMatchSetResponse
forall x.
DeleteSqlInjectionMatchSetResponse
-> Rep DeleteSqlInjectionMatchSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteSqlInjectionMatchSetResponse x
-> DeleteSqlInjectionMatchSetResponse
$cfrom :: forall x.
DeleteSqlInjectionMatchSetResponse
-> Rep DeleteSqlInjectionMatchSetResponse x
Prelude.Generic)
newDeleteSqlInjectionMatchSetResponse ::
Prelude.Int ->
DeleteSqlInjectionMatchSetResponse
newDeleteSqlInjectionMatchSetResponse :: Int -> DeleteSqlInjectionMatchSetResponse
newDeleteSqlInjectionMatchSetResponse Int
pHttpStatus_ =
DeleteSqlInjectionMatchSetResponse' :: Maybe Text -> Int -> DeleteSqlInjectionMatchSetResponse
DeleteSqlInjectionMatchSetResponse'
{ $sel:changeToken:DeleteSqlInjectionMatchSetResponse' :: Maybe Text
changeToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteSqlInjectionMatchSetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteSqlInjectionMatchSetResponse_changeToken :: Lens.Lens' DeleteSqlInjectionMatchSetResponse (Prelude.Maybe Prelude.Text)
deleteSqlInjectionMatchSetResponse_changeToken :: (Maybe Text -> f (Maybe Text))
-> DeleteSqlInjectionMatchSetResponse
-> f DeleteSqlInjectionMatchSetResponse
deleteSqlInjectionMatchSetResponse_changeToken = (DeleteSqlInjectionMatchSetResponse -> Maybe Text)
-> (DeleteSqlInjectionMatchSetResponse
-> Maybe Text -> DeleteSqlInjectionMatchSetResponse)
-> Lens
DeleteSqlInjectionMatchSetResponse
DeleteSqlInjectionMatchSetResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSqlInjectionMatchSetResponse' {Maybe Text
changeToken :: Maybe Text
$sel:changeToken:DeleteSqlInjectionMatchSetResponse' :: DeleteSqlInjectionMatchSetResponse -> Maybe Text
changeToken} -> Maybe Text
changeToken) (\s :: DeleteSqlInjectionMatchSetResponse
s@DeleteSqlInjectionMatchSetResponse' {} Maybe Text
a -> DeleteSqlInjectionMatchSetResponse
s {$sel:changeToken:DeleteSqlInjectionMatchSetResponse' :: Maybe Text
changeToken = Maybe Text
a} :: DeleteSqlInjectionMatchSetResponse)
deleteSqlInjectionMatchSetResponse_httpStatus :: Lens.Lens' DeleteSqlInjectionMatchSetResponse Prelude.Int
deleteSqlInjectionMatchSetResponse_httpStatus :: (Int -> f Int)
-> DeleteSqlInjectionMatchSetResponse
-> f DeleteSqlInjectionMatchSetResponse
deleteSqlInjectionMatchSetResponse_httpStatus = (DeleteSqlInjectionMatchSetResponse -> Int)
-> (DeleteSqlInjectionMatchSetResponse
-> Int -> DeleteSqlInjectionMatchSetResponse)
-> Lens
DeleteSqlInjectionMatchSetResponse
DeleteSqlInjectionMatchSetResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSqlInjectionMatchSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSqlInjectionMatchSetResponse' :: DeleteSqlInjectionMatchSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteSqlInjectionMatchSetResponse
s@DeleteSqlInjectionMatchSetResponse' {} Int
a -> DeleteSqlInjectionMatchSetResponse
s {$sel:httpStatus:DeleteSqlInjectionMatchSetResponse' :: Int
httpStatus = Int
a} :: DeleteSqlInjectionMatchSetResponse)
instance
Prelude.NFData
DeleteSqlInjectionMatchSetResponse