{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.ServiceControl.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data QuotaPropertiesQuotaMode
= Acquire
| AcquireBestEffort
| Check
| Release
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable QuotaPropertiesQuotaMode
instance FromHttpApiData QuotaPropertiesQuotaMode where
parseQueryParam = \case
"ACQUIRE" -> Right Acquire
"ACQUIRE_BEST_EFFORT" -> Right AcquireBestEffort
"CHECK" -> Right Check
"RELEASE" -> Right Release
x -> Left ("Unable to parse QuotaPropertiesQuotaMode from: " <> x)
instance ToHttpApiData QuotaPropertiesQuotaMode where
toQueryParam = \case
Acquire -> "ACQUIRE"
AcquireBestEffort -> "ACQUIRE_BEST_EFFORT"
Check -> "CHECK"
Release -> "RELEASE"
instance FromJSON QuotaPropertiesQuotaMode where
parseJSON = parseJSONText "QuotaPropertiesQuotaMode"
instance ToJSON QuotaPropertiesQuotaMode where
toJSON = toJSONText
data CheckErrorCode
= ErrorCodeUnspecified
| NotFound
| PermissionDenied
| ResourceExhausted
| BudgetExceeded
| DenialOfServiceDetected
| LoadShedding
| AbUserDetected
| ServiceNotActivated
| VisibilityDenied
| BillingDisabled
| ProjectDeleted
| ProjectInvalid
| ConsumerInvalid
| IPAddressBlocked
| RefererBlocked
| ClientAppBlocked
| APITargetBlocked
| APIKeyInvalid
| APIKeyExpired
| APIKeyNotFound
| SpatulaHeaderInvalid
| LoasRoleInvalid
| NoLoasProject
| LoasProjectDisabled
| SecurityPolicyViolated
| InvalidCredential
| LocationPolicyViolated
| NamespaceLookupUnavailable
| ServiceStatusUnavailable
| BillingStatusUnavailable
| QuotaCheckUnavailable
| LoasProjectLookupUnavailable
| CloudResourceManagerBackendUnavailable
| SecurityPolicyBackendUnavailable
| LocationPolicyBackendUnavailable
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable CheckErrorCode
instance FromHttpApiData CheckErrorCode where
parseQueryParam = \case
"ERROR_CODE_UNSPECIFIED" -> Right ErrorCodeUnspecified
"NOT_FOUND" -> Right NotFound
"PERMISSION_DENIED" -> Right PermissionDenied
"RESOURCE_EXHAUSTED" -> Right ResourceExhausted
"BUDGET_EXCEEDED" -> Right BudgetExceeded
"DENIAL_OF_SERVICE_DETECTED" -> Right DenialOfServiceDetected
"LOAD_SHEDDING" -> Right LoadShedding
"ABUSER_DETECTED" -> Right AbUserDetected
"SERVICE_NOT_ACTIVATED" -> Right ServiceNotActivated
"VISIBILITY_DENIED" -> Right VisibilityDenied
"BILLING_DISABLED" -> Right BillingDisabled
"PROJECT_DELETED" -> Right ProjectDeleted
"PROJECT_INVALID" -> Right ProjectInvalid
"CONSUMER_INVALID" -> Right ConsumerInvalid
"IP_ADDRESS_BLOCKED" -> Right IPAddressBlocked
"REFERER_BLOCKED" -> Right RefererBlocked
"CLIENT_APP_BLOCKED" -> Right ClientAppBlocked
"API_TARGET_BLOCKED" -> Right APITargetBlocked
"API_KEY_INVALID" -> Right APIKeyInvalid
"API_KEY_EXPIRED" -> Right APIKeyExpired
"API_KEY_NOT_FOUND" -> Right APIKeyNotFound
"SPATULA_HEADER_INVALID" -> Right SpatulaHeaderInvalid
"LOAS_ROLE_INVALID" -> Right LoasRoleInvalid
"NO_LOAS_PROJECT" -> Right NoLoasProject
"LOAS_PROJECT_DISABLED" -> Right LoasProjectDisabled
"SECURITY_POLICY_VIOLATED" -> Right SecurityPolicyViolated
"INVALID_CREDENTIAL" -> Right InvalidCredential
"LOCATION_POLICY_VIOLATED" -> Right LocationPolicyViolated
"NAMESPACE_LOOKUP_UNAVAILABLE" -> Right NamespaceLookupUnavailable
"SERVICE_STATUS_UNAVAILABLE" -> Right ServiceStatusUnavailable
"BILLING_STATUS_UNAVAILABLE" -> Right BillingStatusUnavailable
"QUOTA_CHECK_UNAVAILABLE" -> Right QuotaCheckUnavailable
"LOAS_PROJECT_LOOKUP_UNAVAILABLE" -> Right LoasProjectLookupUnavailable
"CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE" -> Right CloudResourceManagerBackendUnavailable
"SECURITY_POLICY_BACKEND_UNAVAILABLE" -> Right SecurityPolicyBackendUnavailable
"LOCATION_POLICY_BACKEND_UNAVAILABLE" -> Right LocationPolicyBackendUnavailable
x -> Left ("Unable to parse CheckErrorCode from: " <> x)
instance ToHttpApiData CheckErrorCode where
toQueryParam = \case
ErrorCodeUnspecified -> "ERROR_CODE_UNSPECIFIED"
NotFound -> "NOT_FOUND"
PermissionDenied -> "PERMISSION_DENIED"
ResourceExhausted -> "RESOURCE_EXHAUSTED"
BudgetExceeded -> "BUDGET_EXCEEDED"
DenialOfServiceDetected -> "DENIAL_OF_SERVICE_DETECTED"
LoadShedding -> "LOAD_SHEDDING"
AbUserDetected -> "ABUSER_DETECTED"
ServiceNotActivated -> "SERVICE_NOT_ACTIVATED"
VisibilityDenied -> "VISIBILITY_DENIED"
BillingDisabled -> "BILLING_DISABLED"
ProjectDeleted -> "PROJECT_DELETED"
ProjectInvalid -> "PROJECT_INVALID"
ConsumerInvalid -> "CONSUMER_INVALID"
IPAddressBlocked -> "IP_ADDRESS_BLOCKED"
RefererBlocked -> "REFERER_BLOCKED"
ClientAppBlocked -> "CLIENT_APP_BLOCKED"
APITargetBlocked -> "API_TARGET_BLOCKED"
APIKeyInvalid -> "API_KEY_INVALID"
APIKeyExpired -> "API_KEY_EXPIRED"
APIKeyNotFound -> "API_KEY_NOT_FOUND"
SpatulaHeaderInvalid -> "SPATULA_HEADER_INVALID"
LoasRoleInvalid -> "LOAS_ROLE_INVALID"
NoLoasProject -> "NO_LOAS_PROJECT"
LoasProjectDisabled -> "LOAS_PROJECT_DISABLED"
SecurityPolicyViolated -> "SECURITY_POLICY_VIOLATED"
InvalidCredential -> "INVALID_CREDENTIAL"
LocationPolicyViolated -> "LOCATION_POLICY_VIOLATED"
NamespaceLookupUnavailable -> "NAMESPACE_LOOKUP_UNAVAILABLE"
ServiceStatusUnavailable -> "SERVICE_STATUS_UNAVAILABLE"
BillingStatusUnavailable -> "BILLING_STATUS_UNAVAILABLE"
QuotaCheckUnavailable -> "QUOTA_CHECK_UNAVAILABLE"
LoasProjectLookupUnavailable -> "LOAS_PROJECT_LOOKUP_UNAVAILABLE"
CloudResourceManagerBackendUnavailable -> "CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE"
SecurityPolicyBackendUnavailable -> "SECURITY_POLICY_BACKEND_UNAVAILABLE"
LocationPolicyBackendUnavailable -> "LOCATION_POLICY_BACKEND_UNAVAILABLE"
instance FromJSON CheckErrorCode where
parseJSON = parseJSONText "CheckErrorCode"
instance ToJSON CheckErrorCode where
toJSON = toJSONText
data QuotaOperationQuotaMode
= Unspecified
| Normal
| BestEffort
| CheckOnly
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable QuotaOperationQuotaMode
instance FromHttpApiData QuotaOperationQuotaMode where
parseQueryParam = \case
"UNSPECIFIED" -> Right Unspecified
"NORMAL" -> Right Normal
"BEST_EFFORT" -> Right BestEffort
"CHECK_ONLY" -> Right CheckOnly
x -> Left ("Unable to parse QuotaOperationQuotaMode from: " <> x)
instance ToHttpApiData QuotaOperationQuotaMode where
toQueryParam = \case
Unspecified -> "UNSPECIFIED"
Normal -> "NORMAL"
BestEffort -> "BEST_EFFORT"
CheckOnly -> "CHECK_ONLY"
instance FromJSON QuotaOperationQuotaMode where
parseJSON = parseJSONText "QuotaOperationQuotaMode"
instance ToJSON QuotaOperationQuotaMode where
toJSON = toJSONText
data OperationImportance
= Low
| High
| Debug
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable OperationImportance
instance FromHttpApiData OperationImportance where
parseQueryParam = \case
"LOW" -> Right Low
"HIGH" -> Right High
"DEBUG" -> Right Debug
x -> Left ("Unable to parse OperationImportance from: " <> x)
instance ToHttpApiData OperationImportance where
toQueryParam = \case
Low -> "LOW"
High -> "HIGH"
Debug -> "DEBUG"
instance FromJSON OperationImportance where
parseJSON = parseJSONText "OperationImportance"
instance ToJSON OperationImportance 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 ConsumerInfoType
= ConsumerTypeUnspecified
| Project
| Folder
| Organization
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ConsumerInfoType
instance FromHttpApiData ConsumerInfoType where
parseQueryParam = \case
"CONSUMER_TYPE_UNSPECIFIED" -> Right ConsumerTypeUnspecified
"PROJECT" -> Right Project
"FOLDER" -> Right Folder
"ORGANIZATION" -> Right Organization
x -> Left ("Unable to parse ConsumerInfoType from: " <> x)
instance ToHttpApiData ConsumerInfoType where
toQueryParam = \case
ConsumerTypeUnspecified -> "CONSUMER_TYPE_UNSPECIFIED"
Project -> "PROJECT"
Folder -> "FOLDER"
Organization -> "ORGANIZATION"
instance FromJSON ConsumerInfoType where
parseJSON = parseJSONText "ConsumerInfoType"
instance ToJSON ConsumerInfoType where
toJSON = toJSONText
data LogEntrySeverity
= LESDefault
| LESDebug
| LESInfo
| LESNotice
| LESWarning
| LESError'
| LESCritical
| LESAlert
| LESEmergency
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable LogEntrySeverity
instance FromHttpApiData LogEntrySeverity where
parseQueryParam = \case
"DEFAULT" -> Right LESDefault
"DEBUG" -> Right LESDebug
"INFO" -> Right LESInfo
"NOTICE" -> Right LESNotice
"WARNING" -> Right LESWarning
"ERROR" -> Right LESError'
"CRITICAL" -> Right LESCritical
"ALERT" -> Right LESAlert
"EMERGENCY" -> Right LESEmergency
x -> Left ("Unable to parse LogEntrySeverity from: " <> x)
instance ToHttpApiData LogEntrySeverity where
toQueryParam = \case
LESDefault -> "DEFAULT"
LESDebug -> "DEBUG"
LESInfo -> "INFO"
LESNotice -> "NOTICE"
LESWarning -> "WARNING"
LESError' -> "ERROR"
LESCritical -> "CRITICAL"
LESAlert -> "ALERT"
LESEmergency -> "EMERGENCY"
instance FromJSON LogEntrySeverity where
parseJSON = parseJSONText "LogEntrySeverity"
instance ToJSON LogEntrySeverity where
toJSON = toJSONText
data QuotaErrorCode
= QECUnspecified
| QECResourceExhausted
| QECOutOfRange
| QECBillingNotActive
| QECProjectDeleted
| QECAPIKeyInvalid
| QECAPIKeyExpired
| QECSpatulaHeaderInvalid
| QECLoasRoleInvalid
| QECNoLoasProject
| QECProjectStatusUnavailable
| QECServiceStatusUnavailable
| QECBillingStatusUnavailable
| QECQuotaSystemUnavailable
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable QuotaErrorCode
instance FromHttpApiData QuotaErrorCode where
parseQueryParam = \case
"UNSPECIFIED" -> Right QECUnspecified
"RESOURCE_EXHAUSTED" -> Right QECResourceExhausted
"OUT_OF_RANGE" -> Right QECOutOfRange
"BILLING_NOT_ACTIVE" -> Right QECBillingNotActive
"PROJECT_DELETED" -> Right QECProjectDeleted
"API_KEY_INVALID" -> Right QECAPIKeyInvalid
"API_KEY_EXPIRED" -> Right QECAPIKeyExpired
"SPATULA_HEADER_INVALID" -> Right QECSpatulaHeaderInvalid
"LOAS_ROLE_INVALID" -> Right QECLoasRoleInvalid
"NO_LOAS_PROJECT" -> Right QECNoLoasProject
"PROJECT_STATUS_UNAVAILABLE" -> Right QECProjectStatusUnavailable
"SERVICE_STATUS_UNAVAILABLE" -> Right QECServiceStatusUnavailable
"BILLING_STATUS_UNAVAILABLE" -> Right QECBillingStatusUnavailable
"QUOTA_SYSTEM_UNAVAILABLE" -> Right QECQuotaSystemUnavailable
x -> Left ("Unable to parse QuotaErrorCode from: " <> x)
instance ToHttpApiData QuotaErrorCode where
toQueryParam = \case
QECUnspecified -> "UNSPECIFIED"
QECResourceExhausted -> "RESOURCE_EXHAUSTED"
QECOutOfRange -> "OUT_OF_RANGE"
QECBillingNotActive -> "BILLING_NOT_ACTIVE"
QECProjectDeleted -> "PROJECT_DELETED"
QECAPIKeyInvalid -> "API_KEY_INVALID"
QECAPIKeyExpired -> "API_KEY_EXPIRED"
QECSpatulaHeaderInvalid -> "SPATULA_HEADER_INVALID"
QECLoasRoleInvalid -> "LOAS_ROLE_INVALID"
QECNoLoasProject -> "NO_LOAS_PROJECT"
QECProjectStatusUnavailable -> "PROJECT_STATUS_UNAVAILABLE"
QECServiceStatusUnavailable -> "SERVICE_STATUS_UNAVAILABLE"
QECBillingStatusUnavailable -> "BILLING_STATUS_UNAVAILABLE"
QECQuotaSystemUnavailable -> "QUOTA_SYSTEM_UNAVAILABLE"
instance FromJSON QuotaErrorCode where
parseJSON = parseJSONText "QuotaErrorCode"
instance ToJSON QuotaErrorCode where
toJSON = toJSONText