{-# 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.ReputationOptions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SES.Types.ReputationOptions 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

-- | Contains information about the reputation settings for a configuration
-- set.
--
-- /See:/ 'newReputationOptions' smart constructor.
data ReputationOptions = ReputationOptions'
  { -- | The date and time at which the reputation metrics for the configuration
    -- set were last reset. Resetting these metrics is known as a /fresh
    -- start/.
    --
    -- When you disable email sending for a configuration set using
    -- UpdateConfigurationSetSendingEnabled and later re-enable it, the
    -- reputation metrics for the configuration set (but not for the entire
    -- Amazon SES account) are reset.
    --
    -- If email sending for the configuration set has never been disabled and
    -- later re-enabled, the value of this attribute is @null@.
    ReputationOptions -> Maybe ISO8601
lastFreshStart :: Prelude.Maybe Data.ISO8601,
    -- | Describes whether or not Amazon SES publishes reputation metrics for the
    -- configuration set, such as bounce and complaint rates, to Amazon
    -- CloudWatch.
    --
    -- If the value is @true@, reputation metrics are published. If the value
    -- is @false@, reputation metrics are not published. The default value is
    -- @false@.
    ReputationOptions -> Maybe Bool
reputationMetricsEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Describes whether email sending is enabled or disabled for the
    -- configuration set. If the value is @true@, then Amazon SES will send
    -- emails that use the configuration set. If the value is @false@, Amazon
    -- SES will not send emails that use the configuration set. The default
    -- value is @true@. You can change this setting using
    -- UpdateConfigurationSetSendingEnabled.
    ReputationOptions -> Maybe Bool
sendingEnabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (ReputationOptions -> ReputationOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReputationOptions -> ReputationOptions -> Bool
$c/= :: ReputationOptions -> ReputationOptions -> Bool
== :: ReputationOptions -> ReputationOptions -> Bool
$c== :: ReputationOptions -> ReputationOptions -> Bool
Prelude.Eq, ReadPrec [ReputationOptions]
ReadPrec ReputationOptions
Int -> ReadS ReputationOptions
ReadS [ReputationOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReputationOptions]
$creadListPrec :: ReadPrec [ReputationOptions]
readPrec :: ReadPrec ReputationOptions
$creadPrec :: ReadPrec ReputationOptions
readList :: ReadS [ReputationOptions]
$creadList :: ReadS [ReputationOptions]
readsPrec :: Int -> ReadS ReputationOptions
$creadsPrec :: Int -> ReadS ReputationOptions
Prelude.Read, Int -> ReputationOptions -> ShowS
[ReputationOptions] -> ShowS
ReputationOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReputationOptions] -> ShowS
$cshowList :: [ReputationOptions] -> ShowS
show :: ReputationOptions -> String
$cshow :: ReputationOptions -> String
showsPrec :: Int -> ReputationOptions -> ShowS
$cshowsPrec :: Int -> ReputationOptions -> ShowS
Prelude.Show, forall x. Rep ReputationOptions x -> ReputationOptions
forall x. ReputationOptions -> Rep ReputationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReputationOptions x -> ReputationOptions
$cfrom :: forall x. ReputationOptions -> Rep ReputationOptions x
Prelude.Generic)

-- |
-- Create a value of 'ReputationOptions' 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:
--
-- 'lastFreshStart', 'reputationOptions_lastFreshStart' - The date and time at which the reputation metrics for the configuration
-- set were last reset. Resetting these metrics is known as a /fresh
-- start/.
--
-- When you disable email sending for a configuration set using
-- UpdateConfigurationSetSendingEnabled and later re-enable it, the
-- reputation metrics for the configuration set (but not for the entire
-- Amazon SES account) are reset.
--
-- If email sending for the configuration set has never been disabled and
-- later re-enabled, the value of this attribute is @null@.
--
-- 'reputationMetricsEnabled', 'reputationOptions_reputationMetricsEnabled' - Describes whether or not Amazon SES publishes reputation metrics for the
-- configuration set, such as bounce and complaint rates, to Amazon
-- CloudWatch.
--
-- If the value is @true@, reputation metrics are published. If the value
-- is @false@, reputation metrics are not published. The default value is
-- @false@.
--
-- 'sendingEnabled', 'reputationOptions_sendingEnabled' - Describes whether email sending is enabled or disabled for the
-- configuration set. If the value is @true@, then Amazon SES will send
-- emails that use the configuration set. If the value is @false@, Amazon
-- SES will not send emails that use the configuration set. The default
-- value is @true@. You can change this setting using
-- UpdateConfigurationSetSendingEnabled.
newReputationOptions ::
  ReputationOptions
newReputationOptions :: ReputationOptions
newReputationOptions =
  ReputationOptions'
    { $sel:lastFreshStart:ReputationOptions' :: Maybe ISO8601
lastFreshStart =
        forall a. Maybe a
Prelude.Nothing,
      $sel:reputationMetricsEnabled:ReputationOptions' :: Maybe Bool
reputationMetricsEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:sendingEnabled:ReputationOptions' :: Maybe Bool
sendingEnabled = forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time at which the reputation metrics for the configuration
-- set were last reset. Resetting these metrics is known as a /fresh
-- start/.
--
-- When you disable email sending for a configuration set using
-- UpdateConfigurationSetSendingEnabled and later re-enable it, the
-- reputation metrics for the configuration set (but not for the entire
-- Amazon SES account) are reset.
--
-- If email sending for the configuration set has never been disabled and
-- later re-enabled, the value of this attribute is @null@.
reputationOptions_lastFreshStart :: Lens.Lens' ReputationOptions (Prelude.Maybe Prelude.UTCTime)
reputationOptions_lastFreshStart :: Lens' ReputationOptions (Maybe UTCTime)
reputationOptions_lastFreshStart = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReputationOptions' {Maybe ISO8601
lastFreshStart :: Maybe ISO8601
$sel:lastFreshStart:ReputationOptions' :: ReputationOptions -> Maybe ISO8601
lastFreshStart} -> Maybe ISO8601
lastFreshStart) (\s :: ReputationOptions
s@ReputationOptions' {} Maybe ISO8601
a -> ReputationOptions
s {$sel:lastFreshStart:ReputationOptions' :: Maybe ISO8601
lastFreshStart = Maybe ISO8601
a} :: ReputationOptions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Describes whether or not Amazon SES publishes reputation metrics for the
-- configuration set, such as bounce and complaint rates, to Amazon
-- CloudWatch.
--
-- If the value is @true@, reputation metrics are published. If the value
-- is @false@, reputation metrics are not published. The default value is
-- @false@.
reputationOptions_reputationMetricsEnabled :: Lens.Lens' ReputationOptions (Prelude.Maybe Prelude.Bool)
reputationOptions_reputationMetricsEnabled :: Lens' ReputationOptions (Maybe Bool)
reputationOptions_reputationMetricsEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReputationOptions' {Maybe Bool
reputationMetricsEnabled :: Maybe Bool
$sel:reputationMetricsEnabled:ReputationOptions' :: ReputationOptions -> Maybe Bool
reputationMetricsEnabled} -> Maybe Bool
reputationMetricsEnabled) (\s :: ReputationOptions
s@ReputationOptions' {} Maybe Bool
a -> ReputationOptions
s {$sel:reputationMetricsEnabled:ReputationOptions' :: Maybe Bool
reputationMetricsEnabled = Maybe Bool
a} :: ReputationOptions)

