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 FromText AggregateBucketType where
fromText = \case
"activitySegment" -> Just ABTActivitySegment
"activityType" -> Just ABTActivityType
"session" -> Just ABTSession
"time" -> Just ABTTime
"unknown" -> Just ABTUnknown
_ -> Nothing
instance ToText AggregateBucketType where
toText = \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 FromText DataSourceType where
fromText = \case
"derived" -> Just Derived
"raw" -> Just Raw
_ -> Nothing
instance ToText DataSourceType where
toText = \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 FromText DeviceType where
fromText = \case
"chestStrap" -> Just ChestStrap
"phone" -> Just Phone
"scale" -> Just Scale
"tablet" -> Just Tablet
"unknown" -> Just Unknown
"watch" -> Just Watch
_ -> Nothing
instance ToText DeviceType where
toText = \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
= FloatList
| FloatPoint
| Integer
| IntegerList
| Map
| String
deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
instance Hashable DataTypeFieldFormat
instance FromText DataTypeFieldFormat where
fromText = \case
"floatList" -> Just FloatList
"floatPoint" -> Just FloatPoint
"integer" -> Just Integer
"integerList" -> Just IntegerList
"map" -> Just Map
"string" -> Just String
_ -> Nothing
instance ToText DataTypeFieldFormat where
toText = \case
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