{-# 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.Forecast.Types.MetricResult -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) module Amazonka.Forecast.Types.MetricResult where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import qualified Amazonka.Prelude as Prelude -- | An individual metric Forecast calculated when monitoring predictor -- usage. You can compare the value for this metric to the metric\'s value -- in the Baseline to see how your predictor\'s performance is changing. -- -- For more information about metrics generated by Forecast see -- -- -- /See:/ 'newMetricResult' smart constructor. data MetricResult = MetricResult' { -- | The name of the metric. metricName :: Prelude.Maybe Prelude.Text, -- | The value for the metric. metricValue :: Prelude.Maybe Prelude.Double } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'MetricResult' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'metricName', 'metricResult_metricName' - The name of the metric. -- -- 'metricValue', 'metricResult_metricValue' - The value for the metric. newMetricResult :: MetricResult newMetricResult = MetricResult' { metricName = Prelude.Nothing, metricValue = Prelude.Nothing } -- | The name of the metric. metricResult_metricName :: Lens.Lens' MetricResult (Prelude.Maybe Prelude.Text) metricResult_metricName = Lens.lens (\MetricResult' {metricName} -> metricName) (\s@MetricResult' {} a -> s {metricName = a} :: MetricResult) -- | The value for the metric. metricResult_metricValue :: Lens.Lens' MetricResult (Prelude.Maybe Prelude.Double) metricResult_metricValue = Lens.lens (\MetricResult' {metricValue} -> metricValue) (\s@MetricResult' {} a -> s {metricValue = a} :: MetricResult) instance Data.FromJSON MetricResult where parseJSON = Data.withObject "MetricResult" ( \x -> MetricResult' Prelude.<$> (x Data..:? "MetricName") Prelude.<*> (x Data..:? "MetricValue") ) instance Prelude.Hashable MetricResult where hashWithSalt _salt MetricResult' {..} = _salt `Prelude.hashWithSalt` metricName `Prelude.hashWithSalt` metricValue instance Prelude.NFData MetricResult where rnf MetricResult' {..} = Prelude.rnf metricName `Prelude.seq` Prelude.rnf metricValue