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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(AnomalyDetectorConfigSummary
 -> AnomalyDetectorConfigSummary -> Bool)
-> (AnomalyDetectorConfigSummary
    -> AnomalyDetectorConfigSummary -> Bool)
-> Eq AnomalyDetectorConfigSummary
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]
(Int -> ReadS AnomalyDetectorConfigSummary)
-> ReadS [AnomalyDetectorConfigSummary]
-> ReadPrec AnomalyDetectorConfigSummary
-> ReadPrec [AnomalyDetectorConfigSummary]
-> Read 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
(Int -> AnomalyDetectorConfigSummary -> ShowS)
-> (AnomalyDetectorConfigSummary -> String)
-> ([AnomalyDetectorConfigSummary] -> ShowS)
-> Show AnomalyDetectorConfigSummary
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.
 AnomalyDetectorConfigSummary -> Rep AnomalyDetectorConfigSummary x)
-> (forall x.
    Rep AnomalyDetectorConfigSummary x -> AnomalyDetectorConfigSummary)
-> Generic AnomalyDetectorConfigSummary
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' :: Maybe Frequency -> AnomalyDetectorConfigSummary
AnomalyDetectorConfigSummary'
    { $sel:anomalyDetectorFrequency:AnomalyDetectorConfigSummary' :: Maybe Frequency
anomalyDetectorFrequency =
        Maybe Frequency
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 :: (Maybe Frequency -> f (Maybe Frequency))
-> AnomalyDetectorConfigSummary -> f AnomalyDetectorConfigSummary
anomalyDetectorConfigSummary_anomalyDetectorFrequency = (AnomalyDetectorConfigSummary -> Maybe Frequency)
-> (AnomalyDetectorConfigSummary
    -> Maybe Frequency -> AnomalyDetectorConfigSummary)
-> Lens
     AnomalyDetectorConfigSummary
     AnomalyDetectorConfigSummary
     (Maybe Frequency)
     (Maybe Frequency)
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 Core.FromJSON AnomalyDetectorConfigSummary where
  parseJSON :: Value -> Parser AnomalyDetectorConfigSummary
parseJSON =
    String
-> (Object -> Parser AnomalyDetectorConfigSummary)
-> Value
-> Parser AnomalyDetectorConfigSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AnomalyDetectorConfigSummary"
      ( \Object
x ->
          Maybe Frequency -> AnomalyDetectorConfigSummary
AnomalyDetectorConfigSummary'
            (Maybe Frequency -> AnomalyDetectorConfigSummary)
-> Parser (Maybe Frequency) -> Parser AnomalyDetectorConfigSummary
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Frequency)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AnomalyDetectorFrequency")
      )

instance
  Prelude.Hashable
    AnomalyDetectorConfigSummary

instance Prelude.NFData AnomalyDetectorConfigSummary