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

from __future__ import annotations
from abbyy_document_ai import utils
from abbyy_document_ai.types import BaseModel
from typing import Optional


class PaymentRequiredErrorData(BaseModel):
    type: str
    r"""A URI reference that identifies the problem type."""

    title: str
    r"""A short, human-readable summary of the problem type."""

    status: float
    r"""The HTTP status code generated by the origin server for this occurrence of the problem."""

    detail: str
    r"""A human-readable explanation specific to this occurrence of the problem."""

    instance: Optional[str] = None
    r"""The URI that identifies the specific occurrence of the problem."""


class PaymentRequiredError(Exception):
    r"""The error returned when request limits have been reached."""

    data: PaymentRequiredErrorData

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

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