{-# 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.PutAccountDetails
-- 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)
--
-- Update your Amazon SES account details.
module Amazonka.SESV2.PutAccountDetails
  ( -- * Creating a Request
    PutAccountDetails (..),
    newPutAccountDetails,

    -- * Request Lenses
    putAccountDetails_contactLanguage,
    putAccountDetails_productionAccessEnabled,
    putAccountDetails_additionalContactEmailAddresses,
    putAccountDetails_mailType,
    putAccountDetails_websiteURL,
    putAccountDetails_useCaseDescription,

    -- * Destructuring the Response
    PutAccountDetailsResponse (..),
    newPutAccountDetailsResponse,

    -- * Response Lenses
    putAccountDetailsResponse_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 submit new account details.
--
-- /See:/ 'newPutAccountDetails' smart constructor.
data PutAccountDetails = PutAccountDetails'
  { -- | The language you would prefer to be contacted with.
    PutAccountDetails -> Maybe ContactLanguage
contactLanguage :: Prelude.Maybe ContactLanguage,
    -- | Indicates whether or not your account should have production access in
    -- the current Amazon Web Services Region.
    --
    -- If the value is @false@, then your account is in the /sandbox/. When
    -- your account is in the sandbox, you can only send email to verified
    -- identities. Additionally, the maximum number of emails you can send in a
    -- 24-hour period (your sending quota) is 200, and the maximum number of
    -- emails you can send per second (your maximum sending rate) is 1.
    --
    -- If the value is @true@, then your account has production access. When
    -- your account has production access, you can send email to any address.
    -- The sending quota and maximum sending rate for your account vary based
    -- on your specific use case.
    PutAccountDetails -> Maybe Bool
productionAccessEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Additional email addresses that you would like to be notified regarding
    -- Amazon SES matters.
    PutAccountDetails -> Maybe (Sensitive (NonEmpty (Sensitive Text)))
additionalContactEmailAddresses :: Prelude.Maybe (Core.Sensitive (Prelude.NonEmpty (Core.Sensitive Prelude.Text))),
    -- | The type of email your account will send.
    PutAccountDetails -> MailType
mailType :: MailType,
    -- | The URL of your website. This information helps us better understand the
    -- type of content that you plan to send.
    PutAccountDetails -> Sensitive Text
websiteURL :: Core.Sensitive Prelude.Text,
    -- | A description of the types of email that you plan to send.
    PutAccountDetails -> Sensitive Text
useCaseDescription :: Core.Sensitive Prelude.Text
  }
  deriving (PutAccountDetails -> PutAccountDetails -> Bool
(PutAccountDetails -> PutAccountDetails -> Bool)
-> (PutAccountDetails -> PutAccountDetails -> Bool)
-> Eq PutAccountDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccountDetails -> PutAccountDetails -> Bool
$c/= :: PutAccountDetails -> PutAccountDetails -> Bool
== :: PutAccountDetails -> PutAccountDetails -> Bool
$c== :: PutAccountDetails -> PutAccountDetails -> Bool
Prelude.Eq, Int -> PutAccountDetails -> ShowS
[PutAccountDetails] -> ShowS
PutAccountDetails -> String
(Int -> PutAccountDetails -> ShowS)
-> (PutAccountDetails -> String)
-> ([PutAccountDetails] -> ShowS)
-> Show PutAccountDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccountDetails] -> ShowS
$cshowList :: [PutAccountDetails] -> ShowS
show :: PutAccountDetails -> String
$cshow :: PutAccountDetails -> String
showsPrec :: Int -> PutAccountDetails -> ShowS
$cshowsPrec :: Int -> PutAccountDetails -> ShowS
Prelude.Show, (forall x. PutAccountDetails -> Rep PutAccountDetails x)
-> (forall x. Rep PutAccountDetails x -> PutAccountDetails)
-> Generic PutAccountDetails
forall x. Rep PutAccountDetails x -> PutAccountDetails
forall x. PutAccountDetails -> Rep PutAccountDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutAccountDetails x -> PutAccountDetails
$cfrom :: forall x. PutAccountDetails -> Rep PutAccountDetails x
Prelude.Generic)

