{-# 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.VolumeStatistics
-- 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.VolumeStatistics 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 information about the amount of email that was
-- delivered to recipients.
--
-- /See:/ 'newVolumeStatistics' smart constructor.
data VolumeStatistics = VolumeStatistics'
  { -- | The total number of emails that arrived in recipients\' inboxes.
    VolumeStatistics -> Maybe Integer
inboxRawCount :: Prelude.Maybe Prelude.Integer,
    -- | An estimate of the percentage of emails sent from the current domain
    -- that will arrive in recipients\' inboxes.
    VolumeStatistics -> Maybe Integer
projectedInbox :: Prelude.Maybe Prelude.Integer,
    -- | An estimate of the percentage of emails sent from the current domain
    -- that will arrive in recipients\' spam or junk mail folders.
    VolumeStatistics -> Maybe Integer
projectedSpam :: Prelude.Maybe Prelude.Integer,
    -- | The total number of emails that arrived in recipients\' spam or junk
    -- mail folders.
    VolumeStatistics -> Maybe Integer
spamRawCount :: Prelude.Maybe Prelude.Integer
  }
  deriving (VolumeStatistics -> VolumeStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VolumeStatistics -> VolumeStatistics -> Bool
$c/= :: VolumeStatistics -> VolumeStatistics -> Bool
== :: VolumeStatistics -> VolumeStatistics -> Bool
$c== :: VolumeStatistics -> VolumeStatistics -> Bool
Prelude.Eq, ReadPrec [VolumeStatistics]
ReadPrec VolumeStatistics
Int -> ReadS VolumeStatistics
ReadS [VolumeStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VolumeStatistics]
$creadListPrec :: ReadPrec [VolumeStatistics]
readPrec :: ReadPrec VolumeStatistics
$creadPrec :: ReadPrec VolumeStatistics
readList :: ReadS [VolumeStatistics]
$creadList :: ReadS [VolumeStatistics]
readsPrec :: Int -> ReadS VolumeStatistics
$creadsPrec :: Int -> ReadS VolumeStatistics
Prelude.Read, Int -> VolumeStatistics -> ShowS
[VolumeStatistics] -> ShowS
VolumeStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VolumeStatistics] -> ShowS
$cshowList :: [VolumeStatistics] -> ShowS
show :: VolumeStatistics -> String
$cshow :: VolumeStatistics -> String
showsPrec :: Int -> VolumeStatistics -> ShowS
$cshowsPrec :: Int -> VolumeStatistics -> ShowS
Prelude.Show, forall x. Rep VolumeStatistics x -> VolumeStatistics
forall x. VolumeStatistics -> Rep VolumeStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VolumeStatistics x -> VolumeStatistics
$cfrom :: forall x. VolumeStatistics -> Rep VolumeStatistics x
Prelude.Generic)

-- |
-- Create a value of 'VolumeStatistics' 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:
--
-- 'inboxRawCount', 'volumeStatistics_inboxRawCount' - The total number of emails that arrived in recipients\' inboxes.
--
-- 'projectedInbox', 'volumeStatistics_projectedInbox' - An estimate of the percentage of emails sent from the current domain
-- that will arrive in recipients\' inboxes.
--
-- 'projectedSpam', 'volumeStatistics_projectedSpam' - An estimate of the percentage of emails sent from the current domain
-- that will arrive in recipients\' spam or junk mail folders.
--
-- 'spamRawCount', 'volumeStatistics_spamRawCount' - The total number of emails that arrived in recipients\' spam or junk
-- mail folders.
newVolumeStatistics ::
  VolumeStatistics
newVolumeStatistics :: VolumeStatistics
newVolumeStatistics =
  VolumeStatistics'
    { $sel:inboxRawCount:VolumeStatistics' :: Maybe Integer
inboxRawCount = forall a. Maybe a
Prelude.Nothing,
      $sel:projectedInbox:VolumeStatistics' :: Maybe Integer
projectedInbox = forall a. Maybe a
Prelude.Nothing,
      $sel:projectedSpam:VolumeStatistics' :: Maybe Integer
projectedSpam = forall a. Maybe a
Prelude.Nothing,
      $sel:spamRawCount:VolumeStatistics' :: Maybe Integer
spamRawCount = forall a. Maybe a
Prelude.Nothing
    }

