{-# 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.WAFV2.ListRegexPatternSets
(
ListRegexPatternSets (..),
newListRegexPatternSets,
listRegexPatternSets_limit,
listRegexPatternSets_nextMarker,
listRegexPatternSets_scope,
ListRegexPatternSetsResponse (..),
newListRegexPatternSetsResponse,
listRegexPatternSetsResponse_nextMarker,
listRegexPatternSetsResponse_regexPatternSets,
listRegexPatternSetsResponse_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.WAFV2.Types
data ListRegexPatternSets = ListRegexPatternSets'
{
ListRegexPatternSets -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListRegexPatternSets -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListRegexPatternSets -> Scope
scope :: Scope
}
deriving (ListRegexPatternSets -> ListRegexPatternSets -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRegexPatternSets -> ListRegexPatternSets -> Bool
$c/= :: ListRegexPatternSets -> ListRegexPatternSets -> Bool
== :: ListRegexPatternSets -> ListRegexPatternSets -> Bool
$c== :: ListRegexPatternSets -> ListRegexPatternSets -> Bool
Prelude.Eq, ReadPrec [ListRegexPatternSets]
ReadPrec ListRegexPatternSets
Int -> ReadS ListRegexPatternSets
ReadS [ListRegexPatternSets]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRegexPatternSets]
$creadListPrec :: ReadPrec [ListRegexPatternSets]
readPrec :: ReadPrec ListRegexPatternSets
$creadPrec :: ReadPrec ListRegexPatternSets
readList :: ReadS [ListRegexPatternSets]
$creadList :: ReadS [ListRegexPatternSets]
readsPrec :: Int -> ReadS ListRegexPatternSets
$creadsPrec :: Int -> ReadS ListRegexPatternSets
Prelude.Read, Int -> ListRegexPatternSets -> ShowS
[ListRegexPatternSets] -> ShowS
ListRegexPatternSets -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRegexPatternSets] -> ShowS
$cshowList :: [ListRegexPatternSets] -> ShowS
show :: ListRegexPatternSets -> String
$cshow :: ListRegexPatternSets -> String
showsPrec :: Int -> ListRegexPatternSets -> ShowS
$cshowsPrec :: Int -> ListRegexPatternSets -> ShowS
Prelude.Show, forall x. Rep ListRegexPatternSets x -> ListRegexPatternSets
forall x. ListRegexPatternSets -> Rep ListRegexPatternSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRegexPatternSets x -> ListRegexPatternSets
$cfrom :: forall x. ListRegexPatternSets -> Rep ListRegexPatternSets x
Prelude.Generic)
newListRegexPatternSets ::
Scope ->
ListRegexPatternSets
newListRegexPatternSets :: Scope -> ListRegexPatternSets
newListRegexPatternSets Scope
pScope_ =
ListRegexPatternSets'
{ $sel:limit:ListRegexPatternSets' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListRegexPatternSets' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
$sel:scope:ListRegexPatternSets' :: Scope
scope = Scope
pScope_
}
listRegexPatternSets_limit :: Lens.Lens' ListRegexPatternSets (Prelude.Maybe Prelude.Natural)
listRegexPatternSets_limit :: Lens' ListRegexPatternSets (Maybe Natural)
listRegexPatternSets_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegexPatternSets' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListRegexPatternSets' :: ListRegexPatternSets -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListRegexPatternSets
s@ListRegexPatternSets' {} Maybe Natural
a -> ListRegexPatternSets
s {$sel:limit:ListRegexPatternSets' :: Maybe Natural
limit = Maybe Natural
a} :: ListRegexPatternSets)
listRegexPatternSets_nextMarker :: Lens.Lens' ListRegexPatternSets (Prelude.Maybe Prelude.Text)
listRegexPatternSets_nextMarker :: Lens' ListRegexPatternSets (Maybe Text)
listRegexPatternSets_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegexPatternSets' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListRegexPatternSets' :: ListRegexPatternSets -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListRegexPatternSets
s@ListRegexPatternSets' {} Maybe Text
a -> ListRegexPatternSets
s {$sel:nextMarker:ListRegexPatternSets' :: Maybe Text
nextMarker = Maybe Text
a} :: ListRegexPatternSets)
listRegexPatternSets_scope :: Lens.Lens' ListRegexPatternSets Scope
listRegexPatternSets_scope :: Lens' ListRegexPatternSets Scope
listRegexPatternSets_scope = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegexPatternSets' {Scope
scope :: Scope
$sel:scope:ListRegexPatternSets' :: ListRegexPatternSets -> Scope
scope} -> Scope
scope) (\s :: ListRegexPatternSets
s@ListRegexPatternSets' {} Scope
a -> ListRegexPatternSets
s {$sel:scope:ListRegexPatternSets' :: Scope
scope = Scope
a} :: ListRegexPatternSets)
instance Core.AWSRequest ListRegexPatternSets where
type
AWSResponse ListRegexPatternSets =
ListRegexPatternSetsResponse
request :: (Service -> Service)
-> ListRegexPatternSets -> Request ListRegexPatternSets
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 ListRegexPatternSets
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListRegexPatternSets)))
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 Text
-> Maybe [RegexPatternSetSummary]
-> Int
-> ListRegexPatternSetsResponse
ListRegexPatternSetsResponse'
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
"NextMarker")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RegexPatternSets"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
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 ListRegexPatternSets where
hashWithSalt :: Int -> ListRegexPatternSets -> Int
hashWithSalt Int
_salt ListRegexPatternSets' {Maybe Natural
Maybe Text
Scope
scope :: Scope
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:scope:ListRegexPatternSets' :: ListRegexPatternSets -> Scope
$sel:nextMarker:ListRegexPatternSets' :: ListRegexPatternSets -> Maybe Text
$sel:limit:ListRegexPatternSets' :: ListRegexPatternSets -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextMarker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Scope
scope
instance Prelude.NFData ListRegexPatternSets where
rnf :: ListRegexPatternSets -> ()
rnf ListRegexPatternSets' {Maybe Natural
Maybe Text
Scope
scope :: Scope
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:scope:ListRegexPatternSets' :: ListRegexPatternSets -> Scope
$sel:nextMarker:ListRegexPatternSets' :: ListRegexPatternSets -> Maybe Text
$sel:limit:ListRegexPatternSets' :: ListRegexPatternSets -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Scope
scope
instance Data.ToHeaders ListRegexPatternSets where
toHeaders :: ListRegexPatternSets -> 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_20190729.ListRegexPatternSets" ::
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 ListRegexPatternSets where
toJSON :: ListRegexPatternSets -> Value
toJSON ListRegexPatternSets' {Maybe Natural
Maybe Text
Scope
scope :: Scope
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:scope:ListRegexPatternSets' :: ListRegexPatternSets -> Scope
$sel:nextMarker:ListRegexPatternSets' :: ListRegexPatternSets -> Maybe Text
$sel:limit:ListRegexPatternSets' :: ListRegexPatternSets -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Limit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
(Key
"NextMarker" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextMarker,
forall a. a -> Maybe a
Prelude.Just (Key
"Scope" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Scope
scope)
]
)
instance Data.ToPath ListRegexPatternSets where
toPath :: ListRegexPatternSets -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListRegexPatternSets where
toQuery :: ListRegexPatternSets -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListRegexPatternSetsResponse = ListRegexPatternSetsResponse'
{
ListRegexPatternSetsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListRegexPatternSetsResponse -> Maybe [RegexPatternSetSummary]
regexPatternSets :: Prelude.Maybe [RegexPatternSetSummary],
ListRegexPatternSetsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListRegexPatternSetsResponse
-> ListRegexPatternSetsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRegexPatternSetsResponse
-> ListRegexPatternSetsResponse -> Bool
$c/= :: ListRegexPatternSetsResponse
-> ListRegexPatternSetsResponse -> Bool
== :: ListRegexPatternSetsResponse
-> ListRegexPatternSetsResponse -> Bool
$c== :: ListRegexPatternSetsResponse
-> ListRegexPatternSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListRegexPatternSetsResponse]
ReadPrec ListRegexPatternSetsResponse
Int -> ReadS ListRegexPatternSetsResponse
ReadS [ListRegexPatternSetsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRegexPatternSetsResponse]
$creadListPrec :: ReadPrec [ListRegexPatternSetsResponse]
readPrec :: ReadPrec ListRegexPatternSetsResponse
$creadPrec :: ReadPrec ListRegexPatternSetsResponse
readList :: ReadS [ListRegexPatternSetsResponse]
$creadList :: ReadS [ListRegexPatternSetsResponse]
readsPrec :: Int -> ReadS ListRegexPatternSetsResponse
$creadsPrec :: Int -> ReadS ListRegexPatternSetsResponse
Prelude.Read, Int -> ListRegexPatternSetsResponse -> ShowS
[ListRegexPatternSetsResponse] -> ShowS
ListRegexPatternSetsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRegexPatternSetsResponse] -> ShowS
$cshowList :: [ListRegexPatternSetsResponse] -> ShowS
show :: ListRegexPatternSetsResponse -> String
$cshow :: ListRegexPatternSetsResponse -> String
showsPrec :: Int -> ListRegexPatternSetsResponse -> ShowS
$cshowsPrec :: Int -> ListRegexPatternSetsResponse -> ShowS
Prelude.Show, forall x.
Rep ListRegexPatternSetsResponse x -> ListRegexPatternSetsResponse
forall x.
ListRegexPatternSetsResponse -> Rep ListRegexPatternSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRegexPatternSetsResponse x -> ListRegexPatternSetsResponse
$cfrom :: forall x.
ListRegexPatternSetsResponse -> Rep ListRegexPatternSetsResponse x
Prelude.Generic)
newListRegexPatternSetsResponse ::
Prelude.Int ->
ListRegexPatternSetsResponse
newListRegexPatternSetsResponse :: Int -> ListRegexPatternSetsResponse
newListRegexPatternSetsResponse Int
pHttpStatus_ =
ListRegexPatternSetsResponse'
{ $sel:nextMarker:ListRegexPatternSetsResponse' :: Maybe Text
nextMarker =
forall a. Maybe a
Prelude.Nothing,
$sel:regexPatternSets:ListRegexPatternSetsResponse' :: Maybe [RegexPatternSetSummary]
regexPatternSets = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListRegexPatternSetsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listRegexPatternSetsResponse_nextMarker :: Lens.Lens' ListRegexPatternSetsResponse (Prelude.Maybe Prelude.Text)
listRegexPatternSetsResponse_nextMarker :: Lens' ListRegexPatternSetsResponse (Maybe Text)
listRegexPatternSetsResponse_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegexPatternSetsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListRegexPatternSetsResponse' :: ListRegexPatternSetsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListRegexPatternSetsResponse
s@ListRegexPatternSetsResponse' {} Maybe Text
a -> ListRegexPatternSetsResponse
s {$sel:nextMarker:ListRegexPatternSetsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListRegexPatternSetsResponse)
listRegexPatternSetsResponse_regexPatternSets :: Lens.Lens' ListRegexPatternSetsResponse (Prelude.Maybe [RegexPatternSetSummary])
listRegexPatternSetsResponse_regexPatternSets :: Lens' ListRegexPatternSetsResponse (Maybe [RegexPatternSetSummary])
listRegexPatternSetsResponse_regexPatternSets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegexPatternSetsResponse' {Maybe [RegexPatternSetSummary]
regexPatternSets :: Maybe [RegexPatternSetSummary]
$sel:regexPatternSets:ListRegexPatternSetsResponse' :: ListRegexPatternSetsResponse -> Maybe [RegexPatternSetSummary]
regexPatternSets} -> Maybe [RegexPatternSetSummary]
regexPatternSets) (\s :: ListRegexPatternSetsResponse
s@ListRegexPatternSetsResponse' {} Maybe [RegexPatternSetSummary]
a -> ListRegexPatternSetsResponse
s {$sel:regexPatternSets:ListRegexPatternSetsResponse' :: Maybe [RegexPatternSetSummary]
regexPatternSets = Maybe [RegexPatternSetSummary]
a} :: ListRegexPatternSetsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listRegexPatternSetsResponse_httpStatus :: Lens.Lens' ListRegexPatternSetsResponse Prelude.Int
listRegexPatternSetsResponse_httpStatus :: Lens' ListRegexPatternSetsResponse Int
listRegexPatternSetsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRegexPatternSetsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListRegexPatternSetsResponse' :: ListRegexPatternSetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListRegexPatternSetsResponse
s@ListRegexPatternSetsResponse' {} Int
a -> ListRegexPatternSetsResponse
s {$sel:httpStatus:ListRegexPatternSetsResponse' :: Int
httpStatus = Int
a} :: ListRegexPatternSetsResponse)
instance Prelude.NFData ListRegexPatternSetsResponse where
rnf :: ListRegexPatternSetsResponse -> ()
rnf ListRegexPatternSetsResponse' {Int
Maybe [RegexPatternSetSummary]
Maybe Text
httpStatus :: Int
regexPatternSets :: Maybe [RegexPatternSetSummary]
nextMarker :: Maybe Text
$sel:httpStatus:ListRegexPatternSetsResponse' :: ListRegexPatternSetsResponse -> Int
$sel:regexPatternSets:ListRegexPatternSetsResponse' :: ListRegexPatternSetsResponse -> Maybe [RegexPatternSetSummary]
$sel:nextMarker:ListRegexPatternSetsResponse' :: ListRegexPatternSetsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RegexPatternSetSummary]
regexPatternSets
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus