"""Typed gRPC client for the `{{ service_name }}` service.

Generated by ``tonin service new --lang python``. Hand-editing this
file is fine — ``codegen.sh`` regenerates the ``_pb`` module from
``../proto/*.proto`` but does NOT touch the items below it.

Client-side primitives
======================

This package re-exports the shared ``tonin_client`` surface so peer
services can write one ``from {{ service_name_snake }}_client import *``
and get everything they need to call ``{{ service_name }}`` with auth,
retries, and circuit breakers configured::

    from {{ service_name_snake }}_client import (
        {{ ServiceCamel }}Stub,
        HelloRequest,
        AuthCtx,
        RetryPolicy,
    )

    import grpc
    channel = grpc.aio.insecure_channel("{{ service_name }}:50051")
    stub = {{ ServiceCamel }}Stub(channel)

    metadata: list[tuple[str, str]] = []
    AuthCtx.from_bearer(my_token).propagate(metadata)
    reply = await stub.SayHello(HelloRequest(name="world"), metadata=metadata)

As the framework grows additional client-side patterns (retries,
circuit breakers, hedging), they land in ``tonin_client`` and become
available here without touching this generated file.
"""

from __future__ import annotations

# Generated stubs. `_pb/` is populated by `codegen.sh`.
from {{ service_name_snake }}_client._pb.{{ service_name_snake }}_pb2 import (
    HelloReply,
    HelloRequest,
)
from {{ service_name_snake }}_client._pb.{{ service_name_snake }}_pb2_grpc import (
    {{ ServiceCamel }}Stub,
)

# Shared client-side primitives from `tonin_client`. Re-exported at
# the top level so peers don't need to learn the two-package split.
from tonin_client.auth import AuthCtx, AuthError, PrincipalKind, RawToken
from tonin_client.breaker import CircuitBreaker
from tonin_client.retry import Backoff, RetryPolicy

__all__ = [
    "AuthCtx",
    "AuthError",
    "Backoff",
    "CircuitBreaker",
    "{{ ServiceCamel }}Stub",
    "HelloReply",
    "HelloRequest",
    "PrincipalKind",
    "RawToken",
    "RetryPolicy",
]
