{-# 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.DashboardOptions
-- 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.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

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

-- |
-- Create a value of 'DashboardOptions' 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', 'dashboardOptions_engagementMetrics' - Specifies the status of your VDM engagement metrics collection. Can be
-- one of the following:
--
-- -   @ENABLED@ – Amazon SES enables engagement metrics for the
--     configuration set.
--
-- -   @DISABLED@ – Amazon SES disables engagement metrics for the
--     configuration set.
newDashboardOptions ::
  DashboardOptions
newDashboardOptions :: DashboardOptions
newDashboardOptions =
  DashboardOptions'
    { $sel:engagementMetrics:DashboardOptions' :: 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 the
--     configuration set.
--
-- -   @DISABLED@ – Amazon SES disables engagement metrics for the
--     configuration set.
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
          ]
      )