{-# 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.PutEmailIdentityMailFromAttributes
(
PutEmailIdentityMailFromAttributes (..),
newPutEmailIdentityMailFromAttributes,
putEmailIdentityMailFromAttributes_behaviorOnMxFailure,
putEmailIdentityMailFromAttributes_mailFromDomain,
putEmailIdentityMailFromAttributes_emailIdentity,
PutEmailIdentityMailFromAttributesResponse (..),
newPutEmailIdentityMailFromAttributesResponse,
putEmailIdentityMailFromAttributesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SESV2.Types
data PutEmailIdentityMailFromAttributes = PutEmailIdentityMailFromAttributes'
{
PutEmailIdentityMailFromAttributes -> Maybe BehaviorOnMxFailure
behaviorOnMxFailure :: Prelude.Maybe BehaviorOnMxFailure,
PutEmailIdentityMailFromAttributes -> Maybe Text
mailFromDomain :: Prelude.Maybe Prelude.Text,
PutEmailIdentityMailFromAttributes -> Text
emailIdentity :: Prelude.Text
}
deriving (PutEmailIdentityMailFromAttributes
-> PutEmailIdentityMailFromAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutEmailIdentityMailFromAttributes
-> PutEmailIdentityMailFromAttributes -> Bool
$c/= :: PutEmailIdentityMailFromAttributes
-> PutEmailIdentityMailFromAttributes -> Bool
== :: PutEmailIdentityMailFromAttributes
-> PutEmailIdentityMailFromAttributes -> Bool
$c== :: PutEmailIdentityMailFromAttributes
-> PutEmailIdentityMailFromAttributes -> Bool
Prelude.Eq, ReadPrec [PutEmailIdentityMailFromAttributes]
ReadPrec PutEmailIdentityMailFromAttributes
Int -> ReadS PutEmailIdentityMailFromAttributes
ReadS [PutEmailIdentityMailFromAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutEmailIdentityMailFromAttributes]
$creadListPrec :: ReadPrec [PutEmailIdentityMailFromAttributes]
readPrec :: ReadPrec PutEmailIdentityMailFromAttributes
$creadPrec :: ReadPrec PutEmailIdentityMailFromAttributes
readList :: ReadS [PutEmailIdentityMailFromAttributes]
$creadList :: ReadS [PutEmailIdentityMailFromAttributes]
readsPrec :: Int -> ReadS PutEmailIdentityMailFromAttributes
$creadsPrec :: Int -> ReadS PutEmailIdentityMailFromAttributes
Prelude.Read, Int -> PutEmailIdentityMailFromAttributes -> ShowS
[PutEmailIdentityMailFromAttributes] -> ShowS
PutEmailIdentityMailFromAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutEmailIdentityMailFromAttributes] -> ShowS
$cshowList :: [PutEmailIdentityMailFromAttributes] -> ShowS
show :: PutEmailIdentityMailFromAttributes -> String
$cshow :: PutEmailIdentityMailFromAttributes -> String
showsPrec :: Int -> PutEmailIdentityMailFromAttributes -> ShowS
$cshowsPrec :: Int -> PutEmailIdentityMailFromAttributes -> ShowS
Prelude.Show, forall x.
Rep PutEmailIdentityMailFromAttributes x
-> PutEmailIdentityMailFromAttributes
forall x.
PutEmailIdentityMailFromAttributes
-> Rep PutEmailIdentityMailFromAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutEmailIdentityMailFromAttributes x
-> PutEmailIdentityMailFromAttributes
$cfrom :: forall x.
PutEmailIdentityMailFromAttributes
-> Rep PutEmailIdentityMailFromAttributes x
Prelude.Generic)
newPutEmailIdentityMailFromAttributes ::
Prelude.Text ->
PutEmailIdentityMailFromAttributes
newPutEmailIdentityMailFromAttributes :: Text -> PutEmailIdentityMailFromAttributes
newPutEmailIdentityMailFromAttributes Text
pEmailIdentity_ =
PutEmailIdentityMailFromAttributes'
{ $sel:behaviorOnMxFailure:PutEmailIdentityMailFromAttributes' :: Maybe BehaviorOnMxFailure
behaviorOnMxFailure =
forall a. Maybe a
Prelude.Nothing,
$sel:mailFromDomain:PutEmailIdentityMailFromAttributes' :: Maybe Text
mailFromDomain = forall a. Maybe a
Prelude.Nothing,
$sel:emailIdentity:PutEmailIdentityMailFromAttributes' :: Text
emailIdentity = Text
pEmailIdentity_
}
putEmailIdentityMailFromAttributes_behaviorOnMxFailure :: Lens.Lens' PutEmailIdentityMailFromAttributes (Prelude.Maybe BehaviorOnMxFailure)
putEmailIdentityMailFromAttributes_behaviorOnMxFailure :: Lens'
PutEmailIdentityMailFromAttributes (Maybe BehaviorOnMxFailure)
putEmailIdentityMailFromAttributes_behaviorOnMxFailure = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEmailIdentityMailFromAttributes' {Maybe BehaviorOnMxFailure
behaviorOnMxFailure :: Maybe BehaviorOnMxFailure
$sel:behaviorOnMxFailure:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Maybe BehaviorOnMxFailure
behaviorOnMxFailure} -> Maybe BehaviorOnMxFailure
behaviorOnMxFailure) (\s :: PutEmailIdentityMailFromAttributes
s@PutEmailIdentityMailFromAttributes' {} Maybe BehaviorOnMxFailure
a -> PutEmailIdentityMailFromAttributes
s {$sel:behaviorOnMxFailure:PutEmailIdentityMailFromAttributes' :: Maybe BehaviorOnMxFailure
behaviorOnMxFailure = Maybe BehaviorOnMxFailure
a} :: PutEmailIdentityMailFromAttributes)
putEmailIdentityMailFromAttributes_mailFromDomain :: Lens.Lens' PutEmailIdentityMailFromAttributes (Prelude.Maybe Prelude.Text)
putEmailIdentityMailFromAttributes_mailFromDomain :: Lens' PutEmailIdentityMailFromAttributes (Maybe Text)
putEmailIdentityMailFromAttributes_mailFromDomain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEmailIdentityMailFromAttributes' {Maybe Text
mailFromDomain :: Maybe Text
$sel:mailFromDomain:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Maybe Text
mailFromDomain} -> Maybe Text
mailFromDomain) (\s :: PutEmailIdentityMailFromAttributes
s@PutEmailIdentityMailFromAttributes' {} Maybe Text
a -> PutEmailIdentityMailFromAttributes
s {$sel:mailFromDomain:PutEmailIdentityMailFromAttributes' :: Maybe Text
mailFromDomain = Maybe Text
a} :: PutEmailIdentityMailFromAttributes)
putEmailIdentityMailFromAttributes_emailIdentity :: Lens.Lens' PutEmailIdentityMailFromAttributes Prelude.Text
putEmailIdentityMailFromAttributes_emailIdentity :: Lens' PutEmailIdentityMailFromAttributes Text
putEmailIdentityMailFromAttributes_emailIdentity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEmailIdentityMailFromAttributes' {Text
emailIdentity :: Text
$sel:emailIdentity:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Text
emailIdentity} -> Text
emailIdentity) (\s :: PutEmailIdentityMailFromAttributes
s@PutEmailIdentityMailFromAttributes' {} Text
a -> PutEmailIdentityMailFromAttributes
s {$sel:emailIdentity:PutEmailIdentityMailFromAttributes' :: Text
emailIdentity = Text
a} :: PutEmailIdentityMailFromAttributes)
instance
Core.AWSRequest
PutEmailIdentityMailFromAttributes
where
type
AWSResponse PutEmailIdentityMailFromAttributes =
PutEmailIdentityMailFromAttributesResponse
request :: (Service -> Service)
-> PutEmailIdentityMailFromAttributes
-> Request PutEmailIdentityMailFromAttributes
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 PutEmailIdentityMailFromAttributes
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutEmailIdentityMailFromAttributes)))
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 -> PutEmailIdentityMailFromAttributesResponse
PutEmailIdentityMailFromAttributesResponse'
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
PutEmailIdentityMailFromAttributes
where
hashWithSalt :: Int -> PutEmailIdentityMailFromAttributes -> Int
hashWithSalt
Int
_salt
PutEmailIdentityMailFromAttributes' {Maybe Text
Maybe BehaviorOnMxFailure
Text
emailIdentity :: Text
mailFromDomain :: Maybe Text
behaviorOnMxFailure :: Maybe BehaviorOnMxFailure
$sel:emailIdentity:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Text
$sel:mailFromDomain:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Maybe Text
$sel:behaviorOnMxFailure:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Maybe BehaviorOnMxFailure
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BehaviorOnMxFailure
behaviorOnMxFailure
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
mailFromDomain
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
emailIdentity
instance
Prelude.NFData
PutEmailIdentityMailFromAttributes
where
rnf :: PutEmailIdentityMailFromAttributes -> ()
rnf PutEmailIdentityMailFromAttributes' {Maybe Text
Maybe BehaviorOnMxFailure
Text
emailIdentity :: Text
mailFromDomain :: Maybe Text
behaviorOnMxFailure :: Maybe BehaviorOnMxFailure
$sel:emailIdentity:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Text
$sel:mailFromDomain:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Maybe Text
$sel:behaviorOnMxFailure:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Maybe BehaviorOnMxFailure
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe BehaviorOnMxFailure
behaviorOnMxFailure
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
mailFromDomain
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
emailIdentity
instance
Data.ToHeaders
PutEmailIdentityMailFromAttributes
where
toHeaders :: PutEmailIdentityMailFromAttributes -> 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
PutEmailIdentityMailFromAttributes
where
toJSON :: PutEmailIdentityMailFromAttributes -> Value
toJSON PutEmailIdentityMailFromAttributes' {Maybe Text
Maybe BehaviorOnMxFailure
Text
emailIdentity :: Text
mailFromDomain :: Maybe Text
behaviorOnMxFailure :: Maybe BehaviorOnMxFailure
$sel:emailIdentity:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Text
$sel:mailFromDomain:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Maybe Text
$sel:behaviorOnMxFailure:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Maybe BehaviorOnMxFailure
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BehaviorOnMxFailure" 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 BehaviorOnMxFailure
behaviorOnMxFailure,
(Key
"MailFromDomain" 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 Text
mailFromDomain
]
)
instance
Data.ToPath
PutEmailIdentityMailFromAttributes
where
toPath :: PutEmailIdentityMailFromAttributes -> ByteString
toPath PutEmailIdentityMailFromAttributes' {Maybe Text
Maybe BehaviorOnMxFailure
Text
emailIdentity :: Text
mailFromDomain :: Maybe Text
behaviorOnMxFailure :: Maybe BehaviorOnMxFailure
$sel:emailIdentity:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Text
$sel:mailFromDomain:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Maybe Text
$sel:behaviorOnMxFailure:PutEmailIdentityMailFromAttributes' :: PutEmailIdentityMailFromAttributes -> Maybe BehaviorOnMxFailure
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v2/email/identities/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
emailIdentity,
ByteString
"/mail-from"
]
instance
Data.ToQuery
PutEmailIdentityMailFromAttributes
where
toQuery :: PutEmailIdentityMailFromAttributes -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutEmailIdentityMailFromAttributesResponse = PutEmailIdentityMailFromAttributesResponse'
{
PutEmailIdentityMailFromAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutEmailIdentityMailFromAttributesResponse
-> PutEmailIdentityMailFromAttributesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutEmailIdentityMailFromAttributesResponse
-> PutEmailIdentityMailFromAttributesResponse -> Bool
$c/= :: PutEmailIdentityMailFromAttributesResponse
-> PutEmailIdentityMailFromAttributesResponse -> Bool
== :: PutEmailIdentityMailFromAttributesResponse
-> PutEmailIdentityMailFromAttributesResponse -> Bool
$c== :: PutEmailIdentityMailFromAttributesResponse
-> PutEmailIdentityMailFromAttributesResponse -> Bool
Prelude.Eq, ReadPrec [PutEmailIdentityMailFromAttributesResponse]
ReadPrec PutEmailIdentityMailFromAttributesResponse
Int -> ReadS PutEmailIdentityMailFromAttributesResponse
ReadS [PutEmailIdentityMailFromAttributesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutEmailIdentityMailFromAttributesResponse]
$creadListPrec :: ReadPrec [PutEmailIdentityMailFromAttributesResponse]
readPrec :: ReadPrec PutEmailIdentityMailFromAttributesResponse
$creadPrec :: ReadPrec PutEmailIdentityMailFromAttributesResponse
readList :: ReadS [PutEmailIdentityMailFromAttributesResponse]
$creadList :: ReadS [PutEmailIdentityMailFromAttributesResponse]
readsPrec :: Int -> ReadS PutEmailIdentityMailFromAttributesResponse
$creadsPrec :: Int -> ReadS PutEmailIdentityMailFromAttributesResponse
Prelude.Read, Int -> PutEmailIdentityMailFromAttributesResponse -> ShowS
[PutEmailIdentityMailFromAttributesResponse] -> ShowS
PutEmailIdentityMailFromAttributesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutEmailIdentityMailFromAttributesResponse] -> ShowS
$cshowList :: [PutEmailIdentityMailFromAttributesResponse] -> ShowS
show :: PutEmailIdentityMailFromAttributesResponse -> String
$cshow :: PutEmailIdentityMailFromAttributesResponse -> String
showsPrec :: Int -> PutEmailIdentityMailFromAttributesResponse -> ShowS
$cshowsPrec :: Int -> PutEmailIdentityMailFromAttributesResponse -> ShowS
Prelude.Show, forall x.
Rep PutEmailIdentityMailFromAttributesResponse x
-> PutEmailIdentityMailFromAttributesResponse
forall x.
PutEmailIdentityMailFromAttributesResponse
-> Rep PutEmailIdentityMailFromAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutEmailIdentityMailFromAttributesResponse x
-> PutEmailIdentityMailFromAttributesResponse
$cfrom :: forall x.
PutEmailIdentityMailFromAttributesResponse
-> Rep PutEmailIdentityMailFromAttributesResponse x
Prelude.Generic)
newPutEmailIdentityMailFromAttributesResponse ::
Prelude.Int ->
PutEmailIdentityMailFromAttributesResponse
newPutEmailIdentityMailFromAttributesResponse :: Int -> PutEmailIdentityMailFromAttributesResponse
newPutEmailIdentityMailFromAttributesResponse
Int
pHttpStatus_ =
PutEmailIdentityMailFromAttributesResponse'
{ $sel:httpStatus:PutEmailIdentityMailFromAttributesResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putEmailIdentityMailFromAttributesResponse_httpStatus :: Lens.Lens' PutEmailIdentityMailFromAttributesResponse Prelude.Int
putEmailIdentityMailFromAttributesResponse_httpStatus :: Lens' PutEmailIdentityMailFromAttributesResponse Int
putEmailIdentityMailFromAttributesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEmailIdentityMailFromAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutEmailIdentityMailFromAttributesResponse' :: PutEmailIdentityMailFromAttributesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutEmailIdentityMailFromAttributesResponse
s@PutEmailIdentityMailFromAttributesResponse' {} Int
a -> PutEmailIdentityMailFromAttributesResponse
s {$sel:httpStatus:PutEmailIdentityMailFromAttributesResponse' :: Int
httpStatus = Int
a} :: PutEmailIdentityMailFromAttributesResponse)
instance
Prelude.NFData
PutEmailIdentityMailFromAttributesResponse
where
rnf :: PutEmailIdentityMailFromAttributesResponse -> ()
rnf PutEmailIdentityMailFromAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutEmailIdentityMailFromAttributesResponse' :: PutEmailIdentityMailFromAttributesResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus