{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.SourceRepo.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data PubsubConfigMessageFormat
= MessageFormatUnspecified
| Protobuf
| JSON
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable PubsubConfigMessageFormat
instance FromHttpApiData PubsubConfigMessageFormat where
parseQueryParam = \case
"MESSAGE_FORMAT_UNSPECIFIED" -> Right MessageFormatUnspecified
"PROTOBUF" -> Right Protobuf
"JSON" -> Right JSON
x -> Left ("Unable to parse PubsubConfigMessageFormat from: " <> x)
instance ToHttpApiData PubsubConfigMessageFormat where
toQueryParam = \case
MessageFormatUnspecified -> "MESSAGE_FORMAT_UNSPECIFIED"
Protobuf -> "PROTOBUF"
JSON -> "JSON"
instance FromJSON PubsubConfigMessageFormat where
parseJSON = parseJSONText "PubsubConfigMessageFormat"
instance ToJSON PubsubConfigMessageFormat 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