{-# 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.NodeExporter
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Kafka.Types.NodeExporter where

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

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

-- |
-- Create a value of 'NodeExporter' 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', 'nodeExporter_enabledInBroker' - Indicates whether you want to turn on or turn off the Node Exporter.
newNodeExporter ::
  -- | 'enabledInBroker'
  Prelude.Bool ->
  NodeExporter
newNodeExporter :: Bool -> NodeExporter
newNodeExporter Bool
pEnabledInBroker_ =
  NodeExporter' {$sel:enabledInBroker:NodeExporter' :: Bool
enabledInBroker = Bool
pEnabledInBroker_}

-- | Indicates whether you want to turn on or turn off the Node Exporter.
nodeExporter_enabledInBroker :: Lens.Lens' NodeExporter Prelude.Bool
nodeExporter_enabledInBroker :: Lens' NodeExporter Bool
nodeExporter_enabledInBroker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeExporter' {Bool
enabledInBroker :: Bool
$sel:enabledInBroker:NodeExporter' :: NodeExporter -> Bool
enabledInBroker} -> Bool
enabledInBroker) (\s :: NodeExporter
s@NodeExporter' {} Bool
a -> NodeExporter
s {$sel:enabledInBroker:NodeExporter' :: Bool
enabledInBroker = Bool
a} :: NodeExporter)

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

instance Prelude.Hashable NodeExporter where
  hashWithSalt :: Int -> NodeExporter -> Int
hashWithSalt Int
_salt NodeExporter' {Bool
enabledInBroker :: Bool
$sel:enabledInBroker:NodeExporter' :: NodeExporter -> Bool
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enabledInBroker

instance Prelude.NFData NodeExporter where
  rnf :: NodeExporter -> ()
rnf NodeExporter' {Bool
enabledInBroker :: Bool
$sel:enabledInBroker:NodeExporter' :: NodeExporter -> Bool
..} = forall a. NFData a => a -> ()
Prelude.rnf Bool
enabledInBroker