{-# 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.DashboardAttributes 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 DashboardAttributes = DashboardAttributes'
{
DashboardAttributes -> Maybe FeatureStatus
engagementMetrics :: Prelude.Maybe FeatureStatus
}
deriving (DashboardAttributes -> DashboardAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DashboardAttributes -> DashboardAttributes -> Bool
$c/= :: DashboardAttributes -> DashboardAttributes -> Bool
== :: DashboardAttributes -> DashboardAttributes -> Bool
$c== :: DashboardAttributes -> DashboardAttributes -> Bool
Prelude.Eq, ReadPrec [DashboardAttributes]
ReadPrec DashboardAttributes
Int -> ReadS DashboardAttributes
ReadS [DashboardAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DashboardAttributes]
$creadListPrec :: ReadPrec [DashboardAttributes]
readPrec :: ReadPrec DashboardAttributes
$creadPrec :: ReadPrec DashboardAttributes
readList :: ReadS [DashboardAttributes]
$creadList :: ReadS [DashboardAttributes]
readsPrec :: Int -> ReadS DashboardAttributes
$creadsPrec :: Int -> ReadS DashboardAttributes
Prelude.Read, Int -> DashboardAttributes -> ShowS
[DashboardAttributes] -> ShowS
DashboardAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DashboardAttributes] -> ShowS
$cshowList :: [DashboardAttributes] -> ShowS
show :: DashboardAttributes -> String
$cshow :: DashboardAttributes -> String
showsPrec :: Int -> DashboardAttributes -> ShowS
$cshowsPrec :: Int -> DashboardAttributes -> ShowS
Prelude.Show, forall x. Rep DashboardAttributes x -> DashboardAttributes
forall x. DashboardAttributes -> Rep DashboardAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DashboardAttributes x -> DashboardAttributes
$cfrom :: forall x. DashboardAttributes -> Rep DashboardAttributes x
Prelude.Generic)
newDashboardAttributes ::
DashboardAttributes
newDashboardAttributes :: DashboardAttributes
newDashboardAttributes =
DashboardAttributes'
{ $sel:engagementMetrics:DashboardAttributes' :: Maybe FeatureStatus
engagementMetrics =
forall a. Maybe a
Prelude.Nothing
}
dashboardAttributes_engagementMetrics :: Lens.Lens' DashboardAttributes (Prelude.Maybe FeatureStatus)
dashboardAttributes_engagementMetrics :: Lens' DashboardAttributes (Maybe FeatureStatus)
dashboardAttributes_engagementMetrics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardAttributes' {Maybe FeatureStatus
engagementMetrics :: Maybe FeatureStatus
$sel:engagementMetrics:DashboardAttributes' :: DashboardAttributes -> Maybe FeatureStatus
engagementMetrics} -> Maybe FeatureStatus
engagementMetrics) (\s :: DashboardAttributes
s@DashboardAttributes' {} Maybe FeatureStatus
a -> DashboardAttributes
s {$sel:engagementMetrics:DashboardAttributes' :: Maybe FeatureStatus
engagementMetrics = Maybe FeatureStatus
a} :: DashboardAttributes)
instance Data.FromJSON DashboardAttributes where
parseJSON :: Value -> Parser DashboardAttributes
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DashboardAttributes"
( \Object
x ->
Maybe FeatureStatus -> DashboardAttributes
DashboardAttributes'
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 DashboardAttributes where
hashWithSalt :: Int -> DashboardAttributes -> Int
hashWithSalt Int
_salt DashboardAttributes' {Maybe FeatureStatus
engagementMetrics :: Maybe FeatureStatus
$sel:engagementMetrics:DashboardAttributes' :: DashboardAttributes -> Maybe FeatureStatus
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FeatureStatus
engagementMetrics
instance Prelude.NFData DashboardAttributes where
rnf :: DashboardAttributes -> ()
rnf DashboardAttributes' {Maybe FeatureStatus
engagementMetrics :: Maybe FeatureStatus
$sel:engagementMetrics:DashboardAttributes' :: DashboardAttributes -> Maybe FeatureStatus
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe FeatureStatus
engagementMetrics
instance Data.ToJSON DashboardAttributes where
toJSON :: DashboardAttributes -> Value
toJSON DashboardAttributes' {Maybe FeatureStatus
engagementMetrics :: Maybe FeatureStatus
$sel:engagementMetrics:DashboardAttributes' :: DashboardAttributes -> 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
]
)