{-# 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_limit,
listWebACLs_nextMarker,
ListWebACLsResponse (..),
newListWebACLsResponse,
listWebACLsResponse_nextMarker,
listWebACLsResponse_webACLs,
listWebACLsResponse_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.WAFRegional.Types
data ListWebACLs = ListWebACLs'
{
ListWebACLs -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListWebACLs -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text
}
deriving (ListWebACLs -> ListWebACLs -> Bool
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]
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
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. 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'
{ $sel:limit:ListWebACLs' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListWebACLs' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing
}
listWebACLs_limit :: Lens.Lens' ListWebACLs (Prelude.Maybe Prelude.Natural)
listWebACLs_limit :: Lens' ListWebACLs (Maybe Natural)
listWebACLs_limit = 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)
listWebACLs_nextMarker :: Lens.Lens' ListWebACLs (Prelude.Maybe Prelude.Text)
listWebACLs_nextMarker :: Lens' ListWebACLs (Maybe Text)
listWebACLs_nextMarker = 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)
instance Core.AWSRequest ListWebACLs where
type AWSResponse ListWebACLs = ListWebACLsResponse
request :: (Service -> Service) -> ListWebACLs -> Request ListWebACLs
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 ListWebACLs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListWebACLs)))
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 [WebACLSummary] -> Int -> ListWebACLsResponse
ListWebACLsResponse'
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
"WebACLs" 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 ListWebACLs where
hashWithSalt :: Int -> ListWebACLs -> Int
hashWithSalt Int
_salt ListWebACLs' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListWebACLs' :: ListWebACLs -> Maybe Text
$sel:limit:ListWebACLs' :: ListWebACLs -> 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
instance Prelude.NFData ListWebACLs where
rnf :: ListWebACLs -> ()
rnf ListWebACLs' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListWebACLs' :: ListWebACLs -> Maybe Text
$sel:limit:ListWebACLs' :: ListWebACLs -> 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
instance Data.ToHeaders ListWebACLs where
toHeaders :: ListWebACLs -> 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_Regional_20161128.ListWebACLs" ::
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 ListWebACLs where
toJSON :: ListWebACLs -> Value
toJSON ListWebACLs' {Maybe Natural
Maybe Text
nextMarker :: Maybe Text
limit :: Maybe Natural
$sel:nextMarker:ListWebACLs' :: ListWebACLs -> Maybe Text
$sel:limit:ListWebACLs' :: ListWebACLs -> 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
]
)
instance Data.ToPath ListWebACLs where
toPath :: ListWebACLs -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListWebACLs where
toQuery :: ListWebACLs -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListWebACLsResponse = ListWebACLsResponse'
{
ListWebACLsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListWebACLsResponse -> Maybe [WebACLSummary]
webACLs :: Prelude.Maybe [WebACLSummary],
ListWebACLsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListWebACLsResponse -> ListWebACLsResponse -> Bool
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]
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
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. 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'
{ $sel:nextMarker:ListWebACLsResponse' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
$sel:webACLs:ListWebACLsResponse' :: Maybe [WebACLSummary]
webACLs = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListWebACLsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listWebACLsResponse_nextMarker :: Lens.Lens' ListWebACLsResponse (Prelude.Maybe Prelude.Text)
listWebACLsResponse_nextMarker :: Lens' ListWebACLsResponse (Maybe Text)
listWebACLsResponse_nextMarker = 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_webACLs :: Lens.Lens' ListWebACLsResponse (Prelude.Maybe [WebACLSummary])
listWebACLsResponse_webACLs :: Lens' ListWebACLsResponse (Maybe [WebACLSummary])
listWebACLsResponse_webACLs = 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) 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
listWebACLsResponse_httpStatus :: Lens.Lens' ListWebACLsResponse Prelude.Int
listWebACLsResponse_httpStatus :: Lens' ListWebACLsResponse Int
listWebACLsResponse_httpStatus = 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 where
rnf :: ListWebACLsResponse -> ()
rnf ListWebACLsResponse' {Int
Maybe [WebACLSummary]
Maybe Text
httpStatus :: Int
webACLs :: Maybe [WebACLSummary]
nextMarker :: Maybe Text
$sel:httpStatus:ListWebACLsResponse' :: ListWebACLsResponse -> Int
$sel:webACLs:ListWebACLsResponse' :: ListWebACLsResponse -> Maybe [WebACLSummary]
$sel:nextMarker:ListWebACLsResponse' :: ListWebACLsResponse -> 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 [WebACLSummary]
webACLs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus