{-# 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.UpdateConfigurationSetReputationMetricsEnabled
-- 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)
--
-- Enables or disables the publishing of reputation metrics for emails sent
-- using a specific configuration set in a given AWS Region. Reputation
-- metrics include bounce and complaint rates. These metrics are published
-- to Amazon CloudWatch. By using CloudWatch, you can create alarms when
-- bounce or complaint rates exceed certain thresholds.
--
-- You can execute this operation no more than once per second.
module Amazonka.SES.UpdateConfigurationSetReputationMetricsEnabled
  ( -- * Creating a Request
    UpdateConfigurationSetReputationMetricsEnabled (..),
    newUpdateConfigurationSetReputationMetricsEnabled,

    -- * Request Lenses
    updateConfigurationSetReputationMetricsEnabled_configurationSetName,
    updateConfigurationSetReputationMetricsEnabled_enabled,

    -- * Destructuring the Response
    UpdateConfigurationSetReputationMetricsEnabledResponse (..),
    newUpdateConfigurationSetReputationMetricsEnabledResponse,
  )
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 modify the reputation metric publishing settings
-- for a configuration set.
--
-- /See:/ 'newUpdateConfigurationSetReputationMetricsEnabled' smart constructor.
data UpdateConfigurationSetReputationMetricsEnabled = UpdateConfigurationSetReputationMetricsEnabled'
  { -- | The name of the configuration set that you want to update.
    UpdateConfigurationSetReputationMetricsEnabled -> Text
configurationSetName :: Prelude.Text,
    -- | Describes whether or not Amazon SES will publish reputation metrics for
    -- the configuration set, such as bounce and complaint rates, to Amazon
    -- CloudWatch.
    UpdateConfigurationSetReputationMetricsEnabled -> Bool
enabled :: Prelude.Bool
  }
  deriving (UpdateConfigurationSetReputationMetricsEnabled
-> UpdateConfigurationSetReputationMetricsEnabled -> Bool
(UpdateConfigurationSetReputationMetricsEnabled
 -> UpdateConfigurationSetReputationMetricsEnabled -> Bool)
-> (UpdateConfigurationSetReputationMetricsEnabled
    -> UpdateConfigurationSetReputationMetricsEnabled -> Bool)
-> Eq UpdateConfigurationSetReputationMetricsEnabled
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConfigurationSetReputationMetricsEnabled
-> UpdateConfigurationSetReputationMetricsEnabled -> Bool
$c/= :: UpdateConfigurationSetReputationMetricsEnabled
-> UpdateConfigurationSetReputationMetricsEnabled -> Bool
== :: UpdateConfigurationSetReputationMetricsEnabled
-> UpdateConfigurationSetReputationMetricsEnabled -> Bool
$c== :: UpdateConfigurationSetReputationMetricsEnabled
-> UpdateConfigurationSetReputationMetricsEnabled -> Bool
Prelude.Eq, ReadPrec [UpdateConfigurationSetReputationMetricsEnabled]
ReadPrec UpdateConfigurationSetReputationMetricsEnabled
Int -> ReadS UpdateConfigurationSetReputationMetricsEnabled
ReadS [UpdateConfigurationSetReputationMetricsEnabled]
(Int -> ReadS UpdateConfigurationSetReputationMetricsEnabled)
-> ReadS [UpdateConfigurationSetReputationMetricsEnabled]
-> ReadPrec UpdateConfigurationSetReputationMetricsEnabled
-> ReadPrec [UpdateConfigurationSetReputationMetricsEnabled]
-> Read UpdateConfigurationSetReputationMetricsEnabled
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConfigurationSetReputationMetricsEnabled]
$creadListPrec :: ReadPrec [UpdateConfigurationSetReputationMetricsEnabled]
readPrec :: ReadPrec UpdateConfigurationSetReputationMetricsEnabled
$creadPrec :: ReadPrec UpdateConfigurationSetReputationMetricsEnabled
readList :: ReadS [UpdateConfigurationSetReputationMetricsEnabled]
$creadList :: ReadS [UpdateConfigurationSetReputationMetricsEnabled]
readsPrec :: Int -> ReadS UpdateConfigurationSetReputationMetricsEnabled
$creadsPrec :: Int -> ReadS UpdateConfigurationSetReputationMetricsEnabled
Prelude.Read, Int -> UpdateConfigurationSetReputationMetricsEnabled -> ShowS
[UpdateConfigurationSetReputationMetricsEnabled] -> ShowS
UpdateConfigurationSetReputationMetricsEnabled -> String
(Int -> UpdateConfigurationSetReputationMetricsEnabled -> ShowS)
-> (UpdateConfigurationSetReputationMetricsEnabled -> String)
-> ([UpdateConfigurationSetReputationMetricsEnabled] -> ShowS)
-> Show UpdateConfigurationSetReputationMetricsEnabled
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConfigurationSetReputationMetricsEnabled] -> ShowS
$cshowList :: [UpdateConfigurationSetReputationMetricsEnabled] -> ShowS
show :: UpdateConfigurationSetReputationMetricsEnabled -> String
$cshow :: UpdateConfigurationSetReputationMetricsEnabled -> String
showsPrec :: Int -> UpdateConfigurationSetReputationMetricsEnabled -> ShowS
$cshowsPrec :: Int -> UpdateConfigurationSetReputationMetricsEnabled -> ShowS
Prelude.Show, (forall x.
 UpdateConfigurationSetReputationMetricsEnabled
 -> Rep UpdateConfigurationSetReputationMetricsEnabled x)
-> (forall x.
    Rep UpdateConfigurationSetReputationMetricsEnabled x
    -> UpdateConfigurationSetReputationMetricsEnabled)
-> Generic UpdateConfigurationSetReputationMetricsEnabled
forall x.
Rep UpdateConfigurationSetReputationMetricsEnabled x
-> UpdateConfigurationSetReputationMetricsEnabled
forall x.
UpdateConfigurationSetReputationMetricsEnabled
-> Rep UpdateConfigurationSetReputationMetricsEnabled x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateConfigurationSetReputationMetricsEnabled x
-> UpdateConfigurationSetReputationMetricsEnabled
$cfrom :: forall x.
UpdateConfigurationSetReputationMetricsEnabled
-> Rep UpdateConfigurationSetReputationMetricsEnabled x
Prelude.Generic)

-- |
-- Create a value of 'UpdateConfigurationSetReputationMetricsEnabled' 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', 'updateConfigurationSetReputationMetricsEnabled_configurationSetName' - The name of the configuration set that you want to update.
--
-- 'enabled', 'updateConfigurationSetReputationMetricsEnabled_enabled' - Describes whether or not Amazon SES will publish reputation metrics for
-- the configuration set, such as bounce and complaint rates, to Amazon
-- CloudWatch.
newUpdateConfigurationSetReputationMetricsEnabled ::
  -- | 'configurationSetName'
  Prelude.Text ->
  -- | 'enabled'
  Prelude.Bool ->
  UpdateConfigurationSetReputationMetricsEnabled
newUpdateConfigurationSetReputationMetricsEnabled :: Text -> Bool -> UpdateConfigurationSetReputationMetricsEnabled
newUpdateConfigurationSetReputationMetricsEnabled
  Text
pConfigurationSetName_
  Bool
pEnabled_ =
    UpdateConfigurationSetReputationMetricsEnabled' :: Text -> Bool -> UpdateConfigurationSetReputationMetricsEnabled
UpdateConfigurationSetReputationMetricsEnabled'
      { $sel:configurationSetName:UpdateConfigurationSetReputationMetricsEnabled' :: Text
configurationSetName =
          Text
pConfigurationSetName_,
        $sel:enabled:UpdateConfigurationSetReputationMetricsEnabled' :: Bool
enabled = Bool
pEnabled_
      }

-- | The name of the configuration set that you want to update.
updateConfigurationSetReputationMetricsEnabled_configurationSetName :: Lens.Lens' UpdateConfigurationSetReputationMetricsEnabled Prelude.Text
updateConfigurationSetReputationMetricsEnabled_configurationSetName :: (Text -> f Text)
-> UpdateConfigurationSetReputationMetricsEnabled
-> f UpdateConfigurationSetReputationMetricsEnabled
updateConfigurationSetReputationMetricsEnabled_configurationSetName = (UpdateConfigurationSetReputationMetricsEnabled -> Text)
-> (UpdateConfigurationSetReputationMetricsEnabled
    -> Text -> UpdateConfigurationSetReputationMetricsEnabled)
-> Lens
     UpdateConfigurationSetReputationMetricsEnabled
     UpdateConfigurationSetReputationMetricsEnabled
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfigurationSetReputationMetricsEnabled' {Text
configurationSetName :: Text
$sel:configurationSetName:UpdateConfigurationSetReputationMetricsEnabled' :: UpdateConfigurationSetReputationMetricsEnabled -> Text
configurationSetName} -> Text
configurationSetName) (\s :: UpdateConfigurationSetReputationMetricsEnabled
s@UpdateConfigurationSetReputationMetricsEnabled' {} Text
a -> UpdateConfigurationSetReputationMetricsEnabled
s {$sel:configurationSetName:UpdateConfigurationSetReputationMetricsEnabled' :: Text
configurationSetName = Text
a} :: UpdateConfigurationSetReputationMetricsEnabled)

-- | Describes whether or not Amazon SES will publish reputation metrics for
-- the configuration set, such as bounce and complaint rates, to Amazon
-- CloudWatch.
updateConfigurationSetReputationMetricsEnabled_enabled :: Lens.Lens' UpdateConfigurationSetReputationMetricsEnabled Prelude.Bool
updateConfigurationSetReputationMetricsEnabled_enabled :: (Bool -> f Bool)
-> UpdateConfigurationSetReputationMetricsEnabled
-> f UpdateConfigurationSetReputationMetricsEnabled
updateConfigurationSetReputationMetricsEnabled_enabled = (UpdateConfigurationSetReputationMetricsEnabled -> Bool)
-> (UpdateConfigurationSetReputationMetricsEnabled
    -> Bool -> UpdateConfigurationSetReputationMetricsEnabled)
-> Lens
     UpdateConfigurationSetReputationMetricsEnabled
     UpdateConfigurationSetReputationMetricsEnabled
     Bool
     Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfigurationSetReputationMetricsEnabled' {Bool
enabled :: Bool
$sel:enabled:UpdateConfigurationSetReputationMetricsEnabled' :: UpdateConfigurationSetReputationMetricsEnabled -> Bool
enabled} -> Bool
enabled) (\s :: UpdateConfigurationSetReputationMetricsEnabled
s@UpdateConfigurationSetReputationMetricsEnabled' {} Bool
a -> UpdateConfigurationSetReputationMetricsEnabled
s {$sel:enabled:UpdateConfigurationSetReputationMetricsEnabled' :: Bool
enabled = Bool
a} :: UpdateConfigurationSetReputationMetricsEnabled)

instance
  Core.AWSRequest
    UpdateConfigurationSetReputationMetricsEnabled
  where
  type
    AWSResponse
      UpdateConfigurationSetReputationMetricsEnabled =
      UpdateConfigurationSetReputationMetricsEnabledResponse
  request :: UpdateConfigurationSetReputationMetricsEnabled
-> Request UpdateConfigurationSetReputationMetricsEnabled
request = Service
-> UpdateConfigurationSetReputationMetricsEnabled
-> Request UpdateConfigurationSetReputationMetricsEnabled
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateConfigurationSetReputationMetricsEnabled
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateConfigurationSetReputationMetricsEnabled)))
response =
    AWSResponse UpdateConfigurationSetReputationMetricsEnabled
-> Logger
-> Service
-> Proxy UpdateConfigurationSetReputationMetricsEnabled
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateConfigurationSetReputationMetricsEnabled)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse UpdateConfigurationSetReputationMetricsEnabled
UpdateConfigurationSetReputationMetricsEnabledResponse
UpdateConfigurationSetReputationMetricsEnabledResponse'

instance
  Prelude.Hashable
    UpdateConfigurationSetReputationMetricsEnabled

instance
  Prelude.NFData
    UpdateConfigurationSetReputationMetricsEnabled

instance
  Core.ToHeaders
    UpdateConfigurationSetReputationMetricsEnabled
  where
  toHeaders :: UpdateConfigurationSetReputationMetricsEnabled -> [Header]
toHeaders = [Header]
-> UpdateConfigurationSetReputationMetricsEnabled -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

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

instance
  Core.ToQuery
    UpdateConfigurationSetReputationMetricsEnabled
  where
  toQuery :: UpdateConfigurationSetReputationMetricsEnabled -> QueryString
toQuery
    UpdateConfigurationSetReputationMetricsEnabled' {Bool
Text
enabled :: Bool
configurationSetName :: Text
$sel:enabled:UpdateConfigurationSetReputationMetricsEnabled' :: UpdateConfigurationSetReputationMetricsEnabled -> Bool
$sel:configurationSetName:UpdateConfigurationSetReputationMetricsEnabled' :: UpdateConfigurationSetReputationMetricsEnabled -> 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
"UpdateConfigurationSetReputationMetricsEnabled" ::
                        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
"Enabled" ByteString -> Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Bool
enabled
        ]

-- | /See:/ 'newUpdateConfigurationSetReputationMetricsEnabledResponse' smart constructor.
data UpdateConfigurationSetReputationMetricsEnabledResponse = UpdateConfigurationSetReputationMetricsEnabledResponse'
  {
  }
  deriving (UpdateConfigurationSetReputationMetricsEnabledResponse
-> UpdateConfigurationSetReputationMetricsEnabledResponse -> Bool
(UpdateConfigurationSetReputationMetricsEnabledResponse
 -> UpdateConfigurationSetReputationMetricsEnabledResponse -> Bool)
-> (UpdateConfigurationSetReputationMetricsEnabledResponse
    -> UpdateConfigurationSetReputationMetricsEnabledResponse -> Bool)
-> Eq UpdateConfigurationSetReputationMetricsEnabledResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConfigurationSetReputationMetricsEnabledResponse
-> UpdateConfigurationSetReputationMetricsEnabledResponse -> Bool
$c/= :: UpdateConfigurationSetReputationMetricsEnabledResponse
-> UpdateConfigurationSetReputationMetricsEnabledResponse -> Bool
== :: UpdateConfigurationSetReputationMetricsEnabledResponse
-> UpdateConfigurationSetReputationMetricsEnabledResponse -> Bool
$c== :: UpdateConfigurationSetReputationMetricsEnabledResponse
-> UpdateConfigurationSetReputationMetricsEnabledResponse -> Bool
Prelude.Eq, ReadPrec [UpdateConfigurationSetReputationMetricsEnabledResponse]
ReadPrec UpdateConfigurationSetReputationMetricsEnabledResponse
Int -> ReadS UpdateConfigurationSetReputationMetricsEnabledResponse
ReadS [UpdateConfigurationSetReputationMetricsEnabledResponse]
(Int
 -> ReadS UpdateConfigurationSetReputationMetricsEnabledResponse)
-> ReadS [UpdateConfigurationSetReputationMetricsEnabledResponse]
-> ReadPrec UpdateConfigurationSetReputationMetricsEnabledResponse
-> ReadPrec
     [UpdateConfigurationSetReputationMetricsEnabledResponse]
-> Read UpdateConfigurationSetReputationMetricsEnabledResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConfigurationSetReputationMetricsEnabledResponse]
$creadListPrec :: ReadPrec [UpdateConfigurationSetReputationMetricsEnabledResponse]
readPrec :: ReadPrec UpdateConfigurationSetReputationMetricsEnabledResponse
$creadPrec :: ReadPrec UpdateConfigurationSetReputationMetricsEnabledResponse
readList :: ReadS [UpdateConfigurationSetReputationMetricsEnabledResponse]
$creadList :: ReadS [UpdateConfigurationSetReputationMetricsEnabledResponse]
readsPrec :: Int -> ReadS UpdateConfigurationSetReputationMetricsEnabledResponse
$creadsPrec :: Int -> ReadS UpdateConfigurationSetReputationMetricsEnabledResponse
Prelude.Read, Int
-> UpdateConfigurationSetReputationMetricsEnabledResponse -> ShowS
[UpdateConfigurationSetReputationMetricsEnabledResponse] -> ShowS
UpdateConfigurationSetReputationMetricsEnabledResponse -> String
(Int
 -> UpdateConfigurationSetReputationMetricsEnabledResponse -> ShowS)
