{-# LANGUAGE MultiWayIf #-}
-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.
{-# LANGUAGE OverloadedStrings #-}

-- | Contains the types generated from the schema Error
module RecurlyClient.Types.Error where

import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString
import qualified Data.ByteString as Data.ByteString.Internal
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified RecurlyClient.Common
import RecurlyClient.TypeAlias
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.Error@ in the specification.
data Error = Error
    { Error -> Maybe Text
errorMessage :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ message
    , Error -> Maybe [ErrorParams]
errorParams :: (GHC.Maybe.Maybe [ErrorParams])
    -- ^ params
    , Error -> Maybe ErrorType
errorType :: (GHC.Maybe.Maybe ErrorType)
    -- ^ type
    }
    deriving
        ( Int -> Error -> ShowS
[Error] -> ShowS
Error -> String
(Int -> Error -> ShowS)
-> (Error -> String) -> ([Error] -> ShowS) -> Show Error
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Error -> ShowS
showsPrec :: Int -> Error -> ShowS
$cshow :: Error -> String
show :: Error -> String
$cshowList :: [Error] -> ShowS
showList :: [Error] -> ShowS
GHC.Show.Show
        , Error -> Error -> Bool
(Error -> Error -> Bool) -> (Error -> Error -> Bool) -> Eq Error
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Error -> Error -> Bool
== :: Error -> Error -> Bool
$c/= :: Error -> Error -> Bool
/= :: Error -> Error -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON Error where
    toJSON :: Error -> Value
toJSON Error
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"message" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Error -> Maybe Text
errorMessage Error
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> ([ErrorParams] -> [Pair]) -> Maybe [ErrorParams] -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> ([ErrorParams] -> Pair) -> [ErrorParams] -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"params" Key -> [ErrorParams] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Error -> Maybe [ErrorParams]
errorParams Error
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (ErrorType -> [Pair]) -> Maybe ErrorType -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (ErrorType -> Pair) -> ErrorType -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"type" Key -> ErrorType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Error -> Maybe ErrorType
errorType Error
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: Error -> Encoding
toEncoding Error
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"message" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Error -> Maybe Text
errorMessage Error
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> ([ErrorParams] -> [Series]) -> Maybe [ErrorParams] -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> ([ErrorParams] -> Series) -> [ErrorParams] -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"params" Key -> [ErrorParams] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Error -> Maybe [ErrorParams]
errorParams Error
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (ErrorType -> [Series]) -> Maybe ErrorType -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (ErrorType -> Series) -> ErrorType -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"type" Key -> ErrorType -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Error -> Maybe ErrorType
errorType Error
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON Error where
    parseJSON :: Value -> Parser Error
parseJSON = String -> (Object -> Parser Error) -> Value -> Parser Error
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"Error" (\Object
obj -> (((Maybe Text -> Maybe [ErrorParams] -> Maybe ErrorType -> Error)
-> Parser
     (Maybe Text -> Maybe [ErrorParams] -> Maybe ErrorType -> Error)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text -> Maybe [ErrorParams] -> Maybe ErrorType -> Error
Error Parser
  (Maybe Text -> Maybe [ErrorParams] -> Maybe ErrorType -> Error)
-> Parser (Maybe Text)
-> Parser (Maybe [ErrorParams] -> Maybe ErrorType -> Error)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"message")) Parser (Maybe [ErrorParams] -> Maybe ErrorType -> Error)
-> Parser (Maybe [ErrorParams])
-> Parser (Maybe ErrorType -> Error)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe [ErrorParams])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"params")) Parser (Maybe ErrorType -> Error)
-> Parser (Maybe ErrorType) -> Parser Error
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe ErrorType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"type"))

-- | Create a new 'Error' with all required fields.
mkError :: Error
mkError :: Error
mkError =
    Error
        { errorMessage :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , errorParams :: Maybe [ErrorParams]
errorParams = Maybe [ErrorParams]
forall a. Maybe a
GHC.Maybe.Nothing
        , errorType :: Maybe ErrorType
errorType = Maybe ErrorType
forall a. Maybe a
GHC.Maybe.Nothing
        }

