"""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_target_identifier_attributes_attribute_statuses_status_op as models_patch_v2_target_identifier_attributes_attribute_statuses_status_op,
)
from attio.types import BaseModel
from dataclasses import dataclass, field
import httpx
from typing import Optional


class PatchV2TargetIdentifierAttributesAttributeStatusesStatusSlugConflictErrorData(
    BaseModel
):
    status_code: float

    type: models_patch_v2_target_identifier_attributes_attribute_statuses_status_op.PatchV2TargetIdentifierAttributesAttributeStatusesStatusConflictType

    code: models_patch_v2_target_identifier_attributes_attribute_statuses_status_op.PatchV2TargetIdentifierAttributesAttributeStatusesStatusConflictCode

    message: str


@dataclass(frozen=True)
class PatchV2TargetIdentifierAttributesAttributeStatusesStatusSlugConflictError(
    AttioError
):
    r"""Conflict"""

    data: PatchV2TargetIdentifierAttributesAttributeStatusesStatusSlugConflictErrorData = field(
        hash=False
    )

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

    type: models_patch_v2_target_identifier_attributes_attribute_statuses_status_op.PatchV2TargetIdentifierAttributesAttributeStatusesStatusNotFoundType

    code: models_patch_v2_target_identifier_attributes_attribute_statuses_status_op.PatchV2TargetIdentifierAttributesAttributeStatusesStatusNotFoundCode

    message: str


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

    data: PatchV2TargetIdentifierAttributesAttributeStatusesStatusNotFoundErrorData = (
        field(hash=False)
    )

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

    type: models_patch_v2_target_identifier_attributes_attribute_statuses_status_op.PatchV2TargetIdentifierAttributesAttributeStatusesStatusBadRequestType

    code: models_patch_v2_target_identifier_attributes_attribute_statuses_status_op.PatchV2TargetIdentifierAttributesAttributeStatusesStatusCodeValueNotFound

    message: str


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

    data: PatchV2TargetIdentifierAttributesAttributeStatusesStatusValueNotFoundErrorData = field(
        hash=False
    )

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