{-# 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.SESV2.PutAccountDedicatedIpWarmupAttributes
-- 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)
--
-- Enable or disable the automatic warm-up feature for dedicated IP
-- addresses.
module Amazonka.SESV2.PutAccountDedicatedIpWarmupAttributes
  ( -- * Creating a Request
    PutAccountDedicatedIpWarmupAttributes (..),
    newPutAccountDedicatedIpWarmupAttributes,

    -- * Request Lenses
    putAccountDedicatedIpWarmupAttributes_autoWarmupEnabled,

    -- * Destructuring the Response
    PutAccountDedicatedIpWarmupAttributesResponse (..),
    newPutAccountDedicatedIpWarmupAttributesResponse,

    -- * Response Lenses
    putAccountDedicatedIpWarmupAttributesResponse_httpStatus,
  )
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.SESV2.Types

-- | A request to enable or disable the automatic IP address warm-up feature.
--
-- /See:/ 'newPutAccountDedicatedIpWarmupAttributes' smart constructor.
data PutAccountDedicatedIpWarmupAttributes = PutAccountDedicatedIpWarmupAttributes'
  { -- | Enables or disables the automatic warm-up feature for dedicated IP
    -- addresses that are associated with your Amazon SES account in the
    -- current Amazon Web Services Region. Set to @true@ to enable the
    -- automatic warm-up feature, or set to @false@ to disable it.
    PutAccountDedicatedIpWarmupAttributes -> Maybe Bool
autoWarmupEnabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (PutAccountDedicatedIpWarmupAttributes
-> PutAccountDedicatedIpWarmupAttributes -> Bool
(PutAccountDedicatedIpWarmupAttributes
 -> PutAccountDedicatedIpWarmupAttributes -> Bool)
-> (PutAccountDedicatedIpWarmupAttributes
    -> PutAccountDedicatedIpWarmupAttributes -> Bool)
-> Eq PutAccountDedicatedIpWarmupAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccountDedicatedIpWarmupAttributes
-> PutAccountDedicatedIpWarmupAttributes -> Bool
$c/= :: PutAccountDedicatedIpWarmupAttributes
-> PutAccountDedicatedIpWarmupAttributes -> Bool
== :: PutAccountDedicatedIpWarmupAttributes
-> PutAccountDedicatedIpWarmupAttributes -> Bool
$c== :: PutAccountDedicatedIpWarmupAttributes
-> PutAccountDedicatedIpWarmupAttributes -> Bool
Prelude.Eq, ReadPrec [PutAccountDedicatedIpWarmupAttributes]
ReadPrec PutAccountDedicatedIpWarmupAttributes
Int -> ReadS PutAccountDedicatedIpWarmupAttributes
ReadS [PutAccountDedicatedIpWarmupAttributes]
(Int -> ReadS PutAccountDedicatedIpWarmupAttributes)
-> ReadS [PutAccountDedicatedIpWarmupAttributes]
-> ReadPrec PutAccountDedicatedIpWarmupAttributes
-> ReadPrec [PutAccountDedicatedIpWarmupAttributes]
-> Read PutAccountDedicatedIpWarmupAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccountDedicatedIpWarmupAttributes]
$creadListPrec :: ReadPrec [PutAccountDedicatedIpWarmupAttributes]
readPrec :: ReadPrec PutAccountDedicatedIpWarmupAttributes
$creadPrec :: ReadPrec PutAccountDedicatedIpWarmupAttributes
readList :: ReadS [PutAccountDedicatedIpWarmupAttributes]
$creadList :: ReadS [PutAccountDedicatedIpWarmupAttributes]
readsPrec :: Int -> ReadS PutAccountDedicatedIpWarmupAttributes
$creadsPrec :: Int -> ReadS PutAccountDedicatedIpWarmupAttributes
Prelude.Read, Int -> PutAccountDedicatedIpWarmupAttributes -> ShowS
[PutAccountDedicatedIpWarmupAttributes] -> ShowS
PutAccountDedicatedIpWarmupAttributes -> String
(Int -> PutAccountDedicatedIpWarmupAttributes -> ShowS)
-> (PutAccountDedicatedIpWarmupAttributes -> String)
-> ([PutAccountDedicatedIpWarmupAttributes] -> ShowS)
-> Show PutAccountDedicatedIpWarmupAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccountDedicatedIpWarmupAttributes] -> ShowS
$cshowList :: [PutAccountDedicatedIpWarmupAttributes] -> ShowS
show :: PutAccountDedicatedIpWarmupAttributes -> String
$cshow :: PutAccountDedicatedIpWarmupAttributes -> String
showsPrec :: Int -> PutAccountDedicatedIpWarmupAttributes -> ShowS
$cshowsPrec :: Int -> PutAccountDedicatedIpWarmupAttributes -> ShowS
Prelude.Show, (forall x.
 PutAccountDedicatedIpWarmupAttributes
 -> Rep PutAccountDedicatedIpWarmupAttributes x)
