{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Kafka.Types.OpenMonitoringInfo
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Kafka.Types.OpenMonitoringInfo where

import qualified Amazonka.Core as Core
import Amazonka.Kafka.Types.PrometheusInfo
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | JMX and Node monitoring for the MSK cluster.
--
-- /See:/ 'newOpenMonitoringInfo' smart constructor.
data OpenMonitoringInfo = OpenMonitoringInfo'
  { -- | Prometheus settings.
    OpenMonitoringInfo -> PrometheusInfo
prometheus :: PrometheusInfo
  }
  deriving (OpenMonitoringInfo -> OpenMonitoringInfo -> Bool
(OpenMonitoringInfo -> OpenMonitoringInfo -> Bool)
-> (OpenMonitoringInfo -> OpenMonitoringInfo -> Bool)
-> Eq OpenMonitoringInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpenMonitoringInfo -> OpenMonitoringInfo -> Bool
$c/= :: OpenMonitoringInfo -> OpenMonitoringInfo -> Bool
== :: OpenMonitoringInfo -> OpenMonitoringInfo -> Bool
$c== :: OpenMonitoringInfo -> OpenMonitoringInfo -> Bool
Prelude.Eq, ReadPrec [OpenMonitoringInfo]
ReadPrec OpenMonitoringInfo
Int -> ReadS OpenMonitoringInfo
ReadS [OpenMonitoringInfo]
(Int -> ReadS OpenMonitoringInfo)
-> ReadS [OpenMonitoringInfo]
-> ReadPrec OpenMonitoringInfo
-> ReadPrec [OpenMonitoringInfo]
-> Read OpenMonitoringInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpenMonitoringInfo]
$creadListPrec :: ReadPrec [OpenMonitoringInfo]
readPrec :: ReadPrec OpenMonitoringInfo
$creadPrec :: ReadPrec OpenMonitoringInfo
readList :: ReadS [OpenMonitoringInfo]
$creadList :: ReadS [OpenMonitoringInfo]
readsPrec :: Int -> ReadS OpenMonitoringInfo
$creadsPrec :: Int -> ReadS OpenMonitoringInfo
Prelude.Read, Int -> OpenMonitoringInfo -> ShowS
[OpenMonitoringInfo] -> ShowS
OpenMonitoringInfo -> String
(Int -> OpenMonitoringInfo -> ShowS)
-> (OpenMonitoringInfo -> String)
-> ([OpenMonitoringInfo] -> ShowS)
-> Show OpenMonitoringInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpenMonitoringInfo] -> ShowS
$cshowList :: [OpenMonitoringInfo] -> ShowS
show :: OpenMonitoringInfo -> String
$cshow :: OpenMonitoringInfo -> String
showsPrec :: Int -> OpenMonitoringInfo -> ShowS
$cshowsPrec :: Int -> OpenMonitoringInfo -> ShowS
Prelude.Show, (forall x. OpenMonitoringInfo -> Rep OpenMonitoringInfo x)
-> (forall x. Rep OpenMonitoringInfo x -> OpenMonitoringInfo)
-> Generic OpenMonitoringInfo
forall x. Rep OpenMonitoringInfo x -> OpenMonitoringInfo
forall x. OpenMonitoringInfo -> Rep OpenMonitoringInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OpenMonitoringInfo x -> OpenMonitoringInfo
$cfrom :: forall x. OpenMonitoringInfo -> Rep OpenMonitoringInfo x
Prelude.Generic)

-- |
-- Create a value of 'OpenMonitoringInfo' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'prometheus', 'openMonitoringInfo_prometheus' - Prometheus settings.
newOpenMonitoringInfo ::
  -- | 'prometheus'
  PrometheusInfo ->
  OpenMonitoringInfo
newOpenMonitoringInfo :: PrometheusInfo -> OpenMonitoringInfo
newOpenMonitoringInfo PrometheusInfo
pPrometheus_ =
  OpenMonitoringInfo' :: PrometheusInfo -> OpenMonitoringInfo
OpenMonitoringInfo' {$sel:prometheus:OpenMonitoringInfo' :: PrometheusInfo
prometheus = PrometheusInfo
pPrometheus_}

-- | Prometheus settings.
openMonitoringInfo_prometheus :: Lens.Lens' OpenMonitoringInfo PrometheusInfo
openMonitoringInfo_prometheus :: (PrometheusInfo -> f PrometheusInfo)
-> OpenMonitoringInfo -> f OpenMonitoringInfo
openMonitoringInfo_prometheus = (OpenMonitoringInfo -> PrometheusInfo)
-> (OpenMonitoringInfo -> PrometheusInfo -> OpenMonitoringInfo)
-> Lens
     OpenMonitoringInfo OpenMonitoringInfo PrometheusInfo PrometheusInfo
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpenMonitoringInfo' {PrometheusInfo
prometheus :: PrometheusInfo
$sel:prometheus:OpenMonitoringInfo' :: OpenMonitoringInfo -> PrometheusInfo
prometheus} -> PrometheusInfo
prometheus) (\s :: OpenMonitoringInfo
s@OpenMonitoringInfo' {} PrometheusInfo
a -> OpenMonitoringInfo
s {$sel:prometheus:OpenMonitoringInfo' :: PrometheusInfo
prometheus = PrometheusInfo
a} :: OpenMonitoringInfo)

instance Prelude.Hashable OpenMonitoringInfo

instance Prelude.NFData OpenMonitoringInfo

instance Core.ToJSON OpenMonitoringInfo where
  toJSON :: OpenMonitoringInfo -> Value
toJSON OpenMonitoringInfo' {PrometheusInfo
prometheus :: PrometheusInfo
$sel:prometheus:OpenMonitoringInfo' :: OpenMonitoringInfo -> PrometheusInfo
..} =
    [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
"prometheus" Text -> PrometheusInfo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PrometheusInfo
prometheus)]
      )