{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.XRay.Types.Product where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.XRay.Types.Sum
data Alias = Alias'
{ _aNames :: !(Maybe [Text])
, _aName :: !(Maybe Text)
, _aType :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
alias
:: Alias
alias = Alias' {_aNames = Nothing, _aName = Nothing, _aType = Nothing}
aNames :: Lens' Alias [Text]
aNames = lens _aNames (\ s a -> s{_aNames = a}) . _Default . _Coerce
aName :: Lens' Alias (Maybe Text)
aName = lens _aName (\ s a -> s{_aName = a})
aType :: Lens' Alias (Maybe Text)
aType = lens _aType (\ s a -> s{_aType = a})
instance FromJSON Alias where
parseJSON
= withObject "Alias"
(\ x ->
Alias' <$>
(x .:? "Names" .!= mempty) <*> (x .:? "Name") <*>
(x .:? "Type"))
instance Hashable Alias where
instance NFData Alias where
data AnnotationValue = AnnotationValue'
{ _avNumberValue :: !(Maybe Double)
, _avStringValue :: !(Maybe Text)
, _avBooleanValue :: !(Maybe Bool)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
annotationValue
:: AnnotationValue
annotationValue =
AnnotationValue'
{ _avNumberValue = Nothing
, _avStringValue = Nothing
, _avBooleanValue = Nothing
}
avNumberValue :: Lens' AnnotationValue (Maybe Double)
avNumberValue = lens _avNumberValue (\ s a -> s{_avNumberValue = a})
avStringValue :: Lens' AnnotationValue (Maybe Text)
avStringValue = lens _avStringValue (\ s a -> s{_avStringValue = a})
avBooleanValue :: Lens' AnnotationValue (Maybe Bool)
avBooleanValue = lens _avBooleanValue (\ s a -> s{_avBooleanValue = a})
instance FromJSON AnnotationValue where
parseJSON
= withObject "AnnotationValue"
(\ x ->
AnnotationValue' <$>
(x .:? "NumberValue") <*> (x .:? "StringValue") <*>
(x .:? "BooleanValue"))
instance Hashable AnnotationValue where
instance NFData AnnotationValue where
data BackendConnectionErrors = BackendConnectionErrors'
{ _bceOtherCount :: !(Maybe Int)
, _bceTimeoutCount :: !(Maybe Int)
, _bceHTTPCode5XXCount :: !(Maybe Int)
, _bceConnectionRefusedCount :: !(Maybe Int)
, _bceHTTPCode4XXCount :: !(Maybe Int)
, _bceUnknownHostCount :: !(Maybe Int)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
backendConnectionErrors
:: BackendConnectionErrors
backendConnectionErrors =
BackendConnectionErrors'
{ _bceOtherCount = Nothing
, _bceTimeoutCount = Nothing
, _bceHTTPCode5XXCount = Nothing
, _bceConnectionRefusedCount = Nothing
, _bceHTTPCode4XXCount = Nothing
, _bceUnknownHostCount = Nothing
}
bceOtherCount :: Lens' BackendConnectionErrors (Maybe Int)
bceOtherCount = lens _bceOtherCount (\ s a -> s{_bceOtherCount = a})
bceTimeoutCount :: Lens' BackendConnectionErrors (Maybe Int)
bceTimeoutCount = lens _bceTimeoutCount (\ s a -> s{_bceTimeoutCount = a})
bceHTTPCode5XXCount :: Lens' BackendConnectionErrors (Maybe Int)
bceHTTPCode5XXCount = lens _bceHTTPCode5XXCount (\ s a -> s{_bceHTTPCode5XXCount = a})
bceConnectionRefusedCount :: Lens' BackendConnectionErrors (Maybe Int)
bceConnectionRefusedCount = lens _bceConnectionRefusedCount (\ s a -> s{_bceConnectionRefusedCount = a})
bceHTTPCode4XXCount :: Lens' BackendConnectionErrors (Maybe Int)
bceHTTPCode4XXCount = lens _bceHTTPCode4XXCount (\ s a -> s{_bceHTTPCode4XXCount = a})
bceUnknownHostCount :: Lens' BackendConnectionErrors (Maybe Int)
bceUnknownHostCount = lens _bceUnknownHostCount (\ s a -> s{_bceUnknownHostCount = a})
instance Hashable BackendConnectionErrors where
instance NFData BackendConnectionErrors where
instance ToJSON BackendConnectionErrors where
toJSON BackendConnectionErrors'{..}
= object
(catMaybes
[("OtherCount" .=) <$> _bceOtherCount,
("TimeoutCount" .=) <$> _bceTimeoutCount,
("HTTPCode5XXCount" .=) <$> _bceHTTPCode5XXCount,
("ConnectionRefusedCount" .=) <$>
_bceConnectionRefusedCount,
("HTTPCode4XXCount" .=) <$> _bceHTTPCode4XXCount,
("UnknownHostCount" .=) <$> _bceUnknownHostCount])
data Edge = Edge'
{ _eStartTime :: !(Maybe POSIX)
, _eAliases :: !(Maybe [Alias])
, _eResponseTimeHistogram :: !(Maybe [HistogramEntry])
, _eReferenceId :: !(Maybe Int)
, _eEndTime :: !(Maybe POSIX)
, _eSummaryStatistics :: !(Maybe EdgeStatistics)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
edge
:: Edge
edge =
Edge'
{ _eStartTime = Nothing
, _eAliases = Nothing
, _eResponseTimeHistogram = Nothing
, _eReferenceId = Nothing
, _eEndTime = Nothing
, _eSummaryStatistics = Nothing
}
eStartTime :: Lens' Edge (Maybe UTCTime)
eStartTime = lens _eStartTime (\ s a -> s{_eStartTime = a}) . mapping _Time
eAliases :: Lens' Edge [Alias]
eAliases = lens _eAliases (\ s a -> s{_eAliases = a}) . _Default . _Coerce
eResponseTimeHistogram :: Lens' Edge [HistogramEntry]
eResponseTimeHistogram = lens _eResponseTimeHistogram (\ s a -> s{_eResponseTimeHistogram = a}) . _Default . _Coerce
eReferenceId :: Lens' Edge (Maybe Int)
eReferenceId = lens _eReferenceId (\ s a -> s{_eReferenceId = a})
eEndTime :: Lens' Edge (Maybe UTCTime)
eEndTime = lens _eEndTime (\ s a -> s{_eEndTime = a}) . mapping _Time
eSummaryStatistics :: Lens' Edge (Maybe EdgeStatistics)
eSummaryStatistics = lens _eSummaryStatistics (\ s a -> s{_eSummaryStatistics = a})
instance FromJSON Edge where
parseJSON
= withObject "Edge"
(\ x ->
Edge' <$>
(x .:? "StartTime") <*> (x .:? "Aliases" .!= mempty)
<*> (x .:? "ResponseTimeHistogram" .!= mempty)
<*> (x .:? "ReferenceId")
<*> (x .:? "EndTime")
<*> (x .:? "SummaryStatistics"))
instance Hashable Edge where
instance NFData Edge where
data EdgeStatistics = EdgeStatistics'
{ _esFaultStatistics :: !(Maybe FaultStatistics)
, _esOKCount :: !(Maybe Integer)
, _esTotalResponseTime :: !(Maybe Double)
, _esErrorStatistics :: !(Maybe ErrorStatistics)
, _esTotalCount :: !(Maybe Integer)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
edgeStatistics
:: EdgeStatistics
edgeStatistics =
EdgeStatistics'
{ _esFaultStatistics = Nothing
, _esOKCount = Nothing
, _esTotalResponseTime = Nothing
, _esErrorStatistics = Nothing
, _esTotalCount = Nothing
}
esFaultStatistics :: Lens' EdgeStatistics (Maybe FaultStatistics)
esFaultStatistics = lens _esFaultStatistics (\ s a -> s{_esFaultStatistics = a})
esOKCount :: Lens' EdgeStatistics (Maybe Integer)
esOKCount = lens _esOKCount (\ s a -> s{_esOKCount = a})
esTotalResponseTime :: Lens' EdgeStatistics (Maybe Double)
esTotalResponseTime = lens _esTotalResponseTime (\ s a -> s{_esTotalResponseTime = a})
esErrorStatistics :: Lens' EdgeStatistics (Maybe ErrorStatistics)
esErrorStatistics = lens _esErrorStatistics (\ s a -> s{_esErrorStatistics = a})
esTotalCount :: Lens' EdgeStatistics (Maybe Integer)
esTotalCount = lens _esTotalCount (\ s a -> s{_esTotalCount = a})
instance FromJSON EdgeStatistics where
parseJSON
= withObject "EdgeStatistics"
(\ x ->
EdgeStatistics' <$>
(x .:? "FaultStatistics") <*> (x .:? "OkCount") <*>
(x .:? "TotalResponseTime")
<*> (x .:? "ErrorStatistics")
<*> (x .:? "TotalCount"))
instance Hashable EdgeStatistics where
instance NFData EdgeStatistics where
data EncryptionConfig = EncryptionConfig'
{ _ecStatus :: !(Maybe EncryptionStatus)
, _ecKeyId :: !(Maybe Text)
, _ecType :: !(Maybe EncryptionType)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
encryptionConfig
:: EncryptionConfig
encryptionConfig =
EncryptionConfig' {_ecStatus = Nothing, _ecKeyId = Nothing, _ecType = Nothing}
ecStatus :: Lens' EncryptionConfig (Maybe EncryptionStatus)
ecStatus = lens _ecStatus (\ s a -> s{_ecStatus = a})
ecKeyId :: Lens' EncryptionConfig (Maybe Text)
ecKeyId = lens _ecKeyId (\ s a -> s{_ecKeyId = a})
ecType :: Lens' EncryptionConfig (Maybe EncryptionType)
ecType = lens _ecType (\ s a -> s{_ecType = a})
instance FromJSON EncryptionConfig where
parseJSON
= withObject "EncryptionConfig"
(\ x ->
EncryptionConfig' <$>
(x .:? "Status") <*> (x .:? "KeyId") <*>
(x .:? "Type"))
instance Hashable EncryptionConfig where
instance NFData EncryptionConfig where
data ErrorStatistics = ErrorStatistics'
{ _eOtherCount :: !(Maybe Integer)
, _eThrottleCount :: !(Maybe Integer)
, _eTotalCount :: !(Maybe Integer)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
errorStatistics
:: ErrorStatistics
errorStatistics =
ErrorStatistics'
{_eOtherCount = Nothing, _eThrottleCount = Nothing, _eTotalCount = Nothing}
eOtherCount :: Lens' ErrorStatistics (Maybe Integer)
eOtherCount = lens _eOtherCount (\ s a -> s{_eOtherCount = a})
eThrottleCount :: Lens' ErrorStatistics (Maybe Integer)
eThrottleCount = lens _eThrottleCount (\ s a -> s{_eThrottleCount = a})
eTotalCount :: Lens' ErrorStatistics (Maybe Integer)
eTotalCount = lens _eTotalCount (\ s a -> s{_eTotalCount = a})
instance FromJSON ErrorStatistics where
parseJSON
= withObject "ErrorStatistics"
(\ x ->
ErrorStatistics' <$>
(x .:? "OtherCount") <*> (x .:? "ThrottleCount") <*>
(x .:? "TotalCount"))
instance Hashable ErrorStatistics where
instance NFData ErrorStatistics where
data FaultStatistics = FaultStatistics'
{ _fsOtherCount :: !(Maybe Integer)
, _fsTotalCount :: !(Maybe Integer)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
faultStatistics
:: FaultStatistics
faultStatistics =
FaultStatistics' {_fsOtherCount = Nothing, _fsTotalCount = Nothing}
fsOtherCount :: Lens' FaultStatistics (Maybe Integer)
fsOtherCount = lens _fsOtherCount (\ s a -> s{_fsOtherCount = a})
fsTotalCount :: Lens' FaultStatistics (Maybe Integer)
fsTotalCount = lens _fsTotalCount (\ s a -> s{_fsTotalCount = a})
instance FromJSON FaultStatistics where
parseJSON
= withObject "FaultStatistics"
(\ x ->
FaultStatistics' <$>
(x .:? "OtherCount") <*> (x .:? "TotalCount"))
instance Hashable FaultStatistics where
instance NFData FaultStatistics where
data HTTP = HTTP'
{ _httpHTTPMethod :: !(Maybe Text)
, _httpHTTPStatus :: !(Maybe Int)
, _httpClientIP :: !(Maybe Text)
, _httpUserAgent :: !(Maybe Text)
, _httpHTTPURL :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
hTTP
:: HTTP
hTTP =
HTTP'
{ _httpHTTPMethod = Nothing
, _httpHTTPStatus = Nothing
, _httpClientIP = Nothing
, _httpUserAgent = Nothing
, _httpHTTPURL = Nothing
}
httpHTTPMethod :: Lens' HTTP (Maybe Text)
httpHTTPMethod = lens _httpHTTPMethod (\ s a -> s{_httpHTTPMethod = a})
httpHTTPStatus :: Lens' HTTP (Maybe Int)
httpHTTPStatus = lens _httpHTTPStatus (\ s a -> s{_httpHTTPStatus = a})
httpClientIP :: Lens' HTTP (Maybe Text)
httpClientIP = lens _httpClientIP (\ s a -> s{_httpClientIP = a})
httpUserAgent :: Lens' HTTP (Maybe Text)
httpUserAgent = lens _httpUserAgent (\ s a -> s{_httpUserAgent = a})
httpHTTPURL :: Lens' HTTP (Maybe Text)
httpHTTPURL = lens _httpHTTPURL (\ s a -> s{_httpHTTPURL = a})
instance FromJSON HTTP where
parseJSON
= withObject "HTTP"
(\ x ->
HTTP' <$>
(x .:? "HttpMethod") <*> (x .:? "HttpStatus") <*>
(x .:? "ClientIp")
<*> (x .:? "UserAgent")
<*> (x .:? "HttpURL"))
instance Hashable HTTP where
instance NFData HTTP where
data HistogramEntry = HistogramEntry'
{ _heCount :: !(Maybe Int)
, _heValue :: !(Maybe Double)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
histogramEntry
:: HistogramEntry
histogramEntry = HistogramEntry' {_heCount = Nothing, _heValue = Nothing}
heCount :: Lens' HistogramEntry (Maybe Int)
heCount = lens _heCount (\ s a -> s{_heCount = a})
heValue :: Lens' HistogramEntry (Maybe Double)
heValue = lens _heValue (\ s a -> s{_heValue = a})
instance FromJSON HistogramEntry where
parseJSON
= withObject "HistogramEntry"
(\ x ->
HistogramEntry' <$>
(x .:? "Count") <*> (x .:? "Value"))
instance Hashable HistogramEntry where
instance NFData HistogramEntry where
data Segment = Segment'
{ _sDocument :: !(Maybe Text)
, _sId :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
segment
:: Segment
segment = Segment' {_sDocument = Nothing, _sId = Nothing}
sDocument :: Lens' Segment (Maybe Text)
sDocument = lens _sDocument (\ s a -> s{_sDocument = a})
sId :: Lens' Segment (Maybe Text)
sId = lens _sId (\ s a -> s{_sId = a})
instance FromJSON Segment where
parseJSON
= withObject "Segment"
(\ x ->
Segment' <$> (x .:? "Document") <*> (x .:? "Id"))
instance Hashable Segment where
instance NFData Segment where
data ServiceId = ServiceId'
{ _siAccountId :: !(Maybe Text)
, _siNames :: !(Maybe [Text])
, _siName :: !(Maybe Text)
, _siType :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
serviceId
:: ServiceId
serviceId =
ServiceId'
{ _siAccountId = Nothing
, _siNames = Nothing
, _siName = Nothing
, _siType = Nothing
}
siAccountId :: Lens' ServiceId (Maybe Text)
siAccountId = lens _siAccountId (\ s a -> s{_siAccountId = a})
siNames :: Lens' ServiceId [Text]
siNames = lens _siNames (\ s a -> s{_siNames = a}) . _Default . _Coerce
siName :: Lens' ServiceId (Maybe Text)
siName = lens _siName (\ s a -> s{_siName = a})
siType :: Lens' ServiceId (Maybe Text)
siType = lens _siType (\ s a -> s{_siType = a})
instance FromJSON ServiceId where
parseJSON
= withObject "ServiceId"
(\ x ->
ServiceId' <$>
(x .:? "AccountId") <*> (x .:? "Names" .!= mempty)
<*> (x .:? "Name")
<*> (x .:? "Type"))
instance Hashable ServiceId where
instance NFData ServiceId where
data ServiceInfo = ServiceInfo'
{ _sState :: !(Maybe Text)
, _sStartTime :: !(Maybe POSIX)
, _sRoot :: !(Maybe Bool)
, _sResponseTimeHistogram :: !(Maybe [HistogramEntry])
, _sDurationHistogram :: !(Maybe [HistogramEntry])
, _sReferenceId :: !(Maybe Int)
, _sAccountId :: !(Maybe Text)
, _sNames :: !(Maybe [Text])
, _sName :: !(Maybe Text)
, _sEndTime :: !(Maybe POSIX)
, _sType :: !(Maybe Text)
, _sEdges :: !(Maybe [Edge])
, _sSummaryStatistics :: !(Maybe ServiceStatistics)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
serviceInfo
:: ServiceInfo
serviceInfo =
ServiceInfo'
{ _sState = Nothing
, _sStartTime = Nothing
, _sRoot = Nothing
, _sResponseTimeHistogram = Nothing
, _sDurationHistogram = Nothing
, _sReferenceId = Nothing
, _sAccountId = Nothing
, _sNames = Nothing
, _sName = Nothing
, _sEndTime = Nothing
, _sType = Nothing
, _sEdges = Nothing
, _sSummaryStatistics = Nothing
}
sState :: Lens' ServiceInfo (Maybe Text)
sState = lens _sState (\ s a -> s{_sState = a})
sStartTime :: Lens' ServiceInfo (Maybe UTCTime)
sStartTime = lens _sStartTime (\ s a -> s{_sStartTime = a}) . mapping _Time
sRoot :: Lens' ServiceInfo (Maybe Bool)
sRoot = lens _sRoot (\ s a -> s{_sRoot = a})
sResponseTimeHistogram :: Lens' ServiceInfo [HistogramEntry]
sResponseTimeHistogram = lens _sResponseTimeHistogram (\ s a -> s{_sResponseTimeHistogram = a}) . _Default . _Coerce
sDurationHistogram :: Lens' ServiceInfo [HistogramEntry]
sDurationHistogram = lens _sDurationHistogram (\ s a -> s{_sDurationHistogram = a}) . _Default . _Coerce
sReferenceId :: Lens' ServiceInfo (Maybe Int)
sReferenceId = lens _sReferenceId (\ s a -> s{_sReferenceId = a})
sAccountId :: Lens' ServiceInfo (Maybe Text)
sAccountId = lens _sAccountId (\ s a -> s{_sAccountId = a})
sNames :: Lens' ServiceInfo [Text]
sNames = lens _sNames (\ s a -> s{_sNames = a}) . _Default . _Coerce
sName :: Lens' ServiceInfo (Maybe Text)
sName = lens _sName (\ s a -> s{_sName = a})
sEndTime :: Lens' ServiceInfo (Maybe UTCTime)
sEndTime = lens _sEndTime (\ s a -> s{_sEndTime = a}) . mapping _Time
sType :: Lens' ServiceInfo (Maybe Text)
sType = lens _sType (\ s a -> s{_sType = a})
sEdges :: Lens' ServiceInfo [Edge]
sEdges = lens _sEdges (\ s a -> s{_sEdges = a}) . _Default . _Coerce
sSummaryStatistics :: Lens' ServiceInfo (Maybe ServiceStatistics)
sSummaryStatistics = lens _sSummaryStatistics (\ s a -> s{_sSummaryStatistics = a})
instance FromJSON ServiceInfo where
parseJSON
= withObject "ServiceInfo"
(\ x ->
ServiceInfo' <$>
(x .:? "State") <*> (x .:? "StartTime") <*>
(x .:? "Root")
<*> (x .:? "ResponseTimeHistogram" .!= mempty)
<*> (x .:? "DurationHistogram" .!= mempty)
<*> (x .:? "ReferenceId")
<*> (x .:? "AccountId")
<*> (x .:? "Names" .!= mempty)
<*> (x .:? "Name")
<*> (x .:? "EndTime")
<*> (x .:? "Type")
<*> (x .:? "Edges" .!= mempty)
<*> (x .:? "SummaryStatistics"))
instance Hashable ServiceInfo where
instance NFData ServiceInfo where
data ServiceStatistics = ServiceStatistics'
{ _ssFaultStatistics :: !(Maybe FaultStatistics)
, _ssOKCount :: !(Maybe Integer)
, _ssTotalResponseTime :: !(Maybe Double)
, _ssErrorStatistics :: !(Maybe ErrorStatistics)
, _ssTotalCount :: !(Maybe Integer)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
serviceStatistics
:: ServiceStatistics
serviceStatistics =
ServiceStatistics'
{ _ssFaultStatistics = Nothing
, _ssOKCount = Nothing
, _ssTotalResponseTime = Nothing
, _ssErrorStatistics = Nothing
, _ssTotalCount = Nothing
}
ssFaultStatistics :: Lens' ServiceStatistics (Maybe FaultStatistics)
ssFaultStatistics = lens _ssFaultStatistics (\ s a -> s{_ssFaultStatistics = a})
ssOKCount :: Lens' ServiceStatistics (Maybe Integer)
ssOKCount = lens _ssOKCount (\ s a -> s{_ssOKCount = a})
ssTotalResponseTime :: Lens' ServiceStatistics (Maybe Double)
ssTotalResponseTime = lens _ssTotalResponseTime (\ s a -> s{_ssTotalResponseTime = a})
ssErrorStatistics :: Lens' ServiceStatistics (Maybe ErrorStatistics)
ssErrorStatistics = lens _ssErrorStatistics (\ s a -> s{_ssErrorStatistics = a})
ssTotalCount :: Lens' ServiceStatistics (Maybe Integer)
ssTotalCount = lens _ssTotalCount (\ s a -> s{_ssTotalCount = a})
instance FromJSON ServiceStatistics where
parseJSON
= withObject "ServiceStatistics"
(\ x ->
ServiceStatistics' <$>
(x .:? "FaultStatistics") <*> (x .:? "OkCount") <*>
(x .:? "TotalResponseTime")
<*> (x .:? "ErrorStatistics")
<*> (x .:? "TotalCount"))
instance Hashable ServiceStatistics where
instance NFData ServiceStatistics where
data TelemetryRecord = TelemetryRecord'
{ _trSegmentsReceivedCount :: !(Maybe Int)
, _trSegmentsSentCount :: !(Maybe Int)
, _trSegmentsSpilloverCount :: !(Maybe Int)
, _trSegmentsRejectedCount :: !(Maybe Int)
, _trBackendConnectionErrors :: !(Maybe BackendConnectionErrors)
, _trTimestamp :: !POSIX
} deriving (Eq, Read, Show, Data, Typeable, Generic)
telemetryRecord
:: UTCTime
-> TelemetryRecord
telemetryRecord pTimestamp_ =
TelemetryRecord'
{ _trSegmentsReceivedCount = Nothing
, _trSegmentsSentCount = Nothing
, _trSegmentsSpilloverCount = Nothing
, _trSegmentsRejectedCount = Nothing
, _trBackendConnectionErrors = Nothing
, _trTimestamp = _Time # pTimestamp_
}
trSegmentsReceivedCount :: Lens' TelemetryRecord (Maybe Int)
trSegmentsReceivedCount = lens _trSegmentsReceivedCount (\ s a -> s{_trSegmentsReceivedCount = a})
trSegmentsSentCount :: Lens' TelemetryRecord (Maybe Int)
trSegmentsSentCount = lens _trSegmentsSentCount (\ s a -> s{_trSegmentsSentCount = a})
trSegmentsSpilloverCount :: Lens' TelemetryRecord (Maybe Int)
trSegmentsSpilloverCount = lens _trSegmentsSpilloverCount (\ s a -> s{_trSegmentsSpilloverCount = a})
trSegmentsRejectedCount :: Lens' TelemetryRecord (Maybe Int)
trSegmentsRejectedCount = lens _trSegmentsRejectedCount (\ s a -> s{_trSegmentsRejectedCount = a})
trBackendConnectionErrors :: Lens' TelemetryRecord (Maybe BackendConnectionErrors)
trBackendConnectionErrors = lens _trBackendConnectionErrors (\ s a -> s{_trBackendConnectionErrors = a})
trTimestamp :: Lens' TelemetryRecord UTCTime
trTimestamp = lens _trTimestamp (\ s a -> s{_trTimestamp = a}) . _Time
instance Hashable TelemetryRecord where
instance NFData TelemetryRecord where
instance ToJSON TelemetryRecord where
toJSON TelemetryRecord'{..}
= object
(catMaybes
[("SegmentsReceivedCount" .=) <$>
_trSegmentsReceivedCount,
("SegmentsSentCount" .=) <$> _trSegmentsSentCount,
("SegmentsSpilloverCount" .=) <$>
_trSegmentsSpilloverCount,
("SegmentsRejectedCount" .=) <$>
_trSegmentsRejectedCount,
("BackendConnectionErrors" .=) <$>
_trBackendConnectionErrors,
Just ("Timestamp" .= _trTimestamp)])
data Trace = Trace'
{ _tId :: !(Maybe Text)
, _tSegments :: !(Maybe [Segment])
, _tDuration :: !(Maybe Double)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
trace
:: Trace
trace = Trace' {_tId = Nothing, _tSegments = Nothing, _tDuration = Nothing}
tId :: Lens' Trace (Maybe Text)
tId = lens _tId (\ s a -> s{_tId = a})
tSegments :: Lens' Trace [Segment]
tSegments = lens _tSegments (\ s a -> s{_tSegments = a}) . _Default . _Coerce
tDuration :: Lens' Trace (Maybe Double)
tDuration = lens _tDuration (\ s a -> s{_tDuration = a})
instance FromJSON Trace where
parseJSON
= withObject "Trace"
(\ x ->
Trace' <$>
(x .:? "Id") <*> (x .:? "Segments" .!= mempty) <*>
(x .:? "Duration"))
instance Hashable Trace where
instance NFData Trace where
data TraceSummary = TraceSummary'
{ _tsAnnotations :: !(Maybe (Map Text [ValueWithServiceIds]))
, _tsHasThrottle :: !(Maybe Bool)
, _tsUsers :: !(Maybe [TraceUser])
, _tsHasFault :: !(Maybe Bool)
, _tsServiceIds :: !(Maybe [ServiceId])
, _tsIsPartial :: !(Maybe Bool)
, _tsHasError :: !(Maybe Bool)
, _tsId :: !(Maybe Text)
, _tsHTTP :: !(Maybe HTTP)
, _tsDuration :: !(Maybe Double)
, _tsResponseTime :: !(Maybe Double)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
traceSummary
:: TraceSummary
traceSummary =
TraceSummary'
{ _tsAnnotations = Nothing
, _tsHasThrottle = Nothing
, _tsUsers = Nothing
, _tsHasFault = Nothing
, _tsServiceIds = Nothing
, _tsIsPartial = Nothing
, _tsHasError = Nothing
, _tsId = Nothing
, _tsHTTP = Nothing
, _tsDuration = Nothing
, _tsResponseTime = Nothing
}
tsAnnotations :: Lens' TraceSummary (HashMap Text [ValueWithServiceIds])
tsAnnotations = lens _tsAnnotations (\ s a -> s{_tsAnnotations = a}) . _Default . _Map
tsHasThrottle :: Lens' TraceSummary (Maybe Bool)
tsHasThrottle = lens _tsHasThrottle (\ s a -> s{_tsHasThrottle = a})
tsUsers :: Lens' TraceSummary [TraceUser]
tsUsers = lens _tsUsers (\ s a -> s{_tsUsers = a}) . _Default . _Coerce
tsHasFault :: Lens' TraceSummary (Maybe Bool)
tsHasFault = lens _tsHasFault (\ s a -> s{_tsHasFault = a})
tsServiceIds :: Lens' TraceSummary [ServiceId]
tsServiceIds = lens _tsServiceIds (\ s a -> s{_tsServiceIds = a}) . _Default . _Coerce
tsIsPartial :: Lens' TraceSummary (Maybe Bool)
tsIsPartial = lens _tsIsPartial (\ s a -> s{_tsIsPartial = a})
tsHasError :: Lens' TraceSummary (Maybe Bool)
tsHasError = lens _tsHasError (\ s a -> s{_tsHasError = a})
tsId :: Lens' TraceSummary (Maybe Text)
tsId = lens _tsId (\ s a -> s{_tsId = a})
tsHTTP :: Lens' TraceSummary (Maybe HTTP)
tsHTTP = lens _tsHTTP (\ s a -> s{_tsHTTP = a})
tsDuration :: Lens' TraceSummary (Maybe Double)
tsDuration = lens _tsDuration (\ s a -> s{_tsDuration = a})
tsResponseTime :: Lens' TraceSummary (Maybe Double)
tsResponseTime = lens _tsResponseTime (\ s a -> s{_tsResponseTime = a})
instance FromJSON TraceSummary where
parseJSON
= withObject "TraceSummary"
(\ x ->
TraceSummary' <$>
(x .:? "Annotations" .!= mempty) <*>
(x .:? "HasThrottle")
<*> (x .:? "Users" .!= mempty)
<*> (x .:? "HasFault")
<*> (x .:? "ServiceIds" .!= mempty)
<*> (x .:? "IsPartial")
<*> (x .:? "HasError")
<*> (x .:? "Id")
<*> (x .:? "Http")
<*> (x .:? "Duration")
<*> (x .:? "ResponseTime"))
instance Hashable TraceSummary where
instance NFData TraceSummary where
data TraceUser = TraceUser'
{ _tuServiceIds :: !(Maybe [ServiceId])
, _tuUserName :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
traceUser
:: TraceUser
traceUser = TraceUser' {_tuServiceIds = Nothing, _tuUserName = Nothing}
tuServiceIds :: Lens' TraceUser [ServiceId]
tuServiceIds = lens _tuServiceIds (\ s a -> s{_tuServiceIds = a}) . _Default . _Coerce
tuUserName :: Lens' TraceUser (Maybe Text)
tuUserName = lens _tuUserName (\ s a -> s{_tuUserName = a})
instance FromJSON TraceUser where
parseJSON
= withObject "TraceUser"
(\ x ->
TraceUser' <$>
(x .:? "ServiceIds" .!= mempty) <*>
(x .:? "UserName"))
instance Hashable TraceUser where
instance NFData TraceUser where
data UnprocessedTraceSegment = UnprocessedTraceSegment'
{ _utsErrorCode :: !(Maybe Text)
, _utsId :: !(Maybe Text)
, _utsMessage :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
unprocessedTraceSegment
:: UnprocessedTraceSegment
unprocessedTraceSegment =
UnprocessedTraceSegment'
{_utsErrorCode = Nothing, _utsId = Nothing, _utsMessage = Nothing}
utsErrorCode :: Lens' UnprocessedTraceSegment (Maybe Text)
utsErrorCode = lens _utsErrorCode (\ s a -> s{_utsErrorCode = a})
utsId :: Lens' UnprocessedTraceSegment (Maybe Text)
utsId = lens _utsId (\ s a -> s{_utsId = a})
utsMessage :: Lens' UnprocessedTraceSegment (Maybe Text)
utsMessage = lens _utsMessage (\ s a -> s{_utsMessage = a})
instance FromJSON UnprocessedTraceSegment where
parseJSON
= withObject "UnprocessedTraceSegment"
(\ x ->
UnprocessedTraceSegment' <$>
(x .:? "ErrorCode") <*> (x .:? "Id") <*>
(x .:? "Message"))
instance Hashable UnprocessedTraceSegment where
instance NFData UnprocessedTraceSegment where
data ValueWithServiceIds = ValueWithServiceIds'
{ _vwsiServiceIds :: !(Maybe [ServiceId])
, _vwsiAnnotationValue :: !(Maybe AnnotationValue)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
valueWithServiceIds
:: ValueWithServiceIds
valueWithServiceIds =
ValueWithServiceIds'
{_vwsiServiceIds = Nothing, _vwsiAnnotationValue = Nothing}
vwsiServiceIds :: Lens' ValueWithServiceIds [ServiceId]
vwsiServiceIds = lens _vwsiServiceIds (\ s a -> s{_vwsiServiceIds = a}) . _Default . _Coerce
vwsiAnnotationValue :: Lens' ValueWithServiceIds (Maybe AnnotationValue)
vwsiAnnotationValue = lens _vwsiAnnotationValue (\ s a -> s{_vwsiAnnotationValue = a})
instance FromJSON ValueWithServiceIds where
parseJSON
= withObject "ValueWithServiceIds"
(\ x ->
ValueWithServiceIds' <$>
(x .:? "ServiceIds" .!= mempty) <*>
(x .:? "AnnotationValue"))
instance Hashable ValueWithServiceIds where
instance NFData ValueWithServiceIds where