{-# 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.LookoutEquipment.Types.DataPreProcessingConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutEquipment.Types.TargetSamplingRate
import qualified Amazonka.Prelude as Prelude
data DataPreProcessingConfiguration = DataPreProcessingConfiguration'
{
DataPreProcessingConfiguration -> Maybe TargetSamplingRate
targetSamplingRate :: Prelude.Maybe TargetSamplingRate
}
deriving (DataPreProcessingConfiguration
-> DataPreProcessingConfiguration -> Bool
(DataPreProcessingConfiguration
-> DataPreProcessingConfiguration -> Bool)
-> (DataPreProcessingConfiguration
-> DataPreProcessingConfiguration -> Bool)
-> Eq DataPreProcessingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataPreProcessingConfiguration
-> DataPreProcessingConfiguration -> Bool
$c/= :: DataPreProcessingConfiguration
-> DataPreProcessingConfiguration -> Bool
== :: DataPreProcessingConfiguration
-> DataPreProcessingConfiguration -> Bool
$c== :: DataPreProcessingConfiguration
-> DataPreProcessingConfiguration -> Bool
Prelude.Eq, ReadPrec [DataPreProcessingConfiguration]
ReadPrec DataPreProcessingConfiguration
Int -> ReadS DataPreProcessingConfiguration
ReadS [DataPreProcessingConfiguration]
(Int -> ReadS DataPreProcessingConfiguration)
-> ReadS [DataPreProcessingConfiguration]
-> ReadPrec DataPreProcessingConfiguration
-> ReadPrec [DataPreProcessingConfiguration]
-> Read DataPreProcessingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataPreProcessingConfiguration]
$creadListPrec :: ReadPrec [DataPreProcessingConfiguration]
readPrec :: ReadPrec DataPreProcessingConfiguration
$creadPrec :: ReadPrec DataPreProcessingConfiguration
readList :: ReadS [DataPreProcessingConfiguration]
$creadList :: ReadS [DataPreProcessingConfiguration]
readsPrec :: Int -> ReadS DataPreProcessingConfiguration
$creadsPrec :: Int -> ReadS DataPreProcessingConfiguration
Prelude.Read, Int -> DataPreProcessingConfiguration -> ShowS
[DataPreProcessingConfiguration] -> ShowS
DataPreProcessingConfiguration -> String
(Int -> DataPreProcessingConfiguration -> ShowS)
-> (DataPreProcessingConfiguration -> String)
-> ([DataPreProcessingConfiguration] -> ShowS)
-> Show DataPreProcessingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataPreProcessingConfiguration] -> ShowS
$cshowList :: [DataPreProcessingConfiguration] -> ShowS
show :: DataPreProcessingConfiguration -> String
$cshow :: DataPreProcessingConfiguration -> String
showsPrec :: Int -> DataPreProcessingConfiguration -> ShowS
$cshowsPrec :: Int -> DataPreProcessingConfiguration -> ShowS
Prelude.Show, (forall x.
DataPreProcessingConfiguration
-> Rep DataPreProcessingConfiguration x)
-> (forall x.
Rep DataPreProcessingConfiguration x
-> DataPreProcessingConfiguration)
-> Generic DataPreProcessingConfiguration
forall x.
Rep DataPreProcessingConfiguration x
-> DataPreProcessingConfiguration
forall x.
DataPreProcessingConfiguration
-> Rep DataPreProcessingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DataPreProcessingConfiguration x
-> DataPreProcessingConfiguration
$cfrom :: forall x.
DataPreProcessingConfiguration
-> Rep DataPreProcessingConfiguration x
Prelude.Generic)
newDataPreProcessingConfiguration ::
DataPreProcessingConfiguration
newDataPreProcessingConfiguration :: DataPreProcessingConfiguration
newDataPreProcessingConfiguration =
DataPreProcessingConfiguration' :: Maybe TargetSamplingRate -> DataPreProcessingConfiguration
DataPreProcessingConfiguration'
{ $sel:targetSamplingRate:DataPreProcessingConfiguration' :: Maybe TargetSamplingRate
targetSamplingRate =
Maybe TargetSamplingRate
forall a. Maybe a
Prelude.Nothing
}
dataPreProcessingConfiguration_targetSamplingRate :: Lens.Lens' DataPreProcessingConfiguration (Prelude.Maybe TargetSamplingRate)
dataPreProcessingConfiguration_targetSamplingRate :: (Maybe TargetSamplingRate -> f (Maybe TargetSamplingRate))
-> DataPreProcessingConfiguration
-> f DataPreProcessingConfiguration
dataPreProcessingConfiguration_targetSamplingRate = (DataPreProcessingConfiguration -> Maybe TargetSamplingRate)
-> (DataPreProcessingConfiguration
-> Maybe TargetSamplingRate -> DataPreProcessingConfiguration)
-> Lens
DataPreProcessingConfiguration
DataPreProcessingConfiguration
(Maybe TargetSamplingRate)
(Maybe TargetSamplingRate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataPreProcessingConfiguration' {Maybe TargetSamplingRate
targetSamplingRate :: Maybe TargetSamplingRate
$sel:targetSamplingRate:DataPreProcessingConfiguration' :: DataPreProcessingConfiguration -> Maybe TargetSamplingRate
targetSamplingRate} -> Maybe TargetSamplingRate
targetSamplingRate) (\s :: DataPreProcessingConfiguration
s@DataPreProcessingConfiguration' {} Maybe TargetSamplingRate
a -> DataPreProcessingConfiguration
s {$sel:targetSamplingRate:DataPreProcessingConfiguration' :: Maybe TargetSamplingRate
targetSamplingRate = Maybe TargetSamplingRate
a} :: DataPreProcessingConfiguration)
instance Core.FromJSON DataPreProcessingConfiguration where
parseJSON :: Value -> Parser DataPreProcessingConfiguration
parseJSON =
String
-> (Object -> Parser DataPreProcessingConfiguration)
-> Value
-> Parser DataPreProcessingConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DataPreProcessingConfiguration"
( \Object
x ->
Maybe TargetSamplingRate -> DataPreProcessingConfiguration
DataPreProcessingConfiguration'
(Maybe TargetSamplingRate -> DataPreProcessingConfiguration)
-> Parser (Maybe TargetSamplingRate)
-> Parser DataPreProcessingConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TargetSamplingRate)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TargetSamplingRate")
)
instance
Prelude.Hashable
DataPreProcessingConfiguration
instance
Prelude.NFData
DataPreProcessingConfiguration
instance Core.ToJSON DataPreProcessingConfiguration where
toJSON :: DataPreProcessingConfiguration -> Value
toJSON DataPreProcessingConfiguration' {Maybe TargetSamplingRate
targetSamplingRate :: Maybe TargetSamplingRate
$sel:targetSamplingRate:DataPreProcessingConfiguration' :: DataPreProcessingConfiguration -> Maybe TargetSamplingRate
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TargetSamplingRate" Text -> TargetSamplingRate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(TargetSamplingRate -> Pair)
-> Maybe TargetSamplingRate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TargetSamplingRate
targetSamplingRate
]
)