{-# 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.DeleteConfigurationSetTrackingOptions
-- 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 an association between a configuration set and a custom domain
-- for open and click event tracking.
--
-- By default, images and links used for tracking open and click events are
-- hosted on domains operated by Amazon SES. You can configure a subdomain
-- of your own to handle these events. For information about using custom
-- domains, see the
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/configure-custom-open-click-domains.html Amazon SES Developer Guide>.
--
-- Deleting this kind of association will result in emails sent using the
-- specified configuration set to capture open and click events using the
-- standard, Amazon SES-operated domains.
module Amazonka.SES.DeleteConfigurationSetTrackingOptions
  ( -- * Creating a Request
    DeleteConfigurationSetTrackingOptions (..),
    newDeleteConfigurationSetTrackingOptions,

    -- * Request Lenses
    deleteConfigurationSetTrackingOptions_configurationSetName,

    -- * Destructuring the Response
    DeleteConfigurationSetTrackingOptionsResponse (..),
    newDeleteConfigurationSetTrackingOptionsResponse,

    -- * Response Lenses
    deleteConfigurationSetTrackingOptionsResponse_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 open and click tracking options in a
-- configuration set.
--
-- /See:/ 'newDeleteConfigurationSetTrackingOptions' smart constructor.
data DeleteConfigurationSetTrackingOptions = DeleteConfigurationSetTrackingOptions'
  { -- | The name of the configuration set from which you want to delete the
    -- tracking options.
    DeleteConfigurationSetTrackingOptions -> Text
configurationSetName :: Prelude.Text
  }
  deriving (DeleteConfigurationSetTrackingOptions
-> DeleteConfigurationSetTrackingOptions -> Bool
(DeleteConfigurationSetTrackingOptions
 -> DeleteConfigurationSetTrackingOptions -> Bool)
-> (DeleteConfigurationSetTrackingOptions
    -> DeleteConfigurationSetTrackingOptions -> Bool)
-> Eq DeleteConfigurationSetTrackingOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteConfigurationSetTrackingOptions
-> DeleteConfigurationSetTrackingOptions -> Bool
== :: DeleteConfigurationSetTrackingOptions
-> DeleteConfigurationSetTrackingOptions -> Bool
$c/= :: DeleteConfigurationSetTrackingOptions
-> DeleteConfigurationSetTrackingOptions -> Bool
/= :: DeleteConfigurationSetTrackingOptions
-> DeleteConfigurationSetTrackingOptions -> Bool
Prelude.Eq, ReadPrec [DeleteConfigurationSetTrackingOptions]
ReadPrec DeleteConfigurationSetTrackingOptions
Int -> ReadS DeleteConfigurationSetTrackingOptions
ReadS [DeleteConfigurationSetTrackingOptions]
(Int -> ReadS DeleteConfigurationSetTrackingOptions)
-> ReadS [DeleteConfigurationSetTrackingOptions]
-> ReadPrec DeleteConfigurationSetTrackingOptions
-> ReadPrec [DeleteConfigurationSetTrackingOptions]
-> Read DeleteConfigurationSetTrackingOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS DeleteConfigurationSetTrackingOptions
readsPrec :: Int -> ReadS DeleteConfigurationSetTrackingOptions
$creadList :: ReadS [DeleteConfigurationSetTrackingOptions]
readList :: ReadS [DeleteConfigurationSetTrackingOptions]
$creadPrec :: ReadPrec DeleteConfigurationSetTrackingOptions
readPrec :: ReadPrec DeleteConfigurationSetTrackingOptions
$creadListPrec :: ReadPrec [DeleteConfigurationSetTrackingOptions]
readListPrec :: ReadPrec [DeleteConfigurationSetTrackingOptions]
Prelude.Read, Int -> DeleteConfigurationSetTrackingOptions -> ShowS
[DeleteConfigurationSetTrackingOptions] -> ShowS
DeleteConfigurationSetTrackingOptions -> String
(Int -> DeleteConfigurationSetTrackingOptions -> ShowS)
-> (DeleteConfigurationSetTrackingOptions -> String)
-> ([DeleteConfigurationSetTrackingOptions] -> ShowS)
-> Show DeleteConfigurationSetTrackingOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteConfigurationSetTrackingOptions -> ShowS
showsPrec :: Int -> DeleteConfigurationSetTrackingOptions -> ShowS
$cshow :: DeleteConfigurationSetTrackingOptions -> String
show :: DeleteConfigurationSetTrackingOptions -> String
$cshowList :: [DeleteConfigurationSetTrackingOptions] -> ShowS
showList :: [DeleteConfigurationSetTrackingOptions] -> ShowS
Prelude.Show, (forall x.
 DeleteConfigurationSetTrackingOptions
 -> Rep DeleteConfigurationSetTrackingOptions x)
-> (forall x.
    Rep DeleteConfigurationSetTrackingOptions x
    -> DeleteConfigurationSetTrackingOptions)
-> Generic DeleteConfigurationSetTrackingOptions
forall x.
Rep DeleteConfigurationSetTrackingOptions x
-> DeleteConfigurationSetTrackingOptions
forall x.
DeleteConfigurationSetTrackingOptions
-> Rep DeleteConfigurationSetTrackingOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
DeleteConfigurationSetTrackingOptions
-> Rep DeleteConfigurationSetTrackingOptions x
from :: forall x.
DeleteConfigurationSetTrackingOptions
-> Rep DeleteConfigurationSetTrackingOptions x
$cto :: forall x.
Rep DeleteConfigurationSetTrackingOptions x
-> DeleteConfigurationSetTrackingOptions
to :: forall x.
Rep DeleteConfigurationSetTrackingOptions x
-> DeleteConfigurationSetTrackingOptions
Prelude.Generic)

-- |
-- Create a value of 'DeleteConfigurationSetTrackingOptions' 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', 'deleteConfigurationSetTrackingOptions_configurationSetName' - The name of the configuration set from which you want to delete the
-- tracking options.
newDeleteConfigurationSetTrackingOptions ::
  -- | 'configurationSetName'
  Prelude.Text ->
  DeleteConfigurationSetTrackingOptions
newDeleteConfigurationSetTrackingOptions :: Text -> DeleteConfigurationSetTrackingOptions
newDeleteConfigurationSetTrackingOptions
  Text
pConfigurationSetName_ =
    DeleteConfigurationSetTrackingOptions'
      { $sel:configurationSetName:DeleteConfigurationSetTrackingOptions' :: Text
configurationSetName =
          Text
pConfigurationSetName_
      }

-- | The name of the configuration set from which you want to delete the
-- tracking options.
deleteConfigurationSetTrackingOptions_configurationSetName :: Lens.Lens' DeleteConfigurationSetTrackingOptions Prelude.Text
deleteConfigurationSetTrackingOptions_configurationSetName :: Lens' DeleteConfigurationSetTrackingOptions Text
deleteConfigurationSetTrackingOptions_configurationSetName = (DeleteConfigurationSetTrackingOptions -> Text)
-> (DeleteConfigurationSetTrackingOptions
    -> Text -> DeleteConfigurationSetTrackingOptions)
-> Lens' DeleteConfigurationSetTrackingOptions Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationSetTrackingOptions' {Text
$sel:configurationSetName:DeleteConfigurationSetTrackingOptions' :: DeleteConfigurationSetTrackingOptions -> Text
configurationSetName :: Text
configurationSetName} -> Text
configurationSetName) (\s :: DeleteConfigurationSetTrackingOptions
s@DeleteConfigurationSetTrackingOptions' {} Text
a -> DeleteConfigurationSetTrackingOptions
s {configurationSetName = a} :: DeleteConfigurationSetTrackingOptions)

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

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

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

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

instance
  Data.ToQuery
    DeleteConfigurationSetTrackingOptions
  where
  toQuery :: DeleteConfigurationSetTrackingOptions -> QueryString
toQuery DeleteConfigurationSetTrackingOptions' {Text
$sel:configurationSetName:DeleteConfigurationSetTrackingOptions' :: DeleteConfigurationSetTrackingOptions -> Text
configurationSetName :: Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DeleteConfigurationSetTrackingOptions" ::
                      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
      ]

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

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

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

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