{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.ContainerBuilder.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data BuildStepStatus
= StatusUnknown
| Queued
| Working
| Success
| Failure
| InternalError
| Timeout
| Cancelled
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BuildStepStatus
instance FromHttpApiData BuildStepStatus where
parseQueryParam = \case
"STATUS_UNKNOWN" -> Right StatusUnknown
"QUEUED" -> Right Queued
"WORKING" -> Right Working
"SUCCESS" -> Right Success
"FAILURE" -> Right Failure
"INTERNAL_ERROR" -> Right InternalError
"TIMEOUT" -> Right Timeout
"CANCELLED" -> Right Cancelled
x -> Left ("Unable to parse BuildStepStatus from: " <> x)
instance ToHttpApiData BuildStepStatus where
toQueryParam = \case
StatusUnknown -> "STATUS_UNKNOWN"
Queued -> "QUEUED"
Working -> "WORKING"
Success -> "SUCCESS"
Failure -> "FAILURE"
InternalError -> "INTERNAL_ERROR"
Timeout -> "TIMEOUT"
Cancelled -> "CANCELLED"
instance FromJSON BuildStepStatus where
parseJSON = parseJSONText "BuildStepStatus"
instance ToJSON BuildStepStatus where
toJSON = toJSONText
data BuildOptionsRequestedVerifyOption
= NotVerified
| Verified
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BuildOptionsRequestedVerifyOption
instance FromHttpApiData BuildOptionsRequestedVerifyOption where
parseQueryParam = \case
"NOT_VERIFIED" -> Right NotVerified
"VERIFIED" -> Right Verified
x -> Left ("Unable to parse BuildOptionsRequestedVerifyOption from: " <> x)
instance ToHttpApiData BuildOptionsRequestedVerifyOption where
toQueryParam = \case
NotVerified -> "NOT_VERIFIED"
Verified -> "VERIFIED"
instance FromJSON BuildOptionsRequestedVerifyOption where
parseJSON = parseJSONText "BuildOptionsRequestedVerifyOption"
instance ToJSON BuildOptionsRequestedVerifyOption 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 BuildStatus
= BSStatusUnknown
| BSQueued
| BSWorking
| BSSuccess
| BSFailure
| BSInternalError
| BSTimeout
| BSCancelled
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BuildStatus
instance FromHttpApiData BuildStatus where
parseQueryParam = \case
"STATUS_UNKNOWN" -> Right BSStatusUnknown
"QUEUED" -> Right BSQueued
"WORKING" -> Right BSWorking
"SUCCESS" -> Right BSSuccess
"FAILURE" -> Right BSFailure
"INTERNAL_ERROR" -> Right BSInternalError
"TIMEOUT" -> Right BSTimeout
"CANCELLED" -> Right BSCancelled
x -> Left ("Unable to parse BuildStatus from: " <> x)
instance ToHttpApiData BuildStatus where
toQueryParam = \case
BSStatusUnknown -> "STATUS_UNKNOWN"
BSQueued -> "QUEUED"
BSWorking -> "WORKING"
BSSuccess -> "SUCCESS"
BSFailure -> "FAILURE"
BSInternalError -> "INTERNAL_ERROR"
BSTimeout -> "TIMEOUT"
BSCancelled -> "CANCELLED"
instance FromJSON BuildStatus where
parseJSON = parseJSONText "BuildStatus"
instance ToJSON BuildStatus where
toJSON = toJSONText
data BuildOptionsSubstitutionOption
= MustMatch
| AllowLoose
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BuildOptionsSubstitutionOption
instance FromHttpApiData BuildOptionsSubstitutionOption where
parseQueryParam = \case
"MUST_MATCH" -> Right MustMatch
"ALLOW_LOOSE" -> Right AllowLoose
x -> Left ("Unable to parse BuildOptionsSubstitutionOption from: " <> x)
instance ToHttpApiData BuildOptionsSubstitutionOption where
toQueryParam = \case
MustMatch -> "MUST_MATCH"
AllowLoose -> "ALLOW_LOOSE"
instance FromJSON BuildOptionsSubstitutionOption where
parseJSON = parseJSONText "BuildOptionsSubstitutionOption"
instance ToJSON BuildOptionsSubstitutionOption where
toJSON = toJSONText
data HashType
= None
| SHA256
| MD5
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable HashType
instance FromHttpApiData HashType where
parseQueryParam = \case
"NONE" -> Right None
"SHA256" -> Right SHA256
"MD5" -> Right MD5
x -> Left ("Unable to parse HashType from: " <> x)
instance ToHttpApiData HashType where
toQueryParam = \case
None -> "NONE"
SHA256 -> "SHA256"
MD5 -> "MD5"
instance FromJSON HashType where
parseJSON = parseJSONText "HashType"
instance ToJSON HashType where
toJSON = toJSONText
data BuildOptionsLogStreamingOption
= StreamDefault
| StreamOn
| StreamOff
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BuildOptionsLogStreamingOption
instance FromHttpApiData BuildOptionsLogStreamingOption where
parseQueryParam = \case
"STREAM_DEFAULT" -> Right StreamDefault
"STREAM_ON" -> Right StreamOn
"STREAM_OFF" -> Right StreamOff
x -> Left ("Unable to parse BuildOptionsLogStreamingOption from: " <> x)
instance ToHttpApiData BuildOptionsLogStreamingOption where
toQueryParam = \case
StreamDefault -> "STREAM_DEFAULT"
StreamOn -> "STREAM_ON"
StreamOff -> "STREAM_OFF"
instance FromJSON BuildOptionsLogStreamingOption where
parseJSON = parseJSONText "BuildOptionsLogStreamingOption"
instance ToJSON BuildOptionsLogStreamingOption where
toJSON = toJSONText
data BuildOptionsLogging
= LoggingUnspecified
| Legacy
| GcsOnly
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BuildOptionsLogging
instance FromHttpApiData BuildOptionsLogging where
parseQueryParam = \case
"LOGGING_UNSPECIFIED" -> Right LoggingUnspecified
"LEGACY" -> Right Legacy
"GCS_ONLY" -> Right GcsOnly
x -> Left ("Unable to parse BuildOptionsLogging from: " <> x)
instance ToHttpApiData BuildOptionsLogging where
toQueryParam = \case
LoggingUnspecified -> "LOGGING_UNSPECIFIED"
Legacy -> "LEGACY"
GcsOnly -> "GCS_ONLY"
instance FromJSON BuildOptionsLogging where
parseJSON = parseJSONText "BuildOptionsLogging"
instance ToJSON BuildOptionsLogging where
toJSON = toJSONText
data BuildOptionsMachineType
= Unspecified
| N1Highcpu8
| N1Highcpu32
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BuildOptionsMachineType
instance FromHttpApiData BuildOptionsMachineType where
parseQueryParam = \case
"UNSPECIFIED" -> Right Unspecified
"N1_HIGHCPU_8" -> Right N1Highcpu8
"N1_HIGHCPU_32" -> Right N1Highcpu32
x -> Left ("Unable to parse BuildOptionsMachineType from: " <> x)
instance ToHttpApiData BuildOptionsMachineType where
toQueryParam = \case
Unspecified -> "UNSPECIFIED"
N1Highcpu8 -> "N1_HIGHCPU_8"
N1Highcpu32 -> "N1_HIGHCPU_32"
instance FromJSON BuildOptionsMachineType where
parseJSON = parseJSONText "BuildOptionsMachineType"
instance ToJSON BuildOptionsMachineType where
toJSON = toJSONText