-> (UpdateConfigurationSetReputationMetricsEnabledResponse
    -> String)
-> ([UpdateConfigurationSetReputationMetricsEnabledResponse]
    -> ShowS)
-> Show UpdateConfigurationSetReputationMetricsEnabledResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConfigurationSetReputationMetricsEnabledResponse] -> ShowS
$cshowList :: [UpdateConfigurationSetReputationMetricsEnabledResponse] -> ShowS
show :: UpdateConfigurationSetReputationMetricsEnabledResponse -> String
$cshow :: UpdateConfigurationSetReputationMetricsEnabledResponse -> String
showsPrec :: Int
-> UpdateConfigurationSetReputationMetricsEnabledResponse -> ShowS
$cshowsPrec :: Int
-> UpdateConfigurationSetReputationMetricsEnabledResponse -> ShowS
Prelude.Show, (forall x.
 UpdateConfigurationSetReputationMetricsEnabledResponse
 -> Rep UpdateConfigurationSetReputationMetricsEnabledResponse x)
-> (forall x.
    Rep UpdateConfigurationSetReputationMetricsEnabledResponse x
    -> UpdateConfigurationSetReputationMetricsEnabledResponse)
-> Generic UpdateConfigurationSetReputationMetricsEnabledResponse
forall x.
Rep UpdateConfigurationSetReputationMetricsEnabledResponse x
-> UpdateConfigurationSetReputationMetricsEnabledResponse
forall x.
UpdateConfigurationSetReputationMetricsEnabledResponse
-> Rep UpdateConfigurationSetReputationMetricsEnabledResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateConfigurationSetReputationMetricsEnabledResponse x
-> UpdateConfigurationSetReputationMetricsEnabledResponse
$cfrom :: forall x.
UpdateConfigurationSetReputationMetricsEnabledResponse
-> Rep UpdateConfigurationSetReputationMetricsEnabledResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateConfigurationSetReputationMetricsEnabledResponse' 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.
newUpdateConfigurationSetReputationMetricsEnabledResponse ::
  UpdateConfigurationSetReputationMetricsEnabledResponse
newUpdateConfigurationSetReputationMetricsEnabledResponse :: UpdateConfigurationSetReputationMetricsEnabledResponse
newUpdateConfigurationSetReputationMetricsEnabledResponse =
  UpdateConfigurationSetReputationMetricsEnabledResponse
UpdateConfigurationSetReputationMetricsEnabledResponse'

instance
  Prelude.NFData
    UpdateConfigurationSetReputationMetricsEnabledResponse