"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from attio.errors import AttioError
from attio.models import (
    put_v2_lists_list_entries_entry_id_op as models_put_v2_lists_list_entries_entry_id_op,
)
from attio.types import BaseModel
from dataclasses import dataclass, field
import httpx
from typing import Optional


class PutV2ListsListEntriesEntryIDNotFoundErrorData(BaseModel):
    status_code: float

    type: models_put_v2_lists_list_entries_entry_id_op.PutV2ListsListEntriesEntryIDNotFoundType

    code: models_put_v2_lists_list_entries_entry_id_op.PutV2ListsListEntriesEntryIDNotFoundCode

    message: str


@dataclass(frozen=True)
class PutV2ListsListEntriesEntryIDNotFoundError(AttioError):
    r"""Not Found"""

    data: PutV2ListsListEntriesEntryIDNotFoundErrorData = field(hash=False)

    def __init__(
        self,
        data: PutV2ListsListEntriesEntryIDNotFoundErrorData,
        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 PutV2ListsListEntriesEntryIDImmutableValueErrorData(BaseModel):
    status_code: float

    type: models_put_v2_lists_list_entries_entry_id_op.PutV2ListsListEntriesEntryIDBadRequestType

    code: models_put_v2_lists_list_entries_entry_id_op.PutV2ListsListEntriesEntryIDCodeImmutableValue

    message: str


@dataclass(frozen=True)
class PutV2ListsListEntriesEntryIDImmutableValueError(AttioError):
    r"""Bad Request"""

    data: PutV2ListsListEntriesEntryIDImmutableValueErrorData = field(hash=False)

    def __init__(
        self,
        data: PutV2ListsListEntriesEntryIDImmutableValueErrorData,
        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)
