{-# 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.MetricSetSummary
-- 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.MetricSetSummary 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

-- | Contains information about a dataset.
--
-- /See:/ 'newMetricSetSummary' smart constructor.
data MetricSetSummary = MetricSetSummary'
  { -- | The ARN of the detector to which the dataset belongs.
    MetricSetSummary -> Maybe Text
anomalyDetectorArn :: Prelude.Maybe Prelude.Text,
    -- | The time at which the dataset was created.
    MetricSetSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The time at which the dataset was last modified.
    MetricSetSummary -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Data.POSIX,
    -- | The ARN of the dataset.
    MetricSetSummary -> Maybe Text
metricSetArn :: Prelude.Maybe Prelude.Text,
    -- | The description of the dataset.
    MetricSetSummary -> Maybe Text
metricSetDescription :: Prelude.Maybe Prelude.Text,
    -- | The name of the dataset.
    MetricSetSummary -> Maybe Text
metricSetName :: Prelude.Maybe Prelude.Text,
    -- | The dataset\'s
    -- <https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html tags>.
    MetricSetSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (MetricSetSummary -> MetricSetSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetricSetSummary -> MetricSetSummary -> Bool
$c/= :: MetricSetSummary -> MetricSetSummary -> Bool
== :: MetricSetSummary -> MetricSetSummary -> Bool
$c== :: MetricSetSummary -> MetricSetSummary -> Bool
Prelude.Eq, ReadPrec [MetricSetSummary]
ReadPrec MetricSetSummary
Int -> ReadS MetricSetSummary
ReadS [MetricSetSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetricSetSummary]
$creadListPrec :: ReadPrec [MetricSetSummary]
readPrec :: ReadPrec MetricSetSummary
$creadPrec :: ReadPrec MetricSetSummary
readList :: ReadS [MetricSetSummary]
$creadList :: ReadS [MetricSetSummary]
readsPrec :: Int -> ReadS MetricSetSummary
$creadsPrec :: Int -> ReadS MetricSetSummary
Prelude.Read, Int -> MetricSetSummary -> ShowS
[MetricSetSummary] -> ShowS
MetricSetSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetricSetSummary] -> ShowS
$cshowList :: [MetricSetSummary] -> ShowS
show :: MetricSetSummary -> String
$cshow :: MetricSetSummary -> String
showsPrec :: Int -> MetricSetSummary -> ShowS
$cshowsPrec :: Int -> MetricSetSummary -> ShowS
Prelude.Show, forall x. Rep MetricSetSummary x -> MetricSetSummary
forall x. MetricSetSummary -> Rep MetricSetSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetricSetSummary x -> MetricSetSummary
$cfrom :: forall x. MetricSetSummary -> Rep MetricSetSummary x
Prelude.Generic)

-- |
-- Create a value of 'MetricSetSummary' 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:
--
-- 'anomalyDetectorArn', 'metricSetSummary_anomalyDetectorArn' - The ARN of the detector to which the dataset belongs.
--
-- 'creationTime', 'metricSetSummary_creationTime' - The time at which the dataset was created.
--
-- 'lastModificationTime', 'metricSetSummary_lastModificationTime' - The time at which the dataset was last modified.
--
-- 'metricSetArn', 'metricSetSummary_metricSetArn' - The ARN of the dataset.
--
-- 'metricSetDescription', 'metricSetSummary_metricSetDescription' - The description of the dataset.
--
-- 'metricSetName', 'metricSetSummary_metricSetName' - The name of the dataset.
--
-- 'tags', 'metricSetSummary_tags' - The dataset\'s
-- <https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html tags>.
newMetricSetSummary ::
  MetricSetSummary
newMetricSetSummary :: MetricSetSummary
newMetricSetSummary =
  MetricSetSummary'
    { $sel:anomalyDetectorArn:MetricSetSummary' :: Maybe Text
anomalyDetectorArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:MetricSetSummary' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModificationTime:MetricSetSummary' :: Maybe POSIX
lastModificationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:metricSetArn:MetricSetSummary' :: Maybe Text
metricSetArn = forall a. Maybe a
Prelude.Nothing,
      $sel:metricSetDescription:MetricSetSummary' :: Maybe Text
metricSetDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:metricSetName:MetricSetSummary' :: Maybe Text
metricSetName = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:MetricSetSummary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the detector to which the dataset belongs.
metricSetSummary_anomalyDetectorArn :: Lens.Lens' MetricSetSummary (Prelude.Maybe Prelude.Text)
metricSetSummary_anomalyDetectorArn :: Lens' MetricSetSummary (Maybe Text)
metricSetSummary_anomalyDetectorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricSetSummary' {Maybe Text
anomalyDetectorArn :: Maybe Text
$sel:anomalyDetectorArn:MetricSetSummary' :: MetricSetSummary -> Maybe Text
anomalyDetectorArn} -> Maybe Text
anomalyDetectorArn) (\s :: MetricSetSummary
s@MetricSetSummary' {} Maybe Text
a -> MetricSetSummary
s {$sel:anomalyDetectorArn:MetricSetSummary' :: Maybe Text
anomalyDetectorArn = Maybe Text
a} :: MetricSetSummary)

