{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.BulkEmailDestinationStatus
-- 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)
module Amazonka.SES.Types.BulkEmailDestinationStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SES.Types.BulkEmailStatus

-- | An object that contains the response from the @SendBulkTemplatedEmail@
-- operation.
--
-- /See:/ 'newBulkEmailDestinationStatus' smart constructor.
data BulkEmailDestinationStatus = BulkEmailDestinationStatus'
  { -- | The status of a message sent using the @SendBulkTemplatedEmail@
    -- operation.
    --
    -- Possible values for this parameter include:
    --
    -- -   @Success@: Amazon SES accepted the message, and will attempt to
    --     deliver it to the recipients.
    --
    -- -   @MessageRejected@: The message was rejected because it contained a
    --     virus.
    --
    -- -   @MailFromDomainNotVerified@: The sender\'s email address or domain
    --     was not verified.
    --
    -- -   @ConfigurationSetDoesNotExist@: The configuration set you specified
    --     does not exist.
    --
    -- -   @TemplateDoesNotExist@: The template you specified does not exist.
    --
    -- -   @AccountSuspended@: Your account has been shut down because of
    --     issues related to your email sending practices.
    --
    -- -   @AccountThrottled@: The number of emails you can send has been
    --     reduced because your account has exceeded its allocated sending
    --     limit.
    --
    -- -   @AccountDailyQuotaExceeded@: You have reached or exceeded the
    --     maximum number of emails you can send from your account in a 24-hour
    --     period.
    --
    -- -   @InvalidSendingPoolName@: The configuration set you specified refers
    --     to an IP pool that does not exist.
    --
    -- -   @AccountSendingPaused@: Email sending for the Amazon SES account was
    --     disabled using the UpdateAccountSendingEnabled operation.
    --
    -- -   @ConfigurationSetSendingPaused@: Email sending for this
    --     configuration set was disabled using the
    --     UpdateConfigurationSetSendingEnabled operation.
    --
    -- -   @InvalidParameterValue@: One or more of the parameters you specified
    --     when calling this operation was invalid. See the error message for
    --     additional information.
    --
    -- -   @TransientFailure@: Amazon SES was unable to process your request
    --     because of a temporary issue.
    --
    -- -   @Failed@: Amazon SES was unable to process your request. See the
    --     error message for additional information.
    BulkEmailDestinationStatus -> Maybe BulkEmailStatus
status :: Prelude.Maybe BulkEmailStatus,
    -- | A description of an error that prevented a message being sent using the
    -- @SendBulkTemplatedEmail@ operation.
    BulkEmailDestinationStatus -> Maybe Text
error :: Prelude.Maybe Prelude.Text,
    -- | The unique message identifier returned from the @SendBulkTemplatedEmail@
    -- operation.
    BulkEmailDestinationStatus -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text
  }
  deriving (BulkEmailDestinationStatus -> BulkEmailDestinationStatus -> Bool
(BulkEmailDestinationStatus -> BulkEmailDestinationStatus -> Bool)
-> (BulkEmailDestinationStatus
    -> BulkEmailDestinationStatus -> Bool)
-> Eq BulkEmailDestinationStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BulkEmailDestinationStatus -> BulkEmailDestinationStatus -> Bool
$c/= :: BulkEmailDestinationStatus -> BulkEmailDestinationStatus -> Bool
== :: BulkEmailDestinationStatus -> BulkEmailDestinationStatus -> Bool
$c== :: BulkEmailDestinationStatus -> BulkEmailDestinationStatus -> Bool
Prelude.Eq, ReadPrec [BulkEmailDestinationStatus]
ReadPrec BulkEmailDestinationStatus
Int -> ReadS BulkEmailDestinationStatus
ReadS [BulkEmailDestinationStatus]
(Int -> ReadS BulkEmailDestinationStatus)
-> ReadS [BulkEmailDestinationStatus]
-> ReadPrec BulkEmailDestinationStatus
-> ReadPrec [BulkEmailDestinationStatus]
-> Read BulkEmailDestinationStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BulkEmailDestinationStatus]
$creadListPrec :: ReadPrec [BulkEmailDestinationStatus]
readPrec :: ReadPrec BulkEmailDestinationStatus
$creadPrec :: ReadPrec BulkEmailDestinationStatus
readList :: ReadS [BulkEmailDestinationStatus]
$creadList :: ReadS [BulkEmailDestinationStatus]
readsPrec :: Int -> ReadS BulkEmailDestinationStatus
$creadsPrec :: Int -> ReadS BulkEmailDestinationStatus
Prelude.Read, Int -> BulkEmailDestinationStatus -> ShowS
[BulkEmailDestinationStatus] -> ShowS
BulkEmailDestinationStatus -> String
(Int -> BulkEmailDestinationStatus -> ShowS)
-> (BulkEmailDestinationStatus -> String)
-> ([BulkEmailDestinationStatus] -> ShowS)
-> Show BulkEmailDestinationStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BulkEmailDestinationStatus] -> ShowS
$cshowList :: [BulkEmailDestinationStatus] -> ShowS
show :: BulkEmailDestinationStatus -> String
$cshow :: BulkEmailDestinationStatus -> String
showsPrec :: Int -> BulkEmailDestinationStatus -> ShowS
$cshowsPrec :: Int -> BulkEmailDestinationStatus -> ShowS
Prelude.Show, (forall x.
 BulkEmailDestinationStatus -> Rep BulkEmailDestinationStatus x)
