{-# 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.PutDedicatedIpInPool
(
PutDedicatedIpInPool (..),
newPutDedicatedIpInPool,
putDedicatedIpInPool_ip,
putDedicatedIpInPool_destinationPoolName,
PutDedicatedIpInPoolResponse (..),
newPutDedicatedIpInPoolResponse,
putDedicatedIpInPoolResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.PinpointEmail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutDedicatedIpInPool = PutDedicatedIpInPool'
{
PutDedicatedIpInPool -> Text
ip :: Prelude.Text,
PutDedicatedIpInPool -> Text
destinationPoolName :: Prelude.Text
}
deriving (PutDedicatedIpInPool -> PutDedicatedIpInPool -> Bool
(PutDedicatedIpInPool -> PutDedicatedIpInPool -> Bool)
-> (PutDedicatedIpInPool -> PutDedicatedIpInPool -> Bool)
-> Eq PutDedicatedIpInPool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDedicatedIpInPool -> PutDedicatedIpInPool -> Bool
$c/= :: PutDedicatedIpInPool -> PutDedicatedIpInPool -> Bool
== :: PutDedicatedIpInPool -> PutDedicatedIpInPool -> Bool
$c== :: PutDedicatedIpInPool -> PutDedicatedIpInPool -> Bool
Prelude.Eq, ReadPrec [PutDedicatedIpInPool]
ReadPrec PutDedicatedIpInPool
Int -> ReadS PutDedicatedIpInPool
ReadS [PutDedicatedIpInPool]
(Int -> ReadS PutDedicatedIpInPool)
-> ReadS [PutDedicatedIpInPool]
-> ReadPrec PutDedicatedIpInPool
-> ReadPrec [PutDedicatedIpInPool]
-> Read PutDedicatedIpInPool
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDedicatedIpInPool]
$creadListPrec :: ReadPrec [PutDedicatedIpInPool]
readPrec :: ReadPrec PutDedicatedIpInPool
$creadPrec :: ReadPrec PutDedicatedIpInPool
readList :: ReadS [PutDedicatedIpInPool]
$creadList :: ReadS [PutDedicatedIpInPool]
readsPrec :: Int -> ReadS PutDedicatedIpInPool
$creadsPrec :: Int -> ReadS PutDedicatedIpInPool
Prelude.Read, Int -> PutDedicatedIpInPool -> ShowS
[PutDedicatedIpInPool] -> ShowS
PutDedicatedIpInPool -> String
(Int -> PutDedicatedIpInPool -> ShowS)
-> (PutDedicatedIpInPool -> String)
-> ([PutDedicatedIpInPool] -> ShowS)
-> Show PutDedicatedIpInPool
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDedicatedIpInPool] -> ShowS
$cshowList :: [PutDedicatedIpInPool] -> ShowS
show :: PutDedicatedIpInPool -> String
$cshow :: PutDedicatedIpInPool -> String
showsPrec :: Int -> PutDedicatedIpInPool -> ShowS
$cshowsPrec :: Int -> PutDedicatedIpInPool -> ShowS
Prelude.Show, (forall x. PutDedicatedIpInPool -> Rep PutDedicatedIpInPool x)
-> (forall x. Rep PutDedicatedIpInPool x -> PutDedicatedIpInPool)
-> Generic PutDedicatedIpInPool
forall x. Rep PutDedicatedIpInPool x -> PutDedicatedIpInPool
forall x. PutDedicatedIpInPool -> Rep PutDedicatedIpInPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutDedicatedIpInPool x -> PutDedicatedIpInPool
$cfrom :: forall x. PutDedicatedIpInPool -> Rep PutDedicatedIpInPool x
Prelude.Generic)
newPutDedicatedIpInPool ::
Prelude.Text ->
Prelude.Text ->
PutDedicatedIpInPool
newPutDedicatedIpInPool :: Text -> Text -> PutDedicatedIpInPool
newPutDedicatedIpInPool Text
pIp_ Text
pDestinationPoolName_ =
PutDedicatedIpInPool' :: Text -> Text -> PutDedicatedIpInPool
PutDedicatedIpInPool'
{ $sel:ip:PutDedicatedIpInPool' :: Text
ip = Text
pIp_,
$sel:destinationPoolName:PutDedicatedIpInPool' :: Text
destinationPoolName = Text
pDestinationPoolName_
}
putDedicatedIpInPool_ip :: Lens.Lens' PutDedicatedIpInPool Prelude.Text
putDedicatedIpInPool_ip :: (Text -> f Text) -> PutDedicatedIpInPool -> f PutDedicatedIpInPool
putDedicatedIpInPool_ip = (PutDedicatedIpInPool -> Text)
-> (PutDedicatedIpInPool -> Text -> PutDedicatedIpInPool)
-> Lens PutDedicatedIpInPool PutDedicatedIpInPool Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDedicatedIpInPool' {Text
ip :: Text
$sel:ip:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
ip} -> Text
ip) (\s :: PutDedicatedIpInPool
s@PutDedicatedIpInPool' {} Text
a -> PutDedicatedIpInPool
s {$sel:ip:PutDedicatedIpInPool' :: Text
ip = Text
a} :: PutDedicatedIpInPool)
putDedicatedIpInPool_destinationPoolName :: Lens.Lens' PutDedicatedIpInPool Prelude.Text
putDedicatedIpInPool_destinationPoolName :: (Text -> f Text) -> PutDedicatedIpInPool -> f PutDedicatedIpInPool
putDedicatedIpInPool_destinationPoolName = (PutDedicatedIpInPool -> Text)
-> (PutDedicatedIpInPool -> Text -> PutDedicatedIpInPool)
-> Lens PutDedicatedIpInPool PutDedicatedIpInPool Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDedicatedIpInPool' {Text
destinationPoolName :: Text
$sel:destinationPoolName:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
destinationPoolName} -> Text
destinationPoolName) (\s :: PutDedicatedIpInPool
s@PutDedicatedIpInPool' {} Text
a -> PutDedicatedIpInPool
s {$sel:destinationPoolName:PutDedicatedIpInPool' :: Text
destinationPoolName = Text
a} :: PutDedicatedIpInPool)
instance Core.AWSRequest PutDedicatedIpInPool where
type
AWSResponse PutDedicatedIpInPool =
PutDedicatedIpInPoolResponse
request :: PutDedicatedIpInPool -> Request PutDedicatedIpInPool
request = Service -> PutDedicatedIpInPool -> Request PutDedicatedIpInPool
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutDedicatedIpInPool
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutDedicatedIpInPool)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutDedicatedIpInPool))
-> Logger
-> Service
-> Proxy PutDedicatedIpInPool
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutDedicatedIpInPool)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutDedicatedIpInPoolResponse
PutDedicatedIpInPoolResponse'
(Int -> PutDedicatedIpInPoolResponse)
-> Either String Int -> Either String PutDedicatedIpInPoolResponse
forall (f :: * -> *) a b. Functor 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 PutDedicatedIpInPool
instance Prelude.NFData PutDedicatedIpInPool
instance Core.ToHeaders PutDedicatedIpInPool where
toHeaders :: PutDedicatedIpInPool -> ResponseHeaders
toHeaders =
ResponseHeaders -> PutDedicatedIpInPool -> 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.ToJSON PutDedicatedIpInPool where
toJSON :: PutDedicatedIpInPool -> Value
toJSON PutDedicatedIpInPool' {Text
destinationPoolName :: Text
ip :: Text
$sel:destinationPoolName:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
$sel:ip:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DestinationPoolName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destinationPoolName)
]
)
instance Core.ToPath PutDedicatedIpInPool where
toPath :: PutDedicatedIpInPool -> ByteString
toPath PutDedicatedIpInPool' {Text
destinationPoolName :: Text
ip :: Text
$sel:destinationPoolName:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
$sel:ip:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/email/dedicated-ips/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
ip, ByteString
"/pool"]
instance Core.ToQuery PutDedicatedIpInPool where
toQuery :: PutDedicatedIpInPool -> QueryString
toQuery = QueryString -> PutDedicatedIpInPool -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutDedicatedIpInPoolResponse = PutDedicatedIpInPoolResponse'
{
PutDedicatedIpInPoolResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutDedicatedIpInPoolResponse
-> PutDedicatedIpInPoolResponse -> Bool
(PutDedicatedIpInPoolResponse
-> PutDedicatedIpInPoolResponse -> Bool)
-> (PutDedicatedIpInPoolResponse
-> PutDedicatedIpInPoolResponse -> Bool)
-> Eq PutDedicatedIpInPoolResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDedicatedIpInPoolResponse
-> PutDedicatedIpInPoolResponse -> Bool
$c/= :: PutDedicatedIpInPoolResponse
-> PutDedicatedIpInPoolResponse -> Bool
== :: PutDedicatedIpInPoolResponse
-> PutDedicatedIpInPoolResponse -> Bool
$c== :: PutDedicatedIpInPoolResponse
-> PutDedicatedIpInPoolResponse -> Bool
Prelude.Eq, ReadPrec [PutDedicatedIpInPoolResponse]
ReadPrec PutDedicatedIpInPoolResponse
Int -> ReadS PutDedicatedIpInPoolResponse
ReadS [PutDedicatedIpInPoolResponse]
(Int -> ReadS PutDedicatedIpInPoolResponse)
-> ReadS [PutDedicatedIpInPoolResponse]
-> ReadPrec PutDedicatedIpInPoolResponse
-> ReadPrec [PutDedicatedIpInPoolResponse]
-> Read PutDedicatedIpInPoolResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDedicatedIpInPoolResponse]
$creadListPrec :: ReadPrec [PutDedicatedIpInPoolResponse]
readPrec :: ReadPrec PutDedicatedIpInPoolResponse
$creadPrec :: ReadPrec PutDedicatedIpInPoolResponse
readList :: ReadS [PutDedicatedIpInPoolResponse]
$creadList :: ReadS [PutDedicatedIpInPoolResponse]
readsPrec :: Int -> ReadS PutDedicatedIpInPoolResponse
$creadsPrec :: Int -> ReadS PutDedicatedIpInPoolResponse
Prelude.Read, Int -> PutDedicatedIpInPoolResponse -> ShowS
[PutDedicatedIpInPoolResponse] -> ShowS
PutDedicatedIpInPoolResponse -> String
(Int -> PutDedicatedIpInPoolResponse -> ShowS)
-> (PutDedicatedIpInPoolResponse -> String)
-> ([PutDedicatedIpInPoolResponse] -> ShowS)
-> Show PutDedicatedIpInPoolResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDedicatedIpInPoolResponse] -> ShowS
$cshowList :: [PutDedicatedIpInPoolResponse] -> ShowS
show :: PutDedicatedIpInPoolResponse -> String
$cshow :: PutDedicatedIpInPoolResponse -> String
showsPrec :: Int -> PutDedicatedIpInPoolResponse -> ShowS
$cshowsPrec :: Int -> PutDedicatedIpInPoolResponse -> ShowS
Prelude.Show, (forall x.
PutDedicatedIpInPoolResponse -> Rep PutDedicatedIpInPoolResponse x)
-> (forall x.
Rep PutDedicatedIpInPoolResponse x -> PutDedicatedIpInPoolResponse)
-> Generic PutDedicatedIpInPoolResponse
forall x.
Rep PutDedicatedIpInPoolResponse x -> PutDedicatedIpInPoolResponse
forall x.
PutDedicatedIpInPoolResponse -> Rep PutDedicatedIpInPoolResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutDedicatedIpInPoolResponse x -> PutDedicatedIpInPoolResponse
$cfrom :: forall x.
PutDedicatedIpInPoolResponse -> Rep PutDedicatedIpInPoolResponse x
Prelude.Generic)
newPutDedicatedIpInPoolResponse ::
Prelude.Int ->
PutDedicatedIpInPoolResponse
newPutDedicatedIpInPoolResponse :: Int -> PutDedicatedIpInPoolResponse
newPutDedicatedIpInPoolResponse Int
pHttpStatus_ =
PutDedicatedIpInPoolResponse' :: Int -> PutDedicatedIpInPoolResponse
PutDedicatedIpInPoolResponse'
{ $sel:httpStatus:PutDedicatedIpInPoolResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putDedicatedIpInPoolResponse_httpStatus :: Lens.Lens' PutDedicatedIpInPoolResponse Prelude.Int
putDedicatedIpInPoolResponse_httpStatus :: (Int -> f Int)
-> PutDedicatedIpInPoolResponse -> f PutDedicatedIpInPoolResponse
putDedicatedIpInPoolResponse_httpStatus = (PutDedicatedIpInPoolResponse -> Int)
-> (PutDedicatedIpInPoolResponse
-> Int -> PutDedicatedIpInPoolResponse)
-> Lens
PutDedicatedIpInPoolResponse PutDedicatedIpInPoolResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDedicatedIpInPoolResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutDedicatedIpInPoolResponse' :: PutDedicatedIpInPoolResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutDedicatedIpInPoolResponse
s@PutDedicatedIpInPoolResponse' {} Int
a -> PutDedicatedIpInPoolResponse
s {$sel:httpStatus:PutDedicatedIpInPoolResponse' :: Int
httpStatus = Int
a} :: PutDedicatedIpInPoolResponse)
instance Prelude.NFData PutDedicatedIpInPoolResponse