{-# 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.IoTWireless.Types.WirelessGatewayEventLogOption where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTWireless.Types.LogLevel
import Amazonka.IoTWireless.Types.WirelessGatewayEvent
import qualified Amazonka.Prelude as Prelude
data WirelessGatewayEventLogOption = WirelessGatewayEventLogOption'
{ WirelessGatewayEventLogOption -> WirelessGatewayEvent
event :: WirelessGatewayEvent,
WirelessGatewayEventLogOption -> LogLevel
logLevel :: LogLevel
}
deriving (WirelessGatewayEventLogOption
-> WirelessGatewayEventLogOption -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WirelessGatewayEventLogOption
-> WirelessGatewayEventLogOption -> Bool
$c/= :: WirelessGatewayEventLogOption
-> WirelessGatewayEventLogOption -> Bool
== :: WirelessGatewayEventLogOption
-> WirelessGatewayEventLogOption -> Bool
$c== :: WirelessGatewayEventLogOption
-> WirelessGatewayEventLogOption -> Bool
Prelude.Eq, ReadPrec [WirelessGatewayEventLogOption]
ReadPrec WirelessGatewayEventLogOption
Int -> ReadS WirelessGatewayEventLogOption
ReadS [WirelessGatewayEventLogOption]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WirelessGatewayEventLogOption]
$creadListPrec :: ReadPrec [WirelessGatewayEventLogOption]
readPrec :: ReadPrec WirelessGatewayEventLogOption
$creadPrec :: ReadPrec WirelessGatewayEventLogOption
readList :: ReadS [WirelessGatewayEventLogOption]
$creadList :: ReadS [WirelessGatewayEventLogOption]
readsPrec :: Int -> ReadS WirelessGatewayEventLogOption
$creadsPrec :: Int -> ReadS WirelessGatewayEventLogOption
Prelude.Read, Int -> WirelessGatewayEventLogOption -> ShowS
[WirelessGatewayEventLogOption] -> ShowS
WirelessGatewayEventLogOption -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WirelessGatewayEventLogOption] -> ShowS
$cshowList :: [WirelessGatewayEventLogOption] -> ShowS
show :: WirelessGatewayEventLogOption -> String
$cshow :: WirelessGatewayEventLogOption -> String
showsPrec :: Int -> WirelessGatewayEventLogOption -> ShowS
$cshowsPrec :: Int -> WirelessGatewayEventLogOption -> ShowS
Prelude.Show, forall x.
Rep WirelessGatewayEventLogOption x
-> WirelessGatewayEventLogOption
forall x.
WirelessGatewayEventLogOption
-> Rep WirelessGatewayEventLogOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WirelessGatewayEventLogOption x
-> WirelessGatewayEventLogOption
$cfrom :: forall x.
WirelessGatewayEventLogOption
-> Rep WirelessGatewayEventLogOption x
Prelude.Generic)
newWirelessGatewayEventLogOption ::
WirelessGatewayEvent ->
LogLevel ->
WirelessGatewayEventLogOption
newWirelessGatewayEventLogOption :: WirelessGatewayEvent -> LogLevel -> WirelessGatewayEventLogOption
newWirelessGatewayEventLogOption WirelessGatewayEvent
pEvent_ LogLevel
pLogLevel_ =
WirelessGatewayEventLogOption'
{ $sel:event:WirelessGatewayEventLogOption' :: WirelessGatewayEvent
event = WirelessGatewayEvent
pEvent_,
$sel:logLevel:WirelessGatewayEventLogOption' :: LogLevel
logLevel = LogLevel
pLogLevel_
}
wirelessGatewayEventLogOption_event :: Lens.Lens' WirelessGatewayEventLogOption WirelessGatewayEvent
wirelessGatewayEventLogOption_event :: Lens' WirelessGatewayEventLogOption WirelessGatewayEvent
wirelessGatewayEventLogOption_event = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WirelessGatewayEventLogOption' {WirelessGatewayEvent
event :: WirelessGatewayEvent
$sel:event:WirelessGatewayEventLogOption' :: WirelessGatewayEventLogOption -> WirelessGatewayEvent
event} -> WirelessGatewayEvent
event) (\s :: WirelessGatewayEventLogOption
s@WirelessGatewayEventLogOption' {} WirelessGatewayEvent
a -> WirelessGatewayEventLogOption
s {$sel:event:WirelessGatewayEventLogOption' :: WirelessGatewayEvent
event = WirelessGatewayEvent
a} :: WirelessGatewayEventLogOption)
wirelessGatewayEventLogOption_logLevel :: Lens.Lens' WirelessGatewayEventLogOption LogLevel
wirelessGatewayEventLogOption_logLevel :: Lens' WirelessGatewayEventLogOption LogLevel
wirelessGatewayEventLogOption_logLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WirelessGatewayEventLogOption' {LogLevel
logLevel :: LogLevel
$sel:logLevel:WirelessGatewayEventLogOption' :: WirelessGatewayEventLogOption -> LogLevel
logLevel} -> LogLevel
logLevel) (\s :: WirelessGatewayEventLogOption
s@WirelessGatewayEventLogOption' {} LogLevel
a -> WirelessGatewayEventLogOption
s {$sel:logLevel:WirelessGatewayEventLogOption' :: LogLevel
logLevel = LogLevel
a} :: WirelessGatewayEventLogOption)
instance Data.FromJSON WirelessGatewayEventLogOption where
parseJSON :: Value -> Parser WirelessGatewayEventLogOption
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"WirelessGatewayEventLogOption"
( \Object
x ->
WirelessGatewayEvent -> LogLevel -> WirelessGatewayEventLogOption
WirelessGatewayEventLogOption'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Event")
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
"LogLevel")
)
instance
Prelude.Hashable
WirelessGatewayEventLogOption
where
hashWithSalt :: Int -> WirelessGatewayEventLogOption -> Int
hashWithSalt Int
_salt WirelessGatewayEventLogOption' {LogLevel
WirelessGatewayEvent
logLevel :: LogLevel
event :: WirelessGatewayEvent
$sel:logLevel:WirelessGatewayEventLogOption' :: WirelessGatewayEventLogOption -> LogLevel
$sel:event:WirelessGatewayEventLogOption' :: WirelessGatewayEventLogOption -> WirelessGatewayEvent
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` WirelessGatewayEvent
event
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LogLevel
logLevel
instance Prelude.NFData WirelessGatewayEventLogOption where
rnf :: WirelessGatewayEventLogOption -> ()
rnf WirelessGatewayEventLogOption' {LogLevel
WirelessGatewayEvent
logLevel :: LogLevel
event :: WirelessGatewayEvent
$sel:logLevel:WirelessGatewayEventLogOption' :: WirelessGatewayEventLogOption -> LogLevel
$sel:event:WirelessGatewayEventLogOption' :: WirelessGatewayEventLogOption -> WirelessGatewayEvent
..} =
forall a. NFData a => a -> ()
Prelude.rnf WirelessGatewayEvent
event
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LogLevel
logLevel
instance Data.ToJSON WirelessGatewayEventLogOption where
toJSON :: WirelessGatewayEventLogOption -> Value
toJSON WirelessGatewayEventLogOption' {LogLevel
WirelessGatewayEvent
logLevel :: LogLevel
event :: WirelessGatewayEvent
$sel:logLevel:WirelessGatewayEventLogOption' :: WirelessGatewayEventLogOption -> LogLevel
$sel:event:WirelessGatewayEventLogOption' :: WirelessGatewayEventLogOption -> WirelessGatewayEvent
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Event" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= WirelessGatewayEvent
event),
forall a. a -> Maybe a
Prelude.Just (Key
"LogLevel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= LogLevel
logLevel)
]
)