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


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


class FieldDeleteTemplateFieldInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class FieldDeleteTemplateFieldInternalServerErrorIssue(BaseModel):
    message: str


class FieldDeleteTemplateFieldInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldDeleteTemplateFieldInternalServerErrorIssue]] = None


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

    data: FieldDeleteTemplateFieldInternalServerErrorData = field(hash=False)

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


class FieldDeleteTemplateFieldForbiddenIssue(BaseModel):
    message: str


class FieldDeleteTemplateFieldForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldDeleteTemplateFieldForbiddenIssue]] = None


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

    data: FieldDeleteTemplateFieldForbiddenErrorData = field(hash=False)

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


class FieldDeleteTemplateFieldUnauthorizedIssue(BaseModel):
    message: str


class FieldDeleteTemplateFieldUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldDeleteTemplateFieldUnauthorizedIssue]] = None


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

    data: FieldDeleteTemplateFieldUnauthorizedErrorData = field(hash=False)

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


class FieldDeleteTemplateFieldBadRequestIssue(BaseModel):
    message: str


class FieldDeleteTemplateFieldBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldDeleteTemplateFieldBadRequestIssue]] = None


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

    data: FieldDeleteTemplateFieldBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
