module Network.Google.CloudMonitoring.Types.Product where
import Network.Google.CloudMonitoring.Types.Sum
import Network.Google.Prelude
data MetricDescriptorTypeDescriptor = MetricDescriptorTypeDescriptor'
{ _mdtdMetricType :: !(Maybe Text)
, _mdtdValueType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
metricDescriptorTypeDescriptor
:: MetricDescriptorTypeDescriptor
metricDescriptorTypeDescriptor =
MetricDescriptorTypeDescriptor'
{ _mdtdMetricType = Nothing
, _mdtdValueType = Nothing
}
mdtdMetricType :: Lens' MetricDescriptorTypeDescriptor (Maybe Text)
mdtdMetricType
= lens _mdtdMetricType
(\ s a -> s{_mdtdMetricType = a})
mdtdValueType :: Lens' MetricDescriptorTypeDescriptor (Maybe Text)
mdtdValueType
= lens _mdtdValueType
(\ s a -> s{_mdtdValueType = a})
instance FromJSON MetricDescriptorTypeDescriptor
where
parseJSON
= withObject "MetricDescriptorTypeDescriptor"
(\ o ->
MetricDescriptorTypeDescriptor' <$>
(o .:? "metricType") <*> (o .:? "valueType"))
instance ToJSON MetricDescriptorTypeDescriptor where
toJSON MetricDescriptorTypeDescriptor'{..}
= object
(catMaybes
[("metricType" .=) <$> _mdtdMetricType,
("valueType" .=) <$> _mdtdValueType])
data ListTimeseriesResponse = ListTimeseriesResponse'
{ _ltrNextPageToken :: !(Maybe Text)
, _ltrKind :: !Text
, _ltrOldest :: !(Maybe DateTime')
, _ltrYoungest :: !(Maybe DateTime')
, _ltrTimeseries :: !(Maybe [Timeseries])
} deriving (Eq,Show,Data,Typeable,Generic)
listTimeseriesResponse
:: ListTimeseriesResponse
listTimeseriesResponse =
ListTimeseriesResponse'
{ _ltrNextPageToken = Nothing
, _ltrKind = "cloudmonitoring#listTimeseriesResponse"
, _ltrOldest = Nothing
, _ltrYoungest = Nothing
, _ltrTimeseries = Nothing
}
ltrNextPageToken :: Lens' ListTimeseriesResponse (Maybe Text)
ltrNextPageToken
= lens _ltrNextPageToken
(\ s a -> s{_ltrNextPageToken = a})
ltrKind :: Lens' ListTimeseriesResponse Text
ltrKind = lens _ltrKind (\ s a -> s{_ltrKind = a})
ltrOldest :: Lens' ListTimeseriesResponse (Maybe UTCTime)
ltrOldest
= lens _ltrOldest (\ s a -> s{_ltrOldest = a}) .
mapping _DateTime
ltrYoungest :: Lens' ListTimeseriesResponse (Maybe UTCTime)
ltrYoungest
= lens _ltrYoungest (\ s a -> s{_ltrYoungest = a}) .
mapping _DateTime
ltrTimeseries :: Lens' ListTimeseriesResponse [Timeseries]
ltrTimeseries
= lens _ltrTimeseries
(\ s a -> s{_ltrTimeseries = a})
. _Default
. _Coerce
instance FromJSON ListTimeseriesResponse where
parseJSON
= withObject "ListTimeseriesResponse"
(\ o ->
ListTimeseriesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!=
"cloudmonitoring#listTimeseriesResponse")
<*> (o .:? "oldest")
<*> (o .:? "youngest")
<*> (o .:? "timeseries" .!= mempty))
instance ToJSON ListTimeseriesResponse where
toJSON ListTimeseriesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _ltrNextPageToken,
Just ("kind" .= _ltrKind),
("oldest" .=) <$> _ltrOldest,
("youngest" .=) <$> _ltrYoungest,
("timeseries" .=) <$> _ltrTimeseries])
data MetricDescriptor = MetricDescriptor'
{ _mdProject :: !(Maybe Text)
, _mdTypeDescriptor :: !(Maybe MetricDescriptorTypeDescriptor)
, _mdName :: !(Maybe Text)
, _mdLabels :: !(Maybe [MetricDescriptorLabelDescriptor])
, _mdDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
metricDescriptor
:: MetricDescriptor
metricDescriptor =
MetricDescriptor'
{ _mdProject = Nothing
, _mdTypeDescriptor = Nothing
, _mdName = Nothing
, _mdLabels = Nothing
, _mdDescription = Nothing
}
mdProject :: Lens' MetricDescriptor (Maybe Text)
mdProject
= lens _mdProject (\ s a -> s{_mdProject = a})
mdTypeDescriptor :: Lens' MetricDescriptor (Maybe MetricDescriptorTypeDescriptor)
mdTypeDescriptor
= lens _mdTypeDescriptor
(\ s a -> s{_mdTypeDescriptor = a})
mdName :: Lens' MetricDescriptor (Maybe Text)
mdName = lens _mdName (\ s a -> s{_mdName = a})
mdLabels :: Lens' MetricDescriptor [MetricDescriptorLabelDescriptor]
mdLabels
= lens _mdLabels (\ s a -> s{_mdLabels = a}) .
_Default
. _Coerce
mdDescription :: Lens' MetricDescriptor (Maybe Text)
mdDescription
= lens _mdDescription
(\ s a -> s{_mdDescription = a})
instance FromJSON MetricDescriptor where
parseJSON
= withObject "MetricDescriptor"
(\ o ->
MetricDescriptor' <$>
(o .:? "project") <*> (o .:? "typeDescriptor") <*>
(o .:? "name")
<*> (o .:? "labels" .!= mempty)
<*> (o .:? "description"))
instance ToJSON MetricDescriptor where
toJSON MetricDescriptor'{..}
= object
(catMaybes
[("project" .=) <$> _mdProject,
("typeDescriptor" .=) <$> _mdTypeDescriptor,
("name" .=) <$> _mdName, ("labels" .=) <$> _mdLabels,
("description" .=) <$> _mdDescription])
data WriteTimeseriesRequest = WriteTimeseriesRequest'
{ _wtrCommonLabels :: !(Maybe WriteTimeseriesRequestCommonLabels)
, _wtrTimeseries :: !(Maybe [TimeseriesPoint])
} deriving (Eq,Show,Data,Typeable,Generic)
writeTimeseriesRequest
:: WriteTimeseriesRequest
writeTimeseriesRequest =
WriteTimeseriesRequest'
{ _wtrCommonLabels = Nothing
, _wtrTimeseries = Nothing
}
wtrCommonLabels :: Lens' WriteTimeseriesRequest (Maybe WriteTimeseriesRequestCommonLabels)
wtrCommonLabels
= lens _wtrCommonLabels
(\ s a -> s{_wtrCommonLabels = a})
wtrTimeseries :: Lens' WriteTimeseriesRequest [TimeseriesPoint]
wtrTimeseries
= lens _wtrTimeseries
(\ s a -> s{_wtrTimeseries = a})
. _Default
. _Coerce
instance FromJSON WriteTimeseriesRequest where
parseJSON
= withObject "WriteTimeseriesRequest"
(\ o ->
WriteTimeseriesRequest' <$>
(o .:? "commonLabels") <*>
(o .:? "timeseries" .!= mempty))
instance ToJSON WriteTimeseriesRequest where
toJSON WriteTimeseriesRequest'{..}
= object
(catMaybes
[("commonLabels" .=) <$> _wtrCommonLabels,
("timeseries" .=) <$> _wtrTimeseries])
newtype WriteTimeseriesRequestCommonLabels = WriteTimeseriesRequestCommonLabels'
{ _wtrclAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
writeTimeseriesRequestCommonLabels
:: HashMap Text Text
-> WriteTimeseriesRequestCommonLabels
writeTimeseriesRequestCommonLabels pWtrclAddtional_ =
WriteTimeseriesRequestCommonLabels'
{ _wtrclAddtional = _Coerce # pWtrclAddtional_
}
wtrclAddtional :: Lens' WriteTimeseriesRequestCommonLabels (HashMap Text Text)
wtrclAddtional
= lens _wtrclAddtional
(\ s a -> s{_wtrclAddtional = a})
. _Coerce
instance FromJSON WriteTimeseriesRequestCommonLabels
where
parseJSON
= withObject "WriteTimeseriesRequestCommonLabels"
(\ o ->
WriteTimeseriesRequestCommonLabels' <$>
(parseJSONObject o))
instance ToJSON WriteTimeseriesRequestCommonLabels
where
toJSON = toJSON . _wtrclAddtional
data MetricDescriptorLabelDescriptor = MetricDescriptorLabelDescriptor'
{ _mdldKey :: !(Maybe Text)
, _mdldDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
metricDescriptorLabelDescriptor
:: MetricDescriptorLabelDescriptor
metricDescriptorLabelDescriptor =
MetricDescriptorLabelDescriptor'
{ _mdldKey = Nothing
, _mdldDescription = Nothing
}
mdldKey :: Lens' MetricDescriptorLabelDescriptor (Maybe Text)
mdldKey = lens _mdldKey (\ s a -> s{_mdldKey = a})
mdldDescription :: Lens' MetricDescriptorLabelDescriptor (Maybe Text)
mdldDescription
= lens _mdldDescription
(\ s a -> s{_mdldDescription = a})
instance FromJSON MetricDescriptorLabelDescriptor
where
parseJSON
= withObject "MetricDescriptorLabelDescriptor"
(\ o ->
MetricDescriptorLabelDescriptor' <$>
(o .:? "key") <*> (o .:? "description"))
instance ToJSON MetricDescriptorLabelDescriptor where
toJSON MetricDescriptorLabelDescriptor'{..}
= object
(catMaybes
[("key" .=) <$> _mdldKey,
("description" .=) <$> _mdldDescription])
data PointDistributionUnderflowBucket = PointDistributionUnderflowBucket'
{ _pdubUpperBound :: !(Maybe (Textual Double))
, _pdubCount :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
pointDistributionUnderflowBucket
:: PointDistributionUnderflowBucket
pointDistributionUnderflowBucket =
PointDistributionUnderflowBucket'
{ _pdubUpperBound = Nothing
, _pdubCount = Nothing
}
pdubUpperBound :: Lens' PointDistributionUnderflowBucket (Maybe Double)
pdubUpperBound
= lens _pdubUpperBound
(\ s a -> s{_pdubUpperBound = a})
. mapping _Coerce
pdubCount :: Lens' PointDistributionUnderflowBucket (Maybe Int64)
pdubCount
= lens _pdubCount (\ s a -> s{_pdubCount = a}) .
mapping _Coerce
instance FromJSON PointDistributionUnderflowBucket
where
parseJSON
= withObject "PointDistributionUnderflowBucket"
(\ o ->
PointDistributionUnderflowBucket' <$>
(o .:? "upperBound") <*> (o .:? "count"))
instance ToJSON PointDistributionUnderflowBucket
where
toJSON PointDistributionUnderflowBucket'{..}
= object
(catMaybes
[("upperBound" .=) <$> _pdubUpperBound,
("count" .=) <$> _pdubCount])
data ListMetricDescriptorsResponse = ListMetricDescriptorsResponse'
{ _lmdrMetrics :: !(Maybe [MetricDescriptor])
, _lmdrNextPageToken :: !(Maybe Text)
, _lmdrKind :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
listMetricDescriptorsResponse
:: ListMetricDescriptorsResponse
listMetricDescriptorsResponse =
ListMetricDescriptorsResponse'
{ _lmdrMetrics = Nothing
, _lmdrNextPageToken = Nothing
, _lmdrKind = "cloudmonitoring#listMetricDescriptorsResponse"
}
lmdrMetrics :: Lens' ListMetricDescriptorsResponse [MetricDescriptor]
lmdrMetrics
= lens _lmdrMetrics (\ s a -> s{_lmdrMetrics = a}) .
_Default
. _Coerce
lmdrNextPageToken :: Lens' ListMetricDescriptorsResponse (Maybe Text)
lmdrNextPageToken
= lens _lmdrNextPageToken
(\ s a -> s{_lmdrNextPageToken = a})
lmdrKind :: Lens' ListMetricDescriptorsResponse Text
lmdrKind = lens _lmdrKind (\ s a -> s{_lmdrKind = a})
instance FromJSON ListMetricDescriptorsResponse where
parseJSON
= withObject "ListMetricDescriptorsResponse"
(\ o ->
ListMetricDescriptorsResponse' <$>
(o .:? "metrics" .!= mempty) <*>
(o .:? "nextPageToken")
<*>
(o .:? "kind" .!=
"cloudmonitoring#listMetricDescriptorsResponse"))
instance ToJSON ListMetricDescriptorsResponse where
toJSON ListMetricDescriptorsResponse'{..}
= object
(catMaybes
[("metrics" .=) <$> _lmdrMetrics,
("nextPageToken" .=) <$> _lmdrNextPageToken,
Just ("kind" .= _lmdrKind)])
newtype ListTimeseriesDescriptorsRequest = ListTimeseriesDescriptorsRequest'
{ _ltdrKind :: Text
} deriving (Eq,Show,Data,Typeable,Generic)
listTimeseriesDescriptorsRequest
:: ListTimeseriesDescriptorsRequest
listTimeseriesDescriptorsRequest =
ListTimeseriesDescriptorsRequest'
{ _ltdrKind = "cloudmonitoring#listTimeseriesDescriptorsRequest"
}
ltdrKind :: Lens' ListTimeseriesDescriptorsRequest Text
ltdrKind = lens _ltdrKind (\ s a -> s{_ltdrKind = a})
instance FromJSON ListTimeseriesDescriptorsRequest
where
parseJSON
= withObject "ListTimeseriesDescriptorsRequest"
(\ o ->
ListTimeseriesDescriptorsRequest' <$>
(o .:? "kind" .!=
"cloudmonitoring#listTimeseriesDescriptorsRequest"))
instance ToJSON ListTimeseriesDescriptorsRequest
where
toJSON ListTimeseriesDescriptorsRequest'{..}
= object (catMaybes [Just ("kind" .= _ltdrKind)])
newtype TimeseriesDescriptorLabels = TimeseriesDescriptorLabels'
{ _tdlAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
timeseriesDescriptorLabels
:: HashMap Text Text
-> TimeseriesDescriptorLabels
timeseriesDescriptorLabels pTdlAddtional_ =
TimeseriesDescriptorLabels'
{ _tdlAddtional = _Coerce # pTdlAddtional_
}
tdlAddtional :: Lens' TimeseriesDescriptorLabels (HashMap Text Text)
tdlAddtional
= lens _tdlAddtional (\ s a -> s{_tdlAddtional = a})
. _Coerce
instance FromJSON TimeseriesDescriptorLabels where
parseJSON
= withObject "TimeseriesDescriptorLabels"
(\ o ->
TimeseriesDescriptorLabels' <$> (parseJSONObject o))
instance ToJSON TimeseriesDescriptorLabels where
toJSON = toJSON . _tdlAddtional
data PointDistributionBucket = PointDistributionBucket'
{ _pdbUpperBound :: !(Maybe (Textual Double))
, _pdbCount :: !(Maybe (Textual Int64))
, _pdbLowerBound :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
pointDistributionBucket
:: PointDistributionBucket
pointDistributionBucket =
PointDistributionBucket'
{ _pdbUpperBound = Nothing
, _pdbCount = Nothing
, _pdbLowerBound = Nothing
}
pdbUpperBound :: Lens' PointDistributionBucket (Maybe Double)
pdbUpperBound
= lens _pdbUpperBound
(\ s a -> s{_pdbUpperBound = a})
. mapping _Coerce
pdbCount :: Lens' PointDistributionBucket (Maybe Int64)
pdbCount
= lens _pdbCount (\ s a -> s{_pdbCount = a}) .
mapping _Coerce
pdbLowerBound :: Lens' PointDistributionBucket (Maybe Double)
pdbLowerBound
= lens _pdbLowerBound
(\ s a -> s{_pdbLowerBound = a})
. mapping _Coerce
instance FromJSON PointDistributionBucket where
parseJSON
= withObject "PointDistributionBucket"
(\ o ->
PointDistributionBucket' <$>
(o .:? "upperBound") <*> (o .:? "count") <*>
(o .:? "lowerBound"))
instance ToJSON PointDistributionBucket where
toJSON PointDistributionBucket'{..}
= object
(catMaybes
[("upperBound" .=) <$> _pdbUpperBound,
("count" .=) <$> _pdbCount,
("lowerBound" .=) <$> _pdbLowerBound])
newtype WriteTimeseriesResponse = WriteTimeseriesResponse'
{ _wtrKind :: Text
} deriving (Eq,Show,Data,Typeable,Generic)
writeTimeseriesResponse
:: WriteTimeseriesResponse
writeTimeseriesResponse =
WriteTimeseriesResponse'
{ _wtrKind = "cloudmonitoring#writeTimeseriesResponse"
}
wtrKind :: Lens' WriteTimeseriesResponse Text
wtrKind = lens _wtrKind (\ s a -> s{_wtrKind = a})
instance FromJSON WriteTimeseriesResponse where
parseJSON
= withObject "WriteTimeseriesResponse"
(\ o ->
WriteTimeseriesResponse' <$>
(o .:? "kind" .!=
"cloudmonitoring#writeTimeseriesResponse"))
instance ToJSON WriteTimeseriesResponse where
toJSON WriteTimeseriesResponse'{..}
= object (catMaybes [Just ("kind" .= _wtrKind)])
data TimeseriesDescriptorLabel = TimeseriesDescriptorLabel'
{ _tdlValue :: !(Maybe Text)
, _tdlKey :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
timeseriesDescriptorLabel
:: TimeseriesDescriptorLabel
timeseriesDescriptorLabel =
TimeseriesDescriptorLabel'
{ _tdlValue = Nothing
, _tdlKey = Nothing
}
tdlValue :: Lens' TimeseriesDescriptorLabel (Maybe Text)
tdlValue = lens _tdlValue (\ s a -> s{_tdlValue = a})
tdlKey :: Lens' TimeseriesDescriptorLabel (Maybe Text)
tdlKey = lens _tdlKey (\ s a -> s{_tdlKey = a})
instance FromJSON TimeseriesDescriptorLabel where
parseJSON
= withObject "TimeseriesDescriptorLabel"
(\ o ->
TimeseriesDescriptorLabel' <$>
(o .:? "value") <*> (o .:? "key"))
instance ToJSON TimeseriesDescriptorLabel where
toJSON TimeseriesDescriptorLabel'{..}
= object
(catMaybes
[("value" .=) <$> _tdlValue, ("key" .=) <$> _tdlKey])
data PointDistribution = PointDistribution'
{ _pdOverflowBucket :: !(Maybe PointDistributionOverflowBucket)
, _pdBuckets :: !(Maybe [PointDistributionBucket])
, _pdUnderflowBucket :: !(Maybe PointDistributionUnderflowBucket)
} deriving (Eq,Show,Data,Typeable,Generic)
pointDistribution
:: PointDistribution
pointDistribution =
PointDistribution'
{ _pdOverflowBucket = Nothing
, _pdBuckets = Nothing
, _pdUnderflowBucket = Nothing
}
pdOverflowBucket :: Lens' PointDistribution (Maybe PointDistributionOverflowBucket)
pdOverflowBucket
= lens _pdOverflowBucket
(\ s a -> s{_pdOverflowBucket = a})
pdBuckets :: Lens' PointDistribution [PointDistributionBucket]
pdBuckets
= lens _pdBuckets (\ s a -> s{_pdBuckets = a}) .
_Default
. _Coerce
pdUnderflowBucket :: Lens' PointDistribution (Maybe PointDistributionUnderflowBucket)
pdUnderflowBucket
= lens _pdUnderflowBucket
(\ s a -> s{_pdUnderflowBucket = a})
instance FromJSON PointDistribution where
parseJSON
= withObject "PointDistribution"
(\ o ->
PointDistribution' <$>
(o .:? "overflowBucket") <*>
(o .:? "buckets" .!= mempty)
<*> (o .:? "underflowBucket"))
instance ToJSON PointDistribution where
toJSON PointDistribution'{..}
= object
(catMaybes
[("overflowBucket" .=) <$> _pdOverflowBucket,
("buckets" .=) <$> _pdBuckets,
("underflowBucket" .=) <$> _pdUnderflowBucket])
data Point = Point'
{ _pBoolValue :: !(Maybe Bool)
, _pStart :: !(Maybe DateTime')
, _pDoubleValue :: !(Maybe (Textual Double))
, _pStringValue :: !(Maybe Text)
, _pDistributionValue :: !(Maybe PointDistribution)
, _pEnd :: !(Maybe DateTime')
, _pInt64Value :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
point
:: Point
point =
Point'
{ _pBoolValue = Nothing
, _pStart = Nothing
, _pDoubleValue = Nothing
, _pStringValue = Nothing
, _pDistributionValue = Nothing
, _pEnd = Nothing
, _pInt64Value = Nothing
}
pBoolValue :: Lens' Point (Maybe Bool)
pBoolValue
= lens _pBoolValue (\ s a -> s{_pBoolValue = a})
pStart :: Lens' Point (Maybe UTCTime)
pStart
= lens _pStart (\ s a -> s{_pStart = a}) .
mapping _DateTime
pDoubleValue :: Lens' Point (Maybe Double)
pDoubleValue
= lens _pDoubleValue (\ s a -> s{_pDoubleValue = a})
. mapping _Coerce
pStringValue :: Lens' Point (Maybe Text)
pStringValue
= lens _pStringValue (\ s a -> s{_pStringValue = a})
pDistributionValue :: Lens' Point (Maybe PointDistribution)
pDistributionValue
= lens _pDistributionValue
(\ s a -> s{_pDistributionValue = a})
pEnd :: Lens' Point (Maybe UTCTime)
pEnd
= lens _pEnd (\ s a -> s{_pEnd = a}) .
mapping _DateTime
pInt64Value :: Lens' Point (Maybe Int64)
pInt64Value
= lens _pInt64Value (\ s a -> s{_pInt64Value = a}) .
mapping _Coerce
instance FromJSON Point where
parseJSON
= withObject "Point"
(\ o ->
Point' <$>
(o .:? "boolValue") <*> (o .:? "start") <*>
(o .:? "doubleValue")
<*> (o .:? "stringValue")
<*> (o .:? "distributionValue")
<*> (o .:? "end")
<*> (o .:? "int64Value"))
instance ToJSON Point where
toJSON Point'{..}
= object
(catMaybes
[("boolValue" .=) <$> _pBoolValue,
("start" .=) <$> _pStart,
("doubleValue" .=) <$> _pDoubleValue,
("stringValue" .=) <$> _pStringValue,
("distributionValue" .=) <$> _pDistributionValue,
("end" .=) <$> _pEnd,
("int64Value" .=) <$> _pInt64Value])
data PointDistributionOverflowBucket = PointDistributionOverflowBucket'
{ _pdobCount :: !(Maybe (Textual Int64))
, _pdobLowerBound :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
pointDistributionOverflowBucket
:: PointDistributionOverflowBucket
pointDistributionOverflowBucket =
PointDistributionOverflowBucket'
{ _pdobCount = Nothing
, _pdobLowerBound = Nothing
}
pdobCount :: Lens' PointDistributionOverflowBucket (Maybe Int64)
pdobCount
= lens _pdobCount (\ s a -> s{_pdobCount = a}) .
mapping _Coerce
pdobLowerBound :: Lens' PointDistributionOverflowBucket (Maybe Double)
pdobLowerBound
= lens _pdobLowerBound
(\ s a -> s{_pdobLowerBound = a})
. mapping _Coerce
instance FromJSON PointDistributionOverflowBucket
where
parseJSON
= withObject "PointDistributionOverflowBucket"
(\ o ->
PointDistributionOverflowBucket' <$>
(o .:? "count") <*> (o .:? "lowerBound"))
instance ToJSON PointDistributionOverflowBucket where
toJSON PointDistributionOverflowBucket'{..}
= object
(catMaybes
[("count" .=) <$> _pdobCount,
("lowerBound" .=) <$> _pdobLowerBound])
data ListTimeseriesDescriptorsResponse = ListTimeseriesDescriptorsResponse'
{ _lNextPageToken :: !(Maybe Text)
, _lKind :: !Text
, _lOldest :: !(Maybe DateTime')
, _lYoungest :: !(Maybe DateTime')
, _lTimeseries :: !(Maybe [TimeseriesDescriptor])
} deriving (Eq,Show,Data,Typeable,Generic)
listTimeseriesDescriptorsResponse
:: ListTimeseriesDescriptorsResponse
listTimeseriesDescriptorsResponse =
ListTimeseriesDescriptorsResponse'
{ _lNextPageToken = Nothing
, _lKind = "cloudmonitoring#listTimeseriesDescriptorsResponse"
, _lOldest = Nothing
, _lYoungest = Nothing
, _lTimeseries = Nothing
}
lNextPageToken :: Lens' ListTimeseriesDescriptorsResponse (Maybe Text)
lNextPageToken
= lens _lNextPageToken
(\ s a -> s{_lNextPageToken = a})
lKind :: Lens' ListTimeseriesDescriptorsResponse Text
lKind = lens _lKind (\ s a -> s{_lKind = a})
lOldest :: Lens' ListTimeseriesDescriptorsResponse (Maybe UTCTime)
lOldest
= lens _lOldest (\ s a -> s{_lOldest = a}) .
mapping _DateTime
lYoungest :: Lens' ListTimeseriesDescriptorsResponse (Maybe UTCTime)
lYoungest
= lens _lYoungest (\ s a -> s{_lYoungest = a}) .
mapping _DateTime
lTimeseries :: Lens' ListTimeseriesDescriptorsResponse [TimeseriesDescriptor]
lTimeseries
= lens _lTimeseries (\ s a -> s{_lTimeseries = a}) .
_Default
. _Coerce
instance FromJSON ListTimeseriesDescriptorsResponse
where
parseJSON
= withObject "ListTimeseriesDescriptorsResponse"
(\ o ->
ListTimeseriesDescriptorsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!=
"cloudmonitoring#listTimeseriesDescriptorsResponse")
<*> (o .:? "oldest")
<*> (o .:? "youngest")
<*> (o .:? "timeseries" .!= mempty))
instance ToJSON ListTimeseriesDescriptorsResponse
where
toJSON ListTimeseriesDescriptorsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lNextPageToken,
Just ("kind" .= _lKind), ("oldest" .=) <$> _lOldest,
("youngest" .=) <$> _lYoungest,
("timeseries" .=) <$> _lTimeseries])
newtype ListMetricDescriptorsRequest = ListMetricDescriptorsRequest'
{ _lisKind :: Text
} deriving (Eq,Show,Data,Typeable,Generic)
listMetricDescriptorsRequest
:: ListMetricDescriptorsRequest
listMetricDescriptorsRequest =
ListMetricDescriptorsRequest'
{ _lisKind = "cloudmonitoring#listMetricDescriptorsRequest"
}
lisKind :: Lens' ListMetricDescriptorsRequest Text
lisKind = lens _lisKind (\ s a -> s{_lisKind = a})
instance FromJSON ListMetricDescriptorsRequest where
parseJSON
= withObject "ListMetricDescriptorsRequest"
(\ o ->
ListMetricDescriptorsRequest' <$>
(o .:? "kind" .!=
"cloudmonitoring#listMetricDescriptorsRequest"))
instance ToJSON ListMetricDescriptorsRequest where
toJSON ListMetricDescriptorsRequest'{..}
= object (catMaybes [Just ("kind" .= _lisKind)])
data TimeseriesPoint = TimeseriesPoint'
{ _tpPoint :: !(Maybe Point)
, _tpTimeseriesDesc :: !(Maybe TimeseriesDescriptor)
} deriving (Eq,Show,Data,Typeable,Generic)
timeseriesPoint
:: TimeseriesPoint
timeseriesPoint =
TimeseriesPoint'
{ _tpPoint = Nothing
, _tpTimeseriesDesc = Nothing
}
tpPoint :: Lens' TimeseriesPoint (Maybe Point)
tpPoint = lens _tpPoint (\ s a -> s{_tpPoint = a})
tpTimeseriesDesc :: Lens' TimeseriesPoint (Maybe TimeseriesDescriptor)
tpTimeseriesDesc
= lens _tpTimeseriesDesc
(\ s a -> s{_tpTimeseriesDesc = a})
instance FromJSON TimeseriesPoint where
parseJSON
= withObject "TimeseriesPoint"
(\ o ->
TimeseriesPoint' <$>
(o .:? "point") <*> (o .:? "timeseriesDesc"))
instance ToJSON TimeseriesPoint where
toJSON TimeseriesPoint'{..}
= object
(catMaybes
[("point" .=) <$> _tpPoint,
("timeseriesDesc" .=) <$> _tpTimeseriesDesc])
newtype DeleteMetricDescriptorResponse = DeleteMetricDescriptorResponse'
{ _dmdrKind :: Text
} deriving (Eq,Show,Data,Typeable,Generic)
deleteMetricDescriptorResponse
:: DeleteMetricDescriptorResponse
deleteMetricDescriptorResponse =
DeleteMetricDescriptorResponse'
{ _dmdrKind = "cloudmonitoring#deleteMetricDescriptorResponse"
}
dmdrKind :: Lens' DeleteMetricDescriptorResponse Text
dmdrKind = lens _dmdrKind (\ s a -> s{_dmdrKind = a})
instance FromJSON DeleteMetricDescriptorResponse
where
parseJSON
= withObject "DeleteMetricDescriptorResponse"
(\ o ->
DeleteMetricDescriptorResponse' <$>
(o .:? "kind" .!=
"cloudmonitoring#deleteMetricDescriptorResponse"))
instance ToJSON DeleteMetricDescriptorResponse where
toJSON DeleteMetricDescriptorResponse'{..}
= object (catMaybes [Just ("kind" .= _dmdrKind)])
newtype ListTimeseriesRequest = ListTimeseriesRequest'
{ _ltrtKind :: Text
} deriving (Eq,Show,Data,Typeable,Generic)
listTimeseriesRequest
:: ListTimeseriesRequest
listTimeseriesRequest =
ListTimeseriesRequest'
{ _ltrtKind = "cloudmonitoring#listTimeseriesRequest"
}
ltrtKind :: Lens' ListTimeseriesRequest Text
ltrtKind = lens _ltrtKind (\ s a -> s{_ltrtKind = a})
instance FromJSON ListTimeseriesRequest where
parseJSON
= withObject "ListTimeseriesRequest"
(\ o ->
ListTimeseriesRequest' <$>
(o .:? "kind" .!=
"cloudmonitoring#listTimeseriesRequest"))
instance ToJSON ListTimeseriesRequest where
toJSON ListTimeseriesRequest'{..}
= object (catMaybes [Just ("kind" .= _ltrtKind)])
data TimeseriesDescriptor = TimeseriesDescriptor'
{ _tdProject :: !(Maybe Text)
, _tdMetric :: !(Maybe Text)
, _tdLabels :: !(Maybe TimeseriesDescriptorLabels)
} deriving (Eq,Show,Data,Typeable,Generic)
timeseriesDescriptor
:: TimeseriesDescriptor
timeseriesDescriptor =
TimeseriesDescriptor'
{ _tdProject = Nothing
, _tdMetric = Nothing
, _tdLabels = Nothing
}
tdProject :: Lens' TimeseriesDescriptor (Maybe Text)
tdProject
= lens _tdProject (\ s a -> s{_tdProject = a})
tdMetric :: Lens' TimeseriesDescriptor (Maybe Text)
tdMetric = lens _tdMetric (\ s a -> s{_tdMetric = a})
tdLabels :: Lens' TimeseriesDescriptor (Maybe TimeseriesDescriptorLabels)
tdLabels = lens _tdLabels (\ s a -> s{_tdLabels = a})
instance FromJSON TimeseriesDescriptor where
parseJSON
= withObject "TimeseriesDescriptor"
(\ o ->
TimeseriesDescriptor' <$>
(o .:? "project") <*> (o .:? "metric") <*>
(o .:? "labels"))
instance ToJSON TimeseriesDescriptor where
toJSON TimeseriesDescriptor'{..}
= object
(catMaybes
[("project" .=) <$> _tdProject,
("metric" .=) <$> _tdMetric,
("labels" .=) <$> _tdLabels])
data Timeseries = Timeseries'
{ _tPoints :: !(Maybe [Point])
, _tTimeseriesDesc :: !(Maybe TimeseriesDescriptor)
} deriving (Eq,Show,Data,Typeable,Generic)
timeseries
:: Timeseries
timeseries =
Timeseries'
{ _tPoints = Nothing
, _tTimeseriesDesc = Nothing
}
tPoints :: Lens' Timeseries [Point]
tPoints
= lens _tPoints (\ s a -> s{_tPoints = a}) . _Default
. _Coerce
tTimeseriesDesc :: Lens' Timeseries (Maybe TimeseriesDescriptor)
tTimeseriesDesc
= lens _tTimeseriesDesc
(\ s a -> s{_tTimeseriesDesc = a})
instance FromJSON Timeseries where
parseJSON
= withObject "Timeseries"
(\ o ->
Timeseries' <$>
(o .:? "points" .!= mempty) <*>
(o .:? "timeseriesDesc"))
instance ToJSON Timeseries where
toJSON Timeseries'{..}
= object
(catMaybes
[("points" .=) <$> _tPoints,
("timeseriesDesc" .=) <$> _tTimeseriesDesc])