{-# 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 #-}
module Amazonka.SES.Types.ReputationOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ReputationOptions = ReputationOptions'
{
ReputationOptions -> Maybe ISO8601
lastFreshStart :: Prelude.Maybe Core.ISO8601,
ReputationOptions -> Maybe Bool
reputationMetricsEnabled :: Prelude.Maybe Prelude.Bool,
ReputationOptions -> Maybe Bool
sendingEnabled :: Prelude.Maybe Prelude.Bool
}
deriving (ReputationOptions -> ReputationOptions -> Bool
(ReputationOptions -> ReputationOptions -> Bool)
-> (ReputationOptions -> ReputationOptions -> Bool)
-> Eq ReputationOptions
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]
(Int -> ReadS ReputationOptions)
-> ReadS [ReputationOptions]
-> ReadPrec ReputationOptions
-> ReadPrec [ReputationOptions]
-> Read 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
(Int -> ReputationOptions -> ShowS)
-> (ReputationOptions -> String)
-> ([ReputationOptions] -> ShowS)
-> Show ReputationOptions
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. ReputationOptions -> Rep ReputationOptions x)
-> (forall x. Rep ReputationOptions x -> ReputationOptions)
-> Generic ReputationOptions
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)
newReputationOptions ::
ReputationOptions
newReputationOptions :: ReputationOptions
newReputationOptions =
ReputationOptions' :: Maybe ISO8601 -> Maybe Bool -> Maybe Bool -> ReputationOptions
ReputationOptions'
{ $sel:lastFreshStart:ReputationOptions' :: Maybe ISO8601
lastFreshStart =
Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:reputationMetricsEnabled:ReputationOptions' :: Maybe Bool
reputationMetricsEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:sendingEnabled:ReputationOptions' :: Maybe Bool
sendingEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
reputationOptions_lastFreshStart :: Lens.Lens' ReputationOptions (Prelude.Maybe Prelude.UTCTime)
reputationOptions_lastFreshStart :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReputationOptions -> f ReputationOptions
reputationOptions_lastFreshStart = (ReputationOptions -> Maybe ISO8601)
-> (ReputationOptions -> Maybe ISO8601 -> ReputationOptions)
-> Lens
ReputationOptions ReputationOptions (Maybe ISO8601) (Maybe ISO8601)
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) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> ReputationOptions -> f ReputationOptions)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReputationOptions
-> f ReputationOptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
reputationOptions_reputationMetricsEnabled :: Lens.Lens' ReputationOptions (Prelude.Maybe Prelude.Bool)
reputationOptions_reputationMetricsEnabled :: (Maybe Bool -> f (Maybe Bool))
-> ReputationOptions -> f ReputationOptions
reputationOptions_reputationMetricsEnabled = (ReputationOptions -> Maybe Bool)
-> (ReputationOptions -> Maybe Bool -> ReputationOptions)
-> Lens
ReputationOptions ReputationOptions (Maybe Bool) (Maybe Bool)
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)
reputationOptions_sendingEnabled :: Lens.Lens' ReputationOptions (Prelude.Maybe Prelude.Bool)
reputationOptions_sendingEnabled :: (Maybe Bool -> f (Maybe Bool))
-> ReputationOptions -> f ReputationOptions
reputationOptions_sendingEnabled = (ReputationOptions -> Maybe Bool)
-> (ReputationOptions -> Maybe Bool -> ReputationOptions)
-> Lens
ReputationOptions ReputationOptions (Maybe Bool) (Maybe Bool)
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 Core.FromXML ReputationOptions where
parseXML :: [Node] -> Either String ReputationOptions
parseXML [Node]
x =
Maybe ISO8601 -> Maybe Bool -> Maybe Bool -> ReputationOptions
ReputationOptions'
(Maybe ISO8601 -> Maybe Bool -> Maybe Bool -> ReputationOptions)
-> Either String (Maybe ISO8601)
-> Either String (Maybe Bool -> Maybe Bool -> ReputationOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LastFreshStart")
Either String (Maybe Bool -> Maybe Bool -> ReputationOptions)
-> Either String (Maybe Bool)
-> Either String (Maybe Bool -> ReputationOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ReputationMetricsEnabled")
Either String (Maybe Bool -> ReputationOptions)
-> Either String (Maybe Bool) -> Either String ReputationOptions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SendingEnabled")
instance Prelude.Hashable ReputationOptions
instance Prelude.NFData ReputationOptions