{-# 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.ListByteMatchSets
(
ListByteMatchSets (..),
newListByteMatchSets,
listByteMatchSets_nextMarker,
listByteMatchSets_limit,
ListByteMatchSetsResponse (..),
newListByteMatchSetsResponse,
listByteMatchSetsResponse_byteMatchSets,
listByteMatchSetsResponse_nextMarker,
listByteMatchSetsResponse_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 ListByteMatchSets = ListByteMatchSets'
{
ListByteMatchSets -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListByteMatchSets -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
}
deriving (ListByteMatchSets -> ListByteMatchSets -> Bool
(ListByteMatchSets -> ListByteMatchSets -> Bool)
-> (ListByteMatchSets -> ListByteMatchSets -> Bool)
-> Eq ListByteMatchSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListByteMatchSets -> ListByteMatchSets -> Bool
$c/= :: ListByteMatchSets -> ListByteMatchSets -> Bool
== :: ListByteMatchSets -> ListByteMatchSets -> Bool
$c== :: ListByteMatchSets -> ListByteMatchSets -> Bool
Prelude.Eq, ReadPrec [ListByteMatchSets]
ReadPrec ListByteMatchSets
Int -> ReadS ListByteMatchSets
ReadS [ListByteMatchSets]
(Int -> ReadS ListByteMatchSets)
-> ReadS [ListByteMatchSets]
-> ReadPrec ListByteMatchSets
-> ReadPrec [ListByteMatchSets]
-> Read ListByteMatchSets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListByteMatchSets]
$creadListPrec :: ReadPrec [ListByteMatchSets]
readPrec :: ReadPrec ListByteMatchSets
$creadPrec :: ReadPrec ListByteMatchSets
readList :: ReadS [ListByteMatchSets]
$creadList :: ReadS [ListByteMatchSets]
readsPrec :: Int -> ReadS ListByteMatchSets
$creadsPrec :: Int -> ReadS ListByteMatchSets
Prelude.Read, Int -> ListByteMatchSets -> ShowS
[ListByteMatchSets] -> ShowS
ListByteMatchSets -> String
(Int -> ListByteMatchSets -> ShowS)
-> (ListByteMatchSets -> String)
-> ([ListByteMatchSets] -> ShowS)
-> Show ListByteMatchSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListByteMatchSets] -> ShowS
$cshowList :: [ListByteMatchSets] -> ShowS
show :: ListByteMatchSets -> String
$cshow :: ListByteMatchSets -> String
showsPrec :: Int -> ListByteMatchSets -> ShowS
$cshowsPrec :: Int -> ListByteMatchSets -> ShowS
Prelude.Show, (forall x. ListByteMatchSets -> Rep ListByteMatchSets x)
-> (forall x. Rep ListByteMatchSets x -> ListByteMatchSets)
-> Generic ListByteMatchSets
forall x. Rep ListByteMatchSets x -> ListByteMatchSets
forall x. ListByteMatchSets -> Rep ListByteMatchSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListByteMatchSets x -> ListByteMatchSets
$cfrom :: forall x. ListByteMatchSets -> Rep ListByteMatchSets x
Prelude.Generic)
newListByteMatchSets ::
ListByteMatchSets
newListByteMatchSets :: ListByteMatchSets
newListByteMatchSets =
ListByteMatchSets' :: Maybe Text -> Maybe Natural -> ListByteMatchSets
ListByteMatchSets'
{ $sel:nextMarker:ListByteMatchSets' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:limit:ListByteMatchSets' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listByteMatchSets_nextMarker :: Lens.Lens' ListByteMatchSets (Prelude.Maybe Prelude.Text)
listByteMatchSets_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListByteMatchSets -> f ListByteMatchSets
listByteMatchSets_nextMarker = (ListByteMatchSets -> Maybe Text)
-> (ListByteMatchSets -> Maybe Text -> ListByteMatchSets)
-> Lens
ListByteMatchSets ListByteMatchSets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByteMatchSets' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListByteMatchSets' :: ListByteMatchSets -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListByteMatchSets
s@ListByteMatchSets' {} Maybe Text
a -> ListByteMatchSets
s {$sel:nextMarker:ListByteMatchSets' :: Maybe Text
nextMarker = Maybe Text
a} :: ListByteMatchSets)
listByteMatchSets_limit :: Lens.Lens' ListByteMatchSets (Prelude.Maybe Prelude.Natural)
listByteMatchSets_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListByteMatchSets -> f ListByteMatchSets
listByteMatchSets_limit = (ListByteMatchSets -> Maybe Natural)
-> (ListByteMatchSets -> Maybe Natural -> ListByteMatchSets)
-> Lens
ListByteMatchSets ListByteMatchSets (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByteMatchSets' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListByteMatchSets' :: ListByteMatchSets -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListByteMatchSets
s@ListByteMatchSets' {} Maybe Natural
a -> ListByteMatchSets
s {$sel:limit:ListByteMatchSets' :: Maybe Natural
limit = Maybe Natural
a} :: ListByteMatchSets)
instance Core.AWSRequest ListByteMatchSets where
type
AWSResponse ListByteMatchSets =
ListByteMatchSetsResponse
request :: ListByteMatchSets -> Request ListByteMatchSets
request = Service -> ListByteMatchSets -> Request ListByteMatchSets
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListByteMatchSets
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListByteMatchSets)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListByteMatchSets))
-> Logger
-> Service
-> Proxy ListByteMatchSets
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListByteMatchSets)))
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 [ByteMatchSetSummary]
-> Maybe Text -> Int -> ListByteMatchSetsResponse
ListByteMatchSetsResponse'
(Maybe [ByteMatchSetSummary]
-> Maybe Text -> Int -> ListByteMatchSetsResponse)
-> Either String (Maybe [ByteMatchSetSummary])
-> Either String (Maybe Text -> Int -> ListByteMatchSetsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [ByteMatchSetSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ByteMatchSets" Either String (Maybe (Maybe [ByteMatchSetSummary]))
-> Maybe [ByteMatchSetSummary]
-> Either String (Maybe [ByteMatchSetSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ByteMatchSetSummary]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> ListByteMatchSetsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListByteMatchSetsResponse)
forall (f :: * -> *) a b. Applicative f => 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
"NextMarker")
Either String (Int -> ListByteMatchSetsResponse)
-> Either String Int -> Either String ListByteMatchSetsResponse
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 ListByteMatchSets
instance Prelude.NFData ListByteMatchSets
instance Core.ToHeaders ListByteMatchSets where
toHeaders :: ListByteMatchSets -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListByteMatchSets -> 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.ListByteMatchSets" ::
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 ListByteMatchSets where
toJSON :: ListByteMatchSets -> Value
toJSON ListByteMatchSets' {Maybe Natural
Maybe Text
limit :: Maybe Natural
nextMarker :: Maybe Text
$sel:limit:ListByteMatchSets' :: ListByteMatchSets -> Maybe Natural
$sel:nextMarker:ListByteMatchSets' :: ListByteMatchSets -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NextMarker" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextMarker,
(Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit
]
)
instance Core.ToPath ListByteMatchSets where
toPath :: ListByteMatchSets -> ByteString
toPath = ByteString -> ListByteMatchSets -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListByteMatchSets where
toQuery :: ListByteMatchSets -> QueryString
toQuery = QueryString -> ListByteMatchSets -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListByteMatchSetsResponse = ListByteMatchSetsResponse'
{
ListByteMatchSetsResponse -> Maybe [ByteMatchSetSummary]
byteMatchSets :: Prelude.Maybe [ByteMatchSetSummary],
ListByteMatchSetsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListByteMatchSetsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool
(ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool)
-> (ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool)
-> Eq ListByteMatchSetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool
$c/= :: ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool
== :: ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool
$c== :: ListByteMatchSetsResponse -> ListByteMatchSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListByteMatchSetsResponse]
ReadPrec ListByteMatchSetsResponse
Int -> ReadS ListByteMatchSetsResponse
ReadS [ListByteMatchSetsResponse]
(Int -> ReadS ListByteMatchSetsResponse)
-> ReadS [ListByteMatchSetsResponse]
-> ReadPrec ListByteMatchSetsResponse
-> ReadPrec [ListByteMatchSetsResponse]
-> Read ListByteMatchSetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListByteMatchSetsResponse]
$creadListPrec :: ReadPrec [ListByteMatchSetsResponse]
readPrec :: ReadPrec ListByteMatchSetsResponse
$creadPrec :: ReadPrec ListByteMatchSetsResponse
readList :: ReadS [ListByteMatchSetsResponse]
$creadList :: ReadS [ListByteMatchSetsResponse]
readsPrec :: Int -> ReadS ListByteMatchSetsResponse
$creadsPrec :: Int -> ReadS ListByteMatchSetsResponse
Prelude.Read, Int -> ListByteMatchSetsResponse -> ShowS
[ListByteMatchSetsResponse] -> ShowS
ListByteMatchSetsResponse -> String
(Int -> ListByteMatchSetsResponse -> ShowS)
-> (ListByteMatchSetsResponse -> String)
-> ([ListByteMatchSetsResponse] -> ShowS)
-> Show ListByteMatchSetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListByteMatchSetsResponse] -> ShowS
$cshowList :: [ListByteMatchSetsResponse] -> ShowS
show :: ListByteMatchSetsResponse -> String
$cshow :: ListByteMatchSetsResponse -> String
showsPrec :: Int -> ListByteMatchSetsResponse -> ShowS
$cshowsPrec :: Int -> ListByteMatchSetsResponse -> ShowS
Prelude.Show, (forall x.
ListByteMatchSetsResponse -> Rep ListByteMatchSetsResponse x)
-> (forall x.
Rep ListByteMatchSetsResponse x -> ListByteMatchSetsResponse)
-> Generic ListByteMatchSetsResponse
forall x.
Rep ListByteMatchSetsResponse x -> ListByteMatchSetsResponse
forall x.
ListByteMatchSetsResponse -> Rep ListByteMatchSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListByteMatchSetsResponse x -> ListByteMatchSetsResponse
$cfrom :: forall x.
ListByteMatchSetsResponse -> Rep ListByteMatchSetsResponse x
Prelude.Generic)
newListByteMatchSetsResponse ::
Prelude.Int ->
ListByteMatchSetsResponse
newListByteMatchSetsResponse :: Int -> ListByteMatchSetsResponse
newListByteMatchSetsResponse Int
pHttpStatus_ =
ListByteMatchSetsResponse' :: Maybe [ByteMatchSetSummary]
-> Maybe Text -> Int -> ListByteMatchSetsResponse
ListByteMatchSetsResponse'
{ $sel:byteMatchSets:ListByteMatchSetsResponse' :: Maybe [ByteMatchSetSummary]
byteMatchSets =
Maybe [ByteMatchSetSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListByteMatchSetsResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListByteMatchSetsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listByteMatchSetsResponse_byteMatchSets :: Lens.Lens' ListByteMatchSetsResponse (Prelude.Maybe [ByteMatchSetSummary])
listByteMatchSetsResponse_byteMatchSets :: (Maybe [ByteMatchSetSummary] -> f (Maybe [ByteMatchSetSummary]))
-> ListByteMatchSetsResponse -> f ListByteMatchSetsResponse
listByteMatchSetsResponse_byteMatchSets = (ListByteMatchSetsResponse -> Maybe [ByteMatchSetSummary])
-> (ListByteMatchSetsResponse
-> Maybe [ByteMatchSetSummary] -> ListByteMatchSetsResponse)
-> Lens
ListByteMatchSetsResponse
ListByteMatchSetsResponse
(Maybe [ByteMatchSetSummary])
(Maybe [ByteMatchSetSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByteMatchSetsResponse' {Maybe [ByteMatchSetSummary]
byteMatchSets :: Maybe [ByteMatchSetSummary]
$sel:byteMatchSets:ListByteMatchSetsResponse' :: ListByteMatchSetsResponse -> Maybe [ByteMatchSetSummary]
byteMatchSets} -> Maybe [ByteMatchSetSummary]
byteMatchSets) (\s :: ListByteMatchSetsResponse
s@ListByteMatchSetsResponse' {} Maybe [ByteMatchSetSummary]
a -> ListByteMatchSetsResponse
s {$sel:byteMatchSets:ListByteMatchSetsResponse' :: Maybe [ByteMatchSetSummary]
byteMatchSets = Maybe [ByteMatchSetSummary]
a} :: ListByteMatchSetsResponse) ((Maybe [ByteMatchSetSummary] -> f (Maybe [ByteMatchSetSummary]))
-> ListByteMatchSetsResponse -> f ListByteMatchSetsResponse)
-> ((Maybe [ByteMatchSetSummary]
-> f (Maybe [ByteMatchSetSummary]))
-> Maybe [ByteMatchSetSummary] -> f (Maybe [ByteMatchSetSummary]))
-> (Maybe [ByteMatchSetSummary] -> f (Maybe [ByteMatchSetSummary]))
-> ListByteMatchSetsResponse
-> f ListByteMatchSetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ByteMatchSetSummary]
[ByteMatchSetSummary]
[ByteMatchSetSummary]
[ByteMatchSetSummary]
-> Iso
(Maybe [ByteMatchSetSummary])
(Maybe [ByteMatchSetSummary])
(Maybe [ByteMatchSetSummary])
(Maybe [ByteMatchSetSummary])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[ByteMatchSetSummary]
[ByteMatchSetSummary]
[ByteMatchSetSummary]
[ByteMatchSetSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listByteMatchSetsResponse_nextMarker :: Lens.Lens' ListByteMatchSetsResponse (Prelude.Maybe Prelude.Text)
listByteMatchSetsResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListByteMatchSetsResponse -> f ListByteMatchSetsResponse
listByteMatchSetsResponse_nextMarker = (ListByteMatchSetsResponse -> Maybe Text)
-> (ListByteMatchSetsResponse
-> Maybe Text -> ListByteMatchSetsResponse)
-> Lens
ListByteMatchSetsResponse
ListByteMatchSetsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByteMatchSetsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListByteMatchSetsResponse' :: ListByteMatchSetsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListByteMatchSetsResponse
s@ListByteMatchSetsResponse' {} Maybe Text
a -> ListByteMatchSetsResponse
s {$sel:nextMarker:ListByteMatchSetsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListByteMatchSetsResponse)
listByteMatchSetsResponse_httpStatus :: Lens.Lens' ListByteMatchSetsResponse Prelude.Int
listByteMatchSetsResponse_httpStatus :: (Int -> f Int)
-> ListByteMatchSetsResponse -> f ListByteMatchSetsResponse
listByteMatchSetsResponse_httpStatus = (ListByteMatchSetsResponse -> Int)
-> (ListByteMatchSetsResponse -> Int -> ListByteMatchSetsResponse)
-> Lens ListByteMatchSetsResponse ListByteMatchSetsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByteMatchSetsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListByteMatchSetsResponse' :: ListByteMatchSetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListByteMatchSetsResponse
s@ListByteMatchSetsResponse' {} Int
a -> ListByteMatchSetsResponse
s {$sel:httpStatus:ListByteMatchSetsResponse' :: Int
httpStatus = Int
a} :: ListByteMatchSetsResponse)
instance Prelude.NFData ListByteMatchSetsResponse