{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Testing.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data TestMatrixState
= TestStateUnspecified
| Validating
| Pending
| Running
| Finished
| Error'
| UnsupportedEnvironment
| IncompatibleEnvironment
| IncompatibleArchitecture
| Cancelled
| Invalid
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable TestMatrixState
instance FromHttpApiData TestMatrixState where
parseQueryParam = \case
"TEST_STATE_UNSPECIFIED" -> Right TestStateUnspecified
"VALIDATING" -> Right Validating
"PENDING" -> Right Pending
"RUNNING" -> Right Running
"FINISHED" -> Right Finished
"ERROR" -> Right Error'
"UNSUPPORTED_ENVIRONMENT" -> Right UnsupportedEnvironment
"INCOMPATIBLE_ENVIRONMENT" -> Right IncompatibleEnvironment
"INCOMPATIBLE_ARCHITECTURE" -> Right IncompatibleArchitecture
"CANCELLED" -> Right Cancelled
"INVALID" -> Right Invalid
x -> Left ("Unable to parse TestMatrixState from: " <> x)
instance ToHttpApiData TestMatrixState where
toQueryParam = \case
TestStateUnspecified -> "TEST_STATE_UNSPECIFIED"
Validating -> "VALIDATING"
Pending -> "PENDING"
Running -> "RUNNING"
Finished -> "FINISHED"
Error' -> "ERROR"
UnsupportedEnvironment -> "UNSUPPORTED_ENVIRONMENT"
IncompatibleEnvironment -> "INCOMPATIBLE_ENVIRONMENT"
IncompatibleArchitecture -> "INCOMPATIBLE_ARCHITECTURE"
Cancelled -> "CANCELLED"
Invalid -> "INVALID"
instance FromJSON TestMatrixState where
parseJSON = parseJSONText "TestMatrixState"
instance ToJSON TestMatrixState where
toJSON = toJSONText
data TestMatrixInvalidMatrixDetails
= InvalidMatrixDetailsUnspecified
| DetailsUnavailable
| MalformedAPK
| MalformedTestAPK
| NoManifest
| NoPackageName
| TestSameAsApp
| NoInstrumentation
| NoSignature
| InstrumentationOrchestratorIncompatible
| NoTestRunnerClass
| NoLauncherActivity
| ForBiddenPermissions
| InvalidRoboDirectives
| TestLoopIntentFilterNotFound
| ScenarioLabelNotDeclared
| ScenarioLabelMalformed
| ScenarioNotDeclared
| DeviceAdminReceiver
| MalformedXcTestZip
| BuiltForIosSimulator
| NoTestsInXcTestZip
| UseDestinationArtifacts
| TestNotAppHosted
| PListCannotBeParsed
| TestOnlyAPK
| MalformedIPa
| NoCodeAPK
| InvalidInputAPK
| InvalidAPKPreviewSdk
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable TestMatrixInvalidMatrixDetails
instance FromHttpApiData TestMatrixInvalidMatrixDetails where
parseQueryParam = \case
"INVALID_MATRIX_DETAILS_UNSPECIFIED" -> Right InvalidMatrixDetailsUnspecified
"DETAILS_UNAVAILABLE" -> Right DetailsUnavailable
"MALFORMED_APK" -> Right MalformedAPK
"MALFORMED_TEST_APK" -> Right MalformedTestAPK
"NO_MANIFEST" -> Right NoManifest
"NO_PACKAGE_NAME" -> Right NoPackageName
"TEST_SAME_AS_APP" -> Right TestSameAsApp
"NO_INSTRUMENTATION" -> Right NoInstrumentation
"NO_SIGNATURE" -> Right NoSignature
"INSTRUMENTATION_ORCHESTRATOR_INCOMPATIBLE" -> Right InstrumentationOrchestratorIncompatible
"NO_TEST_RUNNER_CLASS" -> Right NoTestRunnerClass
"NO_LAUNCHER_ACTIVITY" -> Right NoLauncherActivity
"FORBIDDEN_PERMISSIONS" -> Right ForBiddenPermissions
"INVALID_ROBO_DIRECTIVES" -> Right InvalidRoboDirectives
"TEST_LOOP_INTENT_FILTER_NOT_FOUND" -> Right TestLoopIntentFilterNotFound
"SCENARIO_LABEL_NOT_DECLARED" -> Right ScenarioLabelNotDeclared
"SCENARIO_LABEL_MALFORMED" -> Right ScenarioLabelMalformed
"SCENARIO_NOT_DECLARED" -> Right ScenarioNotDeclared
"DEVICE_ADMIN_RECEIVER" -> Right DeviceAdminReceiver
"MALFORMED_XC_TEST_ZIP" -> Right MalformedXcTestZip
"BUILT_FOR_IOS_SIMULATOR" -> Right BuiltForIosSimulator
"NO_TESTS_IN_XC_TEST_ZIP" -> Right NoTestsInXcTestZip
"USE_DESTINATION_ARTIFACTS" -> Right UseDestinationArtifacts
"TEST_NOT_APP_HOSTED" -> Right TestNotAppHosted
"PLIST_CANNOT_BE_PARSED" -> Right PListCannotBeParsed
"TEST_ONLY_APK" -> Right TestOnlyAPK
"MALFORMED_IPA" -> Right MalformedIPa
"NO_CODE_APK" -> Right NoCodeAPK
"INVALID_INPUT_APK" -> Right InvalidInputAPK
"INVALID_APK_PREVIEW_SDK" -> Right InvalidAPKPreviewSdk
x -> Left ("Unable to parse TestMatrixInvalidMatrixDetails from: " <> x)
instance ToHttpApiData TestMatrixInvalidMatrixDetails where
toQueryParam = \case
InvalidMatrixDetailsUnspecified -> "INVALID_MATRIX_DETAILS_UNSPECIFIED"
DetailsUnavailable -> "DETAILS_UNAVAILABLE"
MalformedAPK -> "MALFORMED_APK"
MalformedTestAPK -> "MALFORMED_TEST_APK"
NoManifest -> "NO_MANIFEST"
NoPackageName -> "NO_PACKAGE_NAME"
TestSameAsApp -> "TEST_SAME_AS_APP"
NoInstrumentation -> "NO_INSTRUMENTATION"
NoSignature -> "NO_SIGNATURE"
InstrumentationOrchestratorIncompatible -> "INSTRUMENTATION_ORCHESTRATOR_INCOMPATIBLE"
NoTestRunnerClass -> "NO_TEST_RUNNER_CLASS"
NoLauncherActivity -> "NO_LAUNCHER_ACTIVITY"
ForBiddenPermissions -> "FORBIDDEN_PERMISSIONS"
InvalidRoboDirectives -> "INVALID_ROBO_DIRECTIVES"
TestLoopIntentFilterNotFound -> "TEST_LOOP_INTENT_FILTER_NOT_FOUND"
ScenarioLabelNotDeclared -> "SCENARIO_LABEL_NOT_DECLARED"
ScenarioLabelMalformed -> "SCENARIO_LABEL_MALFORMED"
ScenarioNotDeclared -> "SCENARIO_NOT_DECLARED"
DeviceAdminReceiver -> "DEVICE_ADMIN_RECEIVER"
MalformedXcTestZip -> "MALFORMED_XC_TEST_ZIP"
BuiltForIosSimulator -> "BUILT_FOR_IOS_SIMULATOR"
NoTestsInXcTestZip -> "NO_TESTS_IN_XC_TEST_ZIP"
UseDestinationArtifacts -> "USE_DESTINATION_ARTIFACTS"
TestNotAppHosted -> "TEST_NOT_APP_HOSTED"
PListCannotBeParsed -> "PLIST_CANNOT_BE_PARSED"
TestOnlyAPK -> "TEST_ONLY_APK"
MalformedIPa -> "MALFORMED_IPA"
NoCodeAPK -> "NO_CODE_APK"
InvalidInputAPK -> "INVALID_INPUT_APK"
InvalidAPKPreviewSdk -> "INVALID_APK_PREVIEW_SDK"
instance FromJSON TestMatrixInvalidMatrixDetails where
parseJSON = parseJSONText "TestMatrixInvalidMatrixDetails"
instance ToJSON TestMatrixInvalidMatrixDetails where
toJSON = toJSONText
data AndroidInstrumentationTestOrchestratorOption
= OrchestratorOptionUnspecified
| UseOrchestrator
| DoNotUseOrchestrator
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AndroidInstrumentationTestOrchestratorOption
instance FromHttpApiData AndroidInstrumentationTestOrchestratorOption where
parseQueryParam = \case
"ORCHESTRATOR_OPTION_UNSPECIFIED" -> Right OrchestratorOptionUnspecified
"USE_ORCHESTRATOR" -> Right UseOrchestrator
"DO_NOT_USE_ORCHESTRATOR" -> Right DoNotUseOrchestrator
x -> Left ("Unable to parse AndroidInstrumentationTestOrchestratorOption from: " <> x)
instance ToHttpApiData AndroidInstrumentationTestOrchestratorOption where
toQueryParam = \case
OrchestratorOptionUnspecified -> "ORCHESTRATOR_OPTION_UNSPECIFIED"
UseOrchestrator -> "USE_ORCHESTRATOR"
DoNotUseOrchestrator -> "DO_NOT_USE_ORCHESTRATOR"
instance FromJSON AndroidInstrumentationTestOrchestratorOption where
parseJSON = parseJSONText "AndroidInstrumentationTestOrchestratorOption"
instance ToJSON AndroidInstrumentationTestOrchestratorOption where
toJSON = toJSONText
data TestExecutionState
= TESTestStateUnspecified
| TESValidating
| TESPending
| TESRunning
| TESFinished
| TESError'
| TESUnsupportedEnvironment
| TESIncompatibleEnvironment
| TESIncompatibleArchitecture
| TESCancelled
| TESInvalid
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable TestExecutionState
instance FromHttpApiData TestExecutionState where
parseQueryParam = \case
"TEST_STATE_UNSPECIFIED" -> Right TESTestStateUnspecified
"VALIDATING" -> Right TESValidating
"PENDING" -> Right TESPending
"RUNNING" -> Right TESRunning
"FINISHED" -> Right TESFinished
"ERROR" -> Right TESError'
"UNSUPPORTED_ENVIRONMENT" -> Right TESUnsupportedEnvironment
"INCOMPATIBLE_ENVIRONMENT" -> Right TESIncompatibleEnvironment
"INCOMPATIBLE_ARCHITECTURE" -> Right TESIncompatibleArchitecture
"CANCELLED" -> Right TESCancelled
"INVALID" -> Right TESInvalid
x -> Left ("Unable to parse TestExecutionState from: " <> x)
instance ToHttpApiData TestExecutionState where
toQueryParam = \case
TESTestStateUnspecified -> "TEST_STATE_UNSPECIFIED"
TESValidating -> "VALIDATING"
TESPending -> "PENDING"
TESRunning -> "RUNNING"
TESFinished -> "FINISHED"
TESError' -> "ERROR"
TESUnsupportedEnvironment -> "UNSUPPORTED_ENVIRONMENT"
TESIncompatibleEnvironment -> "INCOMPATIBLE_ENVIRONMENT"
TESIncompatibleArchitecture -> "INCOMPATIBLE_ARCHITECTURE"
TESCancelled -> "CANCELLED"
TESInvalid -> "INVALID"
instance FromJSON TestExecutionState where
parseJSON = parseJSONText "TestExecutionState"
instance ToJSON TestExecutionState where
toJSON = toJSONText
data CancelTestMatrixResponseTestState
= CTMRTSTestStateUnspecified
| CTMRTSValidating
| CTMRTSPending
| CTMRTSRunning
| CTMRTSFinished
| CTMRTSError'
| CTMRTSUnsupportedEnvironment
| CTMRTSIncompatibleEnvironment
| CTMRTSIncompatibleArchitecture
| CTMRTSCancelled
| CTMRTSInvalid
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable CancelTestMatrixResponseTestState
instance FromHttpApiData CancelTestMatrixResponseTestState where
parseQueryParam = \case
"TEST_STATE_UNSPECIFIED" -> Right CTMRTSTestStateUnspecified
"VALIDATING" -> Right CTMRTSValidating
"PENDING" -> Right CTMRTSPending
"RUNNING" -> Right CTMRTSRunning
"FINISHED" -> Right CTMRTSFinished
"ERROR" -> Right CTMRTSError'
"UNSUPPORTED_ENVIRONMENT" -> Right CTMRTSUnsupportedEnvironment
"INCOMPATIBLE_ENVIRONMENT" -> Right CTMRTSIncompatibleEnvironment
"INCOMPATIBLE_ARCHITECTURE" -> Right CTMRTSIncompatibleArchitecture
"CANCELLED" -> Right CTMRTSCancelled
"INVALID" -> Right CTMRTSInvalid
x -> Left ("Unable to parse CancelTestMatrixResponseTestState from: " <> x)
instance ToHttpApiData CancelTestMatrixResponseTestState where
toQueryParam = \case
CTMRTSTestStateUnspecified -> "TEST_STATE_UNSPECIFIED"
CTMRTSValidating -> "VALIDATING"
CTMRTSPending -> "PENDING"
CTMRTSRunning -> "RUNNING"
CTMRTSFinished -> "FINISHED"
CTMRTSError' -> "ERROR"
CTMRTSUnsupportedEnvironment -> "UNSUPPORTED_ENVIRONMENT"
CTMRTSIncompatibleEnvironment -> "INCOMPATIBLE_ENVIRONMENT"
CTMRTSIncompatibleArchitecture -> "INCOMPATIBLE_ARCHITECTURE"
CTMRTSCancelled -> "CANCELLED"
CTMRTSInvalid -> "INVALID"
instance FromJSON CancelTestMatrixResponseTestState where
parseJSON = parseJSONText "CancelTestMatrixResponseTestState"
instance ToJSON CancelTestMatrixResponseTestState where
toJSON = toJSONText
data RoboDirectiveActionType
= ActionTypeUnspecified
| SingleClick
| EnterText
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable RoboDirectiveActionType
instance FromHttpApiData RoboDirectiveActionType where
parseQueryParam = \case
"ACTION_TYPE_UNSPECIFIED" -> Right ActionTypeUnspecified
"SINGLE_CLICK" -> Right SingleClick
"ENTER_TEXT" -> Right EnterText
x -> Left ("Unable to parse RoboDirectiveActionType from: " <> x)
instance ToHttpApiData RoboDirectiveActionType where
toQueryParam = \case
ActionTypeUnspecified -> "ACTION_TYPE_UNSPECIFIED"
SingleClick -> "SINGLE_CLICK"
EnterText -> "ENTER_TEXT"
instance FromJSON RoboDirectiveActionType where
parseJSON = parseJSONText "RoboDirectiveActionType"
instance ToJSON RoboDirectiveActionType where
toJSON = toJSONText
data IosModelFormFactor
= DeviceFormFactorUnspecified
| Phone
| Tablet
| Wearable
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable IosModelFormFactor
instance FromHttpApiData IosModelFormFactor where
parseQueryParam = \case
"DEVICE_FORM_FACTOR_UNSPECIFIED" -> Right DeviceFormFactorUnspecified
"PHONE" -> Right Phone
"TABLET" -> Right Tablet
"WEARABLE" -> Right Wearable
x -> Left ("Unable to parse IosModelFormFactor from: " <> x)
instance ToHttpApiData IosModelFormFactor where
toQueryParam = \case
DeviceFormFactorUnspecified -> "DEVICE_FORM_FACTOR_UNSPECIFIED"
Phone -> "PHONE"
Tablet -> "TABLET"
Wearable -> "WEARABLE"
instance FromJSON IosModelFormFactor where
parseJSON = parseJSONText "IosModelFormFactor"
instance ToJSON IosModelFormFactor where
toJSON = toJSONText
data AndroidModelFormFactor
= AMFFDeviceFormFactorUnspecified
| AMFFPhone
| AMFFTablet
| AMFFWearable
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AndroidModelFormFactor
instance FromHttpApiData AndroidModelFormFactor where
parseQueryParam = \case
"DEVICE_FORM_FACTOR_UNSPECIFIED" -> Right AMFFDeviceFormFactorUnspecified
"PHONE" -> Right AMFFPhone
"TABLET" -> Right AMFFTablet
"WEARABLE" -> Right AMFFWearable
x -> Left ("Unable to parse AndroidModelFormFactor from: " <> x)
instance ToHttpApiData AndroidModelFormFactor where
toQueryParam = \case
AMFFDeviceFormFactorUnspecified -> "DEVICE_FORM_FACTOR_UNSPECIFIED"
AMFFPhone -> "PHONE"
AMFFTablet -> "TABLET"
AMFFWearable -> "WEARABLE"
instance FromJSON AndroidModelFormFactor where
parseJSON = parseJSONText "AndroidModelFormFactor"
instance ToJSON AndroidModelFormFactor where
toJSON = toJSONText
data AndroidModelForm
= DeviceFormUnspecified
| Virtual
| Physical
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AndroidModelForm
instance FromHttpApiData AndroidModelForm where
parseQueryParam = \case
"DEVICE_FORM_UNSPECIFIED" -> Right DeviceFormUnspecified
"VIRTUAL" -> Right Virtual
"PHYSICAL" -> Right Physical
x -> Left ("Unable to parse AndroidModelForm from: " <> x)
instance ToHttpApiData AndroidModelForm where
toQueryParam = \case
DeviceFormUnspecified -> "DEVICE_FORM_UNSPECIFIED"
Virtual -> "VIRTUAL"
Physical -> "PHYSICAL"
instance FromJSON AndroidModelForm where
parseJSON = parseJSONText "AndroidModelForm"
instance ToJSON AndroidModelForm 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