{-# 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.PinpointEmail.Types.DomainIspPlacement
-- 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.PinpointEmail.Types.DomainIspPlacement 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 email sent from one of
-- your email domains to a specific email provider.
--
-- /See:/ 'newDomainIspPlacement' smart constructor.
data DomainIspPlacement = DomainIspPlacement'
  { -- | The percentage of messages that were sent from the selected domain to
    -- the specified email provider that arrived in recipients\' inboxes.
    DomainIspPlacement -> Maybe Double
inboxPercentage :: Prelude.Maybe Prelude.Double,
    -- | The total number of messages that were sent from the selected domain to
    -- the specified email provider that arrived in recipients\' inboxes.
    DomainIspPlacement -> Maybe Integer
inboxRawCount :: Prelude.Maybe Prelude.Integer,
    -- | The name of the email provider that the inbox placement data applies to.
    DomainIspPlacement -> Maybe Text
ispName :: Prelude.Maybe Prelude.Text,
    -- | The percentage of messages that were sent from the selected domain to
    -- the specified email provider that arrived in recipients\' spam or junk
    -- mail folders.
    DomainIspPlacement -> Maybe Double
spamPercentage :: Prelude.Maybe Prelude.Double,
    -- | The total number of messages that were sent from the selected domain to
    -- the specified email provider that arrived in recipients\' spam or junk
    -- mail folders.
    DomainIspPlacement -> Maybe Integer
spamRawCount :: Prelude.Maybe Prelude.Integer
  }
  deriving (DomainIspPlacement -> DomainIspPlacement -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainIspPlacement -> DomainIspPlacement -> Bool
$c/= :: DomainIspPlacement -> DomainIspPlacement -> Bool
== :: DomainIspPlacement -> DomainIspPlacement -> Bool
$c== :: DomainIspPlacement -> DomainIspPlacement -> Bool
Prelude.Eq, ReadPrec [DomainIspPlacement]
ReadPrec DomainIspPlacement
Int -> ReadS DomainIspPlacement
ReadS [DomainIspPlacement]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainIspPlacement]
$creadListPrec :: ReadPrec [DomainIspPlacement]
readPrec :: ReadPrec DomainIspPlacement
$creadPrec :: ReadPrec DomainIspPlacement
readList :: ReadS [DomainIspPlacement]
$creadList :: ReadS [DomainIspPlacement]
readsPrec :: Int -> ReadS DomainIspPlacement
$creadsPrec :: Int -> ReadS DomainIspPlacement
Prelude.Read, Int -> DomainIspPlacement -> ShowS
[DomainIspPlacement] -> ShowS
DomainIspPlacement -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainIspPlacement] -> ShowS
$cshowList :: [DomainIspPlacement] -> ShowS
show :: DomainIspPlacement -> String
$cshow :: DomainIspPlacement -> String
showsPrec :: Int -> DomainIspPlacement -> ShowS
$cshowsPrec :: Int -> DomainIspPlacement -> ShowS
Prelude.Show, forall x. Rep DomainIspPlacement x -> DomainIspPlacement
forall x. DomainIspPlacement -> Rep DomainIspPlacement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainIspPlacement x -> DomainIspPlacement
$cfrom :: forall x. DomainIspPlacement -> Rep DomainIspPlacement x
Prelude.Generic)

-- |
-- Create a value of 'DomainIspPlacement' 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:
--
-- 'inboxPercentage', 'domainIspPlacement_inboxPercentage' - The percentage of messages that were sent from the selected domain to
-- the specified email provider that arrived in recipients\' inboxes.
--
-- 'inboxRawCount', 'domainIspPlacement_inboxRawCount' - The total number of messages that were sent from the selected domain to
-- the specified email provider that arrived in recipients\' inboxes.
--
-- 'ispName', 'domainIspPlacement_ispName' - The name of the email provider that the inbox placement data applies to.
--
-- 'spamPercentage', 'domainIspPlacement_spamPercentage' - The percentage of messages that were sent from the selected domain to
-- the specified email provider that arrived in recipients\' spam or junk
-- mail folders.
--
-- 'spamRawCount', 'domainIspPlacement_spamRawCount' - The total number of messages that were sent from the selected domain to
-- the specified email provider that arrived in recipients\' spam or junk
-- mail folders.
newDomainIspPlacement ::
  DomainIspPlacement
