{-# 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.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 PutDedicatedIpInPool = PutDedicatedIpInPool'
{
PutDedicatedIpInPool -> Text
ip :: Prelude.Text,
PutDedicatedIpInPool -> Text
destinationPoolName :: Prelude.Text
}
deriving (PutDedicatedIpInPool -> PutDedicatedIpInPool -> Bool
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]
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
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. 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'
{ $sel:ip:PutDedicatedIpInPool' :: Text
ip = Text
pIp_,
$sel:destinationPoolName:PutDedicatedIpInPool' :: Text
destinationPoolName = Text
pDestinationPoolName_
}
putDedicatedIpInPool_ip :: Lens.Lens' PutDedicatedIpInPool Prelude.Text
putDedicatedIpInPool_ip :: Lens' PutDedicatedIpInPool Text
putDedicatedIpInPool_ip = 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 :: Lens' PutDedicatedIpInPool Text
putDedicatedIpInPool_destinationPoolName = 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 :: (Service -> Service)
-> PutDedicatedIpInPool -> Request PutDedicatedIpInPool
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutDedicatedIpInPool
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutDedicatedIpInPool)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutDedicatedIpInPoolResponse
PutDedicatedIpInPoolResponse'
forall (f :: * -> *) a b. Functor 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 PutDedicatedIpInPool where
hashWithSalt :: Int -> PutDedicatedIpInPool -> Int
hashWithSalt Int
_salt PutDedicatedIpInPool' {Text
destinationPoolName :: Text
ip :: Text
$sel:destinationPoolName:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
$sel:ip:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ip
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
destinationPoolName
instance Prelude.NFData PutDedicatedIpInPool where
rnf :: PutDedicatedIpInPool -> ()
rnf PutDedicatedIpInPool' {Text
destinationPoolName :: Text
ip :: Text
$sel:destinationPoolName:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
$sel:ip:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
ip
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
destinationPoolName
instance Data.ToHeaders PutDedicatedIpInPool where
toHeaders :: PutDedicatedIpInPool -> 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.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"DestinationPoolName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
destinationPoolName)
]
)
instance Data.ToPath PutDedicatedIpInPool where
toPath :: PutDedicatedIpInPool -> ByteString
toPath PutDedicatedIpInPool' {Text
destinationPoolName :: Text
ip :: Text
$sel:destinationPoolName:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
$sel:ip:PutDedicatedIpInPool' :: PutDedicatedIpInPool -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/email/dedicated-ips/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
ip, ByteString
"/pool"]
instance Data.ToQuery PutDedicatedIpInPool where
toQuery :: PutDedicatedIpInPool -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutDedicatedIpInPoolResponse = PutDedicatedIpInPoolResponse'
{
PutDedicatedIpInPoolResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutDedicatedIpInPoolResponse
-> PutDedicatedIpInPoolResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:PutDedicatedIpInPoolResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putDedicatedIpInPoolResponse_httpStatus :: Lens.Lens' PutDedicatedIpInPoolResponse Prelude.Int
putDedicatedIpInPoolResponse_httpStatus :: Lens' PutDedicatedIpInPoolResponse Int
putDedicatedIpInPoolResponse_httpStatus = 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 where
rnf :: PutDedicatedIpInPoolResponse -> ()
rnf PutDedicatedIpInPoolResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutDedicatedIpInPoolResponse' :: PutDedicatedIpInPoolResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus