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