{-# 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.UpdateAccountSendingEnabled
-- 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 across your entire Amazon SES account
-- in the current AWS Region. You can use this operation in conjunction
-- with Amazon CloudWatch alarms to temporarily pause email sending across
-- your Amazon SES account in a given AWS Region when reputation metrics
-- (such as your bounce or complaint rates) reach certain thresholds.
--
-- You can execute this operation no more than once per second.
module Amazonka.SES.UpdateAccountSendingEnabled
  ( -- * Creating a Request
    UpdateAccountSendingEnabled (..),
    newUpdateAccountSendingEnabled,

    -- * Request Lenses
    updateAccountSendingEnabled_enabled,

    -- * Destructuring the Response
    UpdateAccountSendingEnabledResponse (..),
    newUpdateAccountSendingEnabledResponse,
  )
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 your entire Amazon SES account.
--
-- /See:/ 'newUpdateAccountSendingEnabled' smart constructor.
data UpdateAccountSendingEnabled = UpdateAccountSendingEnabled'
  { -- | Describes whether email sending is enabled or disabled for your Amazon
    -- SES account in the current AWS Region.
    UpdateAccountSendingEnabled -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (UpdateAccountSendingEnabled -> UpdateAccountSendingEnabled -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAccountSendingEnabled -> UpdateAccountSendingEnabled -> Bool
$c/= :: UpdateAccountSendingEnabled -> UpdateAccountSendingEnabled -> Bool
== :: UpdateAccountSendingEnabled -> UpdateAccountSendingEnabled -> Bool
$c== :: UpdateAccountSendingEnabled -> UpdateAccountSendingEnabled -> Bool
Prelude.Eq, ReadPrec [UpdateAccountSendingEnabled]
ReadPrec UpdateAccountSendingEnabled
Int -> ReadS UpdateAccountSendingEnabled
ReadS [UpdateAccountSendingEnabled]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAccountSendingEnabled]
$creadListPrec :: ReadPrec [UpdateAccountSendingEnabled]
readPrec :: ReadPrec UpdateAccountSendingEnabled
$creadPrec :: ReadPrec UpdateAccountSendingEnabled
readList :: ReadS [UpdateAccountSendingEnabled]
$creadList :: ReadS [UpdateAccountSendingEnabled]
readsPrec :: Int -> ReadS UpdateAccountSendingEnabled
$creadsPrec :: Int -> ReadS UpdateAccountSendingEnabled
Prelude.Read, Int -> UpdateAccountSendingEnabled -> ShowS
[UpdateAccountSendingEnabled] -> ShowS
UpdateAccountSendingEnabled -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAccountSendingEnabled] -> ShowS
$cshowList :: [UpdateAccountSendingEnabled] -> ShowS
show :: UpdateAccountSendingEnabled -> String
$cshow :: UpdateAccountSendingEnabled -> String
showsPrec :: Int -> UpdateAccountSendingEnabled -> ShowS
$cshowsPrec :: Int -> UpdateAccountSendingEnabled -> ShowS
Prelude.Show, forall x.
Rep UpdateAccountSendingEnabled x -> UpdateAccountSendingEnabled
forall x.
UpdateAccountSendingEnabled -> Rep UpdateAccountSendingEnabled x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAccountSendingEnabled x -> UpdateAccountSendingEnabled
$cfrom :: forall x.
UpdateAccountSendingEnabled -> Rep UpdateAccountSendingEnabled x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAccountSendingEnabled' 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:
--
-- 'enabled', 'updateAccountSendingEnabled_enabled' - Describes whether email sending is enabled or disabled for your Amazon
-- SES account in the current AWS Region.
newUpdateAccountSendingEnabled ::
  UpdateAccountSendingEnabled
newUpdateAccountSendingEnabled :: UpdateAccountSendingEnabled
newUpdateAccountSendingEnabled =
  UpdateAccountSendingEnabled'
    { $sel:enabled:UpdateAccountSendingEnabled' :: Maybe Bool
enabled =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Describes whether email sending is enabled or disabled for your Amazon
-- SES account in the current AWS Region.
updateAccountSendingEnabled_enabled :: Lens.Lens' UpdateAccountSendingEnabled (Prelude.Maybe Prelude.Bool)
updateAccountSendingEnabled_enabled :: Lens' UpdateAccountSendingEnabled (Maybe Bool)
updateAccountSendingEnabled_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccountSendingEnabled' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:UpdateAccountSendingEnabled' :: UpdateAccountSendingEnabled -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: UpdateAccountSendingEnabled
s@UpdateAccountSendingEnabled' {} Maybe Bool
a -> UpdateAccountSendingEnabled
s {$sel:enabled:UpdateAccountSendingEnabled' :: Maybe Bool
enabled = Maybe Bool
a} :: UpdateAccountSendingEnabled)

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

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

instance Prelude.NFData UpdateAccountSendingEnabled where
  rnf :: UpdateAccountSendingEnabled -> ()
rnf UpdateAccountSendingEnabled' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:UpdateAccountSendingEnabled' :: UpdateAccountSendingEnabled -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled

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

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

instance Data.ToQuery UpdateAccountSendingEnabled where
  toQuery :: UpdateAccountSendingEnabled -> QueryString
toQuery UpdateAccountSendingEnabled' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:UpdateAccountSendingEnabled' :: UpdateAccountSendingEnabled -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"UpdateAccountSendingEnabled" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"Enabled" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
enabled
      ]

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

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

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