{-# 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.GetXssMatchSet
(
GetXssMatchSet (..),
newGetXssMatchSet,
getXssMatchSet_xssMatchSetId,
GetXssMatchSetResponse (..),
newGetXssMatchSetResponse,
getXssMatchSetResponse_xssMatchSet,
getXssMatchSetResponse_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.WAF.Types
data GetXssMatchSet = GetXssMatchSet'
{
GetXssMatchSet -> Text
xssMatchSetId :: Prelude.Text
}
deriving (GetXssMatchSet -> GetXssMatchSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetXssMatchSet -> GetXssMatchSet -> Bool
$c/= :: GetXssMatchSet -> GetXssMatchSet -> Bool
== :: GetXssMatchSet -> GetXssMatchSet -> Bool
$c== :: GetXssMatchSet -> GetXssMatchSet -> Bool
Prelude.Eq, ReadPrec [GetXssMatchSet]
ReadPrec GetXssMatchSet
Int -> ReadS GetXssMatchSet
ReadS [GetXssMatchSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetXssMatchSet]
$creadListPrec :: ReadPrec [GetXssMatchSet]
readPrec :: ReadPrec GetXssMatchSet
$creadPrec :: ReadPrec GetXssMatchSet
readList :: ReadS [GetXssMatchSet]
$creadList :: ReadS [GetXssMatchSet]
readsPrec :: Int -> ReadS GetXssMatchSet
$creadsPrec :: Int -> ReadS GetXssMatchSet
Prelude.Read, Int -> GetXssMatchSet -> ShowS
[GetXssMatchSet] -> ShowS
GetXssMatchSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetXssMatchSet] -> ShowS
$cshowList :: [GetXssMatchSet] -> ShowS
show :: GetXssMatchSet -> String
$cshow :: GetXssMatchSet -> String
showsPrec :: Int -> GetXssMatchSet -> ShowS
$cshowsPrec :: Int -> GetXssMatchSet -> ShowS
Prelude.Show, forall x. Rep GetXssMatchSet x -> GetXssMatchSet
forall x. GetXssMatchSet -> Rep GetXssMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetXssMatchSet x -> GetXssMatchSet
$cfrom :: forall x. GetXssMatchSet -> Rep GetXssMatchSet x
Prelude.Generic)
newGetXssMatchSet ::
Prelude.Text ->
GetXssMatchSet
newGetXssMatchSet :: Text -> GetXssMatchSet
newGetXssMatchSet Text
pXssMatchSetId_ =
GetXssMatchSet' {$sel:xssMatchSetId:GetXssMatchSet' :: Text
xssMatchSetId = Text
pXssMatchSetId_}
getXssMatchSet_xssMatchSetId :: Lens.Lens' GetXssMatchSet Prelude.Text
getXssMatchSet_xssMatchSetId :: Lens' GetXssMatchSet Text
getXssMatchSet_xssMatchSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetXssMatchSet' {Text
xssMatchSetId :: Text
$sel:xssMatchSetId:GetXssMatchSet' :: GetXssMatchSet -> Text
xssMatchSetId} -> Text
xssMatchSetId) (\s :: GetXssMatchSet
s@GetXssMatchSet' {} Text
a -> GetXssMatchSet
s {$sel:xssMatchSetId:GetXssMatchSet' :: Text
xssMatchSetId = Text
a} :: GetXssMatchSet)
instance Core.AWSRequest GetXssMatchSet where
type
AWSResponse GetXssMatchSet =
GetXssMatchSetResponse
request :: (Service -> Service) -> GetXssMatchSet -> Request GetXssMatchSet
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 GetXssMatchSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetXssMatchSet)))
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 XssMatchSet -> Int -> GetXssMatchSetResponse
GetXssMatchSetResponse'
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
"XssMatchSet")
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 GetXssMatchSet where
hashWithSalt :: Int -> GetXssMatchSet -> Int
hashWithSalt Int
_salt GetXssMatchSet' {Text
xssMatchSetId :: Text
$sel:xssMatchSetId:GetXssMatchSet' :: GetXssMatchSet -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
xssMatchSetId
instance Prelude.NFData GetXssMatchSet where
rnf :: GetXssMatchSet -> ()
rnf GetXssMatchSet' {Text
xssMatchSetId :: Text
$sel:xssMatchSetId:GetXssMatchSet' :: GetXssMatchSet -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
xssMatchSetId
instance Data.ToHeaders GetXssMatchSet where
toHeaders :: GetXssMatchSet -> 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_20150824.GetXssMatchSet" ::
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 GetXssMatchSet where
toJSON :: GetXssMatchSet -> Value
toJSON GetXssMatchSet' {Text
xssMatchSetId :: Text
$sel:xssMatchSetId:GetXssMatchSet' :: GetXssMatchSet -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"XssMatchSetId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
xssMatchSetId)
]
)
instance Data.ToPath GetXssMatchSet where
toPath :: GetXssMatchSet -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetXssMatchSet where
toQuery :: GetXssMatchSet -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetXssMatchSetResponse = GetXssMatchSetResponse'
{
GetXssMatchSetResponse -> Maybe XssMatchSet
xssMatchSet :: Prelude.Maybe XssMatchSet,
GetXssMatchSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetXssMatchSetResponse -> GetXssMatchSetResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetXssMatchSetResponse -> GetXssMatchSetResponse -> Bool
$c/= :: GetXssMatchSetResponse -> GetXssMatchSetResponse -> Bool
== :: GetXssMatchSetResponse -> GetXssMatchSetResponse -> Bool
$c== :: GetXssMatchSetResponse -> GetXssMatchSetResponse -> Bool
Prelude.Eq, ReadPrec [GetXssMatchSetResponse]
ReadPrec GetXssMatchSetResponse
Int -> ReadS GetXssMatchSetResponse
ReadS [GetXssMatchSetResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetXssMatchSetResponse]
$creadListPrec :: ReadPrec [GetXssMatchSetResponse]
readPrec :: ReadPrec GetXssMatchSetResponse
$creadPrec :: ReadPrec GetXssMatchSetResponse
readList :: ReadS [GetXssMatchSetResponse]
$creadList :: ReadS [GetXssMatchSetResponse]
readsPrec :: Int -> ReadS GetXssMatchSetResponse
$creadsPrec :: Int -> ReadS GetXssMatchSetResponse
Prelude.Read, Int -> GetXssMatchSetResponse -> ShowS
[GetXssMatchSetResponse] -> ShowS
GetXssMatchSetResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetXssMatchSetResponse] -> ShowS
$cshowList :: [GetXssMatchSetResponse] -> ShowS
show :: GetXssMatchSetResponse -> String
$cshow :: GetXssMatchSetResponse -> String
showsPrec :: Int -> GetXssMatchSetResponse -> ShowS
$cshowsPrec :: Int -> GetXssMatchSetResponse -> ShowS
Prelude.Show, forall x. Rep GetXssMatchSetResponse x -> GetXssMatchSetResponse
forall x. GetXssMatchSetResponse -> Rep GetXssMatchSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetXssMatchSetResponse x -> GetXssMatchSetResponse
$cfrom :: forall x. GetXssMatchSetResponse -> Rep GetXssMatchSetResponse x
Prelude.Generic)
newGetXssMatchSetResponse ::
Prelude.Int ->
GetXssMatchSetResponse
newGetXssMatchSetResponse :: Int -> GetXssMatchSetResponse
newGetXssMatchSetResponse Int
pHttpStatus_ =
GetXssMatchSetResponse'
{ $sel:xssMatchSet:GetXssMatchSetResponse' :: Maybe XssMatchSet
xssMatchSet =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetXssMatchSetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getXssMatchSetResponse_xssMatchSet :: Lens.Lens' GetXssMatchSetResponse (Prelude.Maybe XssMatchSet)
getXssMatchSetResponse_xssMatchSet :: Lens' GetXssMatchSetResponse (Maybe XssMatchSet)
getXssMatchSetResponse_xssMatchSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetXssMatchSetResponse' {Maybe XssMatchSet
xssMatchSet :: Maybe XssMatchSet
$sel:xssMatchSet:GetXssMatchSetResponse' :: GetXssMatchSetResponse -> Maybe XssMatchSet
xssMatchSet} -> Maybe XssMatchSet
xssMatchSet) (\s :: GetXssMatchSetResponse
s@GetXssMatchSetResponse' {} Maybe XssMatchSet
a -> GetXssMatchSetResponse
s {$sel:xssMatchSet:GetXssMatchSetResponse' :: Maybe XssMatchSet
xssMatchSet = Maybe XssMatchSet
a} :: GetXssMatchSetResponse)
getXssMatchSetResponse_httpStatus :: Lens.Lens' GetXssMatchSetResponse Prelude.Int
getXssMatchSetResponse_httpStatus :: Lens' GetXssMatchSetResponse Int
getXssMatchSetResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetXssMatchSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetXssMatchSetResponse' :: GetXssMatchSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetXssMatchSetResponse
s@GetXssMatchSetResponse' {} Int
a -> GetXssMatchSetResponse
s {$sel:httpStatus:GetXssMatchSetResponse' :: Int
httpStatus = Int
a} :: GetXssMatchSetResponse)
instance Prelude.NFData GetXssMatchSetResponse where
rnf :: GetXssMatchSetResponse -> ()
rnf GetXssMatchSetResponse' {Int
Maybe XssMatchSet
httpStatus :: Int
xssMatchSet :: Maybe XssMatchSet
$sel:httpStatus:GetXssMatchSetResponse' :: GetXssMatchSetResponse -> Int
$sel:xssMatchSet:GetXssMatchSetResponse' :: GetXssMatchSetResponse -> Maybe XssMatchSet
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe XssMatchSet
xssMatchSet
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus