{-# 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.UpdateEmailIdentityPolicy
(
UpdateEmailIdentityPolicy (..),
newUpdateEmailIdentityPolicy,
updateEmailIdentityPolicy_emailIdentity,
updateEmailIdentityPolicy_policyName,
updateEmailIdentityPolicy_policy,
UpdateEmailIdentityPolicyResponse (..),
newUpdateEmailIdentityPolicyResponse,
updateEmailIdentityPolicyResponse_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 UpdateEmailIdentityPolicy = UpdateEmailIdentityPolicy'
{
UpdateEmailIdentityPolicy -> Text
emailIdentity :: Prelude.Text,
UpdateEmailIdentityPolicy -> Text
policyName :: Prelude.Text,
UpdateEmailIdentityPolicy -> Text
policy :: Prelude.Text
}
deriving (UpdateEmailIdentityPolicy -> UpdateEmailIdentityPolicy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEmailIdentityPolicy -> UpdateEmailIdentityPolicy -> Bool
$c/= :: UpdateEmailIdentityPolicy -> UpdateEmailIdentityPolicy -> Bool
== :: UpdateEmailIdentityPolicy -> UpdateEmailIdentityPolicy -> Bool
$c== :: UpdateEmailIdentityPolicy -> UpdateEmailIdentityPolicy -> Bool
Prelude.Eq, ReadPrec [UpdateEmailIdentityPolicy]
ReadPrec UpdateEmailIdentityPolicy
Int -> ReadS UpdateEmailIdentityPolicy
ReadS [UpdateEmailIdentityPolicy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEmailIdentityPolicy]
$creadListPrec :: ReadPrec [UpdateEmailIdentityPolicy]
readPrec :: ReadPrec UpdateEmailIdentityPolicy
$creadPrec :: ReadPrec UpdateEmailIdentityPolicy
readList :: ReadS [UpdateEmailIdentityPolicy]
$creadList :: ReadS [UpdateEmailIdentityPolicy]
readsPrec :: Int -> ReadS UpdateEmailIdentityPolicy
$creadsPrec :: Int -> ReadS UpdateEmailIdentityPolicy
Prelude.Read, Int -> UpdateEmailIdentityPolicy -> ShowS
[UpdateEmailIdentityPolicy] -> ShowS
UpdateEmailIdentityPolicy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEmailIdentityPolicy] -> ShowS
$cshowList :: [UpdateEmailIdentityPolicy] -> ShowS
show :: UpdateEmailIdentityPolicy -> String
$cshow :: UpdateEmailIdentityPolicy -> String
showsPrec :: Int -> UpdateEmailIdentityPolicy -> ShowS
$cshowsPrec :: Int -> UpdateEmailIdentityPolicy -> ShowS
Prelude.Show, forall x.
Rep UpdateEmailIdentityPolicy x -> UpdateEmailIdentityPolicy
forall x.
UpdateEmailIdentityPolicy -> Rep UpdateEmailIdentityPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEmailIdentityPolicy x -> UpdateEmailIdentityPolicy
$cfrom :: forall x.
UpdateEmailIdentityPolicy -> Rep UpdateEmailIdentityPolicy x
Prelude.Generic)
newUpdateEmailIdentityPolicy ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
UpdateEmailIdentityPolicy
newUpdateEmailIdentityPolicy :: Text -> Text -> Text -> UpdateEmailIdentityPolicy
newUpdateEmailIdentityPolicy
Text
pEmailIdentity_
Text
pPolicyName_
Text
pPolicy_ =
UpdateEmailIdentityPolicy'
{ $sel:emailIdentity:UpdateEmailIdentityPolicy' :: Text
emailIdentity =
Text
pEmailIdentity_,
$sel:policyName:UpdateEmailIdentityPolicy' :: Text
policyName = Text
pPolicyName_,
$sel:policy:UpdateEmailIdentityPolicy' :: Text
policy = Text
pPolicy_
}
updateEmailIdentityPolicy_emailIdentity :: Lens.Lens' UpdateEmailIdentityPolicy Prelude.Text
updateEmailIdentityPolicy_emailIdentity :: Lens' UpdateEmailIdentityPolicy Text
updateEmailIdentityPolicy_emailIdentity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEmailIdentityPolicy' {Text
emailIdentity :: Text
$sel:emailIdentity:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
emailIdentity} -> Text
emailIdentity) (\s :: UpdateEmailIdentityPolicy
s@UpdateEmailIdentityPolicy' {} Text
a -> UpdateEmailIdentityPolicy
s {$sel:emailIdentity:UpdateEmailIdentityPolicy' :: Text
emailIdentity = Text
a} :: UpdateEmailIdentityPolicy)
updateEmailIdentityPolicy_policyName :: Lens.Lens' UpdateEmailIdentityPolicy Prelude.Text
updateEmailIdentityPolicy_policyName :: Lens' UpdateEmailIdentityPolicy Text
updateEmailIdentityPolicy_policyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEmailIdentityPolicy' {Text
policyName :: Text
$sel:policyName:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
policyName} -> Text
policyName) (\s :: UpdateEmailIdentityPolicy
s@UpdateEmailIdentityPolicy' {} Text
a -> UpdateEmailIdentityPolicy
s {$sel:policyName:UpdateEmailIdentityPolicy' :: Text
policyName = Text
a} :: UpdateEmailIdentityPolicy)
updateEmailIdentityPolicy_policy :: Lens.Lens' UpdateEmailIdentityPolicy Prelude.Text
updateEmailIdentityPolicy_policy :: Lens' UpdateEmailIdentityPolicy Text
updateEmailIdentityPolicy_policy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEmailIdentityPolicy' {Text
policy :: Text
$sel:policy:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
policy} -> Text
policy) (\s :: UpdateEmailIdentityPolicy
s@UpdateEmailIdentityPolicy' {} Text
a -> UpdateEmailIdentityPolicy
s {$sel:policy:UpdateEmailIdentityPolicy' :: Text
policy = Text
a} :: UpdateEmailIdentityPolicy)
instance Core.AWSRequest UpdateEmailIdentityPolicy where
type
AWSResponse UpdateEmailIdentityPolicy =
UpdateEmailIdentityPolicyResponse
request :: (Service -> Service)
-> UpdateEmailIdentityPolicy -> Request UpdateEmailIdentityPolicy
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 UpdateEmailIdentityPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateEmailIdentityPolicy)))
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 -> UpdateEmailIdentityPolicyResponse
UpdateEmailIdentityPolicyResponse'
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 UpdateEmailIdentityPolicy where
hashWithSalt :: Int -> UpdateEmailIdentityPolicy -> Int
hashWithSalt Int
_salt UpdateEmailIdentityPolicy' {Text
policy :: Text
policyName :: Text
emailIdentity :: Text
$sel:policy:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
$sel:policyName:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
$sel:emailIdentity:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
emailIdentity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policyName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policy
instance Prelude.NFData UpdateEmailIdentityPolicy where
rnf :: UpdateEmailIdentityPolicy -> ()
rnf UpdateEmailIdentityPolicy' {Text
policy :: Text
policyName :: Text
emailIdentity :: Text
$sel:policy:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
$sel:policyName:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
$sel:emailIdentity:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
emailIdentity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policyName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policy
instance Data.ToHeaders UpdateEmailIdentityPolicy where
toHeaders :: UpdateEmailIdentityPolicy -> 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 UpdateEmailIdentityPolicy where
toJSON :: UpdateEmailIdentityPolicy -> Value
toJSON UpdateEmailIdentityPolicy' {Text
policy :: Text
policyName :: Text
emailIdentity :: Text
$sel:policy:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
$sel:policyName:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
$sel:emailIdentity:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"Policy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
policy)]
)
instance Data.ToPath UpdateEmailIdentityPolicy where
toPath :: UpdateEmailIdentityPolicy -> ByteString
toPath UpdateEmailIdentityPolicy' {Text
policy :: Text
policyName :: Text
emailIdentity :: Text
$sel:policy:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
$sel:policyName:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
$sel:emailIdentity:UpdateEmailIdentityPolicy' :: UpdateEmailIdentityPolicy -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v2/email/identities/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
emailIdentity,
ByteString
"/policies/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
policyName
]
instance Data.ToQuery UpdateEmailIdentityPolicy where
toQuery :: UpdateEmailIdentityPolicy -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateEmailIdentityPolicyResponse = UpdateEmailIdentityPolicyResponse'
{
UpdateEmailIdentityPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateEmailIdentityPolicyResponse
-> UpdateEmailIdentityPolicyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEmailIdentityPolicyResponse
-> UpdateEmailIdentityPolicyResponse -> Bool
$c/= :: UpdateEmailIdentityPolicyResponse
-> UpdateEmailIdentityPolicyResponse -> Bool
== :: UpdateEmailIdentityPolicyResponse
-> UpdateEmailIdentityPolicyResponse -> Bool
$c== :: UpdateEmailIdentityPolicyResponse
-> UpdateEmailIdentityPolicyResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEmailIdentityPolicyResponse]
ReadPrec UpdateEmailIdentityPolicyResponse
Int -> ReadS UpdateEmailIdentityPolicyResponse
ReadS [UpdateEmailIdentityPolicyResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEmailIdentityPolicyResponse]
$creadListPrec :: ReadPrec [UpdateEmailIdentityPolicyResponse]
readPrec :: ReadPrec UpdateEmailIdentityPolicyResponse
$creadPrec :: ReadPrec UpdateEmailIdentityPolicyResponse
readList :: ReadS [UpdateEmailIdentityPolicyResponse]
$creadList :: ReadS [UpdateEmailIdentityPolicyResponse]
readsPrec :: Int -> ReadS UpdateEmailIdentityPolicyResponse
$creadsPrec :: Int -> ReadS UpdateEmailIdentityPolicyResponse
Prelude.Read, Int -> UpdateEmailIdentityPolicyResponse -> ShowS
[UpdateEmailIdentityPolicyResponse] -> ShowS
UpdateEmailIdentityPolicyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEmailIdentityPolicyResponse] -> ShowS
$cshowList :: [UpdateEmailIdentityPolicyResponse] -> ShowS
show :: UpdateEmailIdentityPolicyResponse -> String
$cshow :: UpdateEmailIdentityPolicyResponse -> String
showsPrec :: Int -> UpdateEmailIdentityPolicyResponse -> ShowS
$cshowsPrec :: Int -> UpdateEmailIdentityPolicyResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateEmailIdentityPolicyResponse x
-> UpdateEmailIdentityPolicyResponse
forall x.
UpdateEmailIdentityPolicyResponse
-> Rep UpdateEmailIdentityPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEmailIdentityPolicyResponse x
-> UpdateEmailIdentityPolicyResponse
$cfrom :: forall x.
UpdateEmailIdentityPolicyResponse
-> Rep UpdateEmailIdentityPolicyResponse x
Prelude.Generic)
newUpdateEmailIdentityPolicyResponse ::
Prelude.Int ->
UpdateEmailIdentityPolicyResponse
newUpdateEmailIdentityPolicyResponse :: Int -> UpdateEmailIdentityPolicyResponse
newUpdateEmailIdentityPolicyResponse Int
pHttpStatus_ =
UpdateEmailIdentityPolicyResponse'
{ $sel:httpStatus:UpdateEmailIdentityPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateEmailIdentityPolicyResponse_httpStatus :: Lens.Lens' UpdateEmailIdentityPolicyResponse Prelude.Int
updateEmailIdentityPolicyResponse_httpStatus :: Lens' UpdateEmailIdentityPolicyResponse Int
updateEmailIdentityPolicyResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEmailIdentityPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEmailIdentityPolicyResponse' :: UpdateEmailIdentityPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateEmailIdentityPolicyResponse
s@UpdateEmailIdentityPolicyResponse' {} Int
a -> UpdateEmailIdentityPolicyResponse
s {$sel:httpStatus:UpdateEmailIdentityPolicyResponse' :: Int
httpStatus = Int
a} :: UpdateEmailIdentityPolicyResponse)
instance
Prelude.NFData
UpdateEmailIdentityPolicyResponse
where
rnf :: UpdateEmailIdentityPolicyResponse -> ()
rnf UpdateEmailIdentityPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEmailIdentityPolicyResponse' :: UpdateEmailIdentityPolicyResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus