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