module Network.Google.Monitoring.Types.Product where
import Network.Google.Monitoring.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 ListTimeSeriesResponse = ListTimeSeriesResponse'
{ _ltsrNextPageToken :: !(Maybe Text)
, _ltsrTimeSeries :: !(Maybe [TimeSeries])
} deriving (Eq,Show,Data,Typeable,Generic)
listTimeSeriesResponse
:: ListTimeSeriesResponse
listTimeSeriesResponse =
ListTimeSeriesResponse'
{ _ltsrNextPageToken = Nothing
, _ltsrTimeSeries = Nothing
}
ltsrNextPageToken :: Lens' ListTimeSeriesResponse (Maybe Text)
ltsrNextPageToken
= lens _ltsrNextPageToken
(\ s a -> s{_ltsrNextPageToken = a})
ltsrTimeSeries :: Lens' ListTimeSeriesResponse [TimeSeries]
ltsrTimeSeries
= lens _ltsrTimeSeries
(\ s a -> s{_ltsrTimeSeries = a})
. _Default
. _Coerce
instance FromJSON ListTimeSeriesResponse where
parseJSON
= withObject "ListTimeSeriesResponse"
(\ o ->
ListTimeSeriesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "timeSeries" .!= mempty))
instance ToJSON ListTimeSeriesResponse where
toJSON ListTimeSeriesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _ltsrNextPageToken,
("timeSeries" .=) <$> _ltsrTimeSeries])
data ListMetricAssociationsResponse = ListMetricAssociationsResponse'
{ _lmarNextPageToken :: !(Maybe Text)
, _lmarMetricAssociations :: !(Maybe [MetricAssociation])
} deriving (Eq,Show,Data,Typeable,Generic)
listMetricAssociationsResponse
:: ListMetricAssociationsResponse
listMetricAssociationsResponse =
ListMetricAssociationsResponse'
{ _lmarNextPageToken = Nothing
, _lmarMetricAssociations = Nothing
}
lmarNextPageToken :: Lens' ListMetricAssociationsResponse (Maybe Text)
lmarNextPageToken
= lens _lmarNextPageToken
(\ s a -> s{_lmarNextPageToken = a})
lmarMetricAssociations :: Lens' ListMetricAssociationsResponse [MetricAssociation]
lmarMetricAssociations
= lens _lmarMetricAssociations
(\ s a -> s{_lmarMetricAssociations = a})
. _Default
. _Coerce
instance FromJSON ListMetricAssociationsResponse
where
parseJSON
= withObject "ListMetricAssociationsResponse"
(\ o ->
ListMetricAssociationsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "metricAssociations" .!= mempty))
instance ToJSON ListMetricAssociationsResponse where
toJSON ListMetricAssociationsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lmarNextPageToken,
("metricAssociations" .=) <$>
_lmarMetricAssociations])
data MetricDescriptor = MetricDescriptor'
{ _mdMetricKind :: !(Maybe MetricDescriptorMetricKind)
, _mdName :: !(Maybe Text)
, _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
, _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})
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 .:? "displayName")
<*> (o .:? "labels" .!= mempty)
<*> (o .:? "type")
<*> (o .:? "valueType")
<*> (o .:? "description")
<*> (o .:? "unit"))
instance ToJSON MetricDescriptor where
toJSON MetricDescriptor'{..}
= object
(catMaybes
[("metricKind" .=) <$> _mdMetricKind,
("name" .=) <$> _mdName,
("displayName" .=) <$> _mdDisplayName,
("labels" .=) <$> _mdLabels, ("type" .=) <$> _mdType,
("valueType" .=) <$> _mdValueType,
("description" .=) <$> _mdDescription,
("unit" .=) <$> _mdUnit])
data Group = Group'
{ _gName :: !(Maybe Text)
, _gDisplayName :: !(Maybe Text)
, _gFilter :: !(Maybe Text)
, _gIsCluster :: !(Maybe Bool)
, _gParentName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
group'
:: Group
group' =
Group'
{ _gName = Nothing
, _gDisplayName = Nothing
, _gFilter = Nothing
, _gIsCluster = Nothing
, _gParentName = Nothing
}
gName :: Lens' Group (Maybe Text)
gName = lens _gName (\ s a -> s{_gName = a})
gDisplayName :: Lens' Group (Maybe Text)
gDisplayName
= lens _gDisplayName (\ s a -> s{_gDisplayName = a})
gFilter :: Lens' Group (Maybe Text)
gFilter = lens _gFilter (\ s a -> s{_gFilter = a})
gIsCluster :: Lens' Group (Maybe Bool)
gIsCluster
= lens _gIsCluster (\ s a -> s{_gIsCluster = a})
gParentName :: Lens' Group (Maybe Text)
gParentName
= lens _gParentName (\ s a -> s{_gParentName = a})
instance FromJSON Group where
parseJSON
= withObject "Group"
(\ o ->
Group' <$>
(o .:? "name") <*> (o .:? "displayName") <*>
(o .:? "filter")
<*> (o .:? "isCluster")
<*> (o .:? "parentName"))
instance ToJSON Group where
toJSON Group'{..}
= object
(catMaybes
[("name" .=) <$> _gName,
("displayName" .=) <$> _gDisplayName,
("filter" .=) <$> _gFilter,
("isCluster" .=) <$> _gIsCluster,
("parentName" .=) <$> _gParentName])
data TypedValue = TypedValue'
{ _tvBoolValue :: !(Maybe Bool)
, _tvDoubleValue :: !(Maybe (Textual Double))
, _tvStringValue :: !(Maybe Text)
, _tvDistributionValue :: !(Maybe Distribution)
, _tvInt64Value :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
typedValue
:: TypedValue
typedValue =
TypedValue'
{ _tvBoolValue = Nothing
, _tvDoubleValue = Nothing
, _tvStringValue = Nothing
, _tvDistributionValue = Nothing
, _tvInt64Value = Nothing
}
tvBoolValue :: Lens' TypedValue (Maybe Bool)
tvBoolValue
= lens _tvBoolValue (\ s a -> s{_tvBoolValue = a})
tvDoubleValue :: Lens' TypedValue (Maybe Double)
tvDoubleValue
= lens _tvDoubleValue
(\ s a -> s{_tvDoubleValue = a})
. mapping _Coerce
tvStringValue :: Lens' TypedValue (Maybe Text)
tvStringValue
= lens _tvStringValue
(\ s a -> s{_tvStringValue = a})
tvDistributionValue :: Lens' TypedValue (Maybe Distribution)
tvDistributionValue
= lens _tvDistributionValue
(\ s a -> s{_tvDistributionValue = a})
tvInt64Value :: Lens' TypedValue (Maybe Int64)
tvInt64Value
= lens _tvInt64Value (\ s a -> s{_tvInt64Value = a})
. mapping _Coerce
instance FromJSON TypedValue where
parseJSON
= withObject "TypedValue"
(\ o ->
TypedValue' <$>
(o .:? "boolValue") <*> (o .:? "doubleValue") <*>
(o .:? "stringValue")
<*> (o .:? "distributionValue")
<*> (o .:? "int64Value"))
instance ToJSON TypedValue where
toJSON TypedValue'{..}
= object
(catMaybes
[("boolValue" .=) <$> _tvBoolValue,
("doubleValue" .=) <$> _tvDoubleValue,
("stringValue" .=) <$> _tvStringValue,
("distributionValue" .=) <$> _tvDistributionValue,
("int64Value" .=) <$> _tvInt64Value])
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
newtype SourceContext = SourceContext'
{ _scFileName :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
sourceContext
:: SourceContext
sourceContext =
SourceContext'
{ _scFileName = Nothing
}
scFileName :: Lens' SourceContext (Maybe Text)
scFileName
= lens _scFileName (\ s a -> s{_scFileName = a})
instance FromJSON SourceContext where
parseJSON
= withObject "SourceContext"
(\ o -> SourceContext' <$> (o .:? "fileName"))
instance ToJSON SourceContext where
toJSON SourceContext'{..}
= object
(catMaybes [("fileName" .=) <$> _scFileName])
data Distribution = Distribution'
{ _dSumOfSquaredDeviation :: !(Maybe (Textual Double))
, _dMean :: !(Maybe (Textual Double))
, _dCount :: !(Maybe (Textual Int64))
, _dBucketCounts :: !(Maybe [Textual Int64])
, _dRange :: !(Maybe Range)
, _dBucketOptions :: !(Maybe BucketOptions)
} deriving (Eq,Show,Data,Typeable,Generic)
distribution
:: Distribution
distribution =
Distribution'
{ _dSumOfSquaredDeviation = Nothing
, _dMean = Nothing
, _dCount = Nothing
, _dBucketCounts = Nothing
, _dRange = Nothing
, _dBucketOptions = Nothing
}
dSumOfSquaredDeviation :: Lens' Distribution (Maybe Double)
dSumOfSquaredDeviation
= lens _dSumOfSquaredDeviation
(\ s a -> s{_dSumOfSquaredDeviation = a})
. mapping _Coerce
dMean :: Lens' Distribution (Maybe Double)
dMean
= lens _dMean (\ s a -> s{_dMean = a}) .
mapping _Coerce
dCount :: Lens' Distribution (Maybe Int64)
dCount
= lens _dCount (\ s a -> s{_dCount = a}) .
mapping _Coerce
dBucketCounts :: Lens' Distribution [Int64]
dBucketCounts
= lens _dBucketCounts
(\ s a -> s{_dBucketCounts = a})
. _Default
. _Coerce
dRange :: Lens' Distribution (Maybe Range)
dRange = lens _dRange (\ s a -> s{_dRange = a})
dBucketOptions :: Lens' Distribution (Maybe BucketOptions)
dBucketOptions
= lens _dBucketOptions
(\ s a -> s{_dBucketOptions = a})
instance FromJSON Distribution where
parseJSON
= withObject "Distribution"
(\ o ->
Distribution' <$>
(o .:? "sumOfSquaredDeviation") <*> (o .:? "mean")
<*> (o .:? "count")
<*> (o .:? "bucketCounts" .!= mempty)
<*> (o .:? "range")
<*> (o .:? "bucketOptions"))
instance ToJSON Distribution where
toJSON Distribution'{..}
= object
(catMaybes
[("sumOfSquaredDeviation" .=) <$>
_dSumOfSquaredDeviation,
("mean" .=) <$> _dMean, ("count" .=) <$> _dCount,
("bucketCounts" .=) <$> _dBucketCounts,
("range" .=) <$> _dRange,
("bucketOptions" .=) <$> _dBucketOptions])
data Field = Field'
{ _fKind :: !(Maybe FieldKind)
, _fOneofIndex :: !(Maybe (Textual Int32))
, _fName :: !(Maybe Text)
, _fJSONName :: !(Maybe Text)
, _fCardinality :: !(Maybe FieldCardinality)
, _fOptions :: !(Maybe [Option])
, _fPacked :: !(Maybe Bool)
, _fDefaultValue :: !(Maybe Text)
, _fNumber :: !(Maybe (Textual Int32))
, _fTypeURL :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
field
:: Field
field =
Field'
{ _fKind = Nothing
, _fOneofIndex = Nothing
, _fName = Nothing
, _fJSONName = Nothing
, _fCardinality = Nothing
, _fOptions = Nothing
, _fPacked = Nothing
, _fDefaultValue = Nothing
, _fNumber = Nothing
, _fTypeURL = Nothing
}
fKind :: Lens' Field (Maybe FieldKind)
fKind = lens _fKind (\ s a -> s{_fKind = a})
fOneofIndex :: Lens' Field (Maybe Int32)
fOneofIndex
= lens _fOneofIndex (\ s a -> s{_fOneofIndex = a}) .
mapping _Coerce
fName :: Lens' Field (Maybe Text)
fName = lens _fName (\ s a -> s{_fName = a})
fJSONName :: Lens' Field (Maybe Text)
fJSONName
= lens _fJSONName (\ s a -> s{_fJSONName = a})
fCardinality :: Lens' Field (Maybe FieldCardinality)
fCardinality
= lens _fCardinality (\ s a -> s{_fCardinality = a})
fOptions :: Lens' Field [Option]
fOptions
= lens _fOptions (\ s a -> s{_fOptions = a}) .
_Default
. _Coerce
fPacked :: Lens' Field (Maybe Bool)
fPacked = lens _fPacked (\ s a -> s{_fPacked = a})
fDefaultValue :: Lens' Field (Maybe Text)
fDefaultValue
= lens _fDefaultValue
(\ s a -> s{_fDefaultValue = a})
fNumber :: Lens' Field (Maybe Int32)
fNumber
= lens _fNumber (\ s a -> s{_fNumber = a}) .
mapping _Coerce
fTypeURL :: Lens' Field (Maybe Text)
fTypeURL = lens _fTypeURL (\ s a -> s{_fTypeURL = a})
instance FromJSON Field where
parseJSON
= withObject "Field"
(\ o ->
Field' <$>
(o .:? "kind") <*> (o .:? "oneofIndex") <*>
(o .:? "name")
<*> (o .:? "jsonName")
<*> (o .:? "cardinality")
<*> (o .:? "options" .!= mempty)
<*> (o .:? "packed")
<*> (o .:? "defaultValue")
<*> (o .:? "number")
<*> (o .:? "typeUrl"))
instance ToJSON Field where
toJSON Field'{..}
= object
(catMaybes
[("kind" .=) <$> _fKind,
("oneofIndex" .=) <$> _fOneofIndex,
("name" .=) <$> _fName,
("jsonName" .=) <$> _fJSONName,
("cardinality" .=) <$> _fCardinality,
("options" .=) <$> _fOptions,
("packed" .=) <$> _fPacked,
("defaultValue" .=) <$> _fDefaultValue,
("number" .=) <$> _fNumber,
("typeUrl" .=) <$> _fTypeURL])
data MetricAssociation = MetricAssociation'
{ _maMetricType :: !(Maybe Text)
, _maName :: !(Maybe Text)
, _maIsDefault :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
metricAssociation
:: MetricAssociation
metricAssociation =
MetricAssociation'
{ _maMetricType = Nothing
, _maName = Nothing
, _maIsDefault = Nothing
}
maMetricType :: Lens' MetricAssociation (Maybe Text)
maMetricType
= lens _maMetricType (\ s a -> s{_maMetricType = a})
maName :: Lens' MetricAssociation (Maybe Text)
maName = lens _maName (\ s a -> s{_maName = a})
maIsDefault :: Lens' MetricAssociation (Maybe Bool)
maIsDefault
= lens _maIsDefault (\ s a -> s{_maIsDefault = a})
instance FromJSON MetricAssociation where
parseJSON
= withObject "MetricAssociation"
(\ o ->
MetricAssociation' <$>
(o .:? "metricType") <*> (o .:? "name") <*>
(o .:? "isDefault"))
instance ToJSON MetricAssociation where
toJSON MetricAssociation'{..}
= object
(catMaybes
[("metricType" .=) <$> _maMetricType,
("name" .=) <$> _maName,
("isDefault" .=) <$> _maIsDefault])
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 ListGroupsResponse = ListGroupsResponse'
{ _lgrNextPageToken :: !(Maybe Text)
, _lgrGroup :: !(Maybe [Group])
} deriving (Eq,Show,Data,Typeable,Generic)
listGroupsResponse
:: ListGroupsResponse
listGroupsResponse =
ListGroupsResponse'
{ _lgrNextPageToken = Nothing
, _lgrGroup = Nothing
}
lgrNextPageToken :: Lens' ListGroupsResponse (Maybe Text)
lgrNextPageToken
= lens _lgrNextPageToken
(\ s a -> s{_lgrNextPageToken = a})
lgrGroup :: Lens' ListGroupsResponse [Group]
lgrGroup
= lens _lgrGroup (\ s a -> s{_lgrGroup = a}) .
_Default
. _Coerce
instance FromJSON ListGroupsResponse where
parseJSON
= withObject "ListGroupsResponse"
(\ o ->
ListGroupsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "group" .!= mempty))
instance ToJSON ListGroupsResponse where
toJSON ListGroupsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lgrNextPageToken,
("group" .=) <$> _lgrGroup])
data ListMetricDescriptorsResponse = ListMetricDescriptorsResponse'
{ _lmdrMetricDescriptors :: !(Maybe [MetricDescriptor])
, _lmdrNextPageToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
listMetricDescriptorsResponse
:: ListMetricDescriptorsResponse
listMetricDescriptorsResponse =
ListMetricDescriptorsResponse'
{ _lmdrMetricDescriptors = Nothing
, _lmdrNextPageToken = Nothing
}
lmdrMetricDescriptors :: Lens' ListMetricDescriptorsResponse [MetricDescriptor]
lmdrMetricDescriptors
= lens _lmdrMetricDescriptors
(\ s a -> s{_lmdrMetricDescriptors = a})
. _Default
. _Coerce
lmdrNextPageToken :: Lens' ListMetricDescriptorsResponse (Maybe Text)
lmdrNextPageToken
= lens _lmdrNextPageToken
(\ s a -> s{_lmdrNextPageToken = a})
instance FromJSON ListMetricDescriptorsResponse where
parseJSON
= withObject "ListMetricDescriptorsResponse"
(\ o ->
ListMetricDescriptorsResponse' <$>
(o .:? "metricDescriptors" .!= mempty) <*>
(o .:? "nextPageToken"))
instance ToJSON ListMetricDescriptorsResponse where
toJSON ListMetricDescriptorsResponse'{..}
= object
(catMaybes
[("metricDescriptors" .=) <$> _lmdrMetricDescriptors,
("nextPageToken" .=) <$> _lmdrNextPageToken])
newtype OptionValue = OptionValue'
{ _ovAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
optionValue
:: HashMap Text JSONValue
-> OptionValue
optionValue pOvAddtional_ =
OptionValue'
{ _ovAddtional = _Coerce # pOvAddtional_
}
ovAddtional :: Lens' OptionValue (HashMap Text JSONValue)
ovAddtional
= lens _ovAddtional (\ s a -> s{_ovAddtional = a}) .
_Coerce
instance FromJSON OptionValue where
parseJSON
= withObject "OptionValue"
(\ o -> OptionValue' <$> (parseJSONObject o))
instance ToJSON OptionValue where
toJSON = toJSON . _ovAddtional
data Category = Category'
{ _cShortName :: !(Maybe Text)
, _cName :: !(Maybe Text)
, _cDisplayName :: !(Maybe Text)
, _cDescription :: !(Maybe Text)
, _cIsDefault :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
category
:: Category
category =
Category'
{ _cShortName = Nothing
, _cName = Nothing
, _cDisplayName = Nothing
, _cDescription = Nothing
, _cIsDefault = Nothing
}
cShortName :: Lens' Category (Maybe Text)
cShortName
= lens _cShortName (\ s a -> s{_cShortName = a})
cName :: Lens' Category (Maybe Text)
cName = lens _cName (\ s a -> s{_cName = a})
cDisplayName :: Lens' Category (Maybe Text)
cDisplayName
= lens _cDisplayName (\ s a -> s{_cDisplayName = a})
cDescription :: Lens' Category (Maybe Text)
cDescription
= lens _cDescription (\ s a -> s{_cDescription = a})
cIsDefault :: Lens' Category (Maybe Bool)
cIsDefault
= lens _cIsDefault (\ s a -> s{_cIsDefault = a})
instance FromJSON Category where
parseJSON
= withObject "Category"
(\ o ->
Category' <$>
(o .:? "shortName") <*> (o .:? "name") <*>
(o .:? "displayName")
<*> (o .:? "description")
<*> (o .:? "isDefault"))
instance ToJSON Category where
toJSON Category'{..}
= object
(catMaybes
[("shortName" .=) <$> _cShortName,
("name" .=) <$> _cName,
("displayName" .=) <$> _cDisplayName,
("description" .=) <$> _cDescription,
("isDefault" .=) <$> _cIsDefault])
newtype CreateTimeSeriesRequest = CreateTimeSeriesRequest'
{ _ctsrTimeSeries :: Maybe [TimeSeries]
} deriving (Eq,Show,Data,Typeable,Generic)
createTimeSeriesRequest
:: CreateTimeSeriesRequest
createTimeSeriesRequest =
CreateTimeSeriesRequest'
{ _ctsrTimeSeries = Nothing
}
ctsrTimeSeries :: Lens' CreateTimeSeriesRequest [TimeSeries]
ctsrTimeSeries
= lens _ctsrTimeSeries
(\ s a -> s{_ctsrTimeSeries = a})
. _Default
. _Coerce
instance FromJSON CreateTimeSeriesRequest where
parseJSON
= withObject "CreateTimeSeriesRequest"
(\ o ->
CreateTimeSeriesRequest' <$>
(o .:? "timeSeries" .!= mempty))
instance ToJSON CreateTimeSeriesRequest where
toJSON CreateTimeSeriesRequest'{..}
= object
(catMaybes [("timeSeries" .=) <$> _ctsrTimeSeries])
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])
newtype MetricLabels = MetricLabels'
{ _mlAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
metricLabels
:: HashMap Text Text
-> MetricLabels
metricLabels pMlAddtional_ =
MetricLabels'
{ _mlAddtional = _Coerce # pMlAddtional_
}
mlAddtional :: Lens' MetricLabels (HashMap Text Text)
mlAddtional
= lens _mlAddtional (\ s a -> s{_mlAddtional = a}) .
_Coerce
instance FromJSON MetricLabels where
parseJSON
= withObject "MetricLabels"
(\ o -> MetricLabels' <$> (parseJSONObject o))
instance ToJSON MetricLabels where
toJSON = toJSON . _mlAddtional
newtype CollectdPayloadMetadata = CollectdPayloadMetadata'
{ _cpmAddtional :: HashMap Text TypedValue
} deriving (Eq,Show,Data,Typeable,Generic)
collectdPayloadMetadata
:: HashMap Text TypedValue
-> CollectdPayloadMetadata
collectdPayloadMetadata pCpmAddtional_ =
CollectdPayloadMetadata'
{ _cpmAddtional = _Coerce # pCpmAddtional_
}
cpmAddtional :: Lens' CollectdPayloadMetadata (HashMap Text TypedValue)
cpmAddtional
= lens _cpmAddtional (\ s a -> s{_cpmAddtional = a})
. _Coerce
instance FromJSON CollectdPayloadMetadata where
parseJSON
= withObject "CollectdPayloadMetadata"
(\ o ->
CollectdPayloadMetadata' <$> (parseJSONObject o))
instance ToJSON CollectdPayloadMetadata where
toJSON = toJSON . _cpmAddtional
data CollectdValue = CollectdValue'
{ _cvDataSourceName :: !(Maybe Text)
, _cvDataSourceType :: !(Maybe CollectdValueDataSourceType)
, _cvValue :: !(Maybe TypedValue)
} deriving (Eq,Show,Data,Typeable,Generic)
collectdValue
:: CollectdValue
collectdValue =
CollectdValue'
{ _cvDataSourceName = Nothing
, _cvDataSourceType = Nothing
, _cvValue = Nothing
}
cvDataSourceName :: Lens' CollectdValue (Maybe Text)
cvDataSourceName
= lens _cvDataSourceName
(\ s a -> s{_cvDataSourceName = a})
cvDataSourceType :: Lens' CollectdValue (Maybe CollectdValueDataSourceType)
cvDataSourceType
= lens _cvDataSourceType
(\ s a -> s{_cvDataSourceType = a})
cvValue :: Lens' CollectdValue (Maybe TypedValue)
cvValue = lens _cvValue (\ s a -> s{_cvValue = a})
instance FromJSON CollectdValue where
parseJSON
= withObject "CollectdValue"
(\ o ->
CollectdValue' <$>
(o .:? "dataSourceName") <*> (o .:? "dataSourceType")
<*> (o .:? "value"))
instance ToJSON CollectdValue where
toJSON CollectdValue'{..}
= object
(catMaybes
[("dataSourceName" .=) <$> _cvDataSourceName,
("dataSourceType" .=) <$> _cvDataSourceType,
("value" .=) <$> _cvValue])
data CreateCollectdTimeSeriesRequest = CreateCollectdTimeSeriesRequest'
{ _cctsrCollectdPayloads :: !(Maybe [CollectdPayload])
, _cctsrResource :: !(Maybe MonitoredResource)
, _cctsrCollectdVersion :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
createCollectdTimeSeriesRequest
:: CreateCollectdTimeSeriesRequest
createCollectdTimeSeriesRequest =
CreateCollectdTimeSeriesRequest'
{ _cctsrCollectdPayloads = Nothing
, _cctsrResource = Nothing
, _cctsrCollectdVersion = Nothing
}
cctsrCollectdPayloads :: Lens' CreateCollectdTimeSeriesRequest [CollectdPayload]
cctsrCollectdPayloads
= lens _cctsrCollectdPayloads
(\ s a -> s{_cctsrCollectdPayloads = a})
. _Default
. _Coerce
cctsrResource :: Lens' CreateCollectdTimeSeriesRequest (Maybe MonitoredResource)
cctsrResource
= lens _cctsrResource
(\ s a -> s{_cctsrResource = a})
cctsrCollectdVersion :: Lens' CreateCollectdTimeSeriesRequest (Maybe Text)
cctsrCollectdVersion
= lens _cctsrCollectdVersion
(\ s a -> s{_cctsrCollectdVersion = a})
instance FromJSON CreateCollectdTimeSeriesRequest
where
parseJSON
= withObject "CreateCollectdTimeSeriesRequest"
(\ o ->
CreateCollectdTimeSeriesRequest' <$>
(o .:? "collectdPayloads" .!= mempty) <*>
(o .:? "resource")
<*> (o .:? "collectdVersion"))
instance ToJSON CreateCollectdTimeSeriesRequest where
toJSON CreateCollectdTimeSeriesRequest'{..}
= object
(catMaybes
[("collectdPayloads" .=) <$> _cctsrCollectdPayloads,
("resource" .=) <$> _cctsrResource,
("collectdVersion" .=) <$> _cctsrCollectdVersion])
data Point = Point'
{ _pValue :: !(Maybe TypedValue)
, _pInterval :: !(Maybe TimeInterval)
} deriving (Eq,Show,Data,Typeable,Generic)
point
:: Point
point =
Point'
{ _pValue = Nothing
, _pInterval = Nothing
}
pValue :: Lens' Point (Maybe TypedValue)
pValue = lens _pValue (\ s a -> s{_pValue = a})
pInterval :: Lens' Point (Maybe TimeInterval)
pInterval
= lens _pInterval (\ s a -> s{_pInterval = a})
instance FromJSON Point where
parseJSON
= withObject "Point"
(\ o ->
Point' <$> (o .:? "value") <*> (o .:? "interval"))
instance ToJSON Point where
toJSON Point'{..}
= object
(catMaybes
[("value" .=) <$> _pValue,
("interval" .=) <$> _pInterval])
data CollectdPayload = CollectdPayload'
{ _cpStartTime :: !(Maybe DateTime')
, _cpPluginInstance :: !(Maybe Text)
, _cpValues :: !(Maybe [CollectdValue])
, _cpTypeInstance :: !(Maybe Text)
, _cpEndTime :: !(Maybe DateTime')
, _cpMetadata :: !(Maybe CollectdPayloadMetadata)
, _cpType :: !(Maybe Text)
, _cpPlugin :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
collectdPayload
:: CollectdPayload
collectdPayload =
CollectdPayload'
{ _cpStartTime = Nothing
, _cpPluginInstance = Nothing
, _cpValues = Nothing
, _cpTypeInstance = Nothing
, _cpEndTime = Nothing
, _cpMetadata = Nothing
, _cpType = Nothing
, _cpPlugin = Nothing
}
cpStartTime :: Lens' CollectdPayload (Maybe UTCTime)
cpStartTime
= lens _cpStartTime (\ s a -> s{_cpStartTime = a}) .
mapping _DateTime
cpPluginInstance :: Lens' CollectdPayload (Maybe Text)
cpPluginInstance
= lens _cpPluginInstance
(\ s a -> s{_cpPluginInstance = a})
cpValues :: Lens' CollectdPayload [CollectdValue]
cpValues
= lens _cpValues (\ s a -> s{_cpValues = a}) .
_Default
. _Coerce
cpTypeInstance :: Lens' CollectdPayload (Maybe Text)
cpTypeInstance
= lens _cpTypeInstance
(\ s a -> s{_cpTypeInstance = a})
cpEndTime :: Lens' CollectdPayload (Maybe UTCTime)
cpEndTime
= lens _cpEndTime (\ s a -> s{_cpEndTime = a}) .
mapping _DateTime
cpMetadata :: Lens' CollectdPayload (Maybe CollectdPayloadMetadata)
cpMetadata
= lens _cpMetadata (\ s a -> s{_cpMetadata = a})
cpType :: Lens' CollectdPayload (Maybe Text)
cpType = lens _cpType (\ s a -> s{_cpType = a})
cpPlugin :: Lens' CollectdPayload (Maybe Text)
cpPlugin = lens _cpPlugin (\ s a -> s{_cpPlugin = a})
instance FromJSON CollectdPayload where
parseJSON
= withObject "CollectdPayload"
(\ o ->
CollectdPayload' <$>
(o .:? "startTime") <*> (o .:? "pluginInstance") <*>
(o .:? "values" .!= mempty)
<*> (o .:? "typeInstance")
<*> (o .:? "endTime")
<*> (o .:? "metadata")
<*> (o .:? "type")
<*> (o .:? "plugin"))
instance ToJSON CollectdPayload where
toJSON CollectdPayload'{..}
= object
(catMaybes
[("startTime" .=) <$> _cpStartTime,
("pluginInstance" .=) <$> _cpPluginInstance,
("values" .=) <$> _cpValues,
("typeInstance" .=) <$> _cpTypeInstance,
("endTime" .=) <$> _cpEndTime,
("metadata" .=) <$> _cpMetadata,
("type" .=) <$> _cpType,
("plugin" .=) <$> _cpPlugin])
data Metric = Metric'
{ _mLabels :: !(Maybe MetricLabels)
, _mType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
metric
:: Metric
metric =
Metric'
{ _mLabels = Nothing
, _mType = Nothing
}
mLabels :: Lens' Metric (Maybe MetricLabels)
mLabels = lens _mLabels (\ s a -> s{_mLabels = a})
mType :: Lens' Metric (Maybe Text)
mType = lens _mType (\ s a -> s{_mType = a})
instance FromJSON Metric where
parseJSON
= withObject "Metric"
(\ o ->
Metric' <$> (o .:? "labels") <*> (o .:? "type"))
instance ToJSON Metric where
toJSON Metric'{..}
= object
(catMaybes
[("labels" .=) <$> _mLabels, ("type" .=) <$> _mType])
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])
data ListCategoriesResponse = ListCategoriesResponse'
{ _lcrNextPageToken :: !(Maybe Text)
, _lcrCategory :: !(Maybe [Category])
} deriving (Eq,Show,Data,Typeable,Generic)
listCategoriesResponse
:: ListCategoriesResponse
listCategoriesResponse =
ListCategoriesResponse'
{ _lcrNextPageToken = Nothing
, _lcrCategory = Nothing
}
lcrNextPageToken :: Lens' ListCategoriesResponse (Maybe Text)
lcrNextPageToken
= lens _lcrNextPageToken
(\ s a -> s{_lcrNextPageToken = a})
lcrCategory :: Lens' ListCategoriesResponse [Category]
lcrCategory
= lens _lcrCategory (\ s a -> s{_lcrCategory = a}) .
_Default
. _Coerce
instance FromJSON ListCategoriesResponse where
parseJSON
= withObject "ListCategoriesResponse"
(\ o ->
ListCategoriesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "category" .!= mempty))
instance ToJSON ListCategoriesResponse where
toJSON ListCategoriesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lcrNextPageToken,
("category" .=) <$> _lcrCategory])
data Range = Range'
{ _rMax :: !(Maybe (Textual Double))
, _rMin :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
range
:: Range
range =
Range'
{ _rMax = Nothing
, _rMin = Nothing
}
rMax :: Lens' Range (Maybe Double)
rMax
= lens _rMax (\ s a -> s{_rMax = a}) .
mapping _Coerce
rMin :: Lens' Range (Maybe Double)
rMin
= lens _rMin (\ s a -> s{_rMin = a}) .
mapping _Coerce
instance FromJSON Range where
parseJSON
= withObject "Range"
(\ o -> Range' <$> (o .:? "max") <*> (o .:? "min"))
instance ToJSON Range where
toJSON Range'{..}
= object
(catMaybes
[("max" .=) <$> _rMax, ("min" .=) <$> _rMin])
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 TimeInterval = TimeInterval'
{ _tiStartTime :: !(Maybe DateTime')
, _tiEndTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
timeInterval
:: TimeInterval
timeInterval =
TimeInterval'
{ _tiStartTime = Nothing
, _tiEndTime = Nothing
}
tiStartTime :: Lens' TimeInterval (Maybe UTCTime)
tiStartTime
= lens _tiStartTime (\ s a -> s{_tiStartTime = a}) .
mapping _DateTime
tiEndTime :: Lens' TimeInterval (Maybe UTCTime)
tiEndTime
= lens _tiEndTime (\ s a -> s{_tiEndTime = a}) .
mapping _DateTime
instance FromJSON TimeInterval where
parseJSON
= withObject "TimeInterval"
(\ o ->
TimeInterval' <$>
(o .:? "startTime") <*> (o .:? "endTime"))
instance ToJSON TimeInterval where
toJSON TimeInterval'{..}
= object
(catMaybes
[("startTime" .=) <$> _tiStartTime,
("endTime" .=) <$> _tiEndTime])
data ListGroupMembersResponse = ListGroupMembersResponse'
{ _lgmrNextPageToken :: !(Maybe Text)
, _lgmrMembers :: !(Maybe [MonitoredResource])
, _lgmrTotalSize :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
listGroupMembersResponse
:: ListGroupMembersResponse
listGroupMembersResponse =
ListGroupMembersResponse'
{ _lgmrNextPageToken = Nothing
, _lgmrMembers = Nothing
, _lgmrTotalSize = Nothing
}
lgmrNextPageToken :: Lens' ListGroupMembersResponse (Maybe Text)
lgmrNextPageToken
= lens _lgmrNextPageToken
(\ s a -> s{_lgmrNextPageToken = a})
lgmrMembers :: Lens' ListGroupMembersResponse [MonitoredResource]
lgmrMembers
= lens _lgmrMembers (\ s a -> s{_lgmrMembers = a}) .
_Default
. _Coerce
lgmrTotalSize :: Lens' ListGroupMembersResponse (Maybe Int32)
lgmrTotalSize
= lens _lgmrTotalSize
(\ s a -> s{_lgmrTotalSize = a})
. mapping _Coerce
instance FromJSON ListGroupMembersResponse where
parseJSON
= withObject "ListGroupMembersResponse"
(\ o ->
ListGroupMembersResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "members" .!= mempty)
<*> (o .:? "totalSize"))
instance ToJSON ListGroupMembersResponse where
toJSON ListGroupMembersResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lgmrNextPageToken,
("members" .=) <$> _lgmrMembers,
("totalSize" .=) <$> _lgmrTotalSize])
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 Type = Type'
{ _tSourceContext :: !(Maybe SourceContext)
, _tOneofs :: !(Maybe [Text])
, _tName :: !(Maybe Text)
, _tOptions :: !(Maybe [Option])
, _tFields :: !(Maybe [Field])
, _tSyntax :: !(Maybe TypeSyntax)
} deriving (Eq,Show,Data,Typeable,Generic)
type'
:: Type
type' =
Type'
{ _tSourceContext = Nothing
, _tOneofs = Nothing
, _tName = Nothing
, _tOptions = Nothing
, _tFields = Nothing
, _tSyntax = Nothing
}
tSourceContext :: Lens' Type (Maybe SourceContext)
tSourceContext
= lens _tSourceContext
(\ s a -> s{_tSourceContext = a})
tOneofs :: Lens' Type [Text]
tOneofs
= lens _tOneofs (\ s a -> s{_tOneofs = a}) . _Default
. _Coerce
tName :: Lens' Type (Maybe Text)
tName = lens _tName (\ s a -> s{_tName = a})
tOptions :: Lens' Type [Option]
tOptions
= lens _tOptions (\ s a -> s{_tOptions = a}) .
_Default
. _Coerce
tFields :: Lens' Type [Field]
tFields
= lens _tFields (\ s a -> s{_tFields = a}) . _Default
. _Coerce
tSyntax :: Lens' Type (Maybe TypeSyntax)
tSyntax = lens _tSyntax (\ s a -> s{_tSyntax = a})
instance FromJSON Type where
parseJSON
= withObject "Type"
(\ o ->
Type' <$>
(o .:? "sourceContext") <*>
(o .:? "oneofs" .!= mempty)
<*> (o .:? "name")
<*> (o .:? "options" .!= mempty)
<*> (o .:? "fields" .!= mempty)
<*> (o .:? "syntax"))
instance ToJSON Type where
toJSON Type'{..}
= object
(catMaybes
[("sourceContext" .=) <$> _tSourceContext,
("oneofs" .=) <$> _tOneofs, ("name" .=) <$> _tName,
("options" .=) <$> _tOptions,
("fields" .=) <$> _tFields,
("syntax" .=) <$> _tSyntax])
data Option = Option'
{ _oValue :: !(Maybe OptionValue)
, _oName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
option
:: Option
option =
Option'
{ _oValue = Nothing
, _oName = Nothing
}
oValue :: Lens' Option (Maybe OptionValue)
oValue = lens _oValue (\ s a -> s{_oValue = a})
oName :: Lens' Option (Maybe Text)
oName = lens _oName (\ s a -> s{_oName = a})
instance FromJSON Option where
parseJSON
= withObject "Option"
(\ o ->
Option' <$> (o .:? "value") <*> (o .:? "name"))
instance ToJSON Option where
toJSON Option'{..}
= object
(catMaybes
[("value" .=) <$> _oValue, ("name" .=) <$> _oName])
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 TimeSeries = TimeSeries'
{ _tsPoints :: !(Maybe [Point])
, _tsMetricKind :: !(Maybe TimeSeriesMetricKind)
, _tsMetric :: !(Maybe Metric)
, _tsResource :: !(Maybe MonitoredResource)
, _tsValueType :: !(Maybe TimeSeriesValueType)
} deriving (Eq,Show,Data,Typeable,Generic)
timeSeries
:: TimeSeries
timeSeries =
TimeSeries'
{ _tsPoints = Nothing
, _tsMetricKind = Nothing
, _tsMetric = Nothing
, _tsResource = Nothing
, _tsValueType = Nothing
}
tsPoints :: Lens' TimeSeries [Point]
tsPoints
= lens _tsPoints (\ s a -> s{_tsPoints = a}) .
_Default
. _Coerce
tsMetricKind :: Lens' TimeSeries (Maybe TimeSeriesMetricKind)
tsMetricKind
= lens _tsMetricKind (\ s a -> s{_tsMetricKind = a})
tsMetric :: Lens' TimeSeries (Maybe Metric)
tsMetric = lens _tsMetric (\ s a -> s{_tsMetric = a})
tsResource :: Lens' TimeSeries (Maybe MonitoredResource)
tsResource
= lens _tsResource (\ s a -> s{_tsResource = a})
tsValueType :: Lens' TimeSeries (Maybe TimeSeriesValueType)
tsValueType
= lens _tsValueType (\ s a -> s{_tsValueType = a})
instance FromJSON TimeSeries where
parseJSON
= withObject "TimeSeries"
(\ o ->
TimeSeries' <$>
(o .:? "points" .!= mempty) <*> (o .:? "metricKind")
<*> (o .:? "metric")
<*> (o .:? "resource")
<*> (o .:? "valueType"))
instance ToJSON TimeSeries where
toJSON TimeSeries'{..}
= object
(catMaybes
[("points" .=) <$> _tsPoints,
("metricKind" .=) <$> _tsMetricKind,
("metric" .=) <$> _tsMetric,
("resource" .=) <$> _tsResource,
("valueType" .=) <$> _tsValueType])