# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Dict, List, Union, Optional
from typing_extensions import Literal

from pydantic import Field as FieldInfo

from .._models import BaseModel

__all__ = ["AccountDefinitionsResponse", "FieldDefinitions", "RelationshipDefinitions"]


class FieldDefinitions(BaseModel):
    description: Optional[str] = None

    label: str

    type_configuration: Dict[
        str,
        Union[
            str,
            float,
            bool,
            List[Union[str, float, bool, List[Optional[object]], Dict[str, object], None]],
            Dict[str, Union[str, float, bool, List[Optional[object]], Dict[str, object], None]],
            None,
        ],
    ] = FieldInfo(alias="typeConfiguration")

    value_type: str = FieldInfo(alias="valueType")

    id: Optional[str] = None


class RelationshipDefinitions(BaseModel):
    cardinality: Literal["HAS_ONE", "HAS_MANY"]

    description: Optional[str] = None

    label: str

    object_type: str = FieldInfo(alias="objectType")

    id: Optional[str] = None


class AccountDefinitionsResponse(BaseModel):
    field_definitions: Dict[str, FieldDefinitions] = FieldInfo(alias="fieldDefinitions")

    object_type: str = FieldInfo(alias="objectType")

    relationship_definitions: Dict[str, RelationshipDefinitions] = FieldInfo(alias="relationshipDefinitions")
