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

from __future__ import annotations
from opperai import utils
from opperai.types import BaseModel
from typing import Any, Optional


class RequestValidationErrorData(BaseModel):
    detail: Any
    r"""Where the error occurred and the error message"""

    type: Optional[str] = "RequestValidationError"

    message: Optional[str] = "The request is invalid"


class RequestValidationError(Exception):
    data: RequestValidationErrorData

    def __init__(self, data: RequestValidationErrorData):
        self.data = data

    def __str__(self) -> str:
        return utils.marshal_json(self.data, RequestValidationErrorData)
