{-# 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.PutDedicatedIpWarmupAttributes
(
PutDedicatedIpWarmupAttributes (..),
newPutDedicatedIpWarmupAttributes,
putDedicatedIpWarmupAttributes_ip,
putDedicatedIpWarmupAttributes_warmupPercentage,
PutDedicatedIpWarmupAttributesResponse (..),
newPutDedicatedIpWarmupAttributesResponse,
putDedicatedIpWarmupAttributesResponse_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 PutDedicatedIpWarmupAttributes = PutDedicatedIpWarmupAttributes'
{
PutDedicatedIpWarmupAttributes -> Text
ip :: Prelude.Text,
PutDedicatedIpWarmupAttributes -> Int
warmupPercentage :: Prelude.Int
}
deriving (PutDedicatedIpWarmupAttributes
-> PutDedicatedIpWarmupAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDedicatedIpWarmupAttributes
-> PutDedicatedIpWarmupAttributes -> Bool
$c/= :: PutDedicatedIpWarmupAttributes
-> PutDedicatedIpWarmupAttributes -> Bool
== :: PutDedicatedIpWarmupAttributes
-> PutDedicatedIpWarmupAttributes -> Bool
$c== :: PutDedicatedIpWarmupAttributes
-> PutDedicatedIpWarmupAttributes -> Bool
Prelude.Eq, ReadPrec [PutDedicatedIpWarmupAttributes]
ReadPrec PutDedicatedIpWarmupAttributes
Int -> ReadS PutDedicatedIpWarmupAttributes
ReadS [PutDedicatedIpWarmupAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDedicatedIpWarmupAttributes]
$creadListPrec :: ReadPrec [PutDedicatedIpWarmupAttributes]
readPrec :: ReadPrec PutDedicatedIpWarmupAttributes
$creadPrec :: ReadPrec PutDedicatedIpWarmupAttributes
readList :: ReadS [PutDedicatedIpWarmupAttributes]
$creadList :: ReadS [PutDedicatedIpWarmupAttributes]
readsPrec :: Int -> ReadS PutDedicatedIpWarmupAttributes
$creadsPrec :: Int -> ReadS PutDedicatedIpWarmupAttributes
Prelude.Read, Int -> PutDedicatedIpWarmupAttributes -> ShowS
[PutDedicatedIpWarmupAttributes] -> ShowS
PutDedicatedIpWarmupAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDedicatedIpWarmupAttributes] -> ShowS
$cshowList :: [PutDedicatedIpWarmupAttributes] -> ShowS
show :: PutDedicatedIpWarmupAttributes -> String
$cshow :: PutDedicatedIpWarmupAttributes -> String
showsPrec :: Int -> PutDedicatedIpWarmupAttributes -> ShowS
$cshowsPrec :: Int -> PutDedicatedIpWarmupAttributes -> ShowS
Prelude.Show, forall x.
Rep PutDedicatedIpWarmupAttributes x
-> PutDedicatedIpWarmupAttributes
forall x.
PutDedicatedIpWarmupAttributes
-> Rep PutDedicatedIpWarmupAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutDedicatedIpWarmupAttributes x
-> PutDedicatedIpWarmupAttributes
$cfrom :: forall x.
PutDedicatedIpWarmupAttributes
-> Rep PutDedicatedIpWarmupAttributes x
Prelude.Generic)
newPutDedicatedIpWarmupAttributes ::
Prelude.Text ->
Prelude.Int ->
PutDedicatedIpWarmupAttributes
newPutDedicatedIpWarmupAttributes :: Text -> Int -> PutDedicatedIpWarmupAttributes
newPutDedicatedIpWarmupAttributes
Text
pIp_
Int
pWarmupPercentage_ =
PutDedicatedIpWarmupAttributes'
{ $sel:ip:PutDedicatedIpWarmupAttributes' :: Text
ip = Text
pIp_,
$sel:warmupPercentage:PutDedicatedIpWarmupAttributes' :: Int
warmupPercentage = Int
pWarmupPercentage_
}
putDedicatedIpWarmupAttributes_ip :: Lens.Lens' PutDedicatedIpWarmupAttributes Prelude.Text
putDedicatedIpWarmupAttributes_ip :: Lens' PutDedicatedIpWarmupAttributes Text
putDedicatedIpWarmupAttributes_ip = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDedicatedIpWarmupAttributes' {Text
ip :: Text
$sel:ip:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> Text
ip} -> Text
ip) (\s :: PutDedicatedIpWarmupAttributes
s@PutDedicatedIpWarmupAttributes' {} Text
a -> PutDedicatedIpWarmupAttributes
s {$sel:ip:PutDedicatedIpWarmupAttributes' :: Text
ip = Text
a} :: PutDedicatedIpWarmupAttributes)
putDedicatedIpWarmupAttributes_warmupPercentage :: Lens.Lens' PutDedicatedIpWarmupAttributes Prelude.Int
putDedicatedIpWarmupAttributes_warmupPercentage :: Lens' PutDedicatedIpWarmupAttributes Int
putDedicatedIpWarmupAttributes_warmupPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDedicatedIpWarmupAttributes' {Int
warmupPercentage :: Int
$sel:warmupPercentage:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> Int
warmupPercentage} -> Int
warmupPercentage) (\s :: PutDedicatedIpWarmupAttributes
s@PutDedicatedIpWarmupAttributes' {} Int
a -> PutDedicatedIpWarmupAttributes
s {$sel:warmupPercentage:PutDedicatedIpWarmupAttributes' :: Int
warmupPercentage = Int
a} :: PutDedicatedIpWarmupAttributes)
instance
Core.AWSRequest
PutDedicatedIpWarmupAttributes
where
type
AWSResponse PutDedicatedIpWarmupAttributes =
PutDedicatedIpWarmupAttributesResponse
request :: (Service -> Service)
-> PutDedicatedIpWarmupAttributes
-> Request PutDedicatedIpWarmupAttributes
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 PutDedicatedIpWarmupAttributes
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutDedicatedIpWarmupAttributes)))
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 -> PutDedicatedIpWarmupAttributesResponse
PutDedicatedIpWarmupAttributesResponse'
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
PutDedicatedIpWarmupAttributes
where
hashWithSalt :: Int -> PutDedicatedIpWarmupAttributes -> Int
hashWithSalt
Int
_salt
PutDedicatedIpWarmupAttributes' {Int
Text
warmupPercentage :: Int
ip :: Text
$sel:warmupPercentage:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> Int
$sel:ip:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ip
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
warmupPercentage
instance
Prelude.NFData
PutDedicatedIpWarmupAttributes
where
rnf :: PutDedicatedIpWarmupAttributes -> ()
rnf PutDedicatedIpWarmupAttributes' {Int
Text
warmupPercentage :: Int
ip :: Text
$sel:warmupPercentage:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> Int
$sel:ip:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> 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 Int
warmupPercentage
instance
Data.ToHeaders
PutDedicatedIpWarmupAttributes
where
toHeaders :: PutDedicatedIpWarmupAttributes -> 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 PutDedicatedIpWarmupAttributes where
toJSON :: PutDedicatedIpWarmupAttributes -> Value
toJSON PutDedicatedIpWarmupAttributes' {Int
Text
warmupPercentage :: Int
ip :: Text
$sel:warmupPercentage:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> Int
$sel:ip:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"WarmupPercentage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
warmupPercentage)
]
)
instance Data.ToPath PutDedicatedIpWarmupAttributes where
toPath :: PutDedicatedIpWarmupAttributes -> ByteString
toPath PutDedicatedIpWarmupAttributes' {Int
Text
warmupPercentage :: Int
ip :: Text
$sel:warmupPercentage:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> Int
$sel:ip:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> 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
"/warmup"]
instance Data.ToQuery PutDedicatedIpWarmupAttributes where
toQuery :: PutDedicatedIpWarmupAttributes -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutDedicatedIpWarmupAttributesResponse = PutDedicatedIpWarmupAttributesResponse'
{
PutDedicatedIpWarmupAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutDedicatedIpWarmupAttributesResponse
-> PutDedicatedIpWarmupAttributesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDedicatedIpWarmupAttributesResponse
-> PutDedicatedIpWarmupAttributesResponse -> Bool
$c/= :: PutDedicatedIpWarmupAttributesResponse
-> PutDedicatedIpWarmupAttributesResponse -> Bool
== :: PutDedicatedIpWarmupAttributesResponse
-> PutDedicatedIpWarmupAttributesResponse -> Bool
$c== :: PutDedicatedIpWarmupAttributesResponse
-> PutDedicatedIpWarmupAttributesResponse -> Bool
Prelude.Eq, ReadPrec [PutDedicatedIpWarmupAttributesResponse]
ReadPrec PutDedicatedIpWarmupAttributesResponse
Int -> ReadS PutDedicatedIpWarmupAttributesResponse
ReadS [PutDedicatedIpWarmupAttributesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDedicatedIpWarmupAttributesResponse]
$creadListPrec :: ReadPrec [PutDedicatedIpWarmupAttributesResponse]
readPrec :: ReadPrec PutDedicatedIpWarmupAttributesResponse
$creadPrec :: ReadPrec PutDedicatedIpWarmupAttributesResponse
readList :: ReadS [PutDedicatedIpWarmupAttributesResponse]
$creadList :: ReadS [PutDedicatedIpWarmupAttributesResponse]
readsPrec :: Int -> ReadS PutDedicatedIpWarmupAttributesResponse
$creadsPrec :: Int -> ReadS PutDedicatedIpWarmupAttributesResponse
Prelude.Read, Int -> PutDedicatedIpWarmupAttributesResponse -> ShowS
[PutDedicatedIpWarmupAttributesResponse] -> ShowS
PutDedicatedIpWarmupAttributesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDedicatedIpWarmupAttributesResponse] -> ShowS
$cshowList :: [PutDedicatedIpWarmupAttributesResponse] -> ShowS
show :: PutDedicatedIpWarmupAttributesResponse -> String
$cshow :: PutDedicatedIpWarmupAttributesResponse -> String
showsPrec :: Int -> PutDedicatedIpWarmupAttributesResponse -> ShowS
$cshowsPrec :: Int -> PutDedicatedIpWarmupAttributesResponse -> ShowS
Prelude.Show, forall x.
Rep PutDedicatedIpWarmupAttributesResponse x
-> PutDedicatedIpWarmupAttributesResponse
forall x.
PutDedicatedIpWarmupAttributesResponse
-> Rep PutDedicatedIpWarmupAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutDedicatedIpWarmupAttributesResponse x
-> PutDedicatedIpWarmupAttributesResponse
$cfrom :: forall x.
PutDedicatedIpWarmupAttributesResponse
-> Rep PutDedicatedIpWarmupAttributesResponse x
Prelude.Generic)
newPutDedicatedIpWarmupAttributesResponse ::
Prelude.Int ->
PutDedicatedIpWarmupAttributesResponse
newPutDedicatedIpWarmupAttributesResponse :: Int -> PutDedicatedIpWarmupAttributesResponse
newPutDedicatedIpWarmupAttributesResponse
Int
pHttpStatus_ =
PutDedicatedIpWarmupAttributesResponse'
{ $sel:httpStatus:PutDedicatedIpWarmupAttributesResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putDedicatedIpWarmupAttributesResponse_httpStatus :: Lens.Lens' PutDedicatedIpWarmupAttributesResponse Prelude.Int
putDedicatedIpWarmupAttributesResponse_httpStatus :: Lens' PutDedicatedIpWarmupAttributesResponse Int
putDedicatedIpWarmupAttributesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDedicatedIpWarmupAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutDedicatedIpWarmupAttributesResponse' :: PutDedicatedIpWarmupAttributesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutDedicatedIpWarmupAttributesResponse
s@PutDedicatedIpWarmupAttributesResponse' {} Int
a -> PutDedicatedIpWarmupAttributesResponse
s {$sel:httpStatus:PutDedicatedIpWarmupAttributesResponse' :: Int
httpStatus = Int
a} :: PutDedicatedIpWarmupAttributesResponse)
instance
Prelude.NFData
PutDedicatedIpWarmupAttributesResponse
where
rnf :: PutDedicatedIpWarmupAttributesResponse -> ()
rnf PutDedicatedIpWarmupAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutDedicatedIpWarmupAttributesResponse' :: PutDedicatedIpWarmupAttributesResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus