{-# 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.CloudWatchLogs.Types.InputLogEvent 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 InputLogEvent = InputLogEvent'
{
InputLogEvent -> Natural
timestamp :: Prelude.Natural,
InputLogEvent -> Text
message :: Prelude.Text
}
deriving (InputLogEvent -> InputLogEvent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputLogEvent -> InputLogEvent -> Bool
$c/= :: InputLogEvent -> InputLogEvent -> Bool
== :: InputLogEvent -> InputLogEvent -> Bool
$c== :: InputLogEvent -> InputLogEvent -> Bool
Prelude.Eq, ReadPrec [InputLogEvent]
ReadPrec InputLogEvent
Int -> ReadS InputLogEvent
ReadS [InputLogEvent]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputLogEvent]
$creadListPrec :: ReadPrec [InputLogEvent]
readPrec :: ReadPrec InputLogEvent
$creadPrec :: ReadPrec InputLogEvent
readList :: ReadS [InputLogEvent]
$creadList :: ReadS [InputLogEvent]
readsPrec :: Int -> ReadS InputLogEvent
$creadsPrec :: Int -> ReadS InputLogEvent
Prelude.Read, Int -> InputLogEvent -> ShowS
[InputLogEvent] -> ShowS
InputLogEvent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputLogEvent] -> ShowS
$cshowList :: [InputLogEvent] -> ShowS
show :: InputLogEvent -> String
$cshow :: InputLogEvent -> String
showsPrec :: Int -> InputLogEvent -> ShowS
$cshowsPrec :: Int -> InputLogEvent -> ShowS
Prelude.Show, forall x. Rep InputLogEvent x -> InputLogEvent
forall x. InputLogEvent -> Rep InputLogEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputLogEvent x -> InputLogEvent
$cfrom :: forall x. InputLogEvent -> Rep InputLogEvent x
Prelude.Generic)
newInputLogEvent ::
Prelude.Natural ->
Prelude.Text ->
InputLogEvent
newInputLogEvent :: Natural -> Text -> InputLogEvent
newInputLogEvent Natural
pTimestamp_ Text
pMessage_ =
InputLogEvent'
{ $sel:timestamp:InputLogEvent' :: Natural
timestamp = Natural
pTimestamp_,
$sel:message:InputLogEvent' :: Text
message = Text
pMessage_
}
inputLogEvent_timestamp :: Lens.Lens' InputLogEvent Prelude.Natural
inputLogEvent_timestamp :: Lens' InputLogEvent Natural
inputLogEvent_timestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputLogEvent' {Natural
timestamp :: Natural
$sel:timestamp:InputLogEvent' :: InputLogEvent -> Natural
timestamp} -> Natural
timestamp) (\s :: InputLogEvent
s@InputLogEvent' {} Natural
a -> InputLogEvent
s {$sel:timestamp:InputLogEvent' :: Natural
timestamp = Natural
a} :: InputLogEvent)
inputLogEvent_message :: Lens.Lens' InputLogEvent Prelude.Text
inputLogEvent_message :: Lens' InputLogEvent Text
inputLogEvent_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputLogEvent' {Text
message :: Text
$sel:message:InputLogEvent' :: InputLogEvent -> Text
message} -> Text
message) (\s :: InputLogEvent
s@InputLogEvent' {} Text
a -> InputLogEvent
s {$sel:message:InputLogEvent' :: Text
message = Text
a} :: InputLogEvent)
instance Prelude.Hashable InputLogEvent where
hashWithSalt :: Int -> InputLogEvent -> Int
hashWithSalt Int
_salt InputLogEvent' {Natural
Text
message :: Text
timestamp :: Natural
$sel:message:InputLogEvent' :: InputLogEvent -> Text
$sel:timestamp:InputLogEvent' :: InputLogEvent -> Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
timestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
message
instance Prelude.NFData InputLogEvent where
rnf :: InputLogEvent -> ()
rnf InputLogEvent' {Natural
Text
message :: Text
timestamp :: Natural
$sel:message:InputLogEvent' :: InputLogEvent -> Text
$sel:timestamp:InputLogEvent' :: InputLogEvent -> Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Natural
timestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
message
instance Data.ToJSON InputLogEvent where
toJSON :: InputLogEvent -> Value
toJSON InputLogEvent' {Natural
Text
message :: Text
timestamp :: Natural
$sel:message:InputLogEvent' :: InputLogEvent -> Text
$sel:timestamp:InputLogEvent' :: InputLogEvent -> Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"timestamp" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
timestamp),
forall a. a -> Maybe a
Prelude.Just (Key
"message" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
message)
]
)