{-# 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.Shield.Types.SummarizedCounter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SummarizedCounter = SummarizedCounter'
{
SummarizedCounter -> Maybe Double
max :: Prelude.Maybe Prelude.Double,
SummarizedCounter -> Maybe Double
average :: Prelude.Maybe Prelude.Double,
SummarizedCounter -> Maybe Int
n :: Prelude.Maybe Prelude.Int,
SummarizedCounter -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
SummarizedCounter -> Maybe Double
sum :: Prelude.Maybe Prelude.Double,
SummarizedCounter -> Maybe Text
unit :: Prelude.Maybe Prelude.Text
}
deriving (SummarizedCounter -> SummarizedCounter -> Bool
(SummarizedCounter -> SummarizedCounter -> Bool)
-> (SummarizedCounter -> SummarizedCounter -> Bool)
-> Eq SummarizedCounter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SummarizedCounter -> SummarizedCounter -> Bool
$c/= :: SummarizedCounter -> SummarizedCounter -> Bool
== :: SummarizedCounter -> SummarizedCounter -> Bool
$c== :: SummarizedCounter -> SummarizedCounter -> Bool
Prelude.Eq, ReadPrec [SummarizedCounter]
ReadPrec SummarizedCounter
Int -> ReadS SummarizedCounter
ReadS [SummarizedCounter]
(Int -> ReadS SummarizedCounter)
-> ReadS [SummarizedCounter]
-> ReadPrec SummarizedCounter
-> ReadPrec [SummarizedCounter]
-> Read SummarizedCounter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SummarizedCounter]
$creadListPrec :: ReadPrec [SummarizedCounter]
readPrec :: ReadPrec SummarizedCounter
$creadPrec :: ReadPrec SummarizedCounter
readList :: ReadS [SummarizedCounter]
$creadList :: ReadS [SummarizedCounter]
readsPrec :: Int -> ReadS SummarizedCounter
$creadsPrec :: Int -> ReadS SummarizedCounter
Prelude.Read, Int -> SummarizedCounter -> ShowS
[SummarizedCounter] -> ShowS
SummarizedCounter -> String
(Int -> SummarizedCounter -> ShowS)
-> (SummarizedCounter -> String)
-> ([SummarizedCounter] -> ShowS)
-> Show SummarizedCounter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SummarizedCounter] -> ShowS
$cshowList :: [SummarizedCounter] -> ShowS
show :: SummarizedCounter -> String
$cshow :: SummarizedCounter -> String
showsPrec :: Int -> SummarizedCounter -> ShowS
$cshowsPrec :: Int -> SummarizedCounter -> ShowS
Prelude.Show, (forall x. SummarizedCounter -> Rep SummarizedCounter x)
-> (forall x. Rep SummarizedCounter x -> SummarizedCounter)
-> Generic SummarizedCounter
forall x. Rep SummarizedCounter x -> SummarizedCounter
forall x. SummarizedCounter -> Rep SummarizedCounter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SummarizedCounter x -> SummarizedCounter
$cfrom :: forall x. SummarizedCounter -> Rep SummarizedCounter x
Prelude.Generic)
newSummarizedCounter ::
SummarizedCounter
newSummarizedCounter :: SummarizedCounter
newSummarizedCounter =
SummarizedCounter' :: Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe Text
-> SummarizedCounter
SummarizedCounter'
{ $sel:max:SummarizedCounter' :: Maybe Double
max = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:average:SummarizedCounter' :: Maybe Double
average = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:n:SummarizedCounter' :: Maybe Int
n = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:name:SummarizedCounter' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sum:SummarizedCounter' :: Maybe Double
sum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:unit:SummarizedCounter' :: Maybe Text
unit = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
summarizedCounter_max :: Lens.Lens' SummarizedCounter (Prelude.Maybe Prelude.Double)
summarizedCounter_max :: (Maybe Double -> f (Maybe Double))
-> SummarizedCounter -> f SummarizedCounter
summarizedCounter_max = (SummarizedCounter -> Maybe Double)
-> (SummarizedCounter -> Maybe Double -> SummarizedCounter)
-> Lens
SummarizedCounter SummarizedCounter (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SummarizedCounter' {Maybe Double
max :: Maybe Double
$sel:max:SummarizedCounter' :: SummarizedCounter -> Maybe Double
max} -> Maybe Double
max) (\s :: SummarizedCounter
s@SummarizedCounter' {} Maybe Double
a -> SummarizedCounter
s {$sel:max:SummarizedCounter' :: Maybe Double
max = Maybe Double
a} :: SummarizedCounter)
summarizedCounter_average :: Lens.Lens' SummarizedCounter (Prelude.Maybe Prelude.Double)
summarizedCounter_average :: (Maybe Double -> f (Maybe Double))
-> SummarizedCounter -> f SummarizedCounter
summarizedCounter_average = (SummarizedCounter -> Maybe Double)
-> (SummarizedCounter -> Maybe Double -> SummarizedCounter)
-> Lens
SummarizedCounter SummarizedCounter (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SummarizedCounter' {Maybe Double
average :: Maybe Double
$sel:average:SummarizedCounter' :: SummarizedCounter -> Maybe Double
average} -> Maybe Double
average) (\s :: SummarizedCounter
s@SummarizedCounter' {} Maybe Double
a -> SummarizedCounter
s {$sel:average:SummarizedCounter' :: Maybe Double
average = Maybe Double
a} :: SummarizedCounter)
summarizedCounter_n :: Lens.Lens' SummarizedCounter (Prelude.Maybe Prelude.Int)
summarizedCounter_n :: (Maybe Int -> f (Maybe Int))
-> SummarizedCounter -> f SummarizedCounter
summarizedCounter_n = (SummarizedCounter -> Maybe Int)
-> (SummarizedCounter -> Maybe Int -> SummarizedCounter)
-> Lens SummarizedCounter SummarizedCounter (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SummarizedCounter' {Maybe Int
n :: Maybe Int
$sel:n:SummarizedCounter' :: SummarizedCounter -> Maybe Int
n} -> Maybe Int
n) (\s :: SummarizedCounter
s@SummarizedCounter' {} Maybe Int
a -> SummarizedCounter
s {$sel:n:SummarizedCounter' :: Maybe Int
n = Maybe Int
a} :: SummarizedCounter)
summarizedCounter_name :: Lens.Lens' SummarizedCounter (Prelude.Maybe Prelude.Text)
summarizedCounter_name :: (Maybe Text -> f (Maybe Text))
-> SummarizedCounter -> f SummarizedCounter
summarizedCounter_name = (SummarizedCounter -> Maybe Text)
-> (SummarizedCounter -> Maybe Text -> SummarizedCounter)
-> Lens
SummarizedCounter SummarizedCounter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SummarizedCounter' {Maybe Text
name :: Maybe Text
$sel:name:SummarizedCounter' :: SummarizedCounter -> Maybe Text
name} -> Maybe Text
name) (\s :: SummarizedCounter
s@SummarizedCounter' {} Maybe Text
a -> SummarizedCounter
s {$sel:name:SummarizedCounter' :: Maybe Text
name = Maybe Text
a} :: SummarizedCounter)
summarizedCounter_sum :: Lens.Lens' SummarizedCounter (Prelude.Maybe Prelude.Double)
summarizedCounter_sum :: (Maybe Double -> f (Maybe Double))
-> SummarizedCounter -> f SummarizedCounter
summarizedCounter_sum = (SummarizedCounter -> Maybe Double)
-> (SummarizedCounter -> Maybe Double -> SummarizedCounter)
-> Lens
SummarizedCounter SummarizedCounter (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SummarizedCounter' {Maybe Double
sum :: Maybe Double
$sel:sum:SummarizedCounter' :: SummarizedCounter -> Maybe Double
sum} -> Maybe Double
sum) (\s :: SummarizedCounter
s@SummarizedCounter' {} Maybe Double
a -> SummarizedCounter
s {$sel:sum:SummarizedCounter' :: Maybe Double
sum = Maybe Double
a} :: SummarizedCounter)
summarizedCounter_unit :: Lens.Lens' SummarizedCounter (Prelude.Maybe Prelude.Text)
summarizedCounter_unit :: (Maybe Text -> f (Maybe Text))
-> SummarizedCounter -> f SummarizedCounter
summarizedCounter_unit = (SummarizedCounter -> Maybe Text)
-> (SummarizedCounter -> Maybe Text -> SummarizedCounter)
-> Lens
SummarizedCounter SummarizedCounter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SummarizedCounter' {Maybe Text
unit :: Maybe Text
$sel:unit:SummarizedCounter' :: SummarizedCounter -> Maybe Text
unit} -> Maybe Text
unit) (\s :: SummarizedCounter
s@SummarizedCounter' {} Maybe Text
a -> SummarizedCounter
s {$sel:unit:SummarizedCounter' :: Maybe Text
unit = Maybe Text
a} :: SummarizedCounter)
instance Core.FromJSON SummarizedCounter where
parseJSON :: Value -> Parser SummarizedCounter
parseJSON =
String
-> (Object -> Parser SummarizedCounter)
-> Value
-> Parser SummarizedCounter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SummarizedCounter"
( \Object
x ->
Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe Text
-> SummarizedCounter
SummarizedCounter'
(Maybe Double
-> Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe Text
-> SummarizedCounter)
-> Parser (Maybe Double)
-> Parser
(Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe Text
-> SummarizedCounter)
forall (f :: * -> *) a b. Functor 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
"Max")
Parser
(Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe Text
-> SummarizedCounter)
-> Parser (Maybe Double)
-> Parser
(Maybe Int
-> Maybe Text -> Maybe Double -> Maybe Text -> SummarizedCounter)
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
"Average")
Parser
(Maybe Int
-> Maybe Text -> Maybe Double -> Maybe Text -> SummarizedCounter)
-> Parser (Maybe Int)
-> Parser
(Maybe Text -> Maybe Double -> Maybe Text -> SummarizedCounter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"N")
Parser
(Maybe Text -> Maybe Double -> Maybe Text -> SummarizedCounter)
-> Parser (Maybe Text)
-> Parser (Maybe Double -> Maybe Text -> SummarizedCounter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
Parser (Maybe Double -> Maybe Text -> SummarizedCounter)
-> Parser (Maybe Double)
-> Parser (Maybe Text -> SummarizedCounter)
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
"Sum")
Parser (Maybe Text -> SummarizedCounter)
-> Parser (Maybe Text) -> Parser SummarizedCounter
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Unit")
)
instance Prelude.Hashable SummarizedCounter
instance Prelude.NFData SummarizedCounter