{-# 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.GetGeoMatchSet
(
GetGeoMatchSet (..),
newGetGeoMatchSet,
getGeoMatchSet_geoMatchSetId,
GetGeoMatchSetResponse (..),
newGetGeoMatchSetResponse,
getGeoMatchSetResponse_geoMatchSet,
getGeoMatchSetResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WAFRegional.Types
data GetGeoMatchSet = GetGeoMatchSet'
{
GetGeoMatchSet -> Text
geoMatchSetId :: Prelude.Text
}
deriving (GetGeoMatchSet -> GetGeoMatchSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetGeoMatchSet -> GetGeoMatchSet -> Bool
$c/= :: GetGeoMatchSet -> GetGeoMatchSet -> Bool
== :: GetGeoMatchSet -> GetGeoMatchSet -> Bool
$c== :: GetGeoMatchSet -> GetGeoMatchSet -> Bool
Prelude.Eq, ReadPrec [GetGeoMatchSet]
ReadPrec GetGeoMatchSet
Int -> ReadS GetGeoMatchSet
ReadS [GetGeoMatchSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetGeoMatchSet]
$creadListPrec :: ReadPrec [GetGeoMatchSet]
readPrec :: ReadPrec GetGeoMatchSet
$creadPrec :: ReadPrec GetGeoMatchSet
readList :: ReadS [GetGeoMatchSet]
$creadList :: ReadS [GetGeoMatchSet]
readsPrec :: Int -> ReadS GetGeoMatchSet
$creadsPrec :: Int -> ReadS GetGeoMatchSet
Prelude.Read, Int -> GetGeoMatchSet -> ShowS
[GetGeoMatchSet] -> ShowS
GetGeoMatchSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetGeoMatchSet] -> ShowS
$cshowList :: [GetGeoMatchSet] -> ShowS
show :: GetGeoMatchSet -> String
$cshow :: GetGeoMatchSet -> String
showsPrec :: Int -> GetGeoMatchSet -> ShowS
$cshowsPrec :: Int -> GetGeoMatchSet -> ShowS
Prelude.Show, forall x. Rep GetGeoMatchSet x -> GetGeoMatchSet
forall x. GetGeoMatchSet -> Rep GetGeoMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetGeoMatchSet x -> GetGeoMatchSet
$cfrom :: forall x. GetGeoMatchSet -> Rep GetGeoMatchSet x
Prelude.Generic)
newGetGeoMatchSet ::
Prelude.Text ->
GetGeoMatchSet
newGetGeoMatchSet :: Text -> GetGeoMatchSet
newGetGeoMatchSet Text
pGeoMatchSetId_ =
GetGeoMatchSet' {$sel:geoMatchSetId:GetGeoMatchSet' :: Text
geoMatchSetId = Text
pGeoMatchSetId_}
getGeoMatchSet_geoMatchSetId :: Lens.Lens' GetGeoMatchSet Prelude.Text
getGeoMatchSet_geoMatchSetId :: Lens' GetGeoMatchSet Text
getGeoMatchSet_geoMatchSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGeoMatchSet' {Text
geoMatchSetId :: Text
$sel:geoMatchSetId:GetGeoMatchSet' :: GetGeoMatchSet -> Text
geoMatchSetId} -> Text
geoMatchSetId) (\s :: GetGeoMatchSet
s@GetGeoMatchSet' {} Text
a -> GetGeoMatchSet
s {$sel:geoMatchSetId:GetGeoMatchSet' :: Text
geoMatchSetId = Text
a} :: GetGeoMatchSet)
instance Core.AWSRequest GetGeoMatchSet where
type
AWSResponse GetGeoMatchSet =
GetGeoMatchSetResponse
request :: (Service -> Service) -> GetGeoMatchSet -> Request GetGeoMatchSet
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetGeoMatchSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetGeoMatchSet)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe GeoMatchSet -> Int -> GetGeoMatchSetResponse
GetGeoMatchSetResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"GeoMatchSet")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetGeoMatchSet where
hashWithSalt :: Int -> GetGeoMatchSet -> Int
hashWithSalt Int
_salt GetGeoMatchSet' {Text
geoMatchSetId :: Text
$sel:geoMatchSetId:GetGeoMatchSet' :: GetGeoMatchSet -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
geoMatchSetId
instance Prelude.NFData GetGeoMatchSet where
rnf :: GetGeoMatchSet -> ()
rnf GetGeoMatchSet' {Text
geoMatchSetId :: Text
$sel:geoMatchSetId:GetGeoMatchSet' :: GetGeoMatchSet -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
geoMatchSetId
instance Data.ToHeaders GetGeoMatchSet where
toHeaders :: GetGeoMatchSet -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSWAF_Regional_20161128.GetGeoMatchSet" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetGeoMatchSet where
toJSON :: GetGeoMatchSet -> Value
toJSON GetGeoMatchSet' {Text
geoMatchSetId :: Text
$sel:geoMatchSetId:GetGeoMatchSet' :: GetGeoMatchSet -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"GeoMatchSetId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
geoMatchSetId)
]
)
instance Data.ToPath GetGeoMatchSet where
toPath :: GetGeoMatchSet -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetGeoMatchSet where
toQuery :: GetGeoMatchSet -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetGeoMatchSetResponse = GetGeoMatchSetResponse'
{
GetGeoMatchSetResponse -> Maybe GeoMatchSet
geoMatchSet :: Prelude.Maybe GeoMatchSet,
GetGeoMatchSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetGeoMatchSetResponse -> GetGeoMatchSetResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetGeoMatchSetResponse -> GetGeoMatchSetResponse -> Bool
$c/= :: GetGeoMatchSetResponse -> GetGeoMatchSetResponse -> Bool
== :: GetGeoMatchSetResponse -> GetGeoMatchSetResponse -> Bool
$c== :: GetGeoMatchSetResponse -> GetGeoMatchSetResponse -> Bool
Prelude.Eq, ReadPrec [GetGeoMatchSetResponse]
ReadPrec GetGeoMatchSetResponse
Int -> ReadS GetGeoMatchSetResponse
ReadS [GetGeoMatchSetResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetGeoMatchSetResponse]
$creadListPrec :: ReadPrec [GetGeoMatchSetResponse]
readPrec :: ReadPrec GetGeoMatchSetResponse
$creadPrec :: ReadPrec GetGeoMatchSetResponse
readList :: ReadS [GetGeoMatchSetResponse]
$creadList :: ReadS [GetGeoMatchSetResponse]
readsPrec :: Int -> ReadS GetGeoMatchSetResponse
$creadsPrec :: Int -> ReadS GetGeoMatchSetResponse
Prelude.Read, Int -> GetGeoMatchSetResponse -> ShowS
[GetGeoMatchSetResponse] -> ShowS
GetGeoMatchSetResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetGeoMatchSetResponse] -> ShowS
$cshowList :: [GetGeoMatchSetResponse] -> ShowS
show :: GetGeoMatchSetResponse -> String
$cshow :: GetGeoMatchSetResponse -> String
showsPrec :: Int -> GetGeoMatchSetResponse -> ShowS
$cshowsPrec :: Int -> GetGeoMatchSetResponse -> ShowS
Prelude.Show, forall x. Rep GetGeoMatchSetResponse x -> GetGeoMatchSetResponse
forall x. GetGeoMatchSetResponse -> Rep GetGeoMatchSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetGeoMatchSetResponse x -> GetGeoMatchSetResponse
$cfrom :: forall x. GetGeoMatchSetResponse -> Rep GetGeoMatchSetResponse x
Prelude.Generic)
newGetGeoMatchSetResponse ::
Prelude.Int ->
GetGeoMatchSetResponse
newGetGeoMatchSetResponse :: Int -> GetGeoMatchSetResponse
newGetGeoMatchSetResponse Int
pHttpStatus_ =
GetGeoMatchSetResponse'
{ $sel:geoMatchSet:GetGeoMatchSetResponse' :: Maybe GeoMatchSet
geoMatchSet =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetGeoMatchSetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getGeoMatchSetResponse_geoMatchSet :: Lens.Lens' GetGeoMatchSetResponse (Prelude.Maybe GeoMatchSet)
getGeoMatchSetResponse_geoMatchSet :: Lens' GetGeoMatchSetResponse (Maybe GeoMatchSet)
getGeoMatchSetResponse_geoMatchSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGeoMatchSetResponse' {Maybe GeoMatchSet
geoMatchSet :: Maybe GeoMatchSet
$sel:geoMatchSet:GetGeoMatchSetResponse' :: GetGeoMatchSetResponse -> Maybe GeoMatchSet
geoMatchSet} -> Maybe GeoMatchSet
geoMatchSet) (\s :: GetGeoMatchSetResponse
s@GetGeoMatchSetResponse' {} Maybe GeoMatchSet
a -> GetGeoMatchSetResponse
s {$sel:geoMatchSet:GetGeoMatchSetResponse' :: Maybe GeoMatchSet
geoMatchSet = Maybe GeoMatchSet
a} :: GetGeoMatchSetResponse)
getGeoMatchSetResponse_httpStatus :: Lens.Lens' GetGeoMatchSetResponse Prelude.Int
getGeoMatchSetResponse_httpStatus :: Lens' GetGeoMatchSetResponse Int
getGeoMatchSetResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGeoMatchSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetGeoMatchSetResponse' :: GetGeoMatchSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetGeoMatchSetResponse
s@GetGeoMatchSetResponse' {} Int
a -> GetGeoMatchSetResponse
s {$sel:httpStatus:GetGeoMatchSetResponse' :: Int
httpStatus = Int
a} :: GetGeoMatchSetResponse)
instance Prelude.NFData GetGeoMatchSetResponse where
rnf :: GetGeoMatchSetResponse -> ()
rnf GetGeoMatchSetResponse' {Int
Maybe GeoMatchSet
httpStatus :: Int
geoMatchSet :: Maybe GeoMatchSet
$sel:httpStatus:GetGeoMatchSetResponse' :: GetGeoMatchSetResponse -> Int
$sel:geoMatchSet:GetGeoMatchSetResponse' :: GetGeoMatchSetResponse -> Maybe GeoMatchSet
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe GeoMatchSet
geoMatchSet
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus