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