-- | Defines the object schema located at @components.schemas.Error.properties.params.items@ in the specification.
data ErrorParams = ErrorParams
    { ErrorParams -> Maybe Text
errorParamsParam :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ param
    }
    deriving
        ( Int -> ErrorParams -> ShowS
[ErrorParams] -> ShowS
ErrorParams -> String
(Int -> ErrorParams -> ShowS)
-> (ErrorParams -> String)
-> ([ErrorParams] -> ShowS)
-> Show ErrorParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ErrorParams -> ShowS
showsPrec :: Int -> ErrorParams -> ShowS
$cshow :: ErrorParams -> String
show :: ErrorParams -> String
$cshowList :: [ErrorParams] -> ShowS
showList :: [ErrorParams] -> ShowS
GHC.Show.Show
        , ErrorParams -> ErrorParams -> Bool
(ErrorParams -> ErrorParams -> Bool)
-> (ErrorParams -> ErrorParams -> Bool) -> Eq ErrorParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ErrorParams -> ErrorParams -> Bool
== :: ErrorParams -> ErrorParams -> Bool
$c/= :: ErrorParams -> ErrorParams -> Bool
/= :: ErrorParams -> ErrorParams -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON ErrorParams where
    toJSON :: ErrorParams -> Value
toJSON ErrorParams
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"param" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (ErrorParams -> Maybe Text
errorParamsParam ErrorParams
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: ErrorParams -> Encoding
toEncoding ErrorParams
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"param" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (ErrorParams -> Maybe Text
errorParamsParam ErrorParams
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON ErrorParams where
    parseJSON :: Value -> Parser ErrorParams
parseJSON = String
-> (Object -> Parser ErrorParams) -> Value -> Parser ErrorParams
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"ErrorParams" (\Object
obj -> (Maybe Text -> ErrorParams) -> Parser (Maybe Text -> ErrorParams)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text -> ErrorParams
ErrorParams Parser (Maybe Text -> ErrorParams)
-> Parser (Maybe Text) -> Parser ErrorParams
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"param"))

-- | Create a new 'ErrorParams' with all required fields.
mkErrorParams :: ErrorParams
mkErrorParams :: ErrorParams
mkErrorParams = ErrorParams{errorParamsParam :: Maybe Text
errorParamsParam = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing}

-- | Defines the enum schema located at @components.schemas.Error.properties.type@ in the specification.
data ErrorType
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      ErrorTypeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      ErrorTypeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"bad_request"@
      ErrorTypeEnumBad_request
    | -- | Represents the JSON value @"immutable_subscription"@
      ErrorTypeEnumImmutable_subscription
    | -- | Represents the JSON value @"internal_server_error"@
      ErrorTypeEnumInternal_server_error
    | -- | Represents the JSON value @"invalid_api_key"@
      ErrorTypeEnumInvalid_api_key
    | -- | Represents the JSON value @"invalid_api_version"@
      ErrorTypeEnumInvalid_api_version
    | -- | Represents the JSON value @"invalid_content_type"@
      ErrorTypeEnumInvalid_content_type
    | -- | Represents the JSON value @"invalid_permissions"@
      ErrorTypeEnumInvalid_permissions
    | -- | Represents the JSON value @"invalid_token"@
      ErrorTypeEnumInvalid_token
    | -- | Represents the JSON value @"missing_feature"@
      ErrorTypeEnumMissing_feature
    | -- | Represents the JSON value @"not_found"@
      ErrorTypeEnumNot_found
    | -- | Represents the JSON value @"rate_limited"@
      ErrorTypeEnumRate_limited
    | -- | Represents the JSON value @"service_not_available"@
      ErrorTypeEnumService_not_available
    | -- | Represents the JSON value @"simultaneous_request"@
      ErrorTypeEnumSimultaneous_request
    | -- | Represents the JSON value @"tax_service_error"@
      ErrorTypeEnumTax_service_error
    | -- | Represents the JSON value @"transaction"@
      ErrorTypeEnumTransaction
    | -- | Represents the JSON value @"unauthorized"@
      ErrorTypeEnumUnauthorized
    | -- | Represents the JSON value @"unavailable_in_api_version"@
      ErrorTypeEnumUnavailable_in_api_version
    | -- | Represents the JSON value @"unknown_api_version"@
      ErrorTypeEnumUnknown_api_version
    | -- | Represents the JSON value @"validation"@
      ErrorTypeEnumValidation
    deriving (Int -> ErrorType -> ShowS
[ErrorType] -> ShowS
ErrorType -> String
(Int -> ErrorType -> ShowS)
-> (ErrorType -> String)
-> ([ErrorType] -> ShowS)
-> Show ErrorType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ErrorType -> ShowS
showsPrec :: Int -> ErrorType -> ShowS
$cshow :: ErrorType -> String
show :: ErrorType -> String
$cshowList :: [ErrorType] -> ShowS
showList :: [ErrorType] -> ShowS
GHC.Show.Show, ErrorType -> ErrorType -> Bool
(ErrorType -> ErrorType -> Bool)
-> (ErrorType -> ErrorType -> Bool) -> Eq ErrorType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ErrorType -> ErrorType -> Bool
== :: ErrorType -> ErrorType -> Bool
$c/= :: ErrorType -> ErrorType -> Bool
/= :: ErrorType -> ErrorType -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON ErrorType where
    toJSON :: ErrorType -> Value
toJSON (ErrorTypeOther Value
val) = Value
val
    toJSON (ErrorTypeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (ErrorType
ErrorTypeEnumBad_request) = Value
"bad_request"
    toJSON (ErrorType
ErrorTypeEnumImmutable_subscription) = Value
"immutable_subscription"
    toJSON (ErrorType
ErrorTypeEnumInternal_server_error) = Value
"internal_server_error"
    toJSON (ErrorType
ErrorTypeEnumInvalid_api_key) = Value
"invalid_api_key"
    toJSON (ErrorType
ErrorTypeEnumInvalid_api_version) = Value
"invalid_api_version"
    toJSON (ErrorType
ErrorTypeEnumInvalid_content_type) = Value
"invalid_content_type"
    toJSON (ErrorType
ErrorTypeEnumInvalid_permissions) = Value
"invalid_permissions"
    toJSON (ErrorType
ErrorTypeEnumInvalid_token) = Value
"invalid_token"
    toJSON (ErrorType
ErrorTypeEnumMissing_feature) = Value
"missing_feature"
    toJSON (ErrorType
ErrorTypeEnumNot_found) = Value
"not_found"
    toJSON (ErrorType
ErrorTypeEnumRate_limited) = Value
"rate_limited"
    toJSON (ErrorType
ErrorTypeEnumService_not_available) = Value
"service_not_available"
    toJSON (ErrorType
ErrorTypeEnumSimultaneous_request) = Value
"simultaneous_request"
    toJSON (ErrorType
ErrorTypeEnumTax_service_error) = Value
"tax_service_error"
    toJSON (ErrorType
ErrorTypeEnumTransaction) = Value
"transaction"
    toJSON (ErrorType
ErrorTypeEnumUnauthorized) = Value
"unauthorized"
    toJSON (ErrorType
ErrorTypeEnumUnavailable_in_api_version) = Value
"unavailable_in_api_version"
    toJSON (ErrorType
ErrorTypeEnumUnknown_api_version) = Value
"unknown_api_version"
    toJSON (ErrorType
ErrorTypeEnumValidation) = Value
"validation"
instance Data.Aeson.Types.FromJSON.FromJSON ErrorType where
    parseJSON :: Value -> Parser ErrorType
parseJSON Value
val =
        ErrorType -> Parser ErrorType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"bad_request" -> ErrorType
ErrorTypeEnumBad_request
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"immutable_subscription" -> ErrorType
ErrorTypeEnumImmutable_subscription
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"internal_server_error" -> ErrorType
ErrorTypeEnumInternal_server_error
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"invalid_api_key" -> ErrorType
ErrorTypeEnumInvalid_api_key
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"invalid_api_version" -> ErrorType
ErrorTypeEnumInvalid_api_version
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"invalid_content_type" -> ErrorType
ErrorTypeEnumInvalid_content_type
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"invalid_permissions" -> ErrorType
ErrorTypeEnumInvalid_permissions
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"invalid_token" -> ErrorType
ErrorTypeEnumInvalid_token
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"missing_feature" -> ErrorType
ErrorTypeEnumMissing_feature
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"not_found" -> ErrorType
ErrorTypeEnumNot_found
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"rate_limited" -> ErrorType
ErrorTypeEnumRate_limited
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"service_not_available" -> ErrorType
ErrorTypeEnumService_not_available
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"simultaneous_request" -> ErrorType
ErrorTypeEnumSimultaneous_request
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"tax_service_error" -> ErrorType
ErrorTypeEnumTax_service_error
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"transaction" -> ErrorType
ErrorTypeEnumTransaction
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"unauthorized" -> ErrorType
ErrorTypeEnumUnauthorized
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"unavailable_in_api_version" -> ErrorType
ErrorTypeEnumUnavailable_in_api_version
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"unknown_api_version" -> ErrorType
ErrorTypeEnumUnknown_api_version
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"validation" -> ErrorType
ErrorTypeEnumValidation
                | Bool
GHC.Base.otherwise -> Value -> ErrorType
ErrorTypeOther Value
val
            )