{-# 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.JmxExporterInfo
-- 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.JmxExporterInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Indicates whether you want to enable or disable the JMX Exporter.
--
-- /See:/ 'newJmxExporterInfo' smart constructor.
data JmxExporterInfo = JmxExporterInfo'
  { -- | Indicates whether you want to enable or disable the JMX Exporter.
    JmxExporterInfo -> Bool
enabledInBroker :: Prelude.Bool
  }
  deriving (JmxExporterInfo -> JmxExporterInfo -> Bool
(JmxExporterInfo -> JmxExporterInfo -> Bool)
-> (JmxExporterInfo -> JmxExporterInfo -> Bool)
-> Eq JmxExporterInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JmxExporterInfo -> JmxExporterInfo -> Bool
$c/= :: JmxExporterInfo -> JmxExporterInfo -> Bool
== :: JmxExporterInfo -> JmxExporterInfo -> Bool
$c== :: JmxExporterInfo -> JmxExporterInfo -> Bool
Prelude.Eq, ReadPrec [JmxExporterInfo]
ReadPrec JmxExporterInfo
Int -> ReadS JmxExporterInfo
ReadS [JmxExporterInfo]
(Int -> ReadS JmxExporterInfo)
-> ReadS [JmxExporterInfo]
-> ReadPrec JmxExporterInfo
-> ReadPrec [JmxExporterInfo]
-> Read JmxExporterInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JmxExporterInfo]
$creadListPrec :: ReadPrec [JmxExporterInfo]
readPrec :: ReadPrec JmxExporterInfo
$creadPrec :: ReadPrec JmxExporterInfo
readList :: ReadS [JmxExporterInfo]
$creadList :: ReadS [JmxExporterInfo]
readsPrec :: Int -> ReadS JmxExporterInfo
$creadsPrec :: Int -> ReadS JmxExporterInfo
Prelude.Read, Int -> JmxExporterInfo -> ShowS
[JmxExporterInfo] -> ShowS
JmxExporterInfo -> String
(Int -> JmxExporterInfo -> ShowS)
-> (JmxExporterInfo -> String)
-> ([JmxExporterInfo] -> ShowS)
-> Show JmxExporterInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JmxExporterInfo] -> ShowS
$cshowList :: [JmxExporterInfo] -> ShowS
show :: JmxExporterInfo -> String
$cshow :: JmxExporterInfo -> String
showsPrec :: Int -> JmxExporterInfo -> ShowS
$cshowsPrec :: Int -> JmxExporterInfo -> ShowS
Prelude.Show, (forall x. JmxExporterInfo -> Rep JmxExporterInfo x)
-> (forall x. Rep JmxExporterInfo x -> JmxExporterInfo)
-> Generic JmxExporterInfo
forall x. Rep JmxExporterInfo x -> JmxExporterInfo
forall x. JmxExporterInfo -> Rep JmxExporterInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JmxExporterInfo x -> JmxExporterInfo
$cfrom :: forall x. JmxExporterInfo -> Rep JmxExporterInfo x
Prelude.Generic)

-- |
-- Create a value of 'JmxExporterInfo' 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:
--
-- 'enabledInBroker', 'jmxExporterInfo_enabledInBroker' - Indicates whether you want to enable or disable the JMX Exporter.
newJmxExporterInfo ::
  -- | 'enabledInBroker'
  Prelude.Bool ->
  JmxExporterInfo
newJmxExporterInfo :: Bool -> JmxExporterInfo
newJmxExporterInfo Bool
pEnabledInBroker_ =
  JmxExporterInfo' :: Bool -> JmxExporterInfo
JmxExporterInfo'
    { $sel:enabledInBroker:JmxExporterInfo' :: Bool
enabledInBroker =
        Bool
pEnabledInBroker_
    }

-- | Indicates whether you want to enable or disable the JMX Exporter.
jmxExporterInfo_enabledInBroker :: Lens.Lens' JmxExporterInfo Prelude.Bool
jmxExporterInfo_enabledInBroker :: (Bool -> f Bool) -> JmxExporterInfo -> f JmxExporterInfo
jmxExporterInfo_enabledInBroker = (JmxExporterInfo -> Bool)
-> (JmxExporterInfo -> Bool -> JmxExporterInfo)
-> Lens JmxExporterInfo JmxExporterInfo Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JmxExporterInfo' {Bool
enabledInBroker :: Bool
$sel:enabledInBroker:JmxExporterInfo' :: JmxExporterInfo -> Bool
enabledInBroker} -> Bool
enabledInBroker) (\s :: JmxExporterInfo
s@JmxExporterInfo' {} Bool
a -> JmxExporterInfo
s {$sel:enabledInBroker:JmxExporterInfo' :: Bool
enabledInBroker = Bool
a} :: JmxExporterInfo)

instance Prelude.Hashable JmxExporterInfo

instance Prelude.NFData JmxExporterInfo

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