{-# 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.SESV2.Types.DashboardOptions 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 Amazonka.SESV2.Types.FeatureStatus
data DashboardOptions = DashboardOptions'
{
DashboardOptions -> Maybe FeatureStatus
engagementMetrics :: Prelude.Maybe FeatureStatus
}
deriving (DashboardOptions -> DashboardOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DashboardOptions -> DashboardOptions -> Bool
$c/= :: DashboardOptions -> DashboardOptions -> Bool
== :: DashboardOptions -> DashboardOptions -> Bool
$c== :: DashboardOptions -> DashboardOptions -> Bool
Prelude.Eq, ReadPrec [DashboardOptions]
ReadPrec DashboardOptions
Int -> ReadS DashboardOptions
ReadS [DashboardOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DashboardOptions]
$creadListPrec :: ReadPrec [DashboardOptions]
readPrec :: ReadPrec DashboardOptions
$creadPrec :: ReadPrec DashboardOptions
readList :: ReadS [DashboardOptions]
$creadList :: ReadS [DashboardOptions]
readsPrec :: Int -> ReadS DashboardOptions
$creadsPrec :: Int -> ReadS DashboardOptions
Prelude.Read, Int -> DashboardOptions -> ShowS
[DashboardOptions] -> ShowS
DashboardOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DashboardOptions] -> ShowS
$cshowList :: [DashboardOptions] -> ShowS
show :: DashboardOptions -> String
$cshow :: DashboardOptions -> String
showsPrec :: Int -> DashboardOptions -> ShowS
$cshowsPrec :: Int -> DashboardOptions -> ShowS
Prelude.Show, forall x. Rep DashboardOptions x -> DashboardOptions
forall x. DashboardOptions -> Rep DashboardOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DashboardOptions x -> DashboardOptions
$cfrom :: forall x. DashboardOptions -> Rep DashboardOptions x
Prelude.Generic)
newDashboardOptions ::
DashboardOptions
newDashboardOptions :: DashboardOptions
newDashboardOptions =
DashboardOptions'
{ $sel:engagementMetrics:DashboardOptions' :: Maybe FeatureStatus
engagementMetrics =
forall a. Maybe a
Prelude.Nothing
}
dashboardOptions_engagementMetrics :: Lens.Lens' DashboardOptions (Prelude.Maybe FeatureStatus)
dashboardOptions_engagementMetrics :: Lens' DashboardOptions (Maybe FeatureStatus)
dashboardOptions_engagementMetrics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardOptions' {Maybe FeatureStatus
engagementMetrics :: Maybe FeatureStatus
$sel:engagementMetrics:DashboardOptions' :: DashboardOptions -> Maybe FeatureStatus
engagementMetrics} -> Maybe FeatureStatus
engagementMetrics) (\s :: DashboardOptions
s@DashboardOptions' {} Maybe FeatureStatus
a -> DashboardOptions
s {$sel:engagementMetrics:DashboardOptions' :: Maybe FeatureStatus
engagementMetrics = Maybe FeatureStatus
a} :: DashboardOptions)
instance Data.FromJSON DashboardOptions where
parseJSON :: Value -> Parser DashboardOptions
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DashboardOptions"
( \Object
x ->
Maybe FeatureStatus -> DashboardOptions
DashboardOptions'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EngagementMetrics")
)
instance Prelude.Hashable DashboardOptions where
hashWithSalt :: Int -> DashboardOptions -> Int
hashWithSalt Int
_salt DashboardOptions' {Maybe FeatureStatus
engagementMetrics :: Maybe FeatureStatus
$sel:engagementMetrics:DashboardOptions' :: DashboardOptions -> Maybe FeatureStatus
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FeatureStatus
engagementMetrics
instance Prelude.NFData DashboardOptions where
rnf :: DashboardOptions -> ()
rnf DashboardOptions' {Maybe FeatureStatus
engagementMetrics :: Maybe FeatureStatus
$sel:engagementMetrics:DashboardOptions' :: DashboardOptions -> Maybe FeatureStatus
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe FeatureStatus
engagementMetrics
instance Data.ToJSON DashboardOptions where
toJSON :: DashboardOptions -> Value
toJSON DashboardOptions' {Maybe FeatureStatus
engagementMetrics :: Maybe FeatureStatus
$sel:engagementMetrics:DashboardOptions' :: DashboardOptions -> Maybe FeatureStatus
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"EngagementMetrics" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FeatureStatus
engagementMetrics
]
)