{-# 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-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 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.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 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
(UpdateAccountSendingEnabled
 -> UpdateAccountSendingEnabled -> Bool)
-> (UpdateAccountSendingEnabled
    -> UpdateAccountSendingEnabled -> Bool)
-> Eq UpdateAccountSendingEnabled
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]
(Int -> ReadS UpdateAccountSendingEnabled)
-> ReadS [UpdateAccountSendingEnabled]
-> ReadPrec UpdateAccountSendingEnabled
-> ReadPrec [UpdateAccountSendingEnabled]
-> Read 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
(Int -> UpdateAccountSendingEnabled -> ShowS)
-> (UpdateAccountSendingEnabled -> String)
-> ([UpdateAccountSendingEnabled] -> ShowS)
-> Show UpdateAccountSendingEnabled
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.
 UpdateAccountSendingEnabled -> Rep UpdateAccountSendingEnabled x)
-> (forall x.
    Rep UpdateAccountSendingEnabled x -> UpdateAccountSendingEnabled)
-> Generic UpdateAccountSendingEnabled
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' :: Maybe Bool -> UpdateAccountSendingEnabled
UpdateAccountSendingEnabled'
    { $sel:enabled:UpdateAccountSendingEnabled' :: Maybe Bool
enabled =
        Maybe Bool
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 :: (Maybe Bool -> f (Maybe Bool))
-> UpdateAccountSendingEnabled -> f UpdateAccountSendingEnabled
updateAccountSendingEnabled_enabled = (UpdateAccountSendingEnabled -> Maybe Bool)
-> (UpdateAccountSendingEnabled
    -> Maybe Bool -> UpdateAccountSendingEnabled)
-> Lens
     UpdateAccountSendingEnabled
     UpdateAccountSendingEnabled
     (Maybe Bool)
     (Maybe Bool)
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 :: UpdateAccountSendingEnabled -> Request UpdateAccountSendingEnabled
request = Service
-> UpdateAccountSendingEnabled
-> Request UpdateAccountSendingEnabled
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateAccountSendingEnabled
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateAccountSendingEnabled)))
response =
    AWSResponse UpdateAccountSendingEnabled
-> Logger
-> Service
-> Proxy UpdateAccountSendingEnabled
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateAccountSendingEnabled)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse UpdateAccountSendingEnabled
UpdateAccountSendingEnabledResponse
UpdateAccountSendingEnabledResponse'

instance Prelude.Hashable UpdateAccountSendingEnabled

instance Prelude.NFData UpdateAccountSendingEnabled

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

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

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

-- | /See:/ 'newUpdateAccountSendingEnabledResponse' smart constructor.
data UpdateAccountSendingEnabledResponse = UpdateAccountSendingEnabledResponse'
  {
  }
  deriving (UpdateAccountSendingEnabledResponse
-> UpdateAccountSendingEnabledResponse -> Bool
(UpdateAccountSendingEnabledResponse
 -> UpdateAccountSendingEnabledResponse -> Bool)
-> (UpdateAccountSendingEnabledResponse
    -> UpdateAccountSendingEnabledResponse -> Bool)
-> Eq UpdateAccountSendingEnabledResponse
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]
(Int -> ReadS UpdateAccountSendingEnabledResponse)
-> ReadS [UpdateAccountSendingEnabledResponse]
-> ReadPrec UpdateAccountSendingEnabledResponse
-> ReadPrec [UpdateAccountSendingEnabledResponse]
-> Read 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
(Int -> UpdateAccountSendingEnabledResponse -> ShowS)
-> (UpdateAccountSendingEnabledResponse -> String)
-> ([UpdateAccountSendingEnabledResponse] -> ShowS)
-> Show UpdateAccountSendingEnabledResponse
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.
 UpdateAccountSendingEnabledResponse
 -> Rep UpdateAccountSendingEnabledResponse x)
-> (forall x.
    Rep UpdateAccountSendingEnabledResponse x
    -> UpdateAccountSendingEnabledResponse)
-> Generic UpdateAccountSendingEnabledResponse
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