{-# 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.GuardianOptions
-- 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.GuardianOptions 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 Guardian.
--
-- /See:/ 'newGuardianOptions' smart constructor.
data GuardianOptions = GuardianOptions'
  { -- | Specifies the status of your VDM optimized shared delivery. Can be one
    -- of the following:
    --
    -- -   @ENABLED@ – Amazon SES enables optimized shared delivery for the
    --     configuration set.
    --
    -- -   @DISABLED@ – Amazon SES disables optimized shared delivery for the
    --     configuration set.
    GuardianOptions -> Maybe FeatureStatus
optimizedSharedDelivery :: Prelude.Maybe FeatureStatus
  }
  deriving (GuardianOptions -> GuardianOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GuardianOptions -> GuardianOptions -> Bool
$c/= :: GuardianOptions -> GuardianOptions -> Bool
== :: GuardianOptions -> GuardianOptions -> Bool
$c== :: GuardianOptions -> GuardianOptions -> Bool
Prelude.Eq, ReadPrec [GuardianOptions]
ReadPrec GuardianOptions
Int -> ReadS GuardianOptions
ReadS [GuardianOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GuardianOptions]
$creadListPrec :: ReadPrec [GuardianOptions]
readPrec :: ReadPrec GuardianOptions
$creadPrec :: ReadPrec GuardianOptions
readList :: ReadS [GuardianOptions]
$creadList :: ReadS [GuardianOptions]
readsPrec :: Int -> ReadS GuardianOptions
$creadsPrec :: Int -> ReadS GuardianOptions
Prelude.Read, Int -> GuardianOptions -> ShowS
[GuardianOptions] -> ShowS
GuardianOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GuardianOptions] -> ShowS
$cshowList :: [GuardianOptions] -> ShowS
show :: GuardianOptions -> String
$cshow :: GuardianOptions -> String
showsPrec :: Int -> GuardianOptions -> ShowS
$cshowsPrec :: Int -> GuardianOptions -> ShowS
Prelude.Show, forall x. Rep GuardianOptions x -> GuardianOptions
forall x. GuardianOptions -> Rep GuardianOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GuardianOptions x -> GuardianOptions
$cfrom :: forall x. GuardianOptions -> Rep GuardianOptions x
Prelude.Generic)

-- |
-- Create a value of 'GuardianOptions' 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:
--
-- 'optimizedSharedDelivery', 'guardianOptions_optimizedSharedDelivery' - Specifies the status of your VDM optimized shared delivery. Can be one
-- of the following:
--
-- -   @ENABLED@ – Amazon SES enables optimized shared delivery for the
--     configuration set.
--
-- -   @DISABLED@ – Amazon SES disables optimized shared delivery for the
--     configuration set.
newGuardianOptions ::
  GuardianOptions
newGuardianOptions :: GuardianOptions
newGuardianOptions =
  GuardianOptions'
    { $sel:optimizedSharedDelivery:GuardianOptions' :: Maybe FeatureStatus
optimizedSharedDelivery =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the status of your VDM optimized shared delivery. Can be one
-- of the following:
--
-- -   @ENABLED@ – Amazon SES enables optimized shared delivery for the
--     configuration set.
--
-- -   @DISABLED@ – Amazon SES disables optimized shared delivery for the
--     configuration set.
guardianOptions_optimizedSharedDelivery :: Lens.Lens' GuardianOptions (Prelude.Maybe FeatureStatus)
guardianOptions_optimizedSharedDelivery :: Lens' GuardianOptions (Maybe FeatureStatus)
guardianOptions_optimizedSharedDelivery = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GuardianOptions' {Maybe FeatureStatus
optimizedSharedDelivery :: Maybe FeatureStatus
$sel:optimizedSharedDelivery:GuardianOptions' :: GuardianOptions -> Maybe FeatureStatus
optimizedSharedDelivery} -> Maybe FeatureStatus
optimizedSharedDelivery) (\s :: GuardianOptions
s@GuardianOptions' {} Maybe FeatureStatus
a -> GuardianOptions
s {$sel:optimizedSharedDelivery:GuardianOptions' :: Maybe FeatureStatus
optimizedSharedDelivery = Maybe FeatureStatus
a} :: GuardianOptions)

instance Data.FromJSON GuardianOptions where
  parseJSON :: Value -> Parser GuardianOptions
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GuardianOptions"
      ( \Object
x ->
          Maybe FeatureStatus -> GuardianOptions
GuardianOptions'
            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
"OptimizedSharedDelivery")
      )

instance Prelude.Hashable GuardianOptions where
  hashWithSalt :: Int -> GuardianOptions -> Int
hashWithSalt Int
_salt GuardianOptions' {Maybe FeatureStatus
optimizedSharedDelivery :: Maybe FeatureStatus
$sel:optimizedSharedDelivery:GuardianOptions' :: GuardianOptions -> Maybe FeatureStatus
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FeatureStatus
optimizedSharedDelivery

instance Prelude.NFData GuardianOptions where
  rnf :: GuardianOptions -> ()
rnf GuardianOptions' {Maybe FeatureStatus
optimizedSharedDelivery :: Maybe FeatureStatus
$sel:optimizedSharedDelivery:GuardianOptions' :: GuardianOptions -> Maybe FeatureStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe FeatureStatus
optimizedSharedDelivery

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