{-# 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.ElasticBeanstalk.Types.ApplicationMetrics where
import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types.Latency
import Amazonka.ElasticBeanstalk.Types.StatusCodes
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ApplicationMetrics = ApplicationMetrics'
{
ApplicationMetrics -> Maybe Int
requestCount :: Prelude.Maybe Prelude.Int,
ApplicationMetrics -> Maybe Latency
latency :: Prelude.Maybe Latency,
ApplicationMetrics -> Maybe StatusCodes
statusCodes :: Prelude.Maybe StatusCodes,
ApplicationMetrics -> Maybe Int
duration :: Prelude.Maybe Prelude.Int
}
deriving (ApplicationMetrics -> ApplicationMetrics -> Bool
(ApplicationMetrics -> ApplicationMetrics -> Bool)
-> (ApplicationMetrics -> ApplicationMetrics -> Bool)
-> Eq ApplicationMetrics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationMetrics -> ApplicationMetrics -> Bool
$c/= :: ApplicationMetrics -> ApplicationMetrics -> Bool
== :: ApplicationMetrics -> ApplicationMetrics -> Bool
$c== :: ApplicationMetrics -> ApplicationMetrics -> Bool
Prelude.Eq, ReadPrec [ApplicationMetrics]
ReadPrec ApplicationMetrics
Int -> ReadS ApplicationMetrics
ReadS [ApplicationMetrics]
(Int -> ReadS ApplicationMetrics)
-> ReadS [ApplicationMetrics]
-> ReadPrec ApplicationMetrics
-> ReadPrec [ApplicationMetrics]
-> Read ApplicationMetrics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationMetrics]
$creadListPrec :: ReadPrec [ApplicationMetrics]
readPrec :: ReadPrec ApplicationMetrics
$creadPrec :: ReadPrec ApplicationMetrics
readList :: ReadS [ApplicationMetrics]
$creadList :: ReadS [ApplicationMetrics]
readsPrec :: Int -> ReadS ApplicationMetrics
$creadsPrec :: Int -> ReadS ApplicationMetrics
Prelude.Read, Int -> ApplicationMetrics -> ShowS
[ApplicationMetrics] -> ShowS
ApplicationMetrics -> String
(Int -> ApplicationMetrics -> ShowS)
-> (ApplicationMetrics -> String)
-> ([ApplicationMetrics] -> ShowS)
-> Show ApplicationMetrics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationMetrics] -> ShowS
$cshowList :: [ApplicationMetrics] -> ShowS
show :: ApplicationMetrics -> String
$cshow :: ApplicationMetrics -> String
showsPrec :: Int -> ApplicationMetrics -> ShowS
$cshowsPrec :: Int -> ApplicationMetrics -> ShowS
Prelude.Show, (forall x. ApplicationMetrics -> Rep ApplicationMetrics x)
-> (forall x. Rep ApplicationMetrics x -> ApplicationMetrics)
-> Generic ApplicationMetrics
forall x. Rep ApplicationMetrics x -> ApplicationMetrics
forall x. ApplicationMetrics -> Rep ApplicationMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApplicationMetrics x -> ApplicationMetrics
$cfrom :: forall x. ApplicationMetrics -> Rep ApplicationMetrics x
Prelude.Generic)
newApplicationMetrics ::
ApplicationMetrics
newApplicationMetrics :: ApplicationMetrics
newApplicationMetrics =
ApplicationMetrics' :: Maybe Int
-> Maybe Latency
-> Maybe StatusCodes
-> Maybe Int
-> ApplicationMetrics
ApplicationMetrics'
{ $sel:requestCount:ApplicationMetrics' :: Maybe Int
requestCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:latency:ApplicationMetrics' :: Maybe Latency
latency = Maybe Latency
forall a. Maybe a
Prelude.Nothing,
$sel:statusCodes:ApplicationMetrics' :: Maybe StatusCodes
statusCodes = Maybe StatusCodes
forall a. Maybe a
Prelude.Nothing,
$sel:duration:ApplicationMetrics' :: Maybe Int
duration = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
applicationMetrics_requestCount :: Lens.Lens' ApplicationMetrics (Prelude.Maybe Prelude.Int)
applicationMetrics_requestCount :: (Maybe Int -> f (Maybe Int))
-> ApplicationMetrics -> f ApplicationMetrics
applicationMetrics_requestCount = (ApplicationMetrics -> Maybe Int)
-> (ApplicationMetrics -> Maybe Int -> ApplicationMetrics)
-> Lens
ApplicationMetrics ApplicationMetrics (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationMetrics' {Maybe Int
requestCount :: Maybe Int
$sel:requestCount:ApplicationMetrics' :: ApplicationMetrics -> Maybe Int
requestCount} -> Maybe Int
requestCount) (\s :: ApplicationMetrics
s@ApplicationMetrics' {} Maybe Int
a -> ApplicationMetrics
s {$sel:requestCount:ApplicationMetrics' :: Maybe Int
requestCount = Maybe Int
a} :: ApplicationMetrics)
applicationMetrics_latency :: Lens.Lens' ApplicationMetrics (Prelude.Maybe Latency)
applicationMetrics_latency :: (Maybe Latency -> f (Maybe Latency))
-> ApplicationMetrics -> f ApplicationMetrics
applicationMetrics_latency = (ApplicationMetrics -> Maybe Latency)
-> (ApplicationMetrics -> Maybe Latency -> ApplicationMetrics)
-> Lens
ApplicationMetrics
ApplicationMetrics
(Maybe Latency)
(Maybe Latency)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationMetrics' {Maybe Latency
latency :: Maybe Latency
$sel:latency:ApplicationMetrics' :: ApplicationMetrics -> Maybe Latency
latency} -> Maybe Latency
latency) (\s :: ApplicationMetrics
s@ApplicationMetrics' {} Maybe Latency
a -> ApplicationMetrics
s {$sel:latency:ApplicationMetrics' :: Maybe Latency
latency = Maybe Latency
a} :: ApplicationMetrics)
applicationMetrics_statusCodes :: Lens.Lens' ApplicationMetrics (Prelude.Maybe StatusCodes)
applicationMetrics_statusCodes :: (Maybe StatusCodes -> f (Maybe StatusCodes))
-> ApplicationMetrics -> f ApplicationMetrics
applicationMetrics_statusCodes = (ApplicationMetrics -> Maybe StatusCodes)
-> (ApplicationMetrics -> Maybe StatusCodes -> ApplicationMetrics)
-> Lens
ApplicationMetrics
ApplicationMetrics
(Maybe StatusCodes)
(Maybe StatusCodes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationMetrics' {Maybe StatusCodes
statusCodes :: Maybe StatusCodes
$sel:statusCodes:ApplicationMetrics' :: ApplicationMetrics -> Maybe StatusCodes
statusCodes} -> Maybe StatusCodes
statusCodes) (\s :: ApplicationMetrics
s@ApplicationMetrics' {} Maybe StatusCodes
a -> ApplicationMetrics
s {$sel:statusCodes:ApplicationMetrics' :: Maybe StatusCodes
statusCodes = Maybe StatusCodes
a} :: ApplicationMetrics)
applicationMetrics_duration :: Lens.Lens' ApplicationMetrics (Prelude.Maybe Prelude.Int)
applicationMetrics_duration :: (Maybe Int -> f (Maybe Int))
-> ApplicationMetrics -> f ApplicationMetrics
applicationMetrics_duration = (ApplicationMetrics -> Maybe Int)
-> (ApplicationMetrics -> Maybe Int -> ApplicationMetrics)
-> Lens
ApplicationMetrics ApplicationMetrics (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationMetrics' {Maybe Int
duration :: Maybe Int
$sel:duration:ApplicationMetrics' :: ApplicationMetrics -> Maybe Int
duration} -> Maybe Int
duration) (\s :: ApplicationMetrics
s@ApplicationMetrics' {} Maybe Int
a -> ApplicationMetrics
s {$sel:duration:ApplicationMetrics' :: Maybe Int
duration = Maybe Int
a} :: ApplicationMetrics)
instance Core.FromXML ApplicationMetrics where
parseXML :: [Node] -> Either String ApplicationMetrics
parseXML [Node]
x =
Maybe Int
-> Maybe Latency
-> Maybe StatusCodes
-> Maybe Int
-> ApplicationMetrics
ApplicationMetrics'
(Maybe Int
-> Maybe Latency
-> Maybe StatusCodes
-> Maybe Int
-> ApplicationMetrics)
-> Either String (Maybe Int)
-> Either
String
(Maybe Latency
-> Maybe StatusCodes -> Maybe Int -> ApplicationMetrics)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RequestCount")
Either
String
(Maybe Latency
-> Maybe StatusCodes -> Maybe Int -> ApplicationMetrics)
-> Either String (Maybe Latency)
-> Either
String (Maybe StatusCodes -> Maybe Int -> ApplicationMetrics)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Latency)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Latency")
Either
String (Maybe StatusCodes -> Maybe Int -> ApplicationMetrics)
-> Either String (Maybe StatusCodes)
-> Either String (Maybe Int -> ApplicationMetrics)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe StatusCodes)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StatusCodes")
Either String (Maybe Int -> ApplicationMetrics)
-> Either String (Maybe Int) -> Either String ApplicationMetrics
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Duration")
instance Prelude.Hashable ApplicationMetrics
instance Prelude.NFData ApplicationMetrics