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

from __future__ import annotations
import httpx
from ship24.errors import Ship24Error
from ship24.models import error_response_format as models_error_response_format
from ship24.types import BaseModel, OptionalNullable, UNSET
from typing import List, Optional


class ErrorResponseFormatData(BaseModel):
    errors: Optional[List[models_error_response_format.ErrorResponseFormatError]] = None

    data: OptionalNullable[models_error_response_format.ErrorResponseFormatData] = UNSET


class ErrorResponseFormat(Ship24Error):
    data: ErrorResponseFormatData

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