{-# 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.UpdateConfigurationSetSendingEnabled
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Enables or disables email sending for messages sent using a specific
-- configuration set in a given AWS Region. You can use this operation in
-- conjunction with Amazon CloudWatch alarms to temporarily pause email
-- sending for a configuration set when the reputation metrics for that
-- configuration set (such as your bounce on complaint rate) exceed certain
-- thresholds.
--
-- You can execute this operation no more than once per second.
module Amazonka.SES.UpdateConfigurationSetSendingEnabled
  ( -- * Creating a Request
    UpdateConfigurationSetSendingEnabled (..),
    newUpdateConfigurationSetSendingEnabled,

    -- * Request Lenses
    updateConfigurationSetSendingEnabled_configurationSetName,
    updateConfigurationSetSendingEnabled_enabled,

    -- * Destructuring the Response
    UpdateConfigurationSetSendingEnabledResponse (..),
    newUpdateConfigurationSetSendingEnabledResponse,
  )
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 enable or disable the email sending capabilities
-- for a specific configuration set.
--
-- /See:/ 'newUpdateConfigurationSetSendingEnabled' smart constructor.
data UpdateConfigurationSetSendingEnabled = UpdateConfigurationSetSendingEnabled'
  { -- | The name of the configuration set that you want to update.
    UpdateConfigurationSetSendingEnabled -> Text
configurationSetName :: Prelude.Text,
    -- | Describes whether email sending is enabled or disabled for the
    -- configuration set.
    UpdateConfigurationSetSendingEnabled -> Bool
enabled :: Prelude.Bool
  }
  deriving (UpdateConfigurationSetSendingEnabled
-> UpdateConfigurationSetSendingEnabled -> Bool
(UpdateConfigurationSetSendingEnabled
 -> UpdateConfigurationSetSendingEnabled -> Bool)
-> (UpdateConfigurationSetSendingEnabled
    -> UpdateConfigurationSetSendingEnabled -> Bool)
-> Eq UpdateConfigurationSetSendingEnabled
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UpdateConfigurationSetSendingEnabled
-> UpdateConfigurationSetSendingEnabled -> Bool
== :: UpdateConfigurationSetSendingEnabled
-> UpdateConfigurationSetSendingEnabled -> Bool
$c/= :: UpdateConfigurationSetSendingEnabled
-> UpdateConfigurationSetSendingEnabled -> Bool
/= :: UpdateConfigurationSetSendingEnabled
-> UpdateConfigurationSetSendingEnabled -> Bool
Prelude.Eq, ReadPrec [UpdateConfigurationSetSendingEnabled]
ReadPrec UpdateConfigurationSetSendingEnabled
Int -> ReadS UpdateConfigurationSetSendingEnabled
ReadS [UpdateConfigurationSetSendingEnabled]
(Int -> ReadS UpdateConfigurationSetSendingEnabled)
-> ReadS [UpdateConfigurationSetSendingEnabled]
-> ReadPrec UpdateConfigurationSetSendingEnabled
-> ReadPrec [UpdateConfigurationSetSendingEnabled]
-> Read UpdateConfigurationSetSendingEnabled
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS UpdateConfigurationSetSendingEnabled
readsPrec :: Int -> ReadS UpdateConfigurationSetSendingEnabled
$creadList :: ReadS [UpdateConfigurationSetSendingEnabled]
readList :: ReadS [UpdateConfigurationSetSendingEnabled]
$creadPrec :: ReadPrec UpdateConfigurationSetSendingEnabled
readPrec :: ReadPrec UpdateConfigurationSetSendingEnabled
$creadListPrec :: ReadPrec [UpdateConfigurationSetSendingEnabled]
readListPrec :: ReadPrec [UpdateConfigurationSetSendingEnabled]
Prelude.Read, Int -> UpdateConfigurationSetSendingEnabled -> ShowS
[UpdateConfigurationSetSendingEnabled] -> ShowS
UpdateConfigurationSetSendingEnabled -> String
(Int -> UpdateConfigurationSetSendingEnabled -> ShowS)
-> (UpdateConfigurationSetSendingEnabled -> String)
-> ([UpdateConfigurationSetSendingEnabled] -> ShowS)
-> Show UpdateConfigurationSetSendingEnabled
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UpdateConfigurationSetSendingEnabled -> ShowS
showsPrec :: Int -> UpdateConfigurationSetSendingEnabled -> ShowS
$cshow :: UpdateConfigurationSetSendingEnabled -> String
show :: UpdateConfigurationSetSendingEnabled -> String
$cshowList :: [UpdateConfigurationSetSendingEnabled] -> ShowS
showList :: [UpdateConfigurationSetSendingEnabled] -> ShowS
Prelude.Show, (forall x.
 UpdateConfigurationSetSendingEnabled
 -> Rep UpdateConfigurationSetSendingEnabled x)
-> (forall x.
    Rep UpdateConfigurationSetSendingEnabled x
    -> UpdateConfigurationSetSendingEnabled)
-> Generic UpdateConfigurationSetSendingEnabled
forall x.
Rep UpdateConfigurationSetSendingEnabled x
-> UpdateConfigurationSetSendingEnabled
forall x.
UpdateConfigurationSetSendingEnabled
-> Rep UpdateConfigurationSetSendingEnabled x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
UpdateConfigurationSetSendingEnabled
-> Rep UpdateConfigurationSetSendingEnabled x
from :: forall x.
UpdateConfigurationSetSendingEnabled
-> Rep UpdateConfigurationSetSendingEnabled x
$cto :: forall x.
Rep UpdateConfigurationSetSendingEnabled x
-> UpdateConfigurationSetSendingEnabled
to :: forall x.
Rep UpdateConfigurationSetSendingEnabled x
-> UpdateConfigurationSetSendingEnabled
Prelude.Generic)

-- |
-- Create a value of 'UpdateConfigurationSetSendingEnabled' 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', 'updateConfigurationSetSendingEnabled_configurationSetName' - The name of the configuration set that you want to update.
--
-- 'enabled', 'updateConfigurationSetSendingEnabled_enabled' - Describes whether email sending is enabled or disabled for the
-- configuration set.
newUpdateConfigurationSetSendingEnabled ::
  -- | 'configurationSetName'
  Prelude.Text ->
  -- | 'enabled'
  Prelude.Bool ->
  UpdateConfigurationSetSendingEnabled
newUpdateConfigurationSetSendingEnabled :: Text -> Bool -> UpdateConfigurationSetSendingEnabled
newUpdateConfigurationSetSendingEnabled
  Text
pConfigurationSetName_
  Bool
pEnabled_ =
    UpdateConfigurationSetSendingEnabled'
      { $sel:configurationSetName:UpdateConfigurationSetSendingEnabled' :: Text
configurationSetName =
          Text
pConfigurationSetName_,
        $sel:enabled:UpdateConfigurationSetSendingEnabled' :: Bool
enabled = Bool
pEnabled_
      }

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

-- | Describes whether email sending is enabled or disabled for the
-- configuration set.
updateConfigurationSetSendingEnabled_enabled :: Lens.Lens' UpdateConfigurationSetSendingEnabled Prelude.Bool
updateConfigurationSetSendingEnabled_enabled :: Lens' UpdateConfigurationSetSendingEnabled Bool
updateConfigurationSetSendingEnabled_enabled = (UpdateConfigurationSetSendingEnabled -> Bool)
-> (UpdateConfigurationSetSendingEnabled
    -> Bool -> UpdateConfigurationSetSendingEnabled)
-> Lens' UpdateConfigurationSetSendingEnabled Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfigurationSetSendingEnabled' {Bool
$sel:enabled:UpdateConfigurationSetSendingEnabled' :: UpdateConfigurationSetSendingEnabled -> Bool
enabled :: Bool
enabled} -> Bool
enabled) (\s :: UpdateConfigurationSetSendingEnabled
s@UpdateConfigurationSetSendingEnabled' {} Bool
a -> UpdateConfigurationSetSendingEnabled
s {enabled = a} :: UpdateConfigurationSetSendingEnabled)

instance
  Core.AWSRequest
    UpdateConfigurationSetSendingEnabled
  where
  type
    AWSResponse UpdateConfigurationSetSendingEnabled =
      UpdateConfigurationSetSendingEnabledResponse
  request :: (Service -> Service)
-> UpdateConfigurationSetSendingEnabled
-> Request UpdateConfigurationSetSendingEnabled
request Service -> Service
overrides =
    Service
-> UpdateConfigurationSetSendingEnabled
-> Request UpdateConfigurationSetSendingEnabled
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 UpdateConfigurationSetSendingEnabled
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateConfigurationSetSendingEnabled)))
response =
    AWSResponse UpdateConfigurationSetSendingEnabled
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateConfigurationSetSendingEnabled
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateConfigurationSetSendingEnabled)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse UpdateConfigurationSetSendingEnabled
UpdateConfigurationSetSendingEnabledResponse
UpdateConfigurationSetSendingEnabledResponse'

instance
  Prelude.Hashable
    UpdateConfigurationSetSendingEnabled
  where
  hashWithSalt :: Int -> UpdateConfigurationSetSendingEnabled -> Int
hashWithSalt
    Int
_salt
    UpdateConfigurationSetSendingEnabled' {Bool
Text
$sel:configurationSetName:UpdateConfigurationSetSendingEnabled' :: UpdateConfigurationSetSendingEnabled -> Text
$sel:enabled:UpdateConfigurationSetSendingEnabled' :: UpdateConfigurationSetSendingEnabled -> Bool
configurationSetName :: Text
enabled :: Bool
..} =
      Int
_salt
        Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
configurationSetName
        Int -> Bool -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enabled

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

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

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

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

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

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

instance
  Prelude.NFData
    UpdateConfigurationSetSendingEnabledResponse
  where
  rnf :: UpdateConfigurationSetSendingEnabledResponse -> ()
rnf UpdateConfigurationSetSendingEnabledResponse
_ = ()