# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501

import enum
import os
import pathlib
import typing

from nautilus_trader import model

__all__ = [
    "DatabentoDataClientConfig",
    "DatabentoDataClientFactory",
    "DatabentoDataLoader",
    "DatabentoImbalance",
    "DatabentoPublisher",
    "DatabentoStatisticType",
    "DatabentoStatisticUpdateAction",
    "DatabentoStatistics",
    "get_databento_arrow_schema_map",
]

@typing.final
class DatabentoDataClient:
    def __init__(
        self,
        client_id: model.ClientId,
        api_key: str,
        publishers_filepath: str | os.PathLike | pathlib.Path,
        use_exchange_as_venue: bool = True,
        bars_timestamp_on_close: bool = True,
    ) -> None: ...
    @property
    def client_id(self) -> model.ClientId: ...
    @property
    def is_connected(self) -> bool: ...
    @property
    def is_disconnected(self) -> bool: ...
    @property
    def api_key(self) -> str: ...
    @property
    def api_key_masked(self) -> str: ...

@typing.final
class DatabentoDataClientConfig:
    @property
    def publishers_filepath(self) -> pathlib.Path: ...
    @property
    def use_exchange_as_venue(self) -> bool: ...
    @property
    def bars_timestamp_on_close(self) -> bool: ...
    @property
    def venue_dataset_map(self) -> dict[str, str]: ...
    def __init__(
        self,
        api_key: str,
        publishers_filepath: str | os.PathLike | pathlib.Path,
        use_exchange_as_venue: bool = False,
        bars_timestamp_on_close: bool = True,
        venue_dataset_map: typing.Mapping[str, str] | None = None,
    ) -> None: ...

@typing.final
class DatabentoDataClientFactory:
    def __init__(self) -> None: ...
    def name(self) -> str: ...
    @staticmethod
    def create_live_data_client(
        client_id: model.ClientId,
        api_key: str,
        publishers_filepath: str | os.PathLike | pathlib.Path,
        use_exchange_as_venue: bool = True,
        bars_timestamp_on_close: bool = True,
    ) -> DatabentoDataClient: ...

@typing.final
class DatabentoDataLoader:
    def __init__(
        self, publishers_filepath: str | os.PathLike | pathlib.Path | None = None
    ) -> None: ...
    def load_publishers(self, publishers_filepath: str | os.PathLike | pathlib.Path) -> None: ...
    def get_publishers(self) -> dict[int, DatabentoPublisher]: ...
    def set_dataset_for_venue(self, dataset: str, venue: model.Venue) -> None: ...
    def get_dataset_for_venue(self, venue: model.Venue) -> str | None: ...
    def get_venue_for_publisher(self, publisher_id: int) -> str | None: ...
    def set_price_precision(self, symbol: str, price_precision: int) -> None: ...
    def get_price_precisions(self) -> dict[str, int]: ...
    def schema_for_file(self, filepath: str | os.PathLike | pathlib.Path) -> str | None: ...
    def load_instruments(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        use_exchange_as_venue: bool,
        skip_on_error: bool = False,
        expiration_overrides: typing.Mapping[str, typing.Mapping[str, str]] | None = None,
    ) -> typing.Any: ...
    def load_order_book_deltas(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
    ) -> list[model.OrderBookDelta]: ...
    def load_order_book_depth10(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
    ) -> list[model.OrderBookDepth10]: ...
    def load_quotes(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
    ) -> list[model.QuoteTick]: ...
    def load_bbo_quotes(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
    ) -> list[model.QuoteTick]: ...
    def load_cmbp_quotes(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
    ) -> list[model.QuoteTick]: ...
    def load_cbbo_quotes(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
    ) -> list[model.QuoteTick]: ...
    def load_tbbo_trades(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
    ) -> list[model.TradeTick]: ...
    def load_tcbbo_trades(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
    ) -> list[model.TradeTick]: ...
    def load_trades(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
    ) -> list[model.TradeTick]: ...
    def load_bars(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
        timestamp_on_close: bool = True,
    ) -> list[model.Bar]: ...
    def load_status(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
    ) -> list[model.InstrumentStatus]: ...
    def load_imbalance(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
    ) -> list[DatabentoImbalance]: ...
    def load_statistics(
        self,
        filepath: str | os.PathLike | pathlib.Path,
        instrument_id: model.InstrumentId | None = None,
        price_precision: int | None = None,
    ) -> list[DatabentoStatistics]: ...