-- | The total number of emails that arrived in recipients\' inboxes.
volumeStatistics_inboxRawCount :: Lens.Lens' VolumeStatistics (Prelude.Maybe Prelude.Integer)
volumeStatistics_inboxRawCount :: Lens' VolumeStatistics (Maybe Integer)
volumeStatistics_inboxRawCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeStatistics' {Maybe Integer
inboxRawCount :: Maybe Integer
$sel:inboxRawCount:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
inboxRawCount} -> Maybe Integer
inboxRawCount) (\s :: VolumeStatistics
s@VolumeStatistics' {} Maybe Integer
a -> VolumeStatistics
s {$sel:inboxRawCount:VolumeStatistics' :: Maybe Integer
inboxRawCount = Maybe Integer
a} :: VolumeStatistics)

-- | An estimate of the percentage of emails sent from the current domain
-- that will arrive in recipients\' inboxes.
volumeStatistics_projectedInbox :: Lens.Lens' VolumeStatistics (Prelude.Maybe Prelude.Integer)
volumeStatistics_projectedInbox :: Lens' VolumeStatistics (Maybe Integer)
volumeStatistics_projectedInbox = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeStatistics' {Maybe Integer
projectedInbox :: Maybe Integer
$sel:projectedInbox:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
projectedInbox} -> Maybe Integer
projectedInbox) (\s :: VolumeStatistics
s@VolumeStatistics' {} Maybe Integer
a -> VolumeStatistics
s {$sel:projectedInbox:VolumeStatistics' :: Maybe Integer
projectedInbox = Maybe Integer
a} :: VolumeStatistics)

-- | An estimate of the percentage of emails sent from the current domain
-- that will arrive in recipients\' spam or junk mail folders.
volumeStatistics_projectedSpam :: Lens.Lens' VolumeStatistics (Prelude.Maybe Prelude.Integer)
volumeStatistics_projectedSpam :: Lens' VolumeStatistics (Maybe Integer)
volumeStatistics_projectedSpam = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeStatistics' {Maybe Integer
projectedSpam :: Maybe Integer
$sel:projectedSpam:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
projectedSpam} -> Maybe Integer
projectedSpam) (\s :: VolumeStatistics
s@VolumeStatistics' {} Maybe Integer
a -> VolumeStatistics
s {$sel:projectedSpam:VolumeStatistics' :: Maybe Integer
projectedSpam = Maybe Integer
a} :: VolumeStatistics)

-- | The total number of emails that arrived in recipients\' spam or junk
-- mail folders.
volumeStatistics_spamRawCount :: Lens.Lens' VolumeStatistics (Prelude.Maybe Prelude.Integer)
volumeStatistics_spamRawCount :: Lens' VolumeStatistics (Maybe Integer)
volumeStatistics_spamRawCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeStatistics' {Maybe Integer
spamRawCount :: Maybe Integer
$sel:spamRawCount:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
spamRawCount} -> Maybe Integer
spamRawCount) (\s :: VolumeStatistics
s@VolumeStatistics' {} Maybe Integer
a -> VolumeStatistics
s {$sel:spamRawCount:VolumeStatistics' :: Maybe Integer
spamRawCount = Maybe Integer
a} :: VolumeStatistics)

instance Data.FromJSON VolumeStatistics where
  parseJSON :: Value -> Parser VolumeStatistics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VolumeStatistics"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> VolumeStatistics
VolumeStatistics'
            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
"InboxRawCount")
            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
"ProjectedInbox")
            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
"ProjectedSpam")
            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
"SpamRawCount")
      )

instance Prelude.Hashable VolumeStatistics where
  hashWithSalt :: Int -> VolumeStatistics -> Int
hashWithSalt Int
_salt VolumeStatistics' {Maybe Integer
spamRawCount :: Maybe Integer
projectedSpam :: Maybe Integer
projectedInbox :: Maybe Integer
inboxRawCount :: Maybe Integer
$sel:spamRawCount:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
$sel:projectedSpam:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
$sel:projectedInbox:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
$sel:inboxRawCount:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
inboxRawCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
projectedInbox
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
projectedSpam
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
spamRawCount

instance Prelude.NFData VolumeStatistics where
  rnf :: VolumeStatistics -> ()
rnf VolumeStatistics' {Maybe Integer
spamRawCount :: Maybe Integer
projectedSpam :: Maybe Integer
projectedInbox :: Maybe Integer
inboxRawCount :: Maybe Integer
$sel:spamRawCount:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
$sel:projectedSpam:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
$sel:projectedInbox:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
$sel:inboxRawCount:VolumeStatistics' :: VolumeStatistics -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
inboxRawCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
projectedInbox
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
projectedSpam
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
spamRawCount