{-# 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.VdmOptions
-- 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.VdmOptions 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.DashboardOptions
import Amazonka.SESV2.Types.GuardianOptions

-- | An object that defines the VDM settings that apply to emails that you
-- send using the configuration set.
--
-- /See:/ 'newVdmOptions' smart constructor.
data VdmOptions = VdmOptions'
  { -- | Specifies additional settings for your VDM configuration as applicable
    -- to the Dashboard.
    VdmOptions -> Maybe DashboardOptions
dashboardOptions :: Prelude.Maybe DashboardOptions,
    -- | Specifies additional settings for your VDM configuration as applicable
    -- to the Guardian.
    VdmOptions -> Maybe GuardianOptions
guardianOptions :: Prelude.Maybe GuardianOptions
  }
  deriving (VdmOptions -> VdmOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VdmOptions -> VdmOptions -> Bool
$c/= :: VdmOptions -> VdmOptions -> Bool
== :: VdmOptions -> VdmOptions -> Bool
$c== :: VdmOptions -> VdmOptions -> Bool
Prelude.Eq, ReadPrec [VdmOptions]
ReadPrec VdmOptions
Int -> ReadS VdmOptions
ReadS [VdmOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VdmOptions]
$creadListPrec :: ReadPrec [VdmOptions]
readPrec :: ReadPrec VdmOptions
$creadPrec :: ReadPrec VdmOptions
readList :: ReadS [VdmOptions]
$creadList :: ReadS [VdmOptions]
readsPrec :: Int -> ReadS VdmOptions
$creadsPrec :: Int -> ReadS VdmOptions
Prelude.Read, Int -> VdmOptions -> ShowS
[VdmOptions] -> ShowS
VdmOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VdmOptions] -> ShowS
$cshowList :: [VdmOptions] -> ShowS
show :: VdmOptions -> String
$cshow :: VdmOptions -> String
showsPrec :: Int -> VdmOptions -> ShowS
$cshowsPrec :: Int -> VdmOptions -> ShowS
Prelude.Show, forall x. Rep VdmOptions x -> VdmOptions
forall x. VdmOptions -> Rep VdmOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VdmOptions x -> VdmOptions
$cfrom :: forall x. VdmOptions -> Rep VdmOptions x
Prelude.Generic)

-- |
-- Create a value of 'VdmOptions' 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:
--
-- 'dashboardOptions', 'vdmOptions_dashboardOptions' - Specifies additional settings for your VDM configuration as applicable
-- to the Dashboard.
--
-- 'guardianOptions', 'vdmOptions_guardianOptions' - Specifies additional settings for your VDM configuration as applicable
-- to the Guardian.
newVdmOptions ::
  VdmOptions
newVdmOptions :: VdmOptions
newVdmOptions =
  VdmOptions'
    { $sel:dashboardOptions:VdmOptions' :: Maybe DashboardOptions
dashboardOptions = forall a. Maybe a
Prelude.Nothing,
      $sel:guardianOptions:VdmOptions' :: Maybe GuardianOptions
guardianOptions = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies additional settings for your VDM configuration as applicable
-- to the Dashboard.
vdmOptions_dashboardOptions :: Lens.Lens' VdmOptions (Prelude.Maybe DashboardOptions)
vdmOptions_dashboardOptions :: Lens' VdmOptions (Maybe DashboardOptions)
vdmOptions_dashboardOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VdmOptions' {Maybe DashboardOptions
dashboardOptions :: Maybe DashboardOptions
$sel:dashboardOptions:VdmOptions' :: VdmOptions -> Maybe DashboardOptions
dashboardOptions} -> Maybe DashboardOptions
dashboardOptions) (\s :: VdmOptions
s@VdmOptions' {} Maybe DashboardOptions
a -> VdmOptions
s {$sel:dashboardOptions:VdmOptions' :: Maybe DashboardOptions
dashboardOptions = Maybe DashboardOptions
a} :: VdmOptions)

-- | Specifies additional settings for your VDM configuration as applicable
-- to the Guardian.
vdmOptions_guardianOptions :: Lens.Lens' VdmOptions (Prelude.Maybe GuardianOptions)
vdmOptions_guardianOptions :: Lens' VdmOptions (Maybe GuardianOptions)
vdmOptions_guardianOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VdmOptions' {Maybe GuardianOptions
guardianOptions :: Maybe GuardianOptions
$sel:guardianOptions:VdmOptions' :: VdmOptions -> Maybe GuardianOptions
guardianOptions} -> Maybe GuardianOptions
guardianOptions) (\s :: VdmOptions
s@VdmOptions' {} Maybe GuardianOptions
a -> VdmOptions
s {$sel:guardianOptions:VdmOptions' :: Maybe GuardianOptions
guardianOptions = Maybe GuardianOptions
a} :: VdmOptions)

instance Data.FromJSON VdmOptions where
  parseJSON :: Value -> Parser VdmOptions
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VdmOptions"
      ( \Object
x ->
          Maybe DashboardOptions -> Maybe GuardianOptions -> VdmOptions
VdmOptions'
            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
"DashboardOptions")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"GuardianOptions")
      )

instance Prelude.Hashable VdmOptions where
  hashWithSalt :: Int -> VdmOptions -> Int
hashWithSalt Int
_salt VdmOptions' {Maybe DashboardOptions
Maybe GuardianOptions
guardianOptions :: Maybe GuardianOptions
dashboardOptions :: Maybe DashboardOptions
$sel:guardianOptions:VdmOptions' :: VdmOptions -> Maybe GuardianOptions
$sel:dashboardOptions:VdmOptions' :: VdmOptions -> Maybe DashboardOptions
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DashboardOptions
dashboardOptions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GuardianOptions
guardianOptions

instance Prelude.NFData VdmOptions where
  rnf :: VdmOptions -> ()
rnf VdmOptions' {Maybe DashboardOptions
Maybe GuardianOptions
guardianOptions :: Maybe GuardianOptions
dashboardOptions :: Maybe DashboardOptions
$sel:guardianOptions:VdmOptions' :: VdmOptions -> Maybe GuardianOptions
$sel:dashboardOptions:VdmOptions' :: VdmOptions -> Maybe DashboardOptions
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe DashboardOptions
dashboardOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GuardianOptions
guardianOptions

instance Data.ToJSON VdmOptions where
  toJSON :: VdmOptions -> Value
toJSON VdmOptions' {Maybe DashboardOptions
Maybe GuardianOptions
guardianOptions :: Maybe GuardianOptions
dashboardOptions :: Maybe DashboardOptions
$sel:guardianOptions:VdmOptions' :: VdmOptions -> Maybe GuardianOptions
$sel:dashboardOptions:VdmOptions' :: VdmOptions -> Maybe DashboardOptions
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DashboardOptions" 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 DashboardOptions
dashboardOptions,
            (Key
"GuardianOptions" 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 GuardianOptions
guardianOptions
          ]
      )