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