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