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

-- |
-- Create a value of 'GuardianAttributes' 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', 'guardianAttributes_optimizedSharedDelivery' - Specifies the status of your VDM optimized shared delivery. Can be one
-- of the following:
--
-- -   @ENABLED@ – Amazon SES enables optimized shared delivery for your
--     account.
--
-- -   @DISABLED@ – Amazon SES disables optimized shared delivery for your
--     account.
newGuardianAttributes ::
  GuardianAttributes
newGuardianAttributes :: GuardianAttributes
newGuardianAttributes =
  GuardianAttributes'
    { $sel:optimizedSharedDelivery:GuardianAttributes' :: 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 your
--     account.
--
-- -   @DISABLED@ – Amazon SES disables optimized shared delivery for your
--     account.
guardianAttributes_optimizedSharedDelivery :: Lens.Lens' GuardianAttributes (Prelude.Maybe FeatureStatus)
guardianAttributes_optimizedSharedDelivery :: Lens' GuardianAttributes (Maybe FeatureStatus)
guardianAttributes_optimizedSharedDelivery = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GuardianAttributes' {Maybe FeatureStatus
optimizedSharedDelivery :: Maybe FeatureStatus
$sel:optimizedSharedDelivery:GuardianAttributes' :: GuardianAttributes -> Maybe FeatureStatus
optimizedSharedDelivery} -> Maybe FeatureStatus
optimizedSharedDelivery) (\s :: GuardianAttributes
s@GuardianAttributes' {} Maybe FeatureStatus
a -> GuardianAttributes
s {$sel:optimizedSharedDelivery:GuardianAttributes' :: Maybe FeatureStatus
optimizedSharedDelivery = Maybe FeatureStatus
a} :: GuardianAttributes)

instance Data.FromJSON GuardianAttributes where
  parseJSON :: Value -> Parser GuardianAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GuardianAttributes"
      ( \Object
x ->
          Maybe FeatureStatus -> GuardianAttributes
GuardianAttributes'
            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 GuardianAttributes where
  hashWithSalt :: Int -> GuardianAttributes -> Int
hashWithSalt Int
_salt GuardianAttributes' {Maybe FeatureStatus
optimizedSharedDelivery :: Maybe FeatureStatus
$sel:optimizedSharedDelivery:GuardianAttributes' :: GuardianAttributes -> Maybe FeatureStatus
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FeatureStatus
optimizedSharedDelivery

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

instance Data.ToJSON GuardianAttributes where
  toJSON :: GuardianAttributes -> Value
toJSON GuardianAttributes' {Maybe FeatureStatus
optimizedSharedDelivery :: Maybe FeatureStatus
$sel:optimizedSharedDelivery:GuardianAttributes' :: GuardianAttributes -> 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
          ]
      )