-> (forall x.
    Rep PutAccountDedicatedIpWarmupAttributes x
    -> PutAccountDedicatedIpWarmupAttributes)
-> Generic PutAccountDedicatedIpWarmupAttributes
forall x.
Rep PutAccountDedicatedIpWarmupAttributes x
-> PutAccountDedicatedIpWarmupAttributes
forall x.
PutAccountDedicatedIpWarmupAttributes
-> Rep PutAccountDedicatedIpWarmupAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAccountDedicatedIpWarmupAttributes x
-> PutAccountDedicatedIpWarmupAttributes
$cfrom :: forall x.
PutAccountDedicatedIpWarmupAttributes
-> Rep PutAccountDedicatedIpWarmupAttributes x
Prelude.Generic)

-- |
-- Create a value of 'PutAccountDedicatedIpWarmupAttributes' 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:
--
-- 'autoWarmupEnabled', 'putAccountDedicatedIpWarmupAttributes_autoWarmupEnabled' - Enables or disables the automatic warm-up feature for dedicated IP
-- addresses that are associated with your Amazon SES account in the
-- current Amazon Web Services Region. Set to @true@ to enable the
-- automatic warm-up feature, or set to @false@ to disable it.
newPutAccountDedicatedIpWarmupAttributes ::
  PutAccountDedicatedIpWarmupAttributes
newPutAccountDedicatedIpWarmupAttributes :: PutAccountDedicatedIpWarmupAttributes
newPutAccountDedicatedIpWarmupAttributes =
  PutAccountDedicatedIpWarmupAttributes' :: Maybe Bool -> PutAccountDedicatedIpWarmupAttributes
PutAccountDedicatedIpWarmupAttributes'
    { $sel:autoWarmupEnabled:PutAccountDedicatedIpWarmupAttributes' :: Maybe Bool
autoWarmupEnabled =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Enables or disables the automatic warm-up feature for dedicated IP
-- addresses that are associated with your Amazon SES account in the
-- current Amazon Web Services Region. Set to @true@ to enable the
-- automatic warm-up feature, or set to @false@ to disable it.
putAccountDedicatedIpWarmupAttributes_autoWarmupEnabled :: Lens.Lens' PutAccountDedicatedIpWarmupAttributes (Prelude.Maybe Prelude.Bool)
putAccountDedicatedIpWarmupAttributes_autoWarmupEnabled :: (Maybe Bool -> f (Maybe Bool))
-> PutAccountDedicatedIpWarmupAttributes
-> f PutAccountDedicatedIpWarmupAttributes
putAccountDedicatedIpWarmupAttributes_autoWarmupEnabled = (PutAccountDedicatedIpWarmupAttributes -> Maybe Bool)
-> (PutAccountDedicatedIpWarmupAttributes
    -> Maybe Bool -> PutAccountDedicatedIpWarmupAttributes)
-> Lens
     PutAccountDedicatedIpWarmupAttributes
     PutAccountDedicatedIpWarmupAttributes
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountDedicatedIpWarmupAttributes' {Maybe Bool
autoWarmupEnabled :: Maybe Bool
$sel:autoWarmupEnabled:PutAccountDedicatedIpWarmupAttributes' :: PutAccountDedicatedIpWarmupAttributes -> Maybe Bool
autoWarmupEnabled} -> Maybe Bool
autoWarmupEnabled) (\s :: PutAccountDedicatedIpWarmupAttributes
s@PutAccountDedicatedIpWarmupAttributes' {} Maybe Bool
a -> PutAccountDedicatedIpWarmupAttributes
s {$sel:autoWarmupEnabled:PutAccountDedicatedIpWarmupAttributes' :: Maybe Bool
autoWarmupEnabled = Maybe Bool
a} :: PutAccountDedicatedIpWarmupAttributes)