-- | The time at which the dataset was created.
metricSetSummary_creationTime :: Lens.Lens' MetricSetSummary (Prelude.Maybe Prelude.UTCTime)
metricSetSummary_creationTime :: Lens' MetricSetSummary (Maybe UTCTime)
metricSetSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricSetSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:MetricSetSummary' :: MetricSetSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: MetricSetSummary
s@MetricSetSummary' {} Maybe POSIX
a -> MetricSetSummary
s {$sel:creationTime:MetricSetSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: MetricSetSummary) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The time at which the dataset was last modified.
metricSetSummary_lastModificationTime :: Lens.Lens' MetricSetSummary (Prelude.Maybe Prelude.UTCTime)
metricSetSummary_lastModificationTime :: Lens' MetricSetSummary (Maybe UTCTime)
metricSetSummary_lastModificationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricSetSummary' {Maybe POSIX
lastModificationTime :: Maybe POSIX
$sel:lastModificationTime:MetricSetSummary' :: MetricSetSummary -> Maybe POSIX
lastModificationTime} -> Maybe POSIX
lastModificationTime) (\s :: MetricSetSummary
s@MetricSetSummary' {} Maybe POSIX
a -> MetricSetSummary
s {$sel:lastModificationTime:MetricSetSummary' :: Maybe POSIX
lastModificationTime = Maybe POSIX
a} :: MetricSetSummary) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ARN of the dataset.
metricSetSummary_metricSetArn :: Lens.Lens' MetricSetSummary (Prelude.Maybe Prelude.Text)
metricSetSummary_metricSetArn :: Lens' MetricSetSummary (Maybe Text)
metricSetSummary_metricSetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricSetSummary' {Maybe Text
metricSetArn :: Maybe Text
$sel:metricSetArn:MetricSetSummary' :: MetricSetSummary -> Maybe Text
metricSetArn} -> Maybe Text
metricSetArn) (\s :: MetricSetSummary
s@MetricSetSummary' {} Maybe Text
a -> MetricSetSummary
s {$sel:metricSetArn:MetricSetSummary' :: Maybe Text
metricSetArn = Maybe Text
a} :: MetricSetSummary)

-- | The description of the dataset.
metricSetSummary_metricSetDescription :: Lens.Lens' MetricSetSummary (Prelude.Maybe Prelude.Text)
metricSetSummary_metricSetDescription :: Lens' MetricSetSummary (Maybe Text)
metricSetSummary_metricSetDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricSetSummary' {Maybe Text
metricSetDescription :: Maybe Text
$sel:metricSetDescription:MetricSetSummary' :: MetricSetSummary -> Maybe Text
metricSetDescription} -> Maybe Text
metricSetDescription) (\s :: MetricSetSummary
s@MetricSetSummary' {} Maybe Text
a -> MetricSetSummary
s {$sel:metricSetDescription:MetricSetSummary' :: Maybe Text
metricSetDescription = Maybe Text
a} :: MetricSetSummary)

