{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Manufacturers.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data DestinationStatusStatus
= Unknown
| Active
| Pending
| DisApproved
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DestinationStatusStatus
instance FromHttpApiData DestinationStatusStatus where
parseQueryParam = \case
"UNKNOWN" -> Right Unknown
"ACTIVE" -> Right Active
"PENDING" -> Right Pending
"DISAPPROVED" -> Right DisApproved
x -> Left ("Unable to parse DestinationStatusStatus from: " <> x)
instance ToHttpApiData DestinationStatusStatus where
toQueryParam = \case
Unknown -> "UNKNOWN"
Active -> "ACTIVE"
Pending -> "PENDING"
DisApproved -> "DISAPPROVED"
instance FromJSON DestinationStatusStatus where
parseJSON = parseJSONText "DestinationStatusStatus"
instance ToJSON DestinationStatusStatus where
toJSON = toJSONText
data IssueResolution
= ResolutionUnspecified
| UserAction
| PendingProcessing
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable IssueResolution
instance FromHttpApiData IssueResolution where
parseQueryParam = \case
"RESOLUTION_UNSPECIFIED" -> Right ResolutionUnspecified
"USER_ACTION" -> Right UserAction
"PENDING_PROCESSING" -> Right PendingProcessing
x -> Left ("Unable to parse IssueResolution from: " <> x)
instance ToHttpApiData IssueResolution where
toQueryParam = \case
ResolutionUnspecified -> "RESOLUTION_UNSPECIFIED"
UserAction -> "USER_ACTION"
PendingProcessing -> "PENDING_PROCESSING"
instance FromJSON IssueResolution where
parseJSON = parseJSONText "IssueResolution"
instance ToJSON IssueResolution where
toJSON = toJSONText
data ImageStatus
= ISStatusUnspecified
| ISPendingProcessing
| ISPendingCrawl
| ISOK
| ISRoboted
| ISXroboted
| ISCrawlError
| ISProcessingError
| ISDecodingError
| ISTooBig
| ISCrawlSkipped
| ISHostLoaded
| ISHTTP404
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ImageStatus
instance FromHttpApiData ImageStatus where
parseQueryParam = \case
"STATUS_UNSPECIFIED" -> Right ISStatusUnspecified
"PENDING_PROCESSING" -> Right ISPendingProcessing
"PENDING_CRAWL" -> Right ISPendingCrawl
"OK" -> Right ISOK
"ROBOTED" -> Right ISRoboted
"XROBOTED" -> Right ISXroboted
"CRAWL_ERROR" -> Right ISCrawlError
"PROCESSING_ERROR" -> Right ISProcessingError
"DECODING_ERROR" -> Right ISDecodingError
"TOO_BIG" -> Right ISTooBig
"CRAWL_SKIPPED" -> Right ISCrawlSkipped
"HOSTLOADED" -> Right ISHostLoaded
"HTTP_404" -> Right ISHTTP404
x -> Left ("Unable to parse ImageStatus from: " <> x)
instance ToHttpApiData ImageStatus where
toQueryParam = \case
ISStatusUnspecified -> "STATUS_UNSPECIFIED"
ISPendingProcessing -> "PENDING_PROCESSING"
ISPendingCrawl -> "PENDING_CRAWL"
ISOK -> "OK"
ISRoboted -> "ROBOTED"
ISXroboted -> "XROBOTED"
ISCrawlError -> "CRAWL_ERROR"
ISProcessingError -> "PROCESSING_ERROR"
ISDecodingError -> "DECODING_ERROR"
ISTooBig -> "TOO_BIG"
ISCrawlSkipped -> "CRAWL_SKIPPED"
ISHostLoaded -> "HOSTLOADED"
ISHTTP404 -> "HTTP_404"
instance FromJSON ImageStatus where
parseJSON = parseJSONText "ImageStatus"
instance ToJSON ImageStatus where
toJSON = toJSONText
data ImageType
= TypeUnspecified
| Crawled
| Uploaded
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ImageType
instance FromHttpApiData ImageType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right TypeUnspecified
"CRAWLED" -> Right Crawled
"UPLOADED" -> Right Uploaded
x -> Left ("Unable to parse ImageType from: " <> x)
instance ToHttpApiData ImageType where
toQueryParam = \case
TypeUnspecified -> "TYPE_UNSPECIFIED"
Crawled -> "CRAWLED"
Uploaded -> "UPLOADED"
instance FromJSON ImageType where
parseJSON = parseJSONText "ImageType"
instance ToJSON ImageType 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 IssueSeverity
= SeverityUnspecified
| Error'
| Warning
| Info
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable IssueSeverity
instance FromHttpApiData IssueSeverity where
parseQueryParam = \case
"SEVERITY_UNSPECIFIED" -> Right SeverityUnspecified
"ERROR" -> Right Error'
"WARNING" -> Right Warning
"INFO" -> Right Info
x -> Left ("Unable to parse IssueSeverity from: " <> x)
instance ToHttpApiData IssueSeverity where
toQueryParam = \case
SeverityUnspecified -> "SEVERITY_UNSPECIFIED"
Error' -> "ERROR"
Warning -> "WARNING"
Info -> "INFO"
instance FromJSON IssueSeverity where
parseJSON = parseJSONText "IssueSeverity"
instance ToJSON IssueSeverity where
toJSON = toJSONText