{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.CloudShell.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data StartEnvironmentMetadataState
= StateUnspecified
| Starting
| UnarchivingDisk
| Finished
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable StartEnvironmentMetadataState
instance FromHttpApiData StartEnvironmentMetadataState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right StateUnspecified
"STARTING" -> Right Starting
"UNARCHIVING_DISK" -> Right UnarchivingDisk
"FINISHED" -> Right Finished
x -> Left ("Unable to parse StartEnvironmentMetadataState from: " <> x)
instance ToHttpApiData StartEnvironmentMetadataState where
toQueryParam = \case
StateUnspecified -> "STATE_UNSPECIFIED"
Starting -> "STARTING"
UnarchivingDisk -> "UNARCHIVING_DISK"
Finished -> "FINISHED"
instance FromJSON StartEnvironmentMetadataState where
parseJSON = parseJSONText "StartEnvironmentMetadataState"
instance ToJSON StartEnvironmentMetadataState where
toJSON = toJSONText
data EnvironmentState
= ESStateUnspecified
| ESDisabled
| ESStarting
| ESRunning
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable EnvironmentState
instance FromHttpApiData EnvironmentState where
parseQueryParam = \case
"STATE_UNSPECIFIED" -> Right ESStateUnspecified
"DISABLED" -> Right ESDisabled
"STARTING" -> Right ESStarting
"RUNNING" -> Right ESRunning
x -> Left ("Unable to parse EnvironmentState from: " <> x)
instance ToHttpApiData EnvironmentState where
toQueryParam = \case
ESStateUnspecified -> "STATE_UNSPECIFIED"
ESDisabled -> "DISABLED"
ESStarting -> "STARTING"
ESRunning -> "RUNNING"
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
data PublicKeyFormat
= FormatUnspecified
| SSHDss
| SSHRsa
| EcdsaSHA2NISTP256
| EcdsaSHA2NISTP384
| EcdsaSHA2NISTP521
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable PublicKeyFormat
instance FromHttpApiData PublicKeyFormat where
parseQueryParam = \case
"FORMAT_UNSPECIFIED" -> Right FormatUnspecified
"SSH_DSS" -> Right SSHDss
"SSH_RSA" -> Right SSHRsa
"ECDSA_SHA2_NISTP256" -> Right EcdsaSHA2NISTP256
"ECDSA_SHA2_NISTP384" -> Right EcdsaSHA2NISTP384
"ECDSA_SHA2_NISTP521" -> Right EcdsaSHA2NISTP521
x -> Left ("Unable to parse PublicKeyFormat from: " <> x)
instance ToHttpApiData PublicKeyFormat where
toQueryParam = \case
FormatUnspecified -> "FORMAT_UNSPECIFIED"
SSHDss -> "SSH_DSS"
SSHRsa -> "SSH_RSA"
EcdsaSHA2NISTP256 -> "ECDSA_SHA2_NISTP256"
EcdsaSHA2NISTP384 -> "ECDSA_SHA2_NISTP384"
EcdsaSHA2NISTP521 -> "ECDSA_SHA2_NISTP521"
instance FromJSON PublicKeyFormat where
parseJSON = parseJSONText "PublicKeyFormat"
instance ToJSON PublicKeyFormat where
toJSON = toJSONText