# generated by datamodel-codegen:
#   filename:  extensions/extension_meta.json
#   timestamp: 2026-02-23T01:56:40+00:00

from __future__ import annotations

from typing import Annotated, Any, Literal

from adcp.types.base import AdCPBaseModel
from pydantic import AnyUrl, Field


class AdcpExtensionFileSchema(AdCPBaseModel):
    field_schema: Annotated[
        Literal['http://json-schema.org/draft-07/schema#'], Field(alias='$schema')
    ]
    additionalProperties: Annotated[
        Any | None,
        Field(description='Whether additional properties are allowed in the extension data'),
    ] = None
    description: Annotated[str, Field(description='Description of what this extension provides')]
    docs_url: Annotated[
        AnyUrl | None, Field(description='URL to documentation for implementors of this extension')
    ] = None
    properties: Annotated[
        dict[str, Any],
        Field(description='Schema properties defining the structure of ext.{namespace} data'),
    ]
    required: Annotated[
        list[str] | None, Field(description='Required properties within the extension data')
    ] = None
    title: Annotated[str, Field(description='Human-readable title for the extension')]
    type: Annotated[
        Literal['object'],
        Field(description='Extensions must be objects (data within ext.{namespace})'),
    ]
    valid_from: Annotated[
        str,
        Field(
            description="Minimum AdCP version this extension is compatible with (e.g., '2.5'). Extension will be included in all versioned schema builds >= this version.",
            pattern='^\\d+\\.\\d+$',
        ),
    ]
    valid_until: Annotated[
        str | None,
        Field(
            description="Last AdCP version this extension is compatible with (e.g., '3.0'). Omit if extension is still valid for current and future versions.",
            pattern='^\\d+\\.\\d+$',
        ),
    ] = None
