"""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 DocumentAttachmentCreateDataTypedDict(TypedDict):
    label: str
    data: str


class DocumentAttachmentCreateData(BaseModel):
    label: str

    data: str


class DocumentAttachmentCreateRequestTypedDict(TypedDict):
    document_id: float
    data: DocumentAttachmentCreateDataTypedDict


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

    data: DocumentAttachmentCreateData


class DocumentAttachmentCreateInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class DocumentAttachmentCreateInternalServerErrorIssue(BaseModel):
    message: str


class DocumentAttachmentCreateInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentAttachmentCreateInternalServerErrorIssue]] = None


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

    data: DocumentAttachmentCreateInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: DocumentAttachmentCreateInternalServerErrorData,
        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 DocumentAttachmentCreateForbiddenIssueTypedDict(TypedDict):
    message: str


class DocumentAttachmentCreateForbiddenIssue(BaseModel):
    message: str


class DocumentAttachmentCreateForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentAttachmentCreateForbiddenIssue]] = None


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

    data: DocumentAttachmentCreateForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: DocumentAttachmentCreateForbiddenErrorData,
        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 DocumentAttachmentCreateUnauthorizedIssueTypedDict(TypedDict):
    message: str


class DocumentAttachmentCreateUnauthorizedIssue(BaseModel):
    message: str


class DocumentAttachmentCreateUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentAttachmentCreateUnauthorizedIssue]] = None


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

    data: DocumentAttachmentCreateUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: DocumentAttachmentCreateUnauthorizedErrorData,
        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 DocumentAttachmentCreateBadRequestIssueTypedDict(TypedDict):
    message: str


class DocumentAttachmentCreateBadRequestIssue(BaseModel):
    message: str


class DocumentAttachmentCreateBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentAttachmentCreateBadRequestIssue]] = None


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

    data: DocumentAttachmentCreateBadRequestErrorData = field(hash=False)

    def __init__(
        self,
        data: DocumentAttachmentCreateBadRequestErrorData,
        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 DocumentAttachmentCreateResponseTypedDict(TypedDict):
    r"""Successful response"""

    id: str


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

    id: str
