{-# 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.ErrorStatistics 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
data ErrorStatistics = ErrorStatistics'
{
ErrorStatistics -> Maybe Integer
otherCount :: Prelude.Maybe Prelude.Integer,
ErrorStatistics -> Maybe Integer
throttleCount :: Prelude.Maybe Prelude.Integer,
ErrorStatistics -> Maybe Integer
totalCount :: Prelude.Maybe Prelude.Integer
}
deriving (ErrorStatistics -> ErrorStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ErrorStatistics -> ErrorStatistics -> Bool
$c/= :: ErrorStatistics -> ErrorStatistics -> Bool
== :: ErrorStatistics -> ErrorStatistics -> Bool
$c== :: ErrorStatistics -> ErrorStatistics -> Bool
Prelude.Eq, ReadPrec [ErrorStatistics]
ReadPrec ErrorStatistics
Int -> ReadS ErrorStatistics
ReadS [ErrorStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ErrorStatistics]
$creadListPrec :: ReadPrec [ErrorStatistics]
readPrec :: ReadPrec ErrorStatistics
$creadPrec :: ReadPrec ErrorStatistics
readList :: ReadS [ErrorStatistics]
$creadList :: ReadS [ErrorStatistics]
readsPrec :: Int -> ReadS ErrorStatistics
$creadsPrec :: Int -> ReadS ErrorStatistics
Prelude.Read, Int -> ErrorStatistics -> ShowS
[ErrorStatistics] -> ShowS
ErrorStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ErrorStatistics] -> ShowS
$cshowList :: [ErrorStatistics] -> ShowS
show :: ErrorStatistics -> String
$cshow :: ErrorStatistics -> String
showsPrec :: Int -> ErrorStatistics -> ShowS
$cshowsPrec :: Int -> ErrorStatistics -> ShowS
Prelude.Show, forall x. Rep ErrorStatistics x -> ErrorStatistics
forall x. ErrorStatistics -> Rep ErrorStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ErrorStatistics x -> ErrorStatistics
$cfrom :: forall x. ErrorStatistics -> Rep ErrorStatistics x
Prelude.Generic)
newErrorStatistics ::
ErrorStatistics
newErrorStatistics :: ErrorStatistics
newErrorStatistics =
ErrorStatistics'
{ $sel:otherCount:ErrorStatistics' :: Maybe Integer
otherCount = forall a. Maybe a
Prelude.Nothing,
$sel:throttleCount:ErrorStatistics' :: Maybe Integer
throttleCount = forall a. Maybe a
Prelude.Nothing,
$sel:totalCount:ErrorStatistics' :: Maybe Integer
totalCount = forall a. Maybe a
Prelude.Nothing
}
errorStatistics_otherCount :: Lens.Lens' ErrorStatistics (Prelude.Maybe Prelude.Integer)
errorStatistics_otherCount :: Lens' ErrorStatistics (Maybe Integer)
errorStatistics_otherCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorStatistics' {Maybe Integer
otherCount :: Maybe Integer
$sel:otherCount:ErrorStatistics' :: ErrorStatistics -> Maybe Integer
otherCount} -> Maybe Integer
otherCount) (\s :: ErrorStatistics
s@ErrorStatistics' {} Maybe Integer
a -> ErrorStatistics
s {$sel:otherCount:ErrorStatistics' :: Maybe Integer
otherCount = Maybe Integer
a} :: ErrorStatistics)
errorStatistics_throttleCount :: Lens.Lens' ErrorStatistics (Prelude.Maybe Prelude.Integer)
errorStatistics_throttleCount :: Lens' ErrorStatistics (Maybe Integer)
errorStatistics_throttleCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorStatistics' {Maybe Integer
throttleCount :: Maybe Integer
$sel:throttleCount:ErrorStatistics' :: ErrorStatistics -> Maybe Integer
throttleCount} -> Maybe Integer
throttleCount) (\s :: ErrorStatistics
s@ErrorStatistics' {} Maybe Integer
a -> ErrorStatistics
s {$sel:throttleCount:ErrorStatistics' :: Maybe Integer
throttleCount = Maybe Integer
a} :: ErrorStatistics)
errorStatistics_totalCount :: Lens.Lens' ErrorStatistics (Prelude.Maybe Prelude.Integer)
errorStatistics_totalCount :: Lens' ErrorStatistics (Maybe Integer)
errorStatistics_totalCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorStatistics' {Maybe Integer
totalCount :: Maybe Integer
$sel:totalCount:ErrorStatistics' :: ErrorStatistics -> Maybe Integer
totalCount} -> Maybe Integer
totalCount) (\s :: ErrorStatistics
s@ErrorStatistics' {} Maybe Integer
a -> ErrorStatistics
s {$sel:totalCount:ErrorStatistics' :: Maybe Integer
totalCount = Maybe Integer
a} :: ErrorStatistics)
instance Data.FromJSON ErrorStatistics where
parseJSON :: Value -> Parser ErrorStatistics
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ErrorStatistics"
( \Object
x ->
Maybe Integer -> Maybe Integer -> Maybe Integer -> ErrorStatistics
ErrorStatistics'
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
"OtherCount")
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
"ThrottleCount")
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
"TotalCount")
)
instance Prelude.Hashable ErrorStatistics where
hashWithSalt :: Int -> ErrorStatistics -> Int
hashWithSalt Int
_salt ErrorStatistics' {Maybe Integer
totalCount :: Maybe Integer
throttleCount :: Maybe Integer
otherCount :: Maybe Integer
$sel:totalCount:ErrorStatistics' :: ErrorStatistics -> Maybe Integer
$sel:throttleCount:ErrorStatistics' :: ErrorStatistics -> Maybe Integer
$sel:otherCount:ErrorStatistics' :: ErrorStatistics -> Maybe Integer
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
otherCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
throttleCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
totalCount
instance Prelude.NFData ErrorStatistics where
rnf :: ErrorStatistics -> ()
rnf ErrorStatistics' {Maybe Integer
totalCount :: Maybe Integer
throttleCount :: Maybe Integer
otherCount :: Maybe Integer
$sel:totalCount:ErrorStatistics' :: ErrorStatistics -> Maybe Integer
$sel:throttleCount:ErrorStatistics' :: ErrorStatistics -> Maybe Integer
$sel:otherCount:ErrorStatistics' :: ErrorStatistics -> Maybe Integer
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
otherCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
throttleCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
totalCount