{-# 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.PinpointEmail.ListDedicatedIpPools
(
ListDedicatedIpPools (..),
newListDedicatedIpPools,
listDedicatedIpPools_nextToken,
listDedicatedIpPools_pageSize,
ListDedicatedIpPoolsResponse (..),
newListDedicatedIpPoolsResponse,
listDedicatedIpPoolsResponse_dedicatedIpPools,
listDedicatedIpPoolsResponse_nextToken,
listDedicatedIpPoolsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.PinpointEmail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListDedicatedIpPools = ListDedicatedIpPools'
{
ListDedicatedIpPools -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDedicatedIpPools -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int
}
deriving (ListDedicatedIpPools -> ListDedicatedIpPools -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDedicatedIpPools -> ListDedicatedIpPools -> Bool
$c/= :: ListDedicatedIpPools -> ListDedicatedIpPools -> Bool
== :: ListDedicatedIpPools -> ListDedicatedIpPools -> Bool
$c== :: ListDedicatedIpPools -> ListDedicatedIpPools -> Bool
Prelude.Eq, ReadPrec [ListDedicatedIpPools]
ReadPrec ListDedicatedIpPools
Int -> ReadS ListDedicatedIpPools
ReadS [ListDedicatedIpPools]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDedicatedIpPools]
$creadListPrec :: ReadPrec [ListDedicatedIpPools]
readPrec :: ReadPrec ListDedicatedIpPools
$creadPrec :: ReadPrec ListDedicatedIpPools
readList :: ReadS [ListDedicatedIpPools]
$creadList :: ReadS [ListDedicatedIpPools]
readsPrec :: Int -> ReadS ListDedicatedIpPools
$creadsPrec :: Int -> ReadS ListDedicatedIpPools
Prelude.Read, Int -> ListDedicatedIpPools -> ShowS
[ListDedicatedIpPools] -> ShowS
ListDedicatedIpPools -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDedicatedIpPools] -> ShowS
$cshowList :: [ListDedicatedIpPools] -> ShowS
show :: ListDedicatedIpPools -> String
$cshow :: ListDedicatedIpPools -> String
showsPrec :: Int -> ListDedicatedIpPools -> ShowS
$cshowsPrec :: Int -> ListDedicatedIpPools -> ShowS
Prelude.Show, forall x. Rep ListDedicatedIpPools x -> ListDedicatedIpPools
forall x. ListDedicatedIpPools -> Rep ListDedicatedIpPools x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDedicatedIpPools x -> ListDedicatedIpPools
$cfrom :: forall x. ListDedicatedIpPools -> Rep ListDedicatedIpPools x
Prelude.Generic)
newListDedicatedIpPools ::
ListDedicatedIpPools
newListDedicatedIpPools :: ListDedicatedIpPools
newListDedicatedIpPools =
ListDedicatedIpPools'
{ $sel:nextToken:ListDedicatedIpPools' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:ListDedicatedIpPools' :: Maybe Int
pageSize = forall a. Maybe a
Prelude.Nothing
}
listDedicatedIpPools_nextToken :: Lens.Lens' ListDedicatedIpPools (Prelude.Maybe Prelude.Text)
listDedicatedIpPools_nextToken :: Lens' ListDedicatedIpPools (Maybe Text)
listDedicatedIpPools_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDedicatedIpPools' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDedicatedIpPools' :: ListDedicatedIpPools -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDedicatedIpPools
s@ListDedicatedIpPools' {} Maybe Text
a -> ListDedicatedIpPools
s {$sel:nextToken:ListDedicatedIpPools' :: Maybe Text
nextToken = Maybe Text
a} :: ListDedicatedIpPools)
listDedicatedIpPools_pageSize :: Lens.Lens' ListDedicatedIpPools (Prelude.Maybe Prelude.Int)
listDedicatedIpPools_pageSize :: Lens' ListDedicatedIpPools (Maybe Int)
listDedicatedIpPools_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDedicatedIpPools' {Maybe Int
pageSize :: Maybe Int
$sel:pageSize:ListDedicatedIpPools' :: ListDedicatedIpPools -> Maybe Int
pageSize} -> Maybe Int
pageSize) (\s :: ListDedicatedIpPools
s@ListDedicatedIpPools' {} Maybe Int
a -> ListDedicatedIpPools
s {$sel:pageSize:ListDedicatedIpPools' :: Maybe Int
pageSize = Maybe Int
a} :: ListDedicatedIpPools)
instance Core.AWSPager ListDedicatedIpPools where
page :: ListDedicatedIpPools
-> AWSResponse ListDedicatedIpPools -> Maybe ListDedicatedIpPools
page ListDedicatedIpPools
rq AWSResponse ListDedicatedIpPools
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDedicatedIpPools
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDedicatedIpPoolsResponse (Maybe Text)
listDedicatedIpPoolsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDedicatedIpPools
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDedicatedIpPoolsResponse (Maybe [Text])
listDedicatedIpPoolsResponse_dedicatedIpPools
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListDedicatedIpPools
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDedicatedIpPools (Maybe Text)
listDedicatedIpPools_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDedicatedIpPools
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDedicatedIpPoolsResponse (Maybe Text)
listDedicatedIpPoolsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListDedicatedIpPools where
type
AWSResponse ListDedicatedIpPools =
ListDedicatedIpPoolsResponse
request :: (Service -> Service)
-> ListDedicatedIpPools -> Request ListDedicatedIpPools
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListDedicatedIpPools
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDedicatedIpPools)))
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 Text -> Int -> ListDedicatedIpPoolsResponse
ListDedicatedIpPoolsResponse'
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
"DedicatedIpPools"
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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
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 ListDedicatedIpPools where
hashWithSalt :: Int -> ListDedicatedIpPools -> Int
hashWithSalt Int
_salt ListDedicatedIpPools' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListDedicatedIpPools' :: ListDedicatedIpPools -> Maybe Int
$sel:nextToken:ListDedicatedIpPools' :: ListDedicatedIpPools -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
pageSize
instance Prelude.NFData ListDedicatedIpPools where
rnf :: ListDedicatedIpPools -> ()
rnf ListDedicatedIpPools' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListDedicatedIpPools' :: ListDedicatedIpPools -> Maybe Int
$sel:nextToken:ListDedicatedIpPools' :: ListDedicatedIpPools -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
pageSize
instance Data.ToHeaders ListDedicatedIpPools where
toHeaders :: ListDedicatedIpPools -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListDedicatedIpPools where
toPath :: ListDedicatedIpPools -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/v1/email/dedicated-ip-pools"
instance Data.ToQuery ListDedicatedIpPools where
toQuery :: ListDedicatedIpPools -> QueryString
toQuery ListDedicatedIpPools' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListDedicatedIpPools' :: ListDedicatedIpPools -> Maybe Int
$sel:nextToken:ListDedicatedIpPools' :: ListDedicatedIpPools -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
ByteString
"PageSize" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
pageSize
]
data ListDedicatedIpPoolsResponse = ListDedicatedIpPoolsResponse'
{
ListDedicatedIpPoolsResponse -> Maybe [Text]
dedicatedIpPools :: Prelude.Maybe [Prelude.Text],
ListDedicatedIpPoolsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDedicatedIpPoolsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDedicatedIpPoolsResponse
-> ListDedicatedIpPoolsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDedicatedIpPoolsResponse
-> ListDedicatedIpPoolsResponse -> Bool
$c/= :: ListDedicatedIpPoolsResponse
-> ListDedicatedIpPoolsResponse -> Bool
== :: ListDedicatedIpPoolsResponse
-> ListDedicatedIpPoolsResponse -> Bool
$c== :: ListDedicatedIpPoolsResponse
-> ListDedicatedIpPoolsResponse -> Bool
Prelude.Eq, ReadPrec [ListDedicatedIpPoolsResponse]
ReadPrec ListDedicatedIpPoolsResponse
Int -> ReadS ListDedicatedIpPoolsResponse
ReadS [ListDedicatedIpPoolsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDedicatedIpPoolsResponse]
$creadListPrec :: ReadPrec [ListDedicatedIpPoolsResponse]
readPrec :: ReadPrec ListDedicatedIpPoolsResponse
$creadPrec :: ReadPrec ListDedicatedIpPoolsResponse
readList :: ReadS [ListDedicatedIpPoolsResponse]
$creadList :: ReadS [ListDedicatedIpPoolsResponse]
readsPrec :: Int -> ReadS ListDedicatedIpPoolsResponse
$creadsPrec :: Int -> ReadS ListDedicatedIpPoolsResponse
Prelude.Read, Int -> ListDedicatedIpPoolsResponse -> ShowS
[ListDedicatedIpPoolsResponse] -> ShowS
ListDedicatedIpPoolsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDedicatedIpPoolsResponse] -> ShowS
$cshowList :: [ListDedicatedIpPoolsResponse] -> ShowS
show :: ListDedicatedIpPoolsResponse -> String
$cshow :: ListDedicatedIpPoolsResponse -> String
showsPrec :: Int -> ListDedicatedIpPoolsResponse -> ShowS
$cshowsPrec :: Int -> ListDedicatedIpPoolsResponse -> ShowS
Prelude.Show, forall x.
Rep ListDedicatedIpPoolsResponse x -> ListDedicatedIpPoolsResponse
forall x.
ListDedicatedIpPoolsResponse -> Rep ListDedicatedIpPoolsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDedicatedIpPoolsResponse x -> ListDedicatedIpPoolsResponse
$cfrom :: forall x.
ListDedicatedIpPoolsResponse -> Rep ListDedicatedIpPoolsResponse x
Prelude.Generic)
newListDedicatedIpPoolsResponse ::
Prelude.Int ->
ListDedicatedIpPoolsResponse
newListDedicatedIpPoolsResponse :: Int -> ListDedicatedIpPoolsResponse
newListDedicatedIpPoolsResponse Int
pHttpStatus_ =
ListDedicatedIpPoolsResponse'
{ $sel:dedicatedIpPools:ListDedicatedIpPoolsResponse' :: Maybe [Text]
dedicatedIpPools =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDedicatedIpPoolsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDedicatedIpPoolsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDedicatedIpPoolsResponse_dedicatedIpPools :: Lens.Lens' ListDedicatedIpPoolsResponse (Prelude.Maybe [Prelude.Text])
listDedicatedIpPoolsResponse_dedicatedIpPools :: Lens' ListDedicatedIpPoolsResponse (Maybe [Text])
listDedicatedIpPoolsResponse_dedicatedIpPools = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDedicatedIpPoolsResponse' {Maybe [Text]
dedicatedIpPools :: Maybe [Text]
$sel:dedicatedIpPools:ListDedicatedIpPoolsResponse' :: ListDedicatedIpPoolsResponse -> Maybe [Text]
dedicatedIpPools} -> Maybe [Text]
dedicatedIpPools) (\s :: ListDedicatedIpPoolsResponse
s@ListDedicatedIpPoolsResponse' {} Maybe [Text]
a -> ListDedicatedIpPoolsResponse
s {$sel:dedicatedIpPools:ListDedicatedIpPoolsResponse' :: Maybe [Text]
dedicatedIpPools = Maybe [Text]
a} :: ListDedicatedIpPoolsResponse) 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
listDedicatedIpPoolsResponse_nextToken :: Lens.Lens' ListDedicatedIpPoolsResponse (Prelude.Maybe Prelude.Text)
listDedicatedIpPoolsResponse_nextToken :: Lens' ListDedicatedIpPoolsResponse (Maybe Text)
listDedicatedIpPoolsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDedicatedIpPoolsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDedicatedIpPoolsResponse' :: ListDedicatedIpPoolsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDedicatedIpPoolsResponse
s@ListDedicatedIpPoolsResponse' {} Maybe Text
a -> ListDedicatedIpPoolsResponse
s {$sel:nextToken:ListDedicatedIpPoolsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDedicatedIpPoolsResponse)
listDedicatedIpPoolsResponse_httpStatus :: Lens.Lens' ListDedicatedIpPoolsResponse Prelude.Int
listDedicatedIpPoolsResponse_httpStatus :: Lens' ListDedicatedIpPoolsResponse Int
listDedicatedIpPoolsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDedicatedIpPoolsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDedicatedIpPoolsResponse' :: ListDedicatedIpPoolsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDedicatedIpPoolsResponse
s@ListDedicatedIpPoolsResponse' {} Int
a -> ListDedicatedIpPoolsResponse
s {$sel:httpStatus:ListDedicatedIpPoolsResponse' :: Int
httpStatus = Int
a} :: ListDedicatedIpPoolsResponse)
instance Prelude.NFData ListDedicatedIpPoolsResponse where
rnf :: ListDedicatedIpPoolsResponse -> ()
rnf ListDedicatedIpPoolsResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
dedicatedIpPools :: Maybe [Text]
$sel:httpStatus:ListDedicatedIpPoolsResponse' :: ListDedicatedIpPoolsResponse -> Int
$sel:nextToken:ListDedicatedIpPoolsResponse' :: ListDedicatedIpPoolsResponse -> Maybe Text
$sel:dedicatedIpPools:ListDedicatedIpPoolsResponse' :: ListDedicatedIpPoolsResponse -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
dedicatedIpPools
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus