{-# 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.PutEmailIdentityFeedbackAttributes
(
PutEmailIdentityFeedbackAttributes (..),
newPutEmailIdentityFeedbackAttributes,
putEmailIdentityFeedbackAttributes_emailForwardingEnabled,
putEmailIdentityFeedbackAttributes_emailIdentity,
PutEmailIdentityFeedbackAttributesResponse (..),
newPutEmailIdentityFeedbackAttributesResponse,
putEmailIdentityFeedbackAttributesResponse_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 PutEmailIdentityFeedbackAttributes = PutEmailIdentityFeedbackAttributes'
{
PutEmailIdentityFeedbackAttributes -> Maybe Bool
emailForwardingEnabled :: Prelude.Maybe Prelude.Bool,
PutEmailIdentityFeedbackAttributes -> Text
emailIdentity :: Prelude.Text
}
deriving (PutEmailIdentityFeedbackAttributes
-> PutEmailIdentityFeedbackAttributes -> Bool
(PutEmailIdentityFeedbackAttributes
-> PutEmailIdentityFeedbackAttributes -> Bool)
-> (PutEmailIdentityFeedbackAttributes
-> PutEmailIdentityFeedbackAttributes -> Bool)
-> Eq PutEmailIdentityFeedbackAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutEmailIdentityFeedbackAttributes
-> PutEmailIdentityFeedbackAttributes -> Bool
$c/= :: PutEmailIdentityFeedbackAttributes
-> PutEmailIdentityFeedbackAttributes -> Bool
== :: PutEmailIdentityFeedbackAttributes
-> PutEmailIdentityFeedbackAttributes -> Bool
$c== :: PutEmailIdentityFeedbackAttributes
-> PutEmailIdentityFeedbackAttributes -> Bool
Prelude.Eq, ReadPrec [PutEmailIdentityFeedbackAttributes]
ReadPrec PutEmailIdentityFeedbackAttributes
Int -> ReadS PutEmailIdentityFeedbackAttributes
ReadS [PutEmailIdentityFeedbackAttributes]
(Int -> ReadS PutEmailIdentityFeedbackAttributes)
-> ReadS [PutEmailIdentityFeedbackAttributes]
-> ReadPrec PutEmailIdentityFeedbackAttributes
-> ReadPrec [PutEmailIdentityFeedbackAttributes]
-> Read PutEmailIdentityFeedbackAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutEmailIdentityFeedbackAttributes]
$creadListPrec :: ReadPrec [PutEmailIdentityFeedbackAttributes]
readPrec :: ReadPrec PutEmailIdentityFeedbackAttributes
$creadPrec :: ReadPrec PutEmailIdentityFeedbackAttributes
readList :: ReadS [PutEmailIdentityFeedbackAttributes]
$creadList :: ReadS [PutEmailIdentityFeedbackAttributes]
readsPrec :: Int -> ReadS PutEmailIdentityFeedbackAttributes
$creadsPrec :: Int -> ReadS PutEmailIdentityFeedbackAttributes
Prelude.Read, Int -> PutEmailIdentityFeedbackAttributes -> ShowS
[PutEmailIdentityFeedbackAttributes] -> ShowS
PutEmailIdentityFeedbackAttributes -> String
(Int -> PutEmailIdentityFeedbackAttributes -> ShowS)
-> (PutEmailIdentityFeedbackAttributes -> String)
-> ([PutEmailIdentityFeedbackAttributes] -> ShowS)
-> Show PutEmailIdentityFeedbackAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutEmailIdentityFeedbackAttributes] -> ShowS
$cshowList :: [PutEmailIdentityFeedbackAttributes] -> ShowS
show :: PutEmailIdentityFeedbackAttributes -> String
$cshow :: PutEmailIdentityFeedbackAttributes -> String
showsPrec :: Int -> PutEmailIdentityFeedbackAttributes -> ShowS
$cshowsPrec :: Int -> PutEmailIdentityFeedbackAttributes -> ShowS
Prelude.Show, (forall x.
PutEmailIdentityFeedbackAttributes
-> Rep PutEmailIdentityFeedbackAttributes x)
-> (forall x.
Rep PutEmailIdentityFeedbackAttributes x
-> PutEmailIdentityFeedbackAttributes)
-> Generic PutEmailIdentityFeedbackAttributes
forall x.
Rep PutEmailIdentityFeedbackAttributes x
-> PutEmailIdentityFeedbackAttributes
forall x.
PutEmailIdentityFeedbackAttributes
-> Rep PutEmailIdentityFeedbackAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutEmailIdentityFeedbackAttributes x
-> PutEmailIdentityFeedbackAttributes
$cfrom :: forall x.
PutEmailIdentityFeedbackAttributes
-> Rep PutEmailIdentityFeedbackAttributes x
Prelude.Generic)
newPutEmailIdentityFeedbackAttributes ::
Prelude.Text ->
PutEmailIdentityFeedbackAttributes
newPutEmailIdentityFeedbackAttributes :: Text -> PutEmailIdentityFeedbackAttributes
newPutEmailIdentityFeedbackAttributes Text
pEmailIdentity_ =
PutEmailIdentityFeedbackAttributes' :: Maybe Bool -> Text -> PutEmailIdentityFeedbackAttributes
PutEmailIdentityFeedbackAttributes'
{ $sel:emailForwardingEnabled:PutEmailIdentityFeedbackAttributes' :: Maybe Bool
emailForwardingEnabled =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:emailIdentity:PutEmailIdentityFeedbackAttributes' :: Text
emailIdentity = Text
pEmailIdentity_
}
putEmailIdentityFeedbackAttributes_emailForwardingEnabled :: Lens.Lens' PutEmailIdentityFeedbackAttributes (Prelude.Maybe Prelude.Bool)
putEmailIdentityFeedbackAttributes_emailForwardingEnabled :: (Maybe Bool -> f (Maybe Bool))
-> PutEmailIdentityFeedbackAttributes
-> f PutEmailIdentityFeedbackAttributes
putEmailIdentityFeedbackAttributes_emailForwardingEnabled = (PutEmailIdentityFeedbackAttributes -> Maybe Bool)
-> (PutEmailIdentityFeedbackAttributes
-> Maybe Bool -> PutEmailIdentityFeedbackAttributes)
-> Lens
PutEmailIdentityFeedbackAttributes
PutEmailIdentityFeedbackAttributes
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEmailIdentityFeedbackAttributes' {Maybe Bool
emailForwardingEnabled :: Maybe Bool
$sel:emailForwardingEnabled:PutEmailIdentityFeedbackAttributes' :: PutEmailIdentityFeedbackAttributes -> Maybe Bool
emailForwardingEnabled} -> Maybe Bool
emailForwardingEnabled) (\s :: PutEmailIdentityFeedbackAttributes
s@PutEmailIdentityFeedbackAttributes' {} Maybe Bool
a -> PutEmailIdentityFeedbackAttributes
s {$sel:emailForwardingEnabled:PutEmailIdentityFeedbackAttributes' :: Maybe Bool
emailForwardingEnabled = Maybe Bool
a} :: PutEmailIdentityFeedbackAttributes)
putEmailIdentityFeedbackAttributes_emailIdentity :: Lens.Lens' PutEmailIdentityFeedbackAttributes Prelude.Text
putEmailIdentityFeedbackAttributes_emailIdentity :: (Text -> f Text)
-> PutEmailIdentityFeedbackAttributes
-> f PutEmailIdentityFeedbackAttributes
putEmailIdentityFeedbackAttributes_emailIdentity = (PutEmailIdentityFeedbackAttributes -> Text)
-> (PutEmailIdentityFeedbackAttributes
-> Text -> PutEmailIdentityFeedbackAttributes)
-> Lens
PutEmailIdentityFeedbackAttributes
PutEmailIdentityFeedbackAttributes
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEmailIdentityFeedbackAttributes' {Text
emailIdentity :: Text
$sel:emailIdentity:PutEmailIdentityFeedbackAttributes' :: PutEmailIdentityFeedbackAttributes -> Text
emailIdentity} -> Text
emailIdentity) (\s :: PutEmailIdentityFeedbackAttributes
s@PutEmailIdentityFeedbackAttributes' {} Text
a -> PutEmailIdentityFeedbackAttributes
s {$sel:emailIdentity:PutEmailIdentityFeedbackAttributes' :: Text
emailIdentity = Text
a} :: PutEmailIdentityFeedbackAttributes)
instance
Core.AWSRequest
PutEmailIdentityFeedbackAttributes
where
type
AWSResponse PutEmailIdentityFeedbackAttributes =
PutEmailIdentityFeedbackAttributesResponse
request :: PutEmailIdentityFeedbackAttributes
-> Request PutEmailIdentityFeedbackAttributes
request = Service
-> PutEmailIdentityFeedbackAttributes
-> Request PutEmailIdentityFeedbackAttributes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutEmailIdentityFeedbackAttributes
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutEmailIdentityFeedbackAttributes)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutEmailIdentityFeedbackAttributes))
-> Logger
-> Service
-> Proxy PutEmailIdentityFeedbackAttributes
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutEmailIdentityFeedbackAttributes)))
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 -> PutEmailIdentityFeedbackAttributesResponse
PutEmailIdentityFeedbackAttributesResponse'
(Int -> PutEmailIdentityFeedbackAttributesResponse)
-> Either String Int
-> Either String PutEmailIdentityFeedbackAttributesResponse
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
PutEmailIdentityFeedbackAttributes
instance
Prelude.NFData
PutEmailIdentityFeedbackAttributes
instance
Core.ToHeaders
PutEmailIdentityFeedbackAttributes
where
toHeaders :: PutEmailIdentityFeedbackAttributes -> ResponseHeaders
toHeaders =
ResponseHeaders
-> PutEmailIdentityFeedbackAttributes -> 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
PutEmailIdentityFeedbackAttributes
where
toJSON :: PutEmailIdentityFeedbackAttributes -> Value
toJSON PutEmailIdentityFeedbackAttributes' {Maybe Bool
Text
emailIdentity :: Text
emailForwardingEnabled :: Maybe Bool
$sel:emailIdentity:PutEmailIdentityFeedbackAttributes' :: PutEmailIdentityFeedbackAttributes -> Text
$sel:emailForwardingEnabled:PutEmailIdentityFeedbackAttributes' :: PutEmailIdentityFeedbackAttributes -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EmailForwardingEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
emailForwardingEnabled
]
)
instance
Core.ToPath
PutEmailIdentityFeedbackAttributes
where
toPath :: PutEmailIdentityFeedbackAttributes -> ByteString
toPath PutEmailIdentityFeedbackAttributes' {Maybe Bool
Text
emailIdentity :: Text
emailForwardingEnabled :: Maybe Bool
$sel:emailIdentity:PutEmailIdentityFeedbackAttributes' :: PutEmailIdentityFeedbackAttributes -> Text
$sel:emailForwardingEnabled:PutEmailIdentityFeedbackAttributes' :: PutEmailIdentityFeedbackAttributes -> Maybe Bool
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v2/email/identities/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
emailIdentity,
ByteString
"/feedback"
]
instance
Core.ToQuery
PutEmailIdentityFeedbackAttributes
where
toQuery :: PutEmailIdentityFeedbackAttributes -> QueryString
toQuery = QueryString -> PutEmailIdentityFeedbackAttributes -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutEmailIdentityFeedbackAttributesResponse = PutEmailIdentityFeedbackAttributesResponse'
{
PutEmailIdentityFeedbackAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutEmailIdentityFeedbackAttributesResponse
-> PutEmailIdentityFeedbackAttributesResponse -> Bool
(PutEmailIdentityFeedbackAttributesResponse
-> PutEmailIdentityFeedbackAttributesResponse -> Bool)
-> (PutEmailIdentityFeedbackAttributesResponse
-> PutEmailIdentityFeedbackAttributesResponse -> Bool)
-> Eq PutEmailIdentityFeedbackAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutEmailIdentityFeedbackAttributesResponse
-> PutEmailIdentityFeedbackAttributesResponse -> Bool
$c/= :: PutEmailIdentityFeedbackAttributesResponse
-> PutEmailIdentityFeedbackAttributesResponse -> Bool
== :: PutEmailIdentityFeedbackAttributesResponse
-> PutEmailIdentityFeedbackAttributesResponse -> Bool
$c== :: PutEmailIdentityFeedbackAttributesResponse
-> PutEmailIdentityFeedbackAttributesResponse -> Bool
Prelude.Eq, ReadPrec [PutEmailIdentityFeedbackAttributesResponse]
ReadPrec PutEmailIdentityFeedbackAttributesResponse
Int -> ReadS PutEmailIdentityFeedbackAttributesResponse
ReadS [PutEmailIdentityFeedbackAttributesResponse]
(Int -> ReadS PutEmailIdentityFeedbackAttributesResponse)
-> ReadS [PutEmailIdentityFeedbackAttributesResponse]
-> ReadPrec PutEmailIdentityFeedbackAttributesResponse
-> ReadPrec [PutEmailIdentityFeedbackAttributesResponse]
-> Read PutEmailIdentityFeedbackAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutEmailIdentityFeedbackAttributesResponse]
$creadListPrec :: ReadPrec [PutEmailIdentityFeedbackAttributesResponse]
readPrec :: ReadPrec PutEmailIdentityFeedbackAttributesResponse
$creadPrec :: ReadPrec PutEmailIdentityFeedbackAttributesResponse
readList :: ReadS [PutEmailIdentityFeedbackAttributesResponse]
$creadList :: ReadS [PutEmailIdentityFeedbackAttributesResponse]
readsPrec :: Int -> ReadS PutEmailIdentityFeedbackAttributesResponse
$creadsPrec :: Int -> ReadS PutEmailIdentityFeedbackAttributesResponse
Prelude.Read, Int -> PutEmailIdentityFeedbackAttributesResponse -> ShowS
[PutEmailIdentityFeedbackAttributesResponse] -> ShowS
PutEmailIdentityFeedbackAttributesResponse -> String
(Int -> PutEmailIdentityFeedbackAttributesResponse -> ShowS)
-> (PutEmailIdentityFeedbackAttributesResponse -> String)
-> ([PutEmailIdentityFeedbackAttributesResponse] -> ShowS)
-> Show PutEmailIdentityFeedbackAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutEmailIdentityFeedbackAttributesResponse] -> ShowS
$cshowList :: [PutEmailIdentityFeedbackAttributesResponse] -> ShowS
show :: PutEmailIdentityFeedbackAttributesResponse -> String
$cshow :: PutEmailIdentityFeedbackAttributesResponse -> String
showsPrec :: Int -> PutEmailIdentityFeedbackAttributesResponse -> ShowS
$cshowsPrec :: Int -> PutEmailIdentityFeedbackAttributesResponse -> ShowS
Prelude.Show, (forall x.
PutEmailIdentityFeedbackAttributesResponse
-> Rep PutEmailIdentityFeedbackAttributesResponse x)
-> (forall x.
Rep PutEmailIdentityFeedbackAttributesResponse x
-> PutEmailIdentityFeedbackAttributesResponse)
-> Generic PutEmailIdentityFeedbackAttributesResponse
forall x.
Rep PutEmailIdentityFeedbackAttributesResponse x
-> PutEmailIdentityFeedbackAttributesResponse
forall x.
PutEmailIdentityFeedbackAttributesResponse
-> Rep PutEmailIdentityFeedbackAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutEmailIdentityFeedbackAttributesResponse x
-> PutEmailIdentityFeedbackAttributesResponse
$cfrom :: forall x.
PutEmailIdentityFeedbackAttributesResponse
-> Rep PutEmailIdentityFeedbackAttributesResponse x
Prelude.Generic)
newPutEmailIdentityFeedbackAttributesResponse ::
Prelude.Int ->
PutEmailIdentityFeedbackAttributesResponse
newPutEmailIdentityFeedbackAttributesResponse :: Int -> PutEmailIdentityFeedbackAttributesResponse
newPutEmailIdentityFeedbackAttributesResponse
Int
pHttpStatus_ =
PutEmailIdentityFeedbackAttributesResponse' :: Int -> PutEmailIdentityFeedbackAttributesResponse
PutEmailIdentityFeedbackAttributesResponse'
{ $sel:httpStatus:PutEmailIdentityFeedbackAttributesResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putEmailIdentityFeedbackAttributesResponse_httpStatus :: Lens.Lens' PutEmailIdentityFeedbackAttributesResponse Prelude.Int
putEmailIdentityFeedbackAttributesResponse_httpStatus :: (Int -> f Int)
-> PutEmailIdentityFeedbackAttributesResponse
-> f PutEmailIdentityFeedbackAttributesResponse
putEmailIdentityFeedbackAttributesResponse_httpStatus = (PutEmailIdentityFeedbackAttributesResponse -> Int)
-> (PutEmailIdentityFeedbackAttributesResponse
-> Int -> PutEmailIdentityFeedbackAttributesResponse)
-> Lens
PutEmailIdentityFeedbackAttributesResponse
PutEmailIdentityFeedbackAttributesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEmailIdentityFeedbackAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutEmailIdentityFeedbackAttributesResponse' :: PutEmailIdentityFeedbackAttributesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutEmailIdentityFeedbackAttributesResponse
s@PutEmailIdentityFeedbackAttributesResponse' {} Int
a -> PutEmailIdentityFeedbackAttributesResponse
s {$sel:httpStatus:PutEmailIdentityFeedbackAttributesResponse' :: Int
httpStatus = Int
a} :: PutEmailIdentityFeedbackAttributesResponse)
instance
Prelude.NFData
PutEmailIdentityFeedbackAttributesResponse