{-# 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 #-}
module Amazonka.LookoutMetrics.Types.AnomalyGroupTimeSeries where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AnomalyGroupTimeSeries = AnomalyGroupTimeSeries'
{
AnomalyGroupTimeSeries -> Maybe Text
timeSeriesId :: Prelude.Maybe Prelude.Text,
AnomalyGroupTimeSeries -> Text
anomalyGroupId :: Prelude.Text
}
deriving (AnomalyGroupTimeSeries -> AnomalyGroupTimeSeries -> Bool
(AnomalyGroupTimeSeries -> AnomalyGroupTimeSeries -> Bool)
-> (AnomalyGroupTimeSeries -> AnomalyGroupTimeSeries -> Bool)
-> Eq AnomalyGroupTimeSeries
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnomalyGroupTimeSeries -> AnomalyGroupTimeSeries -> Bool
$c/= :: AnomalyGroupTimeSeries -> AnomalyGroupTimeSeries -> Bool
== :: AnomalyGroupTimeSeries -> AnomalyGroupTimeSeries -> Bool
$c== :: AnomalyGroupTimeSeries -> AnomalyGroupTimeSeries -> Bool
Prelude.Eq, ReadPrec [AnomalyGroupTimeSeries]
ReadPrec AnomalyGroupTimeSeries
Int -> ReadS AnomalyGroupTimeSeries
ReadS [AnomalyGroupTimeSeries]
(Int -> ReadS AnomalyGroupTimeSeries)
-> ReadS [AnomalyGroupTimeSeries]
-> ReadPrec AnomalyGroupTimeSeries
-> ReadPrec [AnomalyGroupTimeSeries]
-> Read AnomalyGroupTimeSeries
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnomalyGroupTimeSeries]
$creadListPrec :: ReadPrec [AnomalyGroupTimeSeries]
readPrec :: ReadPrec AnomalyGroupTimeSeries
$creadPrec :: ReadPrec AnomalyGroupTimeSeries
readList :: ReadS [AnomalyGroupTimeSeries]
$creadList :: ReadS [AnomalyGroupTimeSeries]
readsPrec :: Int -> ReadS AnomalyGroupTimeSeries
$creadsPrec :: Int -> ReadS AnomalyGroupTimeSeries
Prelude.Read, Int -> AnomalyGroupTimeSeries -> ShowS
[AnomalyGroupTimeSeries] -> ShowS
AnomalyGroupTimeSeries -> String
(Int -> AnomalyGroupTimeSeries -> ShowS)
-> (AnomalyGroupTimeSeries -> String)
-> ([AnomalyGroupTimeSeries] -> ShowS)
-> Show AnomalyGroupTimeSeries
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnomalyGroupTimeSeries] -> ShowS
$cshowList :: [AnomalyGroupTimeSeries] -> ShowS
show :: AnomalyGroupTimeSeries -> String
$cshow :: AnomalyGroupTimeSeries -> String
showsPrec :: Int -> AnomalyGroupTimeSeries -> ShowS
$cshowsPrec :: Int -> AnomalyGroupTimeSeries -> ShowS
Prelude.Show, (forall x. AnomalyGroupTimeSeries -> Rep AnomalyGroupTimeSeries x)
-> (forall x.
Rep AnomalyGroupTimeSeries x -> AnomalyGroupTimeSeries)
-> Generic AnomalyGroupTimeSeries
forall x. Rep AnomalyGroupTimeSeries x -> AnomalyGroupTimeSeries
forall x. AnomalyGroupTimeSeries -> Rep AnomalyGroupTimeSeries x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnomalyGroupTimeSeries x -> AnomalyGroupTimeSeries
$cfrom :: forall x. AnomalyGroupTimeSeries -> Rep AnomalyGroupTimeSeries x
Prelude.Generic)
newAnomalyGroupTimeSeries ::
Prelude.Text ->
AnomalyGroupTimeSeries
newAnomalyGroupTimeSeries :: Text -> AnomalyGroupTimeSeries
newAnomalyGroupTimeSeries Text
pAnomalyGroupId_ =
AnomalyGroupTimeSeries' :: Maybe Text -> Text -> AnomalyGroupTimeSeries
AnomalyGroupTimeSeries'
{ $sel:timeSeriesId:AnomalyGroupTimeSeries' :: Maybe Text
timeSeriesId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:anomalyGroupId:AnomalyGroupTimeSeries' :: Text
anomalyGroupId = Text
pAnomalyGroupId_
}
anomalyGroupTimeSeries_timeSeriesId :: Lens.Lens' AnomalyGroupTimeSeries (Prelude.Maybe Prelude.Text)
anomalyGroupTimeSeries_timeSeriesId :: (Maybe Text -> f (Maybe Text))
-> AnomalyGroupTimeSeries -> f AnomalyGroupTimeSeries
anomalyGroupTimeSeries_timeSeriesId = (AnomalyGroupTimeSeries -> Maybe Text)
-> (AnomalyGroupTimeSeries -> Maybe Text -> AnomalyGroupTimeSeries)
-> Lens
AnomalyGroupTimeSeries
AnomalyGroupTimeSeries
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyGroupTimeSeries' {Maybe Text
timeSeriesId :: Maybe Text
$sel:timeSeriesId:AnomalyGroupTimeSeries' :: AnomalyGroupTimeSeries -> Maybe Text
timeSeriesId} -> Maybe Text
timeSeriesId) (\s :: AnomalyGroupTimeSeries
s@AnomalyGroupTimeSeries' {} Maybe Text
a -> AnomalyGroupTimeSeries
s {$sel:timeSeriesId:AnomalyGroupTimeSeries' :: Maybe Text
timeSeriesId = Maybe Text
a} :: AnomalyGroupTimeSeries)
anomalyGroupTimeSeries_anomalyGroupId :: Lens.Lens' AnomalyGroupTimeSeries Prelude.Text
anomalyGroupTimeSeries_anomalyGroupId :: (Text -> f Text)
-> AnomalyGroupTimeSeries -> f AnomalyGroupTimeSeries
anomalyGroupTimeSeries_anomalyGroupId = (AnomalyGroupTimeSeries -> Text)
-> (AnomalyGroupTimeSeries -> Text -> AnomalyGroupTimeSeries)
-> Lens AnomalyGroupTimeSeries AnomalyGroupTimeSeries Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyGroupTimeSeries' {Text
anomalyGroupId :: Text
$sel:anomalyGroupId:AnomalyGroupTimeSeries' :: AnomalyGroupTimeSeries -> Text
anomalyGroupId} -> Text
anomalyGroupId) (\s :: AnomalyGroupTimeSeries
s@AnomalyGroupTimeSeries' {} Text
a -> AnomalyGroupTimeSeries
s {$sel:anomalyGroupId:AnomalyGroupTimeSeries' :: Text
anomalyGroupId = Text
a} :: AnomalyGroupTimeSeries)
instance Prelude.Hashable AnomalyGroupTimeSeries
instance Prelude.NFData AnomalyGroupTimeSeries
instance Core.ToJSON AnomalyGroupTimeSeries where
toJSON :: AnomalyGroupTimeSeries -> Value
toJSON AnomalyGroupTimeSeries' {Maybe Text
Text
anomalyGroupId :: Text
timeSeriesId :: Maybe Text
$sel:anomalyGroupId:AnomalyGroupTimeSeries' :: AnomalyGroupTimeSeries -> Text
$sel:timeSeriesId:AnomalyGroupTimeSeries' :: AnomalyGroupTimeSeries -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TimeSeriesId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
timeSeriesId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AnomalyGroupId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
anomalyGroupId)
]
)