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

from __future__ import annotations
import httpx
from owasp_nest.models import NestError
from owasp_nest.types import BaseModel
from typing import Optional


class ChapterErrorResponseData(BaseModel):
    message: str


class ChapterErrorResponse(NestError):
    r"""Chapter error response schema."""

    data: ChapterErrorResponseData

    def __init__(
        self,
        data: ChapterErrorResponseData,
        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
