{-# 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.LogsSummary
-- 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.LogsSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MQ.Types.PendingLogs
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'LogsSummary' 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', 'logsSummary_audit' - Enables audit logging. Every user management action made using JMX or
-- the ActiveMQ Web Console is logged.
--
-- 'auditLogGroup', 'logsSummary_auditLogGroup' - The location of the CloudWatch Logs log group where audit logs are sent.
--
-- 'pending', 'logsSummary_pending' - The list of information about logs pending to be deployed for the
-- specified broker.
--
-- 'generalLogGroup', 'logsSummary_generalLogGroup' - The location of the CloudWatch Logs log group where general logs are
-- sent.
--
-- 'general', 'logsSummary_general' - Enables general logging.
newLogsSummary ::
  -- | 'generalLogGroup'
  Prelude.Text ->
  -- | 'general'
  Prelude.Bool ->
  LogsSummary
newLogsSummary :: Text -> Bool -> LogsSummary
newLogsSummary Text
pGeneralLogGroup_ Bool
pGeneral_ =
  LogsSummary'
    { $sel:audit:LogsSummary' :: Maybe Bool
audit = forall a. Maybe a
Prelude.Nothing,
      $sel:auditLogGroup:LogsSummary' :: Maybe Text
auditLogGroup = forall a. Maybe a
Prelude.Nothing,
      $sel:pending:LogsSummary' :: Maybe PendingLogs
pending = forall a. Maybe a
Prelude.Nothing,
      $sel:generalLogGroup:LogsSummary' :: Text
generalLogGroup = Text
pGeneralLogGroup_,
      $sel:general:LogsSummary' :: Bool
general = Bool
pGeneral_
    }

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

-- | The location of the CloudWatch Logs log group where audit logs are sent.
logsSummary_auditLogGroup :: Lens.Lens' LogsSummary (Prelude.Maybe Prelude.Text)
logsSummary_auditLogGroup :: Lens' LogsSummary (Maybe Text)
logsSummary_auditLogGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogsSummary' {Maybe Text
auditLogGroup :: Maybe Text
$sel:auditLogGroup:LogsSummary' :: LogsSummary -> Maybe Text
auditLogGroup} -> Maybe Text
auditLogGroup) (\s :: LogsSummary
s@LogsSummary' {} Maybe Text
a -> LogsSummary
s {$sel:auditLogGroup:LogsSummary' :: Maybe Text
auditLogGroup = Maybe Text
a} :: LogsSummary)

-- | The list of information about logs pending to be deployed for the
-- specified broker.
logsSummary_pending :: Lens.Lens' LogsSummary (Prelude.Maybe PendingLogs)
logsSummary_pending :: Lens' LogsSummary (Maybe PendingLogs)
logsSummary_pending = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogsSummary' {Maybe PendingLogs
pending :: Maybe PendingLogs
$sel:pending:LogsSummary' :: LogsSummary -> Maybe PendingLogs
pending} -> Maybe PendingLogs
pending) (\s :: LogsSummary
s@LogsSummary' {} Maybe PendingLogs
a -> LogsSummary
s {$sel:pending:LogsSummary' :: Maybe PendingLogs
pending = Maybe PendingLogs
a} :: LogsSummary)

-- | The location of the CloudWatch Logs log group where general logs are
-- sent.
logsSummary_generalLogGroup :: Lens.Lens' LogsSummary Prelude.Text
logsSummary_generalLogGroup :: Lens' LogsSummary Text
logsSummary_generalLogGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogsSummary' {Text
generalLogGroup :: Text
$sel:generalLogGroup:LogsSummary' :: LogsSummary -> Text
generalLogGroup} -> Text
generalLogGroup) (\s :: LogsSummary
s@LogsSummary' {} Text
a -> LogsSummary
s {$sel:generalLogGroup:LogsSummary' :: Text
generalLogGroup = Text
a} :: LogsSummary)

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

instance Data.FromJSON LogsSummary where
  parseJSON :: Value -> Parser LogsSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LogsSummary"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text -> Maybe PendingLogs -> Text -> Bool -> LogsSummary
LogsSummary'
            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
"auditLogGroup")
            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
"pending")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"generalLogGroup")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"general")
      )

instance Prelude.Hashable LogsSummary where
  hashWithSalt :: Int -> LogsSummary -> Int
hashWithSalt Int
_salt LogsSummary' {Bool
Maybe Bool
Maybe Text
Maybe PendingLogs
Text
general :: Bool
generalLogGroup :: Text
pending :: Maybe PendingLogs
auditLogGroup :: Maybe Text
audit :: Maybe Bool
$sel:general:LogsSummary' :: LogsSummary -> Bool
$sel:generalLogGroup:LogsSummary' :: LogsSummary -> Text
$sel:pending:LogsSummary' :: LogsSummary -> Maybe PendingLogs
$sel:auditLogGroup:LogsSummary' :: LogsSummary -> Maybe Text
$sel:audit:LogsSummary' :: LogsSummary -> 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 Text
auditLogGroup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PendingLogs
pending
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
generalLogGroup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
general

instance Prelude.NFData LogsSummary where
  rnf :: LogsSummary -> ()
rnf LogsSummary' {Bool
Maybe Bool
Maybe Text
Maybe PendingLogs
Text
general :: Bool
generalLogGroup :: Text
pending :: Maybe PendingLogs
auditLogGroup :: Maybe Text
audit :: Maybe Bool
$sel:general:LogsSummary' :: LogsSummary -> Bool
$sel:generalLogGroup:LogsSummary' :: LogsSummary -> Text
$sel:pending:LogsSummary' :: LogsSummary -> Maybe PendingLogs
$sel:auditLogGroup:LogsSummary' :: LogsSummary -> Maybe Text
$sel:audit:LogsSummary' :: LogsSummary -> 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 Text
auditLogGroup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PendingLogs
pending
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
generalLogGroup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
general