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

from __future__ import annotations
from dataclasses import dataclass, field
import httpx
from owasp_nest.models import NestError
from owasp_nest.types import BaseModel
from typing import Optional


class SnapshotErrorData(BaseModel):
    message: str


@dataclass(unsafe_hash=True)
class SnapshotError(NestError):
    r"""Snapshot error schema."""

    data: SnapshotErrorData = field(hash=False)

    def __init__(
        self,
        data: SnapshotErrorData,
        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)
        object.__setattr__(self, "data", data)
