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

-- | An object that contains inbox placement data for an email provider.
--
-- /See:/ 'newPlacementStatistics' smart constructor.
data PlacementStatistics = PlacementStatistics'
  { -- | The percentage of emails that were authenticated by using DomainKeys
    -- Identified Mail (DKIM) during the predictive inbox placement test.
    PlacementStatistics -> Maybe Double
dkimPercentage :: Prelude.Maybe Prelude.Double,
    -- | The percentage of emails that arrived in recipients\' inboxes during the
    -- predictive inbox placement test.
    PlacementStatistics -> Maybe Double
inboxPercentage :: Prelude.Maybe Prelude.Double,
    -- | The percentage of emails that didn\'t arrive in recipients\' inboxes at
    -- all during the predictive inbox placement test.
    PlacementStatistics -> Maybe Double
missingPercentage :: Prelude.Maybe Prelude.Double,
    -- | The percentage of emails that arrived in recipients\' spam or junk mail
    -- folders during the predictive inbox placement test.
    PlacementStatistics -> Maybe Double
spamPercentage :: Prelude.Maybe Prelude.Double,
    -- | The percentage of emails that were authenticated by using Sender Policy
    -- Framework (SPF) during the predictive inbox placement test.
    PlacementStatistics -> Maybe Double
spfPercentage :: Prelude.Maybe Prelude.Double
  }
  deriving (PlacementStatistics -> PlacementStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlacementStatistics -> PlacementStatistics -> Bool
$c/= :: PlacementStatistics -> PlacementStatistics -> Bool
== :: PlacementStatistics -> PlacementStatistics -> Bool
$c== :: PlacementStatistics -> PlacementStatistics -> Bool
Prelude.Eq, ReadPrec [PlacementStatistics]
ReadPrec PlacementStatistics
Int -> ReadS PlacementStatistics
ReadS [PlacementStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlacementStatistics]
$creadListPrec :: ReadPrec [PlacementStatistics]
readPrec :: ReadPrec PlacementStatistics
$creadPrec :: ReadPrec PlacementStatistics
readList :: ReadS [PlacementStatistics]
$creadList :: ReadS [PlacementStatistics]
readsPrec :: Int -> ReadS PlacementStatistics
$creadsPrec :: Int -> ReadS PlacementStatistics
Prelude.Read, Int -> PlacementStatistics -> ShowS
[PlacementStatistics] -> ShowS
PlacementStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlacementStatistics] -> ShowS
$cshowList :: [PlacementStatistics] -> ShowS
show :: PlacementStatistics -> String
$cshow :: PlacementStatistics -> String
showsPrec :: Int -> PlacementStatistics -> ShowS
$cshowsPrec :: Int -> PlacementStatistics -> ShowS
Prelude.Show, forall x. Rep PlacementStatistics x -> PlacementStatistics
forall x. PlacementStatistics -> Rep PlacementStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlacementStatistics x -> PlacementStatistics
$cfrom :: forall x. PlacementStatistics -> Rep PlacementStatistics x
Prelude.Generic)

-- |
-- Create a value of 'PlacementStatistics' 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:
--
-- 'dkimPercentage', 'placementStatistics_dkimPercentage' - The percentage of emails that were authenticated by using DomainKeys
-- Identified Mail (DKIM) during the predictive inbox placement test.
--
-- 'inboxPercentage', 'placementStatistics_inboxPercentage' - The percentage of emails that arrived in recipients\' inboxes during the
-- predictive inbox placement test.
--
-- 'missingPercentage', 'placementStatistics_missingPercentage' - The percentage of emails that didn\'t arrive in recipients\' inboxes at
-- all during the predictive inbox placement test.
--
-- 'spamPercentage', 'placementStatistics_spamPercentage' - The percentage of emails that arrived in recipients\' spam or junk mail
-- folders during the predictive inbox placement test.
--
-- 'spfPercentage', 'placementStatistics_spfPercentage' - The percentage of emails that were authenticated by using Sender Policy
-- Framework (SPF) during the predictive inbox placement test.
newPlacementStatistics ::
  PlacementStatistics
newPlacementStatistics :: PlacementStatistics
newPlacementStatistics =
  PlacementStatistics'
    { $sel:dkimPercentage:PlacementStatistics' :: Maybe Double
dkimPercentage =
        forall a. Maybe a
Prelude.Nothing,
      $sel:inboxPercentage:PlacementStatistics' :: Maybe Double
inboxPercentage = forall a. Maybe a
Prelude.Nothing,
      $sel:missingPercentage:PlacementStatistics' :: Maybe Double
missingPercentage = forall a. Maybe a
Prelude.Nothing,
      $sel:spamPercentage:PlacementStatistics' :: Maybe Double
spamPercentage = forall a. Maybe a
Prelude.Nothing,
      $sel:spfPercentage:PlacementStatistics' :: Maybe Double
spfPercentage = forall a. Maybe a
Prelude.Nothing
    }

