{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudWatch.Types.InsightRuleMetricDatapoint
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudWatch.Types.InsightRuleMetricDatapoint where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | One data point from the metric time series returned in a Contributor
-- Insights rule report.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetInsightRuleReport.html GetInsightRuleReport>.
--
-- /See:/ 'newInsightRuleMetricDatapoint' smart constructor.
data InsightRuleMetricDatapoint = InsightRuleMetricDatapoint'
  { -- | The maximum value provided by one contributor during this timestamp.
    -- Each timestamp is evaluated separately, so the identity of the max
    -- contributor could be different for each timestamp.
    --
    -- This statistic is returned only if you included it in the @Metrics@
    -- array in your request.
    InsightRuleMetricDatapoint -> Maybe Double
maxContributorValue :: Prelude.Maybe Prelude.Double,
    -- | The number of occurrences that matched the rule during this data point.
    --
    -- This statistic is returned only if you included it in the @Metrics@
    -- array in your request.
    InsightRuleMetricDatapoint -> Maybe Double
sampleCount :: Prelude.Maybe Prelude.Double,
    -- | The maximum value from a single occurence from a single contributor
    -- during the time period represented by that data point.
    --
    -- This statistic is returned only if you included it in the @Metrics@
    -- array in your request.
    InsightRuleMetricDatapoint -> Maybe Double
maximum :: Prelude.Maybe Prelude.Double,
    -- | The average value from all contributors during the time period
    -- represented by that data point.
    --
    -- This statistic is returned only if you included it in the @Metrics@
    -- array in your request.
    InsightRuleMetricDatapoint -> Maybe Double
average :: Prelude.Maybe Prelude.Double,
    -- | The minimum value from a single contributor during the time period
    -- represented by that data point.
    --
    -- This statistic is returned only if you included it in the @Metrics@
    -- array in your request.
    InsightRuleMetricDatapoint -> Maybe Double
minimum :: Prelude.Maybe Prelude.Double,
    -- | The number of unique contributors who published data during this
    -- timestamp.
    --
    -- This statistic is returned only if you included it in the @Metrics@
    -- array in your request.
    InsightRuleMetricDatapoint -> Maybe Double
uniqueContributors :: Prelude.Maybe Prelude.Double,
    -- | The sum of the values from all contributors during the time period
    -- represented by that data point.
    --
    -- This statistic is returned only if you included it in the @Metrics@
    -- array in your request.
    InsightRuleMetricDatapoint -> Maybe Double
sum :: Prelude.Maybe Prelude.Double,
    -- | The timestamp of the data point.
    InsightRuleMetricDatapoint -> ISO8601
timestamp :: Core.ISO8601
  }
  deriving (InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool
(InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool)
-> (InsightRuleMetricDatapoint
    -> InsightRuleMetricDatapoint -> Bool)
-> Eq InsightRuleMetricDatapoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool
$c/= :: InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool
== :: InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool
$c== :: InsightRuleMetricDatapoint -> InsightRuleMetricDatapoint -> Bool
Prelude.Eq, ReadPrec [InsightRuleMetricDatapoint]
ReadPrec InsightRuleMetricDatapoint
Int -> ReadS InsightRuleMetricDatapoint
ReadS [InsightRuleMetricDatapoint]
(Int -> ReadS InsightRuleMetricDatapoint)
-> ReadS [InsightRuleMetricDatapoint]
-> ReadPrec InsightRuleMetricDatapoint
-> ReadPrec [InsightRuleMetricDatapoint]
-> Read InsightRuleMetricDatapoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InsightRuleMetricDatapoint]
$creadListPrec :: ReadPrec [InsightRuleMetricDatapoint]
readPrec :: ReadPrec InsightRuleMetricDatapoint
$creadPrec :: ReadPrec InsightRuleMetricDatapoint
readList :: ReadS [InsightRuleMetricDatapoint]
$creadList :: ReadS [InsightRuleMetricDatapoint]
readsPrec :: Int -> ReadS InsightRuleMetricDatapoint
$creadsPrec :: Int -> ReadS InsightRuleMetricDatapoint
Prelude.Read, Int -> InsightRuleMetricDatapoint -> ShowS
[InsightRuleMetricDatapoint] -> ShowS
InsightRuleMetricDatapoint -> String
(Int -> InsightRuleMetricDatapoint -> ShowS)
-> (InsightRuleMetricDatapoint -> String)
-> ([InsightRuleMetricDatapoint] -> ShowS)
-> Show InsightRuleMetricDatapoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InsightRuleMetricDatapoint] -> ShowS
$cshowList :: [InsightRuleMetricDatapoint] -> ShowS
show :: InsightRuleMetricDatapoint -> String
$cshow :: InsightRuleMetricDatapoint -> String
showsPrec :: Int -> InsightRuleMetricDatapoint -> ShowS
$cshowsPrec :: Int -> InsightRuleMetricDatapoint -> ShowS
Prelude.Show, (forall x.
 InsightRuleMetricDatapoint -> Rep InsightRuleMetricDatapoint x)
-> (forall x.
    Rep InsightRuleMetricDatapoint x -> InsightRuleMetricDatapoint)
-> Generic InsightRuleMetricDatapoint
forall x.
Rep InsightRuleMetricDatapoint x -> InsightRuleMetricDatapoint
forall x.
InsightRuleMetricDatapoint -> Rep InsightRuleMetricDatapoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InsightRuleMetricDatapoint x -> InsightRuleMetricDatapoint
$cfrom :: forall x.
InsightRuleMetricDatapoint -> Rep InsightRuleMetricDatapoint x
Prelude.Generic)

-- |
-- Create a value of 'InsightRuleMetricDatapoint' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'maxContributorValue', 'insightRuleMetricDatapoint_maxContributorValue' - The maximum value provided by one contributor during this timestamp.
-- Each timestamp is evaluated separately, so the identity of the max
-- contributor could be different for each timestamp.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
--
-- 'sampleCount', 'insightRuleMetricDatapoint_sampleCount' - The number of occurrences that matched the rule during this data point.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
--
-- 'maximum', 'insightRuleMetricDatapoint_maximum' - The maximum value from a single occurence from a single contributor
-- during the time period represented by that data point.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
--
-- 'average', 'insightRuleMetricDatapoint_average' - The average value from all contributors during the time period
-- represented by that data point.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
--
-- 'minimum', 'insightRuleMetricDatapoint_minimum' - The minimum value from a single contributor during the time period
-- represented by that data point.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
--
-- 'uniqueContributors', 'insightRuleMetricDatapoint_uniqueContributors' - The number of unique contributors who published data during this
-- timestamp.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
--
-- 'sum', 'insightRuleMetricDatapoint_sum' - The sum of the values from all contributors during the time period
-- represented by that data point.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
--
-- 'timestamp', 'insightRuleMetricDatapoint_timestamp' - The timestamp of the data point.
newInsightRuleMetricDatapoint ::
  -- | 'timestamp'
  Prelude.UTCTime ->
  InsightRuleMetricDatapoint
newInsightRuleMetricDatapoint :: UTCTime -> InsightRuleMetricDatapoint
newInsightRuleMetricDatapoint UTCTime
pTimestamp_ =
  InsightRuleMetricDatapoint' :: Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint
InsightRuleMetricDatapoint'
    { $sel:maxContributorValue:InsightRuleMetricDatapoint' :: Maybe Double
maxContributorValue =
        Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:sampleCount:InsightRuleMetricDatapoint' :: Maybe Double
sampleCount = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:maximum:InsightRuleMetricDatapoint' :: Maybe Double
maximum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:average:InsightRuleMetricDatapoint' :: Maybe Double
average = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:minimum:InsightRuleMetricDatapoint' :: Maybe Double
minimum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:uniqueContributors:InsightRuleMetricDatapoint' :: Maybe Double
uniqueContributors = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:sum:InsightRuleMetricDatapoint' :: Maybe Double
sum = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:timestamp:InsightRuleMetricDatapoint' :: ISO8601
timestamp = Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pTimestamp_
    }

