"""Pydantic models for GA4GH htsget v1.3."""

from __future__ import annotations

from enum import Enum

from ai4gh.core.types import GA4GHBase


class HtsgetFormat(str, Enum):
    """htsget data formats."""

    BAM = "BAM"
    CRAM = "CRAM"
    VCF = "VCF"
    BCF = "BCF"


class HtsgetClass(str, Enum):
    """htsget data class (for partial retrieval)."""

    header = "header"
    body = "body"


class HtsgetURL(GA4GHBase):
    """A URL entry in an htsget ticket."""

    url: str
    headers: dict[str, str] | None = None
    data_class: HtsgetClass | None = None


class HtsgetTicketData(GA4GHBase):
    """The htsget response data object."""

    format: HtsgetFormat
    urls: list[HtsgetURL]
    md5: str | None = None


class HtsgetTicket(GA4GHBase):
    """htsget ticket response (top-level)."""

    htsget: HtsgetTicketData