-- | The name of the dataset.
metricSetSummary_metricSetName :: Lens.Lens' MetricSetSummary (Prelude.Maybe Prelude.Text)
metricSetSummary_metricSetName :: Lens' MetricSetSummary (Maybe Text)
metricSetSummary_metricSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricSetSummary' {Maybe Text
metricSetName :: Maybe Text
$sel:metricSetName:MetricSetSummary' :: MetricSetSummary -> Maybe Text
metricSetName} -> Maybe Text
metricSetName) (\s :: MetricSetSummary
s@MetricSetSummary' {} Maybe Text
a -> MetricSetSummary
s {$sel:metricSetName:MetricSetSummary' :: Maybe Text
metricSetName = Maybe Text
a} :: MetricSetSummary)

-- | The dataset\'s
-- <https://docs.aws.amazon.com/lookoutmetrics/latest/dev/detectors-tags.html tags>.
metricSetSummary_tags :: Lens.Lens' MetricSetSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
metricSetSummary_tags :: Lens' MetricSetSummary (Maybe (HashMap Text Text))
metricSetSummary_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricSetSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:MetricSetSummary' :: MetricSetSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: MetricSetSummary
s@MetricSetSummary' {} Maybe (HashMap Text Text)
a -> MetricSetSummary
s {$sel:tags:MetricSetSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: MetricSetSummary) 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

instance Data.FromJSON MetricSetSummary where
  parseJSON :: Value -> Parser MetricSetSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MetricSetSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> MetricSetSummary
MetricSetSummary'
            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
"AnomalyDetectorArn")
            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
"CreationTime")
            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
"LastModificationTime")
            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")
            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
"MetricSetDescription")
            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
"MetricSetName")
            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
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable MetricSetSummary where
  hashWithSalt :: Int -> MetricSetSummary -> Int
hashWithSalt Int
_salt MetricSetSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
tags :: Maybe (HashMap Text Text)
metricSetName :: Maybe Text
metricSetDescription :: Maybe Text
metricSetArn :: Maybe Text
lastModificationTime :: Maybe POSIX
creationTime :: Maybe POSIX
anomalyDetectorArn :: Maybe Text
$sel:tags:MetricSetSummary' :: MetricSetSummary -> Maybe (HashMap Text Text)
$sel:metricSetName:MetricSetSummary' :: MetricSetSummary -> Maybe Text
$sel:metricSetDescription:MetricSetSummary' :: MetricSetSummary -> Maybe Text
$sel:metricSetArn:MetricSetSummary' :: MetricSetSummary -> Maybe Text
$sel:lastModificationTime:MetricSetSummary' :: MetricSetSummary -> Maybe POSIX
$sel:creationTime:MetricSetSummary' :: MetricSetSummary -> Maybe POSIX
$sel:anomalyDetectorArn:MetricSetSummary' :: MetricSetSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
anomalyDetectorArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModificationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metricSetArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metricSetDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metricSetName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData MetricSetSummary where
  rnf :: MetricSetSummary -> ()
rnf MetricSetSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
tags :: Maybe (HashMap Text Text)
metricSetName :: Maybe Text
metricSetDescription :: Maybe Text
metricSetArn :: Maybe Text
lastModificationTime :: Maybe POSIX
creationTime :: Maybe POSIX
anomalyDetectorArn :: Maybe Text
$sel:tags:MetricSetSummary' :: MetricSetSummary -> Maybe (HashMap Text Text)
$sel:metricSetName:MetricSetSummary' :: MetricSetSummary -> Maybe Text
$sel:metricSetDescription:MetricSetSummary' :: MetricSetSummary -> Maybe Text
$sel:metricSetArn:MetricSetSummary' :: MetricSetSummary -> Maybe Text
$sel:lastModificationTime:MetricSetSummary' :: MetricSetSummary -> Maybe POSIX
$sel:creationTime:MetricSetSummary' :: MetricSetSummary -> Maybe POSIX
$sel:anomalyDetectorArn:MetricSetSummary' :: MetricSetSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
anomalyDetectorArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModificationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricSetArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricSetDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricSetName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags