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

from __future__ import annotations
from datetime import datetime
from fermisdk.types import BaseModel
from typing import Dict, List, Optional
from typing_extensions import NotRequired, TypedDict


class NodePropertiesTypedDict(TypedDict):
    type: NotRequired[str]
    presence_percentage: NotRequired[float]
    sample_values: NotRequired[List[str]]


class NodeProperties(BaseModel):
    type: Optional[str] = None

    presence_percentage: Optional[float] = None

    sample_values: Optional[List[str]] = None


class RelationshipDirectionTypedDict(TypedDict):
    source_label: NotRequired[str]
    relationship_type: NotRequired[str]
    target_label: NotRequired[str]
    count: NotRequired[int]
    neo4j_type: NotRequired[str]


class RelationshipDirection(BaseModel):
    source_label: Optional[str] = None

    relationship_type: Optional[str] = None

    target_label: Optional[str] = None

    count: Optional[int] = None

    neo4j_type: Optional[str] = None


class StatisticsTypedDict(TypedDict):
    total_node_labels: NotRequired[int]
    total_relationship_types: NotRequired[int]
    total_nodes: NotRequired[int]
    total_relationships: NotRequired[int]


class Statistics(BaseModel):
    total_node_labels: Optional[int] = None

    total_relationship_types: Optional[int] = None

    total_nodes: Optional[int] = None

    total_relationships: Optional[int] = None


class VisualizationResponseJSONMetadataTypedDict(TypedDict):
    pass


class VisualizationResponseJSONMetadata(BaseModel):
    pass


class VisualizationResponseJSONTypedDict(TypedDict):
    tenant_id: NotRequired[str]
    user_id: NotRequired[str]
    extracted_at: NotRequired[datetime]
    sample_size: NotRequired[int]
    node_labels: NotRequired[List[str]]
    relationship_types: NotRequired[List[str]]
    node_properties: NotRequired[Dict[str, Dict[str, NodePropertiesTypedDict]]]
    node_counts: NotRequired[Dict[str, int]]
    relationship_directions: NotRequired[List[RelationshipDirectionTypedDict]]
    relationship_counts: NotRequired[Dict[str, int]]
    statistics: NotRequired[StatisticsTypedDict]
    metadata: NotRequired[VisualizationResponseJSONMetadataTypedDict]


class VisualizationResponseJSON(BaseModel):
    tenant_id: Optional[str] = None

    user_id: Optional[str] = None

    extracted_at: Optional[datetime] = None

    sample_size: Optional[int] = None

    node_labels: Optional[List[str]] = None

    relationship_types: Optional[List[str]] = None

    node_properties: Optional[Dict[str, Dict[str, NodeProperties]]] = None

    node_counts: Optional[Dict[str, int]] = None

    relationship_directions: Optional[List[RelationshipDirection]] = None

    relationship_counts: Optional[Dict[str, int]] = None

    statistics: Optional[Statistics] = None

    metadata: Optional[VisualizationResponseJSONMetadata] = None