-- | The maximum value provided by one contributor during this timestamp.
-- Each timestamp is evaluated separately, so the identity of the max
-- contributor could be different for each timestamp.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
insightRuleMetricDatapoint_maxContributorValue :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_maxContributorValue :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_maxContributorValue = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
    -> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
     InsightRuleMetricDatapoint
     InsightRuleMetricDatapoint
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
maxContributorValue :: Maybe Double
$sel:maxContributorValue:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
maxContributorValue} -> Maybe Double
maxContributorValue) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:maxContributorValue:InsightRuleMetricDatapoint' :: Maybe Double
maxContributorValue = Maybe Double
a} :: InsightRuleMetricDatapoint)

-- | The number of occurrences that matched the rule during this data point.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
insightRuleMetricDatapoint_sampleCount :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_sampleCount :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_sampleCount = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
    -> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
     InsightRuleMetricDatapoint
     InsightRuleMetricDatapoint
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
sampleCount :: Maybe Double
$sel:sampleCount:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
sampleCount} -> Maybe Double
sampleCount) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:sampleCount:InsightRuleMetricDatapoint' :: Maybe Double
sampleCount = Maybe Double
a} :: InsightRuleMetricDatapoint)

-- | The maximum value from a single occurence from a single contributor
-- during the time period represented by that data point.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
insightRuleMetricDatapoint_maximum :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_maximum :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_maximum = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
    -> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
     InsightRuleMetricDatapoint
     InsightRuleMetricDatapoint
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
maximum :: Maybe Double
$sel:maximum:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
maximum} -> Maybe Double
maximum) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:maximum:InsightRuleMetricDatapoint' :: Maybe Double
maximum = Maybe Double
a} :: InsightRuleMetricDatapoint)

-- | The average value from all contributors during the time period
-- represented by that data point.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
insightRuleMetricDatapoint_average :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_average :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_average = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
    -> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
     InsightRuleMetricDatapoint
     InsightRuleMetricDatapoint
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
average :: Maybe Double
$sel:average:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
average} -> Maybe Double
average) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:average:InsightRuleMetricDatapoint' :: Maybe Double
average = Maybe Double
a} :: InsightRuleMetricDatapoint)

-- | The minimum value from a single contributor during the time period
-- represented by that data point.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
insightRuleMetricDatapoint_minimum :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_minimum :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_minimum = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
    -> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
     InsightRuleMetricDatapoint
     InsightRuleMetricDatapoint
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
minimum :: Maybe Double
$sel:minimum:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
minimum} -> Maybe Double
minimum) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:minimum:InsightRuleMetricDatapoint' :: Maybe Double
minimum = Maybe Double
a} :: InsightRuleMetricDatapoint)

-- | The number of unique contributors who published data during this
-- timestamp.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
insightRuleMetricDatapoint_uniqueContributors :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_uniqueContributors :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_uniqueContributors = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
    -> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
     InsightRuleMetricDatapoint
     InsightRuleMetricDatapoint
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
uniqueContributors :: Maybe Double
$sel:uniqueContributors:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
uniqueContributors} -> Maybe Double
uniqueContributors) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:uniqueContributors:InsightRuleMetricDatapoint' :: Maybe Double
uniqueContributors = Maybe Double
a} :: InsightRuleMetricDatapoint)