-> (forall x.
    Rep BulkEmailDestinationStatus x -> BulkEmailDestinationStatus)
-> Generic BulkEmailDestinationStatus
forall x.
Rep BulkEmailDestinationStatus x -> BulkEmailDestinationStatus
forall x.
BulkEmailDestinationStatus -> Rep BulkEmailDestinationStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BulkEmailDestinationStatus x -> BulkEmailDestinationStatus
$cfrom :: forall x.
BulkEmailDestinationStatus -> Rep BulkEmailDestinationStatus x
Prelude.Generic)

-- |
-- Create a value of 'BulkEmailDestinationStatus' 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:
--
-- 'status', 'bulkEmailDestinationStatus_status' - The status of a message sent using the @SendBulkTemplatedEmail@
-- operation.
--
-- Possible values for this parameter include:
--
-- -   @Success@: Amazon SES accepted the message, and will attempt to
--     deliver it to the recipients.
--
-- -   @MessageRejected@: The message was rejected because it contained a
--     virus.
--
-- -   @MailFromDomainNotVerified@: The sender\'s email address or domain
--     was not verified.
--
-- -   @ConfigurationSetDoesNotExist@: The configuration set you specified
--     does not exist.
--
-- -   @TemplateDoesNotExist@: The template you specified does not exist.
--
-- -   @AccountSuspended@: Your account has been shut down because of
--     issues related to your email sending practices.
--
-- -   @AccountThrottled@: The number of emails you can send has been
--     reduced because your account has exceeded its allocated sending
--     limit.
--
-- -   @AccountDailyQuotaExceeded@: You have reached or exceeded the
--     maximum number of emails you can send from your account in a 24-hour
--     period.
--
-- -   @InvalidSendingPoolName@: The configuration set you specified refers
--     to an IP pool that does not exist.
--
-- -   @AccountSendingPaused@: Email sending for the Amazon SES account was
--     disabled using the UpdateAccountSendingEnabled operation.
--
-- -   @ConfigurationSetSendingPaused@: Email sending for this
--     configuration set was disabled using the
--     UpdateConfigurationSetSendingEnabled operation.
--
-- -   @InvalidParameterValue@: One or more of the parameters you specified
--     when calling this operation was invalid. See the error message for
--     additional information.
--
-- -   @TransientFailure@: Amazon SES was unable to process your request
--     because of a temporary issue.
--
-- -   @Failed@: Amazon SES was unable to process your request. See the
--     error message for additional information.
--
-- 'error', 'bulkEmailDestinationStatus_error' - A description of an error that prevented a message being sent using the
-- @SendBulkTemplatedEmail@ operation.
--
-- 'messageId', 'bulkEmailDestinationStatus_messageId' - The unique message identifier returned from the @SendBulkTemplatedEmail@
-- operation.
newBulkEmailDestinationStatus ::
  BulkEmailDestinationStatus
