module Network.Google.URLShortener.Types.Sum where
import Network.Google.Prelude
data URLListProjection
= AnalyticsClicks
| Full
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable URLListProjection
instance FromHttpApiData URLListProjection where
parseQueryParam = \case
"ANALYTICS_CLICKS" -> Right AnalyticsClicks
"FULL" -> Right Full
x -> Left ("Unable to parse URLListProjection from: " <> x)
instance ToHttpApiData URLListProjection where
toQueryParam = \case
AnalyticsClicks -> "ANALYTICS_CLICKS"
Full -> "FULL"
instance FromJSON URLListProjection where
parseJSON = parseJSONText "URLListProjection"
instance ToJSON URLListProjection where
toJSON = toJSONText
data URLGetProjection
= UGPAnalyticsClicks
| UGPAnalyticsTopStrings
| UGPFull
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable URLGetProjection
instance FromHttpApiData URLGetProjection where
parseQueryParam = \case
"ANALYTICS_CLICKS" -> Right UGPAnalyticsClicks
"ANALYTICS_TOP_STRINGS" -> Right UGPAnalyticsTopStrings
"FULL" -> Right UGPFull
x -> Left ("Unable to parse URLGetProjection from: " <> x)
instance ToHttpApiData URLGetProjection where
toQueryParam = \case
UGPAnalyticsClicks -> "ANALYTICS_CLICKS"
UGPAnalyticsTopStrings -> "ANALYTICS_TOP_STRINGS"
UGPFull -> "FULL"
instance FromJSON URLGetProjection where
parseJSON = parseJSONText "URLGetProjection"
instance ToJSON URLGetProjection where
toJSON = toJSONText