{-# 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.CustomerProfiles.Types.DomainStats
-- 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.CustomerProfiles.Types.DomainStats 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

-- | Usage-specific statistics about the domain.
--
-- /See:/ 'newDomainStats' smart constructor.
data DomainStats = DomainStats'
  { -- | The number of profiles that you are currently paying for in the domain.
    -- If you have more than 100 objects associated with a single profile, that
    -- profile counts as two profiles. If you have more than 200 objects, that
    -- profile counts as three, and so on.
    DomainStats -> Maybe Integer
meteringProfileCount :: Prelude.Maybe Prelude.Integer,
    -- | The total number of objects in domain.
    DomainStats -> Maybe Integer
objectCount :: Prelude.Maybe Prelude.Integer,
    -- | The total number of profiles currently in the domain.
    DomainStats -> Maybe Integer
profileCount :: Prelude.Maybe Prelude.Integer,
    -- | The total size, in bytes, of all objects in the domain.
    DomainStats -> Maybe Integer
totalSize :: Prelude.Maybe Prelude.Integer
  }
  deriving (DomainStats -> DomainStats -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainStats -> DomainStats -> Bool
$c/= :: DomainStats -> DomainStats -> Bool
== :: DomainStats -> DomainStats -> Bool
$c== :: DomainStats -> DomainStats -> Bool
Prelude.Eq, ReadPrec [DomainStats]
ReadPrec DomainStats
Int -> ReadS DomainStats
ReadS [DomainStats]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainStats]
$creadListPrec :: ReadPrec [DomainStats]
readPrec :: ReadPrec DomainStats
$creadPrec :: ReadPrec DomainStats
readList :: ReadS [DomainStats]
$creadList :: ReadS [DomainStats]
readsPrec :: Int -> ReadS DomainStats
$creadsPrec :: Int -> ReadS DomainStats
Prelude.Read, Int -> DomainStats -> ShowS
[DomainStats] -> ShowS
DomainStats -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainStats] -> ShowS
$cshowList :: [DomainStats] -> ShowS
show :: DomainStats -> String
$cshow :: DomainStats -> String
showsPrec :: Int -> DomainStats -> ShowS
$cshowsPrec :: Int -> DomainStats -> ShowS
Prelude.Show, forall x. Rep DomainStats x -> DomainStats
forall x. DomainStats -> Rep DomainStats x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainStats x -> DomainStats
$cfrom :: forall x. DomainStats -> Rep DomainStats x
Prelude.Generic)

-- |
-- Create a value of 'DomainStats' 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:
--
-- 'meteringProfileCount', 'domainStats_meteringProfileCount' - The number of profiles that you are currently paying for in the domain.
-- If you have more than 100 objects associated with a single profile, that
-- profile counts as two profiles. If you have more than 200 objects, that
-- profile counts as three, and so on.
--
-- 'objectCount', 'domainStats_objectCount' - The total number of objects in domain.
--
-- 'profileCount', 'domainStats_profileCount' - The total number of profiles currently in the domain.
--
-- 'totalSize', 'domainStats_totalSize' - The total size, in bytes, of all objects in the domain.
newDomainStats ::
  DomainStats
newDomainStats :: DomainStats
newDomainStats =
  DomainStats'
    { $sel:meteringProfileCount:DomainStats' :: Maybe Integer
meteringProfileCount =
        forall a. Maybe a
Prelude.Nothing,
      $sel:objectCount:DomainStats' :: Maybe Integer
objectCount = forall a. Maybe a
Prelude.Nothing,
      $sel:profileCount:DomainStats' :: Maybe Integer
profileCount = forall a. Maybe a
Prelude.Nothing,
      $sel:totalSize:DomainStats' :: Maybe Integer
totalSize = forall a. Maybe a
Prelude.Nothing
    }

