module Network.Google.CloudMonitoring.Types.Sum where
import Network.Google.Prelude
data TimeseriesListAggregator
= Max
| Mean
| Min
| Sum
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable TimeseriesListAggregator
instance FromHttpApiData TimeseriesListAggregator where
parseQueryParam = \case
"max" -> Right Max
"mean" -> Right Mean
"min" -> Right Min
"sum" -> Right Sum
x -> Left ("Unable to parse TimeseriesListAggregator from: " <> x)
instance ToHttpApiData TimeseriesListAggregator where
toQueryParam = \case
Max -> "max"
Mean -> "mean"
Min -> "min"
Sum -> "sum"
instance FromJSON TimeseriesListAggregator where
parseJSON = parseJSONText "TimeseriesListAggregator"
instance ToJSON TimeseriesListAggregator where
toJSON = toJSONText
data TimeseriesDescriptorsListAggregator
= TDLAMax
| TDLAMean
| TDLAMin
| TDLASum
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable TimeseriesDescriptorsListAggregator
instance FromHttpApiData TimeseriesDescriptorsListAggregator where
parseQueryParam = \case
"max" -> Right TDLAMax
"mean" -> Right TDLAMean
"min" -> Right TDLAMin
"sum" -> Right TDLASum
x -> Left ("Unable to parse TimeseriesDescriptorsListAggregator from: " <> x)
instance ToHttpApiData TimeseriesDescriptorsListAggregator where
toQueryParam = \case
TDLAMax -> "max"
TDLAMean -> "mean"
TDLAMin -> "min"
TDLASum -> "sum"
instance FromJSON TimeseriesDescriptorsListAggregator where
parseJSON = parseJSONText "TimeseriesDescriptorsListAggregator"
instance ToJSON TimeseriesDescriptorsListAggregator where
toJSON = toJSONText