{-# 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.ListRegexMatchSets
(
ListRegexMatchSets (..),
newListRegexMatchSets,
listRegexMatchSets_nextMarker,
listRegexMatchSets_limit,
ListRegexMatchSetsResponse (..),
newListRegexMatchSetsResponse,
listRegexMatchSetsResponse_regexMatchSets,
listRegexMatchSetsResponse_nextMarker,
listRegexMatchSetsResponse_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 ListRegexMatchSets = ListRegexMatchSets'
{
ListRegexMatchSets -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListRegexMatchSets -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
}
deriving (ListRegexMatchSets -> ListRegexMatchSets -> Bool
(ListRegexMatchSets -> ListRegexMatchSets -> Bool)
-> (ListRegexMatchSets -> ListRegexMatchSets -> Bool)
-> Eq ListRegexMatchSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRegexMatchSets -> ListRegexMatchSets -> Bool
$c/= :: ListRegexMatchSets -> ListRegexMatchSets -> Bool
== :: ListRegexMatchSets -> ListRegexMatchSets -> Bool
$c== :: ListRegexMatchSets -> ListRegexMatchSets -> Bool
Prelude.Eq, ReadPrec [ListRegexMatchSets]
ReadPrec ListRegexMatchSets
Int -> ReadS ListRegexMatchSets
ReadS [ListRegexMatchSets]
(Int -> ReadS ListRegexMatchSets)
-> ReadS [ListRegexMatchSets]
-> ReadPrec ListRegexMatchSets
-> ReadPrec [ListRegexMatchSets]
-> Read ListRegexMatchSets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRegexMatchSets]
$creadListPrec :: ReadPrec [ListRegexMatchSets]
readPrec :: ReadPrec ListRegexMatchSets
$creadPrec :: ReadPrec ListRegexMatchSets
readList :: ReadS [ListRegexMatchSets]
$creadList :: ReadS [ListRegexMatchSets]
readsPrec :: Int -> ReadS ListRegexMatchSets
$creadsPrec :: Int -> ReadS ListRegexMatchSets
Prelude.Read, Int -> ListRegexMatchSets -> ShowS
[ListRegexMatchSets] -> ShowS
ListRegexMatchSets -> String
(Int -> ListRegexMatchSets -> ShowS)
-> (ListRegexMatchSets -> String)
-> ([ListRegexMatchSets] -> ShowS)
-> Show ListRegexMatchSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRegexMatchSets] -> ShowS
$cshowList :: [ListRegexMatchSets] -> ShowS
show :: ListRegexMatchSets -> String
$cshow :: ListRegexMatchSets -> String
showsPrec :: Int -> ListRegexMatchSets -> ShowS
$cshowsPrec :: Int -> ListRegexMatchSets -> ShowS
Prelude.Show, (forall x. ListRegexMatchSets -> Rep ListRegexMatchSets x)
-> (forall x. Rep ListRegexMatchSets x -> ListRegexMatchSets)
-> Generic ListRegexMatchSets
forall x. Rep ListRegexMatchSets x -> ListRegexMatchSets
forall x. ListRegexMatchSets -> Rep ListRegexMatchSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRegexMatchSets x -> ListRegexMatchSets
$cfrom :: forall x. ListRegexMatchSets -> Rep ListRegexMatchSets x
Prelude.Generic)
newListRegexMatchSets ::
ListRegexMatchSets
newListRegexMatchSets :: ListRegexMatchSets
newListRegexMatchSets =
ListRegexMatchSets' :: Maybe Text -> Maybe Natural -> ListRegexMatchSets
ListRegexMatchSets'
{ $sel:nextMarker:ListRegexMatchSets' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:limit:ListRegexMatchSets' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listRegexMatchSets_nextMarker :: Lens.Lens' ListRegexMatchSets (Prelude.Maybe Prelude.Text)
listRegexMatchSets_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListRegexMatchSets -> f ListRegexMatchSets
listRegexMatchSets_nextMarker = (ListRegexMatchSets -> Maybe Text)
-> (ListRegexMatchSets -> Maybe Text -> ListRegexMatchSets)
-> Lens
ListRegexMatchSets ListRegexMatchSets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegexMatchSets' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListRegexMatchSets' :: ListRegexMatchSets -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListRegexMatchSets
s@ListRegexMatchSets' {} Maybe Text
a -> ListRegexMatchSets
s {$sel:nextMarker:ListRegexMatchSets' :: Maybe Text
nextMarker = Maybe Text
a} :: ListRegexMatchSets)
listRegexMatchSets_limit :: Lens.Lens' ListRegexMatchSets (Prelude.Maybe Prelude.Natural)
listRegexMatchSets_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListRegexMatchSets -> f ListRegexMatchSets
listRegexMatchSets_limit = (ListRegexMatchSets -> Maybe Natural)
-> (ListRegexMatchSets -> Maybe Natural -> ListRegexMatchSets)
-> Lens
ListRegexMatchSets
ListRegexMatchSets
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegexMatchSets' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListRegexMatchSets' :: ListRegexMatchSets -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListRegexMatchSets
s@ListRegexMatchSets' {} Maybe Natural
a -> ListRegexMatchSets
s {$sel:limit:ListRegexMatchSets' :: Maybe Natural
limit = Maybe Natural
a} :: ListRegexMatchSets)
instance Core.AWSRequest ListRegexMatchSets where
type
AWSResponse ListRegexMatchSets =
ListRegexMatchSetsResponse
request :: ListRegexMatchSets -> Request ListRegexMatchSets
request = Service -> ListRegexMatchSets -> Request ListRegexMatchSets
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListRegexMatchSets
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListRegexMatchSets)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListRegexMatchSets))
-> Logger
-> Service
-> Proxy ListRegexMatchSets
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListRegexMatchSets)))
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 [RegexMatchSetSummary]
-> Maybe Text -> Int -> ListRegexMatchSetsResponse
ListRegexMatchSetsResponse'
(Maybe [RegexMatchSetSummary]
-> Maybe Text -> Int -> ListRegexMatchSetsResponse)
-> Either String (Maybe [RegexMatchSetSummary])
-> Either String (Maybe Text -> Int -> ListRegexMatchSetsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [RegexMatchSetSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RegexMatchSets" Either String (Maybe (Maybe [RegexMatchSetSummary]))
-> Maybe [RegexMatchSetSummary]
-> Either String (Maybe [RegexMatchSetSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RegexMatchSetSummary]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> ListRegexMatchSetsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListRegexMatchSetsResponse)
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 -> ListRegexMatchSetsResponse)
-> Either String Int -> Either String ListRegexMatchSetsResponse
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 ListRegexMatchSets
instance Prelude.NFData ListRegexMatchSets
instance Core.ToHeaders ListRegexMatchSets where
toHeaders :: ListRegexMatchSets -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListRegexMatchSets -> 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.ListRegexMatchSets" ::
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 ListRegexMatchSets where
toJSON :: ListRegexMatchSets -> Value
toJSON ListRegexMatchSets' {Maybe Natural
Maybe Text
limit :: Maybe Natural
nextMarker :: Maybe Text
$sel:limit:ListRegexMatchSets' :: ListRegexMatchSets -> Maybe Natural
$sel:nextMarker:ListRegexMatchSets' :: ListRegexMatchSets -> 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 ListRegexMatchSets where
toPath :: ListRegexMatchSets -> ByteString
toPath = ByteString -> ListRegexMatchSets -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListRegexMatchSets where
toQuery :: ListRegexMatchSets -> QueryString
toQuery = QueryString -> ListRegexMatchSets -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListRegexMatchSetsResponse = ListRegexMatchSetsResponse'
{
ListRegexMatchSetsResponse -> Maybe [RegexMatchSetSummary]
regexMatchSets :: Prelude.Maybe [RegexMatchSetSummary],
ListRegexMatchSetsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListRegexMatchSetsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListRegexMatchSetsResponse -> ListRegexMatchSetsResponse -> Bool
(ListRegexMatchSetsResponse -> ListRegexMatchSetsResponse -> Bool)
-> (ListRegexMatchSetsResponse
-> ListRegexMatchSetsResponse -> Bool)
-> Eq ListRegexMatchSetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRegexMatchSetsResponse -> ListRegexMatchSetsResponse -> Bool
$c/= :: ListRegexMatchSetsResponse -> ListRegexMatchSetsResponse -> Bool
== :: ListRegexMatchSetsResponse -> ListRegexMatchSetsResponse -> Bool
$c== :: ListRegexMatchSetsResponse -> ListRegexMatchSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListRegexMatchSetsResponse]
ReadPrec ListRegexMatchSetsResponse
Int -> ReadS ListRegexMatchSetsResponse
ReadS [ListRegexMatchSetsResponse]
(Int -> ReadS ListRegexMatchSetsResponse)
-> ReadS [ListRegexMatchSetsResponse]
-> ReadPrec ListRegexMatchSetsResponse
-> ReadPrec [ListRegexMatchSetsResponse]
-> Read ListRegexMatchSetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRegexMatchSetsResponse]
$creadListPrec :: ReadPrec [ListRegexMatchSetsResponse]
readPrec :: ReadPrec ListRegexMatchSetsResponse
$creadPrec :: ReadPrec ListRegexMatchSetsResponse
readList :: ReadS [ListRegexMatchSetsResponse]
$creadList :: ReadS [ListRegexMatchSetsResponse]
readsPrec :: Int -> ReadS ListRegexMatchSetsResponse
$creadsPrec :: Int -> ReadS ListRegexMatchSetsResponse
Prelude.Read, Int -> ListRegexMatchSetsResponse -> ShowS
[ListRegexMatchSetsResponse] -> ShowS
ListRegexMatchSetsResponse -> String
(Int -> ListRegexMatchSetsResponse -> ShowS)
-> (ListRegexMatchSetsResponse -> String)
-> ([ListRegexMatchSetsResponse] -> ShowS)
-> Show ListRegexMatchSetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRegexMatchSetsResponse] -> ShowS
$cshowList :: [ListRegexMatchSetsResponse] -> ShowS
show :: ListRegexMatchSetsResponse -> String
$cshow :: ListRegexMatchSetsResponse -> String
showsPrec :: Int -> ListRegexMatchSetsResponse -> ShowS
$cshowsPrec :: Int -> ListRegexMatchSetsResponse -> ShowS
Prelude.Show, (forall x.
ListRegexMatchSetsResponse -> Rep ListRegexMatchSetsResponse x)
-> (forall x.
Rep ListRegexMatchSetsResponse x -> ListRegexMatchSetsResponse)
-> Generic ListRegexMatchSetsResponse
forall x.
Rep ListRegexMatchSetsResponse x -> ListRegexMatchSetsResponse
forall x.
ListRegexMatchSetsResponse -> Rep ListRegexMatchSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRegexMatchSetsResponse x -> ListRegexMatchSetsResponse
$cfrom :: forall x.
ListRegexMatchSetsResponse -> Rep ListRegexMatchSetsResponse x
Prelude.Generic)
newListRegexMatchSetsResponse ::
Prelude.Int ->
ListRegexMatchSetsResponse
newListRegexMatchSetsResponse :: Int -> ListRegexMatchSetsResponse
newListRegexMatchSetsResponse Int
pHttpStatus_ =
ListRegexMatchSetsResponse' :: Maybe [RegexMatchSetSummary]
-> Maybe Text -> Int -> ListRegexMatchSetsResponse
ListRegexMatchSetsResponse'
{ $sel:regexMatchSets:ListRegexMatchSetsResponse' :: Maybe [RegexMatchSetSummary]
regexMatchSets =
Maybe [RegexMatchSetSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListRegexMatchSetsResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListRegexMatchSetsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listRegexMatchSetsResponse_regexMatchSets :: Lens.Lens' ListRegexMatchSetsResponse (Prelude.Maybe [RegexMatchSetSummary])
listRegexMatchSetsResponse_regexMatchSets :: (Maybe [RegexMatchSetSummary] -> f (Maybe [RegexMatchSetSummary]))
-> ListRegexMatchSetsResponse -> f ListRegexMatchSetsResponse
listRegexMatchSetsResponse_regexMatchSets = (ListRegexMatchSetsResponse -> Maybe [RegexMatchSetSummary])
-> (ListRegexMatchSetsResponse
-> Maybe [RegexMatchSetSummary] -> ListRegexMatchSetsResponse)
-> Lens
ListRegexMatchSetsResponse
ListRegexMatchSetsResponse
(Maybe [RegexMatchSetSummary])
(Maybe [RegexMatchSetSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegexMatchSetsResponse' {Maybe [RegexMatchSetSummary]
regexMatchSets :: Maybe [RegexMatchSetSummary]
$sel:regexMatchSets:ListRegexMatchSetsResponse' :: ListRegexMatchSetsResponse -> Maybe [RegexMatchSetSummary]
regexMatchSets} -> Maybe [RegexMatchSetSummary]
regexMatchSets) (\s :: ListRegexMatchSetsResponse
s@ListRegexMatchSetsResponse' {} Maybe [RegexMatchSetSummary]
a -> ListRegexMatchSetsResponse
s {$sel:regexMatchSets:ListRegexMatchSetsResponse' :: Maybe [RegexMatchSetSummary]
regexMatchSets = Maybe [RegexMatchSetSummary]
a} :: ListRegexMatchSetsResponse) ((Maybe [RegexMatchSetSummary] -> f (Maybe [RegexMatchSetSummary]))
-> ListRegexMatchSetsResponse -> f ListRegexMatchSetsResponse)
-> ((Maybe [RegexMatchSetSummary]
-> f (Maybe [RegexMatchSetSummary]))
-> Maybe [RegexMatchSetSummary]
-> f (Maybe [RegexMatchSetSummary]))
-> (Maybe [RegexMatchSetSummary]
-> f (Maybe [RegexMatchSetSummary]))
-> ListRegexMatchSetsResponse
-> f ListRegexMatchSetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[RegexMatchSetSummary]
[RegexMatchSetSummary]
[RegexMatchSetSummary]
[RegexMatchSetSummary]
-> Iso
(Maybe [RegexMatchSetSummary])
(Maybe [RegexMatchSetSummary])
(Maybe [RegexMatchSetSummary])
(Maybe [RegexMatchSetSummary])
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
[RegexMatchSetSummary]
[RegexMatchSetSummary]
[RegexMatchSetSummary]
[RegexMatchSetSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listRegexMatchSetsResponse_nextMarker :: Lens.Lens' ListRegexMatchSetsResponse (Prelude.Maybe Prelude.Text)
listRegexMatchSetsResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListRegexMatchSetsResponse -> f ListRegexMatchSetsResponse
listRegexMatchSetsResponse_nextMarker = (ListRegexMatchSetsResponse -> Maybe Text)
-> (ListRegexMatchSetsResponse
-> Maybe Text -> ListRegexMatchSetsResponse)
-> Lens
ListRegexMatchSetsResponse
ListRegexMatchSetsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegexMatchSetsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListRegexMatchSetsResponse' :: ListRegexMatchSetsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListRegexMatchSetsResponse
s@ListRegexMatchSetsResponse' {} Maybe Text
a -> ListRegexMatchSetsResponse
s {$sel:nextMarker:ListRegexMatchSetsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListRegexMatchSetsResponse)
listRegexMatchSetsResponse_httpStatus :: Lens.Lens' ListRegexMatchSetsResponse Prelude.Int
listRegexMatchSetsResponse_httpStatus :: (Int -> f Int)
-> ListRegexMatchSetsResponse -> f ListRegexMatchSetsResponse
listRegexMatchSetsResponse_httpStatus = (ListRegexMatchSetsResponse -> Int)
-> (ListRegexMatchSetsResponse
-> Int -> ListRegexMatchSetsResponse)
-> Lens
ListRegexMatchSetsResponse ListRegexMatchSetsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegexMatchSetsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListRegexMatchSetsResponse' :: ListRegexMatchSetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListRegexMatchSetsResponse
s@ListRegexMatchSetsResponse' {} Int
a -> ListRegexMatchSetsResponse
s {$sel:httpStatus:ListRegexMatchSetsResponse' :: Int
httpStatus = Int
a} :: ListRegexMatchSetsResponse)
instance Prelude.NFData ListRegexMatchSetsResponse