{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.PhotosLibrary.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data VideoStatus
= Unspecified
| Processing
| Ready
| Failed
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable VideoStatus
instance FromHttpApiData VideoStatus where
parseQueryParam = \case
"UNSPECIFIED" -> Right Unspecified
"PROCESSING" -> Right Processing
"READY" -> Right Ready
"FAILED" -> Right Failed
x -> Left ("Unable to parse VideoStatus from: " <> x)
instance ToHttpApiData VideoStatus where
toQueryParam = \case
Unspecified -> "UNSPECIFIED"
Processing -> "PROCESSING"
Ready -> "READY"
Failed -> "FAILED"
instance FromJSON VideoStatus where
parseJSON = parseJSONText "VideoStatus"
instance ToJSON VideoStatus where
toJSON = toJSONText
data AlbumPositionPosition
= PositionTypeUnspecified
| FirstInAlbum
| LastInAlbum
| AfterMediaItem
| AfterEnrichmentItem
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AlbumPositionPosition
instance FromHttpApiData AlbumPositionPosition where
parseQueryParam = \case
"POSITION_TYPE_UNSPECIFIED" -> Right PositionTypeUnspecified
"FIRST_IN_ALBUM" -> Right FirstInAlbum
"LAST_IN_ALBUM" -> Right LastInAlbum
"AFTER_MEDIA_ITEM" -> Right AfterMediaItem
"AFTER_ENRICHMENT_ITEM" -> Right AfterEnrichmentItem
x -> Left ("Unable to parse AlbumPositionPosition from: " <> x)
instance ToHttpApiData AlbumPositionPosition where
toQueryParam = \case
PositionTypeUnspecified -> "POSITION_TYPE_UNSPECIFIED"
FirstInAlbum -> "FIRST_IN_ALBUM"
LastInAlbum -> "LAST_IN_ALBUM"
AfterMediaItem -> "AFTER_MEDIA_ITEM"
AfterEnrichmentItem -> "AFTER_ENRICHMENT_ITEM"
instance FromJSON AlbumPositionPosition where
parseJSON = parseJSONText "AlbumPositionPosition"
instance ToJSON AlbumPositionPosition where
toJSON = toJSONText
data Xgafv
= X1
| X2
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable Xgafv
instance FromHttpApiData Xgafv where
parseQueryParam = \case
"1" -> Right X1
"2" -> Right X2
x -> Left ("Unable to parse Xgafv from: " <> x)
instance ToHttpApiData Xgafv where
toQueryParam = \case
X1 -> "1"
X2 -> "2"
instance FromJSON Xgafv where
parseJSON = parseJSONText "Xgafv"
instance ToJSON Xgafv where
toJSON = toJSONText