# coding: utf-8

"""
    Coinbase Developer Platform APIs

    The Coinbase Developer Platform APIs - leading the world's transition onchain.

    The version of the OpenAPI document: 2.0.0
    Contact: cdp@coinbase.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self


class ErrorType(str, Enum):
    """
    The code that indicates the type of error that occurred. These error codes can be used to determine how to handle the error.
    """

    """
    allowed enum values
    """
    ALREADY_EXISTS = 'already_exists'
    BAD_GATEWAY = 'bad_gateway'
    FAUCET_LIMIT_EXCEEDED = 'faucet_limit_exceeded'
    FORBIDDEN = 'forbidden'
    IDEMPOTENCY_ERROR = 'idempotency_error'
    INTERNAL_SERVER_ERROR = 'internal_server_error'
    INVALID_REQUEST = 'invalid_request'
    INVALID_SIGNATURE = 'invalid_signature'
    MALFORMED_TRANSACTION = 'malformed_transaction'
    NOT_FOUND = 'not_found'
    RATE_LIMIT_EXCEEDED = 'rate_limit_exceeded'
    REQUEST_CANCELED = 'request_canceled'
    SERVICE_UNAVAILABLE = 'service_unavailable'
    TIMED_OUT = 'timed_out'
    UNAUTHORIZED = 'unauthorized'
    POLICY_VIOLATION = 'policy_violation'
    POLICY_IN_USE = 'policy_in_use'

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Create an instance of ErrorType from a JSON string"""
        return cls(json.loads(json_str))