@typing.final
class DatabentoHistoricalClient:
    def __init__(
        self,
        key: str,
        publishers_filepath: str | os.PathLike | pathlib.Path,
        use_exchange_as_venue: bool,
    ) -> None: ...
    @property
    def api_key(self) -> str: ...
    def set_price_precision(self, symbol: str, price_precision: int) -> None: ...
    def get_dataset_range(self, dataset: str) -> typing.Any: ...
    def get_range_instruments(
        self,
        dataset: str,
        instrument_ids: typing.Sequence[model.InstrumentId],
        start: int,
        end: int | None = None,
        limit: int | None = None,
    ) -> typing.Any: ...
    def get_range_quotes(
        self,
        dataset: str,
        instrument_ids: typing.Sequence[model.InstrumentId],
        start: int,
        end: int | None = None,
        limit: int | None = None,
        price_precision: int | None = None,
        schema: str | None = None,
    ) -> typing.Any: ...
    def get_range_trades(
        self,
        dataset: str,
        instrument_ids: typing.Sequence[model.InstrumentId],
        start: int,
        end: int | None = None,
        limit: int | None = None,
        price_precision: int | None = None,
        schema: str | None = None,
    ) -> typing.Any: ...
    def get_range_bars(
        self,
        dataset: str,
        instrument_ids: typing.Sequence[model.InstrumentId],
        aggregation: model.BarAggregation,
        start: int,
        end: int | None = None,
        limit: int | None = None,
        price_precision: int | None = None,
        timestamp_on_close: bool = True,
    ) -> typing.Any: ...
    def get_order_book_depth10(
        self,
        dataset: str,
        instrument_ids: typing.Sequence[model.InstrumentId],
        start: int,
        end: int | None = None,
        depth: int | None = None,
    ) -> typing.Any: ...
    def get_range_order_book_deltas(
        self,
        dataset: str,
        instrument_ids: typing.Sequence[model.InstrumentId],
        start: int,
        end: int | None = None,
        limit: int | None = None,
        price_precision: int | None = None,
    ) -> typing.Any: ...
    def get_range_imbalance(
        self,
        dataset: str,
        instrument_ids: typing.Sequence[model.InstrumentId],
        start: int,
        end: int | None = None,
        limit: int | None = None,
        price_precision: int | None = None,
    ) -> typing.Any: ...
    def get_range_statistics(
        self,
        dataset: str,
        instrument_ids: typing.Sequence[model.InstrumentId],
        start: int,
        end: int | None = None,
        limit: int | None = None,
        price_precision: int | None = None,
    ) -> typing.Any: ...
    def get_range_status(
        self,
        dataset: str,
        instrument_ids: typing.Sequence[model.InstrumentId],
        start: int,
        end: int | None = None,
        limit: int | None = None,
    ) -> typing.Any: ...

@typing.final
class DatabentoImbalance:
    def __hash__(self) -> int: ...
    @property
    def instrument_id(self) -> model.InstrumentId: ...
    @property
    def ref_price(self) -> model.Price: ...
    @property
    def cont_book_clr_price(self) -> model.Price: ...
    @property
    def auct_interest_clr_price(self) -> model.Price: ...
    @property
    def paired_qty(self) -> model.Quantity: ...
    @property
    def total_imbalance_qty(self) -> model.Quantity: ...
    @property
    def side(self) -> model.OrderSide | None: ...
    @property
    def significant_imbalance(self) -> str: ...
    @property
    def ts_event(self) -> int: ...
    @property
    def ts_recv(self) -> int: ...
    @property
    def ts_init(self) -> int: ...
    @staticmethod
    def from_dict(values: dict) -> DatabentoImbalance: ...
    def to_dict(self) -> dict: ...

