{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.CloudScheduler.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data JobState
= StateUnspecified
| Enabled
| Paused
| Disabled
| UpdateFailed
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable JobState
instance FromHttpApiData JobState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right StateUnspecified
"ENABLED" -> Right Enabled
"PAUSED" -> Right Paused
"DISABLED" -> Right Disabled
"UPDATE_FAILED" -> Right UpdateFailed
x -> Left ("Unable to parse JobState from: " <> x)
instance ToHttpApiData JobState where
toQueryParam = \case
StateUnspecified -> "STATE_UNSPECIFIED"
Enabled -> "ENABLED"
Paused -> "PAUSED"
Disabled -> "DISABLED"
UpdateFailed -> "UPDATE_FAILED"
instance FromJSON JobState where
parseJSON = parseJSONText "JobState"
instance ToJSON JobState 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 HTTPTargetHTTPMethod
= HTTPMethodUnspecified
| Post'
| Get'
| Head'
| Put'
| Delete'
| Patch'
| Options
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable HTTPTargetHTTPMethod
instance FromHttpApiData HTTPTargetHTTPMethod where
parseQueryParam = \case
"HTTP_METHOD_UNSPECIFIED" -> Right HTTPMethodUnspecified
"POST" -> Right Post'
"GET" -> Right Get'
"HEAD" -> Right Head'
"PUT" -> Right Put'
"DELETE" -> Right Delete'
"PATCH" -> Right Patch'
"OPTIONS" -> Right Options
x -> Left ("Unable to parse HTTPTargetHTTPMethod from: " <> x)
instance ToHttpApiData HTTPTargetHTTPMethod where
toQueryParam = \case
HTTPMethodUnspecified -> "HTTP_METHOD_UNSPECIFIED"
Post' -> "POST"
Get' -> "GET"
Head' -> "HEAD"
Put' -> "PUT"
Delete' -> "DELETE"
Patch' -> "PATCH"
Options -> "OPTIONS"
instance FromJSON HTTPTargetHTTPMethod where
parseJSON = parseJSONText "HTTPTargetHTTPMethod"
instance ToJSON HTTPTargetHTTPMethod where
toJSON = toJSONText
data AppEngineHTTPTargetHTTPMethod
= AEHTTPTHTTPMHTTPMethodUnspecified
| AEHTTPTHTTPMPost'
| AEHTTPTHTTPMGet'
| AEHTTPTHTTPMHead'
| AEHTTPTHTTPMPut'
| AEHTTPTHTTPMDelete'
| AEHTTPTHTTPMPatch'
| AEHTTPTHTTPMOptions
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AppEngineHTTPTargetHTTPMethod
instance FromHttpApiData AppEngineHTTPTargetHTTPMethod where
parseQueryParam = \case
"HTTP_METHOD_UNSPECIFIED" -> Right AEHTTPTHTTPMHTTPMethodUnspecified
"POST" -> Right AEHTTPTHTTPMPost'
"GET" -> Right AEHTTPTHTTPMGet'
"HEAD" -> Right AEHTTPTHTTPMHead'
"PUT" -> Right AEHTTPTHTTPMPut'
"DELETE" -> Right AEHTTPTHTTPMDelete'
"PATCH" -> Right AEHTTPTHTTPMPatch'
"OPTIONS" -> Right AEHTTPTHTTPMOptions
x -> Left ("Unable to parse AppEngineHTTPTargetHTTPMethod from: " <> x)
instance ToHttpApiData AppEngineHTTPTargetHTTPMethod where
toQueryParam = \case
AEHTTPTHTTPMHTTPMethodUnspecified -> "HTTP_METHOD_UNSPECIFIED"
AEHTTPTHTTPMPost' -> "POST"
AEHTTPTHTTPMGet' -> "GET"
AEHTTPTHTTPMHead' -> "HEAD"
AEHTTPTHTTPMPut' -> "PUT"
AEHTTPTHTTPMDelete' -> "DELETE"
AEHTTPTHTTPMPatch' -> "PATCH"
AEHTTPTHTTPMOptions -> "OPTIONS"
instance FromJSON AppEngineHTTPTargetHTTPMethod where
parseJSON = parseJSONText "AppEngineHTTPTargetHTTPMethod"
instance ToJSON AppEngineHTTPTargetHTTPMethod where
toJSON = toJSONText