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