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

from . import speech_to_text_pb2 as speech__to__text__pb2


class SpeechToTextStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.Recognize = channel.unary_unary(
                '/speech_to_text.SpeechToText/Recognize',
                request_serializer=speech__to__text__pb2.RecognizeRequest.SerializeToString,
                response_deserializer=speech__to__text__pb2.RecognizeResponse.FromString,
                )
        self.StreamingRecognize = channel.stream_stream(
                '/speech_to_text.SpeechToText/StreamingRecognize',
                request_serializer=speech__to__text__pb2.StreamingRecognizeRequest.SerializeToString,
                response_deserializer=speech__to__text__pb2.StreamingRecognizeResponse.FromString,
                )
        self.LongRunningRecognize = channel.unary_unary(
                '/speech_to_text.SpeechToText/LongRunningRecognize',
                request_serializer=speech__to__text__pb2.LongRunningRecognizeRequest.SerializeToString,
                response_deserializer=speech__to__text__pb2.SpeechOperation.FromString,
                )
        self.GetSpeechOperation = channel.unary_unary(
                '/speech_to_text.SpeechToText/GetSpeechOperation',
                request_serializer=speech__to__text__pb2.SpeechOperationRequest.SerializeToString,
                response_deserializer=speech__to__text__pb2.SpeechOperation.FromString,
                )


class SpeechToTextServicer(object):
    """Missing associated documentation comment in .proto file."""

    def Recognize(self, request, context):
        """Performs synchronous non-streaming speech recognition
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamingRecognize(self, request_iterator, context):
        """Performs bidirectional streaming speech recognition: receive results while
        sending audio. This method is only available via the gRPC API (not REST).
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def LongRunningRecognize(self, request, context):
        """Performs asynchronous non-streaming speech recognition
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetSpeechOperation(self, request, context):
        """Returns SpeechOperation for LongRunningRecognize. Used for polling the result
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SpeechToTextServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Recognize': grpc.unary_unary_rpc_method_handler(
                    servicer.Recognize,
                    request_deserializer=speech__to__text__pb2.RecognizeRequest.FromString,
                    response_serializer=speech__to__text__pb2.RecognizeResponse.SerializeToString,
            ),
            'StreamingRecognize': grpc.stream_stream_rpc_method_handler(
                    servicer.StreamingRecognize,
                    request_deserializer=speech__to__text__pb2.StreamingRecognizeRequest.FromString,
                    response_serializer=speech__to__text__pb2.StreamingRecognizeResponse.SerializeToString,
            ),
            'LongRunningRecognize': grpc.unary_unary_rpc_method_handler(
                    servicer.LongRunningRecognize,
                    request_deserializer=speech__to__text__pb2.LongRunningRecognizeRequest.FromString,
                    response_serializer=speech__to__text__pb2.SpeechOperation.SerializeToString,
            ),
            'GetSpeechOperation': grpc.unary_unary_rpc_method_handler(
                    servicer.GetSpeechOperation,
                    request_deserializer=speech__to__text__pb2.SpeechOperationRequest.FromString,
                    response_serializer=speech__to__text__pb2.SpeechOperation.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'speech_to_text.SpeechToText', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class SpeechToText(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def Recognize(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, '/speech_to_text.SpeechToText/Recognize',
            speech__to__text__pb2.RecognizeRequest.SerializeToString,
            speech__to__text__pb2.RecognizeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def StreamingRecognize(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/speech_to_text.SpeechToText/StreamingRecognize',
            speech__to__text__pb2.StreamingRecognizeRequest.SerializeToString,
            speech__to__text__pb2.StreamingRecognizeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def LongRunningRecognize(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, '/speech_to_text.SpeechToText/LongRunningRecognize',
            speech__to__text__pb2.LongRunningRecognizeRequest.SerializeToString,
            speech__to__text__pb2.SpeechOperation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetSpeechOperation(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, '/speech_to_text.SpeechToText/GetSpeechOperation',
            speech__to__text__pb2.SpeechOperationRequest.SerializeToString,
            speech__to__text__pb2.SpeechOperation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
