{-# 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.EdgeStatistics where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.XRay.Types.ErrorStatistics
import Amazonka.XRay.Types.FaultStatistics
data EdgeStatistics = EdgeStatistics'
{
EdgeStatistics -> Maybe FaultStatistics
faultStatistics :: Prelude.Maybe FaultStatistics,
EdgeStatistics -> Maybe Integer
okCount :: Prelude.Maybe Prelude.Integer,
EdgeStatistics -> Maybe Double
totalResponseTime :: Prelude.Maybe Prelude.Double,
EdgeStatistics -> Maybe ErrorStatistics
errorStatistics :: Prelude.Maybe ErrorStatistics,
EdgeStatistics -> Maybe Integer
totalCount :: Prelude.Maybe Prelude.Integer
}
deriving (EdgeStatistics -> EdgeStatistics -> Bool
(EdgeStatistics -> EdgeStatistics -> Bool)
-> (EdgeStatistics -> EdgeStatistics -> Bool) -> Eq EdgeStatistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EdgeStatistics -> EdgeStatistics -> Bool
$c/= :: EdgeStatistics -> EdgeStatistics -> Bool
== :: EdgeStatistics -> EdgeStatistics -> Bool
$c== :: EdgeStatistics -> EdgeStatistics -> Bool
Prelude.Eq, ReadPrec [EdgeStatistics]
ReadPrec EdgeStatistics
Int -> ReadS EdgeStatistics
ReadS [EdgeStatistics]
(Int -> ReadS EdgeStatistics)
-> ReadS [EdgeStatistics]
-> ReadPrec EdgeStatistics
-> ReadPrec [EdgeStatistics]
-> Read EdgeStatistics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EdgeStatistics]
$creadListPrec :: ReadPrec [EdgeStatistics]
readPrec :: ReadPrec EdgeStatistics
$creadPrec :: ReadPrec EdgeStatistics
readList :: ReadS [EdgeStatistics]
$creadList :: ReadS [EdgeStatistics]
readsPrec :: Int -> ReadS EdgeStatistics
$creadsPrec :: Int -> ReadS EdgeStatistics
Prelude.Read, Int -> EdgeStatistics -> ShowS
[EdgeStatistics] -> ShowS
EdgeStatistics -> String
(Int -> EdgeStatistics -> ShowS)
-> (EdgeStatistics -> String)
-> ([EdgeStatistics] -> ShowS)
-> Show EdgeStatistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EdgeStatistics] -> ShowS
$cshowList :: [EdgeStatistics] -> ShowS
show :: EdgeStatistics -> String
$cshow :: EdgeStatistics -> String
showsPrec :: Int -> EdgeStatistics -> ShowS
$cshowsPrec :: Int -> EdgeStatistics -> ShowS
Prelude.Show, (forall x. EdgeStatistics -> Rep EdgeStatistics x)
-> (forall x. Rep EdgeStatistics x -> EdgeStatistics)
-> Generic EdgeStatistics
forall x. Rep EdgeStatistics x -> EdgeStatistics
forall x. EdgeStatistics -> Rep EdgeStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EdgeStatistics x -> EdgeStatistics
$cfrom :: forall x. EdgeStatistics -> Rep EdgeStatistics x
Prelude.Generic)
newEdgeStatistics ::
EdgeStatistics
newEdgeStatistics :: EdgeStatistics
newEdgeStatistics =
EdgeStatistics' :: Maybe FaultStatistics
-> Maybe Integer
-> Maybe Double
-> Maybe ErrorStatistics
-> Maybe Integer
-> EdgeStatistics
EdgeStatistics'
{ $sel:faultStatistics:EdgeStatistics' :: Maybe FaultStatistics
faultStatistics = Maybe FaultStatistics
forall a. Maybe a
Prelude.Nothing,
$sel:okCount:EdgeStatistics' :: Maybe Integer
okCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:totalResponseTime:EdgeStatistics' :: Maybe Double
totalResponseTime = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:errorStatistics:EdgeStatistics' :: Maybe ErrorStatistics
errorStatistics = Maybe ErrorStatistics
forall a. Maybe a
Prelude.Nothing,
$sel:totalCount:EdgeStatistics' :: Maybe Integer
totalCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
edgeStatistics_faultStatistics :: Lens.Lens' EdgeStatistics (Prelude.Maybe FaultStatistics)
edgeStatistics_faultStatistics :: (Maybe FaultStatistics -> f (Maybe FaultStatistics))
-> EdgeStatistics -> f EdgeStatistics
edgeStatistics_faultStatistics = (EdgeStatistics -> Maybe FaultStatistics)
-> (EdgeStatistics -> Maybe FaultStatistics -> EdgeStatistics)
-> Lens
EdgeStatistics
EdgeStatistics
(Maybe FaultStatistics)
(Maybe FaultStatistics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeStatistics' {Maybe FaultStatistics
faultStatistics :: Maybe FaultStatistics
$sel:faultStatistics:EdgeStatistics' :: EdgeStatistics -> Maybe FaultStatistics
faultStatistics} -> Maybe FaultStatistics
faultStatistics) (\s :: EdgeStatistics
s@EdgeStatistics' {} Maybe FaultStatistics
a -> EdgeStatistics
s {$sel:faultStatistics:EdgeStatistics' :: Maybe FaultStatistics
faultStatistics = Maybe FaultStatistics
a} :: EdgeStatistics)
edgeStatistics_okCount :: Lens.Lens' EdgeStatistics (Prelude.Maybe Prelude.Integer)
edgeStatistics_okCount :: (Maybe Integer -> f (Maybe Integer))
-> EdgeStatistics -> f EdgeStatistics
edgeStatistics_okCount = (EdgeStatistics -> Maybe Integer)
-> (EdgeStatistics -> Maybe Integer -> EdgeStatistics)
-> Lens
EdgeStatistics EdgeStatistics (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeStatistics' {Maybe Integer
okCount :: Maybe Integer
$sel:okCount:EdgeStatistics' :: EdgeStatistics -> Maybe Integer
okCount} -> Maybe Integer
okCount) (\s :: EdgeStatistics
s@EdgeStatistics' {} Maybe Integer
a -> EdgeStatistics
s {$sel:okCount:EdgeStatistics' :: Maybe Integer
okCount = Maybe Integer
a} :: EdgeStatistics)
edgeStatistics_totalResponseTime :: Lens.Lens' EdgeStatistics (Prelude.Maybe Prelude.Double)
edgeStatistics_totalResponseTime :: (Maybe Double -> f (Maybe Double))
-> EdgeStatistics -> f EdgeStatistics
edgeStatistics_totalResponseTime = (EdgeStatistics -> Maybe Double)
-> (EdgeStatistics -> Maybe Double -> EdgeStatistics)
-> Lens EdgeStatistics EdgeStatistics (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeStatistics' {Maybe Double
totalResponseTime :: Maybe Double
$sel:totalResponseTime:EdgeStatistics' :: EdgeStatistics -> Maybe Double
totalResponseTime} -> Maybe Double
totalResponseTime) (\s :: EdgeStatistics
s@EdgeStatistics' {} Maybe Double
a -> EdgeStatistics
s {$sel:totalResponseTime:EdgeStatistics' :: Maybe Double
totalResponseTime = Maybe Double
a} :: EdgeStatistics)
edgeStatistics_errorStatistics :: Lens.Lens' EdgeStatistics (Prelude.Maybe ErrorStatistics)
edgeStatistics_errorStatistics :: (Maybe ErrorStatistics -> f (Maybe ErrorStatistics))
-> EdgeStatistics -> f EdgeStatistics
edgeStatistics_errorStatistics = (EdgeStatistics -> Maybe ErrorStatistics)
-> (EdgeStatistics -> Maybe ErrorStatistics -> EdgeStatistics)
-> Lens
EdgeStatistics
EdgeStatistics
(Maybe ErrorStatistics)
(Maybe ErrorStatistics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeStatistics' {Maybe ErrorStatistics
errorStatistics :: Maybe ErrorStatistics
$sel:errorStatistics:EdgeStatistics' :: EdgeStatistics -> Maybe ErrorStatistics
errorStatistics} -> Maybe ErrorStatistics
errorStatistics) (\s :: EdgeStatistics
s@EdgeStatistics' {} Maybe ErrorStatistics
a -> EdgeStatistics
s {$sel:errorStatistics:EdgeStatistics' :: Maybe ErrorStatistics
errorStatistics = Maybe ErrorStatistics
a} :: EdgeStatistics)
edgeStatistics_totalCount :: Lens.Lens' EdgeStatistics (Prelude.Maybe Prelude.Integer)
edgeStatistics_totalCount :: (Maybe Integer -> f (Maybe Integer))
-> EdgeStatistics -> f EdgeStatistics
edgeStatistics_totalCount = (EdgeStatistics -> Maybe Integer)
-> (EdgeStatistics -> Maybe Integer -> EdgeStatistics)
-> Lens
EdgeStatistics EdgeStatistics (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeStatistics' {Maybe Integer
totalCount :: Maybe Integer
$sel:totalCount:EdgeStatistics' :: EdgeStatistics -> Maybe Integer
totalCount} -> Maybe Integer
totalCount) (\s :: EdgeStatistics
s@EdgeStatistics' {} Maybe Integer
a -> EdgeStatistics
s {$sel:totalCount:EdgeStatistics' :: Maybe Integer
totalCount = Maybe Integer
a} :: EdgeStatistics)
instance Core.FromJSON EdgeStatistics where
parseJSON :: Value -> Parser EdgeStatistics
parseJSON =
String
-> (Object -> Parser EdgeStatistics)
-> Value
-> Parser EdgeStatistics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EdgeStatistics"
( \Object
x ->
Maybe FaultStatistics
-> Maybe Integer
-> Maybe Double
-> Maybe ErrorStatistics
-> Maybe Integer
-> EdgeStatistics
EdgeStatistics'
(Maybe FaultStatistics
-> Maybe Integer
-> Maybe Double
-> Maybe ErrorStatistics
-> Maybe Integer
-> EdgeStatistics)
-> Parser (Maybe FaultStatistics)
-> Parser
(Maybe Integer
-> Maybe Double
-> Maybe ErrorStatistics
-> Maybe Integer
-> EdgeStatistics)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe FaultStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FaultStatistics")
Parser
(Maybe Integer
-> Maybe Double
-> Maybe ErrorStatistics
-> Maybe Integer
-> EdgeStatistics)
-> Parser (Maybe Integer)
-> Parser
(Maybe Double
-> Maybe ErrorStatistics -> Maybe Integer -> EdgeStatistics)
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
"OkCount")
Parser
(Maybe Double
-> Maybe ErrorStatistics -> Maybe Integer -> EdgeStatistics)
-> Parser (Maybe Double)
-> Parser
(Maybe ErrorStatistics -> Maybe Integer -> EdgeStatistics)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TotalResponseTime")
Parser (Maybe ErrorStatistics -> Maybe Integer -> EdgeStatistics)
-> Parser (Maybe ErrorStatistics)
-> Parser (Maybe Integer -> EdgeStatistics)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ErrorStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorStatistics")
Parser (Maybe Integer -> EdgeStatistics)
-> Parser (Maybe Integer) -> Parser EdgeStatistics
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 EdgeStatistics
instance Prelude.NFData EdgeStatistics