{-# 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.UpdateConfigurationSetTrackingOptions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies 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>.
module Amazonka.SES.UpdateConfigurationSetTrackingOptions
  ( -- * Creating a Request
    UpdateConfigurationSetTrackingOptions (..),
    newUpdateConfigurationSetTrackingOptions,

    -- * Request Lenses
    updateConfigurationSetTrackingOptions_configurationSetName,
    updateConfigurationSetTrackingOptions_trackingOptions,

    -- * Destructuring the Response
    UpdateConfigurationSetTrackingOptionsResponse (..),
    newUpdateConfigurationSetTrackingOptionsResponse,

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

-- |
-- Create a value of 'UpdateConfigurationSetTrackingOptions' 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', 'updateConfigurationSetTrackingOptions_configurationSetName' - The name of the configuration set for which you want to update the
-- custom tracking domain.
--
-- 'trackingOptions', 'updateConfigurationSetTrackingOptions_trackingOptions' - Undocumented member.
newUpdateConfigurationSetTrackingOptions ::
  -- | 'configurationSetName'
  Prelude.Text ->
  -- | 'trackingOptions'
  TrackingOptions ->
  UpdateConfigurationSetTrackingOptions
newUpdateConfigurationSetTrackingOptions :: Text -> TrackingOptions -> UpdateConfigurationSetTrackingOptions
newUpdateConfigurationSetTrackingOptions
  Text
pConfigurationSetName_
  TrackingOptions
pTrackingOptions_ =
    UpdateConfigurationSetTrackingOptions'
      { $sel:configurationSetName:UpdateConfigurationSetTrackingOptions' :: Text
configurationSetName =
          Text
pConfigurationSetName_,
        $sel:trackingOptions:UpdateConfigurationSetTrackingOptions' :: TrackingOptions
trackingOptions = TrackingOptions
pTrackingOptions_
      }

-- | The name of the configuration set for which you want to update the
-- custom tracking domain.
updateConfigurationSetTrackingOptions_configurationSetName :: Lens.Lens' UpdateConfigurationSetTrackingOptions Prelude.Text
updateConfigurationSetTrackingOptions_configurationSetName :: Lens' UpdateConfigurationSetTrackingOptions Text
updateConfigurationSetTrackingOptions_configurationSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfigurationSetTrackingOptions' {Text
configurationSetName :: Text
$sel:configurationSetName:UpdateConfigurationSetTrackingOptions' :: UpdateConfigurationSetTrackingOptions -> Text
configurationSetName} -> Text
configurationSetName) (\s :: UpdateConfigurationSetTrackingOptions
s@UpdateConfigurationSetTrackingOptions' {} Text
a -> UpdateConfigurationSetTrackingOptions
s {$sel:configurationSetName:UpdateConfigurationSetTrackingOptions' :: Text
configurationSetName = Text
a} :: UpdateConfigurationSetTrackingOptions)

-- | Undocumented member.
updateConfigurationSetTrackingOptions_trackingOptions :: Lens.Lens' UpdateConfigurationSetTrackingOptions TrackingOptions
updateConfigurationSetTrackingOptions_trackingOptions :: Lens' UpdateConfigurationSetTrackingOptions TrackingOptions
updateConfigurationSetTrackingOptions_trackingOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfigurationSetTrackingOptions' {TrackingOptions
trackingOptions :: TrackingOptions
$sel:trackingOptions:UpdateConfigurationSetTrackingOptions' :: UpdateConfigurationSetTrackingOptions -> TrackingOptions
trackingOptions} -> TrackingOptions
trackingOptions) (\s :: UpdateConfigurationSetTrackingOptions
s@UpdateConfigurationSetTrackingOptions' {} TrackingOptions
a -> UpdateConfigurationSetTrackingOptions
s {$sel:trackingOptions:UpdateConfigurationSetTrackingOptions' :: TrackingOptions
trackingOptions = TrackingOptions
a} :: UpdateConfigurationSetTrackingOptions)

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

instance
  Prelude.NFData
    UpdateConfigurationSetTrackingOptions
  where
  rnf :: UpdateConfigurationSetTrackingOptions -> ()
rnf UpdateConfigurationSetTrackingOptions' {Text
TrackingOptions
trackingOptions :: TrackingOptions
configurationSetName :: Text
$sel:trackingOptions:UpdateConfigurationSetTrackingOptions' :: UpdateConfigurationSetTrackingOptions -> TrackingOptions
$sel:configurationSetName:UpdateConfigurationSetTrackingOptions' :: UpdateConfigurationSetTrackingOptions -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
configurationSetName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TrackingOptions
trackingOptions

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

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

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

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

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

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

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