{-# 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])
data MetricDescriptor = MetricDescriptor'
{ _mdMetricKind :: !(Maybe MetricDescriptorMetricKind)
, _mdName :: !(Maybe Text)
, _mdMetadata :: !(Maybe MetricDescriptorMetadata)
, _mdDisplayName :: !(Maybe Text)
, _mdLabels :: !(Maybe [LabelDescriptor])
, _mdType :: !(Maybe Text)
, _mdValueType :: !(Maybe MetricDescriptorValueType)
, _mdDescription :: !(Maybe Text)
, _mdUnit :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
metricDescriptor
:: MetricDescriptor
metricDescriptor =
MetricDescriptor'
{ _mdMetricKind = Nothing
, _mdName = Nothing
, _mdMetadata = Nothing
, _mdDisplayName = Nothing
, _mdLabels = Nothing
, _mdType = Nothing
, _mdValueType = Nothing
, _mdDescription = Nothing
, _mdUnit = Nothing
}
mdMetricKind :: Lens' MetricDescriptor (Maybe MetricDescriptorMetricKind)
mdMetricKind
= lens _mdMetricKind (\ s a -> s{_mdMetricKind = a})
mdName :: Lens' MetricDescriptor (Maybe Text)
mdName = lens _mdName (\ s a -> s{_mdName = a})
mdMetadata :: Lens' MetricDescriptor (Maybe MetricDescriptorMetadata)
mdMetadata
= lens _mdMetadata (\ s a -> s{_mdMetadata = a})
mdDisplayName :: Lens' MetricDescriptor (Maybe Text)
mdDisplayName
= lens _mdDisplayName
(\ s a -> s{_mdDisplayName = a})
mdLabels :: Lens' MetricDescriptor [LabelDescriptor]
mdLabels
= lens _mdLabels (\ s a -> s{_mdLabels = a}) .
_Default
. _Coerce
mdType :: Lens' MetricDescriptor (Maybe Text)
mdType = lens _mdType (\ s a -> s{_mdType = a})
mdValueType :: Lens' MetricDescriptor (Maybe MetricDescriptorValueType)
mdValueType
= lens _mdValueType (\ s a -> s{_mdValueType = a})
mdDescription :: Lens' MetricDescriptor (Maybe Text)
mdDescription
= lens _mdDescription
(\ s a -> s{_mdDescription = a})
mdUnit :: Lens' MetricDescriptor (Maybe Text)
mdUnit = lens _mdUnit (\ s a -> s{_mdUnit = a})
instance FromJSON MetricDescriptor where
parseJSON
= withObject "MetricDescriptor"
(\ o ->
MetricDescriptor' <$>
(o .:? "metricKind") <*> (o .:? "name") <*>
(o .:? "metadata")
<*> (o .:? "displayName")
<*> (o .:? "labels" .!= mempty)
<*> (o .:? "type")
<*> (o .:? "valueType")
<*> (o .:? "description")
<*> (o .:? "unit"))
instance ToJSON MetricDescriptor where
toJSON MetricDescriptor'{..}
= object
(catMaybes
[("metricKind" .=) <$> _mdMetricKind,
("name" .=) <$> _mdName,
("metadata" .=) <$> _mdMetadata,
("displayName" .=) <$> _mdDisplayName,
("labels" .=) <$> _mdLabels, ("type" .=) <$> _mdType,
("valueType" .=) <$> _mdValueType,
("description" .=) <$> _mdDescription,
("unit" .=) <$> _mdUnit])
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 MonitoredResourceMetadata = MonitoredResourceMetadata'
{ _mrmUserLabels :: !(Maybe MonitoredResourceMetadataUserLabels)
, _mrmSystemLabels :: !(Maybe MonitoredResourceMetadataSystemLabels)
} deriving (Eq,Show,Data,Typeable,Generic)
monitoredResourceMetadata
:: MonitoredResourceMetadata
monitoredResourceMetadata =
MonitoredResourceMetadata'
{ _mrmUserLabels = Nothing
, _mrmSystemLabels = Nothing
}
mrmUserLabels :: Lens' MonitoredResourceMetadata (Maybe MonitoredResourceMetadataUserLabels)
mrmUserLabels
= lens _mrmUserLabels
(\ s a -> s{_mrmUserLabels = a})
mrmSystemLabels :: Lens' MonitoredResourceMetadata (Maybe MonitoredResourceMetadataSystemLabels)
mrmSystemLabels
= lens _mrmSystemLabels
(\ s a -> s{_mrmSystemLabels = a})
instance FromJSON MonitoredResourceMetadata where
parseJSON
= withObject "MonitoredResourceMetadata"
(\ o ->
MonitoredResourceMetadata' <$>
(o .:? "userLabels") <*> (o .:? "systemLabels"))
instance ToJSON MonitoredResourceMetadata where
toJSON MonitoredResourceMetadata'{..}
= object
(catMaybes
[("userLabels" .=) <$> _mrmUserLabels,
("systemLabels" .=) <$> _mrmSystemLabels])
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)
, _wlerDryRun :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
writeLogEntriesRequest
:: WriteLogEntriesRequest
writeLogEntriesRequest =
WriteLogEntriesRequest'
{ _wlerEntries = Nothing
, _wlerPartialSuccess = Nothing
, _wlerResource = Nothing
, _wlerLabels = Nothing
, _wlerLogName = Nothing
, _wlerDryRun = 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})
wlerDryRun :: Lens' WriteLogEntriesRequest (Maybe Bool)
wlerDryRun
= lens _wlerDryRun (\ s a -> s{_wlerDryRun = a})
instance FromJSON WriteLogEntriesRequest where
parseJSON
= withObject "WriteLogEntriesRequest"
(\ o ->
WriteLogEntriesRequest' <$>
(o .:? "entries" .!= mempty) <*>
(o .:? "partialSuccess")
<*> (o .:? "resource")
<*> (o .:? "labels")
<*> (o .:? "logName")
<*> (o .:? "dryRun"))
instance ToJSON WriteLogEntriesRequest where
toJSON WriteLogEntriesRequest'{..}
= object
(catMaybes
[("entries" .=) <$> _wlerEntries,
("partialSuccess" .=) <$> _wlerPartialSuccess,
("resource" .=) <$> _wlerResource,
("labels" .=) <$> _wlerLabels,
("logName" .=) <$> _wlerLogName,
("dryRun" .=) <$> _wlerDryRun])
newtype LogMetricLabelExtractors = LogMetricLabelExtractors'
{ _lmleAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
logMetricLabelExtractors
:: HashMap Text Text
-> LogMetricLabelExtractors
logMetricLabelExtractors pLmleAddtional_ =
LogMetricLabelExtractors'
{ _lmleAddtional = _Coerce # pLmleAddtional_
}
lmleAddtional :: Lens' LogMetricLabelExtractors (HashMap Text Text)
lmleAddtional
= lens _lmleAddtional
(\ s a -> s{_lmleAddtional = a})
. _Coerce
instance FromJSON LogMetricLabelExtractors where
parseJSON
= withObject "LogMetricLabelExtractors"
(\ o ->
LogMetricLabelExtractors' <$> (parseJSONObject o))
instance ToJSON LogMetricLabelExtractors where
toJSON = toJSON . _lmleAddtional
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 GDuration)
, _rlWasLoadingRequest :: !(Maybe Bool)
, _rlFirst :: !(Maybe Bool)
, _rlStartTime :: !(Maybe DateTime')
, _rlLatency :: !(Maybe GDuration)
, _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)
, _rlTraceSampled :: !(Maybe Bool)
, _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
, _rlTraceSampled = 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 _GDuration
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 _GDuration
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})
rlTraceSampled :: Lens' RequestLog (Maybe Bool)
rlTraceSampled
= lens _rlTraceSampled
(\ s a -> s{_rlTraceSampled = 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 .:? "traceSampled")
<*> (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,
("traceSampled" .=) <$> _rlTraceSampled,
("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 LogEntrySourceLocation = LogEntrySourceLocation'
{ _leslFunction :: !(Maybe Text)
, _leslLine :: !(Maybe (Textual Int64))
, _leslFile :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
logEntrySourceLocation
:: LogEntrySourceLocation
logEntrySourceLocation =
LogEntrySourceLocation'
{ _leslFunction = Nothing
, _leslLine = Nothing
, _leslFile = Nothing
}
leslFunction :: Lens' LogEntrySourceLocation (Maybe Text)
leslFunction
= lens _leslFunction (\ s a -> s{_leslFunction = a})
leslLine :: Lens' LogEntrySourceLocation (Maybe Int64)
leslLine
= lens _leslLine (\ s a -> s{_leslLine = a}) .
mapping _Coerce
leslFile :: Lens' LogEntrySourceLocation (Maybe Text)
leslFile = lens _leslFile (\ s a -> s{_leslFile = a})
instance FromJSON LogEntrySourceLocation where
parseJSON
= withObject "LogEntrySourceLocation"
(\ o ->
LogEntrySourceLocation' <$>
(o .:? "function") <*> (o .:? "line") <*>
(o .:? "file"))
instance ToJSON LogEntrySourceLocation where
toJSON LogEntrySourceLocation'{..}
= object
(catMaybes
[("function" .=) <$> _leslFunction,
("line" .=) <$> _leslLine,
("file" .=) <$> _leslFile])
data LogExclusion = LogExclusion'
{ _leDisabled :: !(Maybe Bool)
, _leName :: !(Maybe Text)
, _leFilter :: !(Maybe Text)
, _leDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
logExclusion
:: LogExclusion
logExclusion =
LogExclusion'
{ _leDisabled = Nothing
, _leName = Nothing
, _leFilter = Nothing
, _leDescription = Nothing
}
leDisabled :: Lens' LogExclusion (Maybe Bool)
leDisabled
= lens _leDisabled (\ s a -> s{_leDisabled = a})
leName :: Lens' LogExclusion (Maybe Text)
leName = lens _leName (\ s a -> s{_leName = a})
leFilter :: Lens' LogExclusion (Maybe Text)
leFilter = lens _leFilter (\ s a -> s{_leFilter = a})
leDescription :: Lens' LogExclusion (Maybe Text)
leDescription
= lens _leDescription
(\ s a -> s{_leDescription = a})
instance FromJSON LogExclusion where
parseJSON
= withObject "LogExclusion"
(\ o ->
LogExclusion' <$>
(o .:? "disabled") <*> (o .:? "name") <*>
(o .:? "filter")
<*> (o .:? "description"))
instance ToJSON LogExclusion where
toJSON LogExclusion'{..}
= object
(catMaybes
[("disabled" .=) <$> _leDisabled,
("name" .=) <$> _leName, ("filter" .=) <$> _leFilter,
("description" .=) <$> _leDescription])
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)
, _lsIncludeChildren :: !(Maybe Bool)
, _lsOutputVersionFormat :: !(Maybe LogSinkOutputVersionFormat)
, _lsWriterIdentity :: !(Maybe Text)
, _lsName :: !(Maybe Text)
, _lsFilter :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
logSink
:: LogSink
logSink =
LogSink'
{ _lsDestination = Nothing
, _lsIncludeChildren = Nothing
, _lsOutputVersionFormat = Nothing
, _lsWriterIdentity = Nothing
, _lsName = Nothing
, _lsFilter = Nothing
}
lsDestination :: Lens' LogSink (Maybe Text)
lsDestination
= lens _lsDestination
(\ s a -> s{_lsDestination = a})
lsIncludeChildren :: Lens' LogSink (Maybe Bool)
lsIncludeChildren
= lens _lsIncludeChildren
(\ s a -> s{_lsIncludeChildren = a})
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})
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 .:? "includeChildren")
<*> (o .:? "outputVersionFormat")
<*> (o .:? "writerIdentity")
<*> (o .:? "name")
<*> (o .:? "filter"))
instance ToJSON LogSink where
toJSON LogSink'{..}
= object
(catMaybes
[("destination" .=) <$> _lsDestination,
("includeChildren" .=) <$> _lsIncludeChildren,
("outputVersionFormat" .=) <$>
_lsOutputVersionFormat,
("writerIdentity" .=) <$> _lsWriterIdentity,
("name" .=) <$> _lsName,
("filter" .=) <$> _lsFilter])
newtype MonitoredResourceMetadataUserLabels = MonitoredResourceMetadataUserLabels'
{ _mrmulAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
monitoredResourceMetadataUserLabels
:: HashMap Text Text
-> MonitoredResourceMetadataUserLabels
monitoredResourceMetadataUserLabels pMrmulAddtional_ =
MonitoredResourceMetadataUserLabels'
{ _mrmulAddtional = _Coerce # pMrmulAddtional_
}
mrmulAddtional :: Lens' MonitoredResourceMetadataUserLabels (HashMap Text Text)
mrmulAddtional
= lens _mrmulAddtional
(\ s a -> s{_mrmulAddtional = a})
. _Coerce
instance FromJSON MonitoredResourceMetadataUserLabels
where
parseJSON
= withObject "MonitoredResourceMetadataUserLabels"
(\ o ->
MonitoredResourceMetadataUserLabels' <$>
(parseJSONObject o))
instance ToJSON MonitoredResourceMetadataUserLabels
where
toJSON = toJSON . _mrmulAddtional
data ListExclusionsResponse = ListExclusionsResponse'
{ _lerNextPageToken :: !(Maybe Text)
, _lerExclusions :: !(Maybe [LogExclusion])
} deriving (Eq,Show,Data,Typeable,Generic)
listExclusionsResponse
:: ListExclusionsResponse
listExclusionsResponse =
ListExclusionsResponse'
{ _lerNextPageToken = Nothing
, _lerExclusions = Nothing
}
lerNextPageToken :: Lens' ListExclusionsResponse (Maybe Text)
lerNextPageToken
= lens _lerNextPageToken
(\ s a -> s{_lerNextPageToken = a})
lerExclusions :: Lens' ListExclusionsResponse [LogExclusion]
lerExclusions
= lens _lerExclusions
(\ s a -> s{_lerExclusions = a})
. _Default
. _Coerce
instance FromJSON ListExclusionsResponse where
parseJSON
= withObject "ListExclusionsResponse"
(\ o ->
ListExclusionsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "exclusions" .!= mempty))
instance ToJSON ListExclusionsResponse where
toJSON ListExclusionsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lerNextPageToken,
("exclusions" .=) <$> _lerExclusions])
data ListLogsResponse = ListLogsResponse'
{ _llrNextPageToken :: !(Maybe Text)
, _llrLogNames :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
listLogsResponse
:: ListLogsResponse
listLogsResponse =
ListLogsResponse'
{ _llrNextPageToken = Nothing
, _llrLogNames = Nothing
}
llrNextPageToken :: Lens' ListLogsResponse (Maybe Text)
llrNextPageToken
= lens _llrNextPageToken
(\ s a -> s{_llrNextPageToken = a})
llrLogNames :: Lens' ListLogsResponse [Text]
llrLogNames
= lens _llrLogNames (\ s a -> s{_llrLogNames = a}) .
_Default
. _Coerce
instance FromJSON ListLogsResponse where
parseJSON
= withObject "ListLogsResponse"
(\ o ->
ListLogsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "logNames" .!= mempty))
instance ToJSON ListLogsResponse where
toJSON ListLogsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _llrNextPageToken,
("logNames" .=) <$> _llrLogNames])
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])
newtype Explicit = Explicit'
{ _eBounds :: Maybe [Textual Double]
} deriving (Eq,Show,Data,Typeable,Generic)
explicit
:: Explicit
explicit =
Explicit'
{ _eBounds = Nothing
}
eBounds :: Lens' Explicit [Double]
eBounds
= lens _eBounds (\ s a -> s{_eBounds = a}) . _Default
. _Coerce
instance FromJSON Explicit where
parseJSON
= withObject "Explicit"
(\ o -> Explicit' <$> (o .:? "bounds" .!= mempty))
instance ToJSON Explicit where
toJSON Explicit'{..}
= object (catMaybes [("bounds" .=) <$> _eBounds])
data HTTPRequest = HTTPRequest'
{ _httprStatus :: !(Maybe (Textual Int32))
, _httprRequestURL :: !(Maybe Text)
, _httprCacheFillBytes :: !(Maybe (Textual Int64))
, _httprRemoteIP :: !(Maybe Text)
, _httprLatency :: !(Maybe GDuration)
, _httprProtocol :: !(Maybe Text)
, _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
, _httprProtocol = 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 _GDuration
httprProtocol :: Lens' HTTPRequest (Maybe Text)
httprProtocol
= lens _httprProtocol
(\ s a -> s{_httprProtocol = a})
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 .:? "protocol")
<*> (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,
("protocol" .=) <$> _httprProtocol,
("serverIp" .=) <$> _httprServerIP,
("requestSize" .=) <$> _httprRequestSize,
("cacheValidatedWithOriginServer" .=) <$>
_httprCacheValidatedWithOriginServer,
("userAgent" .=) <$> _httprUserAgent,
("cacheLookup" .=) <$> _httprCacheLookup,
("responseSize" .=) <$> _httprResponseSize,
("requestMethod" .=) <$> _httprRequestMethod,
("cacheHit" .=) <$> _httprCacheHit,
("referer" .=) <$> _httprReferer])
data Exponential = Exponential'
{ _eGrowthFactor :: !(Maybe (Textual Double))
, _eScale :: !(Maybe (Textual Double))
, _eNumFiniteBuckets :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
exponential
:: Exponential
exponential =
Exponential'
{ _eGrowthFactor = Nothing
, _eScale = Nothing
, _eNumFiniteBuckets = Nothing
}
eGrowthFactor :: Lens' Exponential (Maybe Double)
eGrowthFactor
= lens _eGrowthFactor
(\ s a -> s{_eGrowthFactor = a})
. mapping _Coerce
eScale :: Lens' Exponential (Maybe Double)
eScale
= lens _eScale (\ s a -> s{_eScale = a}) .
mapping _Coerce
eNumFiniteBuckets :: Lens' Exponential (Maybe Int32)
eNumFiniteBuckets
= lens _eNumFiniteBuckets
(\ s a -> s{_eNumFiniteBuckets = a})
. mapping _Coerce
instance FromJSON Exponential where
parseJSON
= withObject "Exponential"
(\ o ->
Exponential' <$>
(o .:? "growthFactor") <*> (o .:? "scale") <*>
(o .:? "numFiniteBuckets"))
instance ToJSON Exponential where
toJSON Exponential'{..}
= object
(catMaybes
[("growthFactor" .=) <$> _eGrowthFactor,
("scale" .=) <$> _eScale,
("numFiniteBuckets" .=) <$> _eNumFiniteBuckets])
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 MetricDescriptorMetadata = MetricDescriptorMetadata'
{ _mdmSamplePeriod :: !(Maybe GDuration)
, _mdmIngestDelay :: !(Maybe GDuration)
, _mdmLaunchStage :: !(Maybe MetricDescriptorMetadataLaunchStage)
} deriving (Eq,Show,Data,Typeable,Generic)
metricDescriptorMetadata
:: MetricDescriptorMetadata
metricDescriptorMetadata =
MetricDescriptorMetadata'
{ _mdmSamplePeriod = Nothing
, _mdmIngestDelay = Nothing
, _mdmLaunchStage = Nothing
}
mdmSamplePeriod :: Lens' MetricDescriptorMetadata (Maybe Scientific)
mdmSamplePeriod
= lens _mdmSamplePeriod
(\ s a -> s{_mdmSamplePeriod = a})
. mapping _GDuration
mdmIngestDelay :: Lens' MetricDescriptorMetadata (Maybe Scientific)
mdmIngestDelay
= lens _mdmIngestDelay
(\ s a -> s{_mdmIngestDelay = a})
. mapping _GDuration
mdmLaunchStage :: Lens' MetricDescriptorMetadata (Maybe MetricDescriptorMetadataLaunchStage)
mdmLaunchStage
= lens _mdmLaunchStage
(\ s a -> s{_mdmLaunchStage = a})
instance FromJSON MetricDescriptorMetadata where
parseJSON
= withObject "MetricDescriptorMetadata"
(\ o ->
MetricDescriptorMetadata' <$>
(o .:? "samplePeriod") <*> (o .:? "ingestDelay") <*>
(o .:? "launchStage"))
instance ToJSON MetricDescriptorMetadata where
toJSON MetricDescriptorMetadata'{..}
= object
(catMaybes
[("samplePeriod" .=) <$> _mdmSamplePeriod,
("ingestDelay" .=) <$> _mdmIngestDelay,
("launchStage" .=) <$> _mdmLaunchStage])
newtype MonitoredResourceMetadataSystemLabels = MonitoredResourceMetadataSystemLabels'
{ _mrmslAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
monitoredResourceMetadataSystemLabels
:: HashMap Text JSONValue
-> MonitoredResourceMetadataSystemLabels
monitoredResourceMetadataSystemLabels pMrmslAddtional_ =
MonitoredResourceMetadataSystemLabels'
{ _mrmslAddtional = _Coerce # pMrmslAddtional_
}
mrmslAddtional :: Lens' MonitoredResourceMetadataSystemLabels (HashMap Text JSONValue)
mrmslAddtional
= lens _mrmslAddtional
(\ s a -> s{_mrmslAddtional = a})
. _Coerce
instance FromJSON
MonitoredResourceMetadataSystemLabels where
parseJSON
= withObject "MonitoredResourceMetadataSystemLabels"
(\ o ->
MonitoredResourceMetadataSystemLabels' <$>
(parseJSONObject o))
instance ToJSON MonitoredResourceMetadataSystemLabels
where
toJSON = toJSON . _mrmslAddtional
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 Linear = Linear'
{ _lOffSet :: !(Maybe (Textual Double))
, _lWidth :: !(Maybe (Textual Double))
, _lNumFiniteBuckets :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
linear
:: Linear
linear =
Linear'
{ _lOffSet = Nothing
, _lWidth = Nothing
, _lNumFiniteBuckets = Nothing
}
lOffSet :: Lens' Linear (Maybe Double)
lOffSet
= lens _lOffSet (\ s a -> s{_lOffSet = a}) .
mapping _Coerce
lWidth :: Lens' Linear (Maybe Double)
lWidth
= lens _lWidth (\ s a -> s{_lWidth = a}) .
mapping _Coerce
lNumFiniteBuckets :: Lens' Linear (Maybe Int32)
lNumFiniteBuckets
= lens _lNumFiniteBuckets
(\ s a -> s{_lNumFiniteBuckets = a})
. mapping _Coerce
instance FromJSON Linear where
parseJSON
= withObject "Linear"
(\ o ->
Linear' <$>
(o .:? "offset") <*> (o .:? "width") <*>
(o .:? "numFiniteBuckets"))
instance ToJSON Linear where
toJSON Linear'{..}
= object
(catMaybes
[("offset" .=) <$> _lOffSet,
("width" .=) <$> _lWidth,
("numFiniteBuckets" .=) <$> _lNumFiniteBuckets])
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'
{ _lmMetricDescriptor :: !(Maybe MetricDescriptor)
, _lmName :: !(Maybe Text)
, _lmVersion :: !(Maybe LogMetricVersion)
, _lmLabelExtractors :: !(Maybe LogMetricLabelExtractors)
, _lmFilter :: !(Maybe Text)
, _lmValueExtractor :: !(Maybe Text)
, _lmBucketOptions :: !(Maybe BucketOptions)
, _lmDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
logMetric
:: LogMetric
logMetric =
LogMetric'
{ _lmMetricDescriptor = Nothing
, _lmName = Nothing
, _lmVersion = Nothing
, _lmLabelExtractors = Nothing
, _lmFilter = Nothing
, _lmValueExtractor = Nothing
, _lmBucketOptions = Nothing
, _lmDescription = Nothing
}
lmMetricDescriptor :: Lens' LogMetric (Maybe MetricDescriptor)
lmMetricDescriptor
= lens _lmMetricDescriptor
(\ s a -> s{_lmMetricDescriptor = a})
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})
lmLabelExtractors :: Lens' LogMetric (Maybe LogMetricLabelExtractors)
lmLabelExtractors
= lens _lmLabelExtractors
(\ s a -> s{_lmLabelExtractors = a})
lmFilter :: Lens' LogMetric (Maybe Text)
lmFilter = lens _lmFilter (\ s a -> s{_lmFilter = a})
lmValueExtractor :: Lens' LogMetric (Maybe Text)
lmValueExtractor
= lens _lmValueExtractor
(\ s a -> s{_lmValueExtractor = a})
lmBucketOptions :: Lens' LogMetric (Maybe BucketOptions)
lmBucketOptions
= lens _lmBucketOptions
(\ s a -> s{_lmBucketOptions = a})
lmDescription :: Lens' LogMetric (Maybe Text)
lmDescription
= lens _lmDescription
(\ s a -> s{_lmDescription = a})
instance FromJSON LogMetric where
parseJSON
= withObject "LogMetric"
(\ o ->
LogMetric' <$>
(o .:? "metricDescriptor") <*> (o .:? "name") <*>
(o .:? "version")
<*> (o .:? "labelExtractors")
<*> (o .:? "filter")
<*> (o .:? "valueExtractor")
<*> (o .:? "bucketOptions")
<*> (o .:? "description"))
instance ToJSON LogMetric where
toJSON LogMetric'{..}
= object
(catMaybes
[("metricDescriptor" .=) <$> _lmMetricDescriptor,
("name" .=) <$> _lmName,
("version" .=) <$> _lmVersion,
("labelExtractors" .=) <$> _lmLabelExtractors,
("filter" .=) <$> _lmFilter,
("valueExtractor" .=) <$> _lmValueExtractor,
("bucketOptions" .=) <$> _lmBucketOptions,
("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)
, _leMetadata :: !(Maybe MonitoredResourceMetadata)
, _leReceiveTimestamp :: !(Maybe DateTime')
, _leLabels :: !(Maybe LogEntryLabels)
, _leProtoPayload :: !(Maybe LogEntryProtoPayload)
, _leSourceLocation :: !(Maybe LogEntrySourceLocation)
, _leTraceSampled :: !(Maybe Bool)
, _leLogName :: !(Maybe Text)
, _leTimestamp :: !(Maybe DateTime')
, _leTrace :: !(Maybe Text)
, _leSpanId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
logEntry
:: LogEntry
logEntry =
LogEntry'
{ _leOperation = Nothing
, _leSeverity = Nothing
, _leTextPayload = Nothing
, _leJSONPayload = Nothing
, _leHTTPRequest = Nothing
, _leResource = Nothing
, _leInsertId = Nothing
, _leMetadata = Nothing
, _leReceiveTimestamp = Nothing
, _leLabels = Nothing
, _leProtoPayload = Nothing
, _leSourceLocation = Nothing
, _leTraceSampled = Nothing
, _leLogName = Nothing
, _leTimestamp = Nothing
, _leTrace = Nothing
, _leSpanId = 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})
leMetadata :: Lens' LogEntry (Maybe MonitoredResourceMetadata)
leMetadata
= lens _leMetadata (\ s a -> s{_leMetadata = a})
leReceiveTimestamp :: Lens' LogEntry (Maybe UTCTime)
leReceiveTimestamp
= lens _leReceiveTimestamp
(\ s a -> s{_leReceiveTimestamp = a})
. mapping _DateTime
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})
leSourceLocation :: Lens' LogEntry (Maybe LogEntrySourceLocation)
leSourceLocation
= lens _leSourceLocation
(\ s a -> s{_leSourceLocation = a})
leTraceSampled :: Lens' LogEntry (Maybe Bool)
leTraceSampled
= lens _leTraceSampled
(\ s a -> s{_leTraceSampled = 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
leTrace :: Lens' LogEntry (Maybe Text)
leTrace = lens _leTrace (\ s a -> s{_leTrace = a})
leSpanId :: Lens' LogEntry (Maybe Text)
leSpanId = lens _leSpanId (\ s a -> s{_leSpanId = a})
instance FromJSON LogEntry where
parseJSON
= withObject "LogEntry"
(\ o ->
LogEntry' <$>
(o .:? "operation") <*> (o .:? "severity") <*>
(o .:? "textPayload")
<*> (o .:? "jsonPayload")
<*> (o .:? "httpRequest")
<*> (o .:? "resource")
<*> (o .:? "insertId")
<*> (o .:? "metadata")
<*> (o .:? "receiveTimestamp")
<*> (o .:? "labels")
<*> (o .:? "protoPayload")
<*> (o .:? "sourceLocation")
<*> (o .:? "traceSampled")
<*> (o .:? "logName")
<*> (o .:? "timestamp")
<*> (o .:? "trace")
<*> (o .:? "spanId"))
instance ToJSON LogEntry where
toJSON LogEntry'{..}
= object
(catMaybes
[("operation" .=) <$> _leOperation,
("severity" .=) <$> _leSeverity,
("textPayload" .=) <$> _leTextPayload,
("jsonPayload" .=) <$> _leJSONPayload,
("httpRequest" .=) <$> _leHTTPRequest,
("resource" .=) <$> _leResource,
("insertId" .=) <$> _leInsertId,
("metadata" .=) <$> _leMetadata,
("receiveTimestamp" .=) <$> _leReceiveTimestamp,
("labels" .=) <$> _leLabels,
("protoPayload" .=) <$> _leProtoPayload,
("sourceLocation" .=) <$> _leSourceLocation,
("traceSampled" .=) <$> _leTraceSampled,
("logName" .=) <$> _leLogName,
("timestamp" .=) <$> _leTimestamp,
("trace" .=) <$> _leTrace,
("spanId" .=) <$> _leSpanId])
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 BucketOptions = BucketOptions'
{ _boExponentialBuckets :: !(Maybe Exponential)
, _boLinearBuckets :: !(Maybe Linear)
, _boExplicitBuckets :: !(Maybe Explicit)
} deriving (Eq,Show,Data,Typeable,Generic)
bucketOptions
:: BucketOptions
bucketOptions =
BucketOptions'
{ _boExponentialBuckets = Nothing
, _boLinearBuckets = Nothing
, _boExplicitBuckets = Nothing
}
boExponentialBuckets :: Lens' BucketOptions (Maybe Exponential)
boExponentialBuckets
= lens _boExponentialBuckets
(\ s a -> s{_boExponentialBuckets = a})
boLinearBuckets :: Lens' BucketOptions (Maybe Linear)
boLinearBuckets
= lens _boLinearBuckets
(\ s a -> s{_boLinearBuckets = a})
boExplicitBuckets :: Lens' BucketOptions (Maybe Explicit)
boExplicitBuckets
= lens _boExplicitBuckets
(\ s a -> s{_boExplicitBuckets = a})
instance FromJSON BucketOptions where
parseJSON
= withObject "BucketOptions"
(\ o ->
BucketOptions' <$>
(o .:? "exponentialBuckets") <*>
(o .:? "linearBuckets")
<*> (o .:? "explicitBuckets"))
instance ToJSON BucketOptions where
toJSON BucketOptions'{..}
= object
(catMaybes
[("exponentialBuckets" .=) <$> _boExponentialBuckets,
("linearBuckets" .=) <$> _boLinearBuckets,
("explicitBuckets" .=) <$> _boExplicitBuckets])
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