{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InputLogEvent = InputLogEvent'
{
InputLogEvent -> Natural
timestamp :: Prelude.Natural,
InputLogEvent -> Text
message :: Prelude.Text
}
deriving (InputLogEvent -> InputLogEvent -> Bool
(InputLogEvent -> InputLogEvent -> Bool)
-> (InputLogEvent -> InputLogEvent -> Bool) -> Eq InputLogEvent
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]
(Int -> ReadS InputLogEvent)
-> ReadS [InputLogEvent]
-> ReadPrec InputLogEvent
-> ReadPrec [InputLogEvent]
-> Read 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
(Int -> InputLogEvent -> ShowS)
-> (InputLogEvent -> String)
-> ([InputLogEvent] -> ShowS)
-> Show InputLogEvent
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. InputLogEvent -> Rep InputLogEvent x)
-> (forall x. Rep InputLogEvent x -> InputLogEvent)
-> Generic InputLogEvent
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' :: Natural -> Text -> InputLogEvent
InputLogEvent'
{ $sel:timestamp:InputLogEvent' :: Natural
timestamp = Natural
pTimestamp_,
$sel:message:InputLogEvent' :: Text
message = Text
pMessage_
}
inputLogEvent_timestamp :: Lens.Lens' InputLogEvent Prelude.Natural
inputLogEvent_timestamp :: (Natural -> f Natural) -> InputLogEvent -> f InputLogEvent
inputLogEvent_timestamp = (InputLogEvent -> Natural)
-> (InputLogEvent -> Natural -> InputLogEvent)
-> Lens InputLogEvent InputLogEvent Natural Natural
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 :: (Text -> f Text) -> InputLogEvent -> f InputLogEvent
inputLogEvent_message = (InputLogEvent -> Text)
-> (InputLogEvent -> Text -> InputLogEvent)
-> Lens InputLogEvent InputLogEvent Text Text
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
instance Prelude.NFData InputLogEvent
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"timestamp" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
timestamp),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"message" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
message)
]
)