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

from __future__ import annotations
from dataclasses import dataclass, field
from documenso_sdk.models import DocumensoError
from documenso_sdk.types import BaseModel
import httpx
import pydantic
from typing import List, Optional
from typing_extensions import Annotated, TypedDict


class DocumentDuplicateRequestTypedDict(TypedDict):
    document_id: float


class DocumentDuplicateRequest(BaseModel):
    document_id: Annotated[float, pydantic.Field(alias="documentId")]


class DocumentDuplicateInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class DocumentDuplicateInternalServerErrorIssue(BaseModel):
    message: str


class DocumentDuplicateInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentDuplicateInternalServerErrorIssue]] = None


@dataclass(unsafe_hash=True)
class DocumentDuplicateInternalServerError(DocumensoError):
    r"""Internal server error"""

    data: DocumentDuplicateInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: DocumentDuplicateInternalServerErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        fallback = body or raw_response.text
        message = str(data.message) or fallback
        super().__init__(message, raw_response, body)
        object.__setattr__(self, "data", data)


class DocumentDuplicateForbiddenIssueTypedDict(TypedDict):
    message: str


class DocumentDuplicateForbiddenIssue(BaseModel):
    message: str


class DocumentDuplicateForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentDuplicateForbiddenIssue]] = None


@dataclass(unsafe_hash=True)
class DocumentDuplicateForbiddenError(DocumensoError):
    r"""Insufficient access"""

    data: DocumentDuplicateForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: DocumentDuplicateForbiddenErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        fallback = body or raw_response.text
        message = str(data.message) or fallback
        super().__init__(message, raw_response, body)
        object.__setattr__(self, "data", data)


class DocumentDuplicateUnauthorizedIssueTypedDict(TypedDict):
    message: str


class DocumentDuplicateUnauthorizedIssue(BaseModel):
    message: str


class DocumentDuplicateUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentDuplicateUnauthorizedIssue]] = None


@dataclass(unsafe_hash=True)
class DocumentDuplicateUnauthorizedError(DocumensoError):
    r"""Authorization not provided"""

    data: DocumentDuplicateUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: DocumentDuplicateUnauthorizedErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        fallback = body or raw_response.text
        message = str(data.message) or fallback
        super().__init__(message, raw_response, body)
        object.__setattr__(self, "data", data)


class DocumentDuplicateBadRequestIssueTypedDict(TypedDict):
    message: str


class DocumentDuplicateBadRequestIssue(BaseModel):
    message: str


class DocumentDuplicateBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentDuplicateBadRequestIssue]] = None


@dataclass(unsafe_hash=True)
class DocumentDuplicateBadRequestError(DocumensoError):
    r"""Invalid input data"""

    data: DocumentDuplicateBadRequestErrorData = field(hash=False)

    def __init__(
        self,
        data: DocumentDuplicateBadRequestErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        fallback = body or raw_response.text
        message = str(data.message) or fallback
        super().__init__(message, raw_response, body)
        object.__setattr__(self, "data", data)


class DocumentDuplicateResponseTypedDict(TypedDict):
    r"""Successful response"""

    id: str
    document_id: float


class DocumentDuplicateResponse(BaseModel):
    r"""Successful response"""

    id: str

    document_id: Annotated[float, pydantic.Field(alias="documentId")]
