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

from __future__ import annotations
from acuvity import utils
from acuvity.types import BaseModel
from typing import Optional
from typing_extensions import TypedDict


class DataTypedDict(TypedDict):
    r"""Additional error data"""


class Data(BaseModel):
    r"""Additional error data"""


class ElementalerrorData(BaseModel):
    code: Optional[int] = None
    r"""Error code"""

    data: Optional[Data] = None
    r"""Additional error data"""

    description: Optional[str] = None
    r"""Error description"""

    subject: Optional[str] = None
    r"""Error subject"""

    title: Optional[str] = None
    r"""Error title"""

    trace: Optional[str] = None
    r"""Error trace"""


class Elementalerror(Exception):
    data: ElementalerrorData

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

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