{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SES.DeleteConfigurationSetEventDestination
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a configuration set event destination. Configuration set event
-- destinations are associated with configuration sets, which enable you to
-- publish email sending events. For information about using configuration
-- sets, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html Amazon SES Developer Guide>.
--
-- You can execute this operation no more than once per second.
module Amazonka.SES.DeleteConfigurationSetEventDestination
  ( -- * Creating a Request
    DeleteConfigurationSetEventDestination (..),
    newDeleteConfigurationSetEventDestination,

    -- * Request Lenses
    deleteConfigurationSetEventDestination_configurationSetName,
    deleteConfigurationSetEventDestination_eventDestinationName,

    -- * Destructuring the Response
    DeleteConfigurationSetEventDestinationResponse (..),
    newDeleteConfigurationSetEventDestinationResponse,

    -- * Response Lenses
    deleteConfigurationSetEventDestinationResponse_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

-- | Represents a request to delete a configuration set event destination.
-- Configuration set event destinations are associated with configuration
-- sets, which enable you to publish email sending events. For information
-- about using configuration sets, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html Amazon SES Developer Guide>.
--
-- /See:/ 'newDeleteConfigurationSetEventDestination' smart constructor.
data DeleteConfigurationSetEventDestination = DeleteConfigurationSetEventDestination'
  { -- | The name of the configuration set from which to delete the event
    -- destination.
    DeleteConfigurationSetEventDestination -> Text
configurationSetName :: Prelude.Text,
    -- | The name of the event destination to delete.
    DeleteConfigurationSetEventDestination -> Text
eventDestinationName :: Prelude.Text
  }
  deriving (DeleteConfigurationSetEventDestination
-> DeleteConfigurationSetEventDestination -> Bool
(DeleteConfigurationSetEventDestination
 -> DeleteConfigurationSetEventDestination -> Bool)
-> (DeleteConfigurationSetEventDestination
    -> DeleteConfigurationSetEventDestination -> Bool)
-> Eq DeleteConfigurationSetEventDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConfigurationSetEventDestination
-> DeleteConfigurationSetEventDestination -> Bool
$c/= :: DeleteConfigurationSetEventDestination
-> DeleteConfigurationSetEventDestination -> Bool
== :: DeleteConfigurationSetEventDestination
-> DeleteConfigurationSetEventDestination -> Bool
$c== :: DeleteConfigurationSetEventDestination
-> DeleteConfigurationSetEventDestination -> Bool
Prelude.Eq, ReadPrec [DeleteConfigurationSetEventDestination]
ReadPrec DeleteConfigurationSetEventDestination
Int -> ReadS DeleteConfigurationSetEventDestination
ReadS [DeleteConfigurationSetEventDestination]
(Int -> ReadS DeleteConfigurationSetEventDestination)
-> ReadS [DeleteConfigurationSetEventDestination]
-> ReadPrec DeleteConfigurationSetEventDestination
-> ReadPrec [DeleteConfigurationSetEventDestination]
-> Read DeleteConfigurationSetEventDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConfigurationSetEventDestination]
$creadListPrec :: ReadPrec [DeleteConfigurationSetEventDestination]
readPrec :: ReadPrec DeleteConfigurationSetEventDestination
$creadPrec :: ReadPrec DeleteConfigurationSetEventDestination
readList :: ReadS [DeleteConfigurationSetEventDestination]
$creadList :: ReadS [DeleteConfigurationSetEventDestination]
readsPrec :: Int -> ReadS DeleteConfigurationSetEventDestination
$creadsPrec :: Int -> ReadS DeleteConfigurationSetEventDestination
Prelude.Read, Int -> DeleteConfigurationSetEventDestination -> ShowS
[DeleteConfigurationSetEventDestination] -> ShowS
DeleteConfigurationSetEventDestination -> String
(Int -> DeleteConfigurationSetEventDestination -> ShowS)
-> (DeleteConfigurationSetEventDestination -> String)
-> ([DeleteConfigurationSetEventDestination] -> ShowS)
-> Show DeleteConfigurationSetEventDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConfigurationSetEventDestination] -> ShowS
$cshowList :: [DeleteConfigurationSetEventDestination] -> ShowS
show :: DeleteConfigurationSetEventDestination -> String
$cshow :: DeleteConfigurationSetEventDestination -> String
showsPrec :: Int -> DeleteConfigurationSetEventDestination -> ShowS
$cshowsPrec :: Int -> DeleteConfigurationSetEventDestination -> ShowS
Prelude.Show, (forall x.
 DeleteConfigurationSetEventDestination
 -> Rep DeleteConfigurationSetEventDestination x)
-> (forall x.
    Rep DeleteConfigurationSetEventDestination x
    -> DeleteConfigurationSetEventDestination)
-> Generic DeleteConfigurationSetEventDestination
forall x.
Rep DeleteConfigurationSetEventDestination x
-> DeleteConfigurationSetEventDestination
forall x.
DeleteConfigurationSetEventDestination
-> Rep DeleteConfigurationSetEventDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteConfigurationSetEventDestination x
-> DeleteConfigurationSetEventDestination
$cfrom :: forall x.
DeleteConfigurationSetEventDestination
-> Rep DeleteConfigurationSetEventDestination x
Prelude.Generic)

