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