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