# generated by datamodel-codegen:
#   filename:  openapi.json
#   timestamp: 2026-02-22T16:52:42+00:00

from __future__ import annotations
from pydantic import BaseModel, Extra, Field
from typing import Any


class DeliveryPointSchemaSchema(BaseModel):
    active: bool | None = Field(True, title='Active')
    address: str | None = Field(None, title='Address')
    description: str | None = Field(None, title='Description')
    id: str = Field(..., title='Id')
    tariff: str | None = Field(None, title='Tariff')
    type: str = Field(..., title='Type')


class DescriptorSpecSchemaSchema(BaseModel):
    client: str | None = Field('dataset_api', description='Fetcher client', title='Client')
    id: str = Field(..., description='Fetcher ID (domain-scoped).', title='Id')
    limit: int | None = Field(100, description='Query limit', title='Limit')
    offset: int | None = Field(0, description='Query offset', title='Offset')
    output_mapper: str | None = Field(..., description='Payload mapper', title='Output Mapper')
    payload_schema: dict[str, Any] | None = Field(None, description='Payload schema', title='Payload Schema')
    query: str | None = Field('', description='Query', title='Query')


class FetchResultSchemaSchema(BaseModel):
    """
    Result of a value fetch operation.
    """
    class Config:
        extra = Extra.forbid
    count: int = Field(..., title='Count')
    items: list[dict[str, Any]] = Field(..., title='Items')
    limit: int = Field(..., title='Limit')
    offset: int = Field(..., title='Offset')


class GenericPayloadSchema(BaseModel):
    class Config:
        extra = Extra.allow


class LocationSchemaSchema(BaseModel):
    lat: float = Field(..., title='Lat')
    lon: float = Field(..., title='Lon')


class SimulationDescriptorSchemaSchema(BaseModel):
    description: str | None = Field(None, title='Description')
    key: str = Field(..., description='Simulation key.', title='Key')
    meta: GenericPayloadSchema
    title: str | None = Field(None, title='Title')


class SummaryResponseSchemaSchema(BaseModel):
    payload: GenericPayloadSchema


class TopologyNodeSchemaSchema(BaseModel):
    area: dict[str, Any] | None = Field(None, title='TopologyNodeArea')
    id: str = Field(..., title='Id')
    name: str | None = Field(None, title='Name')
    operator: str | None = Field(None, title='Operator')
    parent: str | None = Field(None, title='Parent')
    type: str = Field(..., title='Type')


class UserAssetSchemaSchema(BaseModel):
    asset_type: str = Field(..., title='Asset Type')
    device: dict[str, Any] | None = Field(None, title='UserAssetDevice')
    key: str = Field(..., title='Key')
    name: str = Field(..., title='Name')
    properties: dict[str, Any] | None = Field(None, title='UserAssetProperties')
    relationships: dict[str, Any] | None = Field(None, title='UserAssetRelationships')
    sensor_id: str | None = Field(None, title='Sensor Id')


class UserAssetsResponseSchemaSchema(BaseModel):
    items: list[UserAssetSchemaSchema] = Field(..., title='Items')
    total: int = Field(..., title='Total')


class UserCommunitySummarySchemaSchema(BaseModel):
    description: str | None = Field(None, title='Description')
    key: str = Field(..., title='Key')
    name: str = Field(..., title='Name')


class UserDeliveryPointsResponseSchemaSchema(BaseModel):
    items: list[DeliveryPointSchemaSchema] = Field(..., title='Items')
    total: int = Field(..., title='Total')


class UserMemberDetailSchemaSchema(BaseModel):
    area: str = Field(..., title='Area')
    created_at: str | None = Field(None, title='Created At')
    delivery_points: list[DeliveryPointSchemaSchema] | None = Field(None, title='Delivery Points')
    extra: dict[str, Any] | None = Field(None, title='UserMemberDetailExtra')
    key: str = Field(..., title='Key')
    name: str = Field(..., title='Name')
    role: str = Field(..., title='Role')
    status: str = Field(..., title='Status')
    updated_at: str | None = Field(None, title='Updated At')


class UserMemberSummarySchemaSchema(BaseModel):
    area: str = Field(..., title='Area')
    key: str = Field(..., title='Key')
    name: str = Field(..., title='Name')
    role: str = Field(..., title='Role')
    status: str = Field(..., title='Status')


class UserMembershipSchemaSchema(BaseModel):
    assets_count: dict[str, int] | None = Field(None, title='UserMembershipAssetsCount')
    community: UserCommunitySummarySchemaSchema
    delivery_points_count: int | None = Field(0, title='Delivery Points Count')
    member: UserMemberSummarySchemaSchema


class UserProfileSchemaSchema(BaseModel):
    email: str | None = Field(None, title='Email')
    name: str | None = Field(None, title='Name')
    preferred_username: str | None = Field(None, title='Preferred Username')
    sub: str = Field(..., title='Sub')


class ValidationErrorSchema(BaseModel):
    loc: list[str | int] = Field(..., title='Location')
    msg: str = Field(..., title='Message')
    type: str = Field(..., title='Error Type')


class ValueDescriptorSchemaSchema(BaseModel):
    id: str = Field(..., description='Fetcher ID (domain-scoped).', title='Id')
    spec: DescriptorSpecSchemaSchema = Field(..., description='Fetcher specs (domain-scoped).')


class ValuesRequestSchemaSchema(BaseModel):
    payload: GenericPayloadSchema


class AreaSchemaSchema(BaseModel):
    location: LocationSchemaSchema
    name: str = Field(..., title='Name')


class HTTPValidationErrorSchema(BaseModel):
    detail: list[ValidationErrorSchema] | None = Field(None, title='Detail')


class UserCommunityDetailSchemaSchema(BaseModel):
    areas: dict[str, AreaSchemaSchema] | None = Field(None, title='UserCommunityDetailAreas')
    contact: dict[str, Any] | None = Field(None, title='UserCommunityDetailContact')
    description: str | None = Field(None, title='Description')
    key: str = Field(..., title='Key')
    legal: dict[str, Any] | None = Field(None, title='UserCommunityDetailLegal')
    links: dict[str, Any] | None = Field(None, title='UserCommunityDetailLinks')
    name: str = Field(..., title='Name')
    settings: dict[str, Any] | None = Field(None, title='UserCommunityDetailSettings')
    topology: list[TopologyNodeSchemaSchema] | None = Field(None, title='Topology')
    your_area: str = Field(..., title='Your Area')
    your_role: str = Field(..., title='Your Role')


class UserMeResponseSchemaSchema(BaseModel):
    membership: UserMembershipSchemaSchema | None = None
    profile: UserProfileSchemaSchema
