{-# 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.CreateConfigurationSetEventDestination
(
CreateConfigurationSetEventDestination (..),
newCreateConfigurationSetEventDestination,
createConfigurationSetEventDestination_configurationSetName,
createConfigurationSetEventDestination_eventDestination,
CreateConfigurationSetEventDestinationResponse (..),
newCreateConfigurationSetEventDestinationResponse,
createConfigurationSetEventDestinationResponse_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.SES.Types
data CreateConfigurationSetEventDestination = CreateConfigurationSetEventDestination'
{
CreateConfigurationSetEventDestination -> Text
configurationSetName :: Prelude.Text,
CreateConfigurationSetEventDestination -> EventDestination
eventDestination :: EventDestination
}
deriving (CreateConfigurationSetEventDestination
-> CreateConfigurationSetEventDestination -> Bool
(CreateConfigurationSetEventDestination
-> CreateConfigurationSetEventDestination -> Bool)
-> (CreateConfigurationSetEventDestination
-> CreateConfigurationSetEventDestination -> Bool)
-> Eq CreateConfigurationSetEventDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateConfigurationSetEventDestination
-> CreateConfigurationSetEventDestination -> Bool
== :: CreateConfigurationSetEventDestination
-> CreateConfigurationSetEventDestination -> Bool
$c/= :: CreateConfigurationSetEventDestination
-> CreateConfigurationSetEventDestination -> Bool
/= :: CreateConfigurationSetEventDestination
-> CreateConfigurationSetEventDestination -> Bool
Prelude.Eq, ReadPrec [CreateConfigurationSetEventDestination]
ReadPrec CreateConfigurationSetEventDestination
Int -> ReadS CreateConfigurationSetEventDestination
ReadS [CreateConfigurationSetEventDestination]
(Int -> ReadS CreateConfigurationSetEventDestination)
-> ReadS [CreateConfigurationSetEventDestination]
-> ReadPrec CreateConfigurationSetEventDestination
-> ReadPrec [CreateConfigurationSetEventDestination]
-> Read CreateConfigurationSetEventDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CreateConfigurationSetEventDestination
readsPrec :: Int -> ReadS CreateConfigurationSetEventDestination
$creadList :: ReadS [CreateConfigurationSetEventDestination]
readList :: ReadS [CreateConfigurationSetEventDestination]
$creadPrec :: ReadPrec CreateConfigurationSetEventDestination
readPrec :: ReadPrec CreateConfigurationSetEventDestination
$creadListPrec :: ReadPrec [CreateConfigurationSetEventDestination]
readListPrec :: ReadPrec [CreateConfigurationSetEventDestination]
Prelude.Read, Int -> CreateConfigurationSetEventDestination -> ShowS
[CreateConfigurationSetEventDestination] -> ShowS
CreateConfigurationSetEventDestination -> String
(Int -> CreateConfigurationSetEventDestination -> ShowS)
-> (CreateConfigurationSetEventDestination -> String)
-> ([CreateConfigurationSetEventDestination] -> ShowS)
-> Show CreateConfigurationSetEventDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateConfigurationSetEventDestination -> ShowS
showsPrec :: Int -> CreateConfigurationSetEventDestination -> ShowS
$cshow :: CreateConfigurationSetEventDestination -> String
show :: CreateConfigurationSetEventDestination -> String
$cshowList :: [CreateConfigurationSetEventDestination] -> ShowS
showList :: [CreateConfigurationSetEventDestination] -> ShowS
Prelude.Show, (forall x.
CreateConfigurationSetEventDestination
-> Rep CreateConfigurationSetEventDestination x)
-> (forall x.
Rep CreateConfigurationSetEventDestination x
-> CreateConfigurationSetEventDestination)
-> Generic CreateConfigurationSetEventDestination
forall x.
Rep CreateConfigurationSetEventDestination x
-> CreateConfigurationSetEventDestination
forall x.
CreateConfigurationSetEventDestination
-> Rep CreateConfigurationSetEventDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
CreateConfigurationSetEventDestination
-> Rep CreateConfigurationSetEventDestination x
from :: forall x.
CreateConfigurationSetEventDestination
-> Rep CreateConfigurationSetEventDestination x
$cto :: forall x.
Rep CreateConfigurationSetEventDestination x
-> CreateConfigurationSetEventDestination
to :: forall x.
Rep CreateConfigurationSetEventDestination x
-> CreateConfigurationSetEventDestination
Prelude.Generic)
newCreateConfigurationSetEventDestination ::
Prelude.Text ->
EventDestination ->
CreateConfigurationSetEventDestination
newCreateConfigurationSetEventDestination :: Text -> EventDestination -> CreateConfigurationSetEventDestination
newCreateConfigurationSetEventDestination
Text
pConfigurationSetName_
EventDestination
pEventDestination_ =
CreateConfigurationSetEventDestination'
{ $sel:configurationSetName:CreateConfigurationSetEventDestination' :: Text
configurationSetName =
Text
pConfigurationSetName_,
$sel:eventDestination:CreateConfigurationSetEventDestination' :: EventDestination
eventDestination =
EventDestination
pEventDestination_
}
createConfigurationSetEventDestination_configurationSetName :: Lens.Lens' CreateConfigurationSetEventDestination Prelude.Text
createConfigurationSetEventDestination_configurationSetName :: Lens' CreateConfigurationSetEventDestination Text
createConfigurationSetEventDestination_configurationSetName = (CreateConfigurationSetEventDestination -> Text)
-> (CreateConfigurationSetEventDestination
-> Text -> CreateConfigurationSetEventDestination)
-> Lens' CreateConfigurationSetEventDestination Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationSetEventDestination' {Text
$sel:configurationSetName:CreateConfigurationSetEventDestination' :: CreateConfigurationSetEventDestination -> Text
configurationSetName :: Text
configurationSetName} -> Text
configurationSetName) (\s :: CreateConfigurationSetEventDestination
s@CreateConfigurationSetEventDestination' {} Text
a -> CreateConfigurationSetEventDestination
s {configurationSetName = a} :: CreateConfigurationSetEventDestination)
createConfigurationSetEventDestination_eventDestination :: Lens.Lens' CreateConfigurationSetEventDestination EventDestination
createConfigurationSetEventDestination_eventDestination :: Lens' CreateConfigurationSetEventDestination EventDestination
createConfigurationSetEventDestination_eventDestination = (CreateConfigurationSetEventDestination -> EventDestination)
-> (CreateConfigurationSetEventDestination
-> EventDestination -> CreateConfigurationSetEventDestination)
-> Lens' CreateConfigurationSetEventDestination EventDestination
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationSetEventDestination' {EventDestination
$sel:eventDestination:CreateConfigurationSetEventDestination' :: CreateConfigurationSetEventDestination -> EventDestination
eventDestination :: EventDestination
eventDestination} -> EventDestination
eventDestination) (\s :: CreateConfigurationSetEventDestination
s@CreateConfigurationSetEventDestination' {} EventDestination
a -> CreateConfigurationSetEventDestination
s {eventDestination = a} :: CreateConfigurationSetEventDestination)
instance
Core.AWSRequest
CreateConfigurationSetEventDestination
where
type
AWSResponse
CreateConfigurationSetEventDestination =
CreateConfigurationSetEventDestinationResponse
request :: (Service -> Service)
-> CreateConfigurationSetEventDestination
-> Request CreateConfigurationSetEventDestination
request Service -> Service
overrides =
Service
-> CreateConfigurationSetEventDestination
-> Request CreateConfigurationSetEventDestination
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateConfigurationSetEventDestination
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse CreateConfigurationSetEventDestination)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either
String (AWSResponse CreateConfigurationSetEventDestination))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateConfigurationSetEventDestination
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse CreateConfigurationSetEventDestination)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"CreateConfigurationSetEventDestinationResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> CreateConfigurationSetEventDestinationResponse
CreateConfigurationSetEventDestinationResponse'
(Int -> CreateConfigurationSetEventDestinationResponse)
-> Either String Int
-> Either String CreateConfigurationSetEventDestinationResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall a. a -> Either String a
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
CreateConfigurationSetEventDestination
where
hashWithSalt :: Int -> CreateConfigurationSetEventDestination -> Int
hashWithSalt
Int
_salt
CreateConfigurationSetEventDestination' {Text
EventDestination
$sel:configurationSetName:CreateConfigurationSetEventDestination' :: CreateConfigurationSetEventDestination -> Text
$sel:eventDestination:CreateConfigurationSetEventDestination' :: CreateConfigurationSetEventDestination -> EventDestination
configurationSetName :: Text
eventDestination :: EventDestination
..} =
Int
_salt
Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
configurationSetName
Int -> EventDestination -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EventDestination
eventDestination
instance
Prelude.NFData
CreateConfigurationSetEventDestination
where
rnf :: CreateConfigurationSetEventDestination -> ()
rnf CreateConfigurationSetEventDestination' {Text
EventDestination
$sel:configurationSetName:CreateConfigurationSetEventDestination' :: CreateConfigurationSetEventDestination -> Text
$sel:eventDestination:CreateConfigurationSetEventDestination' :: CreateConfigurationSetEventDestination -> EventDestination
configurationSetName :: Text
eventDestination :: EventDestination
..} =
Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
configurationSetName
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` EventDestination -> ()
forall a. NFData a => a -> ()
Prelude.rnf EventDestination
eventDestination
instance
Data.ToHeaders
CreateConfigurationSetEventDestination
where
toHeaders :: CreateConfigurationSetEventDestination -> ResponseHeaders
toHeaders = ResponseHeaders
-> CreateConfigurationSetEventDestination -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance
Data.ToPath
CreateConfigurationSetEventDestination
where
toPath :: CreateConfigurationSetEventDestination -> ByteString
toPath = ByteString -> CreateConfigurationSetEventDestination -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
CreateConfigurationSetEventDestination
where
toQuery :: CreateConfigurationSetEventDestination -> QueryString
toQuery CreateConfigurationSetEventDestination' {Text
EventDestination
$sel:configurationSetName:CreateConfigurationSetEventDestination' :: CreateConfigurationSetEventDestination -> Text
$sel:eventDestination:CreateConfigurationSetEventDestination' :: CreateConfigurationSetEventDestination -> EventDestination
configurationSetName :: Text
eventDestination :: EventDestination
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"CreateConfigurationSetEventDestination" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"ConfigurationSetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
configurationSetName,
ByteString
"EventDestination" ByteString -> EventDestination -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: EventDestination
eventDestination
]
data CreateConfigurationSetEventDestinationResponse = CreateConfigurationSetEventDestinationResponse'
{
CreateConfigurationSetEventDestinationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateConfigurationSetEventDestinationResponse
-> CreateConfigurationSetEventDestinationResponse -> Bool
(CreateConfigurationSetEventDestinationResponse
-> CreateConfigurationSetEventDestinationResponse -> Bool)
-> (CreateConfigurationSetEventDestinationResponse
-> CreateConfigurationSetEventDestinationResponse -> Bool)
-> Eq CreateConfigurationSetEventDestinationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateConfigurationSetEventDestinationResponse
-> CreateConfigurationSetEventDestinationResponse -> Bool
== :: CreateConfigurationSetEventDestinationResponse
-> CreateConfigurationSetEventDestinationResponse -> Bool
$c/= :: CreateConfigurationSetEventDestinationResponse
-> CreateConfigurationSetEventDestinationResponse -> Bool
/= :: CreateConfigurationSetEventDestinationResponse
-> CreateConfigurationSetEventDestinationResponse -> Bool
Prelude.Eq, ReadPrec [CreateConfigurationSetEventDestinationResponse]
ReadPrec CreateConfigurationSetEventDestinationResponse
Int -> ReadS CreateConfigurationSetEventDestinationResponse
ReadS [CreateConfigurationSetEventDestinationResponse]
(Int -> ReadS CreateConfigurationSetEventDestinationResponse)
-> ReadS [CreateConfigurationSetEventDestinationResponse]
-> ReadPrec CreateConfigurationSetEventDestinationResponse
-> ReadPrec [CreateConfigurationSetEventDestinationResponse]
-> Read CreateConfigurationSetEventDestinationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS CreateConfigurationSetEventDestinationResponse
readsPrec :: Int -> ReadS CreateConfigurationSetEventDestinationResponse
$creadList :: ReadS [CreateConfigurationSetEventDestinationResponse]
readList :: ReadS [CreateConfigurationSetEventDestinationResponse]
$creadPrec :: ReadPrec CreateConfigurationSetEventDestinationResponse
readPrec :: ReadPrec CreateConfigurationSetEventDestinationResponse
$creadListPrec :: ReadPrec [CreateConfigurationSetEventDestinationResponse]
readListPrec :: ReadPrec [CreateConfigurationSetEventDestinationResponse]
Prelude.Read, Int -> CreateConfigurationSetEventDestinationResponse -> ShowS
[CreateConfigurationSetEventDestinationResponse] -> ShowS
CreateConfigurationSetEventDestinationResponse -> String
(Int -> CreateConfigurationSetEventDestinationResponse -> ShowS)
-> (CreateConfigurationSetEventDestinationResponse -> String)
-> ([CreateConfigurationSetEventDestinationResponse] -> ShowS)
-> Show CreateConfigurationSetEventDestinationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateConfigurationSetEventDestinationResponse -> ShowS
showsPrec :: Int -> CreateConfigurationSetEventDestinationResponse -> ShowS
$cshow :: CreateConfigurationSetEventDestinationResponse -> String
show :: CreateConfigurationSetEventDestinationResponse -> String
$cshowList :: [CreateConfigurationSetEventDestinationResponse] -> ShowS
showList :: [CreateConfigurationSetEventDestinationResponse] -> ShowS
Prelude.Show, (forall x.
CreateConfigurationSetEventDestinationResponse
-> Rep CreateConfigurationSetEventDestinationResponse x)
-> (forall x.
Rep CreateConfigurationSetEventDestinationResponse x
-> CreateConfigurationSetEventDestinationResponse)
-> Generic CreateConfigurationSetEventDestinationResponse
forall x.
Rep CreateConfigurationSetEventDestinationResponse x
-> CreateConfigurationSetEventDestinationResponse
forall x.
CreateConfigurationSetEventDestinationResponse
-> Rep CreateConfigurationSetEventDestinationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
CreateConfigurationSetEventDestinationResponse
-> Rep CreateConfigurationSetEventDestinationResponse x
from :: forall x.
CreateConfigurationSetEventDestinationResponse
-> Rep CreateConfigurationSetEventDestinationResponse x
$cto :: forall x.
Rep CreateConfigurationSetEventDestinationResponse x
-> CreateConfigurationSetEventDestinationResponse
to :: forall x.
Rep CreateConfigurationSetEventDestinationResponse x
-> CreateConfigurationSetEventDestinationResponse
Prelude.Generic)
newCreateConfigurationSetEventDestinationResponse ::
Prelude.Int ->
CreateConfigurationSetEventDestinationResponse
newCreateConfigurationSetEventDestinationResponse :: Int -> CreateConfigurationSetEventDestinationResponse
newCreateConfigurationSetEventDestinationResponse
Int
pHttpStatus_ =
CreateConfigurationSetEventDestinationResponse'
{ $sel:httpStatus:CreateConfigurationSetEventDestinationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createConfigurationSetEventDestinationResponse_httpStatus :: Lens.Lens' CreateConfigurationSetEventDestinationResponse Prelude.Int
createConfigurationSetEventDestinationResponse_httpStatus :: Lens' CreateConfigurationSetEventDestinationResponse Int
createConfigurationSetEventDestinationResponse_httpStatus = (CreateConfigurationSetEventDestinationResponse -> Int)
-> (CreateConfigurationSetEventDestinationResponse
-> Int -> CreateConfigurationSetEventDestinationResponse)
-> Lens' CreateConfigurationSetEventDestinationResponse Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationSetEventDestinationResponse' {Int
$sel:httpStatus:CreateConfigurationSetEventDestinationResponse' :: CreateConfigurationSetEventDestinationResponse -> Int
httpStatus :: Int
httpStatus} -> Int
httpStatus) (\s :: CreateConfigurationSetEventDestinationResponse
s@CreateConfigurationSetEventDestinationResponse' {} Int
a -> CreateConfigurationSetEventDestinationResponse
s {httpStatus = a} :: CreateConfigurationSetEventDestinationResponse)
instance
Prelude.NFData
CreateConfigurationSetEventDestinationResponse
where
rnf :: CreateConfigurationSetEventDestinationResponse -> ()
rnf
CreateConfigurationSetEventDestinationResponse' {Int
$sel:httpStatus:CreateConfigurationSetEventDestinationResponse' :: CreateConfigurationSetEventDestinationResponse -> Int
httpStatus :: Int
..} =
Int -> ()
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus