{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.AnalyticsReporting.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data MetricFilterOperator
= OperatorUnspecified
| Equal
| LessThan
| GreaterThan
| IsMissing
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable MetricFilterOperator
instance FromHttpApiData MetricFilterOperator where
parseQueryParam = \case
"OPERATOR_UNSPECIFIED" -> Right OperatorUnspecified
"EQUAL" -> Right Equal
"LESS_THAN" -> Right LessThan
"GREATER_THAN" -> Right GreaterThan
"IS_MISSING" -> Right IsMissing
x -> Left ("Unable to parse MetricFilterOperator from: " <> x)
instance ToHttpApiData MetricFilterOperator where
toQueryParam = \case
OperatorUnspecified -> "OPERATOR_UNSPECIFIED"
Equal -> "EQUAL"
LessThan -> "LESS_THAN"
GreaterThan -> "GREATER_THAN"
IsMissing -> "IS_MISSING"
instance FromJSON MetricFilterOperator where
parseJSON = parseJSONText "MetricFilterOperator"
instance ToJSON MetricFilterOperator where
toJSON = toJSONText
data DimensionFilterClauseOperator
= DFCOOperatorUnspecified
| DFCOOR
| DFCOAnd
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DimensionFilterClauseOperator
instance FromHttpApiData DimensionFilterClauseOperator where
parseQueryParam = \case
"OPERATOR_UNSPECIFIED" -> Right DFCOOperatorUnspecified
"OR" -> Right DFCOOR
"AND" -> Right DFCOAnd
x -> Left ("Unable to parse DimensionFilterClauseOperator from: " <> x)
instance ToHttpApiData DimensionFilterClauseOperator where
toQueryParam = \case
DFCOOperatorUnspecified -> "OPERATOR_UNSPECIFIED"
DFCOOR -> "OR"
DFCOAnd -> "AND"
instance FromJSON DimensionFilterClauseOperator where
parseJSON = parseJSONText "DimensionFilterClauseOperator"
instance ToJSON DimensionFilterClauseOperator where
toJSON = toJSONText
data CohortType
= UnspecifiedCohortType
| FirstVisitDate
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable CohortType
instance FromHttpApiData CohortType where
parseQueryParam = \case
"UNSPECIFIED_COHORT_TYPE" -> Right UnspecifiedCohortType
"FIRST_VISIT_DATE" -> Right FirstVisitDate
x -> Left ("Unable to parse CohortType from: " <> x)
instance ToHttpApiData CohortType where
toQueryParam = \case
UnspecifiedCohortType -> "UNSPECIFIED_COHORT_TYPE"
FirstVisitDate -> "FIRST_VISIT_DATE"
instance FromJSON CohortType where
parseJSON = parseJSONText "CohortType"
instance ToJSON CohortType where
toJSON = toJSONText
data OrderByOrderType
= OrderTypeUnspecified
| Value
| Delta
| Smart
| HistogramBucket
| DimensionAsInteger
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable OrderByOrderType
instance FromHttpApiData OrderByOrderType where
parseQueryParam = \case
"ORDER_TYPE_UNSPECIFIED" -> Right OrderTypeUnspecified
"VALUE" -> Right Value
"DELTA" -> Right Delta
"SMART" -> Right Smart
"HISTOGRAM_BUCKET" -> Right HistogramBucket
"DIMENSION_AS_INTEGER" -> Right DimensionAsInteger
x -> Left ("Unable to parse OrderByOrderType from: " <> x)
instance ToHttpApiData OrderByOrderType where
toQueryParam = \case
OrderTypeUnspecified -> "ORDER_TYPE_UNSPECIFIED"
Value -> "VALUE"
Delta -> "DELTA"
Smart -> "SMART"
HistogramBucket -> "HISTOGRAM_BUCKET"
DimensionAsInteger -> "DIMENSION_AS_INTEGER"
instance FromJSON OrderByOrderType where
parseJSON = parseJSONText "OrderByOrderType"
instance ToJSON OrderByOrderType where
toJSON = toJSONText
data OrderBySortOrder
= SortOrderUnspecified
| Ascending
| Descending
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable OrderBySortOrder
instance FromHttpApiData OrderBySortOrder where
parseQueryParam = \case
"SORT_ORDER_UNSPECIFIED" -> Right SortOrderUnspecified
"ASCENDING" -> Right Ascending
"DESCENDING" -> Right Descending
x -> Left ("Unable to parse OrderBySortOrder from: " <> x)
instance ToHttpApiData OrderBySortOrder where
toQueryParam = \case
SortOrderUnspecified -> "SORT_ORDER_UNSPECIFIED"
Ascending -> "ASCENDING"
Descending -> "DESCENDING"
instance FromJSON OrderBySortOrder where
parseJSON = parseJSONText "OrderBySortOrder"
instance ToJSON OrderBySortOrder where
toJSON = toJSONText
data SegmentMetricFilterOperator
= SMFOUnspecifiedOperator
| SMFOLessThan
| SMFOGreaterThan
| SMFOEqual
| SMFOBetween
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable SegmentMetricFilterOperator
instance FromHttpApiData SegmentMetricFilterOperator where
parseQueryParam = \case
"UNSPECIFIED_OPERATOR" -> Right SMFOUnspecifiedOperator
"LESS_THAN" -> Right SMFOLessThan
"GREATER_THAN" -> Right SMFOGreaterThan
"EQUAL" -> Right SMFOEqual
"BETWEEN" -> Right SMFOBetween
x -> Left ("Unable to parse SegmentMetricFilterOperator from: " <> x)
instance ToHttpApiData SegmentMetricFilterOperator where
toQueryParam = \case
SMFOUnspecifiedOperator -> "UNSPECIFIED_OPERATOR"
SMFOLessThan -> "LESS_THAN"
SMFOGreaterThan -> "GREATER_THAN"
SMFOEqual -> "EQUAL"
SMFOBetween -> "BETWEEN"
instance FromJSON SegmentMetricFilterOperator where
parseJSON = parseJSONText "SegmentMetricFilterOperator"
instance ToJSON SegmentMetricFilterOperator where
toJSON = toJSONText
data MetricHeaderEntryType
= MetricTypeUnspecified
| Integer
| Float
| Currency
| Percent
| Time
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable MetricHeaderEntryType
instance FromHttpApiData MetricHeaderEntryType where
parseQueryParam = \case
"METRIC_TYPE_UNSPECIFIED" -> Right MetricTypeUnspecified
"INTEGER" -> Right Integer
"FLOAT" -> Right Float
"CURRENCY" -> Right Currency
"PERCENT" -> Right Percent
"TIME" -> Right Time
x -> Left ("Unable to parse MetricHeaderEntryType from: " <> x)
instance ToHttpApiData MetricHeaderEntryType where
toQueryParam = \case
MetricTypeUnspecified -> "METRIC_TYPE_UNSPECIFIED"
Integer -> "INTEGER"
Float -> "FLOAT"
Currency -> "CURRENCY"
Percent -> "PERCENT"
Time -> "TIME"
instance FromJSON MetricHeaderEntryType where
parseJSON = parseJSONText "MetricHeaderEntryType"
instance ToJSON MetricHeaderEntryType where
toJSON = toJSONText
data ReportRequestSamplingLevel
= SamplingUnspecified
| Default
| Small
| Large
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable ReportRequestSamplingLevel
instance FromHttpApiData ReportRequestSamplingLevel where
parseQueryParam = \case
"SAMPLING_UNSPECIFIED" -> Right SamplingUnspecified
"DEFAULT" -> Right Default
"SMALL" -> Right Small
"LARGE" -> Right Large
x -> Left ("Unable to parse ReportRequestSamplingLevel from: " <> x)
instance ToHttpApiData ReportRequestSamplingLevel where
toQueryParam = \case
SamplingUnspecified -> "SAMPLING_UNSPECIFIED"
Default -> "DEFAULT"
Small -> "SMALL"
Large -> "LARGE"
instance FromJSON ReportRequestSamplingLevel where
parseJSON = parseJSONText "ReportRequestSamplingLevel"
instance ToJSON ReportRequestSamplingLevel 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 SegmentSequenceStepMatchType
= UnspecifiedMatchType
| Precedes
| ImmediatelyPrecedes
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable SegmentSequenceStepMatchType
instance FromHttpApiData SegmentSequenceStepMatchType where
parseQueryParam = \case
"UNSPECIFIED_MATCH_TYPE" -> Right UnspecifiedMatchType
"PRECEDES" -> Right Precedes
"IMMEDIATELY_PRECEDES" -> Right ImmediatelyPrecedes
x -> Left ("Unable to parse SegmentSequenceStepMatchType from: " <> x)
instance ToHttpApiData SegmentSequenceStepMatchType where
toQueryParam = \case
UnspecifiedMatchType -> "UNSPECIFIED_MATCH_TYPE"
Precedes -> "PRECEDES"
ImmediatelyPrecedes -> "IMMEDIATELY_PRECEDES"
instance FromJSON SegmentSequenceStepMatchType where
parseJSON = parseJSONText "SegmentSequenceStepMatchType"
instance ToJSON SegmentSequenceStepMatchType where
toJSON = toJSONText
data SegmentMetricFilterScope
= UnspecifiedScope
| Product
| Hit
| Session
| User
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable SegmentMetricFilterScope
instance FromHttpApiData SegmentMetricFilterScope where
parseQueryParam = \case
"UNSPECIFIED_SCOPE" -> Right UnspecifiedScope
"PRODUCT" -> Right Product
"HIT" -> Right Hit
"SESSION" -> Right Session
"USER" -> Right User
x -> Left ("Unable to parse SegmentMetricFilterScope from: " <> x)
instance ToHttpApiData SegmentMetricFilterScope where
toQueryParam = \case
UnspecifiedScope -> "UNSPECIFIED_SCOPE"
Product -> "PRODUCT"
Hit -> "HIT"
Session -> "SESSION"
User -> "USER"
instance FromJSON SegmentMetricFilterScope where
parseJSON = parseJSONText "SegmentMetricFilterScope"
instance ToJSON SegmentMetricFilterScope where
toJSON = toJSONText
data DimensionFilterOperator
= DFOOperatorUnspecified
| DFORegexp
| DFOBeginsWith
| DFOEndsWith
| DFOPartial
| DFOExact
| DFONumericEqual
| DFONumericGreaterThan
| DFONumericLessThan
| DFOInList
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable DimensionFilterOperator
instance FromHttpApiData DimensionFilterOperator where
parseQueryParam = \case
"OPERATOR_UNSPECIFIED" -> Right DFOOperatorUnspecified
"REGEXP" -> Right DFORegexp
"BEGINS_WITH" -> Right DFOBeginsWith
"ENDS_WITH" -> Right DFOEndsWith
"PARTIAL" -> Right DFOPartial
"EXACT" -> Right DFOExact
"NUMERIC_EQUAL" -> Right DFONumericEqual
"NUMERIC_GREATER_THAN" -> Right DFONumericGreaterThan
"NUMERIC_LESS_THAN" -> Right DFONumericLessThan
"IN_LIST" -> Right DFOInList
x -> Left ("Unable to parse DimensionFilterOperator from: " <> x)
instance ToHttpApiData DimensionFilterOperator where
toQueryParam = \case
DFOOperatorUnspecified -> "OPERATOR_UNSPECIFIED"
DFORegexp -> "REGEXP"
DFOBeginsWith -> "BEGINS_WITH"
DFOEndsWith -> "ENDS_WITH"
DFOPartial -> "PARTIAL"
DFOExact -> "EXACT"
DFONumericEqual -> "NUMERIC_EQUAL"
DFONumericGreaterThan -> "NUMERIC_GREATER_THAN"
DFONumericLessThan -> "NUMERIC_LESS_THAN"
DFOInList -> "IN_LIST"
instance FromJSON DimensionFilterOperator where
parseJSON = parseJSONText "DimensionFilterOperator"
instance ToJSON DimensionFilterOperator where
toJSON = toJSONText
data MetricFormattingType
= MFTMetricTypeUnspecified
| MFTInteger
| MFTFloat
| MFTCurrency
| MFTPercent
| MFTTime
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable MetricFormattingType
instance FromHttpApiData MetricFormattingType where
parseQueryParam = \case
"METRIC_TYPE_UNSPECIFIED" -> Right MFTMetricTypeUnspecified
"INTEGER" -> Right MFTInteger
"FLOAT" -> Right MFTFloat
"CURRENCY" -> Right MFTCurrency
"PERCENT" -> Right MFTPercent
"TIME" -> Right MFTTime
x -> Left ("Unable to parse MetricFormattingType from: " <> x)
instance ToHttpApiData MetricFormattingType where
toQueryParam = \case
MFTMetricTypeUnspecified -> "METRIC_TYPE_UNSPECIFIED"
MFTInteger -> "INTEGER"
MFTFloat -> "FLOAT"
MFTCurrency -> "CURRENCY"
MFTPercent -> "PERCENT"
MFTTime -> "TIME"
instance FromJSON MetricFormattingType where
parseJSON = parseJSONText "MetricFormattingType"
instance ToJSON MetricFormattingType where
toJSON = toJSONText
data SegmentDimensionFilterOperator
= SDFOOperatorUnspecified
| SDFORegexp
| SDFOBeginsWith
| SDFOEndsWith
| SDFOPartial
| SDFOExact
| SDFOInList
| SDFONumericLessThan
| SDFONumericGreaterThan
| SDFONumericBetween
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable SegmentDimensionFilterOperator
instance FromHttpApiData SegmentDimensionFilterOperator where
parseQueryParam = \case
"OPERATOR_UNSPECIFIED" -> Right SDFOOperatorUnspecified
"REGEXP" -> Right SDFORegexp
"BEGINS_WITH" -> Right SDFOBeginsWith
"ENDS_WITH" -> Right SDFOEndsWith
"PARTIAL" -> Right SDFOPartial
"EXACT" -> Right SDFOExact
"IN_LIST" -> Right SDFOInList
"NUMERIC_LESS_THAN" -> Right SDFONumericLessThan
"NUMERIC_GREATER_THAN" -> Right SDFONumericGreaterThan
"NUMERIC_BETWEEN" -> Right SDFONumericBetween
x -> Left ("Unable to parse SegmentDimensionFilterOperator from: " <> x)
instance ToHttpApiData SegmentDimensionFilterOperator where
toQueryParam = \case
SDFOOperatorUnspecified -> "OPERATOR_UNSPECIFIED"
SDFORegexp -> "REGEXP"
SDFOBeginsWith -> "BEGINS_WITH"
SDFOEndsWith -> "ENDS_WITH"
SDFOPartial -> "PARTIAL"
SDFOExact -> "EXACT"
SDFOInList -> "IN_LIST"
SDFONumericLessThan -> "NUMERIC_LESS_THAN"
SDFONumericGreaterThan -> "NUMERIC_GREATER_THAN"
SDFONumericBetween -> "NUMERIC_BETWEEN"
instance FromJSON SegmentDimensionFilterOperator where
parseJSON = parseJSONText "SegmentDimensionFilterOperator"
instance ToJSON SegmentDimensionFilterOperator where
toJSON = toJSONText
data MetricFilterClauseOperator
= MFCOOperatorUnspecified
| MFCOOR
| MFCOAnd
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable MetricFilterClauseOperator
instance FromHttpApiData MetricFilterClauseOperator where
parseQueryParam = \case
"OPERATOR_UNSPECIFIED" -> Right MFCOOperatorUnspecified
"OR" -> Right MFCOOR
"AND" -> Right MFCOAnd
x -> Left ("Unable to parse MetricFilterClauseOperator from: " <> x)
instance ToHttpApiData MetricFilterClauseOperator where
toQueryParam = \case
MFCOOperatorUnspecified -> "OPERATOR_UNSPECIFIED"
MFCOOR -> "OR"
MFCOAnd -> "AND"
instance FromJSON MetricFilterClauseOperator where
parseJSON = parseJSONText "MetricFilterClauseOperator"
instance ToJSON MetricFilterClauseOperator where
toJSON = toJSONText