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