newDomainIspPlacement :: DomainIspPlacement
newDomainIspPlacement =
  DomainIspPlacement'
    { $sel:inboxPercentage:DomainIspPlacement' :: Maybe Double
inboxPercentage =
        forall a. Maybe a
Prelude.Nothing,
      $sel:inboxRawCount:DomainIspPlacement' :: Maybe Integer
inboxRawCount = forall a. Maybe a
Prelude.Nothing,
      $sel:ispName:DomainIspPlacement' :: Maybe Text
ispName = forall a. Maybe a
Prelude.Nothing,
      $sel:spamPercentage:DomainIspPlacement' :: Maybe Double
spamPercentage = forall a. Maybe a
Prelude.Nothing,
      $sel:spamRawCount:DomainIspPlacement' :: Maybe Integer
spamRawCount = forall a. Maybe a
Prelude.Nothing
    }

-- | The percentage of messages that were sent from the selected domain to
-- the specified email provider that arrived in recipients\' inboxes.
domainIspPlacement_inboxPercentage :: Lens.Lens' DomainIspPlacement (Prelude.Maybe Prelude.Double)
domainIspPlacement_inboxPercentage :: Lens' DomainIspPlacement (Maybe Double)
domainIspPlacement_inboxPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainIspPlacement' {Maybe Double
inboxPercentage :: Maybe Double
$sel:inboxPercentage:DomainIspPlacement' :: DomainIspPlacement -> Maybe Double
inboxPercentage} -> Maybe Double
inboxPercentage) (\s :: DomainIspPlacement
s@DomainIspPlacement' {} Maybe Double
a -> DomainIspPlacement
s {$sel:inboxPercentage:DomainIspPlacement' :: Maybe Double
inboxPercentage = Maybe Double
a} :: DomainIspPlacement)

-- | The total number of messages that were sent from the selected domain to
-- the specified email provider that arrived in recipients\' inboxes.
domainIspPlacement_inboxRawCount :: Lens.Lens' DomainIspPlacement (Prelude.Maybe Prelude.Integer)
domainIspPlacement_inboxRawCount :: Lens' DomainIspPlacement (Maybe Integer)
domainIspPlacement_inboxRawCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainIspPlacement' {Maybe Integer
inboxRawCount :: Maybe Integer
$sel:inboxRawCount:DomainIspPlacement' :: DomainIspPlacement -> Maybe Integer
inboxRawCount} -> Maybe Integer
inboxRawCount) (\s :: DomainIspPlacement
s@DomainIspPlacement' {} Maybe Integer
a -> DomainIspPlacement
s {$sel:inboxRawCount:DomainIspPlacement' :: Maybe Integer
inboxRawCount = Maybe Integer
a} :: DomainIspPlacement)

-- | The name of the email provider that the inbox placement data applies to.
domainIspPlacement_ispName :: Lens.Lens' DomainIspPlacement (Prelude.Maybe Prelude.Text)
domainIspPlacement_ispName :: Lens' DomainIspPlacement (Maybe Text)
domainIspPlacement_ispName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainIspPlacement' {Maybe Text
ispName :: Maybe Text
$sel:ispName:DomainIspPlacement' :: DomainIspPlacement -> Maybe Text
ispName} -> Maybe Text
ispName) (\s :: DomainIspPlacement
s@DomainIspPlacement' {} Maybe Text
a -> DomainIspPlacement
s {$sel:ispName:DomainIspPlacement' :: Maybe Text
ispName = Maybe Text
a} :: DomainIspPlacement)

