"""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_forbidden as models_error_forbidden
from tofupilot.v2.types import BaseModel
from typing import List, Optional


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

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

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


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

    data: ErrorFORBIDDENData

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

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