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

from __future__ import annotations
from attio.errors import SDKError
from attio.models import (
    patch_v2_target_identifier_attributes_attribute_options_option_op as models_patch_v2_target_identifier_attributes_attribute_options_option_op,
)
from attio.types import BaseModel
from dataclasses import dataclass, field
import httpx
from typing import Optional


class PatchV2TargetIdentifierAttributesAttributeOptionsOptionSlugConflictErrorData(
    BaseModel
):
    status_code: float
    type: models_patch_v2_target_identifier_attributes_attribute_options_option_op.PatchV2TargetIdentifierAttributesAttributeOptionsOptionConflictType
    code: models_patch_v2_target_identifier_attributes_attribute_options_option_op.PatchV2TargetIdentifierAttributesAttributeOptionsOptionConflictCode
    message: str


@dataclass(unsafe_hash=True)
class PatchV2TargetIdentifierAttributesAttributeOptionsOptionSlugConflictError(
    SDKError
):
    r"""Conflict"""

    data: PatchV2TargetIdentifierAttributesAttributeOptionsOptionSlugConflictErrorData = field(
        hash=False
    )

    def __init__(
        self,
        data: PatchV2TargetIdentifierAttributesAttributeOptionsOptionSlugConflictErrorData,
        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 PatchV2TargetIdentifierAttributesAttributeOptionsOptionNotFoundErrorData(
    BaseModel
):
    status_code: float
    type: models_patch_v2_target_identifier_attributes_attribute_options_option_op.PatchV2TargetIdentifierAttributesAttributeOptionsOptionNotFoundType
    code: models_patch_v2_target_identifier_attributes_attribute_options_option_op.PatchV2TargetIdentifierAttributesAttributeOptionsOptionNotFoundCode
    message: str


@dataclass(unsafe_hash=True)
class PatchV2TargetIdentifierAttributesAttributeOptionsOptionNotFoundError(SDKError):
    r"""Not Found"""

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

    def __init__(
        self,
        data: PatchV2TargetIdentifierAttributesAttributeOptionsOptionNotFoundErrorData,
        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 PatchV2TargetIdentifierAttributesAttributeOptionsOptionValueNotFoundErrorData(
    BaseModel
):
    status_code: float
    type: models_patch_v2_target_identifier_attributes_attribute_options_option_op.PatchV2TargetIdentifierAttributesAttributeOptionsOptionBadRequestType
    code: models_patch_v2_target_identifier_attributes_attribute_options_option_op.PatchV2TargetIdentifierAttributesAttributeOptionsOptionCodeValueNotFound
    message: str


@dataclass(unsafe_hash=True)
class PatchV2TargetIdentifierAttributesAttributeOptionsOptionValueNotFoundError(
    SDKError
):
    r"""Bad Request"""

    data: PatchV2TargetIdentifierAttributesAttributeOptionsOptionValueNotFoundErrorData = field(
        hash=False
    )

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