-- |
-- Create a value of 'PutAccountDetails' 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:
--
-- 'contactLanguage', 'putAccountDetails_contactLanguage' - The language you would prefer to be contacted with.
--
-- 'productionAccessEnabled', 'putAccountDetails_productionAccessEnabled' - Indicates whether or not your account should have production access in
-- the current Amazon Web Services Region.
--
-- If the value is @false@, then your account is in the /sandbox/. When
-- your account is in the sandbox, you can only send email to verified
-- identities. Additionally, the maximum number of emails you can send in a
-- 24-hour period (your sending quota) is 200, and the maximum number of
-- emails you can send per second (your maximum sending rate) is 1.
--
-- If the value is @true@, then your account has production access. When
-- your account has production access, you can send email to any address.
-- The sending quota and maximum sending rate for your account vary based
-- on your specific use case.
--
-- 'additionalContactEmailAddresses', 'putAccountDetails_additionalContactEmailAddresses' - Additional email addresses that you would like to be notified regarding
-- Amazon SES matters.
--
-- 'mailType', 'putAccountDetails_mailType' - The type of email your account will send.
--
-- 'websiteURL', 'putAccountDetails_websiteURL' - The URL of your website. This information helps us better understand the
-- type of content that you plan to send.
--
-- 'useCaseDescription', 'putAccountDetails_useCaseDescription' - A description of the types of email that you plan to send.
newPutAccountDetails ::
  -- | 'mailType'
  MailType ->
  -- | 'websiteURL'
  Prelude.Text ->
  -- | 'useCaseDescription'
  Prelude.Text ->
  PutAccountDetails
newPutAccountDetails :: MailType -> Text -> Text -> PutAccountDetails
newPutAccountDetails
  MailType
pMailType_
  Text
pWebsiteURL_
  Text
pUseCaseDescription_ =
    PutAccountDetails' :: Maybe ContactLanguage
-> Maybe Bool
-> Maybe (Sensitive (NonEmpty (Sensitive Text)))
-> MailType
-> Sensitive Text
-> Sensitive Text
-> PutAccountDetails
PutAccountDetails'
      { $sel:contactLanguage:PutAccountDetails' :: Maybe ContactLanguage
contactLanguage =
          Maybe ContactLanguage
forall a. Maybe a
Prelude.Nothing,
        $sel:productionAccessEnabled:PutAccountDetails' :: Maybe Bool
productionAccessEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:additionalContactEmailAddresses:PutAccountDetails' :: Maybe (Sensitive (NonEmpty (Sensitive Text)))
additionalContactEmailAddresses = Maybe (Sensitive (NonEmpty (Sensitive Text)))
forall a. Maybe a
Prelude.Nothing,
        $sel:mailType:PutAccountDetails' :: MailType
mailType = MailType
pMailType_,
        $sel:websiteURL:PutAccountDetails' :: Sensitive Text
websiteURL = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pWebsiteURL_,
        $sel:useCaseDescription:PutAccountDetails' :: Sensitive Text
useCaseDescription =
          Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pUseCaseDescription_
      }

-- | The language you would prefer to be contacted with.
putAccountDetails_contactLanguage :: Lens.Lens' PutAccountDetails (Prelude.Maybe ContactLanguage)
putAccountDetails_contactLanguage :: (Maybe ContactLanguage -> f (Maybe ContactLanguage))
-> PutAccountDetails -> f PutAccountDetails
putAccountDetails_contactLanguage = (PutAccountDetails -> Maybe ContactLanguage)
-> (PutAccountDetails
    -> Maybe ContactLanguage -> PutAccountDetails)
-> Lens
     PutAccountDetails
     PutAccountDetails
     (Maybe ContactLanguage)
     (Maybe ContactLanguage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountDetails' {Maybe ContactLanguage
contactLanguage :: Maybe ContactLanguage
$sel:contactLanguage:PutAccountDetails' :: PutAccountDetails -> Maybe ContactLanguage
contactLanguage} -> Maybe ContactLanguage
contactLanguage) (\s :: PutAccountDetails
s@PutAccountDetails' {} Maybe ContactLanguage
a -> PutAccountDetails
s {$sel:contactLanguage:PutAccountDetails' :: Maybe ContactLanguage
contactLanguage = Maybe ContactLanguage
a} :: PutAccountDetails)

-- | Indicates whether or not your account should have production access in
-- the current Amazon Web Services Region.
--
-- If the value is @false@, then your account is in the /sandbox/. When
-- your account is in the sandbox, you can only send email to verified
-- identities. Additionally, the maximum number of emails you can send in a
-- 24-hour period (your sending quota) is 200, and the maximum number of
-- emails you can send per second (your maximum sending rate) is 1.
--
-- If the value is @true@, then your account has production access. When
-- your account has production access, you can send email to any address.
-- The sending quota and maximum sending rate for your account vary based
-- on your specific use case.
putAccountDetails_productionAccessEnabled :: Lens.Lens' PutAccountDetails (Prelude.Maybe Prelude.Bool)
putAccountDetails_productionAccessEnabled :: (Maybe Bool -> f (Maybe Bool))
-> PutAccountDetails -> f PutAccountDetails
putAccountDetails_productionAccessEnabled = (PutAccountDetails -> Maybe Bool)
-> (PutAccountDetails -> Maybe Bool -> PutAccountDetails)
-> Lens
     PutAccountDetails PutAccountDetails (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountDetails' {Maybe Bool
productionAccessEnabled :: Maybe Bool
$sel:productionAccessEnabled:PutAccountDetails' :: PutAccountDetails -> Maybe Bool
productionAccessEnabled} -> Maybe Bool
productionAccessEnabled) (\s :: PutAccountDetails
s@PutAccountDetails' {} Maybe Bool
a -> PutAccountDetails
s {$sel:productionAccessEnabled:PutAccountDetails' :: Maybe Bool
productionAccessEnabled = Maybe Bool
a} :: PutAccountDetails)

-- | Additional email addresses that you would like to be notified regarding
-- Amazon SES matters.
putAccountDetails_additionalContactEmailAddresses :: Lens.Lens' PutAccountDetails (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
putAccountDetails_additionalContactEmailAddresses :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> PutAccountDetails -> f PutAccountDetails
putAccountDetails_additionalContactEmailAddresses = (PutAccountDetails
 -> Maybe (Sensitive (NonEmpty (Sensitive Text))))
-> (PutAccountDetails
    -> Maybe (Sensitive (NonEmpty (Sensitive Text)))
    -> PutAccountDetails)
-> Lens
     PutAccountDetails
     PutAccountDetails
     (Maybe (Sensitive (NonEmpty (Sensitive Text))))
     (Maybe (Sensitive (NonEmpty (Sensitive Text))))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountDetails' {Maybe (Sensitive (NonEmpty (Sensitive Text)))
additionalContactEmailAddresses :: Maybe (Sensitive (NonEmpty (Sensitive Text)))
$sel:additionalContactEmailAddresses:PutAccountDetails' :: PutAccountDetails -> Maybe (Sensitive (NonEmpty (Sensitive Text)))
additionalContactEmailAddresses} -> Maybe (Sensitive (NonEmpty (Sensitive Text)))
additionalContactEmailAddresses) (\s :: PutAccountDetails
s@PutAccountDetails' {} Maybe (Sensitive (NonEmpty (Sensitive Text)))
a -> PutAccountDetails
s {$sel:additionalContactEmailAddresses:PutAccountDetails' :: Maybe (Sensitive (NonEmpty (Sensitive Text)))
additionalContactEmailAddresses = Maybe (Sensitive (NonEmpty (Sensitive Text)))
a} :: PutAccountDetails) ((Maybe (Sensitive (NonEmpty (Sensitive Text)))
  -> f (Maybe (Sensitive (NonEmpty (Sensitive Text)))))
 -> PutAccountDetails -> f PutAccountDetails)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (Sensitive (NonEmpty (Sensitive Text)))
    -> f (Maybe (Sensitive (NonEmpty (Sensitive Text)))))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> PutAccountDetails
-> f PutAccountDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (Sensitive (NonEmpty (Sensitive Text)))
  (Sensitive (NonEmpty (Sensitive Text)))
  (NonEmpty Text)
  (NonEmpty Text)
-> Iso
     (Maybe (Sensitive (NonEmpty (Sensitive Text))))
     (Maybe (Sensitive (NonEmpty (Sensitive Text))))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping (Exchange
  (NonEmpty Text)
  (NonEmpty Text)
  (NonEmpty (Sensitive Text))
  (Identity (NonEmpty (Sensitive Text)))
-> Exchange
     (NonEmpty Text)
     (NonEmpty Text)
     (Sensitive (NonEmpty (Sensitive Text)))
     (Identity (Sensitive (NonEmpty (Sensitive Text))))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Exchange
   (NonEmpty Text)
   (NonEmpty Text)
   (NonEmpty (Sensitive Text))
   (Identity (NonEmpty (Sensitive Text)))
 -> Exchange
      (NonEmpty Text)
      (NonEmpty Text)
      (Sensitive (NonEmpty (Sensitive Text)))
      (Identity (Sensitive (NonEmpty (Sensitive Text)))))
-> (Exchange
      (NonEmpty Text)
      (NonEmpty Text)
      (NonEmpty Text)
      (Identity (NonEmpty Text))
    -> Exchange
         (NonEmpty Text)
         (NonEmpty Text)
         (NonEmpty (Sensitive Text))
         (Identity (NonEmpty (Sensitive Text))))
-> AnIso
     (Sensitive (NonEmpty (Sensitive Text)))
     (Sensitive (NonEmpty (Sensitive Text)))
     (NonEmpty Text)
     (NonEmpty Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
  (NonEmpty Text)
  (NonEmpty Text)
  (NonEmpty Text)
  (Identity (NonEmpty Text))
-> Exchange
     (NonEmpty Text)
     (NonEmpty Text)
     (NonEmpty (Sensitive Text))
     (Identity (NonEmpty (Sensitive Text)))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | The type of email your account will send.
putAccountDetails_mailType :: Lens.Lens' PutAccountDetails MailType
putAccountDetails_mailType :: (MailType -> f MailType)
-> PutAccountDetails -> f PutAccountDetails
putAccountDetails_mailType = (PutAccountDetails -> MailType)
-> (PutAccountDetails -> MailType -> PutAccountDetails)
-> Lens PutAccountDetails PutAccountDetails MailType MailType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountDetails' {MailType
mailType :: MailType
$sel:mailType:PutAccountDetails' :: PutAccountDetails -> MailType
mailType} -> MailType
mailType) (\s :: PutAccountDetails
s@PutAccountDetails' {} MailType
a -> PutAccountDetails
s {$sel:mailType:PutAccountDetails' :: MailType
mailType = MailType
a} :: PutAccountDetails)

-- | The URL of your website. This information helps us better understand the
-- type of content that you plan to send.
putAccountDetails_websiteURL :: Lens.Lens' PutAccountDetails Prelude.Text
putAccountDetails_websiteURL :: (Text -> f Text) -> PutAccountDetails -> f PutAccountDetails
putAccountDetails_websiteURL = (PutAccountDetails -> Sensitive Text)
-> (PutAccountDetails -> Sensitive Text -> PutAccountDetails)
-> Lens
     PutAccountDetails
     PutAccountDetails
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountDetails' {Sensitive Text
websiteURL :: Sensitive Text
$sel:websiteURL:PutAccountDetails' :: PutAccountDetails -> Sensitive Text
websiteURL} -> Sensitive Text
websiteURL) (\s :: PutAccountDetails
s@PutAccountDetails' {} Sensitive Text
a -> PutAccountDetails
s {$sel:websiteURL:PutAccountDetails' :: Sensitive Text
websiteURL = Sensitive Text
a} :: PutAccountDetails) ((Sensitive Text -> f (Sensitive Text))
 -> PutAccountDetails -> f PutAccountDetails)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> PutAccountDetails
-> f PutAccountDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | A description of the types of email that you plan to send.
putAccountDetails_useCaseDescription :: Lens.Lens' PutAccountDetails Prelude.Text
putAccountDetails_useCaseDescription :: (Text -> f Text) -> PutAccountDetails -> f PutAccountDetails
putAccountDetails_useCaseDescription = (PutAccountDetails -> Sensitive Text)
-> (PutAccountDetails -> Sensitive Text -> PutAccountDetails)
-> Lens
     PutAccountDetails
     PutAccountDetails
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountDetails' {Sensitive Text
useCaseDescription :: Sensitive Text
$sel:useCaseDescription:PutAccountDetails' :: PutAccountDetails -> Sensitive Text
useCaseDescription} -> Sensitive Text
useCaseDescription) (\s :: PutAccountDetails
s@PutAccountDetails' {} Sensitive Text
a -> PutAccountDetails
s {$sel:useCaseDescription:PutAccountDetails' :: Sensitive Text
useCaseDescription = Sensitive Text
a} :: PutAccountDetails) ((Sensitive Text -> f (Sensitive Text))
 -> PutAccountDetails -> f PutAccountDetails)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> PutAccountDetails
-> f PutAccountDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

instance Core.AWSRequest PutAccountDetails where
  type
    AWSResponse PutAccountDetails =
      PutAccountDetailsResponse
  request :: PutAccountDetails -> Request PutAccountDetails
request = Service -> PutAccountDetails -> Request PutAccountDetails
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutAccountDetails
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutAccountDetails)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse PutAccountDetails))
-> Logger
-> Service
-> Proxy PutAccountDetails
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutAccountDetails)))
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 -> PutAccountDetailsResponse
PutAccountDetailsResponse'
            (Int -> PutAccountDetailsResponse)
-> Either String Int -> Either String PutAccountDetailsResponse
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 PutAccountDetails

instance Prelude.NFData PutAccountDetails

instance Core.ToHeaders PutAccountDetails where
  toHeaders :: PutAccountDetails -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutAccountDetails -> 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 PutAccountDetails where
  toJSON :: PutAccountDetails -> Value
toJSON PutAccountDetails' {Maybe Bool
Maybe (Sensitive (NonEmpty (Sensitive Text)))
Maybe ContactLanguage
Sensitive Text
MailType
useCaseDescription :: Sensitive Text
websiteURL :: Sensitive Text
mailType :: MailType
additionalContactEmailAddresses :: Maybe (Sensitive (NonEmpty (Sensitive Text)))
productionAccessEnabled :: Maybe Bool
contactLanguage :: Maybe ContactLanguage
$sel:useCaseDescription:PutAccountDetails' :: PutAccountDetails -> Sensitive Text
$sel:websiteURL:PutAccountDetails' :: PutAccountDetails -> Sensitive Text
$sel:mailType:PutAccountDetails' :: PutAccountDetails -> MailType
$sel:additionalContactEmailAddresses:PutAccountDetails' :: PutAccountDetails -> Maybe (Sensitive (NonEmpty (Sensitive Text)))
$sel:productionAccessEnabled:PutAccountDetails' :: PutAccountDetails -> Maybe Bool
$sel:contactLanguage:PutAccountDetails' :: PutAccountDetails -> Maybe ContactLanguage
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ContactLanguage" Text -> ContactLanguage -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ContactLanguage -> Pair) -> Maybe ContactLanguage -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContactLanguage
contactLanguage,
            (Text
"ProductionAccessEnabled" 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
productionAccessEnabled,
            (Text
"AdditionalContactEmailAddresses" Text -> Sensitive (NonEmpty (Sensitive Text)) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive (NonEmpty (Sensitive Text)) -> Pair)
-> Maybe (Sensitive (NonEmpty (Sensitive Text))) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (NonEmpty (Sensitive Text)))
additionalContactEmailAddresses,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MailType" Text -> MailType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MailType
mailType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WebsiteURL" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
websiteURL),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"UseCaseDescription" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
useCaseDescription)
          ]
      )