newBulkEmailDestinationStatus :: BulkEmailDestinationStatus
newBulkEmailDestinationStatus =
  BulkEmailDestinationStatus' :: Maybe BulkEmailStatus
-> Maybe Text -> Maybe Text -> BulkEmailDestinationStatus
BulkEmailDestinationStatus'
    { $sel:status:BulkEmailDestinationStatus' :: Maybe BulkEmailStatus
status =
        Maybe BulkEmailStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:error:BulkEmailDestinationStatus' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:messageId:BulkEmailDestinationStatus' :: Maybe Text
messageId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of a message sent using the @SendBulkTemplatedEmail@
-- operation.
--
-- Possible values for this parameter include:
--
-- -   @Success@: Amazon SES accepted the message, and will attempt to
--     deliver it to the recipients.
--
-- -   @MessageRejected@: The message was rejected because it contained a
--     virus.
--
-- -   @MailFromDomainNotVerified@: The sender\'s email address or domain
--     was not verified.
--
-- -   @ConfigurationSetDoesNotExist@: The configuration set you specified
--     does not exist.
--
-- -   @TemplateDoesNotExist@: The template you specified does not exist.
--
-- -   @AccountSuspended@: Your account has been shut down because of
--     issues related to your email sending practices.
--
-- -   @AccountThrottled@: The number of emails you can send has been
--     reduced because your account has exceeded its allocated sending
--     limit.
--
-- -   @AccountDailyQuotaExceeded@: You have reached or exceeded the
--     maximum number of emails you can send from your account in a 24-hour
--     period.
--
-- -   @InvalidSendingPoolName@: The configuration set you specified refers
--     to an IP pool that does not exist.
--
-- -   @AccountSendingPaused@: Email sending for the Amazon SES account was
--     disabled using the UpdateAccountSendingEnabled operation.
--
-- -   @ConfigurationSetSendingPaused@: Email sending for this
--     configuration set was disabled using the
--     UpdateConfigurationSetSendingEnabled operation.
--
-- -   @InvalidParameterValue@: One or more of the parameters you specified
--     when calling this operation was invalid. See the error message for
--     additional information.
--
-- -   @TransientFailure@: Amazon SES was unable to process your request
--     because of a temporary issue.
--
-- -   @Failed@: Amazon SES was unable to process your request. See the
--     error message for additional information.
bulkEmailDestinationStatus_status :: Lens.Lens' BulkEmailDestinationStatus (Prelude.Maybe BulkEmailStatus)
bulkEmailDestinationStatus_status :: (Maybe BulkEmailStatus -> f (Maybe BulkEmailStatus))
-> BulkEmailDestinationStatus -> f BulkEmailDestinationStatus
bulkEmailDestinationStatus_status = (BulkEmailDestinationStatus -> Maybe BulkEmailStatus)
-> (BulkEmailDestinationStatus
    -> Maybe BulkEmailStatus -> BulkEmailDestinationStatus)
-> Lens
     BulkEmailDestinationStatus
     BulkEmailDestinationStatus
     (Maybe BulkEmailStatus)
     (Maybe BulkEmailStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkEmailDestinationStatus' {Maybe BulkEmailStatus
status :: Maybe BulkEmailStatus
$sel:status:BulkEmailDestinationStatus' :: BulkEmailDestinationStatus -> Maybe BulkEmailStatus
status} -> Maybe BulkEmailStatus
status) (\s :: BulkEmailDestinationStatus
s@BulkEmailDestinationStatus' {} Maybe BulkEmailStatus
a -> BulkEmailDestinationStatus
s {$sel:status:BulkEmailDestinationStatus' :: Maybe BulkEmailStatus
status = Maybe BulkEmailStatus
a} :: BulkEmailDestinationStatus)