-- | Describes whether email sending is enabled or disabled for the
-- configuration set. If the value is @true@, then Amazon SES will send
-- emails that use the configuration set. If the value is @false@, Amazon
-- SES will not send emails that use the configuration set. The default
-- value is @true@. You can change this setting using
-- UpdateConfigurationSetSendingEnabled.
reputationOptions_sendingEnabled :: Lens.Lens' ReputationOptions (Prelude.Maybe Prelude.Bool)
reputationOptions_sendingEnabled :: Lens' ReputationOptions (Maybe Bool)
reputationOptions_sendingEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReputationOptions' {Maybe Bool
sendingEnabled :: Maybe Bool
$sel:sendingEnabled:ReputationOptions' :: ReputationOptions -> Maybe Bool
sendingEnabled} -> Maybe Bool
sendingEnabled) (\s :: ReputationOptions
s@ReputationOptions' {} Maybe Bool
a -> ReputationOptions
s {$sel:sendingEnabled:ReputationOptions' :: Maybe Bool
sendingEnabled = Maybe Bool
a} :: ReputationOptions)

instance Data.FromXML ReputationOptions where
  parseXML :: [Node] -> Either String ReputationOptions
parseXML [Node]
x =
    Maybe ISO8601 -> Maybe Bool -> Maybe Bool -> ReputationOptions
ReputationOptions'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"LastFreshStart")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ReputationMetricsEnabled")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"SendingEnabled")

instance Prelude.Hashable ReputationOptions where
  hashWithSalt :: Int -> ReputationOptions -> Int
hashWithSalt Int
_salt ReputationOptions' {Maybe Bool
Maybe ISO8601
sendingEnabled :: Maybe Bool
reputationMetricsEnabled :: Maybe Bool
lastFreshStart :: Maybe ISO8601
$sel:sendingEnabled:ReputationOptions' :: ReputationOptions -> Maybe Bool
$sel:reputationMetricsEnabled:ReputationOptions' :: ReputationOptions -> Maybe Bool
$sel:lastFreshStart:ReputationOptions' :: ReputationOptions -> Maybe ISO8601
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
lastFreshStart
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
reputationMetricsEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
sendingEnabled

instance Prelude.NFData ReputationOptions where
  rnf :: ReputationOptions -> ()
rnf ReputationOptions' {Maybe Bool
Maybe ISO8601
sendingEnabled :: Maybe Bool
reputationMetricsEnabled :: Maybe Bool
lastFreshStart :: Maybe ISO8601
$sel:sendingEnabled:ReputationOptions' :: ReputationOptions -> Maybe Bool
$sel:reputationMetricsEnabled:ReputationOptions' :: ReputationOptions -> Maybe Bool
$sel:lastFreshStart:ReputationOptions' :: ReputationOptions -> Maybe ISO8601
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
lastFreshStart
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
reputationMetricsEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
sendingEnabled