"""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 (
    createaccountsettings as components_createaccountsettings,
    createprofileerror as components_createprofileerror,
    customersupporterror as components_customersupporterror,
    termsofserviceerror as components_termsofserviceerror,
)
from moovio_sdk.models.errors import MoovError
from moovio_sdk.types import BaseModel
import pydantic
from typing import Optional
from typing_extensions import Annotated


class PatchAccountErrorData(BaseModel):
    profile: Optional[components_createprofileerror.CreateProfileError] = None
    metadata: Optional[str] = None
    terms_of_service: Annotated[
        Optional[components_termsofserviceerror.TermsOfServiceError],
        pydantic.Field(alias="termsOfService"),
    ] = None
    foreign_id: Annotated[Optional[str], pydantic.Field(alias="foreignID")] = None
    customer_support: Annotated[
        Optional[components_customersupporterror.CustomerSupportError],
        pydantic.Field(alias="customerSupport"),
    ] = None
    settings: Optional[components_createaccountsettings.CreateAccountSettings] = None
    error: Optional[str] = None


@dataclass(unsafe_hash=True)
class PatchAccountError(MoovError):
    data: PatchAccountErrorData = field(hash=False)

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