{-# 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.MQ.Types.PendingLogs
-- 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.MQ.Types.PendingLogs 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

-- | The list of information about logs to be enabled for the specified
-- broker.
--
-- /See:/ 'newPendingLogs' smart constructor.
data PendingLogs = PendingLogs'
  { -- | Enables audit logging. Every user management action made using JMX or
    -- the ActiveMQ Web Console is logged.
    PendingLogs -> Maybe Bool
audit :: Prelude.Maybe Prelude.Bool,
    -- | Enables general logging.
    PendingLogs -> Maybe Bool
general :: Prelude.Maybe Prelude.Bool
  }
  deriving (PendingLogs -> PendingLogs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PendingLogs -> PendingLogs -> Bool
$c/= :: PendingLogs -> PendingLogs -> Bool
== :: PendingLogs -> PendingLogs -> Bool
$c== :: PendingLogs -> PendingLogs -> Bool
Prelude.Eq, ReadPrec [PendingLogs]
ReadPrec PendingLogs
Int -> ReadS PendingLogs
ReadS [PendingLogs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PendingLogs]
$creadListPrec :: ReadPrec [PendingLogs]
readPrec :: ReadPrec PendingLogs
$creadPrec :: ReadPrec PendingLogs
readList :: ReadS [PendingLogs]
$creadList :: ReadS [PendingLogs]
readsPrec :: Int -> ReadS PendingLogs
$creadsPrec :: Int -> ReadS PendingLogs
Prelude.Read, Int -> PendingLogs -> ShowS
[PendingLogs] -> ShowS
PendingLogs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PendingLogs] -> ShowS
$cshowList :: [PendingLogs] -> ShowS
show :: PendingLogs -> String
$cshow :: PendingLogs -> String
showsPrec :: Int -> PendingLogs -> ShowS
$cshowsPrec :: Int -> PendingLogs -> ShowS
Prelude.Show, forall x. Rep PendingLogs x -> PendingLogs
forall x. PendingLogs -> Rep PendingLogs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PendingLogs x -> PendingLogs
$cfrom :: forall x. PendingLogs -> Rep PendingLogs x
Prelude.Generic)

-- |
-- Create a value of 'PendingLogs' 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:
--
-- 'audit', 'pendingLogs_audit' - Enables audit logging. Every user management action made using JMX or
-- the ActiveMQ Web Console is logged.
--
-- 'general', 'pendingLogs_general' - Enables general logging.
newPendingLogs ::
  PendingLogs
newPendingLogs :: PendingLogs
newPendingLogs =
  PendingLogs'
    { $sel:audit:PendingLogs' :: Maybe Bool
audit = forall a. Maybe a
Prelude.Nothing,
      $sel:general:PendingLogs' :: Maybe Bool
general = forall a. Maybe a
Prelude.Nothing
    }

-- | Enables audit logging. Every user management action made using JMX or
-- the ActiveMQ Web Console is logged.
pendingLogs_audit :: Lens.Lens' PendingLogs (Prelude.Maybe Prelude.Bool)
pendingLogs_audit :: Lens' PendingLogs (Maybe Bool)
pendingLogs_audit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PendingLogs' {Maybe Bool
audit :: Maybe Bool
$sel:audit:PendingLogs' :: PendingLogs -> Maybe Bool
audit} -> Maybe Bool
audit) (\s :: PendingLogs
s@PendingLogs' {} Maybe Bool
a -> PendingLogs
s {$sel:audit:PendingLogs' :: Maybe Bool
audit = Maybe Bool
a} :: PendingLogs)

-- | Enables general logging.
pendingLogs_general :: Lens.Lens' PendingLogs (Prelude.Maybe Prelude.Bool)
pendingLogs_general :: Lens' PendingLogs (Maybe Bool)
pendingLogs_general = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PendingLogs' {Maybe Bool
general :: Maybe Bool
$sel:general:PendingLogs' :: PendingLogs -> Maybe Bool
general} -> Maybe Bool
general) (\s :: PendingLogs
s@PendingLogs' {} Maybe Bool
a -> PendingLogs
s {$sel:general:PendingLogs' :: Maybe Bool
general = Maybe Bool
a} :: PendingLogs)

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

instance Prelude.Hashable PendingLogs where
  hashWithSalt :: Int -> PendingLogs -> Int
hashWithSalt Int
_salt PendingLogs' {Maybe Bool
general :: Maybe Bool
audit :: Maybe Bool
$sel:general:PendingLogs' :: PendingLogs -> Maybe Bool
$sel:audit:PendingLogs' :: PendingLogs -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
audit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
general

instance Prelude.NFData PendingLogs where
  rnf :: PendingLogs -> ()
rnf PendingLogs' {Maybe Bool
general :: Maybe Bool
audit :: Maybe Bool
$sel:general:PendingLogs' :: PendingLogs -> Maybe Bool
$sel:audit:PendingLogs' :: PendingLogs -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
audit seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
general