{-# 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.LookoutMetrics.Types.MetricSetDataQualityMetric
-- 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.LookoutMetrics.Types.MetricSetDataQualityMetric where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LookoutMetrics.Types.DataQualityMetric
import qualified Amazonka.Prelude as Prelude

-- | An array of @DataQualityMetric@ objects that describes one or more data
-- quality metrics.
--
-- /See:/ 'newMetricSetDataQualityMetric' smart constructor.
data MetricSetDataQualityMetric = MetricSetDataQualityMetric'
  { -- | The array of data quality metrics contained in the data quality metric
    -- set.
    MetricSetDataQualityMetric -> Maybe [DataQualityMetric]
dataQualityMetricList :: Prelude.Maybe [DataQualityMetric],
    -- | The Amazon Resource Name (ARN) of the data quality metric array.
    MetricSetDataQualityMetric -> Maybe Text
metricSetArn :: Prelude.Maybe Prelude.Text
  }
  deriving (MetricSetDataQualityMetric -> MetricSetDataQualityMetric -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetricSetDataQualityMetric -> MetricSetDataQualityMetric -> Bool
$c/= :: MetricSetDataQualityMetric -> MetricSetDataQualityMetric -> Bool
== :: MetricSetDataQualityMetric -> MetricSetDataQualityMetric -> Bool
$c== :: MetricSetDataQualityMetric -> MetricSetDataQualityMetric -> Bool
Prelude.Eq, ReadPrec [MetricSetDataQualityMetric]
ReadPrec MetricSetDataQualityMetric
Int -> ReadS MetricSetDataQualityMetric
ReadS [MetricSetDataQualityMetric]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetricSetDataQualityMetric]
$creadListPrec :: ReadPrec [MetricSetDataQualityMetric]
readPrec :: ReadPrec MetricSetDataQualityMetric
$creadPrec :: ReadPrec MetricSetDataQualityMetric
readList :: ReadS [MetricSetDataQualityMetric]
$creadList :: ReadS [MetricSetDataQualityMetric]
readsPrec :: Int -> ReadS MetricSetDataQualityMetric
$creadsPrec :: Int -> ReadS MetricSetDataQualityMetric
Prelude.Read, Int -> MetricSetDataQualityMetric -> ShowS
[MetricSetDataQualityMetric] -> ShowS
MetricSetDataQualityMetric -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetricSetDataQualityMetric] -> ShowS
$cshowList :: [MetricSetDataQualityMetric] -> ShowS
show :: MetricSetDataQualityMetric -> String
$cshow :: MetricSetDataQualityMetric -> String
showsPrec :: Int -> MetricSetDataQualityMetric -> ShowS
$cshowsPrec :: Int -> MetricSetDataQualityMetric -> ShowS
Prelude.Show, forall x.
Rep MetricSetDataQualityMetric x -> MetricSetDataQualityMetric
forall x.
MetricSetDataQualityMetric -> Rep MetricSetDataQualityMetric x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MetricSetDataQualityMetric x -> MetricSetDataQualityMetric
$cfrom :: forall x.
MetricSetDataQualityMetric -> Rep MetricSetDataQualityMetric x
Prelude.Generic)

-- |
-- Create a value of 'MetricSetDataQualityMetric' 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:
--
-- 'dataQualityMetricList', 'metricSetDataQualityMetric_dataQualityMetricList' - The array of data quality metrics contained in the data quality metric
-- set.
--
-- 'metricSetArn', 'metricSetDataQualityMetric_metricSetArn' - The Amazon Resource Name (ARN) of the data quality metric array.
newMetricSetDataQualityMetric ::
  MetricSetDataQualityMetric
newMetricSetDataQualityMetric :: MetricSetDataQualityMetric
newMetricSetDataQualityMetric =
  MetricSetDataQualityMetric'
    { $sel:dataQualityMetricList:MetricSetDataQualityMetric' :: Maybe [DataQualityMetric]
dataQualityMetricList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:metricSetArn:MetricSetDataQualityMetric' :: Maybe Text
metricSetArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The array of data quality metrics contained in the data quality metric
-- set.
metricSetDataQualityMetric_dataQualityMetricList :: Lens.Lens' MetricSetDataQualityMetric (Prelude.Maybe [DataQualityMetric])
metricSetDataQualityMetric_dataQualityMetricList :: Lens' MetricSetDataQualityMetric (Maybe [DataQualityMetric])
metricSetDataQualityMetric_dataQualityMetricList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricSetDataQualityMetric' {Maybe [DataQualityMetric]
dataQualityMetricList :: Maybe [DataQualityMetric]
$sel:dataQualityMetricList:MetricSetDataQualityMetric' :: MetricSetDataQualityMetric -> Maybe [DataQualityMetric]
dataQualityMetricList} -> Maybe [DataQualityMetric]
dataQualityMetricList) (\s :: MetricSetDataQualityMetric
s@MetricSetDataQualityMetric' {} Maybe [DataQualityMetric]
a -> MetricSetDataQualityMetric
s {$sel:dataQualityMetricList:MetricSetDataQualityMetric' :: Maybe [DataQualityMetric]
dataQualityMetricList = Maybe [DataQualityMetric]
a} :: MetricSetDataQualityMetric) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the data quality metric array.
metricSetDataQualityMetric_metricSetArn :: Lens.Lens' MetricSetDataQualityMetric (Prelude.Maybe Prelude.Text)
metricSetDataQualityMetric_metricSetArn :: Lens' MetricSetDataQualityMetric (Maybe Text)
metricSetDataQualityMetric_metricSetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricSetDataQualityMetric' {Maybe Text
metricSetArn :: Maybe Text
$sel:metricSetArn:MetricSetDataQualityMetric' :: MetricSetDataQualityMetric -> Maybe Text
metricSetArn} -> Maybe Text
metricSetArn) (\s :: MetricSetDataQualityMetric
s@MetricSetDataQualityMetric' {} Maybe Text
a -> MetricSetDataQualityMetric
s {$sel:metricSetArn:MetricSetDataQualityMetric' :: Maybe Text
metricSetArn = Maybe Text
a} :: MetricSetDataQualityMetric)

instance Data.FromJSON MetricSetDataQualityMetric where
  parseJSON :: Value -> Parser MetricSetDataQualityMetric
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MetricSetDataQualityMetric"
      ( \Object
x ->
          Maybe [DataQualityMetric]
-> Maybe Text -> MetricSetDataQualityMetric
MetricSetDataQualityMetric'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DataQualityMetricList"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MetricSetArn")
      )

instance Prelude.Hashable MetricSetDataQualityMetric where
  hashWithSalt :: Int -> MetricSetDataQualityMetric -> Int
hashWithSalt Int
_salt MetricSetDataQualityMetric' {Maybe [DataQualityMetric]
Maybe Text
metricSetArn :: Maybe Text
dataQualityMetricList :: Maybe [DataQualityMetric]
$sel:metricSetArn:MetricSetDataQualityMetric' :: MetricSetDataQualityMetric -> Maybe Text
$sel:dataQualityMetricList:MetricSetDataQualityMetric' :: MetricSetDataQualityMetric -> Maybe [DataQualityMetric]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DataQualityMetric]
dataQualityMetricList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metricSetArn

instance Prelude.NFData MetricSetDataQualityMetric where
  rnf :: MetricSetDataQualityMetric -> ()
rnf MetricSetDataQualityMetric' {Maybe [DataQualityMetric]
Maybe Text
metricSetArn :: Maybe Text
dataQualityMetricList :: Maybe [DataQualityMetric]
$sel:metricSetArn:MetricSetDataQualityMetric' :: MetricSetDataQualityMetric -> Maybe Text
$sel:dataQualityMetricList:MetricSetDataQualityMetric' :: MetricSetDataQualityMetric -> Maybe [DataQualityMetric]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [DataQualityMetric]
dataQualityMetricList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricSetArn