{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Debugger.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data StatusMessageRefersTo
= Unspecified
| BreakpointSourceLocation
| BreakpointCondition
| BreakpointExpression
| BreakpointAge
| VariableName
| VariableValue
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable StatusMessageRefersTo
instance FromHttpApiData StatusMessageRefersTo where
parseQueryParam = \case
"UNSPECIFIED" -> Right Unspecified
"BREAKPOINT_SOURCE_LOCATION" -> Right BreakpointSourceLocation
"BREAKPOINT_CONDITION" -> Right BreakpointCondition
"BREAKPOINT_EXPRESSION" -> Right BreakpointExpression
"BREAKPOINT_AGE" -> Right BreakpointAge
"VARIABLE_NAME" -> Right VariableName
"VARIABLE_VALUE" -> Right VariableValue
x -> Left ("Unable to parse StatusMessageRefersTo from: " <> x)
instance ToHttpApiData StatusMessageRefersTo where
toQueryParam = \case
Unspecified -> "UNSPECIFIED"
BreakpointSourceLocation -> "BREAKPOINT_SOURCE_LOCATION"
BreakpointCondition -> "BREAKPOINT_CONDITION"
BreakpointExpression -> "BREAKPOINT_EXPRESSION"
BreakpointAge -> "BREAKPOINT_AGE"
VariableName -> "VARIABLE_NAME"
VariableValue -> "VARIABLE_VALUE"
instance FromJSON StatusMessageRefersTo where
parseJSON = parseJSONText "StatusMessageRefersTo"
instance ToJSON StatusMessageRefersTo where
toJSON = toJSONText
data BreakpointLogLevel
= Info
| Warning
| Error'
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BreakpointLogLevel
instance FromHttpApiData BreakpointLogLevel where
parseQueryParam = \case
"INFO" -> Right Info
"WARNING" -> Right Warning
"ERROR" -> Right Error'
x -> Left ("Unable to parse BreakpointLogLevel from: " <> x)
instance ToHttpApiData BreakpointLogLevel where
toQueryParam = \case
Info -> "INFO"
Warning -> "WARNING"
Error' -> "ERROR"
instance FromJSON BreakpointLogLevel where
parseJSON = parseJSONText "BreakpointLogLevel"
instance ToJSON BreakpointLogLevel 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 BreakpointAction
= Capture
| Log
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable BreakpointAction
instance FromHttpApiData BreakpointAction where
parseQueryParam = \case
"CAPTURE" -> Right Capture
"LOG" -> Right Log
x -> Left ("Unable to parse BreakpointAction from: " <> x)
instance ToHttpApiData BreakpointAction where
toQueryParam = \case
Capture -> "CAPTURE"
Log -> "LOG"
instance FromJSON BreakpointAction where
parseJSON = parseJSONText "BreakpointAction"
instance ToJSON BreakpointAction where
toJSON = toJSONText
data AliasContextKind
= Any
| Fixed
| Movable
| Other
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AliasContextKind
instance FromHttpApiData AliasContextKind where
parseQueryParam = \case
"ANY" -> Right Any
"FIXED" -> Right Fixed
"MOVABLE" -> Right Movable
"OTHER" -> Right Other
x -> Left ("Unable to parse AliasContextKind from: " <> x)
instance ToHttpApiData AliasContextKind where
toQueryParam = \case
Any -> "ANY"
Fixed -> "FIXED"
Movable -> "MOVABLE"
Other -> "OTHER"
instance FromJSON AliasContextKind where
parseJSON = parseJSONText "AliasContextKind"
instance ToJSON AliasContextKind where
toJSON = toJSONText