-- | A description of an error that prevented a message being sent using the
-- @SendBulkTemplatedEmail@ operation.
bulkEmailDestinationStatus_error :: Lens.Lens' BulkEmailDestinationStatus (Prelude.Maybe Prelude.Text)
bulkEmailDestinationStatus_error :: (Maybe Text -> f (Maybe Text))
-> BulkEmailDestinationStatus -> f BulkEmailDestinationStatus
bulkEmailDestinationStatus_error = (BulkEmailDestinationStatus -> Maybe Text)
-> (BulkEmailDestinationStatus
    -> Maybe Text -> BulkEmailDestinationStatus)
-> Lens
     BulkEmailDestinationStatus
     BulkEmailDestinationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkEmailDestinationStatus' {Maybe Text
error :: Maybe Text
$sel:error:BulkEmailDestinationStatus' :: BulkEmailDestinationStatus -> Maybe Text
error} -> Maybe Text
error) (\s :: BulkEmailDestinationStatus
s@BulkEmailDestinationStatus' {} Maybe Text
a -> BulkEmailDestinationStatus
s {$sel:error:BulkEmailDestinationStatus' :: Maybe Text
error = Maybe Text
a} :: BulkEmailDestinationStatus)

-- | The unique message identifier returned from the @SendBulkTemplatedEmail@
-- operation.
bulkEmailDestinationStatus_messageId :: Lens.Lens' BulkEmailDestinationStatus (Prelude.Maybe Prelude.Text)
bulkEmailDestinationStatus_messageId :: (Maybe Text -> f (Maybe Text))
-> BulkEmailDestinationStatus -> f BulkEmailDestinationStatus
bulkEmailDestinationStatus_messageId = (BulkEmailDestinationStatus -> Maybe Text)
-> (BulkEmailDestinationStatus
    -> Maybe Text -> BulkEmailDestinationStatus)
-> Lens
     BulkEmailDestinationStatus
     BulkEmailDestinationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkEmailDestinationStatus' {Maybe Text
messageId :: Maybe Text
$sel:messageId:BulkEmailDestinationStatus' :: BulkEmailDestinationStatus -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: BulkEmailDestinationStatus
s@BulkEmailDestinationStatus' {} Maybe Text
a -> BulkEmailDestinationStatus
s {$sel:messageId:BulkEmailDestinationStatus' :: Maybe Text
messageId = Maybe Text
a} :: BulkEmailDestinationStatus)

instance Core.FromXML BulkEmailDestinationStatus where
  parseXML :: [Node] -> Either String BulkEmailDestinationStatus
parseXML [Node]
x =
    Maybe BulkEmailStatus
-> Maybe Text -> Maybe Text -> BulkEmailDestinationStatus
BulkEmailDestinationStatus'
      (Maybe BulkEmailStatus
 -> Maybe Text -> Maybe Text -> BulkEmailDestinationStatus)
-> Either String (Maybe BulkEmailStatus)
-> Either
     String (Maybe Text -> Maybe Text -> BulkEmailDestinationStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe BulkEmailStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
      Either
  String (Maybe Text -> Maybe Text -> BulkEmailDestinationStatus)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> BulkEmailDestinationStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Error")
      Either String (Maybe Text -> BulkEmailDestinationStatus)
-> Either String (Maybe Text)
-> Either String BulkEmailDestinationStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MessageId")

instance Prelude.Hashable BulkEmailDestinationStatus

instance Prelude.NFData BulkEmailDestinationStatus