{-# 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.Connect.Types.CurrentMetricData where
import Amazonka.Connect.Types.CurrentMetric
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CurrentMetricData = CurrentMetricData'
{
CurrentMetricData -> Maybe Double
value :: Prelude.Maybe Prelude.Double,
CurrentMetricData -> Maybe CurrentMetric
metric :: Prelude.Maybe CurrentMetric
}
deriving (CurrentMetricData -> CurrentMetricData -> Bool
(CurrentMetricData -> CurrentMetricData -> Bool)
-> (CurrentMetricData -> CurrentMetricData -> Bool)
-> Eq CurrentMetricData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CurrentMetricData -> CurrentMetricData -> Bool
$c/= :: CurrentMetricData -> CurrentMetricData -> Bool
== :: CurrentMetricData -> CurrentMetricData -> Bool
$c== :: CurrentMetricData -> CurrentMetricData -> Bool
Prelude.Eq, ReadPrec [CurrentMetricData]
ReadPrec CurrentMetricData
Int -> ReadS CurrentMetricData
ReadS [CurrentMetricData]
(Int -> ReadS CurrentMetricData)
-> ReadS [CurrentMetricData]
-> ReadPrec CurrentMetricData
-> ReadPrec [CurrentMetricData]
-> Read CurrentMetricData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CurrentMetricData]
$creadListPrec :: ReadPrec [CurrentMetricData]
readPrec :: ReadPrec CurrentMetricData
$creadPrec :: ReadPrec CurrentMetricData
readList :: ReadS [CurrentMetricData]
$creadList :: ReadS [CurrentMetricData]
readsPrec :: Int -> ReadS CurrentMetricData
$creadsPrec :: Int -> ReadS CurrentMetricData
Prelude.Read, Int -> CurrentMetricData -> ShowS
[CurrentMetricData] -> ShowS
CurrentMetricData -> String
(Int -> CurrentMetricData -> ShowS)
-> (CurrentMetricData -> String)
-> ([CurrentMetricData] -> ShowS)
-> Show CurrentMetricData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CurrentMetricData] -> ShowS
$cshowList :: [CurrentMetricData] -> ShowS
show :: CurrentMetricData -> String
$cshow :: CurrentMetricData -> String
showsPrec :: Int -> CurrentMetricData -> ShowS
$cshowsPrec :: Int -> CurrentMetricData -> ShowS
Prelude.Show, (forall x. CurrentMetricData -> Rep CurrentMetricData x)
-> (forall x. Rep CurrentMetricData x -> CurrentMetricData)
-> Generic CurrentMetricData
forall x. Rep CurrentMetricData x -> CurrentMetricData
forall x. CurrentMetricData -> Rep CurrentMetricData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CurrentMetricData x -> CurrentMetricData
$cfrom :: forall x. CurrentMetricData -> Rep CurrentMetricData x
Prelude.Generic)
newCurrentMetricData ::
CurrentMetricData
newCurrentMetricData :: CurrentMetricData
newCurrentMetricData =
CurrentMetricData' :: Maybe Double -> Maybe CurrentMetric -> CurrentMetricData
CurrentMetricData'
{ $sel:value:CurrentMetricData' :: Maybe Double
value = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:metric:CurrentMetricData' :: Maybe CurrentMetric
metric = Maybe CurrentMetric
forall a. Maybe a
Prelude.Nothing
}
currentMetricData_value :: Lens.Lens' CurrentMetricData (Prelude.Maybe Prelude.Double)
currentMetricData_value :: (Maybe Double -> f (Maybe Double))
-> CurrentMetricData -> f CurrentMetricData
currentMetricData_value = (CurrentMetricData -> Maybe Double)
-> (CurrentMetricData -> Maybe Double -> CurrentMetricData)
-> Lens
CurrentMetricData CurrentMetricData (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentMetricData' {Maybe Double
value :: Maybe Double
$sel:value:CurrentMetricData' :: CurrentMetricData -> Maybe Double
value} -> Maybe Double
value) (\s :: CurrentMetricData
s@CurrentMetricData' {} Maybe Double
a -> CurrentMetricData
s {$sel:value:CurrentMetricData' :: Maybe Double
value = Maybe Double
a} :: CurrentMetricData)
currentMetricData_metric :: Lens.Lens' CurrentMetricData (Prelude.Maybe CurrentMetric)
currentMetricData_metric :: (Maybe CurrentMetric -> f (Maybe CurrentMetric))
-> CurrentMetricData -> f CurrentMetricData
currentMetricData_metric = (CurrentMetricData -> Maybe CurrentMetric)
-> (CurrentMetricData -> Maybe CurrentMetric -> CurrentMetricData)
-> Lens
CurrentMetricData
CurrentMetricData
(Maybe CurrentMetric)
(Maybe CurrentMetric)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentMetricData' {Maybe CurrentMetric
metric :: Maybe CurrentMetric
$sel:metric:CurrentMetricData' :: CurrentMetricData -> Maybe CurrentMetric
metric} -> Maybe CurrentMetric
metric) (\s :: CurrentMetricData
s@CurrentMetricData' {} Maybe CurrentMetric
a -> CurrentMetricData
s {$sel:metric:CurrentMetricData' :: Maybe CurrentMetric
metric = Maybe CurrentMetric
a} :: CurrentMetricData)
instance Core.FromJSON CurrentMetricData where
parseJSON :: Value -> Parser CurrentMetricData
parseJSON =
String
-> (Object -> Parser CurrentMetricData)
-> Value
-> Parser CurrentMetricData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CurrentMetricData"
( \Object
x ->
Maybe Double -> Maybe CurrentMetric -> CurrentMetricData
CurrentMetricData'
(Maybe Double -> Maybe CurrentMetric -> CurrentMetricData)
-> Parser (Maybe Double)
-> Parser (Maybe CurrentMetric -> CurrentMetricData)
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
"Value")
Parser (Maybe CurrentMetric -> CurrentMetricData)
-> Parser (Maybe CurrentMetric) -> Parser CurrentMetricData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CurrentMetric)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Metric")
)
instance Prelude.Hashable CurrentMetricData
instance Prelude.NFData CurrentMetricData