{-# 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 #-}
module Amazonka.CustomerProfiles.Types.DomainStats where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DomainStats = DomainStats'
{
DomainStats -> Maybe Integer
meteringProfileCount :: Prelude.Maybe Prelude.Integer,
DomainStats -> Maybe Integer
totalSize :: Prelude.Maybe Prelude.Integer,
DomainStats -> Maybe Integer
profileCount :: Prelude.Maybe Prelude.Integer,
DomainStats -> Maybe Integer
objectCount :: Prelude.Maybe Prelude.Integer
}
deriving (DomainStats -> DomainStats -> Bool
(DomainStats -> DomainStats -> Bool)
-> (DomainStats -> DomainStats -> Bool) -> Eq DomainStats
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]
(Int -> ReadS DomainStats)
-> ReadS [DomainStats]
-> ReadPrec DomainStats
-> ReadPrec [DomainStats]
-> Read 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
(Int -> DomainStats -> ShowS)
-> (DomainStats -> String)
-> ([DomainStats] -> ShowS)
-> Show DomainStats
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. DomainStats -> Rep DomainStats x)
-> (forall x. Rep DomainStats x -> DomainStats)
-> Generic DomainStats
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)
newDomainStats ::
DomainStats
newDomainStats :: DomainStats
newDomainStats =
DomainStats' :: Maybe Integer
-> Maybe Integer -> Maybe Integer -> Maybe Integer -> DomainStats
DomainStats'
{ $sel:meteringProfileCount:DomainStats' :: Maybe Integer
meteringProfileCount =
Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:totalSize:DomainStats' :: Maybe Integer
totalSize = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:profileCount:DomainStats' :: Maybe Integer
profileCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:objectCount:DomainStats' :: Maybe Integer
objectCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
domainStats_meteringProfileCount :: Lens.Lens' DomainStats (Prelude.Maybe Prelude.Integer)
domainStats_meteringProfileCount :: (Maybe Integer -> f (Maybe Integer))
-> DomainStats -> f DomainStats
domainStats_meteringProfileCount = (DomainStats -> Maybe Integer)
-> (DomainStats -> Maybe Integer -> DomainStats)
-> Lens DomainStats DomainStats (Maybe Integer) (Maybe Integer)
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)
domainStats_totalSize :: Lens.Lens' DomainStats (Prelude.Maybe Prelude.Integer)
domainStats_totalSize :: (Maybe Integer -> f (Maybe Integer))
-> DomainStats -> f DomainStats
domainStats_totalSize = (DomainStats -> Maybe Integer)
-> (DomainStats -> Maybe Integer -> DomainStats)
-> Lens DomainStats DomainStats (Maybe Integer) (Maybe Integer)
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)
domainStats_profileCount :: Lens.Lens' DomainStats (Prelude.Maybe Prelude.Integer)
domainStats_profileCount :: (Maybe Integer -> f (Maybe Integer))
-> DomainStats -> f DomainStats
domainStats_profileCount = (DomainStats -> Maybe Integer)
-> (DomainStats -> Maybe Integer -> DomainStats)
-> Lens DomainStats DomainStats (Maybe Integer) (Maybe Integer)
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)
domainStats_objectCount :: Lens.Lens' DomainStats (Prelude.Maybe Prelude.Integer)
domainStats_objectCount :: (Maybe Integer -> f (Maybe Integer))
-> DomainStats -> f DomainStats
domainStats_objectCount = (DomainStats -> Maybe Integer)
-> (DomainStats -> Maybe Integer -> DomainStats)
-> Lens DomainStats DomainStats (Maybe Integer) (Maybe Integer)
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)
instance Core.FromJSON DomainStats where
parseJSON :: Value -> Parser DomainStats
parseJSON =
String
-> (Object -> Parser DomainStats) -> Value -> Parser DomainStats
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DomainStats"
( \Object
x ->
Maybe Integer
-> Maybe Integer -> Maybe Integer -> Maybe Integer -> DomainStats
DomainStats'
(Maybe Integer
-> Maybe Integer -> Maybe Integer -> Maybe Integer -> DomainStats)
-> Parser (Maybe Integer)
-> Parser
(Maybe Integer -> Maybe Integer -> Maybe Integer -> DomainStats)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MeteringProfileCount")
Parser
(Maybe Integer -> Maybe Integer -> Maybe Integer -> DomainStats)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> Maybe Integer -> DomainStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TotalSize")
Parser (Maybe Integer -> Maybe Integer -> DomainStats)
-> Parser (Maybe Integer) -> Parser (Maybe Integer -> DomainStats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProfileCount")
Parser (Maybe Integer -> DomainStats)
-> Parser (Maybe Integer) -> Parser DomainStats
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ObjectCount")
)
instance Prelude.Hashable DomainStats
instance Prelude.NFData DomainStats