"""Gathers and names websocket close codes (Websocket ref: https://datatracker.ietf.org/doc/html/rfc6455)."""
import enum

import websocket


class WSCloseCode(enum.IntEnum):
    NORMAL = websocket.STATUS_NORMAL
    GOING_AWAY = websocket.STATUS_GOING_AWAY
    PROTOCOL_ERROR = websocket.STATUS_PROTOCOL_ERROR
    UNSUPPORTED_DATA_TYPE = websocket.STATUS_UNSUPPORTED_DATA_TYPE
    STATUS_NOT_AVAILABLE = websocket.STATUS_STATUS_NOT_AVAILABLE
    ABNORMAL_CLOSURE = websocket.STATUS_ABNORMAL_CLOSED
    INVALID_PAYLOAD = websocket.STATUS_INVALID_PAYLOAD
    POLICY_VIOLATION = websocket.STATUS_POLICY_VIOLATION
    MESSAGE_TOO_BIG = websocket.STATUS_MESSAGE_TOO_BIG
    INVALID_EXTENSION = websocket.STATUS_INVALID_EXTENSION
    UNEXPECTED_CONDITION = websocket.STATUS_UNEXPECTED_CONDITION
    SERVICE_RESTART = 1012
    TRY_AGAIN_LATER = 1013
    BAD_GATEWAY = websocket.STATUS_BAD_GATEWAY
    TLS_HANDSHAKE_ERROR = websocket.STATUS_TLS_HANDSHAKE_ERROR
    UNAUTHORIZED = 3000
    FORBIDDEN = 3003
    TIMEOUT = 3008
