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

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

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

instance Prelude.Hashable NodeExporterInfo

instance Prelude.NFData NodeExporterInfo

instance Core.ToJSON NodeExporterInfo where
  toJSON :: NodeExporterInfo -> Value
toJSON NodeExporterInfo' {Bool
enabledInBroker :: Bool
$sel:enabledInBroker:NodeExporterInfo' :: NodeExporterInfo -> 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)
          ]
      )