{-# 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.DeleteXssMatchSet
(
DeleteXssMatchSet (..),
newDeleteXssMatchSet,
deleteXssMatchSet_xssMatchSetId,
deleteXssMatchSet_changeToken,
DeleteXssMatchSetResponse (..),
newDeleteXssMatchSetResponse,
deleteXssMatchSetResponse_changeToken,
deleteXssMatchSetResponse_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 DeleteXssMatchSet = DeleteXssMatchSet'
{
DeleteXssMatchSet -> Text
xssMatchSetId :: Prelude.Text,
DeleteXssMatchSet -> Text
changeToken :: Prelude.Text
}
deriving (DeleteXssMatchSet -> DeleteXssMatchSet -> Bool
(DeleteXssMatchSet -> DeleteXssMatchSet -> Bool)
-> (DeleteXssMatchSet -> DeleteXssMatchSet -> Bool)
-> Eq DeleteXssMatchSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteXssMatchSet -> DeleteXssMatchSet -> Bool
$c/= :: DeleteXssMatchSet -> DeleteXssMatchSet -> Bool
== :: DeleteXssMatchSet -> DeleteXssMatchSet -> Bool
$c== :: DeleteXssMatchSet -> DeleteXssMatchSet -> Bool
Prelude.Eq, ReadPrec [DeleteXssMatchSet]
ReadPrec DeleteXssMatchSet
Int -> ReadS DeleteXssMatchSet
ReadS [DeleteXssMatchSet]
(Int -> ReadS DeleteXssMatchSet)
-> ReadS [DeleteXssMatchSet]
-> ReadPrec DeleteXssMatchSet
-> ReadPrec [DeleteXssMatchSet]
-> Read DeleteXssMatchSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteXssMatchSet]
$creadListPrec :: ReadPrec [DeleteXssMatchSet]
readPrec :: ReadPrec DeleteXssMatchSet
$creadPrec :: ReadPrec DeleteXssMatchSet
readList :: ReadS [DeleteXssMatchSet]
$creadList :: ReadS [DeleteXssMatchSet]
readsPrec :: Int -> ReadS DeleteXssMatchSet
$creadsPrec :: Int -> ReadS DeleteXssMatchSet
Prelude.Read, Int -> DeleteXssMatchSet -> ShowS
[DeleteXssMatchSet] -> ShowS
DeleteXssMatchSet -> String
(Int -> DeleteXssMatchSet -> ShowS)
-> (DeleteXssMatchSet -> String)
-> ([DeleteXssMatchSet] -> ShowS)
-> Show DeleteXssMatchSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteXssMatchSet] -> ShowS
$cshowList :: [DeleteXssMatchSet] -> ShowS
show :: DeleteXssMatchSet -> String
$cshow :: DeleteXssMatchSet -> String
showsPrec :: Int -> DeleteXssMatchSet -> ShowS
$cshowsPrec :: Int -> DeleteXssMatchSet -> ShowS
Prelude.Show, (forall x. DeleteXssMatchSet -> Rep DeleteXssMatchSet x)
-> (forall x. Rep DeleteXssMatchSet x -> DeleteXssMatchSet)
-> Generic DeleteXssMatchSet
forall x. Rep DeleteXssMatchSet x -> DeleteXssMatchSet
forall x. DeleteXssMatchSet -> Rep DeleteXssMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteXssMatchSet x -> DeleteXssMatchSet
$cfrom :: forall x. DeleteXssMatchSet -> Rep DeleteXssMatchSet x
Prelude.Generic)
newDeleteXssMatchSet ::
Prelude.Text ->
Prelude.Text ->
DeleteXssMatchSet
newDeleteXssMatchSet :: Text -> Text -> DeleteXssMatchSet
newDeleteXssMatchSet Text
pXssMatchSetId_ Text
pChangeToken_ =
DeleteXssMatchSet' :: Text -> Text -> DeleteXssMatchSet
DeleteXssMatchSet'
{ $sel:xssMatchSetId:DeleteXssMatchSet' :: Text
xssMatchSetId = Text
pXssMatchSetId_,
$sel:changeToken:DeleteXssMatchSet' :: Text
changeToken = Text
pChangeToken_
}
deleteXssMatchSet_xssMatchSetId :: Lens.Lens' DeleteXssMatchSet Prelude.Text
deleteXssMatchSet_xssMatchSetId :: (Text -> f Text) -> DeleteXssMatchSet -> f DeleteXssMatchSet
deleteXssMatchSet_xssMatchSetId = (DeleteXssMatchSet -> Text)
-> (DeleteXssMatchSet -> Text -> DeleteXssMatchSet)
-> Lens DeleteXssMatchSet DeleteXssMatchSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteXssMatchSet' {Text
xssMatchSetId :: Text
$sel:xssMatchSetId:DeleteXssMatchSet' :: DeleteXssMatchSet -> Text
xssMatchSetId} -> Text
xssMatchSetId) (\s :: DeleteXssMatchSet
s@DeleteXssMatchSet' {} Text
a -> DeleteXssMatchSet
s {$sel:xssMatchSetId:DeleteXssMatchSet' :: Text
xssMatchSetId = Text
a} :: DeleteXssMatchSet)
deleteXssMatchSet_changeToken :: Lens.Lens' DeleteXssMatchSet Prelude.Text
deleteXssMatchSet_changeToken :: (Text -> f Text) -> DeleteXssMatchSet -> f DeleteXssMatchSet
deleteXssMatchSet_changeToken = (DeleteXssMatchSet -> Text)
-> (DeleteXssMatchSet -> Text -> DeleteXssMatchSet)
-> Lens DeleteXssMatchSet DeleteXssMatchSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteXssMatchSet' {Text
changeToken :: Text
$sel:changeToken:DeleteXssMatchSet' :: DeleteXssMatchSet -> Text
changeToken} -> Text
changeToken) (\s :: DeleteXssMatchSet
s@DeleteXssMatchSet' {} Text
a -> DeleteXssMatchSet
s {$sel:changeToken:DeleteXssMatchSet' :: Text
changeToken = Text
a} :: DeleteXssMatchSet)
instance Core.AWSRequest DeleteXssMatchSet where
type
AWSResponse DeleteXssMatchSet =
DeleteXssMatchSetResponse
request :: DeleteXssMatchSet -> Request DeleteXssMatchSet
request = Service -> DeleteXssMatchSet -> Request DeleteXssMatchSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteXssMatchSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteXssMatchSet)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteXssMatchSet))
-> Logger
-> Service
-> Proxy DeleteXssMatchSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteXssMatchSet)))
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 -> DeleteXssMatchSetResponse
DeleteXssMatchSetResponse'
(Maybe Text -> Int -> DeleteXssMatchSetResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteXssMatchSetResponse)
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 -> DeleteXssMatchSetResponse)
-> Either String Int -> Either String DeleteXssMatchSetResponse
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 DeleteXssMatchSet
instance Prelude.NFData DeleteXssMatchSet
instance Core.ToHeaders DeleteXssMatchSet where
toHeaders :: DeleteXssMatchSet -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteXssMatchSet -> 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.DeleteXssMatchSet" ::
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 DeleteXssMatchSet where
toJSON :: DeleteXssMatchSet -> Value
toJSON DeleteXssMatchSet' {Text
changeToken :: Text
xssMatchSetId :: Text
$sel:changeToken:DeleteXssMatchSet' :: DeleteXssMatchSet -> Text
$sel:xssMatchSetId:DeleteXssMatchSet' :: DeleteXssMatchSet -> 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
"XssMatchSetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
xssMatchSetId),
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 DeleteXssMatchSet where
toPath :: DeleteXssMatchSet -> ByteString
toPath = ByteString -> DeleteXssMatchSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteXssMatchSet where
toQuery :: DeleteXssMatchSet -> QueryString
toQuery = QueryString -> DeleteXssMatchSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteXssMatchSetResponse = DeleteXssMatchSetResponse'
{
DeleteXssMatchSetResponse -> Maybe Text
changeToken :: Prelude.Maybe Prelude.Text,
DeleteXssMatchSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteXssMatchSetResponse -> DeleteXssMatchSetResponse -> Bool
(DeleteXssMatchSetResponse -> DeleteXssMatchSetResponse -> Bool)
-> (DeleteXssMatchSetResponse -> DeleteXssMatchSetResponse -> Bool)
-> Eq DeleteXssMatchSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteXssMatchSetResponse -> DeleteXssMatchSetResponse -> Bool
$c/= :: DeleteXssMatchSetResponse -> DeleteXssMatchSetResponse -> Bool
== :: DeleteXssMatchSetResponse -> DeleteXssMatchSetResponse -> Bool
$c== :: DeleteXssMatchSetResponse -> DeleteXssMatchSetResponse -> Bool
Prelude.Eq, ReadPrec [DeleteXssMatchSetResponse]
ReadPrec DeleteXssMatchSetResponse
Int -> ReadS DeleteXssMatchSetResponse
ReadS [DeleteXssMatchSetResponse]
(Int -> ReadS DeleteXssMatchSetResponse)
-> ReadS [DeleteXssMatchSetResponse]
-> ReadPrec DeleteXssMatchSetResponse
-> ReadPrec [DeleteXssMatchSetResponse]
-> Read DeleteXssMatchSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteXssMatchSetResponse]
$creadListPrec :: ReadPrec [DeleteXssMatchSetResponse]
readPrec :: ReadPrec DeleteXssMatchSetResponse
$creadPrec :: ReadPrec DeleteXssMatchSetResponse
readList :: ReadS [DeleteXssMatchSetResponse]
$creadList :: ReadS [DeleteXssMatchSetResponse]
readsPrec :: Int -> ReadS DeleteXssMatchSetResponse
$creadsPrec :: Int -> ReadS DeleteXssMatchSetResponse
Prelude.Read, Int -> DeleteXssMatchSetResponse -> ShowS
[DeleteXssMatchSetResponse] -> ShowS
DeleteXssMatchSetResponse -> String
(Int -> DeleteXssMatchSetResponse -> ShowS)
-> (DeleteXssMatchSetResponse -> String)
-> ([DeleteXssMatchSetResponse] -> ShowS)
-> Show DeleteXssMatchSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteXssMatchSetResponse] -> ShowS
$cshowList :: [DeleteXssMatchSetResponse] -> ShowS
show :: DeleteXssMatchSetResponse -> String
$cshow :: DeleteXssMatchSetResponse -> String
showsPrec :: Int -> DeleteXssMatchSetResponse -> ShowS
$cshowsPrec :: Int -> DeleteXssMatchSetResponse -> ShowS
Prelude.Show, (forall x.
DeleteXssMatchSetResponse -> Rep DeleteXssMatchSetResponse x)
-> (forall x.
Rep DeleteXssMatchSetResponse x -> DeleteXssMatchSetResponse)
-> Generic DeleteXssMatchSetResponse
forall x.
Rep DeleteXssMatchSetResponse x -> DeleteXssMatchSetResponse
forall x.
DeleteXssMatchSetResponse -> Rep DeleteXssMatchSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteXssMatchSetResponse x -> DeleteXssMatchSetResponse
$cfrom :: forall x.
DeleteXssMatchSetResponse -> Rep DeleteXssMatchSetResponse x
Prelude.Generic)
newDeleteXssMatchSetResponse ::
Prelude.Int ->
DeleteXssMatchSetResponse
newDeleteXssMatchSetResponse :: Int -> DeleteXssMatchSetResponse
newDeleteXssMatchSetResponse Int
pHttpStatus_ =
DeleteXssMatchSetResponse' :: Maybe Text -> Int -> DeleteXssMatchSetResponse
DeleteXssMatchSetResponse'
{ $sel:changeToken:DeleteXssMatchSetResponse' :: Maybe Text
changeToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteXssMatchSetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteXssMatchSetResponse_changeToken :: Lens.Lens' DeleteXssMatchSetResponse (Prelude.Maybe Prelude.Text)
deleteXssMatchSetResponse_changeToken :: (Maybe Text -> f (Maybe Text))
-> DeleteXssMatchSetResponse -> f DeleteXssMatchSetResponse
deleteXssMatchSetResponse_changeToken = (DeleteXssMatchSetResponse -> Maybe Text)
-> (DeleteXssMatchSetResponse
-> Maybe Text -> DeleteXssMatchSetResponse)
-> Lens
DeleteXssMatchSetResponse
DeleteXssMatchSetResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteXssMatchSetResponse' {Maybe Text
changeToken :: Maybe Text
$sel:changeToken:DeleteXssMatchSetResponse' :: DeleteXssMatchSetResponse -> Maybe Text
changeToken} -> Maybe Text
changeToken) (\s :: DeleteXssMatchSetResponse
s@DeleteXssMatchSetResponse' {} Maybe Text
a -> DeleteXssMatchSetResponse
s {$sel:changeToken:DeleteXssMatchSetResponse' :: Maybe Text
changeToken = Maybe Text
a} :: DeleteXssMatchSetResponse)
deleteXssMatchSetResponse_httpStatus :: Lens.Lens' DeleteXssMatchSetResponse Prelude.Int
deleteXssMatchSetResponse_httpStatus :: (Int -> f Int)
-> DeleteXssMatchSetResponse -> f DeleteXssMatchSetResponse
deleteXssMatchSetResponse_httpStatus = (DeleteXssMatchSetResponse -> Int)
-> (DeleteXssMatchSetResponse -> Int -> DeleteXssMatchSetResponse)
-> Lens DeleteXssMatchSetResponse DeleteXssMatchSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteXssMatchSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteXssMatchSetResponse' :: DeleteXssMatchSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteXssMatchSetResponse
s@DeleteXssMatchSetResponse' {} Int
a -> DeleteXssMatchSetResponse
s {$sel:httpStatus:DeleteXssMatchSetResponse' :: Int
httpStatus = Int
a} :: DeleteXssMatchSetResponse)
instance Prelude.NFData DeleteXssMatchSetResponse