"""Data records and provider protocols for market, reference, and pricing inputs.

This package re-exports the public data-model surface. Source protocols are the
leaf interfaces; provider objects are composite wrappers that delegate to zero
or more sources and return ``None`` or empty tuples when a source is absent.
"""

from __future__ import annotations

from .errors import (
    AlreadyExistsError,
    AuthenticationError,
    ConnectionFailureError,
    DatabaseError,
    InternalError,
    InvalidInputError,
    NotFoundError,
    ParseError,
    PermissionDeniedError,
    RateLimitError,
    SerializationError,
    SourceUnavailableError,
    SubscriptionFailureError,
    TraitError,
    TraitIOError,
    TraitTimeoutError,
    _deprecated_error_alias,
)
from .ids import CurrencyPair, CurveId, EtfId, InstrumentId, PortfolioId, VolSurfaceId, YearMonth
from .market_data import (
    BasisSwapQuote,
    BondQuote,
    BondFutureQuote,
    CdsQuote,
    CurveData,
    CurveInput,
    CurveInputSource,
    CurveInputSet,
    CurveInputs,
    CurveInstrumentType,
    CurvePoint,
    CurveSource,
    EtfHolding,
    EtfQuote,
    EtfQuoteSource,
    FixingSource,
    FxForwardQuote,
    FxRate,
    FxRateSource,
    HaircutQuote,
    IndexFixing,
    IndexFixingSource,
    InflationFixing,
    InflationFixingSource,
    InflationInterpolation,
    InMemoryCurveSource,
    InMemoryEtfQuoteSource,
    InMemoryFixingSource,
    InMemoryFxRateSource,
    InMemoryInflationFixingSource,
    InMemoryQuoteSource,
    InMemoryVolatilitySource,
    MarketDataProvider,
    MarketDataSnapshot,
    PricingDataProvider,
    QuoteSource,
    RawQuote,
    RepoQuote,
    ReferenceCurveSource,
    SourceType,
    SwapQuote,
    VolPoint,
    VolQuoteType,
    VolSurfaceType,
    VolatilitySource,
    VolatilitySurface,
)
from .output import (
    AlertPublisher,
    AnalyticsOutput,
    AnalyticsPublisher,
    BasisSwapQuoteOutput,
    BondQuoteOutput,
    CdsQuoteOutput,
    CurvePublisher,
    EtfAnalyticsOutput,
    EtfPublisher,
    FutureQuoteOutput,
    OutputPublisher,
    PortfolioAnalyticsOutput,
    QuotePublisher,
    RvSignalOutput,
    SwapQuoteOutput,
)
from .pricing_specs import AnalyticsCurves, BenchmarkReference, BidAskSpreadConfig, PricingSpec, QuoteSide
from .reference_data import (
    BondFutureContractReference,
    BondFutureReferenceData,
    BondReferenceData,
    BondReferenceSource,
    BondType,
    CdsReferenceData,
    CallScheduleEntry,
    DeliverableBondReference,
    EtfHoldingsSource,
    FloatingRateTerms,
    FutureReferenceData,
    IssuerReferenceData,
    IssuerReferenceSource,
    IssuerType,
    RatingRecord,
    RatingSource,
    ReferenceDataProvider,
    RepoReferenceData,
    SwapReferenceData,
)

__all__ = [
    "AlertPublisher",
    "AlreadyExistsError",
    "AnalyticsCurves",
    "AnalyticsOutput",
    "AnalyticsPublisher",
    "AuthenticationError",
    "BasisSwapQuote",
    "BasisSwapQuoteOutput",
    "BenchmarkReference",
    "BidAskSpreadConfig",
    "BondQuote",
    "BondFutureQuote",
    "BondFutureContractReference",
    "BondFutureReferenceData",
    "BondQuoteOutput",
    "BondReferenceData",
    "BondReferenceSource",
    "BondType",
    "CdsQuote",
    "CdsQuoteOutput",
    "CdsReferenceData",
    "CallScheduleEntry",
    "ConnectionFailureError",
    "CurrencyPair",
    "CurveData",
    "CurveId",
    "CurveInput",
    "CurveInputSource",
    "CurveInputSet",
    "CurveInputs",
    "CurveInstrumentType",
    "CurvePoint",
    "CurvePublisher",
    "CurveSource",
    "DatabaseError",
    "DeliverableBondReference",
    "EtfAnalyticsOutput",
    "EtfHolding",
    "EtfHoldingsSource",
    "EtfId",
    "EtfPublisher",
    "EtfQuote",
    "EtfQuoteSource",
    "FixingSource",
    "FloatingRateTerms",
    "FutureQuoteOutput",
    "FutureReferenceData",
    "FxForwardQuote",
    "FxRate",
    "FxRateSource",
    "HaircutQuote",
    "IndexFixing",
    "IndexFixingSource",
    "InflationFixing",
    "InflationFixingSource",
    "InflationInterpolation",
    "InMemoryCurveSource",
    "InMemoryEtfQuoteSource",
    "InMemoryFixingSource",
    "InMemoryFxRateSource",
    "InMemoryInflationFixingSource",
    "InMemoryQuoteSource",
    "InMemoryVolatilitySource",
    "InstrumentId",
    "InternalError",
    "InvalidInputError",
    "IssuerReferenceData",
    "IssuerReferenceSource",
    "IssuerType",
    "MarketDataProvider",
    "MarketDataSnapshot",
    "NotFoundError",
    "OutputPublisher",
    "ParseError",
    "PermissionDeniedError",
    "PortfolioAnalyticsOutput",
    "PortfolioId",
    "PricingDataProvider",
    "PricingSpec",
    "QuotePublisher",
    "QuoteSide",
    "QuoteSource",
    "RateLimitError",
    "RatingRecord",
    "RatingSource",
    "RawQuote",
    "RepoQuote",
    "RepoReferenceData",
    "ReferenceCurveSource",
    "ReferenceDataProvider",
    "RvSignalOutput",
    "SerializationError",
    "SourceType",
    "SourceUnavailableError",
    "SubscriptionFailureError",
    "SwapQuote",
    "SwapQuoteOutput",
    "SwapReferenceData",
    "TraitError",
    "TraitIOError",
    "TraitTimeoutError",
    "VolPoint",
    "VolQuoteType",
    "VolSurfaceId",
    "VolSurfaceType",
    "VolatilitySource",
    "VolatilitySurface",
    "YearMonth",
]

_DEPRECATED_ERROR_ALIAS_NAMES = frozenset({"TimeoutError", "IOError", "PermissionError"})


def __getattr__(name: str) -> object:
    """Expose deprecated error aliases at the package level."""
    if name in _DEPRECATED_ERROR_ALIAS_NAMES:
        return _deprecated_error_alias(name, module_name=__name__)
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
