{-# 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.PutEmailIdentityFeedbackAttributes
(
PutEmailIdentityFeedbackAttributes (..),
newPutEmailIdentityFeedbackAttributes,
putEmailIdentityFeedbackAttributes_emailForwardingEnabled,
putEmailIdentityFeedbackAttributes_emailIdentity,
PutEmailIdentityFeedbackAttributesResponse (..),
newPutEmailIdentityFeedbackAttributesResponse,
putEmailIdentityFeedbackAttributesResponse_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 PutEmailIdentityFeedbackAttributes = PutEmailIdentityFeedbackAttributes'
{
PutEmailIdentityFeedbackAttributes -> Maybe Bool
emailForwardingEnabled :: Prelude.Maybe Prelude.Bool,
PutEmailIdentityFeedbackAttributes -> Text
emailIdentity :: Prelude.Text
}
deriving (PutEmailIdentityFeedbackAttributes
-> PutEmailIdentityFeedbackAttributes -> Bool
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]
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
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.
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'
{ $sel:emailForwardingEnabled:PutEmailIdentityFeedbackAttributes' :: Maybe Bool
emailForwardingEnabled =
forall a. Maybe a
Prelude.Nothing,
$sel:emailIdentity:PutEmailIdentityFeedbackAttributes' :: Text
emailIdentity = Text
pEmailIdentity_
}
putEmailIdentityFeedbackAttributes_emailForwardingEnabled :: Lens.Lens' PutEmailIdentityFeedbackAttributes (Prelude.Maybe Prelude.Bool)
putEmailIdentityFeedbackAttributes_emailForwardingEnabled :: Lens' PutEmailIdentityFeedbackAttributes (Maybe Bool)
putEmailIdentityFeedbackAttributes_emailForwardingEnabled = 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 :: Lens' PutEmailIdentityFeedbackAttributes Text
putEmailIdentityFeedbackAttributes_emailIdentity = 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 :: (Service -> Service)
-> PutEmailIdentityFeedbackAttributes
-> Request PutEmailIdentityFeedbackAttributes
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 PutEmailIdentityFeedbackAttributes
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutEmailIdentityFeedbackAttributes)))
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 -> PutEmailIdentityFeedbackAttributesResponse
PutEmailIdentityFeedbackAttributesResponse'
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
PutEmailIdentityFeedbackAttributes
where
hashWithSalt :: Int -> PutEmailIdentityFeedbackAttributes -> Int
hashWithSalt
Int
_salt
PutEmailIdentityFeedbackAttributes' {Maybe Bool
Text
emailIdentity :: Text
emailForwardingEnabled :: Maybe Bool
$sel:emailIdentity:PutEmailIdentityFeedbackAttributes' :: PutEmailIdentityFeedbackAttributes -> Text
$sel:emailForwardingEnabled:PutEmailIdentityFeedbackAttributes' :: PutEmailIdentityFeedbackAttributes -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
emailForwardingEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
emailIdentity
instance
Prelude.NFData
PutEmailIdentityFeedbackAttributes
where
rnf :: PutEmailIdentityFeedbackAttributes -> ()
rnf PutEmailIdentityFeedbackAttributes' {Maybe Bool
Text
emailIdentity :: Text
emailForwardingEnabled :: Maybe Bool
$sel:emailIdentity:PutEmailIdentityFeedbackAttributes' :: PutEmailIdentityFeedbackAttributes -> Text
$sel:emailForwardingEnabled:PutEmailIdentityFeedbackAttributes' :: PutEmailIdentityFeedbackAttributes -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
emailForwardingEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
emailIdentity
instance
Data.ToHeaders
PutEmailIdentityFeedbackAttributes
where
toHeaders :: PutEmailIdentityFeedbackAttributes -> 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
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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"EmailForwardingEnabled" 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 Bool
emailForwardingEnabled
]
)
instance
Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/email/identities/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
emailIdentity,
ByteString
"/feedback"
]
instance
Data.ToQuery
PutEmailIdentityFeedbackAttributes
where
toQuery :: PutEmailIdentityFeedbackAttributes -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutEmailIdentityFeedbackAttributesResponse = PutEmailIdentityFeedbackAttributesResponse'
{
PutEmailIdentityFeedbackAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutEmailIdentityFeedbackAttributesResponse
-> PutEmailIdentityFeedbackAttributesResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:PutEmailIdentityFeedbackAttributesResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putEmailIdentityFeedbackAttributesResponse_httpStatus :: Lens.Lens' PutEmailIdentityFeedbackAttributesResponse Prelude.Int
putEmailIdentityFeedbackAttributesResponse_httpStatus :: Lens' PutEmailIdentityFeedbackAttributesResponse Int
putEmailIdentityFeedbackAttributesResponse_httpStatus = 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
where
rnf :: PutEmailIdentityFeedbackAttributesResponse -> ()
rnf PutEmailIdentityFeedbackAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutEmailIdentityFeedbackAttributesResponse' :: PutEmailIdentityFeedbackAttributesResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus