module Network.Google.Fitness.Types.Sum where
import Network.Google.Prelude
data AggregateBucketType
= ABTActivitySegment
| ABTActivityType
| ABTSession
| ABTTime
| ABTUnknown
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AggregateBucketType
instance FromHttpApiData AggregateBucketType where
parseQueryParam = \case
"activitySegment" -> Right ABTActivitySegment
"activityType" -> Right ABTActivityType
"session" -> Right ABTSession
"time" -> Right ABTTime
"unknown" -> Right ABTUnknown
x -> Left ("Unable to parse AggregateBucketType from: " <> x)
instance ToHttpApiData AggregateBucketType where
toQueryParam = \case
ABTActivitySegment -> "activitySegment"
ABTActivityType -> "activityType"
ABTSession -> "session"
ABTTime -> "time"
ABTUnknown -> "unknown"
instance FromJSON AggregateBucketType where
parseJSON = parseJSONText "AggregateBucketType"
instance ToJSON AggregateBucketType where
toJSON = toJSONText
data DataSourceType
= Derived
| Raw
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DataSourceType
instance FromHttpApiData DataSourceType where
parseQueryParam = \case
"derived" -> Right Derived
"raw" -> Right Raw
x -> Left ("Unable to parse DataSourceType from: " <> x)
instance ToHttpApiData DataSourceType where
toQueryParam = \case
Derived -> "derived"
Raw -> "raw"
instance FromJSON DataSourceType where
parseJSON = parseJSONText "DataSourceType"
instance ToJSON DataSourceType where
toJSON = toJSONText
data DeviceType
= ChestStrap
| Phone
| Scale
| Tablet
| Unknown
| Watch
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DeviceType
instance FromHttpApiData DeviceType where
parseQueryParam = \case
"chestStrap" -> Right ChestStrap
"phone" -> Right Phone
"scale" -> Right Scale
"tablet" -> Right Tablet
"unknown" -> Right Unknown
"watch" -> Right Watch
x -> Left ("Unable to parse DeviceType from: " <> x)
instance ToHttpApiData DeviceType where
toQueryParam = \case
ChestStrap -> "chestStrap"
Phone -> "phone"
Scale -> "scale"
Tablet -> "tablet"
Unknown -> "unknown"
Watch -> "watch"
instance FromJSON DeviceType where
parseJSON = parseJSONText "DeviceType"
instance ToJSON DeviceType where
toJSON = toJSONText
data DataTypeFieldFormat
= Blob
| FloatList
| FloatPoint
| Integer
| IntegerList
| Map
| String
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DataTypeFieldFormat
instance FromHttpApiData DataTypeFieldFormat where
parseQueryParam = \case
"blob" -> Right Blob
"floatList" -> Right FloatList
"floatPoint" -> Right FloatPoint
"integer" -> Right Integer
"integerList" -> Right IntegerList
"map" -> Right Map
"string" -> Right String
x -> Left ("Unable to parse DataTypeFieldFormat from: " <> x)
instance ToHttpApiData DataTypeFieldFormat where
toQueryParam = \case
Blob -> "blob"
FloatList -> "floatList"
FloatPoint -> "floatPoint"
Integer -> "integer"
IntegerList -> "integerList"
Map -> "map"
String -> "string"
instance FromJSON DataTypeFieldFormat where
parseJSON = parseJSONText "DataTypeFieldFormat"
instance ToJSON DataTypeFieldFormat where
toJSON = toJSONText