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

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

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

instance Core.FromJSON JmxExporter where
  parseJSON :: Value -> Parser JmxExporter
parseJSON =
    String
-> (Object -> Parser JmxExporter) -> Value -> Parser JmxExporter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"JmxExporter"
      ( \Object
x ->
          Bool -> JmxExporter
JmxExporter'
            (Bool -> JmxExporter) -> Parser Bool -> Parser JmxExporter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"enabledInBroker")
      )

instance Prelude.Hashable JmxExporter

instance Prelude.NFData JmxExporter