{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Poly.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data ImageErrorCode
= CodeUnspecified
| InvalidImage
| ImageTooBig
| WrongImageType
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ImageErrorCode
instance FromHttpApiData ImageErrorCode where
parseQueryParam = \case
"CODE_UNSPECIFIED" -> Right CodeUnspecified
"INVALID_IMAGE" -> Right InvalidImage
"IMAGE_TOO_BIG" -> Right ImageTooBig
"WRONG_IMAGE_TYPE" -> Right WrongImageType
x -> Left ("Unable to parse ImageErrorCode from: " <> x)
instance ToHttpApiData ImageErrorCode where
toQueryParam = \case
CodeUnspecified -> "CODE_UNSPECIFIED"
InvalidImage -> "INVALID_IMAGE"
ImageTooBig -> "IMAGE_TOO_BIG"
WrongImageType -> "WRONG_IMAGE_TYPE"
instance FromJSON ImageErrorCode where
parseJSON = parseJSONText "ImageErrorCode"
instance ToJSON ImageErrorCode where
toJSON = toJSONText
data AssetImportMessageCode
= AIMCCodeUnspecified
| AIMCNoImportableFile
| AIMCEmptyModel
| AIMCObjParseError
| AIMCExpired
| AIMCImageError
| AIMCExtraFilesWithArchive
| AIMCDefaultMaterials
| AIMCFatalError
| AIMCInvalidElementType
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AssetImportMessageCode
instance FromHttpApiData AssetImportMessageCode where
parseQueryParam = \case
"CODE_UNSPECIFIED" -> Right AIMCCodeUnspecified
"NO_IMPORTABLE_FILE" -> Right AIMCNoImportableFile
"EMPTY_MODEL" -> Right AIMCEmptyModel
"OBJ_PARSE_ERROR" -> Right AIMCObjParseError
"EXPIRED" -> Right AIMCExpired
"IMAGE_ERROR" -> Right AIMCImageError
"EXTRA_FILES_WITH_ARCHIVE" -> Right AIMCExtraFilesWithArchive
"DEFAULT_MATERIALS" -> Right AIMCDefaultMaterials
"FATAL_ERROR" -> Right AIMCFatalError
"INVALID_ELEMENT_TYPE" -> Right AIMCInvalidElementType
x -> Left ("Unable to parse AssetImportMessageCode from: " <> x)
instance ToHttpApiData AssetImportMessageCode where
toQueryParam = \case
AIMCCodeUnspecified -> "CODE_UNSPECIFIED"
AIMCNoImportableFile -> "NO_IMPORTABLE_FILE"
AIMCEmptyModel -> "EMPTY_MODEL"
AIMCObjParseError -> "OBJ_PARSE_ERROR"
AIMCExpired -> "EXPIRED"
AIMCImageError -> "IMAGE_ERROR"
AIMCExtraFilesWithArchive -> "EXTRA_FILES_WITH_ARCHIVE"
AIMCDefaultMaterials -> "DEFAULT_MATERIALS"
AIMCFatalError -> "FATAL_ERROR"
AIMCInvalidElementType -> "INVALID_ELEMENT_TYPE"
instance FromJSON AssetImportMessageCode where
parseJSON = parseJSONText "AssetImportMessageCode"
instance ToJSON AssetImportMessageCode where
toJSON = toJSONText
data AssetVisibility
= VisibilityUnspecified
| Private
| UnListed
| Public
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AssetVisibility
instance FromHttpApiData AssetVisibility where
parseQueryParam = \case
"VISIBILITY_UNSPECIFIED" -> Right VisibilityUnspecified
"PRIVATE" -> Right Private
"UNLISTED" -> Right UnListed
"PUBLIC" -> Right Public
x -> Left ("Unable to parse AssetVisibility from: " <> x)
instance ToHttpApiData AssetVisibility where
toQueryParam = \case
VisibilityUnspecified -> "VISIBILITY_UNSPECIFIED"
Private -> "PRIVATE"
UnListed -> "UNLISTED"
Public -> "PUBLIC"
instance FromJSON AssetVisibility where
parseJSON = parseJSONText "AssetVisibility"
instance ToJSON AssetVisibility where
toJSON = toJSONText
data ObjParseErrorCode
= OPECCodeUnspecified
| OPECInconsistentVertexRefs
| OPECInvalidCommand
| OPECInvalidNumber
| OPECInvalidVertexRef
| OPECMissingGeometricVertex
| OPECMissingToken
| OPECTooFewDimensions
| OPECTooFewVertices
| OPECTooManyDimensions
| OPECUnsupportedCommand
| OPECUnusedTokens
| OPECVertexNotFound
| OPECNumberOutOfRange
| OPECInvalidValue
| OPECInvalidTextureOption
| OPECTooManyProblems
| OPECMissingFileName
| OPECFileNotFound
| OPECUnknownMaterial
| OPECNoMaterialDefined
| OPECInvalidSmoothingGroup
| OPECMissingVertexColors
| OPECFileSubstitution
| OPECLineTooLong
| OPECInvalidFilePath
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ObjParseErrorCode
instance FromHttpApiData ObjParseErrorCode where
parseQueryParam = \case
"CODE_UNSPECIFIED" -> Right OPECCodeUnspecified
"INCONSISTENT_VERTEX_REFS" -> Right OPECInconsistentVertexRefs
"INVALID_COMMAND" -> Right OPECInvalidCommand
"INVALID_NUMBER" -> Right OPECInvalidNumber
"INVALID_VERTEX_REF" -> Right OPECInvalidVertexRef
"MISSING_GEOMETRIC_VERTEX" -> Right OPECMissingGeometricVertex
"MISSING_TOKEN" -> Right OPECMissingToken
"TOO_FEW_DIMENSIONS" -> Right OPECTooFewDimensions
"TOO_FEW_VERTICES" -> Right OPECTooFewVertices
"TOO_MANY_DIMENSIONS" -> Right OPECTooManyDimensions
"UNSUPPORTED_COMMAND" -> Right OPECUnsupportedCommand
"UNUSED_TOKENS" -> Right OPECUnusedTokens
"VERTEX_NOT_FOUND" -> Right OPECVertexNotFound
"NUMBER_OUT_OF_RANGE" -> Right OPECNumberOutOfRange
"INVALID_VALUE" -> Right OPECInvalidValue
"INVALID_TEXTURE_OPTION" -> Right OPECInvalidTextureOption
"TOO_MANY_PROBLEMS" -> Right OPECTooManyProblems
"MISSING_FILE_NAME" -> Right OPECMissingFileName
"FILE_NOT_FOUND" -> Right OPECFileNotFound
"UNKNOWN_MATERIAL" -> Right OPECUnknownMaterial
"NO_MATERIAL_DEFINED" -> Right OPECNoMaterialDefined
"INVALID_SMOOTHING_GROUP" -> Right OPECInvalidSmoothingGroup
"MISSING_VERTEX_COLORS" -> Right OPECMissingVertexColors
"FILE_SUBSTITUTION" -> Right OPECFileSubstitution
"LINE_TOO_LONG" -> Right OPECLineTooLong
"INVALID_FILE_PATH" -> Right OPECInvalidFilePath
x -> Left ("Unable to parse ObjParseErrorCode from: " <> x)
instance ToHttpApiData ObjParseErrorCode where
toQueryParam = \case
OPECCodeUnspecified -> "CODE_UNSPECIFIED"
OPECInconsistentVertexRefs -> "INCONSISTENT_VERTEX_REFS"
OPECInvalidCommand -> "INVALID_COMMAND"
OPECInvalidNumber -> "INVALID_NUMBER"
OPECInvalidVertexRef -> "INVALID_VERTEX_REF"
OPECMissingGeometricVertex -> "MISSING_GEOMETRIC_VERTEX"
OPECMissingToken -> "MISSING_TOKEN"
OPECTooFewDimensions -> "TOO_FEW_DIMENSIONS"
OPECTooFewVertices -> "TOO_FEW_VERTICES"
OPECTooManyDimensions -> "TOO_MANY_DIMENSIONS"
OPECUnsupportedCommand -> "UNSUPPORTED_COMMAND"
OPECUnusedTokens -> "UNUSED_TOKENS"
OPECVertexNotFound -> "VERTEX_NOT_FOUND"
OPECNumberOutOfRange -> "NUMBER_OUT_OF_RANGE"
OPECInvalidValue -> "INVALID_VALUE"
OPECInvalidTextureOption -> "INVALID_TEXTURE_OPTION"
OPECTooManyProblems -> "TOO_MANY_PROBLEMS"
OPECMissingFileName -> "MISSING_FILE_NAME"
OPECFileNotFound -> "FILE_NOT_FOUND"
OPECUnknownMaterial -> "UNKNOWN_MATERIAL"
OPECNoMaterialDefined -> "NO_MATERIAL_DEFINED"
OPECInvalidSmoothingGroup -> "INVALID_SMOOTHING_GROUP"
OPECMissingVertexColors -> "MISSING_VERTEX_COLORS"
OPECFileSubstitution -> "FILE_SUBSTITUTION"
OPECLineTooLong -> "LINE_TOO_LONG"
OPECInvalidFilePath -> "INVALID_FILE_PATH"
instance FromJSON ObjParseErrorCode where
parseJSON = parseJSONText "ObjParseErrorCode"
instance ToJSON ObjParseErrorCode 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
data AssetLicense
= Unknown
| CreativeCommonsBy
| AllRightsReserved
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AssetLicense
instance FromHttpApiData AssetLicense where
parseQueryParam = \case
"UNKNOWN" -> Right Unknown
"CREATIVE_COMMONS_BY" -> Right CreativeCommonsBy
"ALL_RIGHTS_RESERVED" -> Right AllRightsReserved
x -> Left ("Unable to parse AssetLicense from: " <> x)
instance ToHttpApiData AssetLicense where
toQueryParam = \case
Unknown -> "UNKNOWN"
CreativeCommonsBy -> "CREATIVE_COMMONS_BY"
AllRightsReserved -> "ALL_RIGHTS_RESERVED"
instance FromJSON AssetLicense where
parseJSON = parseJSONText "AssetLicense"
instance ToJSON AssetLicense where
toJSON = toJSONText
data PresentationParamsColorSpace
= PPCSUnknown
| PPCSLinear
| PPCSGamma
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable PresentationParamsColorSpace
instance FromHttpApiData PresentationParamsColorSpace where
parseQueryParam = \case
"UNKNOWN" -> Right PPCSUnknown
"LINEAR" -> Right PPCSLinear
"GAMMA" -> Right PPCSGamma
x -> Left ("Unable to parse PresentationParamsColorSpace from: " <> x)
instance ToHttpApiData PresentationParamsColorSpace where
toQueryParam = \case
PPCSUnknown -> "UNKNOWN"
PPCSLinear -> "LINEAR"
PPCSGamma -> "GAMMA"
instance FromJSON PresentationParamsColorSpace where
parseJSON = parseJSONText "PresentationParamsColorSpace"
instance ToJSON PresentationParamsColorSpace where
toJSON = toJSONText