{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Container.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data StatusConditionCode
= Unknown
| GceStockout
| GkeServiceAccountDeleted
| GceQuotaExceeded
| SetByOperator
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable StatusConditionCode
instance FromHttpApiData StatusConditionCode where
parseQueryParam = \case
"UNKNOWN" -> Right Unknown
"GCE_STOCKOUT" -> Right GceStockout
"GKE_SERVICE_ACCOUNT_DELETED" -> Right GkeServiceAccountDeleted
"GCE_QUOTA_EXCEEDED" -> Right GceQuotaExceeded
"SET_BY_OPERATOR" -> Right SetByOperator
x -> Left ("Unable to parse StatusConditionCode from: " <> x)
instance ToHttpApiData StatusConditionCode where
toQueryParam = \case
Unknown -> "UNKNOWN"
GceStockout -> "GCE_STOCKOUT"
GkeServiceAccountDeleted -> "GKE_SERVICE_ACCOUNT_DELETED"
GceQuotaExceeded -> "GCE_QUOTA_EXCEEDED"
SetByOperator -> "SET_BY_OPERATOR"
instance FromJSON StatusConditionCode where
parseJSON = parseJSONText "StatusConditionCode"
instance ToJSON StatusConditionCode where
toJSON = toJSONText
data OperationOperationType
= TypeUnspecified
| CreateCluster
| DeleteCluster
| UpgradeMaster
| UpgradeNodes
| RepairCluster
| UpdateCluster
| CreateNodePool
| DeleteNodePool
| SetNodePoolManagement
| AutoRepairNodes
| AutoUpgradeNodes
| SetLabels
| SetMasterAuth
| SetNodePoolSize
| SetNetworkPolicy
| SetMaintenancePolicy
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable OperationOperationType
instance FromHttpApiData OperationOperationType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right TypeUnspecified
"CREATE_CLUSTER" -> Right CreateCluster
"DELETE_CLUSTER" -> Right DeleteCluster
"UPGRADE_MASTER" -> Right UpgradeMaster
"UPGRADE_NODES" -> Right UpgradeNodes
"REPAIR_CLUSTER" -> Right RepairCluster
"UPDATE_CLUSTER" -> Right UpdateCluster
"CREATE_NODE_POOL" -> Right CreateNodePool
"DELETE_NODE_POOL" -> Right DeleteNodePool
"SET_NODE_POOL_MANAGEMENT" -> Right SetNodePoolManagement
"AUTO_REPAIR_NODES" -> Right AutoRepairNodes
"AUTO_UPGRADE_NODES" -> Right AutoUpgradeNodes
"SET_LABELS" -> Right SetLabels
"SET_MASTER_AUTH" -> Right SetMasterAuth
"SET_NODE_POOL_SIZE" -> Right SetNodePoolSize
"SET_NETWORK_POLICY" -> Right SetNetworkPolicy
"SET_MAINTENANCE_POLICY" -> Right SetMaintenancePolicy
x -> Left ("Unable to parse OperationOperationType from: " <> x)
instance ToHttpApiData OperationOperationType where
toQueryParam = \case
TypeUnspecified -> "TYPE_UNSPECIFIED"
CreateCluster -> "CREATE_CLUSTER"
DeleteCluster -> "DELETE_CLUSTER"
UpgradeMaster -> "UPGRADE_MASTER"
UpgradeNodes -> "UPGRADE_NODES"
RepairCluster -> "REPAIR_CLUSTER"
UpdateCluster -> "UPDATE_CLUSTER"
CreateNodePool -> "CREATE_NODE_POOL"
DeleteNodePool -> "DELETE_NODE_POOL"
SetNodePoolManagement -> "SET_NODE_POOL_MANAGEMENT"
AutoRepairNodes -> "AUTO_REPAIR_NODES"
AutoUpgradeNodes -> "AUTO_UPGRADE_NODES"
SetLabels -> "SET_LABELS"
SetMasterAuth -> "SET_MASTER_AUTH"
SetNodePoolSize -> "SET_NODE_POOL_SIZE"
SetNetworkPolicy -> "SET_NETWORK_POLICY"
SetMaintenancePolicy -> "SET_MAINTENANCE_POLICY"
instance FromJSON OperationOperationType where
parseJSON = parseJSONText "OperationOperationType"
instance ToJSON OperationOperationType where
toJSON = toJSONText
data OperationStatus
= StatusUnspecified
| Pending
| Running
| Done
| Aborting
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable OperationStatus
instance FromHttpApiData OperationStatus where
parseQueryParam = \case
"STATUS_UNSPECIFIED" -> Right StatusUnspecified
"PENDING" -> Right Pending
"RUNNING" -> Right Running
"DONE" -> Right Done
"ABORTING" -> Right Aborting
x -> Left ("Unable to parse OperationStatus from: " <> x)
instance ToHttpApiData OperationStatus where
toQueryParam = \case
StatusUnspecified -> "STATUS_UNSPECIFIED"
Pending -> "PENDING"
Running -> "RUNNING"
Done -> "DONE"
Aborting -> "ABORTING"
instance FromJSON OperationStatus where
parseJSON = parseJSONText "OperationStatus"
instance ToJSON OperationStatus where
toJSON = toJSONText
data NetworkPolicyProvider
= ProviderUnspecified
| Calico
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable NetworkPolicyProvider
instance FromHttpApiData NetworkPolicyProvider where
parseQueryParam = \case
"PROVIDER_UNSPECIFIED" -> Right ProviderUnspecified
"CALICO" -> Right Calico
x -> Left ("Unable to parse NetworkPolicyProvider from: " <> x)
instance ToHttpApiData NetworkPolicyProvider where
toQueryParam = \case
ProviderUnspecified -> "PROVIDER_UNSPECIFIED"
Calico -> "CALICO"
instance FromJSON NetworkPolicyProvider where
parseJSON = parseJSONText "NetworkPolicyProvider"
instance ToJSON NetworkPolicyProvider 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 NodePoolStatus
= NPSStatusUnspecified
| NPSProvisioning
| NPSRunning
| NPSRunningWithError
| NPSReconciling
| NPSStopping
| NPSError'
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable NodePoolStatus
instance FromHttpApiData NodePoolStatus where
parseQueryParam = \case
"STATUS_UNSPECIFIED" -> Right NPSStatusUnspecified
"PROVISIONING" -> Right NPSProvisioning
"RUNNING" -> Right NPSRunning
"RUNNING_WITH_ERROR" -> Right NPSRunningWithError
"RECONCILING" -> Right NPSReconciling
"STOPPING" -> Right NPSStopping
"ERROR" -> Right NPSError'
x -> Left ("Unable to parse NodePoolStatus from: " <> x)
instance ToHttpApiData NodePoolStatus where
toQueryParam = \case
NPSStatusUnspecified -> "STATUS_UNSPECIFIED"
NPSProvisioning -> "PROVISIONING"
NPSRunning -> "RUNNING"
NPSRunningWithError -> "RUNNING_WITH_ERROR"
NPSReconciling -> "RECONCILING"
NPSStopping -> "STOPPING"
NPSError' -> "ERROR"
instance FromJSON NodePoolStatus where
parseJSON = parseJSONText "NodePoolStatus"
instance ToJSON NodePoolStatus where
toJSON = toJSONText
data ClusterStatus
= CSStatusUnspecified
| CSProvisioning
| CSRunning
| CSReconciling
| CSStopping
| CSError'
| CSDegraded
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ClusterStatus
instance FromHttpApiData ClusterStatus where
parseQueryParam = \case
"STATUS_UNSPECIFIED" -> Right CSStatusUnspecified
"PROVISIONING" -> Right CSProvisioning
"RUNNING" -> Right CSRunning
"RECONCILING" -> Right CSReconciling
"STOPPING" -> Right CSStopping
"ERROR" -> Right CSError'
"DEGRADED" -> Right CSDegraded
x -> Left ("Unable to parse ClusterStatus from: " <> x)
instance ToHttpApiData ClusterStatus where
toQueryParam = \case
CSStatusUnspecified -> "STATUS_UNSPECIFIED"
CSProvisioning -> "PROVISIONING"
CSRunning -> "RUNNING"
CSReconciling -> "RECONCILING"
CSStopping -> "STOPPING"
CSError' -> "ERROR"
CSDegraded -> "DEGRADED"
instance FromJSON ClusterStatus where
parseJSON = parseJSONText "ClusterStatus"
instance ToJSON ClusterStatus where
toJSON = toJSONText
data NodeTaintEffect
= EffectUnspecified
| NoSchedule
| PreferNoSchedule
| NoExecute
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable NodeTaintEffect
instance FromHttpApiData NodeTaintEffect where
parseQueryParam = \case
"EFFECT_UNSPECIFIED" -> Right EffectUnspecified
"NO_SCHEDULE" -> Right NoSchedule
"PREFER_NO_SCHEDULE" -> Right PreferNoSchedule
"NO_EXECUTE" -> Right NoExecute
x -> Left ("Unable to parse NodeTaintEffect from: " <> x)
instance ToHttpApiData NodeTaintEffect where
toQueryParam = \case
EffectUnspecified -> "EFFECT_UNSPECIFIED"
NoSchedule -> "NO_SCHEDULE"
PreferNoSchedule -> "PREFER_NO_SCHEDULE"
NoExecute -> "NO_EXECUTE"
instance FromJSON NodeTaintEffect where
parseJSON = parseJSONText "NodeTaintEffect"
instance ToJSON NodeTaintEffect where
toJSON = toJSONText
data SetMasterAuthRequestAction
= SMARAUnknown
| SMARASetPassword
| SMARAGeneratePassword
| SMARASetUsername
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable SetMasterAuthRequestAction
instance FromHttpApiData SetMasterAuthRequestAction where
parseQueryParam = \case
"UNKNOWN" -> Right SMARAUnknown
"SET_PASSWORD" -> Right SMARASetPassword
"GENERATE_PASSWORD" -> Right SMARAGeneratePassword
"SET_USERNAME" -> Right SMARASetUsername
x -> Left ("Unable to parse SetMasterAuthRequestAction from: " <> x)
instance ToHttpApiData SetMasterAuthRequestAction where
toQueryParam = \case
SMARAUnknown -> "UNKNOWN"
SMARASetPassword -> "SET_PASSWORD"
SMARAGeneratePassword -> "GENERATE_PASSWORD"
SMARASetUsername -> "SET_USERNAME"
instance FromJSON SetMasterAuthRequestAction where
parseJSON = parseJSONText "SetMasterAuthRequestAction"
instance ToJSON SetMasterAuthRequestAction where
toJSON = toJSONText