{-# 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.PutAccountVdmAttributes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Update your Amazon SES account VDM attributes.
--
-- You can execute this operation no more than once per second.
module Amazonka.SESV2.PutAccountVdmAttributes
  ( -- * Creating a Request
    PutAccountVdmAttributes (..),
    newPutAccountVdmAttributes,

    -- * Request Lenses
    putAccountVdmAttributes_vdmAttributes,

    -- * Destructuring the Response
    PutAccountVdmAttributesResponse (..),
    newPutAccountVdmAttributesResponse,

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

-- | A request to submit new account VDM attributes.
--
-- /See:/ 'newPutAccountVdmAttributes' smart constructor.
data PutAccountVdmAttributes = PutAccountVdmAttributes'
  { -- | The VDM attributes that you wish to apply to your Amazon SES account.
    PutAccountVdmAttributes -> VdmAttributes
vdmAttributes :: VdmAttributes
  }
  deriving (PutAccountVdmAttributes -> PutAccountVdmAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccountVdmAttributes -> PutAccountVdmAttributes -> Bool
$c/= :: PutAccountVdmAttributes -> PutAccountVdmAttributes -> Bool
== :: PutAccountVdmAttributes -> PutAccountVdmAttributes -> Bool
$c== :: PutAccountVdmAttributes -> PutAccountVdmAttributes -> Bool
Prelude.Eq, ReadPrec [PutAccountVdmAttributes]
ReadPrec PutAccountVdmAttributes
Int -> ReadS PutAccountVdmAttributes
ReadS [PutAccountVdmAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccountVdmAttributes]
$creadListPrec :: ReadPrec [PutAccountVdmAttributes]
readPrec :: ReadPrec PutAccountVdmAttributes
$creadPrec :: ReadPrec PutAccountVdmAttributes
readList :: ReadS [PutAccountVdmAttributes]
$creadList :: ReadS [PutAccountVdmAttributes]
readsPrec :: Int -> ReadS PutAccountVdmAttributes
$creadsPrec :: Int -> ReadS PutAccountVdmAttributes
Prelude.Read, Int -> PutAccountVdmAttributes -> ShowS
[PutAccountVdmAttributes] -> ShowS
PutAccountVdmAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccountVdmAttributes] -> ShowS
$cshowList :: [PutAccountVdmAttributes] -> ShowS
show :: PutAccountVdmAttributes -> String
$cshow :: PutAccountVdmAttributes -> String
showsPrec :: Int -> PutAccountVdmAttributes -> ShowS
$cshowsPrec :: Int -> PutAccountVdmAttributes -> ShowS
Prelude.Show, forall x. Rep PutAccountVdmAttributes x -> PutAccountVdmAttributes
forall x. PutAccountVdmAttributes -> Rep PutAccountVdmAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutAccountVdmAttributes x -> PutAccountVdmAttributes
$cfrom :: forall x. PutAccountVdmAttributes -> Rep PutAccountVdmAttributes x
Prelude.Generic)

-- |
-- Create a value of 'PutAccountVdmAttributes' 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:
--
-- 'vdmAttributes', 'putAccountVdmAttributes_vdmAttributes' - The VDM attributes that you wish to apply to your Amazon SES account.
newPutAccountVdmAttributes ::
  -- | 'vdmAttributes'
  VdmAttributes ->
  PutAccountVdmAttributes
newPutAccountVdmAttributes :: VdmAttributes -> PutAccountVdmAttributes
newPutAccountVdmAttributes VdmAttributes
pVdmAttributes_ =
  PutAccountVdmAttributes'
    { $sel:vdmAttributes:PutAccountVdmAttributes' :: VdmAttributes
vdmAttributes =
        VdmAttributes
pVdmAttributes_
    }

-- | The VDM attributes that you wish to apply to your Amazon SES account.
putAccountVdmAttributes_vdmAttributes :: Lens.Lens' PutAccountVdmAttributes VdmAttributes
putAccountVdmAttributes_vdmAttributes :: Lens' PutAccountVdmAttributes VdmAttributes
putAccountVdmAttributes_vdmAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountVdmAttributes' {VdmAttributes
vdmAttributes :: VdmAttributes
$sel:vdmAttributes:PutAccountVdmAttributes' :: PutAccountVdmAttributes -> VdmAttributes
vdmAttributes} -> VdmAttributes
vdmAttributes) (\s :: PutAccountVdmAttributes
s@PutAccountVdmAttributes' {} VdmAttributes
a -> PutAccountVdmAttributes
s {$sel:vdmAttributes:PutAccountVdmAttributes' :: VdmAttributes
vdmAttributes = VdmAttributes
a} :: PutAccountVdmAttributes)

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

instance Prelude.Hashable PutAccountVdmAttributes where
  hashWithSalt :: Int -> PutAccountVdmAttributes -> Int
hashWithSalt Int
_salt PutAccountVdmAttributes' {VdmAttributes
vdmAttributes :: VdmAttributes
$sel:vdmAttributes:PutAccountVdmAttributes' :: PutAccountVdmAttributes -> VdmAttributes
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VdmAttributes
vdmAttributes

instance Prelude.NFData PutAccountVdmAttributes where
  rnf :: PutAccountVdmAttributes -> ()
rnf PutAccountVdmAttributes' {VdmAttributes
vdmAttributes :: VdmAttributes
$sel:vdmAttributes:PutAccountVdmAttributes' :: PutAccountVdmAttributes -> VdmAttributes
..} =
    forall a. NFData a => a -> ()
Prelude.rnf VdmAttributes
vdmAttributes

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

instance Data.ToJSON PutAccountVdmAttributes where
  toJSON :: PutAccountVdmAttributes -> Value
toJSON PutAccountVdmAttributes' {VdmAttributes
vdmAttributes :: VdmAttributes
$sel:vdmAttributes:PutAccountVdmAttributes' :: PutAccountVdmAttributes -> VdmAttributes
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"VdmAttributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= VdmAttributes
vdmAttributes)
          ]
      )

instance Data.ToPath PutAccountVdmAttributes where
  toPath :: PutAccountVdmAttributes -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/v2/email/account/vdm"

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

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

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

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

instance
  Prelude.NFData
    PutAccountVdmAttributesResponse
  where
  rnf :: PutAccountVdmAttributesResponse -> ()
rnf PutAccountVdmAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutAccountVdmAttributesResponse' :: PutAccountVdmAttributesResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus