module Network.Google.Logging.Types.Product where
import Network.Google.Logging.Types.Sum
import Network.Google.Prelude
data RequestLog = RequestLog
{ _rlTraceId :: !(Maybe Text)
, _rlInstanceId :: !(Maybe (Textual Word8))
, _rlStatus :: !(Maybe (Textual Int32))
, _rlRequestId :: !(Maybe (Textual Word8))
, _rlInstanceIndex :: !(Maybe (Textual Int32))
, _rlModuleId :: !(Maybe Text)
, _rlVersionId :: !(Maybe Text)
, _rlHTTPVersion :: !(Maybe Text)
, _rlTaskName :: !(Maybe Text)
, _rlPendingTime :: !(Maybe Text)
, _rlWasLoadingRequest :: !(Maybe Bool)
, _rlStartTime :: !(Maybe Text)
, _rlLatency :: !(Maybe Text)
, _rlURLMapEntry :: !(Maybe Text)
, _rlCost :: !(Maybe (Textual Double))
, _rlReferrer :: !(Maybe Text)
, _rlLine :: !(Maybe [LogLine])
, _rlIP :: !(Maybe Text)
, _rlAppId :: !(Maybe Text)
, _rlMethod :: !(Maybe Text)
, _rlResource :: !(Maybe Text)
, _rlEndTime :: !(Maybe Text)
, _rlFinished :: !(Maybe Bool)
, _rlMegaCycles :: !(Maybe (Textual Int64))
, _rlUserAgent :: !(Maybe Text)
, _rlNickname :: !(Maybe Text)
, _rlHost :: !(Maybe Text)
, _rlTaskQueueName :: !(Maybe Text)
, _rlResponseSize :: !(Maybe (Textual Int64))
, _rlSourceReference :: !(Maybe [SourceReference])
, _rlAppEngineRelease :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
requestLog
:: RequestLog
requestLog =
RequestLog
{ _rlTraceId = Nothing
, _rlInstanceId = Nothing
, _rlStatus = Nothing
, _rlRequestId = Nothing
, _rlInstanceIndex = Nothing
, _rlModuleId = Nothing
, _rlVersionId = Nothing
, _rlHTTPVersion = Nothing
, _rlTaskName = Nothing
, _rlPendingTime = Nothing
, _rlWasLoadingRequest = Nothing
, _rlStartTime = Nothing
, _rlLatency = Nothing
, _rlURLMapEntry = Nothing
, _rlCost = Nothing
, _rlReferrer = Nothing
, _rlLine = Nothing
, _rlIP = Nothing
, _rlAppId = Nothing
, _rlMethod = Nothing
, _rlResource = Nothing
, _rlEndTime = Nothing
, _rlFinished = Nothing
, _rlMegaCycles = Nothing
, _rlUserAgent = Nothing
, _rlNickname = Nothing
, _rlHost = Nothing
, _rlTaskQueueName = Nothing
, _rlResponseSize = Nothing
, _rlSourceReference = Nothing
, _rlAppEngineRelease = Nothing
}
rlTraceId :: Lens' RequestLog (Maybe Text)
rlTraceId
= lens _rlTraceId (\ s a -> s{_rlTraceId = a})
rlInstanceId :: Lens' RequestLog (Maybe Word8)
rlInstanceId
= lens _rlInstanceId (\ s a -> s{_rlInstanceId = a})
. mapping _Coerce
rlStatus :: Lens' RequestLog (Maybe Int32)
rlStatus
= lens _rlStatus (\ s a -> s{_rlStatus = a}) .
mapping _Coerce
rlRequestId :: Lens' RequestLog (Maybe Word8)
rlRequestId
= lens _rlRequestId (\ s a -> s{_rlRequestId = a}) .
mapping _Coerce
rlInstanceIndex :: Lens' RequestLog (Maybe Int32)
rlInstanceIndex
= lens _rlInstanceIndex
(\ s a -> s{_rlInstanceIndex = a})
. mapping _Coerce
rlModuleId :: Lens' RequestLog (Maybe Text)
rlModuleId
= lens _rlModuleId (\ s a -> s{_rlModuleId = a})
rlVersionId :: Lens' RequestLog (Maybe Text)
rlVersionId
= lens _rlVersionId (\ s a -> s{_rlVersionId = a})
rlHTTPVersion :: Lens' RequestLog (Maybe Text)
rlHTTPVersion
= lens _rlHTTPVersion
(\ s a -> s{_rlHTTPVersion = a})
rlTaskName :: Lens' RequestLog (Maybe Text)
rlTaskName
= lens _rlTaskName (\ s a -> s{_rlTaskName = a})
rlPendingTime :: Lens' RequestLog (Maybe Text)
rlPendingTime
= lens _rlPendingTime
(\ s a -> s{_rlPendingTime = a})
rlWasLoadingRequest :: Lens' RequestLog (Maybe Bool)
rlWasLoadingRequest
= lens _rlWasLoadingRequest
(\ s a -> s{_rlWasLoadingRequest = a})
rlStartTime :: Lens' RequestLog (Maybe Text)
rlStartTime
= lens _rlStartTime (\ s a -> s{_rlStartTime = a})
rlLatency :: Lens' RequestLog (Maybe Text)
rlLatency
= lens _rlLatency (\ s a -> s{_rlLatency = a})
rlURLMapEntry :: Lens' RequestLog (Maybe Text)
rlURLMapEntry
= lens _rlURLMapEntry
(\ s a -> s{_rlURLMapEntry = a})
rlCost :: Lens' RequestLog (Maybe Double)
rlCost
= lens _rlCost (\ s a -> s{_rlCost = a}) .
mapping _Coerce
rlReferrer :: Lens' RequestLog (Maybe Text)
rlReferrer
= lens _rlReferrer (\ s a -> s{_rlReferrer = a})
rlLine :: Lens' RequestLog [LogLine]
rlLine
= lens _rlLine (\ s a -> s{_rlLine = a}) . _Default .
_Coerce
rlIP :: Lens' RequestLog (Maybe Text)
rlIP = lens _rlIP (\ s a -> s{_rlIP = a})
rlAppId :: Lens' RequestLog (Maybe Text)
rlAppId = lens _rlAppId (\ s a -> s{_rlAppId = a})
rlMethod :: Lens' RequestLog (Maybe Text)
rlMethod = lens _rlMethod (\ s a -> s{_rlMethod = a})
rlResource :: Lens' RequestLog (Maybe Text)
rlResource
= lens _rlResource (\ s a -> s{_rlResource = a})
rlEndTime :: Lens' RequestLog (Maybe Text)
rlEndTime
= lens _rlEndTime (\ s a -> s{_rlEndTime = a})
rlFinished :: Lens' RequestLog (Maybe Bool)
rlFinished
= lens _rlFinished (\ s a -> s{_rlFinished = a})
rlMegaCycles :: Lens' RequestLog (Maybe Int64)
rlMegaCycles
= lens _rlMegaCycles (\ s a -> s{_rlMegaCycles = a})
. mapping _Coerce
rlUserAgent :: Lens' RequestLog (Maybe Text)
rlUserAgent
= lens _rlUserAgent (\ s a -> s{_rlUserAgent = a})
rlNickname :: Lens' RequestLog (Maybe Text)
rlNickname
= lens _rlNickname (\ s a -> s{_rlNickname = a})
rlHost :: Lens' RequestLog (Maybe Text)
rlHost = lens _rlHost (\ s a -> s{_rlHost = a})
rlTaskQueueName :: Lens' RequestLog (Maybe Text)
rlTaskQueueName
= lens _rlTaskQueueName
(\ s a -> s{_rlTaskQueueName = a})
rlResponseSize :: Lens' RequestLog (Maybe Int64)
rlResponseSize
= lens _rlResponseSize
(\ s a -> s{_rlResponseSize = a})
. mapping _Coerce
rlSourceReference :: Lens' RequestLog [SourceReference]
rlSourceReference
= lens _rlSourceReference
(\ s a -> s{_rlSourceReference = a})
. _Default
. _Coerce
rlAppEngineRelease :: Lens' RequestLog (Maybe Text)
rlAppEngineRelease
= lens _rlAppEngineRelease
(\ s a -> s{_rlAppEngineRelease = a})
instance FromJSON RequestLog where
parseJSON
= withObject "RequestLog"
(\ o ->
RequestLog <$>
(o .:? "traceId") <*> (o .:? "instanceId") <*>
(o .:? "status")
<*> (o .:? "requestId")
<*> (o .:? "instanceIndex")
<*> (o .:? "moduleId")
<*> (o .:? "versionId")
<*> (o .:? "httpVersion")
<*> (o .:? "taskName")
<*> (o .:? "pendingTime")
<*> (o .:? "wasLoadingRequest")
<*> (o .:? "startTime")
<*> (o .:? "latency")
<*> (o .:? "urlMapEntry")
<*> (o .:? "cost")
<*> (o .:? "referrer")
<*> (o .:? "line" .!= mempty)
<*> (o .:? "ip")
<*> (o .:? "appId")
<*> (o .:? "method")
<*> (o .:? "resource")
<*> (o .:? "endTime")
<*> (o .:? "finished")
<*> (o .:? "megaCycles")
<*> (o .:? "userAgent")
<*> (o .:? "nickname")
<*> (o .:? "host")
<*> (o .:? "taskQueueName")
<*> (o .:? "responseSize")
<*> (o .:? "sourceReference" .!= mempty)
<*> (o .:? "appEngineRelease"))
instance ToJSON RequestLog where
toJSON RequestLog{..}
= object
(catMaybes
[("traceId" .=) <$> _rlTraceId,
("instanceId" .=) <$> _rlInstanceId,
("status" .=) <$> _rlStatus,
("requestId" .=) <$> _rlRequestId,
("instanceIndex" .=) <$> _rlInstanceIndex,
("moduleId" .=) <$> _rlModuleId,
("versionId" .=) <$> _rlVersionId,
("httpVersion" .=) <$> _rlHTTPVersion,
("taskName" .=) <$> _rlTaskName,
("pendingTime" .=) <$> _rlPendingTime,
("wasLoadingRequest" .=) <$> _rlWasLoadingRequest,
("startTime" .=) <$> _rlStartTime,
("latency" .=) <$> _rlLatency,
("urlMapEntry" .=) <$> _rlURLMapEntry,
("cost" .=) <$> _rlCost,
("referrer" .=) <$> _rlReferrer,
("line" .=) <$> _rlLine, ("ip" .=) <$> _rlIP,
("appId" .=) <$> _rlAppId,
("method" .=) <$> _rlMethod,
("resource" .=) <$> _rlResource,
("endTime" .=) <$> _rlEndTime,
("finished" .=) <$> _rlFinished,
("megaCycles" .=) <$> _rlMegaCycles,
("userAgent" .=) <$> _rlUserAgent,
("nickname" .=) <$> _rlNickname,
("host" .=) <$> _rlHost,
("taskQueueName" .=) <$> _rlTaskQueueName,
("responseSize" .=) <$> _rlResponseSize,
("sourceReference" .=) <$> _rlSourceReference,
("appEngineRelease" .=) <$> _rlAppEngineRelease])
data LogLine = LogLine
{ _llTime :: !(Maybe Text)
, _llSeverity :: !(Maybe Text)
, _llLogMessage :: !(Maybe Text)
, _llSourceLocation :: !(Maybe SourceLocation)
} deriving (Eq,Show,Data,Typeable,Generic)
logLine
:: LogLine
logLine =
LogLine
{ _llTime = Nothing
, _llSeverity = Nothing
, _llLogMessage = Nothing
, _llSourceLocation = Nothing
}
llTime :: Lens' LogLine (Maybe Text)
llTime = lens _llTime (\ s a -> s{_llTime = a})
llSeverity :: Lens' LogLine (Maybe Text)
llSeverity
= lens _llSeverity (\ s a -> s{_llSeverity = a})
llLogMessage :: Lens' LogLine (Maybe Text)
llLogMessage
= lens _llLogMessage (\ s a -> s{_llLogMessage = a})
llSourceLocation :: Lens' LogLine (Maybe SourceLocation)
llSourceLocation
= lens _llSourceLocation
(\ s a -> s{_llSourceLocation = a})
instance FromJSON LogLine where
parseJSON
= withObject "LogLine"
(\ o ->
LogLine <$>
(o .:? "time") <*> (o .:? "severity") <*>
(o .:? "logMessage")
<*> (o .:? "sourceLocation"))
instance ToJSON LogLine where
toJSON LogLine{..}
= object
(catMaybes
[("time" .=) <$> _llTime,
("severity" .=) <$> _llSeverity,
("logMessage" .=) <$> _llLogMessage,
("sourceLocation" .=) <$> _llSourceLocation])
data SourceLocation = SourceLocation
{ _slLine :: !(Maybe (Textual Int64))
, _slFunctionName :: !(Maybe Text)
, _slFile :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
sourceLocation
:: SourceLocation
sourceLocation =
SourceLocation
{ _slLine = Nothing
, _slFunctionName = Nothing
, _slFile = Nothing
}
slLine :: Lens' SourceLocation (Maybe Int64)
slLine
= lens _slLine (\ s a -> s{_slLine = a}) .
mapping _Coerce
slFunctionName :: Lens' SourceLocation (Maybe Text)
slFunctionName
= lens _slFunctionName
(\ s a -> s{_slFunctionName = a})
slFile :: Lens' SourceLocation (Maybe Text)
slFile = lens _slFile (\ s a -> s{_slFile = a})
instance FromJSON SourceLocation where
parseJSON
= withObject "SourceLocation"
(\ o ->
SourceLocation <$>
(o .:? "line") <*> (o .:? "functionName") <*>
(o .:? "file"))
instance ToJSON SourceLocation where
toJSON SourceLocation{..}
= object
(catMaybes
[("line" .=) <$> _slLine,
("functionName" .=) <$> _slFunctionName,
("file" .=) <$> _slFile])
data SourceReference = SourceReference
{ _srRepository :: !(Maybe Text)
, _srRevisionId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
sourceReference
:: SourceReference
sourceReference =
SourceReference
{ _srRepository = Nothing
, _srRevisionId = Nothing
}
srRepository :: Lens' SourceReference (Maybe Text)
srRepository
= lens _srRepository (\ s a -> s{_srRepository = a})
srRevisionId :: Lens' SourceReference (Maybe Text)
srRevisionId
= lens _srRevisionId (\ s a -> s{_srRevisionId = a})
instance FromJSON SourceReference where
parseJSON
= withObject "SourceReference"
(\ o ->
SourceReference <$>
(o .:? "repository") <*> (o .:? "revisionId"))
instance ToJSON SourceReference where
toJSON SourceReference{..}
= object
(catMaybes
[("repository" .=) <$> _srRepository,
("revisionId" .=) <$> _srRevisionId])