-- |
-- Create a value of 'DeleteConfigurationSetEventDestination' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'configurationSetName', 'deleteConfigurationSetEventDestination_configurationSetName' - The name of the configuration set from which to delete the event
-- destination.
--
-- 'eventDestinationName', 'deleteConfigurationSetEventDestination_eventDestinationName' - The name of the event destination to delete.
newDeleteConfigurationSetEventDestination ::
  -- | 'configurationSetName'
  Prelude.Text ->
  -- | 'eventDestinationName'
  Prelude.Text ->
  DeleteConfigurationSetEventDestination
newDeleteConfigurationSetEventDestination :: Text -> Text -> DeleteConfigurationSetEventDestination
newDeleteConfigurationSetEventDestination
  Text
pConfigurationSetName_
  Text
pEventDestinationName_ =
    DeleteConfigurationSetEventDestination' :: Text -> Text -> DeleteConfigurationSetEventDestination
DeleteConfigurationSetEventDestination'
      { $sel:configurationSetName:DeleteConfigurationSetEventDestination' :: Text
configurationSetName =
          Text
pConfigurationSetName_,
        $sel:eventDestinationName:DeleteConfigurationSetEventDestination' :: Text
eventDestinationName =
          Text
pEventDestinationName_
      }

-- | The name of the configuration set from which to delete the event
-- destination.
deleteConfigurationSetEventDestination_configurationSetName :: Lens.Lens' DeleteConfigurationSetEventDestination Prelude.Text
deleteConfigurationSetEventDestination_configurationSetName :: (Text -> f Text)
-> DeleteConfigurationSetEventDestination
-> f DeleteConfigurationSetEventDestination
deleteConfigurationSetEventDestination_configurationSetName = (DeleteConfigurationSetEventDestination -> Text)
-> (DeleteConfigurationSetEventDestination
    -> Text -> DeleteConfigurationSetEventDestination)
-> Lens
     DeleteConfigurationSetEventDestination
     DeleteConfigurationSetEventDestination
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationSetEventDestination' {Text
configurationSetName :: Text
$sel:configurationSetName:DeleteConfigurationSetEventDestination' :: DeleteConfigurationSetEventDestination -> Text
configurationSetName} -> Text
configurationSetName) (\s :: DeleteConfigurationSetEventDestination
s@DeleteConfigurationSetEventDestination' {} Text
a -> DeleteConfigurationSetEventDestination
s {$sel:configurationSetName:DeleteConfigurationSetEventDestination' :: Text
configurationSetName = Text
a} :: DeleteConfigurationSetEventDestination)

-- | The name of the event destination to delete.
deleteConfigurationSetEventDestination_eventDestinationName :: Lens.Lens' DeleteConfigurationSetEventDestination Prelude.Text
deleteConfigurationSetEventDestination_eventDestinationName :: (Text -> f Text)
-> DeleteConfigurationSetEventDestination
-> f DeleteConfigurationSetEventDestination
deleteConfigurationSetEventDestination_eventDestinationName = (DeleteConfigurationSetEventDestination -> Text)
-> (DeleteConfigurationSetEventDestination
    -> Text -> DeleteConfigurationSetEventDestination)
-> Lens
     DeleteConfigurationSetEventDestination
     DeleteConfigurationSetEventDestination
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationSetEventDestination' {Text
eventDestinationName :: Text
$sel:eventDestinationName:DeleteConfigurationSetEventDestination' :: DeleteConfigurationSetEventDestination -> Text
eventDestinationName} -> Text
eventDestinationName) (\s :: DeleteConfigurationSetEventDestination
s@DeleteConfigurationSetEventDestination' {} Text
a -> DeleteConfigurationSetEventDestination
s {$sel:eventDestinationName:DeleteConfigurationSetEventDestination' :: Text
eventDestinationName = Text
a} :: DeleteConfigurationSetEventDestination)