instance
  Core.AWSRequest
    PutAccountDedicatedIpWarmupAttributes
  where
  type
    AWSResponse
      PutAccountDedicatedIpWarmupAttributes =
      PutAccountDedicatedIpWarmupAttributesResponse
  request :: PutAccountDedicatedIpWarmupAttributes
-> Request PutAccountDedicatedIpWarmupAttributes
request = Service
-> PutAccountDedicatedIpWarmupAttributes
-> Request PutAccountDedicatedIpWarmupAttributes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutAccountDedicatedIpWarmupAttributes
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse PutAccountDedicatedIpWarmupAttributes)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either
      String (AWSResponse PutAccountDedicatedIpWarmupAttributes))
-> Logger
-> Service
-> Proxy PutAccountDedicatedIpWarmupAttributes
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse PutAccountDedicatedIpWarmupAttributes)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> PutAccountDedicatedIpWarmupAttributesResponse
PutAccountDedicatedIpWarmupAttributesResponse'
            (Int -> PutAccountDedicatedIpWarmupAttributesResponse)
-> Either String Int
-> Either String PutAccountDedicatedIpWarmupAttributesResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    PutAccountDedicatedIpWarmupAttributes

instance
  Prelude.NFData
    PutAccountDedicatedIpWarmupAttributes

instance
  Core.ToHeaders
    PutAccountDedicatedIpWarmupAttributes
  where
  toHeaders :: PutAccountDedicatedIpWarmupAttributes -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> PutAccountDedicatedIpWarmupAttributes -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Core.ToJSON
    PutAccountDedicatedIpWarmupAttributes
  where
  toJSON :: PutAccountDedicatedIpWarmupAttributes -> Value
toJSON PutAccountDedicatedIpWarmupAttributes' {Maybe Bool
autoWarmupEnabled :: Maybe Bool
$sel:autoWarmupEnabled:PutAccountDedicatedIpWarmupAttributes' :: PutAccountDedicatedIpWarmupAttributes -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AutoWarmupEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
autoWarmupEnabled
          ]
      )

instance
  Core.ToPath
    PutAccountDedicatedIpWarmupAttributes
  where
  toPath :: PutAccountDedicatedIpWarmupAttributes -> ByteString
toPath =
    ByteString -> PutAccountDedicatedIpWarmupAttributes -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/v2/email/account/dedicated-ips/warmup"

instance
  Core.ToQuery
    PutAccountDedicatedIpWarmupAttributes
  where
  toQuery :: PutAccountDedicatedIpWarmupAttributes -> QueryString
