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

from __future__ import annotations
import httpx
from supertone.errors import SupertoneError
from supertone.types import BaseModel
from typing import Optional


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

    message: str
    r"""Unsupported media type error message"""


class UnsupportedMediaTypeErrorResponse(SupertoneError):
    data: UnsupportedMediaTypeErrorResponseData

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