"""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
from typing import List, Optional
from typing_extensions import TypedDict


class DocumentAttachmentUpdateDataTypedDict(TypedDict):
    label: str
    data: str


class DocumentAttachmentUpdateData(BaseModel):
    label: str

    data: str


class DocumentAttachmentUpdateRequestTypedDict(TypedDict):
    id: str
    data: DocumentAttachmentUpdateDataTypedDict


class DocumentAttachmentUpdateRequest(BaseModel):
    id: str

    data: DocumentAttachmentUpdateData


class DocumentAttachmentUpdateInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class DocumentAttachmentUpdateInternalServerErrorIssue(BaseModel):
    message: str


class DocumentAttachmentUpdateInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentAttachmentUpdateInternalServerErrorIssue]] = None


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

    data: DocumentAttachmentUpdateInternalServerErrorData = field(hash=False)

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


class DocumentAttachmentUpdateForbiddenIssue(BaseModel):
    message: str


class DocumentAttachmentUpdateForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentAttachmentUpdateForbiddenIssue]] = None


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

    data: DocumentAttachmentUpdateForbiddenErrorData = field(hash=False)

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


class DocumentAttachmentUpdateUnauthorizedIssue(BaseModel):
    message: str


class DocumentAttachmentUpdateUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentAttachmentUpdateUnauthorizedIssue]] = None


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

    data: DocumentAttachmentUpdateUnauthorizedErrorData = field(hash=False)

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


class DocumentAttachmentUpdateBadRequestIssue(BaseModel):
    message: str


class DocumentAttachmentUpdateBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentAttachmentUpdateBadRequestIssue]] = None


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

    data: DocumentAttachmentUpdateBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