@typing.final
class DatabentoLiveClient:
    def __init__(
        self,
        key: str,
        dataset: str,
        publishers_filepath: str | os.PathLike | pathlib.Path,
        use_exchange_as_venue: bool,
        bars_timestamp_on_close: bool | None = None,
        reconnect_timeout_mins: int | None = None,
    ) -> None: ...
    @property
    def dataset(self) -> str: ...
    def is_running(self) -> bool: ...
    def is_closed(self) -> bool: ...
    def subscribe(
        self,
        schema: str,
        instrument_ids: typing.Sequence[model.InstrumentId],
        start: int | None = None,
        snapshot: bool | None = None,
        price_precisions: typing.Sequence[int | None] | None = None,
        stype_in: str | None = None,
    ) -> None: ...
    def start(self, callback: typing.Any, callback_pyo3: typing.Any) -> typing.Any: ...
    def close(self) -> None: ...

@typing.final
class DatabentoPublisher: ...

@typing.final
class DatabentoStatistics:
    def __hash__(self) -> int: ...
    @property
    def instrument_id(self) -> model.InstrumentId: ...
    @property
    def stat_type(self) -> DatabentoStatisticType: ...
    @property
    def update_action(self) -> DatabentoStatisticUpdateAction: ...
    @property
    def price(self) -> model.Price | None: ...
    @property
    def quantity(self) -> model.Quantity | None: ...
    @property
    def channel_id(self) -> int: ...
    @property
    def stat_flags(self) -> int: ...
    @property
    def sequence(self) -> int: ...
    @property
    def ts_ref(self) -> int: ...
    @property
    def ts_in_delta(self) -> int: ...
    @property
    def ts_event(self) -> int: ...
    @property
    def ts_recv(self) -> int: ...
    @property
    def ts_init(self) -> int: ...
    @staticmethod
    def from_dict(values: dict) -> DatabentoStatistics: ...
    def to_dict(self) -> dict: ...

@typing.final
class DatabentoSubscriptionAck: ...

@typing.final
class DatabentoStatisticType(enum.Enum):
    OPENING_PRICE = ...
    INDICATIVE_OPENING_PRICE = ...
    SETTLEMENT_PRICE = ...
    TRADING_SESSION_LOW_PRICE = ...
    TRADING_SESSION_HIGH_PRICE = ...
    CLEARED_VOLUME = ...
    LOWEST_OFFER = ...
    HIGHEST_BID = ...
    OPEN_INTEREST = ...
    FIXING_PRICE = ...
    CLOSE_PRICE = ...
    NET_CHANGE = ...
    VWAP = ...
    VOLATILITY = ...
    DELTA = ...
    UNCROSSING_PRICE = ...
    UPPER_PRICE_LIMIT = ...
    LOWER_PRICE_LIMIT = ...
    BLOCK_VOLUME = ...
    INDICATIVE_CLOSE_PRICE = ...

    def __init__(self, value: typing.Any) -> None: ...
    def __hash__(self) -> int: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> int: ...
    @classmethod
    def from_str(cls, data: typing.Any) -> DatabentoStatisticType: ...

@typing.final
class DatabentoStatisticUpdateAction(enum.Enum):
    ADDED = ...
    DELETED = ...

    def __init__(self, value: typing.Any) -> None: ...
    def __hash__(self) -> int: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> int: ...
    @classmethod
    def from_str(cls, data: typing.Any) -> DatabentoStatisticUpdateAction: ...

def get_databento_arrow_schema_map(cls: type) -> typing.Any: ...