toQuery = QueryString -> PutAccountDedicatedIpWarmupAttributes -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | An HTTP 200 response if the request succeeds, or an error message if the
-- request fails.
--
-- /See:/ 'newPutAccountDedicatedIpWarmupAttributesResponse' smart constructor.
data PutAccountDedicatedIpWarmupAttributesResponse = PutAccountDedicatedIpWarmupAttributesResponse'
  { -- | The response's http status code.
    PutAccountDedicatedIpWarmupAttributesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutAccountDedicatedIpWarmupAttributesResponse
-> PutAccountDedicatedIpWarmupAttributesResponse -> Bool
(PutAccountDedicatedIpWarmupAttributesResponse
 -> PutAccountDedicatedIpWarmupAttributesResponse -> Bool)
-> (PutAccountDedicatedIpWarmupAttributesResponse
    -> PutAccountDedicatedIpWarmupAttributesResponse -> Bool)
-> Eq PutAccountDedicatedIpWarmupAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccountDedicatedIpWarmupAttributesResponse
-> PutAccountDedicatedIpWarmupAttributesResponse -> Bool
$c/= :: PutAccountDedicatedIpWarmupAttributesResponse
-> PutAccountDedicatedIpWarmupAttributesResponse -> Bool
== :: PutAccountDedicatedIpWarmupAttributesResponse
-> PutAccountDedicatedIpWarmupAttributesResponse -> Bool
$c== :: PutAccountDedicatedIpWarmupAttributesResponse
-> PutAccountDedicatedIpWarmupAttributesResponse -> Bool
Prelude.Eq, ReadPrec [PutAccountDedicatedIpWarmupAttributesResponse]
ReadPrec PutAccountDedicatedIpWarmupAttributesResponse
Int -> ReadS PutAccountDedicatedIpWarmupAttributesResponse
ReadS [PutAccountDedicatedIpWarmupAttributesResponse]
(Int -> ReadS PutAccountDedicatedIpWarmupAttributesResponse)
-> ReadS [PutAccountDedicatedIpWarmupAttributesResponse]
-> ReadPrec PutAccountDedicatedIpWarmupAttributesResponse
-> ReadPrec [PutAccountDedicatedIpWarmupAttributesResponse]
-> Read PutAccountDedicatedIpWarmupAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccountDedicatedIpWarmupAttributesResponse]
$creadListPrec :: ReadPrec [PutAccountDedicatedIpWarmupAttributesResponse]
readPrec :: ReadPrec PutAccountDedicatedIpWarmupAttributesResponse
$creadPrec :: ReadPrec PutAccountDedicatedIpWarmupAttributesResponse
readList :: ReadS [PutAccountDedicatedIpWarmupAttributesResponse]
$creadList :: ReadS [PutAccountDedicatedIpWarmupAttributesResponse]
readsPrec :: Int -> ReadS PutAccountDedicatedIpWarmupAttributesResponse
$creadsPrec :: Int -> ReadS PutAccountDedicatedIpWarmupAttributesResponse
Prelude.Read, Int -> PutAccountDedicatedIpWarmupAttributesResponse -> ShowS
[PutAccountDedicatedIpWarmupAttributesResponse] -> ShowS
PutAccountDedicatedIpWarmupAttributesResponse -> String
(Int -> PutAccountDedicatedIpWarmupAttributesResponse -> ShowS)
-> (PutAccountDedicatedIpWarmupAttributesResponse -> String)
-> ([PutAccountDedicatedIpWarmupAttributesResponse] -> ShowS)
-> Show PutAccountDedicatedIpWarmupAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccountDedicatedIpWarmupAttributesResponse] -> ShowS
$cshowList :: [PutAccountDedicatedIpWarmupAttributesResponse] -> ShowS
show :: PutAccountDedicatedIpWarmupAttributesResponse -> String
$cshow :: PutAccountDedicatedIpWarmupAttributesResponse -> String
showsPrec :: Int -> PutAccountDedicatedIpWarmupAttributesResponse -> ShowS
$cshowsPrec :: Int -> PutAccountDedicatedIpWarmupAttributesResponse -> ShowS
Prelude.Show, (forall x.
 PutAccountDedicatedIpWarmupAttributesResponse
 -> Rep PutAccountDedicatedIpWarmupAttributesResponse x)
-> (forall x.
    Rep PutAccountDedicatedIpWarmupAttributesResponse x
    -> PutAccountDedicatedIpWarmupAttributesResponse)
-> Generic PutAccountDedicatedIpWarmupAttributesResponse
forall x.
Rep PutAccountDedicatedIpWarmupAttributesResponse x
-> PutAccountDedicatedIpWarmupAttributesResponse
forall x.
PutAccountDedicatedIpWarmupAttributesResponse
-> Rep PutAccountDedicatedIpWarmupAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAccountDedicatedIpWarmupAttributesResponse x
-> PutAccountDedicatedIpWarmupAttributesResponse
$cfrom :: forall x.
PutAccountDedicatedIpWarmupAttributesResponse
-> Rep PutAccountDedicatedIpWarmupAttributesResponse x
Prelude.Generic)

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

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

instance
  Prelude.NFData
    PutAccountDedicatedIpWarmupAttributesResponse