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