-- | The sum of the values from all contributors during the time period
-- represented by that data point.
--
-- This statistic is returned only if you included it in the @Metrics@
-- array in your request.
insightRuleMetricDatapoint_sum :: Lens.Lens' InsightRuleMetricDatapoint (Prelude.Maybe Prelude.Double)
insightRuleMetricDatapoint_sum :: (Maybe Double -> f (Maybe Double))
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_sum = (InsightRuleMetricDatapoint -> Maybe Double)
-> (InsightRuleMetricDatapoint
    -> Maybe Double -> InsightRuleMetricDatapoint)
-> Lens
     InsightRuleMetricDatapoint
     InsightRuleMetricDatapoint
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {Maybe Double
sum :: Maybe Double
$sel:sum:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> Maybe Double
sum} -> Maybe Double
sum) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} Maybe Double
a -> InsightRuleMetricDatapoint
s {$sel:sum:InsightRuleMetricDatapoint' :: Maybe Double
sum = Maybe Double
a} :: InsightRuleMetricDatapoint)

-- | The timestamp of the data point.
insightRuleMetricDatapoint_timestamp :: Lens.Lens' InsightRuleMetricDatapoint Prelude.UTCTime
insightRuleMetricDatapoint_timestamp :: (UTCTime -> f UTCTime)
-> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint
insightRuleMetricDatapoint_timestamp = (InsightRuleMetricDatapoint -> ISO8601)
-> (InsightRuleMetricDatapoint
    -> ISO8601 -> InsightRuleMetricDatapoint)
-> Lens
     InsightRuleMetricDatapoint
     InsightRuleMetricDatapoint
     ISO8601
     ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightRuleMetricDatapoint' {ISO8601
timestamp :: ISO8601
$sel:timestamp:InsightRuleMetricDatapoint' :: InsightRuleMetricDatapoint -> ISO8601
timestamp} -> ISO8601
timestamp) (\s :: InsightRuleMetricDatapoint
s@InsightRuleMetricDatapoint' {} ISO8601
a -> InsightRuleMetricDatapoint
s {$sel:timestamp:InsightRuleMetricDatapoint' :: ISO8601
timestamp = ISO8601
a} :: InsightRuleMetricDatapoint) ((ISO8601 -> f ISO8601)
 -> InsightRuleMetricDatapoint -> f InsightRuleMetricDatapoint)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> InsightRuleMetricDatapoint
-> f InsightRuleMetricDatapoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromXML InsightRuleMetricDatapoint where
  parseXML :: [Node] -> Either String InsightRuleMetricDatapoint
parseXML [Node]
x =
    Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ISO8601
-> InsightRuleMetricDatapoint
InsightRuleMetricDatapoint'
      (Maybe Double
 -> Maybe Double
 -> Maybe Double
 -> Maybe Double
 -> Maybe Double
 -> Maybe Double
 -> Maybe Double
 -> ISO8601
 -> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> ISO8601
      -> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MaxContributorValue")
      Either
  String
  (Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> ISO8601
   -> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> ISO8601
      -> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SampleCount")
      Either
  String
  (Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> ISO8601
   -> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> ISO8601
      -> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Maximum")
      Either
  String
  (Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> ISO8601
   -> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> ISO8601
      -> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Average")
      Either
  String
  (Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> ISO8601
   -> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
     String
     (Maybe Double
      -> Maybe Double -> ISO8601 -> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Minimum")
      Either
  String
  (Maybe Double
   -> Maybe Double -> ISO8601 -> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either
     String (Maybe Double -> ISO8601 -> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"UniqueContributors")
      Either
  String (Maybe Double -> ISO8601 -> InsightRuleMetricDatapoint)
-> Either String (Maybe Double)
-> Either String (ISO8601 -> InsightRuleMetricDatapoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Sum")
      Either String (ISO8601 -> InsightRuleMetricDatapoint)
-> Either String ISO8601
-> Either String InsightRuleMetricDatapoint
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Timestamp")

instance Prelude.Hashable InsightRuleMetricDatapoint

instance Prelude.NFData InsightRuleMetricDatapoint