"""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 EnvelopeItemDeleteRequestTypedDict(TypedDict):
    envelope_id: str
    envelope_item_id: str


class EnvelopeItemDeleteRequest(BaseModel):
    envelope_id: Annotated[str, pydantic.Field(alias="envelopeId")]

    envelope_item_id: Annotated[str, pydantic.Field(alias="envelopeItemId")]


class EnvelopeItemDeleteInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class EnvelopeItemDeleteInternalServerErrorIssue(BaseModel):
    message: str


class EnvelopeItemDeleteInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeItemDeleteInternalServerErrorIssue]] = None


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

    data: EnvelopeItemDeleteInternalServerErrorData = field(hash=False)

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


class EnvelopeItemDeleteForbiddenIssue(BaseModel):
    message: str


class EnvelopeItemDeleteForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeItemDeleteForbiddenIssue]] = None


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

    data: EnvelopeItemDeleteForbiddenErrorData = field(hash=False)

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


class EnvelopeItemDeleteUnauthorizedIssue(BaseModel):
    message: str


class EnvelopeItemDeleteUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeItemDeleteUnauthorizedIssue]] = None


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

    data: EnvelopeItemDeleteUnauthorizedErrorData = field(hash=False)

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


class EnvelopeItemDeleteBadRequestIssue(BaseModel):
    message: str


class EnvelopeItemDeleteBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeItemDeleteBadRequestIssue]] = None


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

    data: EnvelopeItemDeleteBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
