{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.BigtableAdmin.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data ClusterDefaultStorageType
= StorageTypeUnspecified
| Ssd
| Hdd
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ClusterDefaultStorageType
instance FromHttpApiData ClusterDefaultStorageType where
parseQueryParam = \case
"STORAGE_TYPE_UNSPECIFIED" -> Right StorageTypeUnspecified
"SSD" -> Right Ssd
"HDD" -> Right Hdd
x -> Left ("Unable to parse ClusterDefaultStorageType from: " <> x)
instance ToHttpApiData ClusterDefaultStorageType where
toQueryParam = \case
StorageTypeUnspecified -> "STORAGE_TYPE_UNSPECIFIED"
Ssd -> "SSD"
Hdd -> "HDD"
instance FromJSON ClusterDefaultStorageType where
parseJSON = parseJSONText "ClusterDefaultStorageType"
instance ToJSON ClusterDefaultStorageType where
toJSON = toJSONText
data ClusterStateReplicationState
= StateNotKnown
| Initializing
| PlannedMaintenance
| UnplannedMaintenance
| Ready
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ClusterStateReplicationState
instance FromHttpApiData ClusterStateReplicationState where
parseQueryParam = \case
"STATE_NOT_KNOWN" -> Right StateNotKnown
"INITIALIZING" -> Right Initializing
"PLANNED_MAINTENANCE" -> Right PlannedMaintenance
"UNPLANNED_MAINTENANCE" -> Right UnplannedMaintenance
"READY" -> Right Ready
x -> Left ("Unable to parse ClusterStateReplicationState from: " <> x)
instance ToHttpApiData ClusterStateReplicationState where
toQueryParam = \case
StateNotKnown -> "STATE_NOT_KNOWN"
Initializing -> "INITIALIZING"
PlannedMaintenance -> "PLANNED_MAINTENANCE"
UnplannedMaintenance -> "UNPLANNED_MAINTENANCE"
Ready -> "READY"
instance FromJSON ClusterStateReplicationState where
parseJSON = parseJSONText "ClusterStateReplicationState"
instance ToJSON ClusterStateReplicationState where
toJSON = toJSONText
data InstanceType
= TypeUnspecified
| Production
| Development
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable InstanceType
instance FromHttpApiData InstanceType where
parseQueryParam = \case
"TYPE_UNSPECIFIED" -> Right TypeUnspecified
"PRODUCTION" -> Right Production
"DEVELOPMENT" -> Right Development
x -> Left ("Unable to parse InstanceType from: " <> x)
instance ToHttpApiData InstanceType where
toQueryParam = \case
TypeUnspecified -> "TYPE_UNSPECIFIED"
Production -> "PRODUCTION"
Development -> "DEVELOPMENT"
instance FromJSON InstanceType where
parseJSON = parseJSONText "InstanceType"
instance ToJSON InstanceType 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
data TableGranularity
= TimestampGranularityUnspecified
| Millis
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable TableGranularity
instance FromHttpApiData TableGranularity where
parseQueryParam = \case
"TIMESTAMP_GRANULARITY_UNSPECIFIED" -> Right TimestampGranularityUnspecified
"MILLIS" -> Right Millis
x -> Left ("Unable to parse TableGranularity from: " <> x)
instance ToHttpApiData TableGranularity where
toQueryParam = \case
TimestampGranularityUnspecified -> "TIMESTAMP_GRANULARITY_UNSPECIFIED"
Millis -> "MILLIS"
instance FromJSON TableGranularity where
parseJSON = parseJSONText "TableGranularity"
instance ToJSON TableGranularity where
toJSON = toJSONText
data ClusterType
= CTStateNotKnown
| CTReady
| CTCreating
| CTResizing
| CTDisabled
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ClusterType
instance FromHttpApiData ClusterType where
parseQueryParam = \case
"STATE_NOT_KNOWN" -> Right CTStateNotKnown
"READY" -> Right CTReady
"CREATING" -> Right CTCreating
"RESIZING" -> Right CTResizing
"DISABLED" -> Right CTDisabled
x -> Left ("Unable to parse ClusterType from: " <> x)
instance ToHttpApiData ClusterType where
toQueryParam = \case
CTStateNotKnown -> "STATE_NOT_KNOWN"
CTReady -> "READY"
CTCreating -> "CREATING"
CTResizing -> "RESIZING"
CTDisabled -> "DISABLED"
instance FromJSON ClusterType where
parseJSON = parseJSONText "ClusterType"
instance ToJSON ClusterType where
toJSON = toJSONText
data InstanceState
= ISStateNotKnown
| ISReady
| ISCreating
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable InstanceState
instance FromHttpApiData InstanceState where
parseQueryParam = \case
"STATE_NOT_KNOWN" -> Right ISStateNotKnown
"READY" -> Right ISReady
"CREATING" -> Right ISCreating
x -> Left ("Unable to parse InstanceState from: " <> x)
instance ToHttpApiData InstanceState where
toQueryParam = \case
ISStateNotKnown -> "STATE_NOT_KNOWN"
ISReady -> "READY"
ISCreating -> "CREATING"
instance FromJSON InstanceState where
parseJSON = parseJSONText "InstanceState"
instance ToJSON InstanceState where
toJSON = toJSONText