"""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 EnvelopeAttachmentDeleteRequestTypedDict(TypedDict):
    id: str


class EnvelopeAttachmentDeleteRequest(BaseModel):
    id: str


class EnvelopeAttachmentDeleteInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class EnvelopeAttachmentDeleteInternalServerErrorIssue(BaseModel):
    message: str


class EnvelopeAttachmentDeleteInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeAttachmentDeleteInternalServerErrorIssue]] = None


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

    data: EnvelopeAttachmentDeleteInternalServerErrorData = field(hash=False)

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


class EnvelopeAttachmentDeleteForbiddenIssue(BaseModel):
    message: str


class EnvelopeAttachmentDeleteForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeAttachmentDeleteForbiddenIssue]] = None


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

    data: EnvelopeAttachmentDeleteForbiddenErrorData = field(hash=False)

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


class EnvelopeAttachmentDeleteUnauthorizedIssue(BaseModel):
    message: str


class EnvelopeAttachmentDeleteUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeAttachmentDeleteUnauthorizedIssue]] = None


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

    data: EnvelopeAttachmentDeleteUnauthorizedErrorData = field(hash=False)

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


class EnvelopeAttachmentDeleteBadRequestIssue(BaseModel):
    message: str


class EnvelopeAttachmentDeleteBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeAttachmentDeleteBadRequestIssue]] = None


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

    data: EnvelopeAttachmentDeleteBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