instance Core.ToPath PutAccountDetails where
  toPath :: PutAccountDetails -> ByteString
toPath = ByteString -> PutAccountDetails -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v2/email/account/details"

instance Core.ToQuery PutAccountDetails where
  toQuery :: PutAccountDetails -> QueryString
toQuery = QueryString -> PutAccountDetails -> 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:/ 'newPutAccountDetailsResponse' smart constructor.
data PutAccountDetailsResponse = PutAccountDetailsResponse'
  { -- | The response's http status code.
    PutAccountDetailsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutAccountDetailsResponse -> PutAccountDetailsResponse -> Bool
(PutAccountDetailsResponse -> PutAccountDetailsResponse -> Bool)
-> (PutAccountDetailsResponse -> PutAccountDetailsResponse -> Bool)
-> Eq PutAccountDetailsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccountDetailsResponse -> PutAccountDetailsResponse -> Bool
$c/= :: PutAccountDetailsResponse -> PutAccountDetailsResponse -> Bool
== :: PutAccountDetailsResponse -> PutAccountDetailsResponse -> Bool
$c== :: PutAccountDetailsResponse -> PutAccountDetailsResponse -> Bool
Prelude.Eq, ReadPrec [PutAccountDetailsResponse]
ReadPrec PutAccountDetailsResponse
Int -> ReadS PutAccountDetailsResponse
ReadS [PutAccountDetailsResponse]
(Int -> ReadS PutAccountDetailsResponse)
-> ReadS [PutAccountDetailsResponse]
-> ReadPrec PutAccountDetailsResponse
-> ReadPrec [PutAccountDetailsResponse]
-> Read PutAccountDetailsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccountDetailsResponse]
$creadListPrec :: ReadPrec [PutAccountDetailsResponse]
readPrec :: ReadPrec PutAccountDetailsResponse
$creadPrec :: ReadPrec PutAccountDetailsResponse
readList :: ReadS [PutAccountDetailsResponse]
$creadList :: ReadS [PutAccountDetailsResponse]
readsPrec :: Int -> ReadS PutAccountDetailsResponse
$creadsPrec :: Int -> ReadS PutAccountDetailsResponse
Prelude.Read, Int -> PutAccountDetailsResponse -> ShowS
[PutAccountDetailsResponse] -> ShowS
PutAccountDetailsResponse -> String
(Int -> PutAccountDetailsResponse -> ShowS)
-> (PutAccountDetailsResponse -> String)
-> ([PutAccountDetailsResponse] -> ShowS)
-> Show PutAccountDetailsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccountDetailsResponse] -> ShowS
$cshowList :: [PutAccountDetailsResponse] -> ShowS
show :: PutAccountDetailsResponse -> String
$cshow :: PutAccountDetailsResponse -> String
showsPrec :: Int -> PutAccountDetailsResponse -> ShowS
$cshowsPrec :: Int -> PutAccountDetailsResponse -> ShowS
Prelude.Show, (forall x.
 PutAccountDetailsResponse -> Rep PutAccountDetailsResponse x)
-> (forall x.
    Rep PutAccountDetailsResponse x -> PutAccountDetailsResponse)
-> Generic PutAccountDetailsResponse
forall x.
Rep PutAccountDetailsResponse x -> PutAccountDetailsResponse
forall x.
PutAccountDetailsResponse -> Rep PutAccountDetailsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAccountDetailsResponse x -> PutAccountDetailsResponse
$cfrom :: forall x.
PutAccountDetailsResponse -> Rep PutAccountDetailsResponse x
Prelude.Generic)

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

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

instance Prelude.NFData PutAccountDetailsResponse