{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.FirebaseRules.Types.Sum -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- module Network.Google.FirebaseRules.Types.Sum where import Network.Google.Prelude -- | V1 error format. data Xgafv = X1 -- ^ @1@ -- v1 error format | X2 -- ^ @2@ -- v2 error format 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 -- | The severity of the issue. data IssueSeverity = SeverityUnspecified -- ^ @SEVERITY_UNSPECIFIED@ -- An unspecified severity. | Deprecation -- ^ @DEPRECATION@ -- Deprecation issue for statements and method that may no longer be -- supported or maintained. | Warning -- ^ @WARNING@ -- Warnings such as: unused variables. | Error' -- ^ @ERROR@ -- Errors such as: unmatched curly braces or variable redefinition. deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic) instance Hashable IssueSeverity instance FromHttpApiData IssueSeverity where parseQueryParam = \case "SEVERITY_UNSPECIFIED" -> Right SeverityUnspecified "DEPRECATION" -> Right Deprecation "WARNING" -> Right Warning "ERROR" -> Right Error' x -> Left ("Unable to parse IssueSeverity from: " <> x) instance ToHttpApiData IssueSeverity where toQueryParam = \case SeverityUnspecified -> "SEVERITY_UNSPECIFIED" Deprecation -> "DEPRECATION" Warning -> "WARNING" Error' -> "ERROR" instance FromJSON IssueSeverity where parseJSON = parseJSONText "IssueSeverity" instance ToJSON IssueSeverity where toJSON = toJSONText