"""Internal types for streaming transcription mixin."""

from __future__ import annotations

from dataclasses import dataclass

import grpc


@dataclass
class StreamSessionInit:
    """Result of stream session initialization."""

    next_segment_id: int
    error_code: grpc.StatusCode | None = None
    error_message: str | None = None

    @property
    def success(self) -> bool:
        """Check if initialization succeeded."""
        return self.error_code is None
