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

from __future__ import annotations
from attio.errors import AttioError
from attio.models import patch_v2_lists_list_op as models_patch_v2_lists_list_op
from attio.types import BaseModel
from dataclasses import dataclass, field
import httpx
from typing import Optional


class PatchV2ListsListNotFoundErrorData(BaseModel):
    status_code: float

    type: models_patch_v2_lists_list_op.PatchV2ListsListNotFoundType

    code: models_patch_v2_lists_list_op.PatchV2ListsListNotFoundCode

    message: str


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

    data: PatchV2ListsListNotFoundErrorData = field(hash=False)

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

    type: models_patch_v2_lists_list_op.PatchV2ListsListBadRequestType

    code: models_patch_v2_lists_list_op.PatchV2ListsListCodeValueNotFound

    message: str


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

    data: PatchV2ListsListValueNotFoundErrorData = field(hash=False)

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