{-# 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.AnomalyDetectorConfigSummary
-- 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.AnomalyDetectorConfigSummary 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.Frequency
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a detector\'s configuration.
--
-- /See:/ 'newAnomalyDetectorConfigSummary' smart constructor.
data AnomalyDetectorConfigSummary = AnomalyDetectorConfigSummary'
  { -- | The interval at which the detector analyzes its source data.
    AnomalyDetectorConfigSummary -> Maybe Frequency
anomalyDetectorFrequency :: Prelude.Maybe Frequency
  }
  deriving (AnomalyDetectorConfigSummary
-> AnomalyDetectorConfigSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnomalyDetectorConfigSummary
-> AnomalyDetectorConfigSummary -> Bool
$c/= :: AnomalyDetectorConfigSummary
-> AnomalyDetectorConfigSummary -> Bool
== :: AnomalyDetectorConfigSummary
-> AnomalyDetectorConfigSummary -> Bool
$c== :: AnomalyDetectorConfigSummary
-> AnomalyDetectorConfigSummary -> Bool
Prelude.Eq, ReadPrec [AnomalyDetectorConfigSummary]
ReadPrec AnomalyDetectorConfigSummary
Int -> ReadS AnomalyDetectorConfigSummary
ReadS [AnomalyDetectorConfigSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnomalyDetectorConfigSummary]
$creadListPrec :: ReadPrec [AnomalyDetectorConfigSummary]
readPrec :: ReadPrec AnomalyDetectorConfigSummary
$creadPrec :: ReadPrec AnomalyDetectorConfigSummary
readList :: ReadS [AnomalyDetectorConfigSummary]
$creadList :: ReadS [AnomalyDetectorConfigSummary]
readsPrec :: Int -> ReadS AnomalyDetectorConfigSummary
$creadsPrec :: Int -> ReadS AnomalyDetectorConfigSummary
Prelude.Read, Int -> AnomalyDetectorConfigSummary -> ShowS
[AnomalyDetectorConfigSummary] -> ShowS
AnomalyDetectorConfigSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnomalyDetectorConfigSummary] -> ShowS
$cshowList :: [AnomalyDetectorConfigSummary] -> ShowS
show :: AnomalyDetectorConfigSummary -> String
$cshow :: AnomalyDetectorConfigSummary -> String
showsPrec :: Int -> AnomalyDetectorConfigSummary -> ShowS
$cshowsPrec :: Int -> AnomalyDetectorConfigSummary -> ShowS
Prelude.Show, forall x.
Rep AnomalyDetectorConfigSummary x -> AnomalyDetectorConfigSummary
forall x.
AnomalyDetectorConfigSummary -> Rep AnomalyDetectorConfigSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AnomalyDetectorConfigSummary x -> AnomalyDetectorConfigSummary
$cfrom :: forall x.
AnomalyDetectorConfigSummary -> Rep AnomalyDetectorConfigSummary x
Prelude.Generic)

-- |
-- Create a value of 'AnomalyDetectorConfigSummary' 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:
--
-- 'anomalyDetectorFrequency', 'anomalyDetectorConfigSummary_anomalyDetectorFrequency' - The interval at which the detector analyzes its source data.
newAnomalyDetectorConfigSummary ::
  AnomalyDetectorConfigSummary
newAnomalyDetectorConfigSummary :: AnomalyDetectorConfigSummary
newAnomalyDetectorConfigSummary =
  AnomalyDetectorConfigSummary'
    { $sel:anomalyDetectorFrequency:AnomalyDetectorConfigSummary' :: Maybe Frequency
anomalyDetectorFrequency =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The interval at which the detector analyzes its source data.
anomalyDetectorConfigSummary_anomalyDetectorFrequency :: Lens.Lens' AnomalyDetectorConfigSummary (Prelude.Maybe Frequency)
anomalyDetectorConfigSummary_anomalyDetectorFrequency :: Lens' AnomalyDetectorConfigSummary (Maybe Frequency)
anomalyDetectorConfigSummary_anomalyDetectorFrequency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyDetectorConfigSummary' {Maybe Frequency
anomalyDetectorFrequency :: Maybe Frequency
$sel:anomalyDetectorFrequency:AnomalyDetectorConfigSummary' :: AnomalyDetectorConfigSummary -> Maybe Frequency
anomalyDetectorFrequency} -> Maybe Frequency
anomalyDetectorFrequency) (\s :: AnomalyDetectorConfigSummary
s@AnomalyDetectorConfigSummary' {} Maybe Frequency
a -> AnomalyDetectorConfigSummary
s {$sel:anomalyDetectorFrequency:AnomalyDetectorConfigSummary' :: Maybe Frequency
anomalyDetectorFrequency = Maybe Frequency
a} :: AnomalyDetectorConfigSummary)

instance Data.FromJSON AnomalyDetectorConfigSummary where
  parseJSON :: Value -> Parser AnomalyDetectorConfigSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AnomalyDetectorConfigSummary"
      ( \Object
x ->
          Maybe Frequency -> AnomalyDetectorConfigSummary
AnomalyDetectorConfigSummary'
            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
"AnomalyDetectorFrequency")
      )

instance
  Prelude.Hashable
    AnomalyDetectorConfigSummary
  where
  hashWithSalt :: Int -> AnomalyDetectorConfigSummary -> Int
hashWithSalt Int
_salt AnomalyDetectorConfigSummary' {Maybe Frequency
anomalyDetectorFrequency :: Maybe Frequency
$sel:anomalyDetectorFrequency:AnomalyDetectorConfigSummary' :: AnomalyDetectorConfigSummary -> Maybe Frequency
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Frequency
anomalyDetectorFrequency

instance Prelude.NFData AnomalyDetectorConfigSummary where
  rnf :: AnomalyDetectorConfigSummary -> ()
rnf AnomalyDetectorConfigSummary' {Maybe Frequency
anomalyDetectorFrequency :: Maybe Frequency
$sel:anomalyDetectorFrequency:AnomalyDetectorConfigSummary' :: AnomalyDetectorConfigSummary -> Maybe Frequency
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Frequency
anomalyDetectorFrequency