{-# 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.SES.PutIdentityPolicy
(
PutIdentityPolicy (..),
newPutIdentityPolicy,
putIdentityPolicy_identity,
putIdentityPolicy_policyName,
putIdentityPolicy_policy,
PutIdentityPolicyResponse (..),
newPutIdentityPolicyResponse,
putIdentityPolicyResponse_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.SES.Types
data PutIdentityPolicy = PutIdentityPolicy'
{
PutIdentityPolicy -> Text
identity :: Prelude.Text,
PutIdentityPolicy -> Text
policyName :: Prelude.Text,
PutIdentityPolicy -> Text
policy :: Prelude.Text
}
deriving (PutIdentityPolicy -> PutIdentityPolicy -> Bool
(PutIdentityPolicy -> PutIdentityPolicy -> Bool)
-> (PutIdentityPolicy -> PutIdentityPolicy -> Bool)
-> Eq PutIdentityPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutIdentityPolicy -> PutIdentityPolicy -> Bool
$c/= :: PutIdentityPolicy -> PutIdentityPolicy -> Bool
== :: PutIdentityPolicy -> PutIdentityPolicy -> Bool
$c== :: PutIdentityPolicy -> PutIdentityPolicy -> Bool
Prelude.Eq, ReadPrec [PutIdentityPolicy]
ReadPrec PutIdentityPolicy
Int -> ReadS PutIdentityPolicy
ReadS [PutIdentityPolicy]
(Int -> ReadS PutIdentityPolicy)
-> ReadS [PutIdentityPolicy]
-> ReadPrec PutIdentityPolicy
-> ReadPrec [PutIdentityPolicy]
-> Read PutIdentityPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutIdentityPolicy]
$creadListPrec :: ReadPrec [PutIdentityPolicy]
readPrec :: ReadPrec PutIdentityPolicy
$creadPrec :: ReadPrec PutIdentityPolicy
readList :: ReadS [PutIdentityPolicy]
$creadList :: ReadS [PutIdentityPolicy]
readsPrec :: Int -> ReadS PutIdentityPolicy
$creadsPrec :: Int -> ReadS PutIdentityPolicy
Prelude.Read, Int -> PutIdentityPolicy -> ShowS
[PutIdentityPolicy] -> ShowS
PutIdentityPolicy -> String
(Int -> PutIdentityPolicy -> ShowS)
-> (PutIdentityPolicy -> String)
-> ([PutIdentityPolicy] -> ShowS)
-> Show PutIdentityPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutIdentityPolicy] -> ShowS
$cshowList :: [PutIdentityPolicy] -> ShowS
show :: PutIdentityPolicy -> String
$cshow :: PutIdentityPolicy -> String
showsPrec :: Int -> PutIdentityPolicy -> ShowS
$cshowsPrec :: Int -> PutIdentityPolicy -> ShowS
Prelude.Show, (forall x. PutIdentityPolicy -> Rep PutIdentityPolicy x)
-> (forall x. Rep PutIdentityPolicy x -> PutIdentityPolicy)
-> Generic PutIdentityPolicy
forall x. Rep PutIdentityPolicy x -> PutIdentityPolicy
forall x. PutIdentityPolicy -> Rep PutIdentityPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutIdentityPolicy x -> PutIdentityPolicy
$cfrom :: forall x. PutIdentityPolicy -> Rep PutIdentityPolicy x
Prelude.Generic)
newPutIdentityPolicy ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
PutIdentityPolicy
newPutIdentityPolicy :: Text -> Text -> Text -> PutIdentityPolicy
newPutIdentityPolicy Text
pIdentity_ Text
pPolicyName_ Text
pPolicy_ =
PutIdentityPolicy' :: Text -> Text -> Text -> PutIdentityPolicy
PutIdentityPolicy'
{ $sel:identity:PutIdentityPolicy' :: Text
identity = Text
pIdentity_,
$sel:policyName:PutIdentityPolicy' :: Text
policyName = Text
pPolicyName_,
$sel:policy:PutIdentityPolicy' :: Text
policy = Text
pPolicy_
}
putIdentityPolicy_identity :: Lens.Lens' PutIdentityPolicy Prelude.Text
putIdentityPolicy_identity :: (Text -> f Text) -> PutIdentityPolicy -> f PutIdentityPolicy
putIdentityPolicy_identity = (PutIdentityPolicy -> Text)
-> (PutIdentityPolicy -> Text -> PutIdentityPolicy)
-> Lens PutIdentityPolicy PutIdentityPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIdentityPolicy' {Text
identity :: Text
$sel:identity:PutIdentityPolicy' :: PutIdentityPolicy -> Text
identity} -> Text
identity) (\s :: PutIdentityPolicy
s@PutIdentityPolicy' {} Text
a -> PutIdentityPolicy
s {$sel:identity:PutIdentityPolicy' :: Text
identity = Text
a} :: PutIdentityPolicy)
putIdentityPolicy_policyName :: Lens.Lens' PutIdentityPolicy Prelude.Text
putIdentityPolicy_policyName :: (Text -> f Text) -> PutIdentityPolicy -> f PutIdentityPolicy
putIdentityPolicy_policyName = (PutIdentityPolicy -> Text)
-> (PutIdentityPolicy -> Text -> PutIdentityPolicy)
-> Lens PutIdentityPolicy PutIdentityPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIdentityPolicy' {Text
policyName :: Text
$sel:policyName:PutIdentityPolicy' :: PutIdentityPolicy -> Text
policyName} -> Text
policyName) (\s :: PutIdentityPolicy
s@PutIdentityPolicy' {} Text
a -> PutIdentityPolicy
s {$sel:policyName:PutIdentityPolicy' :: Text
policyName = Text
a} :: PutIdentityPolicy)
putIdentityPolicy_policy :: Lens.Lens' PutIdentityPolicy Prelude.Text
putIdentityPolicy_policy :: (Text -> f Text) -> PutIdentityPolicy -> f PutIdentityPolicy
putIdentityPolicy_policy = (PutIdentityPolicy -> Text)
-> (PutIdentityPolicy -> Text -> PutIdentityPolicy)
-> Lens PutIdentityPolicy PutIdentityPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIdentityPolicy' {Text
policy :: Text
$sel:policy:PutIdentityPolicy' :: PutIdentityPolicy -> Text
policy} -> Text
policy) (\s :: PutIdentityPolicy
s@PutIdentityPolicy' {} Text
a -> PutIdentityPolicy
s {$sel:policy:PutIdentityPolicy' :: Text
policy = Text
a} :: PutIdentityPolicy)
instance Core.AWSRequest PutIdentityPolicy where
type
AWSResponse PutIdentityPolicy =
PutIdentityPolicyResponse
request :: PutIdentityPolicy -> Request PutIdentityPolicy
request = Service -> PutIdentityPolicy -> Request PutIdentityPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy PutIdentityPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutIdentityPolicy)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse PutIdentityPolicy))
-> Logger
-> Service
-> Proxy PutIdentityPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutIdentityPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"PutIdentityPolicyResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> PutIdentityPolicyResponse
PutIdentityPolicyResponse'
(Int -> PutIdentityPolicyResponse)
-> Either String Int -> Either String PutIdentityPolicyResponse
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 PutIdentityPolicy
instance Prelude.NFData PutIdentityPolicy
instance Core.ToHeaders PutIdentityPolicy where
toHeaders :: PutIdentityPolicy -> ResponseHeaders
toHeaders = ResponseHeaders -> PutIdentityPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath PutIdentityPolicy where
toPath :: PutIdentityPolicy -> ByteString
toPath = ByteString -> PutIdentityPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutIdentityPolicy where
toQuery :: PutIdentityPolicy -> QueryString
toQuery PutIdentityPolicy' {Text
policy :: Text
policyName :: Text
identity :: Text
$sel:policy:PutIdentityPolicy' :: PutIdentityPolicy -> Text
$sel:policyName:PutIdentityPolicy' :: PutIdentityPolicy -> Text
$sel:identity:PutIdentityPolicy' :: PutIdentityPolicy -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"PutIdentityPolicy" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"Identity" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
identity,
ByteString
"PolicyName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyName,
ByteString
"Policy" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policy
]
data PutIdentityPolicyResponse = PutIdentityPolicyResponse'
{
PutIdentityPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutIdentityPolicyResponse -> PutIdentityPolicyResponse -> Bool
(PutIdentityPolicyResponse -> PutIdentityPolicyResponse -> Bool)
-> (PutIdentityPolicyResponse -> PutIdentityPolicyResponse -> Bool)
-> Eq PutIdentityPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutIdentityPolicyResponse -> PutIdentityPolicyResponse -> Bool
$c/= :: PutIdentityPolicyResponse -> PutIdentityPolicyResponse -> Bool
== :: PutIdentityPolicyResponse -> PutIdentityPolicyResponse -> Bool
$c== :: PutIdentityPolicyResponse -> PutIdentityPolicyResponse -> Bool
Prelude.Eq, ReadPrec [PutIdentityPolicyResponse]
ReadPrec PutIdentityPolicyResponse
Int -> ReadS PutIdentityPolicyResponse
ReadS [PutIdentityPolicyResponse]
(Int -> ReadS PutIdentityPolicyResponse)
-> ReadS [PutIdentityPolicyResponse]
-> ReadPrec PutIdentityPolicyResponse
-> ReadPrec [PutIdentityPolicyResponse]
-> Read PutIdentityPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutIdentityPolicyResponse]
$creadListPrec :: ReadPrec [PutIdentityPolicyResponse]
readPrec :: ReadPrec PutIdentityPolicyResponse
$creadPrec :: ReadPrec PutIdentityPolicyResponse
readList :: ReadS [PutIdentityPolicyResponse]
$creadList :: ReadS [PutIdentityPolicyResponse]
readsPrec :: Int -> ReadS PutIdentityPolicyResponse
$creadsPrec :: Int -> ReadS PutIdentityPolicyResponse
Prelude.Read, Int -> PutIdentityPolicyResponse -> ShowS
[PutIdentityPolicyResponse] -> ShowS
PutIdentityPolicyResponse -> String
(Int -> PutIdentityPolicyResponse -> ShowS)
-> (PutIdentityPolicyResponse -> String)
-> ([PutIdentityPolicyResponse] -> ShowS)
-> Show PutIdentityPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutIdentityPolicyResponse] -> ShowS
$cshowList :: [PutIdentityPolicyResponse] -> ShowS
show :: PutIdentityPolicyResponse -> String
$cshow :: PutIdentityPolicyResponse -> String
showsPrec :: Int -> PutIdentityPolicyResponse -> ShowS
$cshowsPrec :: Int -> PutIdentityPolicyResponse -> ShowS
Prelude.Show, (forall x.
PutIdentityPolicyResponse -> Rep PutIdentityPolicyResponse x)
-> (forall x.
Rep PutIdentityPolicyResponse x -> PutIdentityPolicyResponse)
-> Generic PutIdentityPolicyResponse
forall x.
Rep PutIdentityPolicyResponse x -> PutIdentityPolicyResponse
forall x.
PutIdentityPolicyResponse -> Rep PutIdentityPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutIdentityPolicyResponse x -> PutIdentityPolicyResponse
$cfrom :: forall x.
PutIdentityPolicyResponse -> Rep PutIdentityPolicyResponse x
Prelude.Generic)
newPutIdentityPolicyResponse ::
Prelude.Int ->
PutIdentityPolicyResponse
newPutIdentityPolicyResponse :: Int -> PutIdentityPolicyResponse
newPutIdentityPolicyResponse Int
pHttpStatus_ =
PutIdentityPolicyResponse' :: Int -> PutIdentityPolicyResponse
PutIdentityPolicyResponse'
{ $sel:httpStatus:PutIdentityPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putIdentityPolicyResponse_httpStatus :: Lens.Lens' PutIdentityPolicyResponse Prelude.Int
putIdentityPolicyResponse_httpStatus :: (Int -> f Int)
-> PutIdentityPolicyResponse -> f PutIdentityPolicyResponse
putIdentityPolicyResponse_httpStatus = (PutIdentityPolicyResponse -> Int)
-> (PutIdentityPolicyResponse -> Int -> PutIdentityPolicyResponse)
-> Lens PutIdentityPolicyResponse PutIdentityPolicyResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIdentityPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutIdentityPolicyResponse' :: PutIdentityPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutIdentityPolicyResponse
s@PutIdentityPolicyResponse' {} Int
a -> PutIdentityPolicyResponse
s {$sel:httpStatus:PutIdentityPolicyResponse' :: Int
httpStatus = Int
a} :: PutIdentityPolicyResponse)
instance Prelude.NFData PutIdentityPolicyResponse