{-# 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.DeleteConfigurationSet
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a configuration set. Configuration sets 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.DeleteConfigurationSet
  ( -- * Creating a Request
    DeleteConfigurationSet (..),
    newDeleteConfigurationSet,

    -- * Request Lenses
    deleteConfigurationSet_configurationSetName,

    -- * Destructuring the Response
    DeleteConfigurationSetResponse (..),
    newDeleteConfigurationSetResponse,

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

-- | Represents a request to delete a configuration set. Configuration sets
-- 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:/ 'newDeleteConfigurationSet' smart constructor.
data DeleteConfigurationSet = DeleteConfigurationSet'
  { -- | The name of the configuration set to delete.
    DeleteConfigurationSet -> Text
configurationSetName :: Prelude.Text
  }
  deriving (DeleteConfigurationSet -> DeleteConfigurationSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConfigurationSet -> DeleteConfigurationSet -> Bool
$c/= :: DeleteConfigurationSet -> DeleteConfigurationSet -> Bool
== :: DeleteConfigurationSet -> DeleteConfigurationSet -> Bool
$c== :: DeleteConfigurationSet -> DeleteConfigurationSet -> Bool
Prelude.Eq, ReadPrec [DeleteConfigurationSet]
ReadPrec DeleteConfigurationSet
Int -> ReadS DeleteConfigurationSet
ReadS [DeleteConfigurationSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConfigurationSet]
$creadListPrec :: ReadPrec [DeleteConfigurationSet]
readPrec :: ReadPrec DeleteConfigurationSet
$creadPrec :: ReadPrec DeleteConfigurationSet
readList :: ReadS [DeleteConfigurationSet]
$creadList :: ReadS [DeleteConfigurationSet]
readsPrec :: Int -> ReadS DeleteConfigurationSet
$creadsPrec :: Int -> ReadS DeleteConfigurationSet
Prelude.Read, Int -> DeleteConfigurationSet -> ShowS
[DeleteConfigurationSet] -> ShowS
DeleteConfigurationSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConfigurationSet] -> ShowS
$cshowList :: [DeleteConfigurationSet] -> ShowS
show :: DeleteConfigurationSet -> String
$cshow :: DeleteConfigurationSet -> String
showsPrec :: Int -> DeleteConfigurationSet -> ShowS
$cshowsPrec :: Int -> DeleteConfigurationSet -> ShowS
Prelude.Show, forall x. Rep DeleteConfigurationSet x -> DeleteConfigurationSet
forall x. DeleteConfigurationSet -> Rep DeleteConfigurationSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteConfigurationSet x -> DeleteConfigurationSet
$cfrom :: forall x. DeleteConfigurationSet -> Rep DeleteConfigurationSet x
Prelude.Generic)

-- |
-- Create a value of 'DeleteConfigurationSet' 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', 'deleteConfigurationSet_configurationSetName' - The name of the configuration set to delete.
newDeleteConfigurationSet ::
  -- | 'configurationSetName'
  Prelude.Text ->
  DeleteConfigurationSet
newDeleteConfigurationSet :: Text -> DeleteConfigurationSet
newDeleteConfigurationSet Text
pConfigurationSetName_ =
  DeleteConfigurationSet'
    { $sel:configurationSetName:DeleteConfigurationSet' :: Text
configurationSetName =
        Text
pConfigurationSetName_
    }

-- | The name of the configuration set to delete.
deleteConfigurationSet_configurationSetName :: Lens.Lens' DeleteConfigurationSet Prelude.Text
deleteConfigurationSet_configurationSetName :: Lens' DeleteConfigurationSet Text
deleteConfigurationSet_configurationSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationSet' {Text
configurationSetName :: Text
$sel:configurationSetName:DeleteConfigurationSet' :: DeleteConfigurationSet -> Text
configurationSetName} -> Text
configurationSetName) (\s :: DeleteConfigurationSet
s@DeleteConfigurationSet' {} Text
a -> DeleteConfigurationSet
s {$sel:configurationSetName:DeleteConfigurationSet' :: Text
configurationSetName = Text
a} :: DeleteConfigurationSet)

instance Core.AWSRequest DeleteConfigurationSet where
  type
    AWSResponse DeleteConfigurationSet =
      DeleteConfigurationSetResponse
  request :: (Service -> Service)
-> DeleteConfigurationSet -> Request DeleteConfigurationSet
request Service -> Service
overrides =
    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 DeleteConfigurationSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteConfigurationSet)))
response =
    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
"DeleteConfigurationSetResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> DeleteConfigurationSetResponse
DeleteConfigurationSetResponse'
            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 DeleteConfigurationSet where
  hashWithSalt :: Int -> DeleteConfigurationSet -> Int
hashWithSalt Int
_salt DeleteConfigurationSet' {Text
configurationSetName :: Text
$sel:configurationSetName:DeleteConfigurationSet' :: DeleteConfigurationSet -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
configurationSetName

instance Prelude.NFData DeleteConfigurationSet where
  rnf :: DeleteConfigurationSet -> ()
rnf DeleteConfigurationSet' {Text
configurationSetName :: Text
$sel:configurationSetName:DeleteConfigurationSet' :: DeleteConfigurationSet -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
configurationSetName

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

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

instance Data.ToQuery DeleteConfigurationSet where
  toQuery :: DeleteConfigurationSet -> QueryString
toQuery DeleteConfigurationSet' {Text
configurationSetName :: Text
$sel:configurationSetName:DeleteConfigurationSet' :: DeleteConfigurationSet -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DeleteConfigurationSet" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"ConfigurationSetName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
configurationSetName
      ]

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

-- |
-- Create a value of 'DeleteConfigurationSetResponse' 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', 'deleteConfigurationSetResponse_httpStatus' - The response's http status code.
newDeleteConfigurationSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteConfigurationSetResponse
newDeleteConfigurationSetResponse :: Int -> DeleteConfigurationSetResponse
newDeleteConfigurationSetResponse Int
pHttpStatus_ =
  DeleteConfigurationSetResponse'
    { $sel:httpStatus:DeleteConfigurationSetResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    DeleteConfigurationSetResponse
  where
  rnf :: DeleteConfigurationSetResponse -> ()
rnf DeleteConfigurationSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteConfigurationSetResponse' :: DeleteConfigurationSetResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus