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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(PendingLogs -> PendingLogs -> Bool)
-> (PendingLogs -> PendingLogs -> Bool) -> Eq PendingLogs
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]
(Int -> ReadS PendingLogs)
-> ReadS [PendingLogs]
-> ReadPrec PendingLogs
-> ReadPrec [PendingLogs]
-> Read 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
(Int -> PendingLogs -> ShowS)
-> (PendingLogs -> String)
-> ([PendingLogs] -> ShowS)
-> Show PendingLogs
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. PendingLogs -> Rep PendingLogs x)
-> (forall x. Rep PendingLogs x -> PendingLogs)
-> Generic PendingLogs
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' :: Maybe Bool -> Maybe Bool -> PendingLogs
PendingLogs'
    { $sel:audit:PendingLogs' :: Maybe Bool
audit = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:general:PendingLogs' :: Maybe Bool
general = Maybe Bool
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 :: (Maybe Bool -> f (Maybe Bool)) -> PendingLogs -> f PendingLogs
pendingLogs_audit = (PendingLogs -> Maybe Bool)
-> (PendingLogs -> Maybe Bool -> PendingLogs)
-> Lens PendingLogs PendingLogs (Maybe Bool) (Maybe Bool)
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 :: (Maybe Bool -> f (Maybe Bool)) -> PendingLogs -> f PendingLogs
pendingLogs_general = (PendingLogs -> Maybe Bool)
-> (PendingLogs -> Maybe Bool -> PendingLogs)
-> Lens PendingLogs PendingLogs (Maybe Bool) (Maybe Bool)
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 Core.FromJSON PendingLogs where
  parseJSON :: Value -> Parser PendingLogs
parseJSON =
    String
-> (Object -> Parser PendingLogs) -> Value -> Parser PendingLogs
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PendingLogs"
      ( \Object
x ->
          Maybe Bool -> Maybe Bool -> PendingLogs
PendingLogs'
            (Maybe Bool -> Maybe Bool -> PendingLogs)
-> Parser (Maybe Bool) -> Parser (Maybe Bool -> PendingLogs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audit")
            Parser (Maybe Bool -> PendingLogs)
-> Parser (Maybe Bool) -> Parser PendingLogs
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"general")
      )

instance Prelude.Hashable PendingLogs

instance Prelude.NFData PendingLogs