# @generated by codegen/generate.py from defs/bloomberg.toml — DO NOT EDIT

from __future__ import annotations

from enum import Enum


class Service(str, Enum):
    """Bloomberg service URIs."""

    APIFLDS = "//blp/apiflds"
    """Field metadata service for field info and search (bflds)."""

    BQLSVC = "//blp/bqlsvc"
    """Bloomberg Query Language service (bql)."""

    EXRSVC = "//blp/exrsvc"
    """Excel/Search service for Bloomberg searches (bsrch)."""

    INSTRUMENTS = "//blp/instruments"
    """Instruments service for security lookup (blkp)."""

    MKTBAR = "//blp/mktbar"
    """Real-time streaming OHLC bars (mktbar)."""

    MKTDATA = "//blp/mktdata"
    """Real-time market data subscriptions (subscribe, stream)."""

    MKTDEPTH = "//blp/mktdepthdata"
    """Level 2 market depth / order book data (depth). Requires B-PIPE license."""

    MKTLIST = "//blp/mktlist"
    """Option chains and futures chains (chains). Requires B-PIPE license."""

    MKTVWAP = "//blp/mktvwap"
    """Real-time VWAP subscription service (vwap)."""

    REFDATA = "//blp/refdata"
    """Reference data service for bdp, bdh, bds, bdib, bdtick, beqs, bport."""

    TASVC = "//blp/tasvc"
    """Technical Analysis service for study calculations (bta)."""


class Operation(str, Enum):
    """Bloomberg request operation names."""

    BEQS = "BeqsRequest"
    """Bloomberg Equity Screening (BEQS)."""

    BQL_SEND_QUERY = "sendQuery"
    """Bloomberg Query Language query (bql)."""

    CURVE_LIST = "curveListRequest"
    """List yield curves (bcurves)."""

    EXCEL_GET_GRID = "ExcelGetGridRequest"
    """Bloomberg Search/Excel grid request (bsrch)."""

    FIELD_INFO = "FieldInfoRequest"
    """Get field metadata (type, description)."""

    FIELD_SEARCH = "FieldSearchRequest"
    """Search for fields by keyword."""

    GOVT_LIST = "govtListRequest"
    """List government securities (bgovts)."""

    HISTORICAL_DATA = "HistoricalDataRequest"
    """Historical time series data (bdh)."""

    INSTRUMENT_LIST = "instrumentListRequest"
    """Security lookup by name (blkp)."""

    INTRADAY_BAR = "IntradayBarRequest"
    """Intraday OHLCV bars (bdib)."""

    INTRADAY_TICK = "IntradayTickRequest"
    """Intraday tick data (bdtick)."""

    PORTFOLIO_DATA = "PortfolioDataRequest"
    """Portfolio data request (bport)."""

    RAW_REQUEST = ""
    """Raw session.sendRequest() call (no operation name needed)."""

    REFERENCE_DATA = "ReferenceDataRequest"
    """Single point-in-time data (bdp, bds)."""

    STUDY_REQUEST = "studyRequest"
    """Technical analysis study request (bta)."""


class ExtractorHint(str, Enum):
    """Hint for which Arrow extractor to use."""

    BQL = "bql"
    """BQL: Bloomberg Query Language responses."""

    BSRCH = "bsrch"
    """BSRCH: Bloomberg Search responses."""

    BULK = "bulk"
    """Bulk data extractor: [ticker, field, row_idx, col1, col2, ...]"""

    FIELD_INFO = "fieldinfo"
    """Field info extractor: [field, type, description, category]"""

    GENERIC = "generic"
    """Generic flattener: [path, type, value_str, value_num, value_date]"""

    HISTDATA = "histdata"
    """Historical data extractor: [ticker, date, field, value, ...]"""

    INTRADAY_BAR = "intraday_bar"
    """Intraday bar extractor: [ticker, time, open, high, low, close, volume, ...]"""

    INTRADAY_TICK = "intraday_tick"
    """Intraday tick extractor: [ticker, time, type, value, size, ...]"""

    REFDATA = "refdata"
    """Reference data extractor: [ticker, field, value, ...]"""


class Format(str, Enum):
    """Output format for reference data."""

    LONG = "long"
    """Long format with all values as strings (default, backwards-compatible)."""

    LONG_TYPED = "long_typed"
    """Long format with typed value columns."""

    LONG_WITH_METADATA = "long_metadata"
    """Long format with string values and dtype metadata column."""

    SEMI_LONG = "semi_long"
    """Semi-long format with one row per ticker/timestamp and fields as columns."""


class OutputMode(str, Enum):
    """Output mode for generic requests."""

    ARROW = "arrow"
    """Convert to Arrow RecordBatch using appropriate extractor."""

    JSON = "json"
    """Return raw JSON as a single-column Arrow table."""