-- | The percentage of emails that were authenticated by using DomainKeys
-- Identified Mail (DKIM) during the predictive inbox placement test.
placementStatistics_dkimPercentage :: Lens.Lens' PlacementStatistics (Prelude.Maybe Prelude.Double)
placementStatistics_dkimPercentage :: Lens' PlacementStatistics (Maybe Double)
placementStatistics_dkimPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementStatistics' {Maybe Double
dkimPercentage :: Maybe Double
$sel:dkimPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
dkimPercentage} -> Maybe Double
dkimPercentage) (\s :: PlacementStatistics
s@PlacementStatistics' {} Maybe Double
a -> PlacementStatistics
s {$sel:dkimPercentage:PlacementStatistics' :: Maybe Double
dkimPercentage = Maybe Double
a} :: PlacementStatistics)

-- | The percentage of emails that arrived in recipients\' inboxes during the
-- predictive inbox placement test.
placementStatistics_inboxPercentage :: Lens.Lens' PlacementStatistics (Prelude.Maybe Prelude.Double)
placementStatistics_inboxPercentage :: Lens' PlacementStatistics (Maybe Double)
placementStatistics_inboxPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementStatistics' {Maybe Double
inboxPercentage :: Maybe Double
$sel:inboxPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
inboxPercentage} -> Maybe Double
inboxPercentage) (\s :: PlacementStatistics
s@PlacementStatistics' {} Maybe Double
a -> PlacementStatistics
s {$sel:inboxPercentage:PlacementStatistics' :: Maybe Double
inboxPercentage = Maybe Double
a} :: PlacementStatistics)

-- | The percentage of emails that didn\'t arrive in recipients\' inboxes at
-- all during the predictive inbox placement test.
placementStatistics_missingPercentage :: Lens.Lens' PlacementStatistics (Prelude.Maybe Prelude.Double)
placementStatistics_missingPercentage :: Lens' PlacementStatistics (Maybe Double)
placementStatistics_missingPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementStatistics' {Maybe Double
missingPercentage :: Maybe Double
$sel:missingPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
missingPercentage} -> Maybe Double
missingPercentage) (\s :: PlacementStatistics
s@PlacementStatistics' {} Maybe Double
a -> PlacementStatistics
s {$sel:missingPercentage:PlacementStatistics' :: Maybe Double
missingPercentage = Maybe Double
a} :: PlacementStatistics)

-- | The percentage of emails that arrived in recipients\' spam or junk mail
-- folders during the predictive inbox placement test.
placementStatistics_spamPercentage :: Lens.Lens' PlacementStatistics (Prelude.Maybe Prelude.Double)
placementStatistics_spamPercentage :: Lens' PlacementStatistics (Maybe Double)
placementStatistics_spamPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementStatistics' {Maybe Double
spamPercentage :: Maybe Double
$sel:spamPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
spamPercentage} -> Maybe Double
spamPercentage) (\s :: PlacementStatistics
s@PlacementStatistics' {} Maybe Double
a -> PlacementStatistics
s {$sel:spamPercentage:PlacementStatistics' :: Maybe Double
spamPercentage = Maybe Double
a} :: PlacementStatistics)

-- | The percentage of emails that were authenticated by using Sender Policy
-- Framework (SPF) during the predictive inbox placement test.
placementStatistics_spfPercentage :: Lens.Lens' PlacementStatistics (Prelude.Maybe Prelude.Double)
placementStatistics_spfPercentage :: Lens' PlacementStatistics (Maybe Double)
placementStatistics_spfPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementStatistics' {Maybe Double
spfPercentage :: Maybe Double
$sel:spfPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
spfPercentage} -> Maybe Double
spfPercentage) (\s :: PlacementStatistics
s@PlacementStatistics' {} Maybe Double
a -> PlacementStatistics
s {$sel:spfPercentage:PlacementStatistics' :: Maybe Double
spfPercentage = Maybe Double
a} :: PlacementStatistics)

instance Data.FromJSON PlacementStatistics where
  parseJSON :: Value -> Parser PlacementStatistics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PlacementStatistics"
      ( \Object
x ->
          Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> PlacementStatistics
PlacementStatistics'
            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
"DkimPercentage")
            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
"InboxPercentage")
            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
"MissingPercentage")
            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
"SpamPercentage")
            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
"SpfPercentage")
      )

instance Prelude.Hashable PlacementStatistics where
  hashWithSalt :: Int -> PlacementStatistics -> Int
hashWithSalt Int
_salt PlacementStatistics' {Maybe Double
spfPercentage :: Maybe Double
spamPercentage :: Maybe Double
missingPercentage :: Maybe Double
inboxPercentage :: Maybe Double
dkimPercentage :: Maybe Double
$sel:spfPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
$sel:spamPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
$sel:missingPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
$sel:inboxPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
$sel:dkimPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
dkimPercentage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
inboxPercentage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
missingPercentage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
spamPercentage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
spfPercentage

instance Prelude.NFData PlacementStatistics where
  rnf :: PlacementStatistics -> ()
rnf PlacementStatistics' {Maybe Double
spfPercentage :: Maybe Double
spamPercentage :: Maybe Double
missingPercentage :: Maybe Double
inboxPercentage :: Maybe Double
dkimPercentage :: Maybe Double
$sel:spfPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
$sel:spamPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
$sel:missingPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
$sel:inboxPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
$sel:dkimPercentage:PlacementStatistics' :: PlacementStatistics -> Maybe Double
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
dkimPercentage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
inboxPercentage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
missingPercentage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
spamPercentage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
spfPercentage