# -*- coding: utf-8 -*-
# Generated by https://github.com/verloop/twirpy/protoc-gen-twirpy.  DO NOT EDIT!
# source: livekit_analytics.proto

from google.protobuf import symbol_database as _symbol_database
from twirp.base import Endpoint
from twirp.client import TwirpClient
from twirp.server import TwirpServer

_sym_db = _symbol_database.Default()


class AnalyticsRecorderServiceServer(TwirpServer):
    def __init__(self, *args, service, server_path_prefix="/twirp"):
        super().__init__(service=service)
        self._prefix = f"{server_path_prefix}/livekit.AnalyticsRecorderService"
        self._endpoints = {
            "IngestStats": Endpoint(
                service_name="AnalyticsRecorderService",
                name="IngestStats",
                function=getattr(service, "IngestStats"),
                input=_sym_db.GetSymbol("livekit.AnalyticsStats"),
                output=_sym_db.GetSymbol("google.protobuf.Empty"),
            ),
            "IngestEvents": Endpoint(
                service_name="AnalyticsRecorderService",
                name="IngestEvents",
                function=getattr(service, "IngestEvents"),
                input=_sym_db.GetSymbol("livekit.AnalyticsEvents"),
                output=_sym_db.GetSymbol("google.protobuf.Empty"),
            ),
        }


class AnalyticsRecorderServiceClient(TwirpClient):
    def IngestStats(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.AnalyticsRecorderService/IngestStats",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("google.protobuf.Empty"),
            **kwargs,
        )

    def IngestEvents(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
        return self._make_request(
            url=f"{server_path_prefix}/livekit.AnalyticsRecorderService/IngestEvents",
            ctx=ctx,
            request=request,
            response_obj=_sym_db.GetSymbol("google.protobuf.Empty"),
            **kwargs,
        )
