{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Logging.Types.Product where
import Network.Google.Logging.Types.Sum
import Network.Google.Prelude
data MonitoredResourceDescriptor = MonitoredResourceDescriptor'
{ _mrdName :: !(Maybe Text)
, _mrdDisplayName :: !(Maybe Text)
, _mrdLabels :: !(Maybe [LabelDescriptor])
, _mrdType :: !(Maybe Text)
, _mrdDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
monitoredResourceDescriptor
:: MonitoredResourceDescriptor
monitoredResourceDescriptor =
MonitoredResourceDescriptor'
{ _mrdName = Nothing
, _mrdDisplayName = Nothing
, _mrdLabels = Nothing
, _mrdType = Nothing
, _mrdDescription = Nothing
}
mrdName :: Lens' MonitoredResourceDescriptor (Maybe Text)
mrdName = lens _mrdName (\ s a -> s{_mrdName = a})
mrdDisplayName :: Lens' MonitoredResourceDescriptor (Maybe Text)
mrdDisplayName
= lens _mrdDisplayName
(\ s a -> s{_mrdDisplayName = a})
mrdLabels :: Lens' MonitoredResourceDescriptor [LabelDescriptor]
mrdLabels
= lens _mrdLabels (\ s a -> s{_mrdLabels = a}) .
_Default
. _Coerce
mrdType :: Lens' MonitoredResourceDescriptor (Maybe Text)
mrdType = lens _mrdType (\ s a -> s{_mrdType = a})
mrdDescription :: Lens' MonitoredResourceDescriptor (Maybe Text)
mrdDescription
= lens _mrdDescription
(\ s a -> s{_mrdDescription = a})
instance FromJSON MonitoredResourceDescriptor where
parseJSON
= withObject "MonitoredResourceDescriptor"
(\ o ->
MonitoredResourceDescriptor' <$>
(o .:? "name") <*> (o .:? "displayName") <*>
(o .:? "labels" .!= mempty)
<*> (o .:? "type")
<*> (o .:? "description"))
instance ToJSON MonitoredResourceDescriptor where
toJSON MonitoredResourceDescriptor'{..}
= object
(catMaybes
[("name" .=) <$> _mrdName,
("displayName" .=) <$> _mrdDisplayName,
("labels" .=) <$> _mrdLabels,
("type" .=) <$> _mrdType,
("description" .=) <$> _mrdDescription])
data ListLogEntriesResponse = ListLogEntriesResponse'
{ _llerNextPageToken :: !(Maybe Text)
, _llerEntries :: !(Maybe [LogEntry])
} deriving (Eq,Show,Data,Typeable,Generic)
listLogEntriesResponse
:: ListLogEntriesResponse
listLogEntriesResponse =
ListLogEntriesResponse'
{ _llerNextPageToken = Nothing
, _llerEntries = Nothing
}
llerNextPageToken :: Lens' ListLogEntriesResponse (Maybe Text)
llerNextPageToken
= lens _llerNextPageToken
(\ s a -> s{_llerNextPageToken = a})
llerEntries :: Lens' ListLogEntriesResponse [LogEntry]
llerEntries
= lens _llerEntries (\ s a -> s{_llerEntries = a}) .
_Default
. _Coerce
instance FromJSON ListLogEntriesResponse where
parseJSON
= withObject "ListLogEntriesResponse"
(\ o ->
ListLogEntriesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "entries" .!= mempty))
instance ToJSON ListLogEntriesResponse where
toJSON ListLogEntriesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _llerNextPageToken,
("entries" .=) <$> _llerEntries])
newtype MonitoredResourceLabels = MonitoredResourceLabels'
{ _mrlAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
monitoredResourceLabels
:: HashMap Text Text
-> MonitoredResourceLabels
monitoredResourceLabels pMrlAddtional_ =
MonitoredResourceLabels'
{ _mrlAddtional = _Coerce # pMrlAddtional_
}
mrlAddtional :: Lens' MonitoredResourceLabels (HashMap Text Text)
mrlAddtional
= lens _mrlAddtional (\ s a -> s{_mrlAddtional = a})
. _Coerce
instance FromJSON MonitoredResourceLabels where
parseJSON
= withObject "MonitoredResourceLabels"
(\ o ->
MonitoredResourceLabels' <$> (parseJSONObject o))
instance ToJSON MonitoredResourceLabels where
toJSON = toJSON . _mrlAddtional
data ListLogMetricsResponse = ListLogMetricsResponse'
{ _llmrMetrics :: !(Maybe [LogMetric])
, _llmrNextPageToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
listLogMetricsResponse
:: ListLogMetricsResponse
listLogMetricsResponse =
ListLogMetricsResponse'
{ _llmrMetrics = Nothing
, _llmrNextPageToken = Nothing
}
llmrMetrics :: Lens' ListLogMetricsResponse [LogMetric]
llmrMetrics
= lens _llmrMetrics (\ s a -> s{_llmrMetrics = a}) .
_Default
. _Coerce
llmrNextPageToken :: Lens' ListLogMetricsResponse (Maybe Text)
llmrNextPageToken
= lens _llmrNextPageToken
(\ s a -> s{_llmrNextPageToken = a})
instance FromJSON ListLogMetricsResponse where
parseJSON
= withObject "ListLogMetricsResponse"
(\ o ->
ListLogMetricsResponse' <$>
(o .:? "metrics" .!= mempty) <*>
(o .:? "nextPageToken"))
instance ToJSON ListLogMetricsResponse where
toJSON ListLogMetricsResponse'{..}
= object
(catMaybes
[("metrics" .=) <$> _llmrMetrics,
("nextPageToken" .=) <$> _llmrNextPageToken])
data WriteLogEntriesRequest = WriteLogEntriesRequest'
{ _wlerEntries :: !(Maybe [LogEntry])
, _wlerPartialSuccess :: !(Maybe Bool)
, _wlerResource :: !(Maybe MonitoredResource)
, _wlerLabels :: !(Maybe WriteLogEntriesRequestLabels)
, _wlerLogName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
writeLogEntriesRequest
:: WriteLogEntriesRequest
writeLogEntriesRequest =
WriteLogEntriesRequest'
{ _wlerEntries = Nothing
, _wlerPartialSuccess = Nothing
, _wlerResource = Nothing
, _wlerLabels = Nothing
, _wlerLogName = Nothing
}
wlerEntries :: Lens' WriteLogEntriesRequest [LogEntry]
wlerEntries
= lens _wlerEntries (\ s a -> s{_wlerEntries = a}) .
_Default
. _Coerce
wlerPartialSuccess :: Lens' WriteLogEntriesRequest (Maybe Bool)
wlerPartialSuccess
= lens _wlerPartialSuccess
(\ s a -> s{_wlerPartialSuccess = a})
wlerResource :: Lens' WriteLogEntriesRequest (Maybe MonitoredResource)
wlerResource
= lens _wlerResource (\ s a -> s{_wlerResource = a})
wlerLabels :: Lens' WriteLogEntriesRequest (Maybe WriteLogEntriesRequestLabels)
wlerLabels
= lens _wlerLabels (\ s a -> s{_wlerLabels = a})
wlerLogName :: Lens' WriteLogEntriesRequest (Maybe Text)
wlerLogName
= lens _wlerLogName (\ s a -> s{_wlerLogName = a})
instance FromJSON WriteLogEntriesRequest where
parseJSON
= withObject "WriteLogEntriesRequest"
(\ o ->
WriteLogEntriesRequest' <$>
(o .:? "entries" .!= mempty) <*>
(o .:? "partialSuccess")
<*> (o .:? "resource")
<*> (o .:? "labels")
<*> (o .:? "logName"))
instance ToJSON WriteLogEntriesRequest where
toJSON WriteLogEntriesRequest'{..}
= object
(catMaybes
[("entries" .=) <$> _wlerEntries,
("partialSuccess" .=) <$> _wlerPartialSuccess,
("resource" .=) <$> _wlerResource,
("labels" .=) <$> _wlerLabels,
("logName" .=) <$> _wlerLogName])
data Empty =
Empty'
deriving (Eq,Show,Data,Typeable,Generic)
empty
:: Empty
empty = Empty'
instance FromJSON Empty where
parseJSON = withObject "Empty" (\ o -> pure Empty')
instance ToJSON Empty where
toJSON = const emptyObject
newtype LogEntryLabels = LogEntryLabels'
{ _lelAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
logEntryLabels
:: HashMap Text Text
-> LogEntryLabels
logEntryLabels pLelAddtional_ =
LogEntryLabels'
{ _lelAddtional = _Coerce # pLelAddtional_
}
lelAddtional :: Lens' LogEntryLabels (HashMap Text Text)
lelAddtional
= lens _lelAddtional (\ s a -> s{_lelAddtional = a})
. _Coerce
instance FromJSON LogEntryLabels where
parseJSON
= withObject "LogEntryLabels"
(\ o -> LogEntryLabels' <$> (parseJSONObject o))
instance ToJSON LogEntryLabels where
toJSON = toJSON . _lelAddtional
data ListSinksResponse = ListSinksResponse'
{ _lsrSinks :: !(Maybe [LogSink])
, _lsrNextPageToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
listSinksResponse
:: ListSinksResponse
listSinksResponse =
ListSinksResponse'
{ _lsrSinks = Nothing
, _lsrNextPageToken = Nothing
}
lsrSinks :: Lens' ListSinksResponse [LogSink]
lsrSinks
= lens _lsrSinks (\ s a -> s{_lsrSinks = a}) .
_Default
. _Coerce
lsrNextPageToken :: Lens' ListSinksResponse (Maybe Text)
lsrNextPageToken
= lens _lsrNextPageToken
(\ s a -> s{_lsrNextPageToken = a})
instance FromJSON ListSinksResponse where
parseJSON
= withObject "ListSinksResponse"
(\ o ->
ListSinksResponse' <$>
(o .:? "sinks" .!= mempty) <*>
(o .:? "nextPageToken"))
instance ToJSON ListSinksResponse where
toJSON ListSinksResponse'{..}
= object
(catMaybes
[("sinks" .=) <$> _lsrSinks,
("nextPageToken" .=) <$> _lsrNextPageToken])
data RequestLog = RequestLog'
{ _rlTraceId :: !(Maybe Text)
, _rlInstanceId :: !(Maybe Text)
, _rlStatus :: !(Maybe (Textual Int32))
, _rlRequestId :: !(Maybe Text)
, _rlInstanceIndex :: !(Maybe (Textual Int32))
, _rlModuleId :: !(Maybe Text)
, _rlVersionId :: !(Maybe Text)
, _rlHTTPVersion :: !(Maybe Text)
, _rlTaskName :: !(Maybe Text)
, _rlPendingTime :: !(Maybe Duration)
, _rlWasLoadingRequest :: !(Maybe Bool)
, _rlFirst :: !(Maybe Bool)
, _rlStartTime :: !(Maybe DateTime')
, _rlLatency :: !(Maybe Duration)
, _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 DateTime')
, _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
, _rlFirst = 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 Text)
rlInstanceId
= lens _rlInstanceId (\ s a -> s{_rlInstanceId = a})
rlStatus :: Lens' RequestLog (Maybe Int32)
rlStatus
= lens _rlStatus (\ s a -> s{_rlStatus = a}) .
mapping _Coerce
rlRequestId :: Lens' RequestLog (Maybe Text)
rlRequestId
= lens _rlRequestId (\ s a -> s{_rlRequestId = a})
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 Scientific)
rlPendingTime
= lens _rlPendingTime
(\ s a -> s{_rlPendingTime = a})
. mapping _Duration
rlWasLoadingRequest :: Lens' RequestLog (Maybe Bool)
rlWasLoadingRequest
= lens _rlWasLoadingRequest
(\ s a -> s{_rlWasLoadingRequest = a})
rlFirst :: Lens' RequestLog (Maybe Bool)
rlFirst = lens _rlFirst (\ s a -> s{_rlFirst = a})
rlStartTime :: Lens' RequestLog (Maybe UTCTime)
rlStartTime
= lens _rlStartTime (\ s a -> s{_rlStartTime = a}) .
mapping _DateTime
rlLatency :: Lens' RequestLog (Maybe Scientific)
rlLatency
= lens _rlLatency (\ s a -> s{_rlLatency = a}) .
mapping _Duration
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 UTCTime)
rlEndTime
= lens _rlEndTime (\ s a -> s{_rlEndTime = a}) .
mapping _DateTime
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 .:? "first")
<*> (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,
("first" .=) <$> _rlFirst,
("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])
newtype LogEntryProtoPayload = LogEntryProtoPayload'
{ _leppAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
logEntryProtoPayload
:: HashMap Text JSONValue
-> LogEntryProtoPayload
logEntryProtoPayload pLeppAddtional_ =
LogEntryProtoPayload'
{ _leppAddtional = _Coerce # pLeppAddtional_
}
leppAddtional :: Lens' LogEntryProtoPayload (HashMap Text JSONValue)
leppAddtional
= lens _leppAddtional
(\ s a -> s{_leppAddtional = a})
. _Coerce
instance FromJSON LogEntryProtoPayload where
parseJSON
= withObject "LogEntryProtoPayload"
(\ o ->
LogEntryProtoPayload' <$> (parseJSONObject o))
instance ToJSON LogEntryProtoPayload where
toJSON = toJSON . _leppAddtional
data WriteLogEntriesResponse =
WriteLogEntriesResponse'
deriving (Eq,Show,Data,Typeable,Generic)
writeLogEntriesResponse
:: WriteLogEntriesResponse
writeLogEntriesResponse = WriteLogEntriesResponse'
instance FromJSON WriteLogEntriesResponse where
parseJSON
= withObject "WriteLogEntriesResponse"
(\ o -> pure WriteLogEntriesResponse')
instance ToJSON WriteLogEntriesResponse where
toJSON = const emptyObject
data LogSink = LogSink'
{ _lsDestination :: !(Maybe Text)
, _lsStartTime :: !(Maybe DateTime')
, _lsOutputVersionFormat :: !(Maybe LogSinkOutputVersionFormat)
, _lsWriterIdentity :: !(Maybe Text)
, _lsName :: !(Maybe Text)
, _lsEndTime :: !(Maybe DateTime')
, _lsFilter :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
logSink
:: LogSink
logSink =
LogSink'
{ _lsDestination = Nothing
, _lsStartTime = Nothing
, _lsOutputVersionFormat = Nothing
, _lsWriterIdentity = Nothing
, _lsName = Nothing
, _lsEndTime = Nothing
, _lsFilter = Nothing
}
lsDestination :: Lens' LogSink (Maybe Text)
lsDestination
= lens _lsDestination
(\ s a -> s{_lsDestination = a})
lsStartTime :: Lens' LogSink (Maybe UTCTime)
lsStartTime
= lens _lsStartTime (\ s a -> s{_lsStartTime = a}) .
mapping _DateTime
lsOutputVersionFormat :: Lens' LogSink (Maybe LogSinkOutputVersionFormat)
lsOutputVersionFormat
= lens _lsOutputVersionFormat
(\ s a -> s{_lsOutputVersionFormat = a})
lsWriterIdentity :: Lens' LogSink (Maybe Text)
lsWriterIdentity
= lens _lsWriterIdentity
(\ s a -> s{_lsWriterIdentity = a})
lsName :: Lens' LogSink (Maybe Text)
lsName = lens _lsName (\ s a -> s{_lsName = a})
lsEndTime :: Lens' LogSink (Maybe UTCTime)
lsEndTime
= lens _lsEndTime (\ s a -> s{_lsEndTime = a}) .
mapping _DateTime
lsFilter :: Lens' LogSink (Maybe Text)
lsFilter = lens _lsFilter (\ s a -> s{_lsFilter = a})
instance FromJSON LogSink where
parseJSON
= withObject "LogSink"
(\ o ->
LogSink' <$>
(o .:? "destination") <*> (o .:? "startTime") <*>
(o .:? "outputVersionFormat")
<*> (o .:? "writerIdentity")
<*> (o .:? "name")
<*> (o .:? "endTime")
<*> (o .:? "filter"))
instance ToJSON LogSink where
toJSON LogSink'{..}
= object
(catMaybes
[("destination" .=) <$> _lsDestination,
("startTime" .=) <$> _lsStartTime,
("outputVersionFormat" .=) <$>
_lsOutputVersionFormat,
("writerIdentity" .=) <$> _lsWriterIdentity,
("name" .=) <$> _lsName,
("endTime" .=) <$> _lsEndTime,
("filter" .=) <$> _lsFilter])
data ListMonitoredResourceDescriptorsResponse = ListMonitoredResourceDescriptorsResponse'
{ _lmrdrNextPageToken :: !(Maybe Text)
, _lmrdrResourceDescriptors :: !(Maybe [MonitoredResourceDescriptor])
} deriving (Eq,Show,Data,Typeable,Generic)
listMonitoredResourceDescriptorsResponse
:: ListMonitoredResourceDescriptorsResponse
listMonitoredResourceDescriptorsResponse =
ListMonitoredResourceDescriptorsResponse'
{ _lmrdrNextPageToken = Nothing
, _lmrdrResourceDescriptors = Nothing
}
lmrdrNextPageToken :: Lens' ListMonitoredResourceDescriptorsResponse (Maybe Text)
lmrdrNextPageToken
= lens _lmrdrNextPageToken
(\ s a -> s{_lmrdrNextPageToken = a})
lmrdrResourceDescriptors :: Lens' ListMonitoredResourceDescriptorsResponse [MonitoredResourceDescriptor]
lmrdrResourceDescriptors
= lens _lmrdrResourceDescriptors
(\ s a -> s{_lmrdrResourceDescriptors = a})
. _Default
. _Coerce
instance FromJSON
ListMonitoredResourceDescriptorsResponse where
parseJSON
= withObject
"ListMonitoredResourceDescriptorsResponse"
(\ o ->
ListMonitoredResourceDescriptorsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "resourceDescriptors" .!= mempty))
instance ToJSON
ListMonitoredResourceDescriptorsResponse where
toJSON ListMonitoredResourceDescriptorsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lmrdrNextPageToken,
("resourceDescriptors" .=) <$>
_lmrdrResourceDescriptors])
data HTTPRequest = HTTPRequest'
{ _httprStatus :: !(Maybe (Textual Int32))
, _httprRequestURL :: !(Maybe Text)
, _httprCacheFillBytes :: !(Maybe (Textual Int64))
, _httprRemoteIP :: !(Maybe Text)
, _httprLatency :: !(Maybe Duration)
, _httprServerIP :: !(Maybe Text)
, _httprRequestSize :: !(Maybe (Textual Int64))
, _httprCacheValidatedWithOriginServer :: !(Maybe Bool)
, _httprUserAgent :: !(Maybe Text)
, _httprCacheLookup :: !(Maybe Bool)
, _httprResponseSize :: !(Maybe (Textual Int64))
, _httprRequestMethod :: !(Maybe Text)
, _httprCacheHit :: !(Maybe Bool)
, _httprReferer :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
hTTPRequest
:: HTTPRequest
hTTPRequest =
HTTPRequest'
{ _httprStatus = Nothing
, _httprRequestURL = Nothing
, _httprCacheFillBytes = Nothing
, _httprRemoteIP = Nothing
, _httprLatency = Nothing
, _httprServerIP = Nothing
, _httprRequestSize = Nothing
, _httprCacheValidatedWithOriginServer = Nothing
, _httprUserAgent = Nothing
, _httprCacheLookup = Nothing
, _httprResponseSize = Nothing
, _httprRequestMethod = Nothing
, _httprCacheHit = Nothing
, _httprReferer = Nothing
}
httprStatus :: Lens' HTTPRequest (Maybe Int32)
httprStatus
= lens _httprStatus (\ s a -> s{_httprStatus = a}) .
mapping _Coerce
httprRequestURL :: Lens' HTTPRequest (Maybe Text)
httprRequestURL
= lens _httprRequestURL
(\ s a -> s{_httprRequestURL = a})
httprCacheFillBytes :: Lens' HTTPRequest (Maybe Int64)
httprCacheFillBytes
= lens _httprCacheFillBytes
(\ s a -> s{_httprCacheFillBytes = a})
. mapping _Coerce
httprRemoteIP :: Lens' HTTPRequest (Maybe Text)
httprRemoteIP
= lens _httprRemoteIP
(\ s a -> s{_httprRemoteIP = a})
httprLatency :: Lens' HTTPRequest (Maybe Scientific)
httprLatency
= lens _httprLatency (\ s a -> s{_httprLatency = a})
. mapping _Duration
httprServerIP :: Lens' HTTPRequest (Maybe Text)
httprServerIP
= lens _httprServerIP
(\ s a -> s{_httprServerIP = a})
httprRequestSize :: Lens' HTTPRequest (Maybe Int64)
httprRequestSize
= lens _httprRequestSize
(\ s a -> s{_httprRequestSize = a})
. mapping _Coerce
httprCacheValidatedWithOriginServer :: Lens' HTTPRequest (Maybe Bool)
httprCacheValidatedWithOriginServer
= lens _httprCacheValidatedWithOriginServer
(\ s a ->
s{_httprCacheValidatedWithOriginServer = a})
httprUserAgent :: Lens' HTTPRequest (Maybe Text)
httprUserAgent
= lens _httprUserAgent
(\ s a -> s{_httprUserAgent = a})
httprCacheLookup :: Lens' HTTPRequest (Maybe Bool)
httprCacheLookup
= lens _httprCacheLookup
(\ s a -> s{_httprCacheLookup = a})
httprResponseSize :: Lens' HTTPRequest (Maybe Int64)
httprResponseSize
= lens _httprResponseSize
(\ s a -> s{_httprResponseSize = a})
. mapping _Coerce
httprRequestMethod :: Lens' HTTPRequest (Maybe Text)
httprRequestMethod
= lens _httprRequestMethod
(\ s a -> s{_httprRequestMethod = a})
httprCacheHit :: Lens' HTTPRequest (Maybe Bool)
httprCacheHit
= lens _httprCacheHit
(\ s a -> s{_httprCacheHit = a})
httprReferer :: Lens' HTTPRequest (Maybe Text)
httprReferer
= lens _httprReferer (\ s a -> s{_httprReferer = a})
instance FromJSON HTTPRequest where
parseJSON
= withObject "HTTPRequest"
(\ o ->
HTTPRequest' <$>
(o .:? "status") <*> (o .:? "requestUrl") <*>
(o .:? "cacheFillBytes")
<*> (o .:? "remoteIp")
<*> (o .:? "latency")
<*> (o .:? "serverIp")
<*> (o .:? "requestSize")
<*> (o .:? "cacheValidatedWithOriginServer")
<*> (o .:? "userAgent")
<*> (o .:? "cacheLookup")
<*> (o .:? "responseSize")
<*> (o .:? "requestMethod")
<*> (o .:? "cacheHit")
<*> (o .:? "referer"))
instance ToJSON HTTPRequest where
toJSON HTTPRequest'{..}
= object
(catMaybes
[("status" .=) <$> _httprStatus,
("requestUrl" .=) <$> _httprRequestURL,
("cacheFillBytes" .=) <$> _httprCacheFillBytes,
("remoteIp" .=) <$> _httprRemoteIP,
("latency" .=) <$> _httprLatency,
("serverIp" .=) <$> _httprServerIP,
("requestSize" .=) <$> _httprRequestSize,
("cacheValidatedWithOriginServer" .=) <$>
_httprCacheValidatedWithOriginServer,
("userAgent" .=) <$> _httprUserAgent,
("cacheLookup" .=) <$> _httprCacheLookup,
("responseSize" .=) <$> _httprResponseSize,
("requestMethod" .=) <$> _httprRequestMethod,
("cacheHit" .=) <$> _httprCacheHit,
("referer" .=) <$> _httprReferer])
newtype WriteLogEntriesRequestLabels = WriteLogEntriesRequestLabels'
{ _wlerlAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
writeLogEntriesRequestLabels
:: HashMap Text Text
-> WriteLogEntriesRequestLabels
writeLogEntriesRequestLabels pWlerlAddtional_ =
WriteLogEntriesRequestLabels'
{ _wlerlAddtional = _Coerce # pWlerlAddtional_
}
wlerlAddtional :: Lens' WriteLogEntriesRequestLabels (HashMap Text Text)
wlerlAddtional
= lens _wlerlAddtional
(\ s a -> s{_wlerlAddtional = a})
. _Coerce
instance FromJSON WriteLogEntriesRequestLabels where
parseJSON
= withObject "WriteLogEntriesRequestLabels"
(\ o ->
WriteLogEntriesRequestLabels' <$>
(parseJSONObject o))
instance ToJSON WriteLogEntriesRequestLabels where
toJSON = toJSON . _wlerlAddtional
data MonitoredResource = MonitoredResource'
{ _mrLabels :: !(Maybe MonitoredResourceLabels)
, _mrType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
monitoredResource
:: MonitoredResource
monitoredResource =
MonitoredResource'
{ _mrLabels = Nothing
, _mrType = Nothing
}
mrLabels :: Lens' MonitoredResource (Maybe MonitoredResourceLabels)
mrLabels = lens _mrLabels (\ s a -> s{_mrLabels = a})
mrType :: Lens' MonitoredResource (Maybe Text)
mrType = lens _mrType (\ s a -> s{_mrType = a})
instance FromJSON MonitoredResource where
parseJSON
= withObject "MonitoredResource"
(\ o ->
MonitoredResource' <$>
(o .:? "labels") <*> (o .:? "type"))
instance ToJSON MonitoredResource where
toJSON MonitoredResource'{..}
= object
(catMaybes
[("labels" .=) <$> _mrLabels,
("type" .=) <$> _mrType])
data LogLine = LogLine'
{ _llTime :: !(Maybe DateTime')
, _llSeverity :: !(Maybe LogLineSeverity)
, _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 UTCTime)
llTime
= lens _llTime (\ s a -> s{_llTime = a}) .
mapping _DateTime
llSeverity :: Lens' LogLine (Maybe LogLineSeverity)
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 LabelDescriptor = LabelDescriptor'
{ _ldKey :: !(Maybe Text)
, _ldValueType :: !(Maybe LabelDescriptorValueType)
, _ldDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
labelDescriptor
:: LabelDescriptor
labelDescriptor =
LabelDescriptor'
{ _ldKey = Nothing
, _ldValueType = Nothing
, _ldDescription = Nothing
}
ldKey :: Lens' LabelDescriptor (Maybe Text)
ldKey = lens _ldKey (\ s a -> s{_ldKey = a})
ldValueType :: Lens' LabelDescriptor (Maybe LabelDescriptorValueType)
ldValueType
= lens _ldValueType (\ s a -> s{_ldValueType = a})
ldDescription :: Lens' LabelDescriptor (Maybe Text)
ldDescription
= lens _ldDescription
(\ s a -> s{_ldDescription = a})
instance FromJSON LabelDescriptor where
parseJSON
= withObject "LabelDescriptor"
(\ o ->
LabelDescriptor' <$>
(o .:? "key") <*> (o .:? "valueType") <*>
(o .:? "description"))
instance ToJSON LabelDescriptor where
toJSON LabelDescriptor'{..}
= object
(catMaybes
[("key" .=) <$> _ldKey,
("valueType" .=) <$> _ldValueType,
("description" .=) <$> _ldDescription])
data ListLogEntriesRequest = ListLogEntriesRequest'
{ _llerOrderBy :: !(Maybe Text)
, _llerProjectIds :: !(Maybe [Text])
, _llerFilter :: !(Maybe Text)
, _llerPageToken :: !(Maybe Text)
, _llerPageSize :: !(Maybe (Textual Int32))
, _llerResourceNames :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
listLogEntriesRequest
:: ListLogEntriesRequest
listLogEntriesRequest =
ListLogEntriesRequest'
{ _llerOrderBy = Nothing
, _llerProjectIds = Nothing
, _llerFilter = Nothing
, _llerPageToken = Nothing
, _llerPageSize = Nothing
, _llerResourceNames = Nothing
}
llerOrderBy :: Lens' ListLogEntriesRequest (Maybe Text)
llerOrderBy
= lens _llerOrderBy (\ s a -> s{_llerOrderBy = a})
llerProjectIds :: Lens' ListLogEntriesRequest [Text]
llerProjectIds
= lens _llerProjectIds
(\ s a -> s{_llerProjectIds = a})
. _Default
. _Coerce
llerFilter :: Lens' ListLogEntriesRequest (Maybe Text)
llerFilter
= lens _llerFilter (\ s a -> s{_llerFilter = a})
llerPageToken :: Lens' ListLogEntriesRequest (Maybe Text)
llerPageToken
= lens _llerPageToken
(\ s a -> s{_llerPageToken = a})
llerPageSize :: Lens' ListLogEntriesRequest (Maybe Int32)
llerPageSize
= lens _llerPageSize (\ s a -> s{_llerPageSize = a})
. mapping _Coerce
llerResourceNames :: Lens' ListLogEntriesRequest [Text]
llerResourceNames
= lens _llerResourceNames
(\ s a -> s{_llerResourceNames = a})
. _Default
. _Coerce
instance FromJSON ListLogEntriesRequest where
parseJSON
= withObject "ListLogEntriesRequest"
(\ o ->
ListLogEntriesRequest' <$>
(o .:? "orderBy") <*> (o .:? "projectIds" .!= mempty)
<*> (o .:? "filter")
<*> (o .:? "pageToken")
<*> (o .:? "pageSize")
<*> (o .:? "resourceNames" .!= mempty))
instance ToJSON ListLogEntriesRequest where
toJSON ListLogEntriesRequest'{..}
= object
(catMaybes
[("orderBy" .=) <$> _llerOrderBy,
("projectIds" .=) <$> _llerProjectIds,
("filter" .=) <$> _llerFilter,
("pageToken" .=) <$> _llerPageToken,
("pageSize" .=) <$> _llerPageSize,
("resourceNames" .=) <$> _llerResourceNames])
data LogEntryOperation = LogEntryOperation'
{ _leoFirst :: !(Maybe Bool)
, _leoProducer :: !(Maybe Text)
, _leoLast :: !(Maybe Bool)
, _leoId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
logEntryOperation
:: LogEntryOperation
logEntryOperation =
LogEntryOperation'
{ _leoFirst = Nothing
, _leoProducer = Nothing
, _leoLast = Nothing
, _leoId = Nothing
}
leoFirst :: Lens' LogEntryOperation (Maybe Bool)
leoFirst = lens _leoFirst (\ s a -> s{_leoFirst = a})
leoProducer :: Lens' LogEntryOperation (Maybe Text)
leoProducer
= lens _leoProducer (\ s a -> s{_leoProducer = a})
leoLast :: Lens' LogEntryOperation (Maybe Bool)
leoLast = lens _leoLast (\ s a -> s{_leoLast = a})
leoId :: Lens' LogEntryOperation (Maybe Text)
leoId = lens _leoId (\ s a -> s{_leoId = a})
instance FromJSON LogEntryOperation where
parseJSON
= withObject "LogEntryOperation"
(\ o ->
LogEntryOperation' <$>
(o .:? "first") <*> (o .:? "producer") <*>
(o .:? "last")
<*> (o .:? "id"))
instance ToJSON LogEntryOperation where
toJSON LogEntryOperation'{..}
= object
(catMaybes
[("first" .=) <$> _leoFirst,
("producer" .=) <$> _leoProducer,
("last" .=) <$> _leoLast, ("id" .=) <$> _leoId])
data LogMetric = LogMetric'
{ _lmName :: !(Maybe Text)
, _lmVersion :: !(Maybe LogMetricVersion)
, _lmFilter :: !(Maybe Text)
, _lmDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
logMetric
:: LogMetric
logMetric =
LogMetric'
{ _lmName = Nothing
, _lmVersion = Nothing
, _lmFilter = Nothing
, _lmDescription = Nothing
}
lmName :: Lens' LogMetric (Maybe Text)
lmName = lens _lmName (\ s a -> s{_lmName = a})
lmVersion :: Lens' LogMetric (Maybe LogMetricVersion)
lmVersion
= lens _lmVersion (\ s a -> s{_lmVersion = a})
lmFilter :: Lens' LogMetric (Maybe Text)
lmFilter = lens _lmFilter (\ s a -> s{_lmFilter = a})
lmDescription :: Lens' LogMetric (Maybe Text)
lmDescription
= lens _lmDescription
(\ s a -> s{_lmDescription = a})
instance FromJSON LogMetric where
parseJSON
= withObject "LogMetric"
(\ o ->
LogMetric' <$>
(o .:? "name") <*> (o .:? "version") <*>
(o .:? "filter")
<*> (o .:? "description"))
instance ToJSON LogMetric where
toJSON LogMetric'{..}
= object
(catMaybes
[("name" .=) <$> _lmName,
("version" .=) <$> _lmVersion,
("filter" .=) <$> _lmFilter,
("description" .=) <$> _lmDescription])
data LogEntry = LogEntry'
{ _leOperation :: !(Maybe LogEntryOperation)
, _leSeverity :: !(Maybe LogEntrySeverity)
, _leTextPayload :: !(Maybe Text)
, _leJSONPayload :: !(Maybe LogEntryJSONPayload)
, _leHTTPRequest :: !(Maybe HTTPRequest)
, _leResource :: !(Maybe MonitoredResource)
, _leInsertId :: !(Maybe Text)
, _leLabels :: !(Maybe LogEntryLabels)
, _leProtoPayload :: !(Maybe LogEntryProtoPayload)
, _leLogName :: !(Maybe Text)
, _leTimestamp :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
logEntry
:: LogEntry
logEntry =
LogEntry'
{ _leOperation = Nothing
, _leSeverity = Nothing
, _leTextPayload = Nothing
, _leJSONPayload = Nothing
, _leHTTPRequest = Nothing
, _leResource = Nothing
, _leInsertId = Nothing
, _leLabels = Nothing
, _leProtoPayload = Nothing
, _leLogName = Nothing
, _leTimestamp = Nothing
}
leOperation :: Lens' LogEntry (Maybe LogEntryOperation)
leOperation
= lens _leOperation (\ s a -> s{_leOperation = a})
leSeverity :: Lens' LogEntry (Maybe LogEntrySeverity)
leSeverity
= lens _leSeverity (\ s a -> s{_leSeverity = a})
leTextPayload :: Lens' LogEntry (Maybe Text)
leTextPayload
= lens _leTextPayload
(\ s a -> s{_leTextPayload = a})
leJSONPayload :: Lens' LogEntry (Maybe LogEntryJSONPayload)
leJSONPayload
= lens _leJSONPayload
(\ s a -> s{_leJSONPayload = a})
leHTTPRequest :: Lens' LogEntry (Maybe HTTPRequest)
leHTTPRequest
= lens _leHTTPRequest
(\ s a -> s{_leHTTPRequest = a})
leResource :: Lens' LogEntry (Maybe MonitoredResource)
leResource
= lens _leResource (\ s a -> s{_leResource = a})
leInsertId :: Lens' LogEntry (Maybe Text)
leInsertId
= lens _leInsertId (\ s a -> s{_leInsertId = a})
leLabels :: Lens' LogEntry (Maybe LogEntryLabels)
leLabels = lens _leLabels (\ s a -> s{_leLabels = a})
leProtoPayload :: Lens' LogEntry (Maybe LogEntryProtoPayload)
leProtoPayload
= lens _leProtoPayload
(\ s a -> s{_leProtoPayload = a})
leLogName :: Lens' LogEntry (Maybe Text)
leLogName
= lens _leLogName (\ s a -> s{_leLogName = a})
leTimestamp :: Lens' LogEntry (Maybe UTCTime)
leTimestamp
= lens _leTimestamp (\ s a -> s{_leTimestamp = a}) .
mapping _DateTime
instance FromJSON LogEntry where
parseJSON
= withObject "LogEntry"
(\ o ->
LogEntry' <$>
(o .:? "operation") <*> (o .:? "severity") <*>
(o .:? "textPayload")
<*> (o .:? "jsonPayload")
<*> (o .:? "httpRequest")
<*> (o .:? "resource")
<*> (o .:? "insertId")
<*> (o .:? "labels")
<*> (o .:? "protoPayload")
<*> (o .:? "logName")
<*> (o .:? "timestamp"))
instance ToJSON LogEntry where
toJSON LogEntry'{..}
= object
(catMaybes
[("operation" .=) <$> _leOperation,
("severity" .=) <$> _leSeverity,
("textPayload" .=) <$> _leTextPayload,
("jsonPayload" .=) <$> _leJSONPayload,
("httpRequest" .=) <$> _leHTTPRequest,
("resource" .=) <$> _leResource,
("insertId" .=) <$> _leInsertId,
("labels" .=) <$> _leLabels,
("protoPayload" .=) <$> _leProtoPayload,
("logName" .=) <$> _leLogName,
("timestamp" .=) <$> _leTimestamp])
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])
newtype LogEntryJSONPayload = LogEntryJSONPayload'
{ _lejpAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
logEntryJSONPayload
:: HashMap Text JSONValue
-> LogEntryJSONPayload
logEntryJSONPayload pLejpAddtional_ =
LogEntryJSONPayload'
{ _lejpAddtional = _Coerce # pLejpAddtional_
}
lejpAddtional :: Lens' LogEntryJSONPayload (HashMap Text JSONValue)
lejpAddtional
= lens _lejpAddtional
(\ s a -> s{_lejpAddtional = a})
. _Coerce
instance FromJSON LogEntryJSONPayload where
parseJSON
= withObject "LogEntryJSONPayload"
(\ o -> LogEntryJSONPayload' <$> (parseJSONObject o))
instance ToJSON LogEntryJSONPayload where
toJSON = toJSON . _lejpAddtional