{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Billing.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data AggregationInfoAggregationLevel
= AggregationLevelUnspecified
| Account
| Project
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AggregationInfoAggregationLevel
instance FromHttpApiData AggregationInfoAggregationLevel where
parseQueryParam = \case
"AGGREGATION_LEVEL_UNSPECIFIED" -> Right AggregationLevelUnspecified
"ACCOUNT" -> Right Account
"PROJECT" -> Right Project
x -> Left ("Unable to parse AggregationInfoAggregationLevel from: " <> x)
instance ToHttpApiData AggregationInfoAggregationLevel where
toQueryParam = \case
AggregationLevelUnspecified -> "AGGREGATION_LEVEL_UNSPECIFIED"
Account -> "ACCOUNT"
Project -> "PROJECT"
instance FromJSON AggregationInfoAggregationLevel where
parseJSON = parseJSONText "AggregationInfoAggregationLevel"
instance ToJSON AggregationInfoAggregationLevel 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 AggregationInfoAggregationInterval
= AggregationIntervalUnspecified
| Daily
| Monthly
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable AggregationInfoAggregationInterval
instance FromHttpApiData AggregationInfoAggregationInterval where
parseQueryParam = \case
"AGGREGATION_INTERVAL_UNSPECIFIED" -> Right AggregationIntervalUnspecified
"DAILY" -> Right Daily
"MONTHLY" -> Right Monthly
x -> Left ("Unable to parse AggregationInfoAggregationInterval from: " <> x)
instance ToHttpApiData AggregationInfoAggregationInterval where
toQueryParam = \case
AggregationIntervalUnspecified -> "AGGREGATION_INTERVAL_UNSPECIFIED"
Daily -> "DAILY"
Monthly -> "MONTHLY"
instance FromJSON AggregationInfoAggregationInterval where
parseJSON = parseJSONText "AggregationInfoAggregationInterval"
instance ToJSON AggregationInfoAggregationInterval where
toJSON = toJSONText