{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Composer.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data OperationMetadataOperationType
= TypeUnspecified
| Create
| Delete'
| Update
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable OperationMetadataOperationType
instance FromHttpApiData OperationMetadataOperationType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right TypeUnspecified
"CREATE" -> Right Create
"DELETE" -> Right Delete'
"UPDATE" -> Right Update
x -> Left ("Unable to parse OperationMetadataOperationType from: " <> x)
instance ToHttpApiData OperationMetadataOperationType where
toQueryParam = \case
TypeUnspecified -> "TYPE_UNSPECIFIED"
Create -> "CREATE"
Delete' -> "DELETE"
Update -> "UPDATE"
instance FromJSON OperationMetadataOperationType where
parseJSON = parseJSONText "OperationMetadataOperationType"
instance ToJSON OperationMetadataOperationType where
toJSON = toJSONText
data OperationMetadataState
= StateUnspecified
| Pending
| Running
| Succeeded
| Successful
| Failed
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable OperationMetadataState
instance FromHttpApiData OperationMetadataState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right StateUnspecified
"PENDING" -> Right Pending
"RUNNING" -> Right Running
"SUCCEEDED" -> Right Succeeded
"SUCCESSFUL" -> Right Successful
"FAILED" -> Right Failed
x -> Left ("Unable to parse OperationMetadataState from: " <> x)
instance ToHttpApiData OperationMetadataState where
toQueryParam = \case
StateUnspecified -> "STATE_UNSPECIFIED"
Pending -> "PENDING"
Running -> "RUNNING"
Succeeded -> "SUCCEEDED"
Successful -> "SUCCESSFUL"
Failed -> "FAILED"
instance FromJSON OperationMetadataState where
parseJSON = parseJSONText "OperationMetadataState"
instance ToJSON OperationMetadataState where
toJSON = toJSONText
data EnvironmentState
= ESStateUnspecified
| ESCreating
| ESRunning
| ESUpdating
| ESDeleting
| ESError'
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable EnvironmentState
instance FromHttpApiData EnvironmentState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right ESStateUnspecified
"CREATING" -> Right ESCreating
"RUNNING" -> Right ESRunning
"UPDATING" -> Right ESUpdating
"DELETING" -> Right ESDeleting
"ERROR" -> Right ESError'
x -> Left ("Unable to parse EnvironmentState from: " <> x)
instance ToHttpApiData EnvironmentState where
toQueryParam = \case
ESStateUnspecified -> "STATE_UNSPECIFIED"
ESCreating -> "CREATING"
ESRunning -> "RUNNING"
ESUpdating -> "UPDATING"
ESDeleting -> "DELETING"
ESError' -> "ERROR"
instance FromJSON EnvironmentState where
parseJSON = parseJSONText "EnvironmentState"
instance ToJSON EnvironmentState 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