{-# 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.LookoutMetrics.Types.ItemizedMetricStats where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ItemizedMetricStats = ItemizedMetricStats'
{
ItemizedMetricStats -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
ItemizedMetricStats -> Maybe Int
occurrenceCount :: Prelude.Maybe Prelude.Int
}
deriving (ItemizedMetricStats -> ItemizedMetricStats -> Bool
(ItemizedMetricStats -> ItemizedMetricStats -> Bool)
-> (ItemizedMetricStats -> ItemizedMetricStats -> Bool)
-> Eq ItemizedMetricStats
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ItemizedMetricStats -> ItemizedMetricStats -> Bool
$c/= :: ItemizedMetricStats -> ItemizedMetricStats -> Bool
== :: ItemizedMetricStats -> ItemizedMetricStats -> Bool
$c== :: ItemizedMetricStats -> ItemizedMetricStats -> Bool
Prelude.Eq, ReadPrec [ItemizedMetricStats]
ReadPrec ItemizedMetricStats
Int -> ReadS ItemizedMetricStats
ReadS [ItemizedMetricStats]
(Int -> ReadS ItemizedMetricStats)
-> ReadS [ItemizedMetricStats]
-> ReadPrec ItemizedMetricStats
-> ReadPrec [ItemizedMetricStats]
-> Read ItemizedMetricStats
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ItemizedMetricStats]
$creadListPrec :: ReadPrec [ItemizedMetricStats]
readPrec :: ReadPrec ItemizedMetricStats
$creadPrec :: ReadPrec ItemizedMetricStats
readList :: ReadS [ItemizedMetricStats]
$creadList :: ReadS [ItemizedMetricStats]
readsPrec :: Int -> ReadS ItemizedMetricStats
$creadsPrec :: Int -> ReadS ItemizedMetricStats
Prelude.Read, Int -> ItemizedMetricStats -> ShowS
[ItemizedMetricStats] -> ShowS
ItemizedMetricStats -> String
(Int -> ItemizedMetricStats -> ShowS)
-> (ItemizedMetricStats -> String)
-> ([ItemizedMetricStats] -> ShowS)
-> Show ItemizedMetricStats
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ItemizedMetricStats] -> ShowS
$cshowList :: [ItemizedMetricStats] -> ShowS
show :: ItemizedMetricStats -> String
$cshow :: ItemizedMetricStats -> String
showsPrec :: Int -> ItemizedMetricStats -> ShowS
$cshowsPrec :: Int -> ItemizedMetricStats -> ShowS
Prelude.Show, (forall x. ItemizedMetricStats -> Rep ItemizedMetricStats x)
-> (forall x. Rep ItemizedMetricStats x -> ItemizedMetricStats)
-> Generic ItemizedMetricStats
forall x. Rep ItemizedMetricStats x -> ItemizedMetricStats
forall x. ItemizedMetricStats -> Rep ItemizedMetricStats x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ItemizedMetricStats x -> ItemizedMetricStats
$cfrom :: forall x. ItemizedMetricStats -> Rep ItemizedMetricStats x
Prelude.Generic)
newItemizedMetricStats ::
ItemizedMetricStats
newItemizedMetricStats :: ItemizedMetricStats
newItemizedMetricStats =
ItemizedMetricStats' :: Maybe Text -> Maybe Int -> ItemizedMetricStats
ItemizedMetricStats'
{ $sel:metricName:ItemizedMetricStats' :: Maybe Text
metricName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:occurrenceCount:ItemizedMetricStats' :: Maybe Int
occurrenceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
itemizedMetricStats_metricName :: Lens.Lens' ItemizedMetricStats (Prelude.Maybe Prelude.Text)
itemizedMetricStats_metricName :: (Maybe Text -> f (Maybe Text))
-> ItemizedMetricStats -> f ItemizedMetricStats
itemizedMetricStats_metricName = (ItemizedMetricStats -> Maybe Text)
-> (ItemizedMetricStats -> Maybe Text -> ItemizedMetricStats)
-> Lens
ItemizedMetricStats ItemizedMetricStats (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ItemizedMetricStats' {Maybe Text
metricName :: Maybe Text
$sel:metricName:ItemizedMetricStats' :: ItemizedMetricStats -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: ItemizedMetricStats
s@ItemizedMetricStats' {} Maybe Text
a -> ItemizedMetricStats
s {$sel:metricName:ItemizedMetricStats' :: Maybe Text
metricName = Maybe Text
a} :: ItemizedMetricStats)
itemizedMetricStats_occurrenceCount :: Lens.Lens' ItemizedMetricStats (Prelude.Maybe Prelude.Int)
itemizedMetricStats_occurrenceCount :: (Maybe Int -> f (Maybe Int))
-> ItemizedMetricStats -> f ItemizedMetricStats
itemizedMetricStats_occurrenceCount = (ItemizedMetricStats -> Maybe Int)
-> (ItemizedMetricStats -> Maybe Int -> ItemizedMetricStats)
-> Lens
ItemizedMetricStats ItemizedMetricStats (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ItemizedMetricStats' {Maybe Int
occurrenceCount :: Maybe Int
$sel:occurrenceCount:ItemizedMetricStats' :: ItemizedMetricStats -> Maybe Int
occurrenceCount} -> Maybe Int
occurrenceCount) (\s :: ItemizedMetricStats
s@ItemizedMetricStats' {} Maybe Int
a -> ItemizedMetricStats
s {$sel:occurrenceCount:ItemizedMetricStats' :: Maybe Int
occurrenceCount = Maybe Int
a} :: ItemizedMetricStats)
instance Core.FromJSON ItemizedMetricStats where
parseJSON :: Value -> Parser ItemizedMetricStats
parseJSON =
String
-> (Object -> Parser ItemizedMetricStats)
-> Value
-> Parser ItemizedMetricStats
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ItemizedMetricStats"
( \Object
x ->
Maybe Text -> Maybe Int -> ItemizedMetricStats
ItemizedMetricStats'
(Maybe Text -> Maybe Int -> ItemizedMetricStats)
-> Parser (Maybe Text) -> Parser (Maybe Int -> ItemizedMetricStats)
forall (f :: * -> *) a b. Functor 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
"MetricName")
Parser (Maybe Int -> ItemizedMetricStats)
-> Parser (Maybe Int) -> Parser ItemizedMetricStats
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
"OccurrenceCount")
)
instance Prelude.Hashable ItemizedMetricStats
instance Prelude.NFData ItemizedMetricStats