"""
This type stub file was generated by pyright.
"""

from dataclasses import dataclass
from typing import Any, Callable, Dict, Mapping, Optional, Sequence
from typing_extensions import Protocol

"""
This type stub file was generated by pyright.
"""
class Runtime:
    """Runtime for SDK Core."""
    def __init__(self, *, telemetry: TelemetryConfig) -> None:
        """Create SDK Core runtime."""
        ...
    
    def retrieve_buffered_metrics(self) -> Sequence[Any]:
        """Get buffered metrics."""
        ...
    
    def write_test_info_log(self, message: str, extra_data: str) -> None:
        """Write a test core log at INFO level."""
        ...
    
    def write_test_debug_log(self, message: str, extra_data: str) -> None:
        """Write a test core log at DEBUG level."""
        ...
    


@dataclass(frozen=True)
class LoggingConfig:
    """Python representation of the Rust struct for logging config."""
    filter: str
    forward_to: Optional[Callable[[Sequence[BufferedLogEntry]], None]]
    ...


@dataclass(frozen=True)
class MetricsConfig:
    """Python representation of the Rust struct for metrics config."""
    opentelemetry: Optional[OpenTelemetryConfig]
    prometheus: Optional[PrometheusConfig]
    buffered_with_size: int
    attach_service_name: bool
    global_tags: Optional[Mapping[str, str]]
    metric_prefix: Optional[str]
    ...


@dataclass(frozen=True)
class OpenTelemetryConfig:
    """Python representation of the Rust struct for OpenTelemetry config."""
    url: str
    headers: Mapping[str, str]
    metric_periodicity_millis: Optional[int]
    metric_temporality_delta: bool
    ...


@dataclass(frozen=True)
class PrometheusConfig:
    """Python representation of the Rust struct for Prometheus config."""
    bind_address: str
    counters_total_suffix: bool
    unit_suffix: bool
    ...


@dataclass(frozen=True)
class TelemetryConfig:
    """Python representation of the Rust struct for telemetry config."""
    logging: Optional[LoggingConfig]
    metrics: Optional[MetricsConfig]
    ...


class BufferedLogEntry(Protocol):
    """A buffered log entry."""
    @property
    def target(self) -> str:
        """Target category for the log entry."""
        ...
    
    @property
    def message(self) -> str:
        """Log message."""
        ...
    
    @property
    def time(self) -> float:
        """Time as from ``time.time`` since Unix epoch."""
        ...
    
    @property
    def level(self) -> int:
        """Python log level, with trace as 9."""
        ...
    
    @property
    def fields(self) -> Dict[str, Any]:
        """Additional log entry fields.
        Requesting this property performs a conversion from the internal
        representation to the Python representation on every request. Therefore
        callers should store the result instead of repeatedly calling.

        Raises:
            Exception: If the internal representation cannot be converted. This
                should not happen and if it does it is considered a bug in the
                SDK and should be reported.
        """
        ...
    