-- | The percentage of messages that were sent from the selected domain to
-- the specified email provider that arrived in recipients\' spam or junk
-- mail folders.
domainIspPlacement_spamPercentage :: Lens.Lens' DomainIspPlacement (Prelude.Maybe Prelude.Double)
domainIspPlacement_spamPercentage :: Lens' DomainIspPlacement (Maybe Double)
domainIspPlacement_spamPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainIspPlacement' {Maybe Double
spamPercentage :: Maybe Double
$sel:spamPercentage:DomainIspPlacement' :: DomainIspPlacement -> Maybe Double
spamPercentage} -> Maybe Double
spamPercentage) (\s :: DomainIspPlacement
s@DomainIspPlacement' {} Maybe Double
a -> DomainIspPlacement
s {$sel:spamPercentage:DomainIspPlacement' :: Maybe Double
spamPercentage = Maybe Double
a} :: DomainIspPlacement)

-- | The total number of messages that were sent from the selected domain to
-- the specified email provider that arrived in recipients\' spam or junk
-- mail folders.
domainIspPlacement_spamRawCount :: Lens.Lens' DomainIspPlacement (Prelude.Maybe Prelude.Integer)
domainIspPlacement_spamRawCount :: Lens' DomainIspPlacement (Maybe Integer)
domainIspPlacement_spamRawCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainIspPlacement' {Maybe Integer
spamRawCount :: Maybe Integer
$sel:spamRawCount:DomainIspPlacement' :: DomainIspPlacement -> Maybe Integer
spamRawCount} -> Maybe Integer
spamRawCount) (\s :: DomainIspPlacement
s@DomainIspPlacement' {} Maybe Integer
a -> DomainIspPlacement
s {$sel:spamRawCount:DomainIspPlacement' :: Maybe Integer
spamRawCount = Maybe Integer
a} :: DomainIspPlacement)

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

instance Prelude.Hashable DomainIspPlacement where
  hashWithSalt :: Int -> DomainIspPlacement -> Int
hashWithSalt Int
_salt DomainIspPlacement' {Maybe Double
Maybe Integer
Maybe Text
spamRawCount :: Maybe Integer
spamPercentage :: Maybe Double
ispName :: Maybe Text
inboxRawCount :: Maybe Integer
inboxPercentage :: Maybe Double
$sel:spamRawCount:DomainIspPlacement' :: DomainIspPlacement -> Maybe Integer
$sel:spamPercentage:DomainIspPlacement' :: DomainIspPlacement -> Maybe Double
$sel:ispName:DomainIspPlacement' :: DomainIspPlacement -> Maybe Text
$sel:inboxRawCount:DomainIspPlacement' :: DomainIspPlacement -> Maybe Integer
$sel:inboxPercentage:DomainIspPlacement' :: DomainIspPlacement -> Maybe Double
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
inboxPercentage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
inboxRawCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ispName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
spamPercentage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
spamRawCount

instance Prelude.NFData DomainIspPlacement where
  rnf :: DomainIspPlacement -> ()
rnf DomainIspPlacement' {Maybe Double
Maybe Integer
Maybe Text
spamRawCount :: Maybe Integer
spamPercentage :: Maybe Double
ispName :: Maybe Text
inboxRawCount :: Maybe Integer
inboxPercentage :: Maybe Double
$sel:spamRawCount:DomainIspPlacement' :: DomainIspPlacement -> Maybe Integer
$sel:spamPercentage:DomainIspPlacement' :: DomainIspPlacement -> Maybe Double
$sel:ispName:DomainIspPlacement' :: DomainIspPlacement -> Maybe Text
$sel:inboxRawCount:DomainIspPlacement' :: DomainIspPlacement -> Maybe Integer
$sel:inboxPercentage:DomainIspPlacement' :: DomainIspPlacement -> Maybe Double
..} =
    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 Integer
inboxRawCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ispName
      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 Integer
spamRawCount