{-# 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.CreateDedicatedIpPool
(
CreateDedicatedIpPool (..),
newCreateDedicatedIpPool,
createDedicatedIpPool_tags,
createDedicatedIpPool_poolName,
CreateDedicatedIpPoolResponse (..),
newCreateDedicatedIpPoolResponse,
createDedicatedIpPoolResponse_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 CreateDedicatedIpPool = CreateDedicatedIpPool'
{
CreateDedicatedIpPool -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateDedicatedIpPool -> Text
poolName :: Prelude.Text
}
deriving (CreateDedicatedIpPool -> CreateDedicatedIpPool -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDedicatedIpPool -> CreateDedicatedIpPool -> Bool
$c/= :: CreateDedicatedIpPool -> CreateDedicatedIpPool -> Bool
== :: CreateDedicatedIpPool -> CreateDedicatedIpPool -> Bool
$c== :: CreateDedicatedIpPool -> CreateDedicatedIpPool -> Bool
Prelude.Eq, ReadPrec [CreateDedicatedIpPool]
ReadPrec CreateDedicatedIpPool
Int -> ReadS CreateDedicatedIpPool
ReadS [CreateDedicatedIpPool]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDedicatedIpPool]
$creadListPrec :: ReadPrec [CreateDedicatedIpPool]
readPrec :: ReadPrec CreateDedicatedIpPool
$creadPrec :: ReadPrec CreateDedicatedIpPool
readList :: ReadS [CreateDedicatedIpPool]
$creadList :: ReadS [CreateDedicatedIpPool]
readsPrec :: Int -> ReadS CreateDedicatedIpPool
$creadsPrec :: Int -> ReadS CreateDedicatedIpPool
Prelude.Read, Int -> CreateDedicatedIpPool -> ShowS
[CreateDedicatedIpPool] -> ShowS
CreateDedicatedIpPool -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDedicatedIpPool] -> ShowS
$cshowList :: [CreateDedicatedIpPool] -> ShowS
show :: CreateDedicatedIpPool -> String
$cshow :: CreateDedicatedIpPool -> String
showsPrec :: Int -> CreateDedicatedIpPool -> ShowS
$cshowsPrec :: Int -> CreateDedicatedIpPool -> ShowS
Prelude.Show, forall x. Rep CreateDedicatedIpPool x -> CreateDedicatedIpPool
forall x. CreateDedicatedIpPool -> Rep CreateDedicatedIpPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDedicatedIpPool x -> CreateDedicatedIpPool
$cfrom :: forall x. CreateDedicatedIpPool -> Rep CreateDedicatedIpPool x
Prelude.Generic)
newCreateDedicatedIpPool ::
Prelude.Text ->
CreateDedicatedIpPool
newCreateDedicatedIpPool :: Text -> CreateDedicatedIpPool
newCreateDedicatedIpPool Text
pPoolName_ =
CreateDedicatedIpPool'
{ $sel:tags:CreateDedicatedIpPool' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:poolName:CreateDedicatedIpPool' :: Text
poolName = Text
pPoolName_
}
createDedicatedIpPool_tags :: Lens.Lens' CreateDedicatedIpPool (Prelude.Maybe [Tag])
createDedicatedIpPool_tags :: Lens' CreateDedicatedIpPool (Maybe [Tag])
createDedicatedIpPool_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDedicatedIpPool' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateDedicatedIpPool' :: CreateDedicatedIpPool -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateDedicatedIpPool
s@CreateDedicatedIpPool' {} Maybe [Tag]
a -> CreateDedicatedIpPool
s {$sel:tags:CreateDedicatedIpPool' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateDedicatedIpPool) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDedicatedIpPool_poolName :: Lens.Lens' CreateDedicatedIpPool Prelude.Text
createDedicatedIpPool_poolName :: Lens' CreateDedicatedIpPool Text
createDedicatedIpPool_poolName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDedicatedIpPool' {Text
poolName :: Text
$sel:poolName:CreateDedicatedIpPool' :: CreateDedicatedIpPool -> Text
poolName} -> Text
poolName) (\s :: CreateDedicatedIpPool
s@CreateDedicatedIpPool' {} Text
a -> CreateDedicatedIpPool
s {$sel:poolName:CreateDedicatedIpPool' :: Text
poolName = Text
a} :: CreateDedicatedIpPool)
instance Core.AWSRequest CreateDedicatedIpPool where
type
AWSResponse CreateDedicatedIpPool =
CreateDedicatedIpPoolResponse
request :: (Service -> Service)
-> CreateDedicatedIpPool -> Request CreateDedicatedIpPool
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateDedicatedIpPool
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateDedicatedIpPool)))
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 -> CreateDedicatedIpPoolResponse
CreateDedicatedIpPoolResponse'
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 CreateDedicatedIpPool where
hashWithSalt :: Int -> CreateDedicatedIpPool -> Int
hashWithSalt Int
_salt CreateDedicatedIpPool' {Maybe [Tag]
Text
poolName :: Text
tags :: Maybe [Tag]
$sel:poolName:CreateDedicatedIpPool' :: CreateDedicatedIpPool -> Text
$sel:tags:CreateDedicatedIpPool' :: CreateDedicatedIpPool -> Maybe [Tag]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
poolName
instance Prelude.NFData CreateDedicatedIpPool where
rnf :: CreateDedicatedIpPool -> ()
rnf CreateDedicatedIpPool' {Maybe [Tag]
Text
poolName :: Text
tags :: Maybe [Tag]
$sel:poolName:CreateDedicatedIpPool' :: CreateDedicatedIpPool -> Text
$sel:tags:CreateDedicatedIpPool' :: CreateDedicatedIpPool -> Maybe [Tag]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
poolName
instance Data.ToHeaders CreateDedicatedIpPool where
toHeaders :: CreateDedicatedIpPool -> 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 CreateDedicatedIpPool where
toJSON :: CreateDedicatedIpPool -> Value
toJSON CreateDedicatedIpPool' {Maybe [Tag]
Text
poolName :: Text
tags :: Maybe [Tag]
$sel:poolName:CreateDedicatedIpPool' :: CreateDedicatedIpPool -> Text
$sel:tags:CreateDedicatedIpPool' :: CreateDedicatedIpPool -> Maybe [Tag]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
forall a. a -> Maybe a
Prelude.Just (Key
"PoolName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
poolName)
]
)
instance Data.ToPath CreateDedicatedIpPool where
toPath :: CreateDedicatedIpPool -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/v1/email/dedicated-ip-pools"
instance Data.ToQuery CreateDedicatedIpPool where
toQuery :: CreateDedicatedIpPool -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateDedicatedIpPoolResponse = CreateDedicatedIpPoolResponse'
{
CreateDedicatedIpPoolResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateDedicatedIpPoolResponse
-> CreateDedicatedIpPoolResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDedicatedIpPoolResponse
-> CreateDedicatedIpPoolResponse -> Bool
$c/= :: CreateDedicatedIpPoolResponse
-> CreateDedicatedIpPoolResponse -> Bool
== :: CreateDedicatedIpPoolResponse
-> CreateDedicatedIpPoolResponse -> Bool
$c== :: CreateDedicatedIpPoolResponse
-> CreateDedicatedIpPoolResponse -> Bool
Prelude.Eq, ReadPrec [CreateDedicatedIpPoolResponse]
ReadPrec CreateDedicatedIpPoolResponse
Int -> ReadS CreateDedicatedIpPoolResponse
ReadS [CreateDedicatedIpPoolResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDedicatedIpPoolResponse]
$creadListPrec :: ReadPrec [CreateDedicatedIpPoolResponse]
readPrec :: ReadPrec CreateDedicatedIpPoolResponse
$creadPrec :: ReadPrec CreateDedicatedIpPoolResponse
readList :: ReadS [CreateDedicatedIpPoolResponse]
$creadList :: ReadS [CreateDedicatedIpPoolResponse]
readsPrec :: Int -> ReadS CreateDedicatedIpPoolResponse
$creadsPrec :: Int -> ReadS CreateDedicatedIpPoolResponse
Prelude.Read, Int -> CreateDedicatedIpPoolResponse -> ShowS
[CreateDedicatedIpPoolResponse] -> ShowS
CreateDedicatedIpPoolResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDedicatedIpPoolResponse] -> ShowS
$cshowList :: [CreateDedicatedIpPoolResponse] -> ShowS
show :: CreateDedicatedIpPoolResponse -> String
$cshow :: CreateDedicatedIpPoolResponse -> String
showsPrec :: Int -> CreateDedicatedIpPoolResponse -> ShowS
$cshowsPrec :: Int -> CreateDedicatedIpPoolResponse -> ShowS
Prelude.Show, forall x.
Rep CreateDedicatedIpPoolResponse x
-> CreateDedicatedIpPoolResponse
forall x.
CreateDedicatedIpPoolResponse
-> Rep CreateDedicatedIpPoolResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDedicatedIpPoolResponse x
-> CreateDedicatedIpPoolResponse
$cfrom :: forall x.
CreateDedicatedIpPoolResponse
-> Rep CreateDedicatedIpPoolResponse x
Prelude.Generic)
newCreateDedicatedIpPoolResponse ::
Prelude.Int ->
CreateDedicatedIpPoolResponse
newCreateDedicatedIpPoolResponse :: Int -> CreateDedicatedIpPoolResponse
newCreateDedicatedIpPoolResponse Int
pHttpStatus_ =
CreateDedicatedIpPoolResponse'
{ $sel:httpStatus:CreateDedicatedIpPoolResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createDedicatedIpPoolResponse_httpStatus :: Lens.Lens' CreateDedicatedIpPoolResponse Prelude.Int
createDedicatedIpPoolResponse_httpStatus :: Lens' CreateDedicatedIpPoolResponse Int
createDedicatedIpPoolResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDedicatedIpPoolResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDedicatedIpPoolResponse' :: CreateDedicatedIpPoolResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDedicatedIpPoolResponse
s@CreateDedicatedIpPoolResponse' {} Int
a -> CreateDedicatedIpPoolResponse
s {$sel:httpStatus:CreateDedicatedIpPoolResponse' :: Int
httpStatus = Int
a} :: CreateDedicatedIpPoolResponse)
instance Prelude.NFData CreateDedicatedIpPoolResponse where
rnf :: CreateDedicatedIpPoolResponse -> ()
rnf CreateDedicatedIpPoolResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDedicatedIpPoolResponse' :: CreateDedicatedIpPoolResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus