# generated by datamodel-codegen:
#   filename:  errors.yaml

from __future__ import annotations

from typing import Annotated, Any, Dict, List

from pendulum import DateTime
from pydantic import AnyUrl, Field
from pydantic_extra_types.pendulum_dt import Date, DateTime

from ..v2 import MyErrorsBaseModel


class ErrorDetail(MyErrorsBaseModel):
    title: str
    """
    The title of the error.
    """
    detail: str
    """
    A short description about the error.
    """
    type: AnyUrl
    """
    A link to the developer hub where more information can be found for the encountered error.
    """
    field_meta: Annotated[Dict[str, Any], Field(alias="_meta")]
    """
    Has additional fields.
    """


class RequestError(MyErrorsBaseModel):
    personio_trace_id: str
    """
    A unique ID that was created for this error.
    """
    timestamp: DateTime
    """
    The timestamp of when the error occurred.
    """
    errors: List[ErrorDetail]
