{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.AppEngine.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data ApplicationServingStatus
= Unspecified
| Serving
| UserDisabled
| SystemDisabled
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ApplicationServingStatus
instance FromHttpApiData ApplicationServingStatus where
parseQueryParam = \case
"UNSPECIFIED" -> Right Unspecified
"SERVING" -> Right Serving
"USER_DISABLED" -> Right UserDisabled
"SYSTEM_DISABLED" -> Right SystemDisabled
x -> Left ("Unable to parse ApplicationServingStatus from: " <> x)
instance ToHttpApiData ApplicationServingStatus where
toQueryParam = \case
Unspecified -> "UNSPECIFIED"
Serving -> "SERVING"
UserDisabled -> "USER_DISABLED"
SystemDisabled -> "SYSTEM_DISABLED"
instance FromJSON ApplicationServingStatus where
parseJSON = parseJSONText "ApplicationServingStatus"
instance ToJSON ApplicationServingStatus where
toJSON = toJSONText
data URLMapLogin
= LoginUnspecified
| LoginOptional
| LoginAdmin
| LoginRequired
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable URLMapLogin
instance FromHttpApiData URLMapLogin where
parseQueryParam = \case
"LOGIN_UNSPECIFIED" -> Right LoginUnspecified
"LOGIN_OPTIONAL" -> Right LoginOptional
"LOGIN_ADMIN" -> Right LoginAdmin
"LOGIN_REQUIRED" -> Right LoginRequired
x -> Left ("Unable to parse URLMapLogin from: " <> x)
instance ToHttpApiData URLMapLogin where
toQueryParam = \case
LoginUnspecified -> "LOGIN_UNSPECIFIED"
LoginOptional -> "LOGIN_OPTIONAL"
LoginAdmin -> "LOGIN_ADMIN"
LoginRequired -> "LOGIN_REQUIRED"
instance FromJSON URLMapLogin where
parseJSON = parseJSONText "URLMapLogin"
instance ToJSON URLMapLogin where
toJSON = toJSONText
data ManagedCertificateStatus
= ManagementStatusUnspecified
| OK
| Pending
| FailedRetryingNotVisible
| FailedPermanent
| FailedRetryingCaaForBidden
| FailedRetryingCaaChecking
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ManagedCertificateStatus
instance FromHttpApiData ManagedCertificateStatus where
parseQueryParam = \case
"MANAGEMENT_STATUS_UNSPECIFIED" -> Right ManagementStatusUnspecified
"OK" -> Right OK
"PENDING" -> Right Pending
"FAILED_RETRYING_NOT_VISIBLE" -> Right FailedRetryingNotVisible
"FAILED_PERMANENT" -> Right FailedPermanent
"FAILED_RETRYING_CAA_FORBIDDEN" -> Right FailedRetryingCaaForBidden
"FAILED_RETRYING_CAA_CHECKING" -> Right FailedRetryingCaaChecking
x -> Left ("Unable to parse ManagedCertificateStatus from: " <> x)
instance ToHttpApiData ManagedCertificateStatus where
toQueryParam = \case
ManagementStatusUnspecified -> "MANAGEMENT_STATUS_UNSPECIFIED"
OK -> "OK"
Pending -> "PENDING"
FailedRetryingNotVisible -> "FAILED_RETRYING_NOT_VISIBLE"
FailedPermanent -> "FAILED_PERMANENT"
FailedRetryingCaaForBidden -> "FAILED_RETRYING_CAA_FORBIDDEN"
FailedRetryingCaaChecking -> "FAILED_RETRYING_CAA_CHECKING"
instance FromJSON ManagedCertificateStatus where
parseJSON = parseJSONText "ManagedCertificateStatus"
instance ToJSON ManagedCertificateStatus where
toJSON = toJSONText
data APIConfigHandlerSecurityLevel
= SecureUnspecified
| SecureDefault
| SecureNever
| SecureOptional
| SecureAlways
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable APIConfigHandlerSecurityLevel
instance FromHttpApiData APIConfigHandlerSecurityLevel where
parseQueryParam = \case
"SECURE_UNSPECIFIED" -> Right SecureUnspecified
"SECURE_DEFAULT" -> Right SecureDefault
"SECURE_NEVER" -> Right SecureNever
"SECURE_OPTIONAL" -> Right SecureOptional
"SECURE_ALWAYS" -> Right SecureAlways
x -> Left ("Unable to parse APIConfigHandlerSecurityLevel from: " <> x)
instance ToHttpApiData APIConfigHandlerSecurityLevel where
toQueryParam = \case
SecureUnspecified -> "SECURE_UNSPECIFIED"
SecureDefault -> "SECURE_DEFAULT"
SecureNever -> "SECURE_NEVER"
SecureOptional -> "SECURE_OPTIONAL"
SecureAlways -> "SECURE_ALWAYS"
instance FromJSON APIConfigHandlerSecurityLevel where
parseJSON = parseJSONText "APIConfigHandlerSecurityLevel"
instance ToJSON APIConfigHandlerSecurityLevel where
toJSON = toJSONText
data ErrorHandlerErrorCode
= ErrorCodeUnspecified
| ErrorCodeDefault
| ErrorCodeOverQuota
| ErrorCodeDosAPIdenial
| ErrorCodeTimeout
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ErrorHandlerErrorCode
instance FromHttpApiData ErrorHandlerErrorCode where
parseQueryParam = \case
"ERROR_CODE_UNSPECIFIED" -> Right ErrorCodeUnspecified
"ERROR_CODE_DEFAULT" -> Right ErrorCodeDefault
"ERROR_CODE_OVER_QUOTA" -> Right ErrorCodeOverQuota
"ERROR_CODE_DOS_API_DENIAL" -> Right ErrorCodeDosAPIdenial
"ERROR_CODE_TIMEOUT" -> Right ErrorCodeTimeout
x -> Left ("Unable to parse ErrorHandlerErrorCode from: " <> x)
instance ToHttpApiData ErrorHandlerErrorCode where
toQueryParam = \case
ErrorCodeUnspecified -> "ERROR_CODE_UNSPECIFIED"
ErrorCodeDefault -> "ERROR_CODE_DEFAULT"
ErrorCodeOverQuota -> "ERROR_CODE_OVER_QUOTA"
ErrorCodeDosAPIdenial -> "ERROR_CODE_DOS_API_DENIAL"
ErrorCodeTimeout -> "ERROR_CODE_TIMEOUT"
instance FromJSON ErrorHandlerErrorCode where
parseJSON = parseJSONText "ErrorHandlerErrorCode"
instance ToJSON ErrorHandlerErrorCode where
toJSON = toJSONText
data EndpointsAPIServiceRolloutStrategy
= UnspecifiedRolloutStrategy
| Fixed
| Managed
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable EndpointsAPIServiceRolloutStrategy
instance FromHttpApiData EndpointsAPIServiceRolloutStrategy where
parseQueryParam = \case
"UNSPECIFIED_ROLLOUT_STRATEGY" -> Right UnspecifiedRolloutStrategy
"FIXED" -> Right Fixed
"MANAGED" -> Right Managed
x -> Left ("Unable to parse EndpointsAPIServiceRolloutStrategy from: " <> x)
instance ToHttpApiData EndpointsAPIServiceRolloutStrategy where
toQueryParam = \case
UnspecifiedRolloutStrategy -> "UNSPECIFIED_ROLLOUT_STRATEGY"
Fixed -> "FIXED"
Managed -> "MANAGED"
instance FromJSON EndpointsAPIServiceRolloutStrategy where
parseJSON = parseJSONText "EndpointsAPIServiceRolloutStrategy"
instance ToJSON EndpointsAPIServiceRolloutStrategy where
toJSON = toJSONText
data APIConfigHandlerAuthFailAction
= AuthFailActionUnspecified
| AuthFailActionRedirect
| AuthFailActionUnauthorized
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable APIConfigHandlerAuthFailAction
instance FromHttpApiData APIConfigHandlerAuthFailAction where
parseQueryParam = \case
"AUTH_FAIL_ACTION_UNSPECIFIED" -> Right AuthFailActionUnspecified
"AUTH_FAIL_ACTION_REDIRECT" -> Right AuthFailActionRedirect
"AUTH_FAIL_ACTION_UNAUTHORIZED" -> Right AuthFailActionUnauthorized
x -> Left ("Unable to parse APIConfigHandlerAuthFailAction from: " <> x)
instance ToHttpApiData APIConfigHandlerAuthFailAction where
toQueryParam = \case
AuthFailActionUnspecified -> "AUTH_FAIL_ACTION_UNSPECIFIED"
AuthFailActionRedirect -> "AUTH_FAIL_ACTION_REDIRECT"
AuthFailActionUnauthorized -> "AUTH_FAIL_ACTION_UNAUTHORIZED"
instance FromJSON APIConfigHandlerAuthFailAction where
parseJSON = parseJSONText "APIConfigHandlerAuthFailAction"
instance ToJSON APIConfigHandlerAuthFailAction where
toJSON = toJSONText
data VersionServingStatus
= VSSServingStatusUnspecified
| VSSServing
| VSSStopped
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable VersionServingStatus
instance FromHttpApiData VersionServingStatus where
parseQueryParam = \case
"SERVING_STATUS_UNSPECIFIED" -> Right VSSServingStatusUnspecified
"SERVING" -> Right VSSServing
"STOPPED" -> Right VSSStopped
x -> Left ("Unable to parse VersionServingStatus from: " <> x)
instance ToHttpApiData VersionServingStatus where
toQueryParam = \case
VSSServingStatusUnspecified -> "SERVING_STATUS_UNSPECIFIED"
VSSServing -> "SERVING"
VSSStopped -> "STOPPED"
instance FromJSON VersionServingStatus where
parseJSON = parseJSONText "VersionServingStatus"
instance ToJSON VersionServingStatus where
toJSON = toJSONText
data URLMapSecurityLevel
= UMSLSecureUnspecified
| UMSLSecureDefault
| UMSLSecureNever
| UMSLSecureOptional
| UMSLSecureAlways
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable URLMapSecurityLevel
instance FromHttpApiData URLMapSecurityLevel where
parseQueryParam = \case
"SECURE_UNSPECIFIED" -> Right UMSLSecureUnspecified
"SECURE_DEFAULT" -> Right UMSLSecureDefault
"SECURE_NEVER" -> Right UMSLSecureNever
"SECURE_OPTIONAL" -> Right UMSLSecureOptional
"SECURE_ALWAYS" -> Right UMSLSecureAlways
x -> Left ("Unable to parse URLMapSecurityLevel from: " <> x)
instance ToHttpApiData URLMapSecurityLevel where
toQueryParam = \case
UMSLSecureUnspecified -> "SECURE_UNSPECIFIED"
UMSLSecureDefault -> "SECURE_DEFAULT"
UMSLSecureNever -> "SECURE_NEVER"
UMSLSecureOptional -> "SECURE_OPTIONAL"
UMSLSecureAlways -> "SECURE_ALWAYS"
instance FromJSON URLMapSecurityLevel where
parseJSON = parseJSONText "URLMapSecurityLevel"
instance ToJSON URLMapSecurityLevel where
toJSON = toJSONText
data ResourceRecordType
= RecordTypeUnspecified
| A
| Aaaa
| Cname
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ResourceRecordType
instance FromHttpApiData ResourceRecordType where
parseQueryParam = \case
"RECORD_TYPE_UNSPECIFIED" -> Right RecordTypeUnspecified
"A" -> Right A
"AAAA" -> Right Aaaa
"CNAME" -> Right Cname
x -> Left ("Unable to parse ResourceRecordType from: " <> x)
instance ToHttpApiData ResourceRecordType where
toQueryParam = \case
RecordTypeUnspecified -> "RECORD_TYPE_UNSPECIFIED"
A -> "A"
Aaaa -> "AAAA"
Cname -> "CNAME"
instance FromJSON ResourceRecordType where
parseJSON = parseJSONText "ResourceRecordType"
instance ToJSON ResourceRecordType 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 TrafficSplitShardBy
= TSSBUnspecified
| TSSBCookie
| TSSBIP
| TSSBRandom
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable TrafficSplitShardBy
instance FromHttpApiData TrafficSplitShardBy where
parseQueryParam = \case
"UNSPECIFIED" -> Right TSSBUnspecified
"COOKIE" -> Right TSSBCookie
"IP" -> Right TSSBIP
"RANDOM" -> Right TSSBRandom
x -> Left ("Unable to parse TrafficSplitShardBy from: " <> x)
instance ToHttpApiData TrafficSplitShardBy where
toQueryParam = \case
TSSBUnspecified -> "UNSPECIFIED"
TSSBCookie -> "COOKIE"
TSSBIP -> "IP"
TSSBRandom -> "RANDOM"
instance FromJSON TrafficSplitShardBy where
parseJSON = parseJSONText "TrafficSplitShardBy"
instance ToJSON TrafficSplitShardBy where
toJSON = toJSONText
data InstanceAvailability
= IAUnspecified
| IAResident
| IADynamic
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable InstanceAvailability
instance FromHttpApiData InstanceAvailability where
parseQueryParam = \case
"UNSPECIFIED" -> Right IAUnspecified
"RESIDENT" -> Right IAResident
"DYNAMIC" -> Right IADynamic
x -> Left ("Unable to parse InstanceAvailability from: " <> x)
instance ToHttpApiData InstanceAvailability where
toQueryParam = \case
IAUnspecified -> "UNSPECIFIED"
IAResident -> "RESIDENT"
IADynamic -> "DYNAMIC"
instance FromJSON InstanceAvailability where
parseJSON = parseJSONText "InstanceAvailability"
instance ToJSON InstanceAvailability where
toJSON = toJSONText
data URLMapAuthFailAction
= UMAFAAuthFailActionUnspecified
| UMAFAAuthFailActionRedirect
| UMAFAAuthFailActionUnauthorized
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable URLMapAuthFailAction
instance FromHttpApiData URLMapAuthFailAction where
parseQueryParam = \case
"AUTH_FAIL_ACTION_UNSPECIFIED" -> Right UMAFAAuthFailActionUnspecified
"AUTH_FAIL_ACTION_REDIRECT" -> Right UMAFAAuthFailActionRedirect
"AUTH_FAIL_ACTION_UNAUTHORIZED" -> Right UMAFAAuthFailActionUnauthorized
x -> Left ("Unable to parse URLMapAuthFailAction from: " <> x)
instance ToHttpApiData URLMapAuthFailAction where
toQueryParam = \case
UMAFAAuthFailActionUnspecified -> "AUTH_FAIL_ACTION_UNSPECIFIED"
UMAFAAuthFailActionRedirect -> "AUTH_FAIL_ACTION_REDIRECT"
UMAFAAuthFailActionUnauthorized -> "AUTH_FAIL_ACTION_UNAUTHORIZED"
instance FromJSON URLMapAuthFailAction where
parseJSON = parseJSONText "URLMapAuthFailAction"
instance ToJSON URLMapAuthFailAction where
toJSON = toJSONText
data URLMapRedirectHTTPResponseCode
= RedirectHTTPResponseCodeUnspecified
| RedirectHTTPResponseCode301
| RedirectHTTPResponseCode302
| RedirectHTTPResponseCode303
| RedirectHTTPResponseCode307
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable URLMapRedirectHTTPResponseCode
instance FromHttpApiData URLMapRedirectHTTPResponseCode where
parseQueryParam = \case
"REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED" -> Right RedirectHTTPResponseCodeUnspecified
"REDIRECT_HTTP_RESPONSE_CODE_301" -> Right RedirectHTTPResponseCode301
"REDIRECT_HTTP_RESPONSE_CODE_302" -> Right RedirectHTTPResponseCode302
"REDIRECT_HTTP_RESPONSE_CODE_303" -> Right RedirectHTTPResponseCode303
"REDIRECT_HTTP_RESPONSE_CODE_307" -> Right RedirectHTTPResponseCode307
x -> Left ("Unable to parse URLMapRedirectHTTPResponseCode from: " <> x)
instance ToHttpApiData URLMapRedirectHTTPResponseCode where
toQueryParam = \case
RedirectHTTPResponseCodeUnspecified -> "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED"
RedirectHTTPResponseCode301 -> "REDIRECT_HTTP_RESPONSE_CODE_301"
RedirectHTTPResponseCode302 -> "REDIRECT_HTTP_RESPONSE_CODE_302"
RedirectHTTPResponseCode303 -> "REDIRECT_HTTP_RESPONSE_CODE_303"
RedirectHTTPResponseCode307 -> "REDIRECT_HTTP_RESPONSE_CODE_307"
instance FromJSON URLMapRedirectHTTPResponseCode where
parseJSON = parseJSONText "URLMapRedirectHTTPResponseCode"
instance ToJSON URLMapRedirectHTTPResponseCode where
toJSON = toJSONText
data FirewallRuleAction
= UnspecifiedAction
| Allow
| Deny
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FirewallRuleAction
instance FromHttpApiData FirewallRuleAction where
parseQueryParam = \case
"UNSPECIFIED_ACTION" -> Right UnspecifiedAction
"ALLOW" -> Right Allow
"DENY" -> Right Deny
x -> Left ("Unable to parse FirewallRuleAction from: " <> x)
instance ToHttpApiData FirewallRuleAction where
toQueryParam = \case
UnspecifiedAction -> "UNSPECIFIED_ACTION"
Allow -> "ALLOW"
Deny -> "DENY"
instance FromJSON FirewallRuleAction where
parseJSON = parseJSONText "FirewallRuleAction"
instance ToJSON FirewallRuleAction where
toJSON = toJSONText
data SSLSettingsSSLManagementType
= SSLManagementTypeUnspecified
| Automatic
| Manual
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable SSLSettingsSSLManagementType
instance FromHttpApiData SSLSettingsSSLManagementType where
parseQueryParam = \case
"SSL_MANAGEMENT_TYPE_UNSPECIFIED" -> Right SSLManagementTypeUnspecified
"AUTOMATIC" -> Right Automatic
"MANUAL" -> Right Manual
x -> Left ("Unable to parse SSLSettingsSSLManagementType from: " <> x)
instance ToHttpApiData SSLSettingsSSLManagementType where
toQueryParam = \case
SSLManagementTypeUnspecified -> "SSL_MANAGEMENT_TYPE_UNSPECIFIED"
Automatic -> "AUTOMATIC"
Manual -> "MANUAL"
instance FromJSON SSLSettingsSSLManagementType where
parseJSON = parseJSONText "SSLSettingsSSLManagementType"
instance ToJSON SSLSettingsSSLManagementType where
toJSON = toJSONText
data APIConfigHandlerLogin
= ACHLLoginUnspecified
| ACHLLoginOptional
| ACHLLoginAdmin
| ACHLLoginRequired
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable APIConfigHandlerLogin
instance FromHttpApiData APIConfigHandlerLogin where
parseQueryParam = \case
"LOGIN_UNSPECIFIED" -> Right ACHLLoginUnspecified
"LOGIN_OPTIONAL" -> Right ACHLLoginOptional
"LOGIN_ADMIN" -> Right ACHLLoginAdmin
"LOGIN_REQUIRED" -> Right ACHLLoginRequired
x -> Left ("Unable to parse APIConfigHandlerLogin from: " <> x)
instance ToHttpApiData APIConfigHandlerLogin where
toQueryParam = \case
ACHLLoginUnspecified -> "LOGIN_UNSPECIFIED"
ACHLLoginOptional -> "LOGIN_OPTIONAL"
ACHLLoginAdmin -> "LOGIN_ADMIN"
ACHLLoginRequired -> "LOGIN_REQUIRED"
instance FromJSON APIConfigHandlerLogin where
parseJSON = parseJSONText "APIConfigHandlerLogin"
instance ToJSON APIConfigHandlerLogin where
toJSON = toJSONText