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

from __future__ import annotations
from dataclasses import dataclass, field
import httpx
from moovio_sdk.models.components import (
    amountdecimalvalidationerror as components_amountdecimalvalidationerror,
    assignproductimagevalidationerror as components_assignproductimagevalidationerror,
    productoptiongroupvalidationerror as components_productoptiongroupvalidationerror,
)
from moovio_sdk.models.errors import MoovError
from moovio_sdk.types import BaseModel
import pydantic
from typing import Dict, Optional
from typing_extensions import Annotated


class ProductRequestValidationErrorData(BaseModel):
    title: Optional[str] = None
    description: Optional[str] = None
    base_price: Annotated[
        Optional[components_amountdecimalvalidationerror.AmountDecimalValidationError],
        pydantic.Field(alias="basePrice"),
    ] = None
    images: Optional[
        Dict[
            str,
            components_assignproductimagevalidationerror.AssignProductImageValidationError,
        ]
    ] = None
    option_groups: Annotated[
        Optional[
            Dict[
                str,
                components_productoptiongroupvalidationerror.ProductOptionGroupValidationError,
            ]
        ],
        pydantic.Field(alias="optionGroups"),
    ] = None


@dataclass(unsafe_hash=True)
class ProductRequestValidationError(MoovError):
    data: ProductRequestValidationErrorData = field(hash=False)

    def __init__(
        self,
        data: ProductRequestValidationErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        message = body or raw_response.text
        super().__init__(message, raw_response, body)
        object.__setattr__(self, "data", data)
