{-# 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.KinesisAnalyticsV2.Types.MonitoringConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.ConfigurationType
import Amazonka.KinesisAnalyticsV2.Types.LogLevel
import Amazonka.KinesisAnalyticsV2.Types.MetricsLevel
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MonitoringConfiguration = MonitoringConfiguration'
{
MonitoringConfiguration -> Maybe LogLevel
logLevel :: Prelude.Maybe LogLevel,
MonitoringConfiguration -> Maybe MetricsLevel
metricsLevel :: Prelude.Maybe MetricsLevel,
MonitoringConfiguration -> ConfigurationType
configurationType :: ConfigurationType
}
deriving (MonitoringConfiguration -> MonitoringConfiguration -> Bool
(MonitoringConfiguration -> MonitoringConfiguration -> Bool)
-> (MonitoringConfiguration -> MonitoringConfiguration -> Bool)
-> Eq MonitoringConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MonitoringConfiguration -> MonitoringConfiguration -> Bool
$c/= :: MonitoringConfiguration -> MonitoringConfiguration -> Bool
== :: MonitoringConfiguration -> MonitoringConfiguration -> Bool
$c== :: MonitoringConfiguration -> MonitoringConfiguration -> Bool
Prelude.Eq, ReadPrec [MonitoringConfiguration]
ReadPrec MonitoringConfiguration
Int -> ReadS MonitoringConfiguration
ReadS [MonitoringConfiguration]
(Int -> ReadS MonitoringConfiguration)
-> ReadS [MonitoringConfiguration]
-> ReadPrec MonitoringConfiguration
-> ReadPrec [MonitoringConfiguration]
-> Read MonitoringConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MonitoringConfiguration]
$creadListPrec :: ReadPrec [MonitoringConfiguration]
readPrec :: ReadPrec MonitoringConfiguration
$creadPrec :: ReadPrec MonitoringConfiguration
readList :: ReadS [MonitoringConfiguration]
$creadList :: ReadS [MonitoringConfiguration]
readsPrec :: Int -> ReadS MonitoringConfiguration
$creadsPrec :: Int -> ReadS MonitoringConfiguration
Prelude.Read, Int -> MonitoringConfiguration -> ShowS
[MonitoringConfiguration] -> ShowS
MonitoringConfiguration -> String
(Int -> MonitoringConfiguration -> ShowS)
-> (MonitoringConfiguration -> String)
-> ([MonitoringConfiguration] -> ShowS)
-> Show MonitoringConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MonitoringConfiguration] -> ShowS
$cshowList :: [MonitoringConfiguration] -> ShowS
show :: MonitoringConfiguration -> String
$cshow :: MonitoringConfiguration -> String
showsPrec :: Int -> MonitoringConfiguration -> ShowS
$cshowsPrec :: Int -> MonitoringConfiguration -> ShowS
Prelude.Show, (forall x.
MonitoringConfiguration -> Rep MonitoringConfiguration x)
-> (forall x.
Rep MonitoringConfiguration x -> MonitoringConfiguration)
-> Generic MonitoringConfiguration
forall x. Rep MonitoringConfiguration x -> MonitoringConfiguration
forall x. MonitoringConfiguration -> Rep MonitoringConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MonitoringConfiguration x -> MonitoringConfiguration
$cfrom :: forall x. MonitoringConfiguration -> Rep MonitoringConfiguration x
Prelude.Generic)
newMonitoringConfiguration ::
ConfigurationType ->
MonitoringConfiguration
newMonitoringConfiguration :: ConfigurationType -> MonitoringConfiguration
newMonitoringConfiguration ConfigurationType
pConfigurationType_ =
MonitoringConfiguration' :: Maybe LogLevel
-> Maybe MetricsLevel
-> ConfigurationType
-> MonitoringConfiguration
MonitoringConfiguration'
{ $sel:logLevel:MonitoringConfiguration' :: Maybe LogLevel
logLevel =
Maybe LogLevel
forall a. Maybe a
Prelude.Nothing,
$sel:metricsLevel:MonitoringConfiguration' :: Maybe MetricsLevel
metricsLevel = Maybe MetricsLevel
forall a. Maybe a
Prelude.Nothing,
$sel:configurationType:MonitoringConfiguration' :: ConfigurationType
configurationType = ConfigurationType
pConfigurationType_
}
monitoringConfiguration_logLevel :: Lens.Lens' MonitoringConfiguration (Prelude.Maybe LogLevel)
monitoringConfiguration_logLevel :: (Maybe LogLevel -> f (Maybe LogLevel))
-> MonitoringConfiguration -> f MonitoringConfiguration
monitoringConfiguration_logLevel = (MonitoringConfiguration -> Maybe LogLevel)
-> (MonitoringConfiguration
-> Maybe LogLevel -> MonitoringConfiguration)
-> Lens
MonitoringConfiguration
MonitoringConfiguration
(Maybe LogLevel)
(Maybe LogLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoringConfiguration' {Maybe LogLevel
logLevel :: Maybe LogLevel
$sel:logLevel:MonitoringConfiguration' :: MonitoringConfiguration -> Maybe LogLevel
logLevel} -> Maybe LogLevel
logLevel) (\s :: MonitoringConfiguration
s@MonitoringConfiguration' {} Maybe LogLevel
a -> MonitoringConfiguration
s {$sel:logLevel:MonitoringConfiguration' :: Maybe LogLevel
logLevel = Maybe LogLevel
a} :: MonitoringConfiguration)
monitoringConfiguration_metricsLevel :: Lens.Lens' MonitoringConfiguration (Prelude.Maybe MetricsLevel)
monitoringConfiguration_metricsLevel :: (Maybe MetricsLevel -> f (Maybe MetricsLevel))
-> MonitoringConfiguration -> f MonitoringConfiguration
monitoringConfiguration_metricsLevel = (MonitoringConfiguration -> Maybe MetricsLevel)
-> (MonitoringConfiguration
-> Maybe MetricsLevel -> MonitoringConfiguration)
-> Lens
MonitoringConfiguration
MonitoringConfiguration
(Maybe MetricsLevel)
(Maybe MetricsLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoringConfiguration' {Maybe MetricsLevel
metricsLevel :: Maybe MetricsLevel
$sel:metricsLevel:MonitoringConfiguration' :: MonitoringConfiguration -> Maybe MetricsLevel
metricsLevel} -> Maybe MetricsLevel
metricsLevel) (\s :: MonitoringConfiguration
s@MonitoringConfiguration' {} Maybe MetricsLevel
a -> MonitoringConfiguration
s {$sel:metricsLevel:MonitoringConfiguration' :: Maybe MetricsLevel
metricsLevel = Maybe MetricsLevel
a} :: MonitoringConfiguration)
monitoringConfiguration_configurationType :: Lens.Lens' MonitoringConfiguration ConfigurationType
monitoringConfiguration_configurationType :: (ConfigurationType -> f ConfigurationType)
-> MonitoringConfiguration -> f MonitoringConfiguration
monitoringConfiguration_configurationType = (MonitoringConfiguration -> ConfigurationType)
-> (MonitoringConfiguration
-> ConfigurationType -> MonitoringConfiguration)
-> Lens
MonitoringConfiguration
MonitoringConfiguration
ConfigurationType
ConfigurationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoringConfiguration' {ConfigurationType
configurationType :: ConfigurationType
$sel:configurationType:MonitoringConfiguration' :: MonitoringConfiguration -> ConfigurationType
configurationType} -> ConfigurationType
configurationType) (\s :: MonitoringConfiguration
s@MonitoringConfiguration' {} ConfigurationType
a -> MonitoringConfiguration
s {$sel:configurationType:MonitoringConfiguration' :: ConfigurationType
configurationType = ConfigurationType
a} :: MonitoringConfiguration)
instance Prelude.Hashable MonitoringConfiguration
instance Prelude.NFData MonitoringConfiguration
instance Core.ToJSON MonitoringConfiguration where
toJSON :: MonitoringConfiguration -> Value
toJSON MonitoringConfiguration' {Maybe LogLevel
Maybe MetricsLevel
ConfigurationType
configurationType :: ConfigurationType
metricsLevel :: Maybe MetricsLevel
logLevel :: Maybe LogLevel
$sel:configurationType:MonitoringConfiguration' :: MonitoringConfiguration -> ConfigurationType
$sel:metricsLevel:MonitoringConfiguration' :: MonitoringConfiguration -> Maybe MetricsLevel
$sel:logLevel:MonitoringConfiguration' :: MonitoringConfiguration -> Maybe LogLevel
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"LogLevel" Text -> LogLevel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LogLevel -> Pair) -> Maybe LogLevel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LogLevel
logLevel,
(Text
"MetricsLevel" Text -> MetricsLevel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MetricsLevel -> Pair) -> Maybe MetricsLevel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MetricsLevel
metricsLevel,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ConfigurationType" Text -> ConfigurationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConfigurationType
configurationType)
]
)