{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.File.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data InstanceTier
= TierUnspecified
| Standard
| Premium
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable InstanceTier
instance FromHttpApiData InstanceTier where
parseQueryParam = \case
"TIER_UNSPECIFIED" -> Right TierUnspecified
"STANDARD" -> Right Standard
"PREMIUM" -> Right Premium
x -> Left ("Unable to parse InstanceTier from: " <> x)
instance ToHttpApiData InstanceTier where
toQueryParam = \case
TierUnspecified -> "TIER_UNSPECIFIED"
Standard -> "STANDARD"
Premium -> "PREMIUM"
instance FromJSON InstanceTier where
parseJSON = parseJSONText "InstanceTier"
instance ToJSON InstanceTier 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 InstanceState
= StateUnspecified
| Creating
| Ready
| Repairing
| Deleting
| Error'
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable InstanceState
instance FromHttpApiData InstanceState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right StateUnspecified
"CREATING" -> Right Creating
"READY" -> Right Ready
"REPAIRING" -> Right Repairing
"DELETING" -> Right Deleting
"ERROR" -> Right Error'
x -> Left ("Unable to parse InstanceState from: " <> x)
instance ToHttpApiData InstanceState where
toQueryParam = \case
StateUnspecified -> "STATE_UNSPECIFIED"
Creating -> "CREATING"
Ready -> "READY"
Repairing -> "REPAIRING"
Deleting -> "DELETING"
Error' -> "ERROR"
instance FromJSON InstanceState where
parseJSON = parseJSONText "InstanceState"
instance ToJSON InstanceState where
toJSON = toJSONText