{-# 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.XRay.Types.FaultStatistics where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FaultStatistics = FaultStatistics'
{
FaultStatistics -> Maybe Integer
otherCount :: Prelude.Maybe Prelude.Integer,
FaultStatistics -> Maybe Integer
totalCount :: Prelude.Maybe Prelude.Integer
}
deriving (FaultStatistics -> FaultStatistics -> Bool
(FaultStatistics -> FaultStatistics -> Bool)
-> (FaultStatistics -> FaultStatistics -> Bool)
-> Eq FaultStatistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FaultStatistics -> FaultStatistics -> Bool
$c/= :: FaultStatistics -> FaultStatistics -> Bool
== :: FaultStatistics -> FaultStatistics -> Bool
$c== :: FaultStatistics -> FaultStatistics -> Bool
Prelude.Eq, ReadPrec [FaultStatistics]
ReadPrec FaultStatistics
Int -> ReadS FaultStatistics
ReadS [FaultStatistics]
(Int -> ReadS FaultStatistics)
-> ReadS [FaultStatistics]
-> ReadPrec FaultStatistics
-> ReadPrec [FaultStatistics]
-> Read FaultStatistics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FaultStatistics]
$creadListPrec :: ReadPrec [FaultStatistics]
readPrec :: ReadPrec FaultStatistics
$creadPrec :: ReadPrec FaultStatistics
readList :: ReadS [FaultStatistics]
$creadList :: ReadS [FaultStatistics]
readsPrec :: Int -> ReadS FaultStatistics
$creadsPrec :: Int -> ReadS FaultStatistics
Prelude.Read, Int -> FaultStatistics -> ShowS
[FaultStatistics] -> ShowS
FaultStatistics -> String
(Int -> FaultStatistics -> ShowS)
-> (FaultStatistics -> String)
-> ([FaultStatistics] -> ShowS)
-> Show FaultStatistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FaultStatistics] -> ShowS
$cshowList :: [FaultStatistics] -> ShowS
show :: FaultStatistics -> String
$cshow :: FaultStatistics -> String
showsPrec :: Int -> FaultStatistics -> ShowS
$cshowsPrec :: Int -> FaultStatistics -> ShowS
Prelude.Show, (forall x. FaultStatistics -> Rep FaultStatistics x)
-> (forall x. Rep FaultStatistics x -> FaultStatistics)
-> Generic FaultStatistics
forall x. Rep FaultStatistics x -> FaultStatistics
forall x. FaultStatistics -> Rep FaultStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FaultStatistics x -> FaultStatistics
$cfrom :: forall x. FaultStatistics -> Rep FaultStatistics x
Prelude.Generic)
newFaultStatistics ::
FaultStatistics
newFaultStatistics :: FaultStatistics
newFaultStatistics =
FaultStatistics' :: Maybe Integer -> Maybe Integer -> FaultStatistics
FaultStatistics'
{ $sel:otherCount:FaultStatistics' :: Maybe Integer
otherCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:totalCount:FaultStatistics' :: Maybe Integer
totalCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
faultStatistics_otherCount :: Lens.Lens' FaultStatistics (Prelude.Maybe Prelude.Integer)
faultStatistics_otherCount :: (Maybe Integer -> f (Maybe Integer))
-> FaultStatistics -> f FaultStatistics
faultStatistics_otherCount = (FaultStatistics -> Maybe Integer)
-> (FaultStatistics -> Maybe Integer -> FaultStatistics)
-> Lens
FaultStatistics FaultStatistics (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaultStatistics' {Maybe Integer
otherCount :: Maybe Integer
$sel:otherCount:FaultStatistics' :: FaultStatistics -> Maybe Integer
otherCount} -> Maybe Integer
otherCount) (\s :: FaultStatistics
s@FaultStatistics' {} Maybe Integer
a -> FaultStatistics
s {$sel:otherCount:FaultStatistics' :: Maybe Integer
otherCount = Maybe Integer
a} :: FaultStatistics)
faultStatistics_totalCount :: Lens.Lens' FaultStatistics (Prelude.Maybe Prelude.Integer)
faultStatistics_totalCount :: (Maybe Integer -> f (Maybe Integer))
-> FaultStatistics -> f FaultStatistics
faultStatistics_totalCount = (FaultStatistics -> Maybe Integer)
-> (FaultStatistics -> Maybe Integer -> FaultStatistics)
-> Lens
FaultStatistics FaultStatistics (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaultStatistics' {Maybe Integer
totalCount :: Maybe Integer
$sel:totalCount:FaultStatistics' :: FaultStatistics -> Maybe Integer
totalCount} -> Maybe Integer
totalCount) (\s :: FaultStatistics
s@FaultStatistics' {} Maybe Integer
a -> FaultStatistics
s {$sel:totalCount:FaultStatistics' :: Maybe Integer
totalCount = Maybe Integer
a} :: FaultStatistics)
instance Core.FromJSON FaultStatistics where
parseJSON :: Value -> Parser FaultStatistics
parseJSON =
String
-> (Object -> Parser FaultStatistics)
-> Value
-> Parser FaultStatistics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FaultStatistics"
( \Object
x ->
Maybe Integer -> Maybe Integer -> FaultStatistics
FaultStatistics'
(Maybe Integer -> Maybe Integer -> FaultStatistics)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> FaultStatistics)
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
"OtherCount")
Parser (Maybe Integer -> FaultStatistics)
-> Parser (Maybe Integer) -> Parser FaultStatistics
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
"TotalCount")
)
instance Prelude.Hashable FaultStatistics
instance Prelude.NFData FaultStatistics