instance
  Core.AWSRequest
    DeleteConfigurationSetEventDestination
  where
  type
    AWSResponse
      DeleteConfigurationSetEventDestination =
      DeleteConfigurationSetEventDestinationResponse
  request :: DeleteConfigurationSetEventDestination
-> Request DeleteConfigurationSetEventDestination
request = Service
-> DeleteConfigurationSetEventDestination
-> Request DeleteConfigurationSetEventDestination
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteConfigurationSetEventDestination
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DeleteConfigurationSetEventDestination)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either
         String (AWSResponse DeleteConfigurationSetEventDestination))
-> Logger
-> Service
-> Proxy DeleteConfigurationSetEventDestination
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DeleteConfigurationSetEventDestination)))
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
"DeleteConfigurationSetEventDestinationResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> DeleteConfigurationSetEventDestinationResponse
DeleteConfigurationSetEventDestinationResponse'
            (Int -> DeleteConfigurationSetEventDestinationResponse)
-> Either String Int
-> Either String DeleteConfigurationSetEventDestinationResponse
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
    DeleteConfigurationSetEventDestination

instance
  Prelude.NFData
    DeleteConfigurationSetEventDestination

instance
  Core.ToHeaders
    DeleteConfigurationSetEventDestination
  where
  toHeaders :: DeleteConfigurationSetEventDestination -> ResponseHeaders
toHeaders = ResponseHeaders
-> DeleteConfigurationSetEventDestination -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance
  Core.ToPath
    DeleteConfigurationSetEventDestination
  where
  toPath :: DeleteConfigurationSetEventDestination -> ByteString
toPath = ByteString -> DeleteConfigurationSetEventDestination -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Core.ToQuery
    DeleteConfigurationSetEventDestination
  where
  toQuery :: DeleteConfigurationSetEventDestination -> QueryString
toQuery DeleteConfigurationSetEventDestination' {Text
eventDestinationName :: Text
configurationSetName :: Text
$sel:eventDestinationName:DeleteConfigurationSetEventDestination' :: DeleteConfigurationSetEventDestination -> Text
$sel:configurationSetName:DeleteConfigurationSetEventDestination' :: DeleteConfigurationSetEventDestination -> 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
"DeleteConfigurationSetEventDestination" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"ConfigurationSetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
configurationSetName,
        ByteString
"EventDestinationName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
eventDestinationName
      ]

-- | An empty element returned on a successful request.
--
-- /See:/ 'newDeleteConfigurationSetEventDestinationResponse' smart constructor.
data DeleteConfigurationSetEventDestinationResponse = DeleteConfigurationSetEventDestinationResponse'
  { -- | The response's http status code.
    DeleteConfigurationSetEventDestinationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteConfigurationSetEventDestinationResponse
-> DeleteConfigurationSetEventDestinationResponse -> Bool
(DeleteConfigurationSetEventDestinationResponse
 -> DeleteConfigurationSetEventDestinationResponse -> Bool)
-> (DeleteConfigurationSetEventDestinationResponse
    -> DeleteConfigurationSetEventDestinationResponse -> Bool)
-> Eq DeleteConfigurationSetEventDestinationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConfigurationSetEventDestinationResponse
-> DeleteConfigurationSetEventDestinationResponse -> Bool
$c/= :: DeleteConfigurationSetEventDestinationResponse
-> DeleteConfigurationSetEventDestinationResponse -> Bool
== :: DeleteConfigurationSetEventDestinationResponse
-> DeleteConfigurationSetEventDestinationResponse -> Bool
$c== :: DeleteConfigurationSetEventDestinationResponse
-> DeleteConfigurationSetEventDestinationResponse -> Bool
Prelude.Eq, ReadPrec [DeleteConfigurationSetEventDestinationResponse]
ReadPrec DeleteConfigurationSetEventDestinationResponse
Int -> ReadS DeleteConfigurationSetEventDestinationResponse
ReadS [DeleteConfigurationSetEventDestinationResponse]
(Int -> ReadS DeleteConfigurationSetEventDestinationResponse)
-> ReadS [DeleteConfigurationSetEventDestinationResponse]
-> ReadPrec DeleteConfigurationSetEventDestinationResponse
-> ReadPrec [DeleteConfigurationSetEventDestinationResponse]
-> Read DeleteConfigurationSetEventDestinationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConfigurationSetEventDestinationResponse]
$creadListPrec :: ReadPrec [DeleteConfigurationSetEventDestinationResponse]
readPrec :: ReadPrec DeleteConfigurationSetEventDestinationResponse
$creadPrec :: ReadPrec DeleteConfigurationSetEventDestinationResponse
readList :: ReadS [DeleteConfigurationSetEventDestinationResponse]
$creadList :: ReadS [DeleteConfigurationSetEventDestinationResponse]
readsPrec :: Int -> ReadS DeleteConfigurationSetEventDestinationResponse
$creadsPrec :: Int -> ReadS DeleteConfigurationSetEventDestinationResponse
Prelude.Read, Int -> DeleteConfigurationSetEventDestinationResponse -> ShowS
[DeleteConfigurationSetEventDestinationResponse] -> ShowS
DeleteConfigurationSetEventDestinationResponse -> String
(Int -> DeleteConfigurationSetEventDestinationResponse -> ShowS)
-> (DeleteConfigurationSetEventDestinationResponse -> String)
-> ([DeleteConfigurationSetEventDestinationResponse] -> ShowS)
-> Show DeleteConfigurationSetEventDestinationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConfigurationSetEventDestinationResponse] -> ShowS
$cshowList :: [DeleteConfigurationSetEventDestinationResponse] -> ShowS
show :: DeleteConfigurationSetEventDestinationResponse -> String
$cshow :: DeleteConfigurationSetEventDestinationResponse -> String
showsPrec :: Int -> DeleteConfigurationSetEventDestinationResponse -> ShowS
$cshowsPrec :: Int -> DeleteConfigurationSetEventDestinationResponse -> ShowS
Prelude.Show, (forall x.
 DeleteConfigurationSetEventDestinationResponse
 -> Rep DeleteConfigurationSetEventDestinationResponse x)
