{-# 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.SESV2.GetDedicatedIps
(
GetDedicatedIps (..),
newGetDedicatedIps,
getDedicatedIps_poolName,
getDedicatedIps_nextToken,
getDedicatedIps_pageSize,
GetDedicatedIpsResponse (..),
newGetDedicatedIpsResponse,
getDedicatedIpsResponse_nextToken,
getDedicatedIpsResponse_dedicatedIps,
getDedicatedIpsResponse_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.SESV2.Types
data GetDedicatedIps = GetDedicatedIps'
{
GetDedicatedIps -> Maybe Text
poolName :: Prelude.Maybe Prelude.Text,
GetDedicatedIps -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetDedicatedIps -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int
}
deriving (GetDedicatedIps -> GetDedicatedIps -> Bool
(GetDedicatedIps -> GetDedicatedIps -> Bool)
-> (GetDedicatedIps -> GetDedicatedIps -> Bool)
-> Eq GetDedicatedIps
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDedicatedIps -> GetDedicatedIps -> Bool
$c/= :: GetDedicatedIps -> GetDedicatedIps -> Bool
== :: GetDedicatedIps -> GetDedicatedIps -> Bool
$c== :: GetDedicatedIps -> GetDedicatedIps -> Bool
Prelude.Eq, ReadPrec [GetDedicatedIps]
ReadPrec GetDedicatedIps
Int -> ReadS GetDedicatedIps
ReadS [GetDedicatedIps]
(Int -> ReadS GetDedicatedIps)
-> ReadS [GetDedicatedIps]
-> ReadPrec GetDedicatedIps
-> ReadPrec [GetDedicatedIps]
-> Read GetDedicatedIps
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDedicatedIps]
$creadListPrec :: ReadPrec [GetDedicatedIps]
readPrec :: ReadPrec GetDedicatedIps
$creadPrec :: ReadPrec GetDedicatedIps
readList :: ReadS [GetDedicatedIps]
$creadList :: ReadS [GetDedicatedIps]
readsPrec :: Int -> ReadS GetDedicatedIps
$creadsPrec :: Int -> ReadS GetDedicatedIps
Prelude.Read, Int -> GetDedicatedIps -> ShowS
[GetDedicatedIps] -> ShowS
GetDedicatedIps -> String
(Int -> GetDedicatedIps -> ShowS)
-> (GetDedicatedIps -> String)
-> ([GetDedicatedIps] -> ShowS)
-> Show GetDedicatedIps
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDedicatedIps] -> ShowS
$cshowList :: [GetDedicatedIps] -> ShowS
show :: GetDedicatedIps -> String
$cshow :: GetDedicatedIps -> String
showsPrec :: Int -> GetDedicatedIps -> ShowS
$cshowsPrec :: Int -> GetDedicatedIps -> ShowS
Prelude.Show, (forall x. GetDedicatedIps -> Rep GetDedicatedIps x)
-> (forall x. Rep GetDedicatedIps x -> GetDedicatedIps)
-> Generic GetDedicatedIps
forall x. Rep GetDedicatedIps x -> GetDedicatedIps
forall x. GetDedicatedIps -> Rep GetDedicatedIps x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDedicatedIps x -> GetDedicatedIps
$cfrom :: forall x. GetDedicatedIps -> Rep GetDedicatedIps x
Prelude.Generic)
newGetDedicatedIps ::
GetDedicatedIps
newGetDedicatedIps :: GetDedicatedIps
newGetDedicatedIps =
GetDedicatedIps' :: Maybe Text -> Maybe Text -> Maybe Int -> GetDedicatedIps
GetDedicatedIps'
{ $sel:poolName:GetDedicatedIps' :: Maybe Text
poolName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:GetDedicatedIps' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:GetDedicatedIps' :: Maybe Int
pageSize = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
getDedicatedIps_poolName :: Lens.Lens' GetDedicatedIps (Prelude.Maybe Prelude.Text)
getDedicatedIps_poolName :: (Maybe Text -> f (Maybe Text))
-> GetDedicatedIps -> f GetDedicatedIps
getDedicatedIps_poolName = (GetDedicatedIps -> Maybe Text)
-> (GetDedicatedIps -> Maybe Text -> GetDedicatedIps)
-> Lens GetDedicatedIps GetDedicatedIps (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDedicatedIps' {Maybe Text
poolName :: Maybe Text
$sel:poolName:GetDedicatedIps' :: GetDedicatedIps -> Maybe Text
poolName} -> Maybe Text
poolName) (\s :: GetDedicatedIps
s@GetDedicatedIps' {} Maybe Text
a -> GetDedicatedIps
s {$sel:poolName:GetDedicatedIps' :: Maybe Text
poolName = Maybe Text
a} :: GetDedicatedIps)
getDedicatedIps_nextToken :: Lens.Lens' GetDedicatedIps (Prelude.Maybe Prelude.Text)
getDedicatedIps_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetDedicatedIps -> f GetDedicatedIps
getDedicatedIps_nextToken = (GetDedicatedIps -> Maybe Text)
-> (GetDedicatedIps -> Maybe Text -> GetDedicatedIps)
-> Lens GetDedicatedIps GetDedicatedIps (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDedicatedIps' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetDedicatedIps' :: GetDedicatedIps -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetDedicatedIps
s@GetDedicatedIps' {} Maybe Text
a -> GetDedicatedIps
s {$sel:nextToken:GetDedicatedIps' :: Maybe Text
nextToken = Maybe Text
a} :: GetDedicatedIps)
getDedicatedIps_pageSize :: Lens.Lens' GetDedicatedIps (Prelude.Maybe Prelude.Int)
getDedicatedIps_pageSize :: (Maybe Int -> f (Maybe Int))
-> GetDedicatedIps -> f GetDedicatedIps
getDedicatedIps_pageSize = (GetDedicatedIps -> Maybe Int)
-> (GetDedicatedIps -> Maybe Int -> GetDedicatedIps)
-> Lens GetDedicatedIps GetDedicatedIps (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDedicatedIps' {Maybe Int
pageSize :: Maybe Int
$sel:pageSize:GetDedicatedIps' :: GetDedicatedIps -> Maybe Int
pageSize} -> Maybe Int
pageSize) (\s :: GetDedicatedIps
s@GetDedicatedIps' {} Maybe Int
a -> GetDedicatedIps
s {$sel:pageSize:GetDedicatedIps' :: Maybe Int
pageSize = Maybe Int
a} :: GetDedicatedIps)
instance Core.AWSRequest GetDedicatedIps where
type
AWSResponse GetDedicatedIps =
GetDedicatedIpsResponse
request :: GetDedicatedIps -> Request GetDedicatedIps
request = Service -> GetDedicatedIps -> Request GetDedicatedIps
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetDedicatedIps
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDedicatedIps)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetDedicatedIps))
-> Logger
-> Service
-> Proxy GetDedicatedIps
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDedicatedIps)))
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 [DedicatedIp] -> Int -> GetDedicatedIpsResponse
GetDedicatedIpsResponse'
(Maybe Text
-> Maybe [DedicatedIp] -> Int -> GetDedicatedIpsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [DedicatedIp] -> Int -> GetDedicatedIpsResponse)
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
"NextToken")
Either
String (Maybe [DedicatedIp] -> Int -> GetDedicatedIpsResponse)
-> Either String (Maybe [DedicatedIp])
-> Either String (Int -> GetDedicatedIpsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [DedicatedIp]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DedicatedIps" Either String (Maybe (Maybe [DedicatedIp]))
-> Maybe [DedicatedIp] -> Either String (Maybe [DedicatedIp])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DedicatedIp]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> GetDedicatedIpsResponse)
-> Either String Int -> Either String GetDedicatedIpsResponse
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 GetDedicatedIps
instance Prelude.NFData GetDedicatedIps
instance Core.ToHeaders GetDedicatedIps where
toHeaders :: GetDedicatedIps -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetDedicatedIps -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath GetDedicatedIps where
toPath :: GetDedicatedIps -> ByteString
toPath = ByteString -> GetDedicatedIps -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v2/email/dedicated-ips"
instance Core.ToQuery GetDedicatedIps where
toQuery :: GetDedicatedIps -> QueryString
toQuery GetDedicatedIps' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
poolName :: Maybe Text
$sel:pageSize:GetDedicatedIps' :: GetDedicatedIps -> Maybe Int
$sel:nextToken:GetDedicatedIps' :: GetDedicatedIps -> Maybe Text
$sel:poolName:GetDedicatedIps' :: GetDedicatedIps -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"PoolName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
poolName,
ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
ByteString
"PageSize" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
pageSize
]
data GetDedicatedIpsResponse = GetDedicatedIpsResponse'
{
GetDedicatedIpsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetDedicatedIpsResponse -> Maybe [DedicatedIp]
dedicatedIps :: Prelude.Maybe [DedicatedIp],
GetDedicatedIpsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool
(GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool)
-> (GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool)
-> Eq GetDedicatedIpsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool
$c/= :: GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool
== :: GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool
$c== :: GetDedicatedIpsResponse -> GetDedicatedIpsResponse -> Bool
Prelude.Eq, ReadPrec [GetDedicatedIpsResponse]
ReadPrec GetDedicatedIpsResponse
Int -> ReadS GetDedicatedIpsResponse
ReadS [GetDedicatedIpsResponse]
(Int -> ReadS GetDedicatedIpsResponse)
-> ReadS [GetDedicatedIpsResponse]
-> ReadPrec GetDedicatedIpsResponse
-> ReadPrec [GetDedicatedIpsResponse]
-> Read GetDedicatedIpsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDedicatedIpsResponse]
$creadListPrec :: ReadPrec [GetDedicatedIpsResponse]
readPrec :: ReadPrec GetDedicatedIpsResponse
$creadPrec :: ReadPrec GetDedicatedIpsResponse
readList :: ReadS [GetDedicatedIpsResponse]
$creadList :: ReadS [GetDedicatedIpsResponse]
readsPrec :: Int -> ReadS GetDedicatedIpsResponse
$creadsPrec :: Int -> ReadS GetDedicatedIpsResponse
Prelude.Read, Int -> GetDedicatedIpsResponse -> ShowS
[GetDedicatedIpsResponse] -> ShowS
GetDedicatedIpsResponse -> String
(Int -> GetDedicatedIpsResponse -> ShowS)
-> (GetDedicatedIpsResponse -> String)
-> ([GetDedicatedIpsResponse] -> ShowS)
-> Show GetDedicatedIpsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDedicatedIpsResponse] -> ShowS
$cshowList :: [GetDedicatedIpsResponse] -> ShowS
show :: GetDedicatedIpsResponse -> String
$cshow :: GetDedicatedIpsResponse -> String
showsPrec :: Int -> GetDedicatedIpsResponse -> ShowS
$cshowsPrec :: Int -> GetDedicatedIpsResponse -> ShowS
Prelude.Show, (forall x.
GetDedicatedIpsResponse -> Rep GetDedicatedIpsResponse x)
-> (forall x.
Rep GetDedicatedIpsResponse x -> GetDedicatedIpsResponse)
-> Generic GetDedicatedIpsResponse
forall x. Rep GetDedicatedIpsResponse x -> GetDedicatedIpsResponse
forall x. GetDedicatedIpsResponse -> Rep GetDedicatedIpsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDedicatedIpsResponse x -> GetDedicatedIpsResponse
$cfrom :: forall x. GetDedicatedIpsResponse -> Rep GetDedicatedIpsResponse x
Prelude.Generic)
newGetDedicatedIpsResponse ::
Prelude.Int ->
GetDedicatedIpsResponse
newGetDedicatedIpsResponse :: Int -> GetDedicatedIpsResponse
newGetDedicatedIpsResponse Int
pHttpStatus_ =
GetDedicatedIpsResponse' :: Maybe Text -> Maybe [DedicatedIp] -> Int -> GetDedicatedIpsResponse
GetDedicatedIpsResponse'
{ $sel:nextToken:GetDedicatedIpsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dedicatedIps:GetDedicatedIpsResponse' :: Maybe [DedicatedIp]
dedicatedIps = Maybe [DedicatedIp]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetDedicatedIpsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getDedicatedIpsResponse_nextToken :: Lens.Lens' GetDedicatedIpsResponse (Prelude.Maybe Prelude.Text)
getDedicatedIpsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetDedicatedIpsResponse -> f GetDedicatedIpsResponse
getDedicatedIpsResponse_nextToken = (GetDedicatedIpsResponse -> Maybe Text)
-> (GetDedicatedIpsResponse
-> Maybe Text -> GetDedicatedIpsResponse)
-> Lens
GetDedicatedIpsResponse
GetDedicatedIpsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDedicatedIpsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetDedicatedIpsResponse' :: GetDedicatedIpsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetDedicatedIpsResponse
s@GetDedicatedIpsResponse' {} Maybe Text
a -> GetDedicatedIpsResponse
s {$sel:nextToken:GetDedicatedIpsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetDedicatedIpsResponse)
getDedicatedIpsResponse_dedicatedIps :: Lens.Lens' GetDedicatedIpsResponse (Prelude.Maybe [DedicatedIp])
getDedicatedIpsResponse_dedicatedIps :: (Maybe [DedicatedIp] -> f (Maybe [DedicatedIp]))
-> GetDedicatedIpsResponse -> f GetDedicatedIpsResponse
getDedicatedIpsResponse_dedicatedIps = (GetDedicatedIpsResponse -> Maybe [DedicatedIp])
-> (GetDedicatedIpsResponse
-> Maybe [DedicatedIp] -> GetDedicatedIpsResponse)
-> Lens
GetDedicatedIpsResponse
GetDedicatedIpsResponse
(Maybe [DedicatedIp])
(Maybe [DedicatedIp])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDedicatedIpsResponse' {Maybe [DedicatedIp]
dedicatedIps :: Maybe [DedicatedIp]
$sel:dedicatedIps:GetDedicatedIpsResponse' :: GetDedicatedIpsResponse -> Maybe [DedicatedIp]
dedicatedIps} -> Maybe [DedicatedIp]
dedicatedIps) (\s :: GetDedicatedIpsResponse
s@GetDedicatedIpsResponse' {} Maybe [DedicatedIp]
a -> GetDedicatedIpsResponse
s {$sel:dedicatedIps:GetDedicatedIpsResponse' :: Maybe [DedicatedIp]
dedicatedIps = Maybe [DedicatedIp]
a} :: GetDedicatedIpsResponse) ((Maybe [DedicatedIp] -> f (Maybe [DedicatedIp]))
-> GetDedicatedIpsResponse -> f GetDedicatedIpsResponse)
-> ((Maybe [DedicatedIp] -> f (Maybe [DedicatedIp]))
-> Maybe [DedicatedIp] -> f (Maybe [DedicatedIp]))
-> (Maybe [DedicatedIp] -> f (Maybe [DedicatedIp]))
-> GetDedicatedIpsResponse
-> f GetDedicatedIpsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DedicatedIp] [DedicatedIp] [DedicatedIp] [DedicatedIp]
-> Iso
(Maybe [DedicatedIp])
(Maybe [DedicatedIp])
(Maybe [DedicatedIp])
(Maybe [DedicatedIp])
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 [DedicatedIp] [DedicatedIp] [DedicatedIp] [DedicatedIp]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getDedicatedIpsResponse_httpStatus :: Lens.Lens' GetDedicatedIpsResponse Prelude.Int
getDedicatedIpsResponse_httpStatus :: (Int -> f Int)
-> GetDedicatedIpsResponse -> f GetDedicatedIpsResponse
getDedicatedIpsResponse_httpStatus = (GetDedicatedIpsResponse -> Int)
-> (GetDedicatedIpsResponse -> Int -> GetDedicatedIpsResponse)
-> Lens GetDedicatedIpsResponse GetDedicatedIpsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDedicatedIpsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDedicatedIpsResponse' :: GetDedicatedIpsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDedicatedIpsResponse
s@GetDedicatedIpsResponse' {} Int
a -> GetDedicatedIpsResponse
s {$sel:httpStatus:GetDedicatedIpsResponse' :: Int
httpStatus = Int
a} :: GetDedicatedIpsResponse)
instance Prelude.NFData GetDedicatedIpsResponse