{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.CloudFunctions.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data OperationMetadataV1Type
= OperationUnspecified
| CreateFunction
| UpdateFunction
| DeleteFunction
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable OperationMetadataV1Type
instance FromHttpApiData OperationMetadataV1Type where
parseQueryParam = \case
"OPERATION_UNSPECIFIED" -> Right OperationUnspecified
"CREATE_FUNCTION" -> Right CreateFunction
"UPDATE_FUNCTION" -> Right UpdateFunction
"DELETE_FUNCTION" -> Right DeleteFunction
x -> Left ("Unable to parse OperationMetadataV1Type from: " <> x)
instance ToHttpApiData OperationMetadataV1Type where
toQueryParam = \case
OperationUnspecified -> "OPERATION_UNSPECIFIED"
CreateFunction -> "CREATE_FUNCTION"
UpdateFunction -> "UPDATE_FUNCTION"
DeleteFunction -> "DELETE_FUNCTION"
instance FromJSON OperationMetadataV1Type where
parseJSON = parseJSONText "OperationMetadataV1Type"
instance ToJSON OperationMetadataV1Type where
toJSON = toJSONText
data CloudFunctionStatus
= CloudFunctionStatusUnspecified
| Active
| Offline
| DeployInProgress
| DeleteInProgress
| Unknown
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable CloudFunctionStatus
instance FromHttpApiData CloudFunctionStatus where
parseQueryParam = \case
"CLOUD_FUNCTION_STATUS_UNSPECIFIED" -> Right CloudFunctionStatusUnspecified
"ACTIVE" -> Right Active
"OFFLINE" -> Right Offline
"DEPLOY_IN_PROGRESS" -> Right DeployInProgress
"DELETE_IN_PROGRESS" -> Right DeleteInProgress
"UNKNOWN" -> Right Unknown
x -> Left ("Unable to parse CloudFunctionStatus from: " <> x)
instance ToHttpApiData CloudFunctionStatus where
toQueryParam = \case
CloudFunctionStatusUnspecified -> "CLOUD_FUNCTION_STATUS_UNSPECIFIED"
Active -> "ACTIVE"
Offline -> "OFFLINE"
DeployInProgress -> "DEPLOY_IN_PROGRESS"
DeleteInProgress -> "DELETE_IN_PROGRESS"
Unknown -> "UNKNOWN"
instance FromJSON CloudFunctionStatus where
parseJSON = parseJSONText "CloudFunctionStatus"
instance ToJSON CloudFunctionStatus where
toJSON = toJSONText
data OperationMetadataV1Beta2Type
= OMVBTOperationUnspecified
| OMVBTCreateFunction
| OMVBTUpdateFunction
| OMVBTDeleteFunction
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable OperationMetadataV1Beta2Type
instance FromHttpApiData OperationMetadataV1Beta2Type where
parseQueryParam = \case
"OPERATION_UNSPECIFIED" -> Right OMVBTOperationUnspecified
"CREATE_FUNCTION" -> Right OMVBTCreateFunction
"UPDATE_FUNCTION" -> Right OMVBTUpdateFunction
"DELETE_FUNCTION" -> Right OMVBTDeleteFunction
x -> Left ("Unable to parse OperationMetadataV1Beta2Type from: " <> x)
instance ToHttpApiData OperationMetadataV1Beta2Type where
toQueryParam = \case
OMVBTOperationUnspecified -> "OPERATION_UNSPECIFIED"
OMVBTCreateFunction -> "CREATE_FUNCTION"
OMVBTUpdateFunction -> "UPDATE_FUNCTION"
OMVBTDeleteFunction -> "DELETE_FUNCTION"
instance FromJSON OperationMetadataV1Beta2Type where
parseJSON = parseJSONText "OperationMetadataV1Beta2Type"
instance ToJSON OperationMetadataV1Beta2Type where
toJSON = toJSONText
data AuditLogConfigLogType
= LogTypeUnspecified
| AdminRead
| DataWrite
| DataRead
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AuditLogConfigLogType
instance FromHttpApiData AuditLogConfigLogType where
parseQueryParam = \case
"LOG_TYPE_UNSPECIFIED" -> Right LogTypeUnspecified
"ADMIN_READ" -> Right AdminRead
"DATA_WRITE" -> Right DataWrite
"DATA_READ" -> Right DataRead
x -> Left ("Unable to parse AuditLogConfigLogType from: " <> x)
instance ToHttpApiData AuditLogConfigLogType where
toQueryParam = \case
LogTypeUnspecified -> "LOG_TYPE_UNSPECIFIED"
AdminRead -> "ADMIN_READ"
DataWrite -> "DATA_WRITE"
DataRead -> "DATA_READ"
instance FromJSON AuditLogConfigLogType where
parseJSON = parseJSONText "AuditLogConfigLogType"
instance ToJSON AuditLogConfigLogType 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