-> (forall x.
    Rep DeleteConfigurationSetEventDestinationResponse x
    -> DeleteConfigurationSetEventDestinationResponse)
-> Generic DeleteConfigurationSetEventDestinationResponse
forall x.
Rep DeleteConfigurationSetEventDestinationResponse x
-> DeleteConfigurationSetEventDestinationResponse
forall x.
DeleteConfigurationSetEventDestinationResponse
-> Rep DeleteConfigurationSetEventDestinationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteConfigurationSetEventDestinationResponse x
-> DeleteConfigurationSetEventDestinationResponse
$cfrom :: forall x.
DeleteConfigurationSetEventDestinationResponse
-> Rep DeleteConfigurationSetEventDestinationResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteConfigurationSetEventDestinationResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'deleteConfigurationSetEventDestinationResponse_httpStatus' - The response's http status code.
newDeleteConfigurationSetEventDestinationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteConfigurationSetEventDestinationResponse
newDeleteConfigurationSetEventDestinationResponse :: Int -> DeleteConfigurationSetEventDestinationResponse
newDeleteConfigurationSetEventDestinationResponse
  Int
pHttpStatus_ =
    DeleteConfigurationSetEventDestinationResponse' :: Int -> DeleteConfigurationSetEventDestinationResponse
DeleteConfigurationSetEventDestinationResponse'
      { $sel:httpStatus:DeleteConfigurationSetEventDestinationResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The response's http status code.
deleteConfigurationSetEventDestinationResponse_httpStatus :: Lens.Lens' DeleteConfigurationSetEventDestinationResponse Prelude.Int
deleteConfigurationSetEventDestinationResponse_httpStatus :: (Int -> f Int)
-> DeleteConfigurationSetEventDestinationResponse
-> f DeleteConfigurationSetEventDestinationResponse
deleteConfigurationSetEventDestinationResponse_httpStatus = (DeleteConfigurationSetEventDestinationResponse -> Int)
-> (DeleteConfigurationSetEventDestinationResponse
    -> Int -> DeleteConfigurationSetEventDestinationResponse)
-> Lens
     DeleteConfigurationSetEventDestinationResponse
     DeleteConfigurationSetEventDestinationResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationSetEventDestinationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteConfigurationSetEventDestinationResponse' :: DeleteConfigurationSetEventDestinationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteConfigurationSetEventDestinationResponse
s@DeleteConfigurationSetEventDestinationResponse' {} Int
a -> DeleteConfigurationSetEventDestinationResponse
s {$sel:httpStatus:DeleteConfigurationSetEventDestinationResponse' :: Int
httpStatus = Int
a} :: DeleteConfigurationSetEventDestinationResponse)

instance
  Prelude.NFData
    DeleteConfigurationSetEventDestinationResponse