{-# 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.PutDedicatedIpWarmupAttributes
(
PutDedicatedIpWarmupAttributes (..),
newPutDedicatedIpWarmupAttributes,
putDedicatedIpWarmupAttributes_ip,
putDedicatedIpWarmupAttributes_warmupPercentage,
PutDedicatedIpWarmupAttributesResponse (..),
newPutDedicatedIpWarmupAttributesResponse,
putDedicatedIpWarmupAttributesResponse_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 PutDedicatedIpWarmupAttributes = PutDedicatedIpWarmupAttributes'
{
PutDedicatedIpWarmupAttributes -> Text
ip :: Prelude.Text,
PutDedicatedIpWarmupAttributes -> Int
warmupPercentage :: Prelude.Int
}
deriving (PutDedicatedIpWarmupAttributes
-> PutDedicatedIpWarmupAttributes -> Bool
(PutDedicatedIpWarmupAttributes
-> PutDedicatedIpWarmupAttributes -> Bool)
-> (PutDedicatedIpWarmupAttributes
-> PutDedicatedIpWarmupAttributes -> Bool)
-> Eq PutDedicatedIpWarmupAttributes
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]
(Int -> ReadS PutDedicatedIpWarmupAttributes)
-> ReadS [PutDedicatedIpWarmupAttributes]
-> ReadPrec PutDedicatedIpWarmupAttributes
-> ReadPrec [PutDedicatedIpWarmupAttributes]
-> Read 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
(Int -> PutDedicatedIpWarmupAttributes -> ShowS)
-> (PutDedicatedIpWarmupAttributes -> String)
-> ([PutDedicatedIpWarmupAttributes] -> ShowS)
-> Show PutDedicatedIpWarmupAttributes
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.
PutDedicatedIpWarmupAttributes
-> Rep PutDedicatedIpWarmupAttributes x)
-> (forall x.
Rep PutDedicatedIpWarmupAttributes x
-> PutDedicatedIpWarmupAttributes)
-> Generic PutDedicatedIpWarmupAttributes
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' :: Text -> Int -> PutDedicatedIpWarmupAttributes
PutDedicatedIpWarmupAttributes'
{ $sel:ip:PutDedicatedIpWarmupAttributes' :: Text
ip = Text
pIp_,
$sel:warmupPercentage:PutDedicatedIpWarmupAttributes' :: Int
warmupPercentage = Int
pWarmupPercentage_
}
putDedicatedIpWarmupAttributes_ip :: Lens.Lens' PutDedicatedIpWarmupAttributes Prelude.Text
putDedicatedIpWarmupAttributes_ip :: (Text -> f Text)
-> PutDedicatedIpWarmupAttributes
-> f PutDedicatedIpWarmupAttributes
putDedicatedIpWarmupAttributes_ip = (PutDedicatedIpWarmupAttributes -> Text)
-> (PutDedicatedIpWarmupAttributes
-> Text -> PutDedicatedIpWarmupAttributes)
-> Lens
PutDedicatedIpWarmupAttributes
PutDedicatedIpWarmupAttributes
Text
Text
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 :: (Int -> f Int)
-> PutDedicatedIpWarmupAttributes
-> f PutDedicatedIpWarmupAttributes
putDedicatedIpWarmupAttributes_warmupPercentage = (PutDedicatedIpWarmupAttributes -> Int)
-> (PutDedicatedIpWarmupAttributes
-> Int -> PutDedicatedIpWarmupAttributes)
-> Lens
PutDedicatedIpWarmupAttributes
PutDedicatedIpWarmupAttributes
Int
Int
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 :: PutDedicatedIpWarmupAttributes
-> Request PutDedicatedIpWarmupAttributes
request = Service
-> PutDedicatedIpWarmupAttributes
-> Request PutDedicatedIpWarmupAttributes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutDedicatedIpWarmupAttributes
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutDedicatedIpWarmupAttributes)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutDedicatedIpWarmupAttributes))
-> Logger
-> Service
-> Proxy PutDedicatedIpWarmupAttributes
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutDedicatedIpWarmupAttributes)))
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 -> PutDedicatedIpWarmupAttributesResponse
PutDedicatedIpWarmupAttributesResponse'
(Int -> PutDedicatedIpWarmupAttributesResponse)
-> Either String Int
-> Either String PutDedicatedIpWarmupAttributesResponse
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
PutDedicatedIpWarmupAttributes
instance
Prelude.NFData
PutDedicatedIpWarmupAttributes
instance
Core.ToHeaders
PutDedicatedIpWarmupAttributes
where
toHeaders :: PutDedicatedIpWarmupAttributes -> ResponseHeaders
toHeaders =
ResponseHeaders
-> PutDedicatedIpWarmupAttributes -> 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 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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"WarmupPercentage" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
warmupPercentage)
]
)
instance Core.ToPath PutDedicatedIpWarmupAttributes where
toPath :: PutDedicatedIpWarmupAttributes -> ByteString
toPath PutDedicatedIpWarmupAttributes' {Int
Text
warmupPercentage :: Int
ip :: Text
$sel:warmupPercentage:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> Int
$sel:ip:PutDedicatedIpWarmupAttributes' :: PutDedicatedIpWarmupAttributes -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v2/email/dedicated-ips/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
ip, ByteString
"/warmup"]
instance Core.ToQuery PutDedicatedIpWarmupAttributes where
toQuery :: PutDedicatedIpWarmupAttributes -> QueryString
toQuery = QueryString -> PutDedicatedIpWarmupAttributes -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutDedicatedIpWarmupAttributesResponse = PutDedicatedIpWarmupAttributesResponse'
{
PutDedicatedIpWarmupAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutDedicatedIpWarmupAttributesResponse
-> PutDedicatedIpWarmupAttributesResponse -> Bool
(PutDedicatedIpWarmupAttributesResponse
-> PutDedicatedIpWarmupAttributesResponse -> Bool)
-> (PutDedicatedIpWarmupAttributesResponse
-> PutDedicatedIpWarmupAttributesResponse -> Bool)
-> Eq PutDedicatedIpWarmupAttributesResponse
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]
(Int -> ReadS PutDedicatedIpWarmupAttributesResponse)
-> ReadS [PutDedicatedIpWarmupAttributesResponse]
-> ReadPrec PutDedicatedIpWarmupAttributesResponse
-> ReadPrec [PutDedicatedIpWarmupAttributesResponse]
-> Read 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
(Int -> PutDedicatedIpWarmupAttributesResponse -> ShowS)
-> (PutDedicatedIpWarmupAttributesResponse -> String)
-> ([PutDedicatedIpWarmupAttributesResponse] -> ShowS)
-> Show PutDedicatedIpWarmupAttributesResponse
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.
PutDedicatedIpWarmupAttributesResponse
-> Rep PutDedicatedIpWarmupAttributesResponse x)
-> (forall x.
Rep PutDedicatedIpWarmupAttributesResponse x
-> PutDedicatedIpWarmupAttributesResponse)
-> Generic PutDedicatedIpWarmupAttributesResponse
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' :: Int -> PutDedicatedIpWarmupAttributesResponse
PutDedicatedIpWarmupAttributesResponse'
{ $sel:httpStatus:PutDedicatedIpWarmupAttributesResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putDedicatedIpWarmupAttributesResponse_httpStatus :: Lens.Lens' PutDedicatedIpWarmupAttributesResponse Prelude.Int
putDedicatedIpWarmupAttributesResponse_httpStatus :: (Int -> f Int)
-> PutDedicatedIpWarmupAttributesResponse
-> f PutDedicatedIpWarmupAttributesResponse
putDedicatedIpWarmupAttributesResponse_httpStatus = (PutDedicatedIpWarmupAttributesResponse -> Int)
-> (PutDedicatedIpWarmupAttributesResponse
-> Int -> PutDedicatedIpWarmupAttributesResponse)
-> Lens
PutDedicatedIpWarmupAttributesResponse
PutDedicatedIpWarmupAttributesResponse
Int
Int
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