"""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 EnvelopeFieldDeleteRequestTypedDict(TypedDict):
    field_id: float


class EnvelopeFieldDeleteRequest(BaseModel):
    field_id: Annotated[float, pydantic.Field(alias="fieldId")]


class EnvelopeFieldDeleteInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class EnvelopeFieldDeleteInternalServerErrorIssue(BaseModel):
    message: str


class EnvelopeFieldDeleteInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeFieldDeleteInternalServerErrorIssue]] = None


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

    data: EnvelopeFieldDeleteInternalServerErrorData = field(hash=False)

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


class EnvelopeFieldDeleteForbiddenIssue(BaseModel):
    message: str


class EnvelopeFieldDeleteForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeFieldDeleteForbiddenIssue]] = None


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

    data: EnvelopeFieldDeleteForbiddenErrorData = field(hash=False)

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


class EnvelopeFieldDeleteUnauthorizedIssue(BaseModel):
    message: str


class EnvelopeFieldDeleteUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeFieldDeleteUnauthorizedIssue]] = None


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

    data: EnvelopeFieldDeleteUnauthorizedErrorData = field(hash=False)

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


class EnvelopeFieldDeleteBadRequestIssue(BaseModel):
    message: str


class EnvelopeFieldDeleteBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeFieldDeleteBadRequestIssue]] = None


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

    data: EnvelopeFieldDeleteBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
