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