{-# 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-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.NodeExporter 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 Node Exporter.
--
-- /See:/ 'newNodeExporter' smart constructor.
data NodeExporter = NodeExporter'
  { -- | Indicates whether you want to enable or disable the Node Exporter.
    NodeExporter -> Bool
enabledInBroker :: Prelude.Bool
  }
  deriving (NodeExporter -> NodeExporter -> Bool
(NodeExporter -> NodeExporter -> Bool)
-> (NodeExporter -> NodeExporter -> Bool) -> Eq NodeExporter
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]
(Int -> ReadS NodeExporter)
-> ReadS [NodeExporter]
-> ReadPrec NodeExporter
-> ReadPrec [NodeExporter]
-> Read 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
(Int -> NodeExporter -> ShowS)
-> (NodeExporter -> String)
-> ([NodeExporter] -> ShowS)
-> Show NodeExporter
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. NodeExporter -> Rep NodeExporter x)
-> (forall x. Rep NodeExporter x -> NodeExporter)
-> Generic NodeExporter
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 enable or disable the Node Exporter.
newNodeExporter ::
  -- | 'enabledInBroker'
  Prelude.Bool ->
  NodeExporter
newNodeExporter :: Bool -> NodeExporter
newNodeExporter Bool
pEnabledInBroker_ =
  NodeExporter' :: Bool -> NodeExporter
NodeExporter' {$sel:enabledInBroker:NodeExporter' :: Bool
enabledInBroker = Bool
pEnabledInBroker_}

-- | Indicates whether you want to enable or disable the Node Exporter.
nodeExporter_enabledInBroker :: Lens.Lens' NodeExporter Prelude.Bool
nodeExporter_enabledInBroker :: (Bool -> f Bool) -> NodeExporter -> f NodeExporter
nodeExporter_enabledInBroker = (NodeExporter -> Bool)
-> (NodeExporter -> Bool -> NodeExporter)
-> Lens NodeExporter NodeExporter Bool Bool
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 Core.FromJSON NodeExporter where
  parseJSON :: Value -> Parser NodeExporter
parseJSON =
    String
-> (Object -> Parser NodeExporter) -> Value -> Parser NodeExporter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NodeExporter"
      ( \Object
x ->
          Bool -> NodeExporter
NodeExporter'
            (Bool -> NodeExporter) -> Parser Bool -> Parser NodeExporter
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 NodeExporter

instance Prelude.NFData NodeExporter