{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Dataproc.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data JobStatusState
= StateUnspecified
| Pending
| SetupDone
| Running
| CancelPending
| CancelStarted
| Cancelled
| Done
| Error'
| AttemptFailure
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable JobStatusState
instance FromHttpApiData JobStatusState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right StateUnspecified
"PENDING" -> Right Pending
"SETUP_DONE" -> Right SetupDone
"RUNNING" -> Right Running
"CANCEL_PENDING" -> Right CancelPending
"CANCEL_STARTED" -> Right CancelStarted
"CANCELLED" -> Right Cancelled
"DONE" -> Right Done
"ERROR" -> Right Error'
"ATTEMPT_FAILURE" -> Right AttemptFailure
x -> Left ("Unable to parse JobStatusState from: " <> x)
instance ToHttpApiData JobStatusState where
toQueryParam = \case
StateUnspecified -> "STATE_UNSPECIFIED"
Pending -> "PENDING"
SetupDone -> "SETUP_DONE"
Running -> "RUNNING"
CancelPending -> "CANCEL_PENDING"
CancelStarted -> "CANCEL_STARTED"
Cancelled -> "CANCELLED"
Done -> "DONE"
Error' -> "ERROR"
AttemptFailure -> "ATTEMPT_FAILURE"
instance FromJSON JobStatusState where
parseJSON = parseJSONText "JobStatusState"
instance ToJSON JobStatusState where
toJSON = toJSONText
data WorkflowNodeState
= WNSNodeStateUnspecified
| WNSBlocked
| WNSRunnable
| WNSRunning
| WNSCompleted
| WNSFailed
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable WorkflowNodeState
instance FromHttpApiData WorkflowNodeState where
parseQueryParam = \case
"NODE_STATE_UNSPECIFIED" -> Right WNSNodeStateUnspecified
"BLOCKED" -> Right WNSBlocked
"RUNNABLE" -> Right WNSRunnable
"RUNNING" -> Right WNSRunning
"COMPLETED" -> Right WNSCompleted
"FAILED" -> Right WNSFailed
x -> Left ("Unable to parse WorkflowNodeState from: " <> x)
instance ToHttpApiData WorkflowNodeState where
toQueryParam = \case
WNSNodeStateUnspecified -> "NODE_STATE_UNSPECIFIED"
WNSBlocked -> "BLOCKED"
WNSRunnable -> "RUNNABLE"
WNSRunning -> "RUNNING"
WNSCompleted -> "COMPLETED"
WNSFailed -> "FAILED"
instance FromJSON WorkflowNodeState where
parseJSON = parseJSONText "WorkflowNodeState"
instance ToJSON WorkflowNodeState where
toJSON = toJSONText
data ClusterStatusSubState
= Unspecified
| Unhealthy
| StaleStatus
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ClusterStatusSubState
instance FromHttpApiData ClusterStatusSubState where
parseQueryParam = \case
"UNSPECIFIED" -> Right Unspecified
"UNHEALTHY" -> Right Unhealthy
"STALE_STATUS" -> Right StaleStatus
x -> Left ("Unable to parse ClusterStatusSubState from: " <> x)
instance ToHttpApiData ClusterStatusSubState where
toQueryParam = \case
Unspecified -> "UNSPECIFIED"
Unhealthy -> "UNHEALTHY"
StaleStatus -> "STALE_STATUS"
instance FromJSON ClusterStatusSubState where
parseJSON = parseJSONText "ClusterStatusSubState"
instance ToJSON ClusterStatusSubState where
toJSON = toJSONText
data WorkflowMetadataState
= WMSUnknown
| WMSPending
| WMSRunning
| WMSDone
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable WorkflowMetadataState
instance FromHttpApiData WorkflowMetadataState where
parseQueryParam = \case
"UNKNOWN" -> Right WMSUnknown
"PENDING" -> Right WMSPending
"RUNNING" -> Right WMSRunning
"DONE" -> Right WMSDone
x -> Left ("Unable to parse WorkflowMetadataState from: " <> x)
instance ToHttpApiData WorkflowMetadataState where
toQueryParam = \case
WMSUnknown -> "UNKNOWN"
WMSPending -> "PENDING"
WMSRunning -> "RUNNING"
WMSDone -> "DONE"
instance FromJSON WorkflowMetadataState where
parseJSON = parseJSONText "WorkflowMetadataState"
instance ToJSON WorkflowMetadataState where
toJSON = toJSONText
data YarnApplicationState
= YASStateUnspecified
| YASNew
| YASNewSaving
| YASSubmitted
| YASAccepted
| YASRunning
| YASFinished
| YASFailed
| YASKilled
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable YarnApplicationState
instance FromHttpApiData YarnApplicationState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right YASStateUnspecified
"NEW" -> Right YASNew
"NEW_SAVING" -> Right YASNewSaving
"SUBMITTED" -> Right YASSubmitted
"ACCEPTED" -> Right YASAccepted
"RUNNING" -> Right YASRunning
"FINISHED" -> Right YASFinished
"FAILED" -> Right YASFailed
"KILLED" -> Right YASKilled
x -> Left ("Unable to parse YarnApplicationState from: " <> x)
instance ToHttpApiData YarnApplicationState where
toQueryParam = \case
YASStateUnspecified -> "STATE_UNSPECIFIED"
YASNew -> "NEW"
YASNewSaving -> "NEW_SAVING"
YASSubmitted -> "SUBMITTED"
YASAccepted -> "ACCEPTED"
YASRunning -> "RUNNING"
YASFinished -> "FINISHED"
YASFailed -> "FAILED"
YASKilled -> "KILLED"
instance FromJSON YarnApplicationState where
parseJSON = parseJSONText "YarnApplicationState"
instance ToJSON YarnApplicationState where
toJSON = toJSONText
data ClusterStatusState
= CSSUnknown
| CSSCreating
| CSSRunning
| CSSError'
| CSSDeleting
| CSSUpdating
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ClusterStatusState
instance FromHttpApiData ClusterStatusState where
parseQueryParam = \case
"UNKNOWN" -> Right CSSUnknown
"CREATING" -> Right CSSCreating
"RUNNING" -> Right CSSRunning
"ERROR" -> Right CSSError'
"DELETING" -> Right CSSDeleting
"UPDATING" -> Right CSSUpdating
x -> Left ("Unable to parse ClusterStatusState from: " <> x)
instance ToHttpApiData ClusterStatusState where
toQueryParam = \case
CSSUnknown -> "UNKNOWN"
CSSCreating -> "CREATING"
CSSRunning -> "RUNNING"
CSSError' -> "ERROR"
CSSDeleting -> "DELETING"
CSSUpdating -> "UPDATING"
instance FromJSON ClusterStatusState where
parseJSON = parseJSONText "ClusterStatusState"
instance ToJSON ClusterStatusState where
toJSON = toJSONText
data ClusterOperationStatusState
= COSSUnknown
| COSSPending
| COSSRunning
| COSSDone
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ClusterOperationStatusState
instance FromHttpApiData ClusterOperationStatusState where
parseQueryParam = \case
"UNKNOWN" -> Right COSSUnknown
"PENDING" -> Right COSSPending
"RUNNING" -> Right COSSRunning
"DONE" -> Right COSSDone
x -> Left ("Unable to parse ClusterOperationStatusState from: " <> x)
instance ToHttpApiData ClusterOperationStatusState where
toQueryParam = \case
COSSUnknown -> "UNKNOWN"
COSSPending -> "PENDING"
COSSRunning -> "RUNNING"
COSSDone -> "DONE"
instance FromJSON ClusterOperationStatusState where
parseJSON = parseJSONText "ClusterOperationStatusState"
instance ToJSON ClusterOperationStatusState 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 JobStatusSubState
= JSSSUnspecified
| JSSSSubmitted
| JSSSQueued
| JSSSStaleStatus
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable JobStatusSubState
instance FromHttpApiData JobStatusSubState where
parseQueryParam = \case
"UNSPECIFIED" -> Right JSSSUnspecified
"SUBMITTED" -> Right JSSSSubmitted
"QUEUED" -> Right JSSSQueued
"STALE_STATUS" -> Right JSSSStaleStatus
x -> Left ("Unable to parse JobStatusSubState from: " <> x)
instance ToHttpApiData JobStatusSubState where
toQueryParam = \case
JSSSUnspecified -> "UNSPECIFIED"
JSSSSubmitted -> "SUBMITTED"
JSSSQueued -> "QUEUED"
JSSSStaleStatus -> "STALE_STATUS"
instance FromJSON JobStatusSubState where
parseJSON = parseJSONText "JobStatusSubState"
instance ToJSON JobStatusSubState where
toJSON = toJSONText