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


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


class FieldDeleteDocumentFieldInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class FieldDeleteDocumentFieldInternalServerErrorIssue(BaseModel):
    message: str


class FieldDeleteDocumentFieldInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldDeleteDocumentFieldInternalServerErrorIssue]] = None


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

    data: FieldDeleteDocumentFieldInternalServerErrorData = field(hash=False)

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


class FieldDeleteDocumentFieldForbiddenIssue(BaseModel):
    message: str


class FieldDeleteDocumentFieldForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldDeleteDocumentFieldForbiddenIssue]] = None


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

    data: FieldDeleteDocumentFieldForbiddenErrorData = field(hash=False)

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


class FieldDeleteDocumentFieldUnauthorizedIssue(BaseModel):
    message: str


class FieldDeleteDocumentFieldUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldDeleteDocumentFieldUnauthorizedIssue]] = None


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

    data: FieldDeleteDocumentFieldUnauthorizedErrorData = field(hash=False)

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


class FieldDeleteDocumentFieldBadRequestIssue(BaseModel):
    message: str


class FieldDeleteDocumentFieldBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldDeleteDocumentFieldBadRequestIssue]] = None


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

    data: FieldDeleteDocumentFieldBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