-- | The number of profiles that you are currently paying for in the domain.
-- If you have more than 100 objects associated with a single profile, that
-- profile counts as two profiles. If you have more than 200 objects, that
-- profile counts as three, and so on.
domainStats_meteringProfileCount :: Lens.Lens' DomainStats (Prelude.Maybe Prelude.Integer)
domainStats_meteringProfileCount :: Lens' DomainStats (Maybe Integer)
domainStats_meteringProfileCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainStats' {Maybe Integer
meteringProfileCount :: Maybe Integer
$sel:meteringProfileCount:DomainStats' :: DomainStats -> Maybe Integer
meteringProfileCount} -> Maybe Integer
meteringProfileCount) (\s :: DomainStats
s@DomainStats' {} Maybe Integer
a -> DomainStats
s {$sel:meteringProfileCount:DomainStats' :: Maybe Integer
meteringProfileCount = Maybe Integer
a} :: DomainStats)

-- | The total number of objects in domain.
domainStats_objectCount :: Lens.Lens' DomainStats (Prelude.Maybe Prelude.Integer)
domainStats_objectCount :: Lens' DomainStats (Maybe Integer)
domainStats_objectCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainStats' {Maybe Integer
objectCount :: Maybe Integer
$sel:objectCount:DomainStats' :: DomainStats -> Maybe Integer
objectCount} -> Maybe Integer
objectCount) (\s :: DomainStats
s@DomainStats' {} Maybe Integer
a -> DomainStats
s {$sel:objectCount:DomainStats' :: Maybe Integer
objectCount = Maybe Integer
a} :: DomainStats)

-- | The total number of profiles currently in the domain.
domainStats_profileCount :: Lens.Lens' DomainStats (Prelude.Maybe Prelude.Integer)
domainStats_profileCount :: Lens' DomainStats (Maybe Integer)
domainStats_profileCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainStats' {Maybe Integer
profileCount :: Maybe Integer
$sel:profileCount:DomainStats' :: DomainStats -> Maybe Integer
profileCount} -> Maybe Integer
profileCount) (\s :: DomainStats
s@DomainStats' {} Maybe Integer
a -> DomainStats
s {$sel:profileCount:DomainStats' :: Maybe Integer
profileCount = Maybe Integer
a} :: DomainStats)

-- | The total size, in bytes, of all objects in the domain.
domainStats_totalSize :: Lens.Lens' DomainStats (Prelude.Maybe Prelude.Integer)
domainStats_totalSize :: Lens' DomainStats (Maybe Integer)
domainStats_totalSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainStats' {Maybe Integer
totalSize :: Maybe Integer
$sel:totalSize:DomainStats' :: DomainStats -> Maybe Integer
totalSize} -> Maybe Integer
totalSize) (\s :: DomainStats
s@DomainStats' {} Maybe Integer
a -> DomainStats
s {$sel:totalSize:DomainStats' :: Maybe Integer
totalSize = Maybe Integer
a} :: DomainStats)

instance Data.FromJSON DomainStats where
  parseJSON :: Value -> Parser DomainStats
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DomainStats"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer -> Maybe Integer -> Maybe Integer -> DomainStats
DomainStats'
            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
"MeteringProfileCount")
            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
"ObjectCount")
            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
"ProfileCount")
            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
"TotalSize")
      )

instance Prelude.Hashable DomainStats where
  hashWithSalt :: Int -> DomainStats -> Int
hashWithSalt Int
_salt DomainStats' {Maybe Integer
totalSize :: Maybe Integer
profileCount :: Maybe Integer
objectCount :: Maybe Integer
meteringProfileCount :: Maybe Integer
$sel:totalSize:DomainStats' :: DomainStats -> Maybe Integer
$sel:profileCount:DomainStats' :: DomainStats -> Maybe Integer
$sel:objectCount:DomainStats' :: DomainStats -> Maybe Integer
$sel:meteringProfileCount:DomainStats' :: DomainStats -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
meteringProfileCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
objectCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
profileCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
totalSize

instance Prelude.NFData DomainStats where
  rnf :: DomainStats -> ()
rnf DomainStats' {Maybe Integer
totalSize :: Maybe Integer
profileCount :: Maybe Integer
objectCount :: Maybe Integer
meteringProfileCount :: Maybe Integer
$sel:totalSize:DomainStats' :: DomainStats -> Maybe Integer
$sel:profileCount:DomainStats' :: DomainStats -> Maybe Integer
$sel:objectCount:DomainStats' :: DomainStats -> Maybe Integer
$sel:meteringProfileCount:DomainStats' :: DomainStats -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
meteringProfileCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
objectCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
profileCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
totalSize