{-# 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 #-}
module Amazonka.MQ.Types.Logs 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
data Logs = Logs'
{
Logs -> Maybe Bool
audit :: Prelude.Maybe Prelude.Bool,
Logs -> Maybe Bool
general :: Prelude.Maybe Prelude.Bool
}
deriving (Logs -> Logs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Logs -> Logs -> Bool
$c/= :: Logs -> Logs -> Bool
== :: Logs -> Logs -> Bool
$c== :: Logs -> Logs -> Bool
Prelude.Eq, ReadPrec [Logs]
ReadPrec Logs
Int -> ReadS Logs
ReadS [Logs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Logs]
$creadListPrec :: ReadPrec [Logs]
readPrec :: ReadPrec Logs
$creadPrec :: ReadPrec Logs
readList :: ReadS [Logs]
$creadList :: ReadS [Logs]
readsPrec :: Int -> ReadS Logs
$creadsPrec :: Int -> ReadS Logs
Prelude.Read, Int -> Logs -> ShowS
[Logs] -> ShowS
Logs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Logs] -> ShowS
$cshowList :: [Logs] -> ShowS
show :: Logs -> String
$cshow :: Logs -> String
showsPrec :: Int -> Logs -> ShowS
$cshowsPrec :: Int -> Logs -> ShowS
Prelude.Show, forall x. Rep Logs x -> Logs
forall x. Logs -> Rep Logs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Logs x -> Logs
$cfrom :: forall x. Logs -> Rep Logs x
Prelude.Generic)
newLogs ::
Logs
newLogs :: Logs
newLogs =
Logs'
{ $sel:audit:Logs' :: Maybe Bool
audit = forall a. Maybe a
Prelude.Nothing,
$sel:general:Logs' :: Maybe Bool
general = forall a. Maybe a
Prelude.Nothing
}
logs_audit :: Lens.Lens' Logs (Prelude.Maybe Prelude.Bool)
logs_audit :: Lens' Logs (Maybe Bool)
logs_audit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Logs' {Maybe Bool
audit :: Maybe Bool
$sel:audit:Logs' :: Logs -> Maybe Bool
audit} -> Maybe Bool
audit) (\s :: Logs
s@Logs' {} Maybe Bool
a -> Logs
s {$sel:audit:Logs' :: Maybe Bool
audit = Maybe Bool
a} :: Logs)
logs_general :: Lens.Lens' Logs (Prelude.Maybe Prelude.Bool)
logs_general :: Lens' Logs (Maybe Bool)
logs_general = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Logs' {Maybe Bool
general :: Maybe Bool
$sel:general:Logs' :: Logs -> Maybe Bool
general} -> Maybe Bool
general) (\s :: Logs
s@Logs' {} Maybe Bool
a -> Logs
s {$sel:general:Logs' :: Maybe Bool
general = Maybe Bool
a} :: Logs)
instance Data.FromJSON Logs where
parseJSON :: Value -> Parser Logs
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Logs"
( \Object
x ->
Maybe Bool -> Maybe Bool -> Logs
Logs'
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 Logs where
hashWithSalt :: Int -> Logs -> Int
hashWithSalt Int
_salt Logs' {Maybe Bool
general :: Maybe Bool
audit :: Maybe Bool
$sel:general:Logs' :: Logs -> Maybe Bool
$sel:audit:Logs' :: Logs -> 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 Logs where
rnf :: Logs -> ()
rnf Logs' {Maybe Bool
general :: Maybe Bool
audit :: Maybe Bool
$sel:general:Logs' :: Logs -> Maybe Bool
$sel:audit:Logs' :: Logs -> 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
instance Data.ToJSON Logs where
toJSON :: Logs -> Value
toJSON Logs' {Maybe Bool
general :: Maybe Bool
audit :: Maybe Bool
$sel:general:Logs' :: Logs -> Maybe Bool
$sel:audit:Logs' :: Logs -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"audit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
audit,
(Key
"general" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
general
]
)