{-# 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.Tracing.Types.Product where
import Network.Google.Prelude
import Network.Google.Tracing.Types.Sum
data Span = Span'
{ _sStatus :: !(Maybe Status)
, _sStartTime :: !(Maybe DateTime')
, _sName :: !(Maybe Text)
, _sStackTrace :: !(Maybe StackTrace)
, _sAttributes :: !(Maybe Attributes)
, _sEndTime :: !(Maybe DateTime')
, _sTimeEvents :: !(Maybe TimeEvents)
, _sDisplayName :: !(Maybe TruncatableString)
, _sParentSpanId :: !(Maybe Text)
, _sLinks :: !(Maybe Links)
, _sSpanId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
span
:: Span
span =
Span'
{ _sStatus = Nothing
, _sStartTime = Nothing
, _sName = Nothing
, _sStackTrace = Nothing
, _sAttributes = Nothing
, _sEndTime = Nothing
, _sTimeEvents = Nothing
, _sDisplayName = Nothing
, _sParentSpanId = Nothing
, _sLinks = Nothing
, _sSpanId = Nothing
}
sStatus :: Lens' Span (Maybe Status)
sStatus = lens _sStatus (\ s a -> s{_sStatus = a})
sStartTime :: Lens' Span (Maybe UTCTime)
sStartTime
= lens _sStartTime (\ s a -> s{_sStartTime = a}) .
mapping _DateTime
sName :: Lens' Span (Maybe Text)
sName = lens _sName (\ s a -> s{_sName = a})
sStackTrace :: Lens' Span (Maybe StackTrace)
sStackTrace
= lens _sStackTrace (\ s a -> s{_sStackTrace = a})
sAttributes :: Lens' Span (Maybe Attributes)
sAttributes
= lens _sAttributes (\ s a -> s{_sAttributes = a})
sEndTime :: Lens' Span (Maybe UTCTime)
sEndTime
= lens _sEndTime (\ s a -> s{_sEndTime = a}) .
mapping _DateTime
sTimeEvents :: Lens' Span (Maybe TimeEvents)
sTimeEvents
= lens _sTimeEvents (\ s a -> s{_sTimeEvents = a})
sDisplayName :: Lens' Span (Maybe TruncatableString)
sDisplayName
= lens _sDisplayName (\ s a -> s{_sDisplayName = a})
sParentSpanId :: Lens' Span (Maybe Text)
sParentSpanId
= lens _sParentSpanId
(\ s a -> s{_sParentSpanId = a})
sLinks :: Lens' Span (Maybe Links)
sLinks = lens _sLinks (\ s a -> s{_sLinks = a})
sSpanId :: Lens' Span (Maybe Text)
sSpanId = lens _sSpanId (\ s a -> s{_sSpanId = a})
instance FromJSON Span where
parseJSON
= withObject "Span"
(\ o ->
Span' <$>
(o .:? "status") <*> (o .:? "startTime") <*>
(o .:? "name")
<*> (o .:? "stackTrace")
<*> (o .:? "attributes")
<*> (o .:? "endTime")
<*> (o .:? "timeEvents")
<*> (o .:? "displayName")
<*> (o .:? "parentSpanId")
<*> (o .:? "links")
<*> (o .:? "spanId"))
instance ToJSON Span where
toJSON Span'{..}
= object
(catMaybes
[("status" .=) <$> _sStatus,
("startTime" .=) <$> _sStartTime,
("name" .=) <$> _sName,
("stackTrace" .=) <$> _sStackTrace,
("attributes" .=) <$> _sAttributes,
("endTime" .=) <$> _sEndTime,
("timeEvents" .=) <$> _sTimeEvents,
("displayName" .=) <$> _sDisplayName,
("parentSpanId" .=) <$> _sParentSpanId,
("links" .=) <$> _sLinks,
("spanId" .=) <$> _sSpanId])
data TruncatableString = TruncatableString'
{ _tsTruncatedCharacterCount :: !(Maybe (Textual Int32))
, _tsValue :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
truncatableString
:: TruncatableString
truncatableString =
TruncatableString'
{ _tsTruncatedCharacterCount = Nothing
, _tsValue = Nothing
}
tsTruncatedCharacterCount :: Lens' TruncatableString (Maybe Int32)
tsTruncatedCharacterCount
= lens _tsTruncatedCharacterCount
(\ s a -> s{_tsTruncatedCharacterCount = a})
. mapping _Coerce
tsValue :: Lens' TruncatableString (Maybe Text)
tsValue = lens _tsValue (\ s a -> s{_tsValue = a})
instance FromJSON TruncatableString where
parseJSON
= withObject "TruncatableString"
(\ o ->
TruncatableString' <$>
(o .:? "truncatedCharacterCount") <*>
(o .:? "value"))
instance ToJSON TruncatableString where
toJSON TruncatableString'{..}
= object
(catMaybes
[("truncatedCharacterCount" .=) <$>
_tsTruncatedCharacterCount,
("value" .=) <$> _tsValue])
data Status = Status'
{ _sDetails :: !(Maybe [StatusDetailsItem])
, _sCode :: !(Maybe (Textual Int32))
, _sMessage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
status
:: Status
status =
Status'
{ _sDetails = Nothing
, _sCode = Nothing
, _sMessage = Nothing
}
sDetails :: Lens' Status [StatusDetailsItem]
sDetails
= lens _sDetails (\ s a -> s{_sDetails = a}) .
_Default
. _Coerce
sCode :: Lens' Status (Maybe Int32)
sCode
= lens _sCode (\ s a -> s{_sCode = a}) .
mapping _Coerce
sMessage :: Lens' Status (Maybe Text)
sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
instance FromJSON Status where
parseJSON
= withObject "Status"
(\ o ->
Status' <$>
(o .:? "details" .!= mempty) <*> (o .:? "code") <*>
(o .:? "message"))
instance ToJSON Status where
toJSON Status'{..}
= object
(catMaybes
[("details" .=) <$> _sDetails,
("code" .=) <$> _sCode,
("message" .=) <$> _sMessage])
newtype AttributesAttributeMap = AttributesAttributeMap'
{ _aamAddtional :: HashMap Text AttributeValue
} deriving (Eq,Show,Data,Typeable,Generic)
attributesAttributeMap
:: HashMap Text AttributeValue
-> AttributesAttributeMap
attributesAttributeMap pAamAddtional_ =
AttributesAttributeMap'
{ _aamAddtional = _Coerce # pAamAddtional_
}
aamAddtional :: Lens' AttributesAttributeMap (HashMap Text AttributeValue)
aamAddtional
= lens _aamAddtional (\ s a -> s{_aamAddtional = a})
. _Coerce
instance FromJSON AttributesAttributeMap where
parseJSON
= withObject "AttributesAttributeMap"
(\ o ->
AttributesAttributeMap' <$> (parseJSONObject o))
instance ToJSON AttributesAttributeMap where
toJSON = toJSON . _aamAddtional
data Annotation = Annotation'
{ _aAttributes :: !(Maybe Attributes)
, _aDescription :: !(Maybe TruncatableString)
} deriving (Eq,Show,Data,Typeable,Generic)
annotation
:: Annotation
annotation =
Annotation'
{ _aAttributes = Nothing
, _aDescription = Nothing
}
aAttributes :: Lens' Annotation (Maybe Attributes)
aAttributes
= lens _aAttributes (\ s a -> s{_aAttributes = a})
aDescription :: Lens' Annotation (Maybe TruncatableString)
aDescription
= lens _aDescription (\ s a -> s{_aDescription = a})
instance FromJSON Annotation where
parseJSON
= withObject "Annotation"
(\ o ->
Annotation' <$>
(o .:? "attributes") <*> (o .:? "description"))
instance ToJSON Annotation where
toJSON Annotation'{..}
= object
(catMaybes
[("attributes" .=) <$> _aAttributes,
("description" .=) <$> _aDescription])
data AttributeValue = AttributeValue'
{ _avBoolValue :: !(Maybe Bool)
, _avIntValue :: !(Maybe (Textual Int64))
, _avStringValue :: !(Maybe TruncatableString)
} deriving (Eq,Show,Data,Typeable,Generic)
attributeValue
:: AttributeValue
attributeValue =
AttributeValue'
{ _avBoolValue = Nothing
, _avIntValue = Nothing
, _avStringValue = Nothing
}
avBoolValue :: Lens' AttributeValue (Maybe Bool)
avBoolValue
= lens _avBoolValue (\ s a -> s{_avBoolValue = a})
avIntValue :: Lens' AttributeValue (Maybe Int64)
avIntValue
= lens _avIntValue (\ s a -> s{_avIntValue = a}) .
mapping _Coerce
avStringValue :: Lens' AttributeValue (Maybe TruncatableString)
avStringValue
= lens _avStringValue
(\ s a -> s{_avStringValue = a})
instance FromJSON AttributeValue where
parseJSON
= withObject "AttributeValue"
(\ o ->
AttributeValue' <$>
(o .:? "boolValue") <*> (o .:? "intValue") <*>
(o .:? "stringValue"))
instance ToJSON AttributeValue where
toJSON AttributeValue'{..}
= object
(catMaybes
[("boolValue" .=) <$> _avBoolValue,
("intValue" .=) <$> _avIntValue,
("stringValue" .=) <$> _avStringValue])
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
data Link = Link'
{ _lTraceId :: !(Maybe Text)
, _lType :: !(Maybe LinkType)
, _lSpanId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
link
:: Link
link =
Link'
{ _lTraceId = Nothing
, _lType = Nothing
, _lSpanId = Nothing
}
lTraceId :: Lens' Link (Maybe Text)
lTraceId = lens _lTraceId (\ s a -> s{_lTraceId = a})
lType :: Lens' Link (Maybe LinkType)
lType = lens _lType (\ s a -> s{_lType = a})
lSpanId :: Lens' Link (Maybe Text)
lSpanId = lens _lSpanId (\ s a -> s{_lSpanId = a})
instance FromJSON Link where
parseJSON
= withObject "Link"
(\ o ->
Link' <$>
(o .:? "traceId") <*> (o .:? "type") <*>
(o .:? "spanId"))
instance ToJSON Link where
toJSON Link'{..}
= object
(catMaybes
[("traceId" .=) <$> _lTraceId,
("type" .=) <$> _lType, ("spanId" .=) <$> _lSpanId])
newtype StatusDetailsItem = StatusDetailsItem'
{ _sdiAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
statusDetailsItem
:: HashMap Text JSONValue
-> StatusDetailsItem
statusDetailsItem pSdiAddtional_ =
StatusDetailsItem'
{ _sdiAddtional = _Coerce # pSdiAddtional_
}
sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
sdiAddtional
= lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
. _Coerce
instance FromJSON StatusDetailsItem where
parseJSON
= withObject "StatusDetailsItem"
(\ o -> StatusDetailsItem' <$> (parseJSONObject o))
instance ToJSON StatusDetailsItem where
toJSON = toJSON . _sdiAddtional
data ListSpansResponse = ListSpansResponse'
{ _lsrNextPageToken :: !(Maybe Text)
, _lsrSpans :: !(Maybe [Span])
} deriving (Eq,Show,Data,Typeable,Generic)
listSpansResponse
:: ListSpansResponse
listSpansResponse =
ListSpansResponse'
{ _lsrNextPageToken = Nothing
, _lsrSpans = Nothing
}
lsrNextPageToken :: Lens' ListSpansResponse (Maybe Text)
lsrNextPageToken
= lens _lsrNextPageToken
(\ s a -> s{_lsrNextPageToken = a})
lsrSpans :: Lens' ListSpansResponse [Span]
lsrSpans
= lens _lsrSpans (\ s a -> s{_lsrSpans = a}) .
_Default
. _Coerce
instance FromJSON ListSpansResponse where
parseJSON
= withObject "ListSpansResponse"
(\ o ->
ListSpansResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "spans" .!= mempty))
instance ToJSON ListSpansResponse where
toJSON ListSpansResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lsrNextPageToken,
("spans" .=) <$> _lsrSpans])
data StackTrace = StackTrace'
{ _stStackTraceHashId :: !(Maybe (Textual Word64))
, _stStackFrames :: !(Maybe StackFrames)
} deriving (Eq,Show,Data,Typeable,Generic)
stackTrace
:: StackTrace
stackTrace =
StackTrace'
{ _stStackTraceHashId = Nothing
, _stStackFrames = Nothing
}
stStackTraceHashId :: Lens' StackTrace (Maybe Word64)
stStackTraceHashId
= lens _stStackTraceHashId
(\ s a -> s{_stStackTraceHashId = a})
. mapping _Coerce
stStackFrames :: Lens' StackTrace (Maybe StackFrames)
stStackFrames
= lens _stStackFrames
(\ s a -> s{_stStackFrames = a})
instance FromJSON StackTrace where
parseJSON
= withObject "StackTrace"
(\ o ->
StackTrace' <$>
(o .:? "stackTraceHashId") <*> (o .:? "stackFrames"))
instance ToJSON StackTrace where
toJSON StackTrace'{..}
= object
(catMaybes
[("stackTraceHashId" .=) <$> _stStackTraceHashId,
("stackFrames" .=) <$> _stStackFrames])
newtype BatchWriteSpansRequest = BatchWriteSpansRequest'
{ _bwsrSpans :: Maybe [Span]
} deriving (Eq,Show,Data,Typeable,Generic)
batchWriteSpansRequest
:: BatchWriteSpansRequest
batchWriteSpansRequest =
BatchWriteSpansRequest'
{ _bwsrSpans = Nothing
}
bwsrSpans :: Lens' BatchWriteSpansRequest [Span]
bwsrSpans
= lens _bwsrSpans (\ s a -> s{_bwsrSpans = a}) .
_Default
. _Coerce
instance FromJSON BatchWriteSpansRequest where
parseJSON
= withObject "BatchWriteSpansRequest"
(\ o ->
BatchWriteSpansRequest' <$>
(o .:? "spans" .!= mempty))
instance ToJSON BatchWriteSpansRequest where
toJSON BatchWriteSpansRequest'{..}
= object (catMaybes [("spans" .=) <$> _bwsrSpans])
data Attributes = Attributes'
{ _aDroppedAttributesCount :: !(Maybe (Textual Int32))
, _aAttributeMap :: !(Maybe AttributesAttributeMap)
} deriving (Eq,Show,Data,Typeable,Generic)
attributes
:: Attributes
attributes =
Attributes'
{ _aDroppedAttributesCount = Nothing
, _aAttributeMap = Nothing
}
aDroppedAttributesCount :: Lens' Attributes (Maybe Int32)
aDroppedAttributesCount
= lens _aDroppedAttributesCount
(\ s a -> s{_aDroppedAttributesCount = a})
. mapping _Coerce
aAttributeMap :: Lens' Attributes (Maybe AttributesAttributeMap)
aAttributeMap
= lens _aAttributeMap
(\ s a -> s{_aAttributeMap = a})
instance FromJSON Attributes where
parseJSON
= withObject "Attributes"
(\ o ->
Attributes' <$>
(o .:? "droppedAttributesCount") <*>
(o .:? "attributeMap"))
instance ToJSON Attributes where
toJSON Attributes'{..}
= object
(catMaybes
[("droppedAttributesCount" .=) <$>
_aDroppedAttributesCount,
("attributeMap" .=) <$> _aAttributeMap])
data NetworkEvent = NetworkEvent'
{ _neTime :: !(Maybe DateTime')
, _neMessageSize :: !(Maybe (Textual Word64))
, _neType :: !(Maybe NetworkEventType)
, _neMessageId :: !(Maybe (Textual Word64))
} deriving (Eq,Show,Data,Typeable,Generic)
networkEvent
:: NetworkEvent
networkEvent =
NetworkEvent'
{ _neTime = Nothing
, _neMessageSize = Nothing
, _neType = Nothing
, _neMessageId = Nothing
}
neTime :: Lens' NetworkEvent (Maybe UTCTime)
neTime
= lens _neTime (\ s a -> s{_neTime = a}) .
mapping _DateTime
neMessageSize :: Lens' NetworkEvent (Maybe Word64)
neMessageSize
= lens _neMessageSize
(\ s a -> s{_neMessageSize = a})
. mapping _Coerce
neType :: Lens' NetworkEvent (Maybe NetworkEventType)
neType = lens _neType (\ s a -> s{_neType = a})
neMessageId :: Lens' NetworkEvent (Maybe Word64)
neMessageId
= lens _neMessageId (\ s a -> s{_neMessageId = a}) .
mapping _Coerce
instance FromJSON NetworkEvent where
parseJSON
= withObject "NetworkEvent"
(\ o ->
NetworkEvent' <$>
(o .:? "time") <*> (o .:? "messageSize") <*>
(o .:? "type")
<*> (o .:? "messageId"))
instance ToJSON NetworkEvent where
toJSON NetworkEvent'{..}
= object
(catMaybes
[("time" .=) <$> _neTime,
("messageSize" .=) <$> _neMessageSize,
("type" .=) <$> _neType,
("messageId" .=) <$> _neMessageId])
data Module = Module'
{ _mBuildId :: !(Maybe TruncatableString)
, _mModule :: !(Maybe TruncatableString)
} deriving (Eq,Show,Data,Typeable,Generic)
module'
:: Module
module' =
Module'
{ _mBuildId = Nothing
, _mModule = Nothing
}
mBuildId :: Lens' Module (Maybe TruncatableString)
mBuildId = lens _mBuildId (\ s a -> s{_mBuildId = a})
mModule :: Lens' Module (Maybe TruncatableString)
mModule = lens _mModule (\ s a -> s{_mModule = a})
instance FromJSON Module where
parseJSON
= withObject "Module"
(\ o ->
Module' <$> (o .:? "buildId") <*> (o .:? "module"))
instance ToJSON Module where
toJSON Module'{..}
= object
(catMaybes
[("buildId" .=) <$> _mBuildId,
("module" .=) <$> _mModule])
data TimeEvents = TimeEvents'
{ _teDroppedAnnotationsCount :: !(Maybe (Textual Int32))
, _teDroppedNetworkEventsCount :: !(Maybe (Textual Int32))
, _teTimeEvent :: !(Maybe [TimeEvent])
} deriving (Eq,Show,Data,Typeable,Generic)
timeEvents
:: TimeEvents
timeEvents =
TimeEvents'
{ _teDroppedAnnotationsCount = Nothing
, _teDroppedNetworkEventsCount = Nothing
, _teTimeEvent = Nothing
}
teDroppedAnnotationsCount :: Lens' TimeEvents (Maybe Int32)
teDroppedAnnotationsCount
= lens _teDroppedAnnotationsCount
(\ s a -> s{_teDroppedAnnotationsCount = a})
. mapping _Coerce
teDroppedNetworkEventsCount :: Lens' TimeEvents (Maybe Int32)
teDroppedNetworkEventsCount
= lens _teDroppedNetworkEventsCount
(\ s a -> s{_teDroppedNetworkEventsCount = a})
. mapping _Coerce
teTimeEvent :: Lens' TimeEvents [TimeEvent]
teTimeEvent
= lens _teTimeEvent (\ s a -> s{_teTimeEvent = a}) .
_Default
. _Coerce
instance FromJSON TimeEvents where
parseJSON
= withObject "TimeEvents"
(\ o ->
TimeEvents' <$>
(o .:? "droppedAnnotationsCount") <*>
(o .:? "droppedNetworkEventsCount")
<*> (o .:? "timeEvent" .!= mempty))
instance ToJSON TimeEvents where
toJSON TimeEvents'{..}
= object
(catMaybes
[("droppedAnnotationsCount" .=) <$>
_teDroppedAnnotationsCount,
("droppedNetworkEventsCount" .=) <$>
_teDroppedNetworkEventsCount,
("timeEvent" .=) <$> _teTimeEvent])
data StackFrames = StackFrames'
{ _sfDroppedFramesCount :: !(Maybe (Textual Int32))
, _sfFrame :: !(Maybe [StackFrame])
} deriving (Eq,Show,Data,Typeable,Generic)
stackFrames
:: StackFrames
stackFrames =
StackFrames'
{ _sfDroppedFramesCount = Nothing
, _sfFrame = Nothing
}
sfDroppedFramesCount :: Lens' StackFrames (Maybe Int32)
sfDroppedFramesCount
= lens _sfDroppedFramesCount
(\ s a -> s{_sfDroppedFramesCount = a})
. mapping _Coerce
sfFrame :: Lens' StackFrames [StackFrame]
sfFrame
= lens _sfFrame (\ s a -> s{_sfFrame = a}) . _Default
. _Coerce
instance FromJSON StackFrames where
parseJSON
= withObject "StackFrames"
(\ o ->
StackFrames' <$>
(o .:? "droppedFramesCount") <*>
(o .:? "frame" .!= mempty))
instance ToJSON StackFrames where
toJSON StackFrames'{..}
= object
(catMaybes
[("droppedFramesCount" .=) <$> _sfDroppedFramesCount,
("frame" .=) <$> _sfFrame])
data StackFrame = StackFrame'
{ _sfLoadModule :: !(Maybe Module)
, _sfOriginalFunctionName :: !(Maybe TruncatableString)
, _sfLineNumber :: !(Maybe (Textual Int64))
, _sfSourceVersion :: !(Maybe TruncatableString)
, _sfFunctionName :: !(Maybe TruncatableString)
, _sfColumnNumber :: !(Maybe (Textual Int64))
, _sfFileName :: !(Maybe TruncatableString)
} deriving (Eq,Show,Data,Typeable,Generic)
stackFrame
:: StackFrame
stackFrame =
StackFrame'
{ _sfLoadModule = Nothing
, _sfOriginalFunctionName = Nothing
, _sfLineNumber = Nothing
, _sfSourceVersion = Nothing
, _sfFunctionName = Nothing
, _sfColumnNumber = Nothing
, _sfFileName = Nothing
}
sfLoadModule :: Lens' StackFrame (Maybe Module)
sfLoadModule
= lens _sfLoadModule (\ s a -> s{_sfLoadModule = a})
sfOriginalFunctionName :: Lens' StackFrame (Maybe TruncatableString)
sfOriginalFunctionName
= lens _sfOriginalFunctionName
(\ s a -> s{_sfOriginalFunctionName = a})
sfLineNumber :: Lens' StackFrame (Maybe Int64)
sfLineNumber
= lens _sfLineNumber (\ s a -> s{_sfLineNumber = a})
. mapping _Coerce
sfSourceVersion :: Lens' StackFrame (Maybe TruncatableString)
sfSourceVersion
= lens _sfSourceVersion
(\ s a -> s{_sfSourceVersion = a})
sfFunctionName :: Lens' StackFrame (Maybe TruncatableString)
sfFunctionName
= lens _sfFunctionName
(\ s a -> s{_sfFunctionName = a})
sfColumnNumber :: Lens' StackFrame (Maybe Int64)
sfColumnNumber
= lens _sfColumnNumber
(\ s a -> s{_sfColumnNumber = a})
. mapping _Coerce
sfFileName :: Lens' StackFrame (Maybe TruncatableString)
sfFileName
= lens _sfFileName (\ s a -> s{_sfFileName = a})
instance FromJSON StackFrame where
parseJSON
= withObject "StackFrame"
(\ o ->
StackFrame' <$>
(o .:? "loadModule") <*>
(o .:? "originalFunctionName")
<*> (o .:? "lineNumber")
<*> (o .:? "sourceVersion")
<*> (o .:? "functionName")
<*> (o .:? "columnNumber")
<*> (o .:? "fileName"))
instance ToJSON StackFrame where
toJSON StackFrame'{..}
= object
(catMaybes
[("loadModule" .=) <$> _sfLoadModule,
("originalFunctionName" .=) <$>
_sfOriginalFunctionName,
("lineNumber" .=) <$> _sfLineNumber,
("sourceVersion" .=) <$> _sfSourceVersion,
("functionName" .=) <$> _sfFunctionName,
("columnNumber" .=) <$> _sfColumnNumber,
("fileName" .=) <$> _sfFileName])
data Links = Links'
{ _lDroppedLinksCount :: !(Maybe (Textual Int32))
, _lLink :: !(Maybe [Link])
} deriving (Eq,Show,Data,Typeable,Generic)
links
:: Links
links =
Links'
{ _lDroppedLinksCount = Nothing
, _lLink = Nothing
}
lDroppedLinksCount :: Lens' Links (Maybe Int32)
lDroppedLinksCount
= lens _lDroppedLinksCount
(\ s a -> s{_lDroppedLinksCount = a})
. mapping _Coerce
lLink :: Lens' Links [Link]
lLink
= lens _lLink (\ s a -> s{_lLink = a}) . _Default .
_Coerce
instance FromJSON Links where
parseJSON
= withObject "Links"
(\ o ->
Links' <$>
(o .:? "droppedLinksCount") <*>
(o .:? "link" .!= mempty))
instance ToJSON Links where
toJSON Links'{..}
= object
(catMaybes
[("droppedLinksCount" .=) <$> _lDroppedLinksCount,
("link" .=) <$> _lLink])
data ListTracesResponse = ListTracesResponse'
{ _ltrNextPageToken :: !(Maybe Text)
, _ltrTraces :: !(Maybe [Trace])
} deriving (Eq,Show,Data,Typeable,Generic)
listTracesResponse
:: ListTracesResponse
listTracesResponse =
ListTracesResponse'
{ _ltrNextPageToken = Nothing
, _ltrTraces = Nothing
}
ltrNextPageToken :: Lens' ListTracesResponse (Maybe Text)
ltrNextPageToken
= lens _ltrNextPageToken
(\ s a -> s{_ltrNextPageToken = a})
ltrTraces :: Lens' ListTracesResponse [Trace]
ltrTraces
= lens _ltrTraces (\ s a -> s{_ltrTraces = a}) .
_Default
. _Coerce
instance FromJSON ListTracesResponse where
parseJSON
= withObject "ListTracesResponse"
(\ o ->
ListTracesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "traces" .!= mempty))
instance ToJSON ListTracesResponse where
toJSON ListTracesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _ltrNextPageToken,
("traces" .=) <$> _ltrTraces])
data TimeEvent = TimeEvent'
{ _teAnnotation :: !(Maybe Annotation)
, _teTime :: !(Maybe DateTime')
, _teNetworkEvent :: !(Maybe NetworkEvent)
} deriving (Eq,Show,Data,Typeable,Generic)
timeEvent
:: TimeEvent
timeEvent =
TimeEvent'
{ _teAnnotation = Nothing
, _teTime = Nothing
, _teNetworkEvent = Nothing
}
teAnnotation :: Lens' TimeEvent (Maybe Annotation)
teAnnotation
= lens _teAnnotation (\ s a -> s{_teAnnotation = a})
teTime :: Lens' TimeEvent (Maybe UTCTime)
teTime
= lens _teTime (\ s a -> s{_teTime = a}) .
mapping _DateTime
teNetworkEvent :: Lens' TimeEvent (Maybe NetworkEvent)
teNetworkEvent
= lens _teNetworkEvent
(\ s a -> s{_teNetworkEvent = a})
instance FromJSON TimeEvent where
parseJSON
= withObject "TimeEvent"
(\ o ->
TimeEvent' <$>
(o .:? "annotation") <*> (o .:? "time") <*>
(o .:? "networkEvent"))
instance ToJSON TimeEvent where
toJSON TimeEvent'{..}
= object
(catMaybes
[("annotation" .=) <$> _teAnnotation,
("time" .=) <$> _teTime,
("networkEvent" .=) <$> _teNetworkEvent])
newtype Trace = Trace'
{ _tName :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
trace
:: Trace
trace =
Trace'
{ _tName = Nothing
}
tName :: Lens' Trace (Maybe Text)
tName = lens _tName (\ s a -> s{_tName = a})
instance FromJSON Trace where
parseJSON
= withObject "Trace"
(\ o -> Trace' <$> (o .:? "name"))
instance ToJSON Trace where
toJSON Trace'{..}
= object (catMaybes [("name" .=) <$> _tName])