{-# 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.LogStream where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LogStream = LogStream'
{
LogStream -> Maybe Natural
creationTime :: Prelude.Maybe Prelude.Natural,
LogStream -> Maybe Text
uploadSequenceToken :: Prelude.Maybe Prelude.Text,
LogStream -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
LogStream -> Maybe Natural
firstEventTimestamp :: Prelude.Maybe Prelude.Natural,
LogStream -> Maybe Text
logStreamName :: Prelude.Maybe Prelude.Text,
LogStream -> Maybe Natural
storedBytes :: Prelude.Maybe Prelude.Natural,
LogStream -> Maybe Natural
lastIngestionTime :: Prelude.Maybe Prelude.Natural,
LogStream -> Maybe Natural
lastEventTimestamp :: Prelude.Maybe Prelude.Natural
}
deriving (LogStream -> LogStream -> Bool
(LogStream -> LogStream -> Bool)
-> (LogStream -> LogStream -> Bool) -> Eq LogStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogStream -> LogStream -> Bool
$c/= :: LogStream -> LogStream -> Bool
== :: LogStream -> LogStream -> Bool
$c== :: LogStream -> LogStream -> Bool
Prelude.Eq, ReadPrec [LogStream]
ReadPrec LogStream
Int -> ReadS LogStream
ReadS [LogStream]
(Int -> ReadS LogStream)
-> ReadS [LogStream]
-> ReadPrec LogStream
-> ReadPrec [LogStream]
-> Read LogStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LogStream]
$creadListPrec :: ReadPrec [LogStream]
readPrec :: ReadPrec LogStream
$creadPrec :: ReadPrec LogStream
readList :: ReadS [LogStream]
$creadList :: ReadS [LogStream]
readsPrec :: Int -> ReadS LogStream
$creadsPrec :: Int -> ReadS LogStream
Prelude.Read, Int -> LogStream -> ShowS
[LogStream] -> ShowS
LogStream -> String
(Int -> LogStream -> ShowS)
-> (LogStream -> String)
-> ([LogStream] -> ShowS)
-> Show LogStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogStream] -> ShowS
$cshowList :: [LogStream] -> ShowS
show :: LogStream -> String
$cshow :: LogStream -> String
showsPrec :: Int -> LogStream -> ShowS
$cshowsPrec :: Int -> LogStream -> ShowS
Prelude.Show, (forall x. LogStream -> Rep LogStream x)
-> (forall x. Rep LogStream x -> LogStream) -> Generic LogStream
forall x. Rep LogStream x -> LogStream
forall x. LogStream -> Rep LogStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LogStream x -> LogStream
$cfrom :: forall x. LogStream -> Rep LogStream x
Prelude.Generic)
newLogStream ::
LogStream
newLogStream :: LogStream
newLogStream =
LogStream' :: Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> LogStream
LogStream'
{ $sel:creationTime:LogStream' :: Maybe Natural
creationTime = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:uploadSequenceToken:LogStream' :: Maybe Text
uploadSequenceToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:LogStream' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:firstEventTimestamp:LogStream' :: Maybe Natural
firstEventTimestamp = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:logStreamName:LogStream' :: Maybe Text
logStreamName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:storedBytes:LogStream' :: Maybe Natural
storedBytes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:lastIngestionTime:LogStream' :: Maybe Natural
lastIngestionTime = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:lastEventTimestamp:LogStream' :: Maybe Natural
lastEventTimestamp = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
logStream_creationTime :: Lens.Lens' LogStream (Prelude.Maybe Prelude.Natural)
logStream_creationTime :: (Maybe Natural -> f (Maybe Natural)) -> LogStream -> f LogStream
logStream_creationTime = (LogStream -> Maybe Natural)
-> (LogStream -> Maybe Natural -> LogStream)
-> Lens LogStream LogStream (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogStream' {Maybe Natural
creationTime :: Maybe Natural
$sel:creationTime:LogStream' :: LogStream -> Maybe Natural
creationTime} -> Maybe Natural
creationTime) (\s :: LogStream
s@LogStream' {} Maybe Natural
a -> LogStream
s {$sel:creationTime:LogStream' :: Maybe Natural
creationTime = Maybe Natural
a} :: LogStream)
logStream_uploadSequenceToken :: Lens.Lens' LogStream (Prelude.Maybe Prelude.Text)
logStream_uploadSequenceToken :: (Maybe Text -> f (Maybe Text)) -> LogStream -> f LogStream
logStream_uploadSequenceToken = (LogStream -> Maybe Text)
-> (LogStream -> Maybe Text -> LogStream)
-> Lens LogStream LogStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogStream' {Maybe Text
uploadSequenceToken :: Maybe Text
$sel:uploadSequenceToken:LogStream' :: LogStream -> Maybe Text
uploadSequenceToken} -> Maybe Text
uploadSequenceToken) (\s :: LogStream
s@LogStream' {} Maybe Text
a -> LogStream
s {$sel:uploadSequenceToken:LogStream' :: Maybe Text
uploadSequenceToken = Maybe Text
a} :: LogStream)
logStream_arn :: Lens.Lens' LogStream (Prelude.Maybe Prelude.Text)
logStream_arn :: (Maybe Text -> f (Maybe Text)) -> LogStream -> f LogStream
logStream_arn = (LogStream -> Maybe Text)
-> (LogStream -> Maybe Text -> LogStream)
-> Lens LogStream LogStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogStream' {Maybe Text
arn :: Maybe Text
$sel:arn:LogStream' :: LogStream -> Maybe Text
arn} -> Maybe Text
arn) (\s :: LogStream
s@LogStream' {} Maybe Text
a -> LogStream
s {$sel:arn:LogStream' :: Maybe Text
arn = Maybe Text
a} :: LogStream)
logStream_firstEventTimestamp :: Lens.Lens' LogStream (Prelude.Maybe Prelude.Natural)
logStream_firstEventTimestamp :: (Maybe Natural -> f (Maybe Natural)) -> LogStream -> f LogStream
logStream_firstEventTimestamp = (LogStream -> Maybe Natural)
-> (LogStream -> Maybe Natural -> LogStream)
-> Lens LogStream LogStream (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogStream' {Maybe Natural
firstEventTimestamp :: Maybe Natural
$sel:firstEventTimestamp:LogStream' :: LogStream -> Maybe Natural
firstEventTimestamp} -> Maybe Natural
firstEventTimestamp) (\s :: LogStream
s@LogStream' {} Maybe Natural
a -> LogStream
s {$sel:firstEventTimestamp:LogStream' :: Maybe Natural
firstEventTimestamp = Maybe Natural
a} :: LogStream)
logStream_logStreamName :: Lens.Lens' LogStream (Prelude.Maybe Prelude.Text)
logStream_logStreamName :: (Maybe Text -> f (Maybe Text)) -> LogStream -> f LogStream
logStream_logStreamName = (LogStream -> Maybe Text)
-> (LogStream -> Maybe Text -> LogStream)
-> Lens LogStream LogStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogStream' {Maybe Text
logStreamName :: Maybe Text
$sel:logStreamName:LogStream' :: LogStream -> Maybe Text
logStreamName} -> Maybe Text
logStreamName) (\s :: LogStream
s@LogStream' {} Maybe Text
a -> LogStream
s {$sel:logStreamName:LogStream' :: Maybe Text
logStreamName = Maybe Text
a} :: LogStream)
logStream_storedBytes :: Lens.Lens' LogStream (Prelude.Maybe Prelude.Natural)
logStream_storedBytes :: (Maybe Natural -> f (Maybe Natural)) -> LogStream -> f LogStream
logStream_storedBytes = (LogStream -> Maybe Natural)
-> (LogStream -> Maybe Natural -> LogStream)
-> Lens LogStream LogStream (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogStream' {Maybe Natural
storedBytes :: Maybe Natural
$sel:storedBytes:LogStream' :: LogStream -> Maybe Natural
storedBytes} -> Maybe Natural
storedBytes) (\s :: LogStream
s@LogStream' {} Maybe Natural
a -> LogStream
s {$sel:storedBytes:LogStream' :: Maybe Natural
storedBytes = Maybe Natural
a} :: LogStream)
logStream_lastIngestionTime :: Lens.Lens' LogStream (Prelude.Maybe Prelude.Natural)
logStream_lastIngestionTime :: (Maybe Natural -> f (Maybe Natural)) -> LogStream -> f LogStream
logStream_lastIngestionTime = (LogStream -> Maybe Natural)
-> (LogStream -> Maybe Natural -> LogStream)
-> Lens LogStream LogStream (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogStream' {Maybe Natural
lastIngestionTime :: Maybe Natural
$sel:lastIngestionTime:LogStream' :: LogStream -> Maybe Natural
lastIngestionTime} -> Maybe Natural
lastIngestionTime) (\s :: LogStream
s@LogStream' {} Maybe Natural
a -> LogStream
s {$sel:lastIngestionTime:LogStream' :: Maybe Natural
lastIngestionTime = Maybe Natural
a} :: LogStream)
logStream_lastEventTimestamp :: Lens.Lens' LogStream (Prelude.Maybe Prelude.Natural)
logStream_lastEventTimestamp :: (Maybe Natural -> f (Maybe Natural)) -> LogStream -> f LogStream
logStream_lastEventTimestamp = (LogStream -> Maybe Natural)
-> (LogStream -> Maybe Natural -> LogStream)
-> Lens LogStream LogStream (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogStream' {Maybe Natural
lastEventTimestamp :: Maybe Natural
$sel:lastEventTimestamp:LogStream' :: LogStream -> Maybe Natural
lastEventTimestamp} -> Maybe Natural
lastEventTimestamp) (\s :: LogStream
s@LogStream' {} Maybe Natural
a -> LogStream
s {$sel:lastEventTimestamp:LogStream' :: Maybe Natural
lastEventTimestamp = Maybe Natural
a} :: LogStream)
instance Core.FromJSON LogStream where
parseJSON :: Value -> Parser LogStream
parseJSON =
String -> (Object -> Parser LogStream) -> Value -> Parser LogStream
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LogStream"
( \Object
x ->
Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> LogStream
LogStream'
(Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> LogStream)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> LogStream)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> LogStream)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> LogStream)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"uploadSequenceToken")
Parser
(Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> LogStream)
-> Parser (Maybe Text)
-> Parser
(Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> LogStream)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
Parser
(Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> LogStream)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text
-> Maybe Natural -> Maybe Natural -> Maybe Natural -> LogStream)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"firstEventTimestamp")
Parser
(Maybe Text
-> Maybe Natural -> Maybe Natural -> Maybe Natural -> LogStream)
-> Parser (Maybe Text)
-> Parser
(Maybe Natural -> Maybe Natural -> Maybe Natural -> LogStream)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"logStreamName")
Parser
(Maybe Natural -> Maybe Natural -> Maybe Natural -> LogStream)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> Maybe Natural -> LogStream)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"storedBytes")
Parser (Maybe Natural -> Maybe Natural -> LogStream)
-> Parser (Maybe Natural) -> Parser (Maybe Natural -> LogStream)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastIngestionTime")
Parser (Maybe Natural -> LogStream)
-> Parser (Maybe Natural) -> Parser LogStream
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastEventTimestamp")
)
instance Prelude.Hashable LogStream
instance Prelude.NFData LogStream