{-# 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.GetDedicatedIp
(
GetDedicatedIp (..),
newGetDedicatedIp,
getDedicatedIp_ip,
GetDedicatedIpResponse (..),
newGetDedicatedIpResponse,
getDedicatedIpResponse_dedicatedIp,
getDedicatedIpResponse_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.SESV2.Types
data GetDedicatedIp = GetDedicatedIp'
{
GetDedicatedIp -> Text
ip :: Prelude.Text
}
deriving (GetDedicatedIp -> GetDedicatedIp -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDedicatedIp -> GetDedicatedIp -> Bool
$c/= :: GetDedicatedIp -> GetDedicatedIp -> Bool
== :: GetDedicatedIp -> GetDedicatedIp -> Bool
$c== :: GetDedicatedIp -> GetDedicatedIp -> Bool
Prelude.Eq, ReadPrec [GetDedicatedIp]
ReadPrec GetDedicatedIp
Int -> ReadS GetDedicatedIp
ReadS [GetDedicatedIp]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDedicatedIp]
$creadListPrec :: ReadPrec [GetDedicatedIp]
readPrec :: ReadPrec GetDedicatedIp
$creadPrec :: ReadPrec GetDedicatedIp
readList :: ReadS [GetDedicatedIp]
$creadList :: ReadS [GetDedicatedIp]
readsPrec :: Int -> ReadS GetDedicatedIp
$creadsPrec :: Int -> ReadS GetDedicatedIp
Prelude.Read, Int -> GetDedicatedIp -> ShowS
[GetDedicatedIp] -> ShowS
GetDedicatedIp -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDedicatedIp] -> ShowS
$cshowList :: [GetDedicatedIp] -> ShowS
show :: GetDedicatedIp -> String
$cshow :: GetDedicatedIp -> String
showsPrec :: Int -> GetDedicatedIp -> ShowS
$cshowsPrec :: Int -> GetDedicatedIp -> ShowS
Prelude.Show, forall x. Rep GetDedicatedIp x -> GetDedicatedIp
forall x. GetDedicatedIp -> Rep GetDedicatedIp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDedicatedIp x -> GetDedicatedIp
$cfrom :: forall x. GetDedicatedIp -> Rep GetDedicatedIp x
Prelude.Generic)
newGetDedicatedIp ::
Prelude.Text ->
GetDedicatedIp
newGetDedicatedIp :: Text -> GetDedicatedIp
newGetDedicatedIp Text
pIp_ = GetDedicatedIp' {$sel:ip:GetDedicatedIp' :: Text
ip = Text
pIp_}
getDedicatedIp_ip :: Lens.Lens' GetDedicatedIp Prelude.Text
getDedicatedIp_ip :: Lens' GetDedicatedIp Text
getDedicatedIp_ip = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDedicatedIp' {Text
ip :: Text
$sel:ip:GetDedicatedIp' :: GetDedicatedIp -> Text
ip} -> Text
ip) (\s :: GetDedicatedIp
s@GetDedicatedIp' {} Text
a -> GetDedicatedIp
s {$sel:ip:GetDedicatedIp' :: Text
ip = Text
a} :: GetDedicatedIp)
instance Core.AWSRequest GetDedicatedIp where
type
AWSResponse GetDedicatedIp =
GetDedicatedIpResponse
request :: (Service -> Service) -> GetDedicatedIp -> Request GetDedicatedIp
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 GetDedicatedIp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDedicatedIp)))
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 DedicatedIp -> Int -> GetDedicatedIpResponse
GetDedicatedIpResponse'
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
"DedicatedIp")
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 GetDedicatedIp where
hashWithSalt :: Int -> GetDedicatedIp -> Int
hashWithSalt Int
_salt GetDedicatedIp' {Text
ip :: Text
$sel:ip:GetDedicatedIp' :: GetDedicatedIp -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ip
instance Prelude.NFData GetDedicatedIp where
rnf :: GetDedicatedIp -> ()
rnf GetDedicatedIp' {Text
ip :: Text
$sel:ip:GetDedicatedIp' :: GetDedicatedIp -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
ip
instance Data.ToHeaders GetDedicatedIp where
toHeaders :: GetDedicatedIp -> 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 GetDedicatedIp where
toPath :: GetDedicatedIp -> ByteString
toPath GetDedicatedIp' {Text
ip :: Text
$sel:ip:GetDedicatedIp' :: GetDedicatedIp -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v2/email/dedicated-ips/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
ip]
instance Data.ToQuery GetDedicatedIp where
toQuery :: GetDedicatedIp -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetDedicatedIpResponse = GetDedicatedIpResponse'
{
GetDedicatedIpResponse -> Maybe DedicatedIp
dedicatedIp :: Prelude.Maybe DedicatedIp,
GetDedicatedIpResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetDedicatedIpResponse -> GetDedicatedIpResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDedicatedIpResponse -> GetDedicatedIpResponse -> Bool
$c/= :: GetDedicatedIpResponse -> GetDedicatedIpResponse -> Bool
== :: GetDedicatedIpResponse -> GetDedicatedIpResponse -> Bool
$c== :: GetDedicatedIpResponse -> GetDedicatedIpResponse -> Bool
Prelude.Eq, ReadPrec [GetDedicatedIpResponse]
ReadPrec GetDedicatedIpResponse
Int -> ReadS GetDedicatedIpResponse
ReadS [GetDedicatedIpResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDedicatedIpResponse]
$creadListPrec :: ReadPrec [GetDedicatedIpResponse]
readPrec :: ReadPrec GetDedicatedIpResponse
$creadPrec :: ReadPrec GetDedicatedIpResponse
readList :: ReadS [GetDedicatedIpResponse]
$creadList :: ReadS [GetDedicatedIpResponse]
readsPrec :: Int -> ReadS GetDedicatedIpResponse
$creadsPrec :: Int -> ReadS GetDedicatedIpResponse
Prelude.Read, Int -> GetDedicatedIpResponse -> ShowS
[GetDedicatedIpResponse] -> ShowS
GetDedicatedIpResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDedicatedIpResponse] -> ShowS
$cshowList :: [GetDedicatedIpResponse] -> ShowS
show :: GetDedicatedIpResponse -> String
$cshow :: GetDedicatedIpResponse -> String
showsPrec :: Int -> GetDedicatedIpResponse -> ShowS
$cshowsPrec :: Int -> GetDedicatedIpResponse -> ShowS
Prelude.Show, forall x. Rep GetDedicatedIpResponse x -> GetDedicatedIpResponse
forall x. GetDedicatedIpResponse -> Rep GetDedicatedIpResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDedicatedIpResponse x -> GetDedicatedIpResponse
$cfrom :: forall x. GetDedicatedIpResponse -> Rep GetDedicatedIpResponse x
Prelude.Generic)
newGetDedicatedIpResponse ::
Prelude.Int ->
GetDedicatedIpResponse
newGetDedicatedIpResponse :: Int -> GetDedicatedIpResponse
newGetDedicatedIpResponse Int
pHttpStatus_ =
GetDedicatedIpResponse'
{ $sel:dedicatedIp:GetDedicatedIpResponse' :: Maybe DedicatedIp
dedicatedIp =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetDedicatedIpResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getDedicatedIpResponse_dedicatedIp :: Lens.Lens' GetDedicatedIpResponse (Prelude.Maybe DedicatedIp)
getDedicatedIpResponse_dedicatedIp :: Lens' GetDedicatedIpResponse (Maybe DedicatedIp)
getDedicatedIpResponse_dedicatedIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDedicatedIpResponse' {Maybe DedicatedIp
dedicatedIp :: Maybe DedicatedIp
$sel:dedicatedIp:GetDedicatedIpResponse' :: GetDedicatedIpResponse -> Maybe DedicatedIp
dedicatedIp} -> Maybe DedicatedIp
dedicatedIp) (\s :: GetDedicatedIpResponse
s@GetDedicatedIpResponse' {} Maybe DedicatedIp
a -> GetDedicatedIpResponse
s {$sel:dedicatedIp:GetDedicatedIpResponse' :: Maybe DedicatedIp
dedicatedIp = Maybe DedicatedIp
a} :: GetDedicatedIpResponse)
getDedicatedIpResponse_httpStatus :: Lens.Lens' GetDedicatedIpResponse Prelude.Int
getDedicatedIpResponse_httpStatus :: Lens' GetDedicatedIpResponse Int
getDedicatedIpResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDedicatedIpResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDedicatedIpResponse' :: GetDedicatedIpResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDedicatedIpResponse
s@GetDedicatedIpResponse' {} Int
a -> GetDedicatedIpResponse
s {$sel:httpStatus:GetDedicatedIpResponse' :: Int
httpStatus = Int
a} :: GetDedicatedIpResponse)
instance Prelude.NFData GetDedicatedIpResponse where
rnf :: GetDedicatedIpResponse -> ()
rnf GetDedicatedIpResponse' {Int
Maybe DedicatedIp
httpStatus :: Int
dedicatedIp :: Maybe DedicatedIp
$sel:httpStatus:GetDedicatedIpResponse' :: GetDedicatedIpResponse -> Int
$sel:dedicatedIp:GetDedicatedIpResponse' :: GetDedicatedIpResponse -> Maybe DedicatedIp
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DedicatedIp
dedicatedIp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus