{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.WebSecurityScanner.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data FindingFindingType
= FindingTypeUnspecified
| MixedContent
| OutdatedLibrary
| RoSettaFlash
| XssCallback
| XssError
| ClearTextPassword
| InvalidContentType
| XssAngularCallback
| InvalidHeader
| MisspelledSecurityHeaderName
| MismatchingSecurityHeaderValues
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FindingFindingType
instance FromHttpApiData FindingFindingType where
parseQueryParam = \case
"FINDING_TYPE_UNSPECIFIED" -> Right FindingTypeUnspecified
"MIXED_CONTENT" -> Right MixedContent
"OUTDATED_LIBRARY" -> Right OutdatedLibrary
"ROSETTA_FLASH" -> Right RoSettaFlash
"XSS_CALLBACK" -> Right XssCallback
"XSS_ERROR" -> Right XssError
"CLEAR_TEXT_PASSWORD" -> Right ClearTextPassword
"INVALID_CONTENT_TYPE" -> Right InvalidContentType
"XSS_ANGULAR_CALLBACK" -> Right XssAngularCallback
"INVALID_HEADER" -> Right InvalidHeader
"MISSPELLED_SECURITY_HEADER_NAME" -> Right MisspelledSecurityHeaderName
"MISMATCHING_SECURITY_HEADER_VALUES" -> Right MismatchingSecurityHeaderValues
x -> Left ("Unable to parse FindingFindingType from: " <> x)
instance ToHttpApiData FindingFindingType where
toQueryParam = \case
FindingTypeUnspecified -> "FINDING_TYPE_UNSPECIFIED"
MixedContent -> "MIXED_CONTENT"
OutdatedLibrary -> "OUTDATED_LIBRARY"
RoSettaFlash -> "ROSETTA_FLASH"
XssCallback -> "XSS_CALLBACK"
XssError -> "XSS_ERROR"
ClearTextPassword -> "CLEAR_TEXT_PASSWORD"
InvalidContentType -> "INVALID_CONTENT_TYPE"
XssAngularCallback -> "XSS_ANGULAR_CALLBACK"
InvalidHeader -> "INVALID_HEADER"
MisspelledSecurityHeaderName -> "MISSPELLED_SECURITY_HEADER_NAME"
MismatchingSecurityHeaderValues -> "MISMATCHING_SECURITY_HEADER_VALUES"
instance FromJSON FindingFindingType where
parseJSON = parseJSONText "FindingFindingType"
instance ToJSON FindingFindingType 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 ScanConfigUserAgent
= UserAgentUnspecified
| ChromeLinux
| ChromeAndroid
| SafariIPhone
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ScanConfigUserAgent
instance FromHttpApiData ScanConfigUserAgent where
parseQueryParam = \case
"USER_AGENT_UNSPECIFIED" -> Right UserAgentUnspecified
"CHROME_LINUX" -> Right ChromeLinux
"CHROME_ANDROID" -> Right ChromeAndroid
"SAFARI_IPHONE" -> Right SafariIPhone
x -> Left ("Unable to parse ScanConfigUserAgent from: " <> x)
instance ToHttpApiData ScanConfigUserAgent where
toQueryParam = \case
UserAgentUnspecified -> "USER_AGENT_UNSPECIFIED"
ChromeLinux -> "CHROME_LINUX"
ChromeAndroid -> "CHROME_ANDROID"
SafariIPhone -> "SAFARI_IPHONE"
instance FromJSON ScanConfigUserAgent where
parseJSON = parseJSONText "ScanConfigUserAgent"
instance ToJSON ScanConfigUserAgent where
toJSON = toJSONText
data ScanRunResultState
= ResultStateUnspecified
| Success
| Error'
| Killed
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ScanRunResultState
instance FromHttpApiData ScanRunResultState where
parseQueryParam = \case
"RESULT_STATE_UNSPECIFIED" -> Right ResultStateUnspecified
"SUCCESS" -> Right Success
"ERROR" -> Right Error'
"KILLED" -> Right Killed
x -> Left ("Unable to parse ScanRunResultState from: " <> x)
instance ToHttpApiData ScanRunResultState where
toQueryParam = \case
ResultStateUnspecified -> "RESULT_STATE_UNSPECIFIED"
Success -> "SUCCESS"
Error' -> "ERROR"
Killed -> "KILLED"
instance FromJSON ScanRunResultState where
parseJSON = parseJSONText "ScanRunResultState"
instance ToJSON ScanRunResultState where
toJSON = toJSONText
data ScanRunExecutionState
= ExecutionStateUnspecified
| Queued
| Scanning
| Finished
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ScanRunExecutionState
instance FromHttpApiData ScanRunExecutionState where
parseQueryParam = \case
"EXECUTION_STATE_UNSPECIFIED" -> Right ExecutionStateUnspecified
"QUEUED" -> Right Queued
"SCANNING" -> Right Scanning
"FINISHED" -> Right Finished
x -> Left ("Unable to parse ScanRunExecutionState from: " <> x)
instance ToHttpApiData ScanRunExecutionState where
toQueryParam = \case
ExecutionStateUnspecified -> "EXECUTION_STATE_UNSPECIFIED"
Queued -> "QUEUED"
Scanning -> "SCANNING"
Finished -> "FINISHED"
instance FromJSON ScanRunExecutionState where
parseJSON = parseJSONText "ScanRunExecutionState"
instance ToJSON ScanRunExecutionState where
toJSON = toJSONText
data FindingTypeStatsFindingType
= FTSFTFindingTypeUnspecified
| FTSFTMixedContent
| FTSFTOutdatedLibrary
| FTSFTRoSettaFlash
| FTSFTXssCallback
| FTSFTXssError
| FTSFTClearTextPassword
| FTSFTInvalidContentType
| FTSFTXssAngularCallback
| FTSFTInvalidHeader
| FTSFTMisspelledSecurityHeaderName
| FTSFTMismatchingSecurityHeaderValues
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FindingTypeStatsFindingType
instance FromHttpApiData FindingTypeStatsFindingType where
parseQueryParam = \case
"FINDING_TYPE_UNSPECIFIED" -> Right FTSFTFindingTypeUnspecified
"MIXED_CONTENT" -> Right FTSFTMixedContent
"OUTDATED_LIBRARY" -> Right FTSFTOutdatedLibrary
"ROSETTA_FLASH" -> Right FTSFTRoSettaFlash
"XSS_CALLBACK" -> Right FTSFTXssCallback
"XSS_ERROR" -> Right FTSFTXssError
"CLEAR_TEXT_PASSWORD" -> Right FTSFTClearTextPassword
"INVALID_CONTENT_TYPE" -> Right FTSFTInvalidContentType
"XSS_ANGULAR_CALLBACK" -> Right FTSFTXssAngularCallback
"INVALID_HEADER" -> Right FTSFTInvalidHeader
"MISSPELLED_SECURITY_HEADER_NAME" -> Right FTSFTMisspelledSecurityHeaderName
"MISMATCHING_SECURITY_HEADER_VALUES" -> Right FTSFTMismatchingSecurityHeaderValues
x -> Left ("Unable to parse FindingTypeStatsFindingType from: " <> x)
instance ToHttpApiData FindingTypeStatsFindingType where
toQueryParam = \case
FTSFTFindingTypeUnspecified -> "FINDING_TYPE_UNSPECIFIED"
FTSFTMixedContent -> "MIXED_CONTENT"
FTSFTOutdatedLibrary -> "OUTDATED_LIBRARY"
FTSFTRoSettaFlash -> "ROSETTA_FLASH"
FTSFTXssCallback -> "XSS_CALLBACK"
FTSFTXssError -> "XSS_ERROR"
FTSFTClearTextPassword -> "CLEAR_TEXT_PASSWORD"
FTSFTInvalidContentType -> "INVALID_CONTENT_TYPE"
FTSFTXssAngularCallback -> "XSS_ANGULAR_CALLBACK"
FTSFTInvalidHeader -> "INVALID_HEADER"
FTSFTMisspelledSecurityHeaderName -> "MISSPELLED_SECURITY_HEADER_NAME"
FTSFTMismatchingSecurityHeaderValues -> "MISMATCHING_SECURITY_HEADER_VALUES"
instance FromJSON FindingTypeStatsFindingType where
parseJSON = parseJSONText "FindingTypeStatsFindingType"
instance ToJSON FindingTypeStatsFindingType where
toJSON = toJSONText