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


class EnvelopeAttachmentUpdateData(BaseModel):
    label: str

    data: str


class EnvelopeAttachmentUpdateRequestTypedDict(TypedDict):
    id: str
    data: EnvelopeAttachmentUpdateDataTypedDict


class EnvelopeAttachmentUpdateRequest(BaseModel):
    id: str

    data: EnvelopeAttachmentUpdateData


class EnvelopeAttachmentUpdateInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class EnvelopeAttachmentUpdateInternalServerErrorIssue(BaseModel):
    message: str


class EnvelopeAttachmentUpdateInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeAttachmentUpdateInternalServerErrorIssue]] = None


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

    data: EnvelopeAttachmentUpdateInternalServerErrorData = field(hash=False)

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


class EnvelopeAttachmentUpdateForbiddenIssue(BaseModel):
    message: str


class EnvelopeAttachmentUpdateForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeAttachmentUpdateForbiddenIssue]] = None


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

    data: EnvelopeAttachmentUpdateForbiddenErrorData = field(hash=False)

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


class EnvelopeAttachmentUpdateUnauthorizedIssue(BaseModel):
    message: str


class EnvelopeAttachmentUpdateUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeAttachmentUpdateUnauthorizedIssue]] = None


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

    data: EnvelopeAttachmentUpdateUnauthorizedErrorData = field(hash=False)

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


class EnvelopeAttachmentUpdateBadRequestIssue(BaseModel):
    message: str


class EnvelopeAttachmentUpdateBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeAttachmentUpdateBadRequestIssue]] = None


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

    data: EnvelopeAttachmentUpdateBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
