# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

try:
    from . import asr_pb2 as asr__pb2
except ImportError:
    import asr_pb2 as asr__pb2

GRPC_GENERATED_VERSION = '1.76.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + ' but the generated code in asr_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class ASRServiceStub(object):
    """ASR Service Definition
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.CreateSession = channel.unary_unary(
                '/asr.ASRService/CreateSession',
                request_serializer=asr__pb2.CreateSessionRequest.SerializeToString,
                response_deserializer=asr__pb2.CreateSessionResponse.FromString,
                _registered_method=True)
        self.Transcribe = channel.unary_unary(
                '/asr.ASRService/Transcribe',
                request_serializer=asr__pb2.TranscribeRequest.SerializeToString,
                response_deserializer=asr__pb2.TranscribeResponse.FromString,
                _registered_method=True)
        self.DestroySession = channel.unary_unary(
                '/asr.ASRService/DestroySession',
                request_serializer=asr__pb2.DestroySessionRequest.SerializeToString,
                response_deserializer=asr__pb2.Empty.FromString,
                _registered_method=True)
        self.GetStats = channel.unary_unary(
                '/asr.ASRService/GetStats',
                request_serializer=asr__pb2.Empty.SerializeToString,
                response_deserializer=asr__pb2.StatsResponse.FromString,
                _registered_method=True)


class ASRServiceServicer(object):
    """ASR Service Definition
    """

    def CreateSession(self, request, context):
        """Create a new ASR session
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Transcribe(self, request, context):
        """Transcribe audio chunks to text
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DestroySession(self, request, context):
        """Destroy an ASR session
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetStats(self, request, context):
        """Get service stats
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ASRServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateSession': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateSession,
                    request_deserializer=asr__pb2.CreateSessionRequest.FromString,
                    response_serializer=asr__pb2.CreateSessionResponse.SerializeToString,
            ),
            'Transcribe': grpc.unary_unary_rpc_method_handler(
                    servicer.Transcribe,
                    request_deserializer=asr__pb2.TranscribeRequest.FromString,
                    response_serializer=asr__pb2.TranscribeResponse.SerializeToString,
            ),
            'DestroySession': grpc.unary_unary_rpc_method_handler(
                    servicer.DestroySession,
                    request_deserializer=asr__pb2.DestroySessionRequest.FromString,
                    response_serializer=asr__pb2.Empty.SerializeToString,
            ),
            'GetStats': grpc.unary_unary_rpc_method_handler(
                    servicer.GetStats,
                    request_deserializer=asr__pb2.Empty.FromString,
                    response_serializer=asr__pb2.StatsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'asr.ASRService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('asr.ASRService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class ASRService(object):
    """ASR Service Definition
    """

    @staticmethod
    def CreateSession(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/asr.ASRService/CreateSession',
            asr__pb2.CreateSessionRequest.SerializeToString,
            asr__pb2.CreateSessionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Transcribe(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/asr.ASRService/Transcribe',
            asr__pb2.TranscribeRequest.SerializeToString,
            asr__pb2.TranscribeResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DestroySession(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/asr.ASRService/DestroySession',
            asr__pb2.DestroySessionRequest.SerializeToString,
            asr__pb2.Empty.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetStats(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/asr.ASRService/GetStats',
            asr__pb2.Empty.SerializeToString,
            asr__pb2.StatsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
