"""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, NotRequired, TypedDict


class EmbeddingPresignCreateEmbeddingPresignTokenRequestTypedDict(TypedDict):
    expires_in: NotRequired[float]


class EmbeddingPresignCreateEmbeddingPresignTokenRequest(BaseModel):
    expires_in: Annotated[Optional[float], pydantic.Field(alias="expiresIn")] = 60


class EmbeddingPresignCreateEmbeddingPresignTokenInternalServerErrorIssueTypedDict(
    TypedDict
):
    message: str


class EmbeddingPresignCreateEmbeddingPresignTokenInternalServerErrorIssue(BaseModel):
    message: str


class EmbeddingPresignCreateEmbeddingPresignTokenInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[
        List[EmbeddingPresignCreateEmbeddingPresignTokenInternalServerErrorIssue]
    ] = None


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

    data: EmbeddingPresignCreateEmbeddingPresignTokenInternalServerErrorData = field(
        hash=False
    )

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


class EmbeddingPresignCreateEmbeddingPresignTokenForbiddenIssue(BaseModel):
    message: str


class EmbeddingPresignCreateEmbeddingPresignTokenForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[
        List[EmbeddingPresignCreateEmbeddingPresignTokenForbiddenIssue]
    ] = None


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

    data: EmbeddingPresignCreateEmbeddingPresignTokenForbiddenErrorData = field(
        hash=False
    )

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


class EmbeddingPresignCreateEmbeddingPresignTokenUnauthorizedIssue(BaseModel):
    message: str


class EmbeddingPresignCreateEmbeddingPresignTokenUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[
        List[EmbeddingPresignCreateEmbeddingPresignTokenUnauthorizedIssue]
    ] = None


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

    data: EmbeddingPresignCreateEmbeddingPresignTokenUnauthorizedErrorData = field(
        hash=False
    )

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


class EmbeddingPresignCreateEmbeddingPresignTokenBadRequestIssue(BaseModel):
    message: str


class EmbeddingPresignCreateEmbeddingPresignTokenBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[
        List[EmbeddingPresignCreateEmbeddingPresignTokenBadRequestIssue]
    ] = None


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

    data: EmbeddingPresignCreateEmbeddingPresignTokenBadRequestErrorData = field(
        hash=False
    )

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

    token: str
    expires_at: str
    expires_in: float


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

    token: str

    expires_at: Annotated[str, pydantic.Field(alias="expiresAt")]

    expires_in: Annotated[float, pydantic.Field(alias="expiresIn")]
