"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
import httpx
from supertone.errors import SupertoneError
from supertone.models import (
    toomanyrequestserrorresponse as models_toomanyrequestserrorresponse,
)
from supertone.types import BaseModel
from typing import Optional


class TooManyRequestsErrorResponseData(BaseModel):
    status: str
    r"""Response status"""

    message: models_toomanyrequestserrorresponse.TooManyRequestsErrorResponseMessage
    r"""Too many requests error details"""


class TooManyRequestsErrorResponse(SupertoneError):
    data: TooManyRequestsErrorResponseData

    def __init__(
        self,
        data: TooManyRequestsErrorResponseData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        message = body or raw_response.text
        super().__init__(message, raw_response, body)
        self.data = data
