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

from __future__ import annotations
from tofupilot.v2 import utils
from tofupilot.v2.models import error_bad_request as models_error_bad_request
from tofupilot.v2.types import BaseModel
from typing import List, Optional


class ErrorBADREQUESTData(BaseModel):
    message: str
    r"""The error message"""

    code: str
    r"""The error code"""

    issues: Optional[List[models_error_bad_request.ErrorBADREQUESTIssue]] = None
    r"""An array of issues that were responsible for the error"""


class ErrorBADREQUEST(Exception):
    r"""The error information"""

    data: ErrorBADREQUESTData

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

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