{-# 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.SESV2.Types.DashboardAttributes
-- 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.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

-- | An object containing additional settings for your VDM configuration as
-- applicable to the Dashboard.
--
-- /See:/ 'newDashboardAttributes' smart constructor.
data DashboardAttributes = DashboardAttributes'
  { -- | Specifies the status of your VDM engagement metrics collection. Can be
    -- one of the following:
    --
    -- -   @ENABLED@ – Amazon SES enables engagement metrics for your account.
    --
    -- -   @DISABLED@ – Amazon SES disables engagement metrics for your
    --     account.
    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)

-- |
-- Create a value of 'DashboardAttributes' 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:
--
-- 'engagementMetrics', 'dashboardAttributes_engagementMetrics' - Specifies the status of your VDM engagement metrics collection. Can be
-- one of the following:
--
-- -   @ENABLED@ – Amazon SES enables engagement metrics for your account.
--
-- -   @DISABLED@ – Amazon SES disables engagement metrics for your
--     account.
newDashboardAttributes ::
  DashboardAttributes
newDashboardAttributes :: DashboardAttributes
newDashboardAttributes =
  DashboardAttributes'
    { $sel:engagementMetrics:DashboardAttributes' :: Maybe FeatureStatus
engagementMetrics =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the status of your VDM engagement metrics collection. Can be
-- one of the following:
--
-- -   @ENABLED@ – Amazon SES enables engagement metrics for your account.
--
-- -   @DISABLED@ – Amazon SES disables engagement metrics for your
--     account.
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
          ]
      )